]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10336, upgrading YUI to 2.3.0
authortoyomoyo <toyomoyo>
Thu, 2 Aug 2007 09:13:40 +0000 (09:13 +0000)
committertoyomoyo <toyomoyo>
Thu, 2 Aug 2007 09:13:40 +0000 (09:13 +0000)
223 files changed:
lib/yui/animation/README
lib/yui/animation/animation-debug.js
lib/yui/animation/animation-min.js
lib/yui/animation/animation.js
lib/yui/assets/skins/sam/autocomplete.css [new file with mode: 0755]
lib/yui/assets/skins/sam/blankimage.png [new file with mode: 0755]
lib/yui/assets/skins/sam/button.css [new file with mode: 0755]
lib/yui/assets/skins/sam/calendar.css [new file with mode: 0755]
lib/yui/assets/skins/sam/colorpicker.css [new file with mode: 0755]
lib/yui/assets/skins/sam/container.css [new file with mode: 0755]
lib/yui/assets/skins/sam/datatable.css [new file with mode: 0755]
lib/yui/assets/skins/sam/dt-arrow-dn.png [new file with mode: 0755]
lib/yui/assets/skins/sam/dt-arrow-up.png [new file with mode: 0755]
lib/yui/assets/skins/sam/editor-knob.gif [new file with mode: 0755]
lib/yui/assets/skins/sam/editor-sprite-active.gif [new file with mode: 0755]
lib/yui/assets/skins/sam/editor-sprite.gif [new file with mode: 0755]
lib/yui/assets/skins/sam/editor.css [new file with mode: 0755]
lib/yui/assets/skins/sam/hue_bg.png [new file with mode: 0755]
lib/yui/assets/skins/sam/logger.css [new file with mode: 0755]
lib/yui/assets/skins/sam/menu-button-arrow-disabled.png [new file with mode: 0755]
lib/yui/assets/skins/sam/menu-button-arrow.png [new file with mode: 0755]
lib/yui/assets/skins/sam/menu.css [new file with mode: 0755]
lib/yui/assets/skins/sam/picker_mask.png [new file with mode: 0755]
lib/yui/assets/skins/sam/skin.css [new file with mode: 0755]
lib/yui/assets/skins/sam/split-button-arrow-active.png [new file with mode: 0755]
lib/yui/assets/skins/sam/split-button-arrow-disabled.png [new file with mode: 0755]
lib/yui/assets/skins/sam/split-button-arrow-focus.png [new file with mode: 0755]
lib/yui/assets/skins/sam/split-button-arrow-hover.png [new file with mode: 0755]
lib/yui/assets/skins/sam/split-button-arrow.png [new file with mode: 0755]
lib/yui/assets/skins/sam/sprite.png [new file with mode: 0755]
lib/yui/assets/skins/sam/tabview.css [new file with mode: 0755]
lib/yui/assets/skins/sam/treeview-loading.gif [new file with mode: 0755]
lib/yui/assets/skins/sam/treeview-sprite.gif [new file with mode: 0755]
lib/yui/assets/skins/sam/treeview.css [new file with mode: 0755]
lib/yui/assets/skins/sam/yuitest.css [new file with mode: 0755]
lib/yui/autocomplete/README
lib/yui/autocomplete/assets/autocomplete-core.css [new file with mode: 0755]
lib/yui/autocomplete/assets/skins/sam/autocomplete-skin.css [new file with mode: 0755]
lib/yui/autocomplete/assets/skins/sam/autocomplete.css [new file with mode: 0755]
lib/yui/autocomplete/autocomplete-debug.js
lib/yui/autocomplete/autocomplete-min.js
lib/yui/autocomplete/autocomplete.js
lib/yui/base/README [new file with mode: 0755]
lib/yui/base/base-min.css [new file with mode: 0755]
lib/yui/base/base.css [new file with mode: 0755]
lib/yui/button/README [new file with mode: 0755]
lib/yui/button/assets/background.png [new file with mode: 0755]
lib/yui/button/assets/button-core.css [new file with mode: 0755]
lib/yui/button/assets/button.css [new file with mode: 0755]
lib/yui/button/assets/menuarrow.gif [new file with mode: 0755]
lib/yui/button/assets/skins/sam/button-skin.css [new file with mode: 0755]
lib/yui/button/assets/skins/sam/button.css [new file with mode: 0755]
lib/yui/button/assets/skins/sam/menu-button-arrow-disabled.png [new file with mode: 0755]
lib/yui/button/assets/skins/sam/menu-button-arrow.png [new file with mode: 0755]
lib/yui/button/assets/skins/sam/split-button-arrow-active.png [new file with mode: 0755]
lib/yui/button/assets/skins/sam/split-button-arrow-disabled.png [new file with mode: 0755]
lib/yui/button/assets/skins/sam/split-button-arrow-focus.png [new file with mode: 0755]
lib/yui/button/assets/skins/sam/split-button-arrow-hover.png [new file with mode: 0755]
lib/yui/button/assets/skins/sam/split-button-arrow.png [new file with mode: 0755]
lib/yui/button/assets/splitarrow.gif [new file with mode: 0755]
lib/yui/button/assets/splitarrow_active.gif [new file with mode: 0755]
lib/yui/button/button-beta-debug.js [new file with mode: 0755]
lib/yui/button/button-beta-min.js [new file with mode: 0755]
lib/yui/button/button-beta.js [new file with mode: 0755]
lib/yui/calendar/README
lib/yui/calendar/assets/calendar-core.css [new file with mode: 0755]
lib/yui/calendar/assets/calendar.css
lib/yui/calendar/assets/skins/sam/calendar-skin.css [new file with mode: 0755]
lib/yui/calendar/assets/skins/sam/calendar.css [new file with mode: 0755]
lib/yui/calendar/calendar-debug.js
lib/yui/calendar/calendar-min.js
lib/yui/calendar/calendar.js
lib/yui/colorpicker/README [new file with mode: 0755]
lib/yui/colorpicker/assets/colorpicker_core.css [new file with mode: 0755]
lib/yui/colorpicker/assets/hue_thumb.png [new file with mode: 0755]
lib/yui/colorpicker/assets/picker_mask.png [new file with mode: 0755]
lib/yui/colorpicker/assets/picker_thumb.png [new file with mode: 0755]
lib/yui/colorpicker/assets/skins/sam/colorpicker-skin.css [new file with mode: 0755]
lib/yui/colorpicker/assets/skins/sam/colorpicker.css [new file with mode: 0755]
lib/yui/colorpicker/assets/skins/sam/hue_bg.png [new file with mode: 0755]
lib/yui/colorpicker/assets/skins/sam/picker_mask.png [new file with mode: 0755]
lib/yui/colorpicker/colorpicker-beta-debug.js [new file with mode: 0755]
lib/yui/colorpicker/colorpicker-beta-min.js [new file with mode: 0755]
lib/yui/colorpicker/colorpicker-beta.js [new file with mode: 0755]
lib/yui/connection/README
lib/yui/connection/connection-debug.js
lib/yui/connection/connection-min.js
lib/yui/connection/connection.js
lib/yui/container/README
lib/yui/container/assets/container-core.css [new file with mode: 0755]
lib/yui/container/assets/container.css
lib/yui/container/assets/skins/sam/container-skin.css [new file with mode: 0755]
lib/yui/container/assets/skins/sam/container.css [new file with mode: 0755]
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/datasource/README [new file with mode: 0755]
lib/yui/datasource/datasource-beta-debug.js [new file with mode: 0755]
lib/yui/datasource/datasource-beta-min.js [new file with mode: 0755]
lib/yui/datasource/datasource-beta.js [new file with mode: 0755]
lib/yui/datatable/README [new file with mode: 0755]
lib/yui/datatable/assets/datatable-core.css [new file with mode: 0755]
lib/yui/datatable/assets/datatable.css [new file with mode: 0755]
lib/yui/datatable/assets/skins/sam/datatable-skin.css [new file with mode: 0755]
lib/yui/datatable/assets/skins/sam/datatable.css [new file with mode: 0755]
lib/yui/datatable/assets/skins/sam/dt-arrow-dn.png [new file with mode: 0755]
lib/yui/datatable/assets/skins/sam/dt-arrow-up.png [new file with mode: 0755]
lib/yui/datatable/datatable-beta-debug.js [new file with mode: 0755]
lib/yui/datatable/datatable-beta-min.js [new file with mode: 0755]
lib/yui/datatable/datatable-beta.js [new file with mode: 0755]
lib/yui/dom/README
lib/yui/dom/dom-debug.js
lib/yui/dom/dom-min.js
lib/yui/dom/dom.js
lib/yui/dragdrop/README
lib/yui/dragdrop/dragdrop-debug.js
lib/yui/dragdrop/dragdrop-min.js
lib/yui/dragdrop/dragdrop.js
lib/yui/editor/README [new file with mode: 0755]
lib/yui/editor/assets/editor-core.css [new file with mode: 0755]
lib/yui/editor/assets/skins/sam/blankimage.png [new file with mode: 0755]
lib/yui/editor/assets/skins/sam/editor-knob.gif [new file with mode: 0755]
lib/yui/editor/assets/skins/sam/editor-skin.css [new file with mode: 0755]
lib/yui/editor/assets/skins/sam/editor-sprite-active.gif [new file with mode: 0755]
lib/yui/editor/assets/skins/sam/editor-sprite.gif [new file with mode: 0755]
lib/yui/editor/assets/skins/sam/editor.css [new file with mode: 0755]
lib/yui/editor/editor-beta-debug.js [new file with mode: 0755]
lib/yui/editor/editor-beta-min.js [new file with mode: 0755]
lib/yui/editor/editor-beta.js [new file with mode: 0755]
lib/yui/element/README [new file with mode: 0755]
lib/yui/element/element-beta-debug.js [new file with mode: 0755]
lib/yui/element/element-beta-min.js [new file with mode: 0755]
lib/yui/element/element-beta.js [new file with mode: 0755]
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/history/README [new file with mode: 0755]
lib/yui/history/assets/blank.html [new file with mode: 0755]
lib/yui/history/history-beta-debug.js [new file with mode: 0755]
lib/yui/history/history-beta-min.js [new file with mode: 0755]
lib/yui/history/history-beta.js [new file with mode: 0755]
lib/yui/imageloader/README [new file with mode: 0755]
lib/yui/imageloader/imageloader-experimental-debug.js [new file with mode: 0755]
lib/yui/imageloader/imageloader-experimental-min.js [new file with mode: 0755]
lib/yui/imageloader/imageloader-experimental.js [new file with mode: 0755]
lib/yui/logger/README
lib/yui/logger/assets/logger-core.css [new file with mode: 0755]
lib/yui/logger/assets/logger.css
lib/yui/logger/assets/skins/sam/logger-skin.css [new file with mode: 0755]
lib/yui/logger/assets/skins/sam/logger.css [new file with mode: 0755]
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/map.gif [new file with mode: 0755]
lib/yui/menu/assets/menu-core.css [new file with mode: 0755]
lib/yui/menu/assets/menu.css
lib/yui/menu/assets/skins/sam/menu-skin.css [new file with mode: 0755]
lib/yui/menu/assets/skins/sam/menu.css [new file with mode: 0755]
lib/yui/menu/menu-debug.js
lib/yui/menu/menu-min.js
lib/yui/menu/menu.js
lib/yui/reset-fonts-grids/README
lib/yui/reset-fonts-grids/reset-fonts-grids.css
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
lib/yui/tabview/assets/border_tabs.css
lib/yui/tabview/assets/loading.gif [new file with mode: 0755]
lib/yui/tabview/assets/skin-sam.css [new file with mode: 0755]
lib/yui/tabview/assets/skins/sam/tabview-skin.css [new file with mode: 0755]
lib/yui/tabview/assets/skins/sam/tabview.css [new file with mode: 0755]
lib/yui/tabview/assets/tabview-core.css [new file with mode: 0755]
lib/yui/tabview/assets/tabview.css [new file with mode: 0644]
lib/yui/tabview/tabview-debug.js
lib/yui/tabview/tabview-min.js
lib/yui/tabview/tabview.js
lib/yui/treeview/README
lib/yui/treeview/assets/skins/sam/treeview-loading.gif [new file with mode: 0755]
lib/yui/treeview/assets/skins/sam/treeview-skin.css [new file with mode: 0755]
lib/yui/treeview/assets/skins/sam/treeview-sprite.gif [new file with mode: 0755]
lib/yui/treeview/assets/skins/sam/treeview.css [new file with mode: 0755]
lib/yui/treeview/assets/sprite-orig.gif [new file with mode: 0755]
lib/yui/treeview/assets/treeview-core.css [new file with mode: 0755]
lib/yui/treeview/assets/treeview-loading.gif [new file with mode: 0755]
lib/yui/treeview/assets/treeview.css [new file with mode: 0755]
lib/yui/treeview/treeview-debug.js
lib/yui/treeview/treeview-min.js
lib/yui/treeview/treeview.js
lib/yui/utilities/README
lib/yui/utilities/utilities.js
lib/yui/yahoo-dom-event/yahoo-dom-event.js
lib/yui/yahoo/README
lib/yui/yahoo/yahoo-debug.js
lib/yui/yahoo/yahoo-min.js
lib/yui/yahoo/yahoo.js
lib/yui/yuiloader/README [new file with mode: 0755]
lib/yui/yuiloader/yuiloader-beta-debug.js [new file with mode: 0755]
lib/yui/yuiloader/yuiloader-beta-min.js [new file with mode: 0755]
lib/yui/yuiloader/yuiloader-beta.js [new file with mode: 0755]
lib/yui/yuitest/README [new file with mode: 0755]
lib/yui/yuitest/assets/skins/sam/yuitest-skin.css [new file with mode: 0755]
lib/yui/yuitest/assets/skins/sam/yuitest.css [new file with mode: 0755]
lib/yui/yuitest/assets/testlogger.css [new file with mode: 0755]
lib/yui/yuitest/assets/yuitest-core.css [new file with mode: 0755]
lib/yui/yuitest/yuitest-beta-debug.js [new file with mode: 0755]
lib/yui/yuitest/yuitest-beta-min.js [new file with mode: 0755]
lib/yui/yuitest/yuitest-beta.js [new file with mode: 0755]

index d6ea69a4beb2a4cd4b33ddd136c70cded442a2f7..f5dc0bda215eb7e5a7158815aaefdb4c92bd056a 100755 (executable)
@@ -1,5 +1,23 @@
 Animation Release Notes
 
+*** version 2.3.0 ***
+
+* duration of zero now executes 1 frame animation
+* added setEl() method to enable reuse
+* fixed stop() for multiple animations
+
+*** version 2.2.2 **
+
+* no change
+
+*** version 2.2.1 **
+
+* no change
+
+*** version 2.2.0 **
+
+* Fixed AnimMgr.stop() when called without tween
+
 *** version 0.12.2 ***
 
 * raised AnimMgr.fps to 1000
index 7745b235b76e32a322ee2da1d23ee31b1a476584..4980ffadb3b8f8b101fe6cac4e9a1b8f442dfb6d 100755 (executable)
@@ -1,9 +1,15 @@
 /*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/*
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
 */
+
 /**
  * The animation module provides allows effects to be added to HTMLElements.
  * @module animation
@@ -32,9 +38,10 @@ version: 0.12.2
  */
 
 YAHOO.util.Anim = function(el, attributes, duration, method) {
-    if (el) {
-        this.init(el, attributes, duration, method); 
+    if (!el) {
+        YAHOO.log('element required to create Anim instance', 'error', 'Anim');
     }
+    this.init(el, attributes, duration, method); 
 };
 
 YAHOO.util.Anim.prototype = {
@@ -45,7 +52,7 @@ YAHOO.util.Anim.prototype = {
      */
     toString: function() {
         var el = this.getEl();
-        var id = el.id || el.tagName;
+        var id = el.id || el.tagName || el;
         return ("Anim " + id);
     },
     
@@ -155,10 +162,10 @@ YAHOO.util.Anim.prototype = {
             if (start.constructor == Array) {
                 end = [];
                 for (var i = 0, len = start.length; i < len; ++i) {
-                    end[i] = start[i] + attributes[attr]['by'][i];
+                    end[i] = start[i] + attributes[attr]['by'][i] * 1; // times 1 to cast "by" 
                 }
             } else {
-                end = start + attributes[attr]['by'];
+                end = start + attributes[attr]['by'] * 1;
             }
         }
         
@@ -166,7 +173,9 @@ YAHOO.util.Anim.prototype = {
         this.runtimeAttributes[attr].end = end;
 
         // set units if needed
-        this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ? attributes[attr]['unit'] : this.getDefaultUnit(attr);
+        this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ?
+                attributes[attr]['unit'] : this.getDefaultUnit(attr);
+        return true;
     },
 
     /**
@@ -230,7 +239,7 @@ YAHOO.util.Anim.prototype = {
          * @property duration
          * @type Number
          */
-        this.duration = duration || 1;
+        this.duration = !YAHOO.lang.isUndefined(duration) ? duration : 1;
         
         /**
          * The method that will provide values to the attribute(s) during the animation. 
@@ -264,6 +273,13 @@ YAHOO.util.Anim.prototype = {
          */
         this.totalFrames = YAHOO.util.AnimMgr.fps;
         
+        /**
+         * Changes the animated element
+         * @method setEl
+         */
+        this.setEl = function(element) {
+            el = YAHOO.util.Dom.get(element);
+        };
         
         /**
          * Returns a reference to the animated element.
@@ -310,7 +326,11 @@ YAHOO.util.Anim.prototype = {
             
             this.totalFrames = ( this.useSeconds ) ? Math.ceil(YAHOO.util.AnimMgr.fps * this.duration) : this.duration;
     
+            if (this.duration === 0 && this.useSeconds) {
+                this.totalFrames = 1; // jump to last frame if no duration
+            }
             YAHOO.util.AnimMgr.registerElement(this);
+            return true;
         };
           
         /**
@@ -506,10 +526,18 @@ YAHOO.util.AnimMgr = new function() {
     this.unRegister = function(tween, index) {
         tween._onComplete.fire();
         index = index || getIndex(tween);
-        if (index != -1) { queue.splice(index, 1); }
+        if (index == -1) {
+            return false;
+        }
         
+        queue.splice(index, 1);
+
         tweenCount -= 1;
-        if (tweenCount <= 0) { this.stop(); }
+        if (tweenCount <= 0) {
+            this.stop();
+        }
+
+        return true;
     };
     
     /**
@@ -518,7 +546,9 @@ YAHOO.util.AnimMgr = new function() {
      * @method start
      */    
     this.start = function() {
-        if (thread === null) { thread = setInterval(this.run, this.delay); }
+        if (thread === null) {
+            thread = setInterval(this.run, this.delay);
+        }
     };
 
     /**
@@ -530,11 +560,13 @@ YAHOO.util.AnimMgr = new function() {
     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);  
+                if ( queue[0].isAnimated() ) {
+                    this.unRegister(queue[0], 0);  
                 }
             }
+
             queue = [];
             thread = null;
             tweenCount = 0;
@@ -774,7 +806,8 @@ YAHOO.util.Bezier = new function() {
             this.runtimeAttributes[attr].end = end;
         }
     };
-})();/*
+})();
+/*
 TERMS OF USE - EASING EQUATIONS
 Open source under the BSD License.
 Copyright 2001 Robert Penner All rights reserved.
@@ -1343,3 +1376,4 @@ YAHOO.util.Easing = {
         }
     };
 })();
+YAHOO.register("animation", YAHOO.util.Anim, {version: "2.3.0", build: "442"});
index 9e1291f510366b51fe57b1189097b43876fda7fe..284ff25f750d1caa98312142e44d7892b95dd5ae 100755 (executable)
@@ -1,22 +1,25 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.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.Anim=function(el,attributes,duration,method){if(!el){}
+this.init(el,attributes,duration,method);};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName||el;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}
 YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}
 var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}
 return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}
 return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}
-start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i];}}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();}
+start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i]*1;}}else{end=start+attributes[attr]['by']*1;}}
+this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);return true;},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=!YAHOO.lang.isUndefined(duration)?duration:1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.setEl=function(element){el=YAHOO.util.Dom.get(element);};this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}
+this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}
+YAHOO.util.AnimMgr.registerElement(this);return true;};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}
 YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}
 isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}
-actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index!=-1){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);}}
+actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index==-1){return false;}
+queue.splice(index,1);tweenCount-=1;if(tweenCount<=0){this.stop();}
+return true;};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[0].isAnimated()){this.unRegister(queue[0],0);}}
 queue=[];thread=null;tweenCount=0;}
 else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}
 if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null)
@@ -72,4 +75,4 @@ this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes
 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
+return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.3.0",build:"442"});
\ No newline at end of file
index 3b34cf4af3bd94a2951c772554721a9a342d6382..236d338353a7c43178274f204cb512f2a58d6664 100755 (executable)
@@ -1,9 +1,15 @@
 /*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/*
 Copyright (c) 2006, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
 */
+
 /**
  * The animation module provides allows effects to be added to HTMLElements.
  * @module animation
@@ -32,9 +38,9 @@ version: 0.12.2
  */
 
 YAHOO.util.Anim = function(el, attributes, duration, method) {
-    if (el) {
-        this.init(el, attributes, duration, method); 
+    if (!el) {
     }
+    this.init(el, attributes, duration, method); 
 };
 
 YAHOO.util.Anim.prototype = {
@@ -45,7 +51,7 @@ YAHOO.util.Anim.prototype = {
      */
     toString: function() {
         var el = this.getEl();
-        var id = el.id || el.tagName;
+        var id = el.id || el.tagName || el;
         return ("Anim " + id);
     },
     
@@ -155,10 +161,10 @@ YAHOO.util.Anim.prototype = {
             if (start.constructor == Array) {
                 end = [];
                 for (var i = 0, len = start.length; i < len; ++i) {
-                    end[i] = start[i] + attributes[attr]['by'][i];
+                    end[i] = start[i] + attributes[attr]['by'][i] * 1; // times 1 to cast "by" 
                 }
             } else {
-                end = start + attributes[attr]['by'];
+                end = start + attributes[attr]['by'] * 1;
             }
         }
         
@@ -166,7 +172,9 @@ YAHOO.util.Anim.prototype = {
         this.runtimeAttributes[attr].end = end;
 
         // set units if needed
-        this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ? attributes[attr]['unit'] : this.getDefaultUnit(attr);
+        this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ?
+                attributes[attr]['unit'] : this.getDefaultUnit(attr);
+        return true;
     },
 
     /**
@@ -230,7 +238,7 @@ YAHOO.util.Anim.prototype = {
          * @property duration
          * @type Number
          */
-        this.duration = duration || 1;
+        this.duration = !YAHOO.lang.isUndefined(duration) ? duration : 1;
         
         /**
          * The method that will provide values to the attribute(s) during the animation. 
@@ -264,6 +272,13 @@ YAHOO.util.Anim.prototype = {
          */
         this.totalFrames = YAHOO.util.AnimMgr.fps;
         
+        /**
+         * Changes the animated element
+         * @method setEl
+         */
+        this.setEl = function(element) {
+            el = YAHOO.util.Dom.get(element);
+        };
         
         /**
          * Returns a reference to the animated element.
@@ -307,7 +322,11 @@ YAHOO.util.Anim.prototype = {
             
             this.totalFrames = ( this.useSeconds ) ? Math.ceil(YAHOO.util.AnimMgr.fps * this.duration) : this.duration;
     
+            if (this.duration === 0 && this.useSeconds) {
+                this.totalFrames = 1; // jump to last frame if no duration
+            }
             YAHOO.util.AnimMgr.registerElement(this);
+            return true;
         };
           
         /**
@@ -503,10 +522,18 @@ YAHOO.util.AnimMgr = new function() {
     this.unRegister = function(tween, index) {
         tween._onComplete.fire();
         index = index || getIndex(tween);
-        if (index != -1) { queue.splice(index, 1); }
+        if (index == -1) {
+            return false;
+        }
         
+        queue.splice(index, 1);
+
         tweenCount -= 1;
-        if (tweenCount <= 0) { this.stop(); }
+        if (tweenCount <= 0) {
+            this.stop();
+        }
+
+        return true;
     };
     
     /**
@@ -515,7 +542,9 @@ YAHOO.util.AnimMgr = new function() {
      * @method start
      */    
     this.start = function() {
-        if (thread === null) { thread = setInterval(this.run, this.delay); }
+        if (thread === null) {
+            thread = setInterval(this.run, this.delay);
+        }
     };
 
     /**
@@ -527,11 +556,13 @@ YAHOO.util.AnimMgr = new function() {
     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);  
+                if ( queue[0].isAnimated() ) {
+                    this.unRegister(queue[0], 0);  
                 }
             }
+
             queue = [];
             thread = null;
             tweenCount = 0;
@@ -771,7 +802,8 @@ YAHOO.util.Bezier = new function() {
             this.runtimeAttributes[attr].end = end;
         }
     };
-})();/*
+})();
+/*
 TERMS OF USE - EASING EQUATIONS
 Open source under the BSD License.
 Copyright 2001 Robert Penner All rights reserved.
@@ -999,6 +1031,7 @@ YAHOO.util.Easing = {
                 Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
     },
 
+
     /**
      * Backtracks slightly, then reverses direction and moves to end.
      * @method backIn
@@ -1339,3 +1372,4 @@ YAHOO.util.Easing = {
         }
     };
 })();
+YAHOO.register("animation", YAHOO.util.Anim, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/assets/skins/sam/autocomplete.css b/lib/yui/assets/skins/sam/autocomplete.css
new file mode 100755 (executable)
index 0000000..98b473e
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-skin-sam .yui-ac{position:relative;font-family:arial;font-size:100%;}.yui-skin-sam .yui-ac-input{position:absolute;width:100%;}.yui-skin-sam .yui-ac-container{position:absolute;top:1.6em;width:100%;}.yui-skin-sam .yui-ac-content{position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050;}.yui-skin-sam .yui-ac-shadow{position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity:0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049;}.yui-skin-sam .yui-ac-content ul{margin:0;padding:0;width:100%;}.yui-skin-sam .yui-ac-content li{margin:0;padding:2px 5px;cursor:default;white-space:nowrap;}.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight{background:#B3D4FF;}.yui-skin-sam .yui-ac-content li.yui-ac-highlight{background:#426FD9;color:#FFF;}
diff --git a/lib/yui/assets/skins/sam/blankimage.png b/lib/yui/assets/skins/sam/blankimage.png
new file mode 100755 (executable)
index 0000000..b87bb24
Binary files /dev/null and b/lib/yui/assets/skins/sam/blankimage.png differ
diff --git a/lib/yui/assets/skins/sam/button.css b/lib/yui/assets/skins/sam/button.css
new file mode 100755 (executable)
index 0000000..c1e05f4
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-skin-sam .yui-button{display:-moz-inline-box;display:inline-block;border-width:1px 0;border-style:solid;border-color:#808080;background:url(sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{display:block;*display:inline-block;border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;*position:relative;*left:-1px;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a{display:block;*display:inline-block;padding:0 10px;border:none;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button button{*overflow:visible;background-color:transparent;cursor:pointer;cursor:hand;}.yui-skin-sam .yui-button a{text-decoration:none;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-focus button,.yui-skin-sam .yui-button-focus a{color:#000;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-hover button,.yui-skin-sam .yui-button-hover a{color:#000;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-active button,.yui-skin-sam .yui-button-active a{color:#000;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);}
diff --git a/lib/yui/assets/skins/sam/calendar.css b/lib/yui/assets/skins/sam/calendar.css
new file mode 100755 (executable)
index 0000000..18e466b
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;}.yui-calendar .calnavright{position:absolute;z-index:1;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(sprite.png) repeat-x 0 0;border-bottom:1px solid #cccccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding-right:2px;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding-left:2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #cccccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#0066cc;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#cccccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#ccff99;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#99ccff;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#ffcccc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#ccff99;}
diff --git a/lib/yui/assets/skins/sam/colorpicker.css b/lib/yui/assets/skins/sam/colorpicker.css
new file mode 100755 (executable)
index 0000000..f07aa51
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-picker-panel{background:#e3e3e3;border-color:#888;}.yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}.yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}.yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}.yui-picker{position:relative;}.yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}.yui-picker-hue-bg{-moz-outline:none;outline:0px none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}.yui-picker-bg{-moz-outline:none;outline:0px none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/colorpicker/assets/picker_mask.png',sizingMethod='scale');}.yui-picker-mask{position:absolute;z-index:1;top:0px;left:0px;}.yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}.yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}.yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}.yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}.yui-picker-controls .hd{background:transparent;border-width:0px !important;}.yui-picker-controls .bd{height:100px;border-width:0px !important;}.yui-picker-controls ul{float:left;list-style:none;padding:0 2px 0 0;margin:0}.yui-picker-controls li{padding:2px;margin:0}.yui-picker-controls input{font-size:0.85em;width:2.4em;}.yui-picker-hex-controls{clear:both;padding:2px;}.yui-picker-hex-controls input{width:4.6em;}.yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;}
diff --git a/lib/yui/assets/skins/sam/container.css b/lib/yui/assets/skins/sam/container.css
new file mode 100755 (executable)
index 0000000..39eb8f5
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:1;}yui-panel-container form{margin:0;}.masked .yui-panel-container{z-index:2;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-tt-shadow{position:absolute;}.yui-skin-sam .mask{background-color:#000;opacity:.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px 3px;}.yui-skin-sam .yui-panel{position:relative;*zoom:1;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{*zoom:1;*position:relative;border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .yui-panel-container.focused .yui-panel .hd{}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(sprite.png) no-repeat 0 -300px;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 5px 0 3px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;right:-3px;bottom:-3px;left:-3px;*top:3px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_right:0;_bottom:0;_left:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft .default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft .default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft .default button{color:#fff;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;*filter:alpha(opacity=12);}
diff --git a/lib/yui/assets/skins/sam/datatable.css b/lib/yui/assets/skins/sam/datatable.css
new file mode 100755 (executable)
index 0000000..bff0dbf
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-dt-table th,.yui-dt-table td{overflow:hidden;}th .yui-dt-header{position:relative;}th .yui-dt-label{position:relative;}th .yui-dt-resizer{position:absolute;margin-right:-6px;right:0;bottom:0;width:6px;height:100%;cursor:w-resize;cursor:col-resize;}.yui-dt-scrollable{*overflow-y:auto;}.yui-dt-scrollable thead{display:block;}.yui-dt-scrollable thead tr{position:relative;}.yui-dt-scrollbody{display:block;overflow:auto;}.yui-dt-editor{position:absolute;z-index:9000;}.yui-skin-sam .yui-dt-table{margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-table caption{padding-bottom:1em;text-align:left;}.yui-skin-sam .yui-dt-table th{background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table th a{font-weight:normal;text-decoration:none;color:#000;vertical-align:bottom;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table td{padding:4px 10px 4px 10px;border-right:1px solid #CBCBCB;}.yui-skin-sam .yui-dt-table td{white-space:nowrap;text-align:left;}.yui-skin-sam .yui-dt-table th.yui-dt-last,.yui-skin-sam .yui-dt-table td.yui-dt-last{border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-list td{border-right:none;}.yui-skin-sam .yui-dt-table thead{border:1px solid #989898;}.yui-skin-sam .yui-dt-table tbody{border-left:1px solid #7F7F7F;border-right:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-sortable{cursor:pointer;}.yui-skin-sam th.yui-dt-sortable{padding-right:5px;}.yui-skin-sam th.yui-dt-sortable .yui-dt-label{margin-right:15px;}.yui-skin-sam th.yui-dt-asc,.yui-skin-sam th.yui-dt-desc{background:url(sprite.png) repeat-x 0 -100px;}.yui-skin-sam th.yui-dt-asc .yui-dt-header{background:url(dt-arrow-up.png) no-repeat right;}.yui-skin-sam th.yui-dt-desc .yui-dt-header{background:url(dt-arrow-dn.png) no-repeat right;}.yui-dt-editable{cursor:pointer;}.yui-dt-editor{text-align:left;background-color:#F2F2F2;border:1px solid #808080;padding:6px;}.yui-dt-editor label{padding-left:4px;padding-right:6px;}.yui-dt-editor .yui-dt-button{padding-top:6px;text-align:right;}.yui-dt-editor .yui-dt-button button{background:url(sprite.png) repeat-x 0 0;border:1px solid #999;width:4em;height:1.8em;margin-left:6px;}.yui-dt-editor .yui-dt-button button.yui-dt-default{background:url(sprite.png) repeat-x 0 -1400px;background-color:#5584E0;border:1px solid #304369;color:#FFF}.yui-dt-editor .yui-dt-button button:hover{background:url(sprite.png) repeat-x 0 -1300px;color:#000;}.yui-dt-editor .yui-dt-button button:active{background:url(sprite.png) repeat-x 0 -1700px;color:#000;}.yui-skin-sam tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam tr.yui-dt-odd{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc{background-color:#DBEAFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam tr.yui-dt-selected td,.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-paginator{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-dt-paginator .yui-dt-first,.yui-skin-sam .yui-dt-paginator .yui-dt-last,.yui-skin-sam .yui-dt-paginator .yui-dt-selected{padding:2px 6px;}.yui-skin-sam .yui-dt-paginator a.yui-dt-first,.yui-skin-sam .yui-dt-paginator a.yui-dt-last{text-decoration:none;}.yui-skin-sam .yui-dt-paginator .yui-dt-previous,.yui-skin-sam .yui-dt-paginator .yui-dt-next{display:none;}.yui-skin-sam a.yui-dt-page{border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;}
diff --git a/lib/yui/assets/skins/sam/dt-arrow-dn.png b/lib/yui/assets/skins/sam/dt-arrow-dn.png
new file mode 100755 (executable)
index 0000000..2178f11
Binary files /dev/null and b/lib/yui/assets/skins/sam/dt-arrow-dn.png differ
diff --git a/lib/yui/assets/skins/sam/dt-arrow-up.png b/lib/yui/assets/skins/sam/dt-arrow-up.png
new file mode 100755 (executable)
index 0000000..5a543a5
Binary files /dev/null and b/lib/yui/assets/skins/sam/dt-arrow-up.png differ
diff --git a/lib/yui/assets/skins/sam/editor-knob.gif b/lib/yui/assets/skins/sam/editor-knob.gif
new file mode 100755 (executable)
index 0000000..03feab3
Binary files /dev/null and b/lib/yui/assets/skins/sam/editor-knob.gif differ
diff --git a/lib/yui/assets/skins/sam/editor-sprite-active.gif b/lib/yui/assets/skins/sam/editor-sprite-active.gif
new file mode 100755 (executable)
index 0000000..04ac4e4
Binary files /dev/null and b/lib/yui/assets/skins/sam/editor-sprite-active.gif differ
diff --git a/lib/yui/assets/skins/sam/editor-sprite.gif b/lib/yui/assets/skins/sam/editor-sprite.gif
new file mode 100755 (executable)
index 0000000..dd36c3e
Binary files /dev/null and b/lib/yui/assets/skins/sam/editor-sprite.gif differ
diff --git a/lib/yui/assets/skins/sam/editor.css b/lib/yui/assets/skins/sam/editor.css
new file mode 100755 (executable)
index 0000000..950a2a6
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;color:#999;padding-left:.25em;}.yui-toolbar-container span.yui-toolbar-separator{border-left:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;float:left;}.yui-toolbar-container .yui-button{border:1px solid #999999;background:none;padding:0;cursor:pointer;height:20px;width:30px;overflow:hidden;display:block;float:left;margin:0 1px;position:relative;filter:none;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{margin:0;border:0;display:block;text-indent:50px !important;width:200px;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{opacity:.5;filter:alpha(opacity=50);cursor:default;}.yui-toolbar-container .yui-button a{padding:0;}.yui-toolbar-container .yui-button.ie6.hover{background-color:#98D5FC !important;}.yui-toolbar-container .yui-toolbar-select{height:20px;width:auto;}.yui-toolbar-container .yui-toolbar-select a{border:none;background-color:transparent;height:19px;width:100%;text-align:left;cursor:pointer;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-select .first-child{width:100% !important;}.yui-toolbar-container .yui-toolbar-select .first-child a{text-indent:3px !important;width:100% !important;}.yui-toolbar-container .yui-toolbar-select.yui-button-disabled a{cursor:default;opacity:1;filter:none;display:block;}.yui-toolbar-container .yui-toolbar-fontname{width:125px;}.yui-toolbar-container .yui-toolbar-heading{width:80px;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-push-button-focus{border:1px dotted #999;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{border:none;background-color:transparent;background-image:none;background-repeat:no-repeat;width:28px;height:20px;text-align:left;text-indent:2px !important;z-index:0;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up,.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{position:absolute;display:block right:0;cursor:pointer;text-indent:999px;overflow:hidden;z-index:1;border:none;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{float:none;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:hidden;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{height:1em;padding:0.25em;font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding-left:23px;text-align:left;margin:.5em;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;overflow:auto;width:100%;zoom:1;text-align:left;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{width:100px;}.yui-editor-panel .yui-toolbar-group-border{width:175px;*width:190px;}.yui-editor-panel .yui-toolbar-group-textflow{width:150px;*width:180px;}.yui-editor-panel .height-width{float:left;width:68%;}.yui-editor-panel .height-width h3{padding-right:11px;}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{width:50px;font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-container div.yuimenu li.yuimenuitem a{float:none;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{border-bottom:3px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{border-bottom:4px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{border-bottom:5px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-toolbar-container .yui-toolbar-bordersize-menu{width:30px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel{display:block;width:50px;color:#ffffff;position:relative;margin-left:20px;padding:0;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-14px;}.yui-toolbar-bordersize-menu .yuimenuitem a.selected,.yui-toolbar-bordertype-menu .yuimenuitem a.selected{color:#B3D4FF;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a{color:#000;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a.selected{color:#fff;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-skin-sam .yui-toolbar-container{border:1px solid #808080;zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0.25em;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-container .yui-editor-editable-container{border:1px solid #808080;border-top:none;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border:1px solid #808080;border-top:none;color:#999;text-align:left;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:2px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-toolbar-container .yui-toolbar-select .first-child a{padding-top:0;}.yui-skin-sam .yui-toolbar-container .yui-button{background:url(sprite.png) repeat-x 0 0;border:1px solid #808080;cursor:pointer;height:22px;margin:0;overflow:hidden;position:relative;display:block;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(sprite.png) no-repeat 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background-image:url( editor-sprite.gif );background-repeat:no-repeat;background-position:30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .visible .yuimenuitemlabel{text-align:left;}.yui-skin-sam .yui-button-menu{background-color:#ffffff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold,.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic,.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript,.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor,.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright,.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist,.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink,.yui-skin-sam .yui-toolbar-container .yui-toolbar-left,.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline,.yui-skin-sam .yui-toolbar-container .yui-toolbar-block,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordersize,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordertype{border-right:none;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-button .first-child a{width:500px;position:absolute;_position:static;top:-1px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{position:static;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{height:19px;left:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up{top:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1221px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{bottom:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1187px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background-image:url( editor-sprite.gif );background-position:0px -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;*width:195px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:185px;}.yui-skin-sam .yui-editor-panel .hd{margin:13px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;*margin-left:-1px;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0;z-index:-1;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background-image:url( editor-sprite.gif );background-position:0 -1260px;display:block;height:20px;left:0;position:absolute;top:0;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background-image:url( editor-knob.gif );background-repeat:no-repeat;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;padding-top:5px;}.yui-editor-blankimage{background-image:url( blankimage.png );}
diff --git a/lib/yui/assets/skins/sam/hue_bg.png b/lib/yui/assets/skins/sam/hue_bg.png
new file mode 100755 (executable)
index 0000000..d9bcdeb
Binary files /dev/null and b/lib/yui/assets/skins/sam/hue_bg.png differ
diff --git a/lib/yui/assets/skins/sam/logger.css b/lib/yui/assets/skins/sam/logger.css
new file mode 100755 (executable)
index 0000000..5b8077f
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-skin-sam .yui-log{padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;}.yui-skin-sam .yui-log-container{position:absolute;top:1em;right:1em;}.yui-skin-sam .yui-log input{margin:0;padding:0;font-family:arial;font-size:100%;font-weight:normal;}.yui-skin-sam .yui-log .yui-log-btns{position:relative;float:right;bottom:.25em;}.yui-skin-sam .yui-log .yui-log-hd{margin-top:1em;padding:.5em;background-color:#575757;}.yui-skin-sam .yui-log .yui-log-hd h4{margin:0;padding:0;font-size:108%;font-weight:bold;color:#FFF;}.yui-skin-sam .yui-log .yui-log-bd{width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}.yui-skin-sam .yui-log p{margin:1px;padding:.1em;}.yui-skin-sam .yui-log pre{margin:0;padding:0;}.yui-skin-sam .yui-log pre.yui-log-verbose{white-space:pre-wrap;white-space:-moz-pre-wrap !important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}.yui-skin-sam .yui-log .yui-log-ft{margin-top:.5em;}.yui-skin-sam .yui-log .yui-log-ft .yui-log-categoryfilters{}.yui-skin-sam .yui-log .yui-log-ft .yui-log-sourcefilters{width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}.yui-skin-sam .yui-log .yui-log-filtergrp{margin-right:.5em;}.yui-skin-sam .yui-log .info{background-color:#A7CC25;}.yui-skin-sam .yui-log .warn{background-color:#F58516;}.yui-skin-sam .yui-log .error{background-color:#E32F0B;}.yui-skin-sam .yui-log .time{background-color:#A6C9D7;}.yui-skin-sam .yui-log .window{background-color:#F2E886;}
diff --git a/lib/yui/assets/skins/sam/menu-button-arrow-disabled.png b/lib/yui/assets/skins/sam/menu-button-arrow-disabled.png
new file mode 100755 (executable)
index 0000000..8cef2ab
Binary files /dev/null and b/lib/yui/assets/skins/sam/menu-button-arrow-disabled.png differ
diff --git a/lib/yui/assets/skins/sam/menu-button-arrow.png b/lib/yui/assets/skins/sam/menu-button-arrow.png
new file mode 100755 (executable)
index 0000000..f03dfee
Binary files /dev/null and b/lib/yui/assets/skins/sam/menu-button-arrow.png differ
diff --git a/lib/yui/assets/skins/sam/menu.css b/lib/yui/assets/skins/sam/menu.css
new file mode 100755 (executable)
index 0000000..046a9c6
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yuimenu .yuimenu,.yuimenubar .yuimenu{position:absolute;visibility:hidden;}.yuimenubar ul,.yuimenu ul{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{white-space:nowrap;}.yui-menu-shadow{position:absolute;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{border:solid 1px #808080;background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubar .bd,.yui-skin-sam .yuimenubar ul{*zoom:1;}.yui-skin-sam .yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yui-skin-sam .yuimenubaritem{float:left;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{display:block;*display:inline-block;font-size:93%;line-height:2;*line-height:1.9;padding:0 10px;color:#000;text-decoration:none;outline:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;}.yui-skin-sam .yuimenubaritemlabel .submenuindicator{width:1px;height:1px;top:0;left:0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel .submenuindicator{top:50%;right:8px;left:auto;margin-top:-3px;height:4px;width:7px;text-indent:8px;background-position:-16px -856px;}.yui-skin-sam .yuimenubaritem a.selected{background:url(sprite.png) repeat-x 0 -1700px;border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubar a.selected .submenuindicator{background:transparent;}.yui-skin-sam .yuimenubarnav a.selected .submenuindicator{background:url(sprite.png) repeat-x -16px -856px;}.yui-skin-sam .yuimenubaritem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.disabled .submenuindicator{background-position:-16px -881px;}.yui-skin-sam .yuimenu .bd{position:relative;top:0;left:0;border:solid 1px #808080;background-color:#fff;z-index:1;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-size:93%;font-weight:bold;line-height:1.5;*line-height:1.45;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{position:relative;height:16px;border:solid 1px #808080;background:#fff url(sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{z-index:2;border-bottom-color:#ccc;margin-bottom:-1px;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{z-index:3;border-top-color:#ccc;margin-top:-1px;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitemlabel{font-size:93%;line-height:1.5;*line-height:1.45;padding:0 20px;display:block;color:#000;text-decoration:none;outline:none;position:relative;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{font-style:normal;margin:0 0 0 40px;}.yui-skin-sam .yuimenuitemlabel .submenuindicator,.yui-skin-sam .yuimenuitemlabel .checkedindicator,.yui-skin-sam .yuimenubaritemlabel .submenuindicator{position:absolute;overflow:hidden;background:url(sprite.png) no-repeat;}.yui-skin-sam .yuimenuitemlabel .submenuindicator{top:50%;right:8px;margin-top:-3px;height:7px;width:4px;text-indent:5px;background-position:0 -906px;}.yui-skin-sam .yuimenuitemlabel .checkedindicator{top:50%;left:8px;margin-top:-3px;height:7px;width:7px;text-indent:8px;background-position:0 -1006px;}.yui-skin-sam .yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);visibility:visible;}.yui-skin-sam .visible .bd,.yui-skin-sam .visible .yuimenuitem{_zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel{*zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel .helptext{float:right;width:100%;text-align:right;margin:-1.5em 0 0 0;*margin:-1.45em 0 0 0;}.yui-skin-sam .yuimenuitem a.selected{background:#B3D4FF;}.yui-skin-sam .yuimenubar .yuimenuitem a.selected .submenuindicator{background:url(sprite.png) no-repeat 0 -906px;}.yui-skin-sam .yuimenubarnav .yuimenuitem a.selected{border-width:0;margin:0;*left:0;}.yui-skin-sam .yuimenuitem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem a.disabled .submenuindicator{background-position:0 -931px;}.yui-skin-sam .yuimenuitem a.disabled .checkedindicator{background-position:0 -1031px;}
diff --git a/lib/yui/assets/skins/sam/picker_mask.png b/lib/yui/assets/skins/sam/picker_mask.png
new file mode 100755 (executable)
index 0000000..f8d9193
Binary files /dev/null and b/lib/yui/assets/skins/sam/picker_mask.png differ
diff --git a/lib/yui/assets/skins/sam/skin.css b/lib/yui/assets/skins/sam/skin.css
new file mode 100755 (executable)
index 0000000..66c2fc5
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-skin-sam .yui-ac{position:relative;font-family:arial;font-size:100%;}.yui-skin-sam .yui-ac-input{position:absolute;width:100%;}.yui-skin-sam .yui-ac-container{position:absolute;top:1.6em;width:100%;}.yui-skin-sam .yui-ac-content{position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050;}.yui-skin-sam .yui-ac-shadow{position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity:0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049;}.yui-skin-sam .yui-ac-content ul{margin:0;padding:0;width:100%;}.yui-skin-sam .yui-ac-content li{margin:0;padding:2px 5px;cursor:default;white-space:nowrap;}.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight{background:#B3D4FF;}.yui-skin-sam .yui-ac-content li.yui-ac-highlight{background:#426FD9;color:#FFF;}
+.yui-skin-sam .yui-button{display:-moz-inline-box;display:inline-block;border-width:1px 0;border-style:solid;border-color:#808080;background:url(sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{display:block;*display:inline-block;border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;*position:relative;*left:-1px;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a{display:block;*display:inline-block;padding:0 10px;border:none;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button button{*overflow:visible;background-color:transparent;cursor:pointer;cursor:hand;}.yui-skin-sam .yui-button a{text-decoration:none;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-focus button,.yui-skin-sam .yui-button-focus a{color:#000;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-hover button,.yui-skin-sam .yui-button-hover a{color:#000;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-active button,.yui-skin-sam .yui-button-active a{color:#000;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);}
+.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;}.yui-calendar .calnavright{position:absolute;z-index:1;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(sprite.png) repeat-x 0 0;border-bottom:1px solid #cccccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding-right:2px;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding-left:2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #cccccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#0066cc;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#cccccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#ccff99;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#99ccff;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#ffcccc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#ccff99;}
+.yui-picker-panel{background:#e3e3e3;border-color:#888;}.yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}.yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}.yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}.yui-picker{position:relative;}.yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}.yui-picker-hue-bg{-moz-outline:none;outline:0px none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}.yui-picker-bg{-moz-outline:none;outline:0px none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/colorpicker/assets/picker_mask.png',sizingMethod='scale');}.yui-picker-mask{position:absolute;z-index:1;top:0px;left:0px;}.yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}.yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}.yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}.yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}.yui-picker-controls .hd{background:transparent;border-width:0px !important;}.yui-picker-controls .bd{height:100px;border-width:0px !important;}.yui-picker-controls ul{float:left;list-style:none;padding:0 2px 0 0;margin:0}.yui-picker-controls li{padding:2px;margin:0}.yui-picker-controls input{font-size:0.85em;width:2.4em;}.yui-picker-hex-controls{clear:both;padding:2px;}.yui-picker-hex-controls input{width:4.6em;}.yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;}
+.yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:1;}yui-panel-container form{margin:0;}.masked .yui-panel-container{z-index:2;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-tt-shadow{position:absolute;}.yui-skin-sam .mask{background-color:#000;opacity:.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px 3px;}.yui-skin-sam .yui-panel{position:relative;*zoom:1;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{*zoom:1;*position:relative;border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .yui-panel-container.focused .yui-panel .hd{}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(sprite.png) no-repeat 0 -300px;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 5px 0 3px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;right:-3px;bottom:-3px;left:-3px;*top:3px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_right:0;_bottom:0;_left:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft .default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft .default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft .default button{color:#fff;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;*filter:alpha(opacity=12);}
+.yui-dt-table th,.yui-dt-table td{overflow:hidden;}th .yui-dt-header{position:relative;}th .yui-dt-label{position:relative;}th .yui-dt-resizer{position:absolute;margin-right:-6px;right:0;bottom:0;width:6px;height:100%;cursor:w-resize;cursor:col-resize;}.yui-dt-scrollable{*overflow-y:auto;}.yui-dt-scrollable thead{display:block;}.yui-dt-scrollable thead tr{position:relative;}.yui-dt-scrollbody{display:block;overflow:auto;}.yui-dt-editor{position:absolute;z-index:9000;}.yui-skin-sam .yui-dt-table{margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-table caption{padding-bottom:1em;text-align:left;}.yui-skin-sam .yui-dt-table th{background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table th a{font-weight:normal;text-decoration:none;color:#000;vertical-align:bottom;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table td{padding:4px 10px 4px 10px;border-right:1px solid #CBCBCB;}.yui-skin-sam .yui-dt-table td{white-space:nowrap;text-align:left;}.yui-skin-sam .yui-dt-table th.yui-dt-last,.yui-skin-sam .yui-dt-table td.yui-dt-last{border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-list td{border-right:none;}.yui-skin-sam .yui-dt-table thead{border:1px solid #989898;}.yui-skin-sam .yui-dt-table tbody{border-left:1px solid #7F7F7F;border-right:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-sortable{cursor:pointer;}.yui-skin-sam th.yui-dt-sortable{padding-right:5px;}.yui-skin-sam th.yui-dt-sortable .yui-dt-label{margin-right:15px;}.yui-skin-sam th.yui-dt-asc,.yui-skin-sam th.yui-dt-desc{background:url(sprite.png) repeat-x 0 -100px;}.yui-skin-sam th.yui-dt-asc .yui-dt-header{background:url(dt-arrow-up.png) no-repeat right;}.yui-skin-sam th.yui-dt-desc .yui-dt-header{background:url(dt-arrow-dn.png) no-repeat right;}.yui-dt-editable{cursor:pointer;}.yui-dt-editor{text-align:left;background-color:#F2F2F2;border:1px solid #808080;padding:6px;}.yui-dt-editor label{padding-left:4px;padding-right:6px;}.yui-dt-editor .yui-dt-button{padding-top:6px;text-align:right;}.yui-dt-editor .yui-dt-button button{background:url(sprite.png) repeat-x 0 0;border:1px solid #999;width:4em;height:1.8em;margin-left:6px;}.yui-dt-editor .yui-dt-button button.yui-dt-default{background:url(sprite.png) repeat-x 0 -1400px;background-color:#5584E0;border:1px solid #304369;color:#FFF}.yui-dt-editor .yui-dt-button button:hover{background:url(sprite.png) repeat-x 0 -1300px;color:#000;}.yui-dt-editor .yui-dt-button button:active{background:url(sprite.png) repeat-x 0 -1700px;color:#000;}.yui-skin-sam tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam tr.yui-dt-odd{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc{background-color:#DBEAFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam tr.yui-dt-selected td,.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-paginator{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-dt-paginator .yui-dt-first,.yui-skin-sam .yui-dt-paginator .yui-dt-last,.yui-skin-sam .yui-dt-paginator .yui-dt-selected{padding:2px 6px;}.yui-skin-sam .yui-dt-paginator a.yui-dt-first,.yui-skin-sam .yui-dt-paginator a.yui-dt-last{text-decoration:none;}.yui-skin-sam .yui-dt-paginator .yui-dt-previous,.yui-skin-sam .yui-dt-paginator .yui-dt-next{display:none;}.yui-skin-sam a.yui-dt-page{border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;}
+.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;color:#999;padding-left:.25em;}.yui-toolbar-container span.yui-toolbar-separator{border-left:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;float:left;}.yui-toolbar-container .yui-button{border:1px solid #999999;background:none;padding:0;cursor:pointer;height:20px;width:30px;overflow:hidden;display:block;float:left;margin:0 1px;position:relative;filter:none;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{margin:0;border:0;display:block;text-indent:50px !important;width:200px;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{opacity:.5;filter:alpha(opacity=50);cursor:default;}.yui-toolbar-container .yui-button a{padding:0;}.yui-toolbar-container .yui-button.ie6.hover{background-color:#98D5FC !important;}.yui-toolbar-container .yui-toolbar-select{height:20px;width:auto;}.yui-toolbar-container .yui-toolbar-select a{border:none;background-color:transparent;height:19px;width:100%;text-align:left;cursor:pointer;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-select .first-child{width:100% !important;}.yui-toolbar-container .yui-toolbar-select .first-child a{text-indent:3px !important;width:100% !important;}.yui-toolbar-container .yui-toolbar-select.yui-button-disabled a{cursor:default;opacity:1;filter:none;display:block;}.yui-toolbar-container .yui-toolbar-fontname{width:125px;}.yui-toolbar-container .yui-toolbar-heading{width:80px;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-push-button-focus{border:1px dotted #999;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{border:none;background-color:transparent;background-image:none;background-repeat:no-repeat;width:28px;height:20px;text-align:left;text-indent:2px !important;z-index:0;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up,.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{position:absolute;display:block right:0;cursor:pointer;text-indent:999px;overflow:hidden;z-index:1;border:none;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{float:none;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:hidden;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{height:1em;padding:0.25em;font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding-left:23px;text-align:left;margin:.5em;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;overflow:auto;width:100%;zoom:1;text-align:left;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{width:100px;}.yui-editor-panel .yui-toolbar-group-border{width:175px;*width:190px;}.yui-editor-panel .yui-toolbar-group-textflow{width:150px;*width:180px;}.yui-editor-panel .height-width{float:left;width:68%;}.yui-editor-panel .height-width h3{padding-right:11px;}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{width:50px;font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-container div.yuimenu li.yuimenuitem a{float:none;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{border-bottom:3px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{border-bottom:4px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{border-bottom:5px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-toolbar-container .yui-toolbar-bordersize-menu{width:30px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel{display:block;width:50px;color:#ffffff;position:relative;margin-left:20px;padding:0;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-14px;}.yui-toolbar-bordersize-menu .yuimenuitem a.selected,.yui-toolbar-bordertype-menu .yuimenuitem a.selected{color:#B3D4FF;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a{color:#000;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a.selected{color:#fff;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-skin-sam .yui-toolbar-container{border:1px solid #808080;zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0.25em;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-container .yui-editor-editable-container{border:1px solid #808080;border-top:none;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border:1px solid #808080;border-top:none;color:#999;text-align:left;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:2px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-toolbar-container .yui-toolbar-select .first-child a{padding-top:0;}.yui-skin-sam .yui-toolbar-container .yui-button{background:url(sprite.png) repeat-x 0 0;border:1px solid #808080;cursor:pointer;height:22px;margin:0;overflow:hidden;position:relative;display:block;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(sprite.png) no-repeat 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background-image:url( editor-sprite.gif );background-repeat:no-repeat;background-position:30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .visible .yuimenuitemlabel{text-align:left;}.yui-skin-sam .yui-button-menu{background-color:#ffffff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold,.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic,.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript,.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor,.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright,.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist,.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink,.yui-skin-sam .yui-toolbar-container .yui-toolbar-left,.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline,.yui-skin-sam .yui-toolbar-container .yui-toolbar-block,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordersize,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordertype{border-right:none;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-button .first-child a{width:500px;position:absolute;_position:static;top:-1px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{position:static;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{height:19px;left:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up{top:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1221px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{bottom:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1187px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background-image:url( editor-sprite.gif );background-position:0px -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;*width:195px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:185px;}.yui-skin-sam .yui-editor-panel .hd{margin:13px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;*margin-left:-1px;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0;z-index:-1;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background-image:url( editor-sprite.gif );background-position:0 -1260px;display:block;height:20px;left:0;position:absolute;top:0;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background-image:url( editor-knob.gif );background-repeat:no-repeat;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;padding-top:5px;}.yui-editor-blankimage{background-image:url( blankimage.png );}
+.yui-skin-sam .yui-log{padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;}.yui-skin-sam .yui-log-container{position:absolute;top:1em;right:1em;}.yui-skin-sam .yui-log input{margin:0;padding:0;font-family:arial;font-size:100%;font-weight:normal;}.yui-skin-sam .yui-log .yui-log-btns{position:relative;float:right;bottom:.25em;}.yui-skin-sam .yui-log .yui-log-hd{margin-top:1em;padding:.5em;background-color:#575757;}.yui-skin-sam .yui-log .yui-log-hd h4{margin:0;padding:0;font-size:108%;font-weight:bold;color:#FFF;}.yui-skin-sam .yui-log .yui-log-bd{width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}.yui-skin-sam .yui-log p{margin:1px;padding:.1em;}.yui-skin-sam .yui-log pre{margin:0;padding:0;}.yui-skin-sam .yui-log pre.yui-log-verbose{white-space:pre-wrap;white-space:-moz-pre-wrap !important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}.yui-skin-sam .yui-log .yui-log-ft{margin-top:.5em;}.yui-skin-sam .yui-log .yui-log-ft .yui-log-categoryfilters{}.yui-skin-sam .yui-log .yui-log-ft .yui-log-sourcefilters{width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}.yui-skin-sam .yui-log .yui-log-filtergrp{margin-right:.5em;}.yui-skin-sam .yui-log .info{background-color:#A7CC25;}.yui-skin-sam .yui-log .warn{background-color:#F58516;}.yui-skin-sam .yui-log .error{background-color:#E32F0B;}.yui-skin-sam .yui-log .time{background-color:#A6C9D7;}.yui-skin-sam .yui-log .window{background-color:#F2E886;}
+.yuimenu .yuimenu,.yuimenubar .yuimenu{position:absolute;visibility:hidden;}.yuimenubar ul,.yuimenu ul{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{white-space:nowrap;}.yui-menu-shadow{position:absolute;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{border:solid 1px #808080;background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubar .bd,.yui-skin-sam .yuimenubar ul{*zoom:1;}.yui-skin-sam .yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yui-skin-sam .yuimenubaritem{float:left;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{display:block;*display:inline-block;font-size:93%;line-height:2;*line-height:1.9;padding:0 10px;color:#000;text-decoration:none;outline:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;}.yui-skin-sam .yuimenubaritemlabel .submenuindicator{width:1px;height:1px;top:0;left:0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel .submenuindicator{top:50%;right:8px;left:auto;margin-top:-3px;height:4px;width:7px;text-indent:8px;background-position:-16px -856px;}.yui-skin-sam .yuimenubaritem a.selected{background:url(sprite.png) repeat-x 0 -1700px;border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubar a.selected .submenuindicator{background:transparent;}.yui-skin-sam .yuimenubarnav a.selected .submenuindicator{background:url(sprite.png) repeat-x -16px -856px;}.yui-skin-sam .yuimenubaritem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.disabled .submenuindicator{background-position:-16px -881px;}.yui-skin-sam .yuimenu .bd{position:relative;top:0;left:0;border:solid 1px #808080;background-color:#fff;z-index:1;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-size:93%;font-weight:bold;line-height:1.5;*line-height:1.45;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{position:relative;height:16px;border:solid 1px #808080;background:#fff url(sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{z-index:2;border-bottom-color:#ccc;margin-bottom:-1px;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{z-index:3;border-top-color:#ccc;margin-top:-1px;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitemlabel{font-size:93%;line-height:1.5;*line-height:1.45;padding:0 20px;display:block;color:#000;text-decoration:none;outline:none;position:relative;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{font-style:normal;margin:0 0 0 40px;}.yui-skin-sam .yuimenuitemlabel .submenuindicator,.yui-skin-sam .yuimenuitemlabel .checkedindicator,.yui-skin-sam .yuimenubaritemlabel .submenuindicator{position:absolute;overflow:hidden;background:url(sprite.png) no-repeat;}.yui-skin-sam .yuimenuitemlabel .submenuindicator{top:50%;right:8px;margin-top:-3px;height:7px;width:4px;text-indent:5px;background-position:0 -906px;}.yui-skin-sam .yuimenuitemlabel .checkedindicator{top:50%;left:8px;margin-top:-3px;height:7px;width:7px;text-indent:8px;background-position:0 -1006px;}.yui-skin-sam .yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);visibility:visible;}.yui-skin-sam .visible .bd,.yui-skin-sam .visible .yuimenuitem{_zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel{*zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel .helptext{float:right;width:100%;text-align:right;margin:-1.5em 0 0 0;*margin:-1.45em 0 0 0;}.yui-skin-sam .yuimenuitem a.selected{background:#B3D4FF;}.yui-skin-sam .yuimenubar .yuimenuitem a.selected .submenuindicator{background:url(sprite.png) no-repeat 0 -906px;}.yui-skin-sam .yuimenubarnav .yuimenuitem a.selected{border-width:0;margin:0;*left:0;}.yui-skin-sam .yuimenuitem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem a.disabled .submenuindicator{background-position:0 -931px;}.yui-skin-sam .yuimenuitem a.disabled .checkedindicator{background-position:0 -1031px;}
+.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{Xoutline:0;}.yui-navset .yui-nav a{Xposition:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;}
+.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvitem{}.ygtvchildren{*zoom:1;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;}.ygtvspacer{height:22px;width:18px;}
+
diff --git a/lib/yui/assets/skins/sam/split-button-arrow-active.png b/lib/yui/assets/skins/sam/split-button-arrow-active.png
new file mode 100755 (executable)
index 0000000..fa58c50
Binary files /dev/null and b/lib/yui/assets/skins/sam/split-button-arrow-active.png differ
diff --git a/lib/yui/assets/skins/sam/split-button-arrow-disabled.png b/lib/yui/assets/skins/sam/split-button-arrow-disabled.png
new file mode 100755 (executable)
index 0000000..0a6a82c
Binary files /dev/null and b/lib/yui/assets/skins/sam/split-button-arrow-disabled.png differ
diff --git a/lib/yui/assets/skins/sam/split-button-arrow-focus.png b/lib/yui/assets/skins/sam/split-button-arrow-focus.png
new file mode 100755 (executable)
index 0000000..167d71e
Binary files /dev/null and b/lib/yui/assets/skins/sam/split-button-arrow-focus.png differ
diff --git a/lib/yui/assets/skins/sam/split-button-arrow-hover.png b/lib/yui/assets/skins/sam/split-button-arrow-hover.png
new file mode 100755 (executable)
index 0000000..167d71e
Binary files /dev/null and b/lib/yui/assets/skins/sam/split-button-arrow-hover.png differ
diff --git a/lib/yui/assets/skins/sam/split-button-arrow.png b/lib/yui/assets/skins/sam/split-button-arrow.png
new file mode 100755 (executable)
index 0000000..b33a93f
Binary files /dev/null and b/lib/yui/assets/skins/sam/split-button-arrow.png differ
diff --git a/lib/yui/assets/skins/sam/sprite.png b/lib/yui/assets/skins/sam/sprite.png
new file mode 100755 (executable)
index 0000000..afd65e0
Binary files /dev/null and b/lib/yui/assets/skins/sam/sprite.png differ
diff --git a/lib/yui/assets/skins/sam/tabview.css b/lib/yui/assets/skins/sam/tabview.css
new file mode 100755 (executable)
index 0000000..247414a
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{Xoutline:0;}.yui-navset .yui-nav a{Xposition:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;}
diff --git a/lib/yui/assets/skins/sam/treeview-loading.gif b/lib/yui/assets/skins/sam/treeview-loading.gif
new file mode 100755 (executable)
index 0000000..0bbf3bc
Binary files /dev/null and b/lib/yui/assets/skins/sam/treeview-loading.gif differ
diff --git a/lib/yui/assets/skins/sam/treeview-sprite.gif b/lib/yui/assets/skins/sam/treeview-sprite.gif
new file mode 100755 (executable)
index 0000000..a04eff6
Binary files /dev/null and b/lib/yui/assets/skins/sam/treeview-sprite.gif differ
diff --git a/lib/yui/assets/skins/sam/treeview.css b/lib/yui/assets/skins/sam/treeview.css
new file mode 100755 (executable)
index 0000000..b82d34e
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvitem{}.ygtvchildren{*zoom:1;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;}.ygtvspacer{height:22px;width:18px;}
diff --git a/lib/yui/assets/skins/sam/yuitest.css b/lib/yui/assets/skins/sam/yuitest.css
new file mode 100755 (executable)
index 0000000..8b4d7cd
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
index 39c1cd89cf054483c422c22ac694fd81084b3168..89659ae9fb8384d009e118a1b5e4d008ef423c55 100755 (executable)
@@ -1,5 +1,56 @@
 AutoComplete Release Notes
 
+*** version 2.3.0 ***
+
+* Applied new skinning model.
+
+* The default queryDelay value has been changed to 0.2. In low-latency
+implementations (e.g., when queryDelay is set to 0 against a local
+JavaScript DataSource), typeAhead functionality may experience a race condition
+when retrieving the value of the textbox. To avoid this problem, implementers
+are advised not to set the queryDelay value too low.
+
+* Fixed runtime property value validation.
+
+* Implemented new method doBeforeSendQuery().
+
+* Implemented new method destroy().
+
+* Added support for latest JSON lib http://www.json.org/json.js.
+
+* Fixed forceSelection issues with matched selections and multiple selections.
+
+* No longer create var oAnim in global scope.
+
+* The properties alwaysShowContainer and useShadow should not be enabled together.
+
+* There is a known issue in Firefox where the native browser autocomplete
+attribute cannot be disabled programmatically on input boxes that are in use.
+
+
+
+
+
+**** version 2.2.2 ***
+
+* No changes.
+
+
+
+*** version 2.2.1 ***
+
+* Fixed form submission in Safari bug.
+* Fixed broken DS_JSArray support for minQueryLength=0.
+* Improved type checking with YAHOO.lang.
+
+
+
+*** version 2.2.0 ***
+
+* No changes.
+
+
+
 *** version 0.12.2 ***
 
 * No changes.
diff --git a/lib/yui/autocomplete/assets/autocomplete-core.css b/lib/yui/autocomplete/assets/autocomplete-core.css
new file mode 100755 (executable)
index 0000000..921fad9
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* This file intentionally left blank */\r
diff --git a/lib/yui/autocomplete/assets/skins/sam/autocomplete-skin.css b/lib/yui/autocomplete/assets/skins/sam/autocomplete-skin.css
new file mode 100755 (executable)
index 0000000..a2d2359
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* styles for entire widget */\r
+.yui-skin-sam .yui-ac {\r
+    position:relative;font-family:arial;font-size:100%;\r
+}\r
+\r
+/* styles for input field */\r
+.yui-skin-sam .yui-ac-input {\r
+    position:absolute;width:100%;\r
+}\r
+\r
+/* styles for results container */\r
+.yui-skin-sam .yui-ac-container {\r
+    position:absolute;top:1.6em;width:100%;\r
+}\r
+\r
+/* styles for header/body/footer wrapper within container */\r
+.yui-skin-sam .yui-ac-content {\r
+    position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050;\r
+}\r
+\r
+/* styles for container shadow */\r
+.yui-skin-sam .yui-ac-shadow {\r
+    position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity: 0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049;\r
+}\r
+\r
+/* styles for results list */\r
+.yui-skin-sam .yui-ac-content ul{\r
+    margin:0;padding:0;width:100%;\r
+}\r
+\r
+/* styles for result item */\r
+.yui-skin-sam .yui-ac-content li {\r
+    margin:0;padding:2px 5px;cursor:default;white-space:nowrap;\r
+}\r
+\r
+/* styles for prehighlighted result item */\r
+.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight {\r
+    background:#B3D4FF;\r
+}\r
+\r
+/* styles for highlighted result item */\r
+.yui-skin-sam .yui-ac-content li.yui-ac-highlight {\r
+    background:#426FD9;color:#FFF;\r
+}\r
diff --git a/lib/yui/autocomplete/assets/skins/sam/autocomplete.css b/lib/yui/autocomplete/assets/skins/sam/autocomplete.css
new file mode 100755 (executable)
index 0000000..98b473e
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-skin-sam .yui-ac{position:relative;font-family:arial;font-size:100%;}.yui-skin-sam .yui-ac-input{position:absolute;width:100%;}.yui-skin-sam .yui-ac-container{position:absolute;top:1.6em;width:100%;}.yui-skin-sam .yui-ac-content{position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050;}.yui-skin-sam .yui-ac-shadow{position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity:0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049;}.yui-skin-sam .yui-ac-content ul{margin:0;padding:0;width:100%;}.yui-skin-sam .yui-ac-content li{margin:0;padding:2px 5px;cursor:default;white-space:nowrap;}.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight{background:#B3D4FF;}.yui-skin-sam .yui-ac-content li.yui-ac-highlight{background:#426FD9;color:#FFF;}
index 45dc20894d95a6074b071b1ca2aaad2fe2c31966..522add11f01e52337db2b22e5f806ecabff69810 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
- /**\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 || (this._nKeyCode == 8)) {\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
- * The DataSource classes manages sending a request and returning response from a live\r
- * database. Supported data include local JavaScript arrays and objects and databases\r
- * accessible via XHR connections. Supported response formats include JavaScript arrays,\r
- * JSON, XML, and flat-file textual data.\r
- *  \r
- * @class DataSource\r
- * @constructor\r
- */\r
-YAHOO.widget.DataSource = function() { \r
-    /* abstract class */\r
-};\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public constants\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Error message for null data responses.\r
- *\r
- * @property ERROR_DATANULL\r
- * @type String\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DataSource.ERROR_DATANULL = "Response data was null";\r
-\r
-/**\r
- * Error message for data responses with parsing errors.\r
- *\r
- * @property ERROR_DATAPARSE\r
- * @type String\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DataSource.ERROR_DATAPARSE = "Response data could not be parsed";\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Max size of the local cache.  Set to 0 to turn off caching.  Caching is\r
- * useful to reduce the number of server connections.  Recommended only for data\r
- * sources that return comprehensive results for queries or when stale data is\r
- * not an issue.\r
- *\r
- * @property maxCacheEntries\r
- * @type Number\r
- * @default 15\r
- */\r
-YAHOO.widget.DataSource.prototype.maxCacheEntries = 15;\r
-\r
-/**\r
- * Use this to equate cache matching with the type of matching done by your live\r
- * data source. If caching is on and queryMatchContains is true, the cache\r
- * returns results that "contain" the query string. By default,\r
- * queryMatchContains is set to false, meaning the cache only returns results\r
- * that "start with" the query string.\r
- *\r
- * @property queryMatchContains\r
- * @type Boolean\r
- * @default false\r
- */\r
-YAHOO.widget.DataSource.prototype.queryMatchContains = false;\r
-\r
-/**\r
- * Enables query subset matching. If caching is on and queryMatchSubset is\r
- * true, substrings of queries will return matching cached results. For\r
- * instance, if the first query is for "abc" susequent queries that start with\r
- * "abc", like "abcd", will be queried against the cache, and not the live data\r
- * source. Recommended only for DataSources that return comprehensive results\r
- * for queries with very few characters.\r
- *\r
- * @property queryMatchSubset\r
- * @type Boolean\r
- * @default false\r
- *\r
- */\r
-YAHOO.widget.DataSource.prototype.queryMatchSubset = false;\r
-\r
-/**\r
- * Enables query case-sensitivity matching. If caching is on and\r
- * queryMatchCase is true, queries will only return results for case-sensitive\r
- * matches.\r
- *\r
- * @property queryMatchCase\r
- * @type Boolean\r
- * @default false\r
- */\r
-YAHOO.widget.DataSource.prototype.queryMatchCase = false;\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
- /**\r
- * Public accessor to the unique name of the DataSource instance.\r
- *\r
- * @method toString\r
- * @return {String} Unique name of the DataSource instance\r
- */\r
-YAHOO.widget.DataSource.prototype.toString = function() {\r
-    return "DataSource " + this._sName;\r
-};\r
-\r
-/**\r
- * Retrieves query results, first checking the local cache, then making the\r
- * query request to the live data source as defined by the function doQuery.\r
- *\r
- * @method getResults\r
- * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- */\r
-YAHOO.widget.DataSource.prototype.getResults = function(oCallbackFn, sQuery, oParent) {\r
-    \r
-    // First look in cache\r
-    var aResults = this._doQueryCache(oCallbackFn,sQuery,oParent);\r
-    \r
-    // Not in cache, so get results from server\r
-    if(aResults.length === 0) {\r
-        this.queryEvent.fire(this, oParent, sQuery);\r
-        this.doQuery(oCallbackFn, sQuery, oParent);\r
-    }\r
-};\r
-\r
-/**\r
- * Abstract method implemented by subclasses to make a query to the live data\r
- * source. Must call the callback function with the response returned from the\r
- * query. Populates cache (if enabled).\r
- *\r
- * @method doQuery\r
- * @param oCallbackFn {HTMLFunction} Callback function implemented by oParent to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- */\r
-YAHOO.widget.DataSource.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r
-    /* override this */ \r
-};\r
-\r
-/**\r
- * Flushes cache.\r
- *\r
- * @method flushCache\r
- */\r
-YAHOO.widget.DataSource.prototype.flushCache = function() {\r
-    if(this._aCache) {\r
-        this._aCache = [];\r
-    }\r
-    if(this._aCacheHelper) {\r
-        this._aCacheHelper = [];\r
-    }\r
-    this.cacheFlushEvent.fire(this);\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public events\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Fired when a query is made to the live data source.\r
- *\r
- * @event queryEvent\r
- * @param oSelf {Object} The DataSource instance.\r
- * @param oParent {Object} The requesting object.\r
- * @param sQuery {String} The query string.\r
- */\r
-YAHOO.widget.DataSource.prototype.queryEvent = null;\r
-\r
-/**\r
- * Fired when a query is made to the local cache.\r
- *\r
- * @event cacheQueryEvent\r
- * @param oSelf {Object} The DataSource instance.\r
- * @param oParent {Object} The requesting object.\r
- * @param sQuery {String} The query string.\r
- */\r
-YAHOO.widget.DataSource.prototype.cacheQueryEvent = null;\r
-\r
-/**\r
- * Fired when data is retrieved from the live data source.\r
- *\r
- * @event getResultsEvent\r
- * @param oSelf {Object} The DataSource instance.\r
- * @param oParent {Object} The requesting object.\r
- * @param sQuery {String} The query string.\r
- * @param aResults {Object[]} Array of result objects.\r
- */\r
-YAHOO.widget.DataSource.prototype.getResultsEvent = null;\r
-    \r
-/**\r
- * Fired when data is retrieved from the local cache.\r
- *\r
- * @event getCachedResultsEvent\r
- * @param oSelf {Object} The DataSource instance.\r
- * @param oParent {Object} The requesting object.\r
- * @param sQuery {String} The query string.\r
- * @param aResults {Object[]} Array of result objects.\r
- */\r
-YAHOO.widget.DataSource.prototype.getCachedResultsEvent = null;\r
-\r
-/**\r
- * Fired when an error is encountered with the live data source.\r
- *\r
- * @event dataErrorEvent\r
- * @param oSelf {Object} The DataSource instance.\r
- * @param oParent {Object} The requesting object.\r
- * @param sQuery {String} The query string.\r
- * @param sMsg {String} Error message string\r
- */\r
-YAHOO.widget.DataSource.prototype.dataErrorEvent = null;\r
-\r
-/**\r
- * Fired when the local cache is flushed.\r
- *\r
- * @event cacheFlushEvent\r
- * @param oSelf {Object} The DataSource instance\r
- */\r
-YAHOO.widget.DataSource.prototype.cacheFlushEvent = null;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Internal class variable to index multiple DataSource instances.\r
- *\r
- * @property _nIndex\r
- * @type Number\r
- * @private\r
- * @static\r
- */\r
-YAHOO.widget.DataSource._nIndex = 0;\r
-\r
-/**\r
- * Name of DataSource instance.\r
- *\r
- * @property _sName\r
- * @type String\r
- * @private\r
- */\r
-YAHOO.widget.DataSource.prototype._sName = null;\r
-\r
-/**\r
- * Local cache of data result objects indexed chronologically.\r
- *\r
- * @property _aCache\r
- * @type Object[]\r
- * @private\r
- */\r
-YAHOO.widget.DataSource.prototype._aCache = null;\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Initializes DataSource instance.\r
- *  \r
- * @method _init\r
- * @private\r
- */\r
-YAHOO.widget.DataSource.prototype._init = function() {\r
-    // Validate and initialize public configs\r
-    var maxCacheEntries = this.maxCacheEntries;\r
-    if(isNaN(maxCacheEntries) || (maxCacheEntries < 0)) {\r
-        maxCacheEntries = 0;\r
-    }\r
-    // Initialize local cache\r
-    if(maxCacheEntries > 0 && !this._aCache) {\r
-        this._aCache = [];\r
-    }\r
-    \r
-    this._sName = "instance" + YAHOO.widget.DataSource._nIndex;\r
-    YAHOO.widget.DataSource._nIndex++;\r
-    \r
-    this.queryEvent = new YAHOO.util.CustomEvent("query", this);\r
-    this.cacheQueryEvent = new YAHOO.util.CustomEvent("cacheQuery", this);\r
-    this.getResultsEvent = new YAHOO.util.CustomEvent("getResults", this);\r
-    this.getCachedResultsEvent = new YAHOO.util.CustomEvent("getCachedResults", this);\r
-    this.dataErrorEvent = new YAHOO.util.CustomEvent("dataError", this);\r
-    this.cacheFlushEvent = new YAHOO.util.CustomEvent("cacheFlush", this);\r
-};\r
-\r
-/**\r
- * Adds a result object to the local cache, evicting the oldest element if the \r
- * cache is full. Newer items will have higher indexes, the oldest item will have\r
- * index of 0. \r
- *\r
- * @method _addCacheElem\r
- * @param oResult {Object} Data result object, including array of results.\r
- * @private\r
- */\r
-YAHOO.widget.DataSource.prototype._addCacheElem = function(oResult) {\r
-    var aCache = this._aCache;\r
-    // Don't add if anything important is missing.\r
-    if(!aCache || !oResult || !oResult.query || !oResult.results) {\r
-        return;\r
-    }\r
-    \r
-    // If the cache is full, make room by removing from index=0\r
-    if(aCache.length >= this.maxCacheEntries) {\r
-        aCache.shift();\r
-    }\r
-        \r
-    // Add to cache, at the end of the array\r
-    aCache.push(oResult);\r
-};\r
-\r
-/**\r
- * Queries the local cache for results. If query has been cached, the callback\r
- * function is called with the results, and the cached is refreshed so that it\r
- * is now the newest element.  \r
- *\r
- * @method _doQueryCache\r
- * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- * @return aResults {Object[]} Array of results from local cache if found, otherwise null.\r
- * @private \r
- */\r
-YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery, oParent) {\r
-    var aResults = [];\r
-    var bMatchFound = false;\r
-    var aCache = this._aCache;\r
-    var nCacheLength = (aCache) ? aCache.length : 0;\r
-    var bMatchContains = this.queryMatchContains;\r
-    \r
-    // If cache is enabled...\r
-    if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {\r
-        this.cacheQueryEvent.fire(this, oParent, sQuery);\r
-        // If case is unimportant, normalize query now instead of in loops\r
-        if(!this.queryMatchCase) {\r
-            var sOrigQuery = sQuery;\r
-            sQuery = sQuery.toLowerCase();\r
-        }\r
-\r
-        // Loop through each cached element's query property...\r
-        for(var i = nCacheLength-1; i >= 0; i--) {\r
-            var resultObj = aCache[i];\r
-            var aAllResultItems = resultObj.results;\r
-            // If case is unimportant, normalize match key for comparison\r
-            var matchKey = (!this.queryMatchCase) ?\r
-                encodeURIComponent(resultObj.query).toLowerCase():\r
-                encodeURIComponent(resultObj.query);\r
-            \r
-            // If a cached match key exactly matches the query...\r
-            if(matchKey == sQuery) {\r
-                    // Stash all result objects into aResult[] and stop looping through the cache.\r
-                    bMatchFound = true;\r
-                    aResults = aAllResultItems;\r
-                    \r
-                    // The matching cache element was not the most recent,\r
-                    // so now we need to refresh the cache.\r
-                    if(i != nCacheLength-1) {                        \r
-                        // Remove element from its original location\r
-                        aCache.splice(i,1);\r
-                        // Add element as newest\r
-                        this._addCacheElem(resultObj);\r
-                    }\r
-                    break;\r
-            }\r
-            // Else if this query is not an exact match and subset matching is enabled...\r
-            else if(this.queryMatchSubset) {\r
-                // Loop through substrings of each cached element's query property...\r
-                for(var j = sQuery.length-1; j >= 0 ; j--) {\r
-                    var subQuery = sQuery.substr(0,j);\r
-                    \r
-                    // If a substring of a cached sQuery exactly matches the query...\r
-                    if(matchKey == subQuery) {                    \r
-                        bMatchFound = true;\r
-                        \r
-                        // Go through each cached result object to match against the query...\r
-                        for(var k = aAllResultItems.length-1; k >= 0; k--) {\r
-                            var aRecord = aAllResultItems[k];\r
-                            var sKeyIndex = (this.queryMatchCase) ?\r
-                                encodeURIComponent(aRecord[0]).indexOf(sQuery):\r
-                                encodeURIComponent(aRecord[0]).toLowerCase().indexOf(sQuery);\r
-                            \r
-                            // A STARTSWITH match is when the query is found at the beginning of the key string...\r
-                            if((!bMatchContains && (sKeyIndex === 0)) ||\r
-                            // A CONTAINS match is when the query is found anywhere within the key string...\r
-                            (bMatchContains && (sKeyIndex > -1))) {\r
-                                // Stash a match into aResults[].\r
-                                aResults.unshift(aRecord);\r
-                            }\r
-                        }\r
-                        \r
-                        // Add the subset match result set object as the newest element to cache,\r
-                        // and stop looping through the cache.\r
-                        resultObj = {};\r
-                        resultObj.query = sQuery;\r
-                        resultObj.results = aResults;\r
-                        this._addCacheElem(resultObj);\r
-                        break;\r
-                    }\r
-                }\r
-                if(bMatchFound) {\r
-                    break;\r
-                }\r
-            }\r
-        }\r
-        \r
-        // If there was a match, send along the results.\r
-        if(bMatchFound) {\r
-            this.getCachedResultsEvent.fire(this, oParent, sOrigQuery, aResults);\r
-            oCallbackFn(sOrigQuery, aResults, oParent);\r
-        }\r
-    }\r
-    return aResults;\r
-};\r
-\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * Implementation of YAHOO.widget.DataSource using XML HTTP requests that return\r
- * query results.\r
- *  \r
- * @class DS_XHR\r
- * @extends YAHOO.widget.DataSource\r
- * @requires connection\r
- * @constructor\r
- * @param sScriptURI {String} Absolute or relative URI to script that returns query\r
- * results as JSON, XML, or delimited flat-file data.\r
- * @param aSchema {String[]} Data schema definition of results.\r
- * @param oConfigs {Object} (optional) Object literal of config params.\r
- */\r
-YAHOO.widget.DS_XHR = function(sScriptURI, aSchema, oConfigs) {\r
-    // Set any config params passed in to override defaults\r
-    if(typeof oConfigs == "object") {\r
-        for(var sConfig in oConfigs) {\r
-            this[sConfig] = oConfigs[sConfig];\r
-        }\r
-    }\r
-    \r
-    // Initialization sequence\r
-    if(!aSchema || (aSchema.constructor != Array)) {\r
-        YAHOO.log("Could not instantiate XHR DataSource due to invalid arguments", "error", this.toString());\r
-        return;\r
-    }\r
-    else {\r
-        this.schema = aSchema;\r
-    }\r
-    this.scriptURI = sScriptURI;\r
-    this._init();\r
-    YAHOO.log("XHR DataSource initialized","info",this.toString());\r
-};\r
-\r
-YAHOO.widget.DS_XHR.prototype = new YAHOO.widget.DataSource();\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public constants\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * JSON data type.\r
- *\r
- * @property TYPE_JSON\r
- * @type Number\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DS_XHR.TYPE_JSON = 0;\r
-\r
-/**\r
- * XML data type.\r
- *\r
- * @property TYPE_XML\r
- * @type Number\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DS_XHR.TYPE_XML = 1;\r
-\r
-/**\r
- * Flat-file data type.\r
- *\r
- * @property TYPE_FLAT\r
- * @type Number\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DS_XHR.TYPE_FLAT = 2;\r
-\r
-/**\r
- * Error message for XHR failure.\r
- *\r
- * @property ERROR_DATAXHR\r
- * @type String\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DS_XHR.ERROR_DATAXHR = "XHR response failed";\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Alias to YUI Connection Manager. Allows implementers to specify their own\r
- * subclasses of the YUI Connection Manager utility.\r
- *\r
- * @property connMgr\r
- * @type Object\r
- * @default YAHOO.util.Connect\r
- */\r
-YAHOO.widget.DS_XHR.prototype.connMgr = YAHOO.util.Connect;\r
-\r
-/**\r
- * Number of milliseconds the XHR connection will wait for a server response. A\r
- * a value of zero indicates the XHR connection will wait forever. Any value\r
- * greater than zero will use the Connection utility's Auto-Abort feature.\r
- *\r
- * @property connTimeout\r
- * @type Number\r
- * @default 0\r
- */\r
-YAHOO.widget.DS_XHR.prototype.connTimeout = 0;\r
-\r
-/**\r
- * Absolute or relative URI to script that returns query results. For instance,\r
- * queries will be sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput\r
- *\r
- * @property scriptURI\r
- * @type String\r
- */\r
-YAHOO.widget.DS_XHR.prototype.scriptURI = null;\r
-\r
-/**\r
- * Query string parameter name sent to scriptURI. For instance, queries will be\r
- * sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput\r
- *\r
- * @property scriptQueryParam\r
- * @type String\r
- * @default "query"\r
- */\r
-YAHOO.widget.DS_XHR.prototype.scriptQueryParam = "query";\r
-\r
-/**\r
- * String of key/value pairs to append to requests made to scriptURI. Define\r
- * this string when you want to send additional query parameters to your script.\r
- * When defined, queries will be sent to\r
- * &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput&#38;&#60;scriptQueryAppend&#62;\r
- *\r
- * @property scriptQueryAppend\r
- * @type String\r
- * @default ""\r
- */\r
-YAHOO.widget.DS_XHR.prototype.scriptQueryAppend = "";\r
-\r
-/**\r
- * XHR response data type. Other types that may be defined are YAHOO.widget.DS_XHR.TYPE_XML\r
- * and YAHOO.widget.DS_XHR.TYPE_FLAT.\r
- *\r
- * @property responseType\r
- * @type String\r
- * @default YAHOO.widget.DS_XHR.TYPE_JSON\r
- */\r
-YAHOO.widget.DS_XHR.prototype.responseType = YAHOO.widget.DS_XHR.TYPE_JSON;\r
-\r
-/**\r
- * String after which to strip results. If the results from the XHR are sent\r
- * back as HTML, the gzip HTML comment appears at the end of the data and should\r
- * be ignored.\r
- *\r
- * @property responseStripAfter\r
- * @type String\r
- * @default "\n&#60;!-"\r
- */\r
-YAHOO.widget.DS_XHR.prototype.responseStripAfter = "\n<!-";\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Queries the live data source defined by scriptURI for results. Results are\r
- * passed back to a callback function.\r
- *  \r
- * @method doQuery\r
- * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- */\r
-YAHOO.widget.DS_XHR.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r
-    var isXML = (this.responseType == YAHOO.widget.DS_XHR.TYPE_XML);\r
-    var sUri = this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;\r
-    if(this.scriptQueryAppend.length > 0) {\r
-        sUri += "&" + this.scriptQueryAppend;\r
-    }\r
-    YAHOO.log("DataSource is querying URL " + sUri, "info", this.toString());\r
-    var oResponse = null;\r
-    \r
-    var oSelf = this;\r
-    /*\r
-     * Sets up ajax request callback\r
-     *\r
-     * @param {object} oReq          HTTPXMLRequest object\r
-     * @private\r
-     */\r
-    var responseSuccess = function(oResp) {\r
-        // Response ID does not match last made request ID.\r
-        if(!oSelf._oConn || (oResp.tId != oSelf._oConn.tId)) {\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r
-            YAHOO.log(YAHOO.widget.DataSource.ERROR_DATANULL, "error", this.toString());\r
-            return;\r
-        }\r
-//DEBUG\r
-/*YAHOO.log(oResp.responseXML.getElementsByTagName("Result"),'warn');\r
-for(var foo in oResp) {\r
-    YAHOO.log(foo + ": "+oResp[foo],'warn');\r
-}\r
-YAHOO.log('responseXML.xml: '+oResp.responseXML.xml,'warn');*/\r
-        if(!isXML) {\r
-            oResp = oResp.responseText;\r
-        }\r
-        else { \r
-            oResp = oResp.responseXML;\r
-        }\r
-        if(oResp === null) {\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r
-            YAHOO.log(YAHOO.widget.DataSource.ERROR_DATANULL, "error", oSelf.toString());\r
-            return;\r
-        }\r
-\r
-        var aResults = oSelf.parseResponse(sQuery, oResp, oParent);\r
-        var resultObj = {};\r
-        resultObj.query = decodeURIComponent(sQuery);\r
-        resultObj.results = aResults;\r
-        if(aResults === null) {\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATAPARSE);\r
-            YAHOO.log(YAHOO.widget.DataSource.ERROR_DATAPARSE, "error", oSelf.toString());\r
-            aResults = [];\r
-        }\r
-        else {\r
-            oSelf.getResultsEvent.fire(oSelf, oParent, sQuery, aResults);\r
-            oSelf._addCacheElem(resultObj);\r
-        }\r
-        oCallbackFn(sQuery, aResults, oParent);\r
-    };\r
-\r
-    var responseFailure = function(oResp) {\r
-        oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DS_XHR.ERROR_DATAXHR);\r
-        YAHOO.log(YAHOO.widget.DS_XHR.ERROR_DATAXHR + ": " + oResp.statusText, "error", oSelf.toString());\r
-        return;\r
-    };\r
-    \r
-    var oCallback = {\r
-        success:responseSuccess,\r
-        failure:responseFailure\r
-    };\r
-    \r
-    if(!isNaN(this.connTimeout) && this.connTimeout > 0) {\r
-        oCallback.timeout = this.connTimeout;\r
-    }\r
-    \r
-    if(this._oConn) {\r
-        this.connMgr.abort(this._oConn);\r
-    }\r
-    \r
-    oSelf._oConn = this.connMgr.asyncRequest("GET", sUri, oCallback, null);\r
-};\r
-\r
-/**\r
- * Parses raw response data into an array of result objects. The result data key\r
- * is always stashed in the [0] element of each result object. \r
- *\r
- * @method parseResponse\r
- * @param sQuery {String} Query string.\r
- * @param oResponse {Object} The raw response data to parse.\r
- * @param oParent {Object} The object instance that has requested data.\r
- * @returns {Object[]} Array of result objects.\r
- */\r
-YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParent) {\r
-    var aSchema = this.schema;\r
-    var aResults = [];\r
-    var bError = false;\r
-\r
-    // Strip out comment at the end of results\r
-    var nEnd = ((this.responseStripAfter !== "") && (oResponse.indexOf)) ?\r
-        oResponse.indexOf(this.responseStripAfter) : -1;\r
-    if(nEnd != -1) {\r
-        oResponse = oResponse.substring(0,nEnd);\r
-    }\r
-\r
-    switch (this.responseType) {\r
-        case YAHOO.widget.DS_XHR.TYPE_JSON:\r
-            var jsonList;\r
-            // Divert KHTML clients from JSON lib\r
-            if(window.JSON && (navigator.userAgent.toLowerCase().indexOf('khtml')== -1)) {\r
-                // Use the JSON utility if available\r
-                var jsonObjParsed = JSON.parse(oResponse);\r
-                if(!jsonObjParsed) {\r
-                    bError = true;\r
-                    break;\r
-                }\r
-                else {\r
-                    try {\r
-                        // eval is necessary here since aSchema[0] is of unknown depth\r
-                        jsonList = eval("jsonObjParsed." + aSchema[0]);\r
-                    }\r
-                    catch(e) {\r
-                        bError = true;\r
-                        break;\r
-                   }\r
-                }\r
-            }\r
-            else {\r
-                // Parse the JSON response as a string\r
-                try {\r
-                    // Trim leading spaces\r
-                    while (oResponse.substring(0,1) == " ") {\r
-                        oResponse = oResponse.substring(1, oResponse.length);\r
-                    }\r
-\r
-                    // Invalid JSON response\r
-                    if(oResponse.indexOf("{") < 0) {\r
-                        bError = true;\r
-                        break;\r
-                    }\r
-\r
-                    // Empty (but not invalid) JSON response\r
-                    if(oResponse.indexOf("{}") === 0) {\r
-                        break;\r
-                    }\r
-\r
-                    // Turn the string into an object literal...\r
-                    // ...eval is necessary here\r
-                    var jsonObjRaw = eval("(" + oResponse + ")");\r
-                    if(!jsonObjRaw) {\r
-                        bError = true;\r
-                        break;\r
-                    }\r
-\r
-                    // Grab the object member that contains an array of all reponses...\r
-                    // ...eval is necessary here since aSchema[0] is of unknown depth\r
-                    jsonList = eval("(jsonObjRaw." + aSchema[0]+")");\r
-                }\r
-                catch(e) {\r
-                    bError = true;\r
-                    break;\r
-               }\r
-            }\r
-\r
-            if(!jsonList) {\r
-                bError = true;\r
-                break;\r
-            }\r
-\r
-            if(jsonList.constructor != Array) {\r
-                jsonList = [jsonList];\r
-            }\r
-            \r
-            // Loop through the array of all responses...\r
-            for(var i = jsonList.length-1; i >= 0 ; i--) {\r
-                var aResultItem = [];\r
-                var jsonResult = jsonList[i];\r
-                // ...and loop through each data field value of each response\r
-                for(var j = aSchema.length-1; j >= 1 ; j--) {\r
-                    // ...and capture data into an array mapped according to the schema...\r
-                    var dataFieldValue = jsonResult[aSchema[j]];\r
-                    if(!dataFieldValue) {\r
-                        dataFieldValue = "";\r
-                    }\r
-                    //YAHOO.log("data: " + i + " value:" +j+" = "+dataFieldValue,"debug",this.toString());\r
-                    aResultItem.unshift(dataFieldValue);\r
-                }\r
-                // If schema isn't well defined, pass along the entire result object\r
-                if(aResultItem.length == 1) {\r
-                    aResultItem.push(jsonResult);\r
-                }\r
-                // Capture the array of data field values in an array of results\r
-                aResults.unshift(aResultItem);\r
-            }\r
-            break;\r
-        case YAHOO.widget.DS_XHR.TYPE_XML:\r
-            // Get the collection of results\r
-            var xmlList = oResponse.getElementsByTagName(aSchema[0]);\r
-            if(!xmlList) {\r
-                bError = true;\r
-                break;\r
-            }\r
-            // Loop through each result\r
-            for(var k = xmlList.length-1; k >= 0 ; k--) {\r
-                var result = xmlList.item(k);\r
-                //YAHOO.log("Result"+k+" is "+result.attributes.item(0).firstChild.nodeValue,"debug",this.toString());\r
-                var aFieldSet = [];\r
-                // Loop through each data field in each result using the schema\r
-                for(var m = aSchema.length-1; m >= 1 ; m--) {\r
-                    //YAHOO.log(aSchema[m]+" is "+result.attributes.getNamedItem(aSchema[m]).firstChild.nodeValue);\r
-                    var sValue = null;\r
-                    // Values may be held in an attribute...\r
-                    var xmlAttr = result.attributes.getNamedItem(aSchema[m]);\r
-                    if(xmlAttr) {\r
-                        sValue = xmlAttr.value;\r
-                        //YAHOO.log("Attr value is "+sValue,"debug",this.toString());\r
-                    }\r
-                    // ...or in a node\r
-                    else{\r
-                        var xmlNode = result.getElementsByTagName(aSchema[m]);\r
-                        if(xmlNode && xmlNode.item(0) && xmlNode.item(0).firstChild) {\r
-                            sValue = xmlNode.item(0).firstChild.nodeValue;\r
-                            //YAHOO.log("Node value is "+sValue,"debug",this.toString());\r
-                        }\r
-                        else {\r
-                            sValue = "";\r
-                            //YAHOO.log("Value not found","debug",this.toString());\r
-                        }\r
-                    }\r
-                    // Capture the schema-mapped data field values into an array\r
-                    aFieldSet.unshift(sValue);\r
-                }\r
-                // Capture each array of values into an array of results\r
-                aResults.unshift(aFieldSet);\r
-            }\r
-            break;\r
-        case YAHOO.widget.DS_XHR.TYPE_FLAT:\r
-            if(oResponse.length > 0) {\r
-                // Delete the last line delimiter at the end of the data if it exists\r
-                var newLength = oResponse.length-aSchema[0].length;\r
-                if(oResponse.substr(newLength) == aSchema[0]) {\r
-                    oResponse = oResponse.substr(0, newLength);\r
-                }\r
-                var aRecords = oResponse.split(aSchema[0]);\r
-                for(var n = aRecords.length-1; n >= 0; n--) {\r
-                    aResults[n] = aRecords[n].split(aSchema[1]);\r
-                }\r
-            }\r
-            break;\r
-        default:\r
-            break;\r
-    }\r
-    sQuery = null;\r
-    oResponse = null;\r
-    oParent = null;\r
-    if(bError) {\r
-        return null;\r
-    }\r
-    else {\r
-        return aResults;\r
-    }\r
-};            \r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * XHR connection object.\r
- *\r
- * @property _oConn\r
- * @type Object\r
- * @private\r
- */\r
-YAHOO.widget.DS_XHR.prototype._oConn = null;\r
-\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * Implementation of YAHOO.widget.DataSource using a native Javascript function as\r
- * its live data source.\r
- *  \r
- * @class DS_JSFunction\r
- * @constructor\r
- * @extends YAHOO.widget.DataSource\r
- * @param oFunction {HTMLFunction} In-memory Javascript function that returns query results as an array of objects.\r
- * @param oConfigs {Object} (optional) Object literal of config params.\r
- */\r
-YAHOO.widget.DS_JSFunction = function(oFunction, oConfigs) {\r
-    // Set any config params passed in to override defaults\r
-    if(typeof oConfigs == "object") {\r
-        for(var sConfig in oConfigs) {\r
-            this[sConfig] = oConfigs[sConfig];\r
-        }\r
-    }\r
-\r
-    // Initialization sequence\r
-    if(!oFunction  || (oFunction.constructor != Function)) {\r
-        YAHOO.log("Could not instantiate JSFunction DataSource due to invalid arguments", "error", this.toString());\r
-        return;\r
-    }\r
-    else {\r
-        this.dataFunction = oFunction;\r
-        this._init();\r
-        YAHOO.log("JS Function DataSource initialized","info",this.toString());\r
-    }\r
-};\r
-\r
-YAHOO.widget.DS_JSFunction.prototype = new YAHOO.widget.DataSource();\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * In-memory Javascript function that returns query results.\r
- *\r
- * @property dataFunction\r
- * @type HTMLFunction\r
- */\r
-YAHOO.widget.DS_JSFunction.prototype.dataFunction = null;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Queries the live data source defined by function for results. Results are\r
- * passed back to a callback function.\r
- *  \r
- * @method doQuery\r
- * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- */\r
-YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r
-    var oFunction = this.dataFunction;\r
-    var aResults = [];\r
-    \r
-    aResults = oFunction(sQuery);\r
-    if(aResults === null) {\r
-        this.dataErrorEvent.fire(this, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r
-        YAHOO.log(YAHOO.widget.DataSource.ERROR_DATANULL, "error", this.toString());\r
-        return;\r
-    }\r
-    \r
-    var resultObj = {};\r
-    resultObj.query = decodeURIComponent(sQuery);\r
-    resultObj.results = aResults;\r
-    this._addCacheElem(resultObj);\r
-    \r
-    this.getResultsEvent.fire(this, oParent, sQuery, aResults);\r
-    oCallbackFn(sQuery, aResults, oParent);\r
-    return;\r
-};\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * Implementation of YAHOO.widget.DataSource using a native Javascript array as\r
- * its live data source.\r
- *\r
- * @class DS_JSArray\r
- * @constructor\r
- * @extends YAHOO.widget.DataSource\r
- * @param aData {String[]} In-memory Javascript array of simple string data.\r
- * @param oConfigs {Object} (optional) Object literal of config params.\r
- */\r
-YAHOO.widget.DS_JSArray = function(aData, oConfigs) {\r
-    // Set any config params passed in to override defaults\r
-    if(typeof oConfigs == "object") {\r
-        for(var sConfig in oConfigs) {\r
-            this[sConfig] = oConfigs[sConfig];\r
-        }\r
-    }\r
-\r
-    // Initialization sequence\r
-    if(!aData || (aData.constructor != Array)) {\r
-        YAHOO.log("Could not instantiate JSArray DataSource due to invalid arguments", "error", this.toString());\r
-        return;\r
-    }\r
-    else {\r
-        this.data = aData;\r
-        this._init();\r
-        YAHOO.log("JS Array DataSource initialized","info",this.toString());\r
-    }\r
-};\r
-\r
-YAHOO.widget.DS_JSArray.prototype = new YAHOO.widget.DataSource();\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * In-memory Javascript array of strings.\r
- *\r
- * @property data\r
- * @type Array\r
- */\r
-YAHOO.widget.DS_JSArray.prototype.data = null;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Queries the live data source defined by data for results. Results are passed\r
- * back to a callback function.\r
- *\r
- * @method doQuery\r
- * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- */\r
-YAHOO.widget.DS_JSArray.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r
-    var aData = this.data; // the array\r
-    var aResults = []; // container for results\r
-    var bMatchFound = false;\r
-    var bMatchContains = this.queryMatchContains;\r
-    if(sQuery) {\r
-        if(!this.queryMatchCase) {\r
-            sQuery = sQuery.toLowerCase();\r
-        }\r
-\r
-        // Loop through each element of the array...\r
-        // which can be a string or an array of strings\r
-        for(var i = aData.length-1; i >= 0; i--) {\r
-            var aDataset = [];\r
-\r
-            if(aData[i]) {\r
-                if(aData[i].constructor == String) {\r
-                    aDataset[0] = aData[i];\r
-                }\r
-                else if(aData[i].constructor == Array) {\r
-                    aDataset = aData[i];\r
-                }\r
-            }\r
-\r
-            if(aDataset[0] && (aDataset[0].constructor == String)) {\r
-                var sKeyIndex = (this.queryMatchCase) ?\r
-                encodeURIComponent(aDataset[0]).indexOf(sQuery):\r
-                encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);\r
-\r
-                // A STARTSWITH match is when the query is found at the beginning of the key string...\r
-                if((!bMatchContains && (sKeyIndex === 0)) ||\r
-                // A CONTAINS match is when the query is found anywhere within the key string...\r
-                (bMatchContains && (sKeyIndex > -1))) {\r
-                    // Stash a match into aResults[].\r
-                    aResults.unshift(aDataset);\r
-                }\r
-            }\r
-        }\r
-    }\r
-\r
-    this.getResultsEvent.fire(this, oParent, sQuery, aResults);\r
-    oCallbackFn(sQuery, aResults, oParent);\r
-};\r
+ /**
+ * The AutoComplete control provides the front-end logic for text-entry suggestion and
+ * completion functionality.
+ *
+ * @module autocomplete
+ * @requires yahoo, dom, event, datasource
+ * @optional animation, connection
+ * @namespace YAHOO.widget
+ * @title AutoComplete Widget
+ */
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The AutoComplete class provides the customizable functionality of a plug-and-play DHTML
+ * auto completion widget.  Some key features:
+ * <ul>
+ * <li>Navigate with up/down arrow keys and/or mouse to pick a selection</li>
+ * <li>The drop down container can "roll down" or "fly out" via configurable
+ * animation</li>
+ * <li>UI look-and-feel customizable through CSS, including container
+ * attributes, borders, position, fonts, etc</li>
+ * </ul>
+ *
+ * @class AutoComplete
+ * @constructor
+ * @param elInput {HTMLElement} DOM element reference of an input field.
+ * @param elInput {String} String ID of an input field.
+ * @param elContainer {HTMLElement} DOM element reference of an existing DIV.
+ * @param elContainer {String} String ID of an existing DIV.
+ * @param oDataSource {YAHOO.widget.DataSource} DataSource instance.
+ * @param oConfigs {Object} (optional) Object literal of configuration params.
+ */
+YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {
+    if(elInput && elContainer && oDataSource) {
+        // Validate DataSource
+        if(oDataSource instanceof YAHOO.widget.DataSource) {
+            this.dataSource = oDataSource;
+        }
+        else {
+            YAHOO.log("Could not instantiate AutoComplete due to an invalid DataSource", "error", this.toString());
+            return;
+        }
+
+        // Validate input element
+        if(YAHOO.util.Dom.inDocument(elInput)) {
+            if(YAHOO.lang.isString(elInput)) {
+                    this._sName = "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput;
+                    this._oTextbox = document.getElementById(elInput);
+            }
+            else {
+                this._sName = (elInput.id) ?
+                    "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput.id:
+                    "instance" + YAHOO.widget.AutoComplete._nIndex;
+                this._oTextbox = elInput;
+            }
+            YAHOO.util.Dom.addClass(this._oTextbox, "yui-ac-input");
+        }
+        else {
+            YAHOO.log("Could not instantiate AutoComplete due to an invalid input element", "error", this.toString());
+            return;
+        }
+
+        // Validate container element
+        if(YAHOO.util.Dom.inDocument(elContainer)) {
+            if(YAHOO.lang.isString(elContainer)) {
+                    this._oContainer = document.getElementById(elContainer);
+            }
+            else {
+                this._oContainer = elContainer;
+            }
+            if(this._oContainer.style.display == "none") {
+                YAHOO.log("The container may not display properly if display is set to \"none\" in CSS", "warn", this.toString());
+            }
+            
+            // For skinning
+            var elParent = this._oContainer.parentNode;
+            var elTag = elParent.tagName.toLowerCase();
+            while(elParent && (elParent != "document")) {
+                if(elTag == "div") {
+                    YAHOO.util.Dom.addClass(elParent, "yui-ac");
+                    break;
+                }
+                else {
+                    elParent = elParent.parentNode;
+                    elTag = elParent.tagName.toLowerCase();
+                }
+            }
+            if(elTag != "div") {
+                YAHOO.log("Could not find an appropriate parent container for skinning", "warn", this.toString());
+            }
+        }
+        else {
+            YAHOO.log("Could not instantiate AutoComplete due to an invalid container element", "error", this.toString());
+            return;
+        }
+
+        // Set any config params passed in to override defaults
+        if(oConfigs && (oConfigs.constructor == Object)) {
+            for(var sConfig in oConfigs) {
+                if(sConfig) {
+                    this[sConfig] = oConfigs[sConfig];
+                }
+            }
+        }
+
+        // Initialization sequence
+        this._initContainer();
+        this._initProps();
+        this._initList();
+        this._initContainerHelpers();
+
+        // Set up events
+        var oSelf = this;
+        var oTextbox = this._oTextbox;
+        // Events are actually for the content module within the container
+        var oContent = this._oContainer._oContent;
+
+        // Dom events
+        YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);
+        YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);
+        YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);
+        YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);
+        YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);
+        YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);
+        YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);
+        YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);
+        if(oTextbox.form) {
+            YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);
+        }
+        YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);
+
+        // Custom events
+        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);
+        
+        // Finish up
+        oTextbox.setAttribute("autocomplete","off");
+        YAHOO.widget.AutoComplete._nIndex++;
+        YAHOO.log("AutoComplete initialized","info",this.toString());
+    }
+    // Required arguments were not found
+    else {
+        YAHOO.log("Could not instantiate AutoComplete due invalid arguments", "error", this.toString());
+    }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * The DataSource object that encapsulates the data used for auto completion.
+ * This object should be an inherited object from YAHOO.widget.DataSource.
+ *
+ * @property dataSource
+ * @type YAHOO.widget.DataSource
+ */
+YAHOO.widget.AutoComplete.prototype.dataSource = null;
+
+/**
+ * Number of characters that must be entered before querying for results. A negative value
+ * effectively turns off the widget. A value of 0 allows queries of null or empty string
+ * values.
+ *
+ * @property minQueryLength
+ * @type Number
+ * @default 1
+ */
+YAHOO.widget.AutoComplete.prototype.minQueryLength = 1;
+
+/**
+ * Maximum number of results to display in results container.
+ *
+ * @property maxResultsDisplayed
+ * @type Number
+ * @default 10
+ */
+YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed = 10;
+
+/**
+ * Number of seconds to delay before submitting a query request.  If a query
+ * request is received before a previous one has completed its delay, the
+ * previous request is cancelled and the new request is set to the delay.
+ * Implementers should take care when setting this value very low (i.e., less
+ * than 0.2) with low latency DataSources and the typeAhead feature enabled, as
+ * fast typers may see unexpected behavior.
+ *
+ * @property queryDelay
+ * @type Number
+ * @default 0.2
+ */
+YAHOO.widget.AutoComplete.prototype.queryDelay = 0.2;
+
+/**
+ * Class name of a highlighted item within results container.
+ *
+ * @property highlightClassName
+ * @type String
+ * @default "yui-ac-highlight"
+ */
+YAHOO.widget.AutoComplete.prototype.highlightClassName = "yui-ac-highlight";
+
+/**
+ * Class name of a pre-highlighted item within results container.
+ *
+ * @property prehighlightClassName
+ * @type String
+ */
+YAHOO.widget.AutoComplete.prototype.prehighlightClassName = null;
+
+/**
+ * Query delimiter. A single character separator for multiple delimited
+ * selections. Multiple delimiter characteres may be defined as an array of
+ * strings. A null value or empty string indicates that query results cannot
+ * be delimited. This feature is not recommended if you need forceSelection to
+ * be true.
+ *
+ * @property delimChar
+ * @type String | String[]
+ */
+YAHOO.widget.AutoComplete.prototype.delimChar = null;
+
+/**
+ * Whether or not the first item in results container should be automatically highlighted
+ * on expand.
+ *
+ * @property autoHighlight
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.AutoComplete.prototype.autoHighlight = true;
+
+/**
+ * Whether or not the input field should be automatically updated
+ * with the first query result as the user types, auto-selecting the substring
+ * that the user has not typed.
+ *
+ * @property typeAhead
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.typeAhead = false;
+
+/**
+ * Whether or not to animate the expansion/collapse of the results container in the
+ * horizontal direction.
+ *
+ * @property animHoriz
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.animHoriz = false;
+
+/**
+ * Whether or not to animate the expansion/collapse of the results container in the
+ * vertical direction.
+ *
+ * @property animVert
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.AutoComplete.prototype.animVert = true;
+
+/**
+ * Speed of container expand/collapse animation, in seconds..
+ *
+ * @property animSpeed
+ * @type Number
+ * @default 0.3
+ */
+YAHOO.widget.AutoComplete.prototype.animSpeed = 0.3;
+
+/**
+ * Whether or not to force the user's selection to match one of the query
+ * results. Enabling this feature essentially transforms the input field into a
+ * &lt;select&gt; field. This feature is not recommended with delimiter character(s)
+ * defined.
+ *
+ * @property forceSelection
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.forceSelection = false;
+
+/**
+ * Whether or not to allow browsers to cache user-typed input in the input
+ * field. Disabling this feature will prevent the widget from setting the
+ * autocomplete="off" on the input field. When autocomplete="off"
+ * and users click the back button after form submission, user-typed input can
+ * be prefilled by the browser from its cache. This caching of user input may
+ * not be desired for sensitive data, such as credit card numbers, in which
+ * case, implementers should consider setting allowBrowserAutocomplete to false.
+ *
+ * @property allowBrowserAutocomplete
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete = true;
+
+/**
+ * Whether or not the results container should always be displayed.
+ * Enabling this feature displays the container when the widget is instantiated
+ * and prevents the toggling of the container to a collapsed state.
+ *
+ * @property alwaysShowContainer
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.alwaysShowContainer = false;
+
+/**
+ * Whether or not to use an iFrame to layer over Windows form elements in
+ * IE. Set to true only when the results container will be on top of a
+ * &lt;select&gt; field in IE and thus exposed to the IE z-index bug (i.e.,
+ * 5.5 < IE < 7).
+ *
+ * @property useIFrame
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.useIFrame = false;
+
+/**
+ * Whether or not the results container should have a shadow.
+ *
+ * @property useShadow
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.useShadow = false;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Public accessor to the unique name of the AutoComplete instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.toString = function() {
+    return "AutoComplete " + this._sName;
+};
+
+ /**
+ * Returns true if container is in an expanded state, false otherwise.
+ *
+ * @method isContainerOpen
+ * @return {Boolean} Returns true if container is in an expanded state, false otherwise.
+ */
+YAHOO.widget.AutoComplete.prototype.isContainerOpen = function() {
+    return this._bContainerOpen;
+};
+
+/**
+ * Public accessor to the internal array of DOM &lt;li&gt; elements that
+ * display query results within the results container.
+ *
+ * @method getListItems
+ * @return {HTMLElement[]} Array of &lt;li&gt; elements within the results container.
+ */
+YAHOO.widget.AutoComplete.prototype.getListItems = function() {
+    return this._aListItems;
+};
+
+/**
+ * Public accessor to the data held in an &lt;li&gt; element of the
+ * results container.
+ *
+ * @method getListItemData
+ * @return {Object | Object[]} Object or array of result data or null
+ */
+YAHOO.widget.AutoComplete.prototype.getListItemData = function(oListItem) {
+    if(oListItem._oResultData) {
+        return oListItem._oResultData;
+    }
+    else {
+        return false;
+    }
+};
+
+/**
+ * Sets HTML markup for the results container header. This markup will be
+ * inserted within a &lt;div&gt; tag with a class of "yui-ac-hd".
+ *
+ * @method setHeader
+ * @param sHeader {String} HTML markup for results container header.
+ */
+YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) {
+    if(sHeader) {
+        if(this._oContainer._oContent._oHeader) {
+            this._oContainer._oContent._oHeader.innerHTML = sHeader;
+            this._oContainer._oContent._oHeader.style.display = "block";
+        }
+    }
+    else {
+        this._oContainer._oContent._oHeader.innerHTML = "";
+        this._oContainer._oContent._oHeader.style.display = "none";
+    }
+};
+
+/**
+ * Sets HTML markup for the results container footer. This markup will be
+ * inserted within a &lt;div&gt; tag with a class of "yui-ac-ft".
+ *
+ * @method setFooter
+ * @param sFooter {String} HTML markup for results container footer.
+ */
+YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) {
+    if(sFooter) {
+        if(this._oContainer._oContent._oFooter) {
+            this._oContainer._oContent._oFooter.innerHTML = sFooter;
+            this._oContainer._oContent._oFooter.style.display = "block";
+        }
+    }
+    else {
+        this._oContainer._oContent._oFooter.innerHTML = "";
+        this._oContainer._oContent._oFooter.style.display = "none";
+    }
+};
+
+/**
+ * Sets HTML markup for the results container body. This markup will be
+ * inserted within a &lt;div&gt; tag with a class of "yui-ac-bd".
+ *
+ * @method setBody
+ * @param sBody {String} HTML markup for results container body.
+ */
+YAHOO.widget.AutoComplete.prototype.setBody = function(sBody) {
+    if(sBody) {
+        if(this._oContainer._oContent._oBody) {
+            this._oContainer._oContent._oBody.innerHTML = sBody;
+            this._oContainer._oContent._oBody.style.display = "block";
+            this._oContainer._oContent.style.display = "block";
+        }
+    }
+    else {
+        this._oContainer._oContent._oBody.innerHTML = "";
+        this._oContainer._oContent.style.display = "none";
+    }
+    this._maxResultsDisplayed = 0;
+};
+
+/**
+ * Overridable method that converts a result item object into HTML markup
+ * for display. Return data values are accessible via the oResultItem object,
+ * and the key return value will always be oResultItem[0]. Markup will be
+ * displayed within &lt;li&gt; element tags in the container.
+ *
+ * @method formatResult
+ * @param oResultItem {Object} Result item representing one query result. Data is held in an array.
+ * @param sQuery {String} The current query string.
+ * @return {String} HTML markup of formatted result data.
+ */
+YAHOO.widget.AutoComplete.prototype.formatResult = function(oResultItem, sQuery) {
+    var sResult = oResultItem[0];
+    if(sResult) {
+        return sResult;
+    }
+    else {
+        return "";
+    }
+};
+
+/**
+ * Overridable method called before container expands allows implementers to access data
+ * and DOM elements.
+ *
+ * @method doBeforeExpandContainer
+ * @param oTextbox {HTMLElement} The text input box.
+ * @param oContainer {HTMLElement} The container element.
+ * @param sQuery {String} The query string.
+ * @param aResults {Object[]}  An array of query results.
+ * @return {Boolean} Return true to continue expanding container, false to cancel the expand.
+ */
+YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer = function(oTextbox, oContainer, sQuery, aResults) {
+    return true;
+};
+
+/**
+ * Makes query request to the DataSource.
+ *
+ * @method sendQuery
+ * @param sQuery {String} Query string.
+ */
+YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {
+    this._sendQuery(sQuery);
+};
+
+/**
+ * Overridable method gives implementers access to the query before it gets sent.
+ *
+ * @method doBeforeSendQuery
+ * @param sQuery {String} Query string.
+ * @return {String} Query string.
+ */
+YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery = function(sQuery) {
+    return sQuery;
+};
+
+/**
+ * Nulls out the entire AutoComplete instance and related objects, removes attached
+ * event listeners, and clears out DOM elements inside the container. After
+ * calling this method, the instance reference should be expliclitly nulled by
+ * implementer, as in myDataTable = null. Use with caution!
+ *
+ * @method destroy
+ */
+YAHOO.widget.AutoComplete.prototype.destroy = function() {
+    var instanceName = this.toString();
+    var elInput = this._oTextbox;
+    var elContainer = this._oContainer;
+
+    // Unhook custom events
+    this.textboxFocusEvent.unsubscribe();
+    this.textboxKeyEvent.unsubscribe();
+    this.dataRequestEvent.unsubscribe();
+    this.dataReturnEvent.unsubscribe();
+    this.dataErrorEvent.unsubscribe();
+    this.containerExpandEvent.unsubscribe();
+    this.typeAheadEvent.unsubscribe();
+    this.itemMouseOverEvent.unsubscribe();
+    this.itemMouseOutEvent.unsubscribe();
+    this.itemArrowToEvent.unsubscribe();
+    this.itemArrowFromEvent.unsubscribe();
+    this.itemSelectEvent.unsubscribe();
+    this.unmatchedItemSelectEvent.unsubscribe();
+    this.selectionEnforceEvent.unsubscribe();
+    this.containerCollapseEvent.unsubscribe();
+    this.textboxBlurEvent.unsubscribe();
+
+    // Unhook DOM events
+    YAHOO.util.Event.purgeElement(elInput, true);
+    YAHOO.util.Event.purgeElement(elContainer, true);
+
+    // Remove DOM elements
+    elContainer.innerHTML = "";
+
+    // Null out objects
+    for(var key in this) {
+        if(this.hasOwnProperty(key)) {
+            this[key] = null;
+        }
+    }
+
+    YAHOO.log("AutoComplete instance destroyed: " + instanceName);
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public events
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Fired when the input field receives focus.
+ *
+ * @event textboxFocusEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.textboxFocusEvent = null;
+
+/**
+ * Fired when the input field receives key input.
+ *
+ * @event textboxKeyEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param nKeycode {Number} The keycode number.
+ */
+YAHOO.widget.AutoComplete.prototype.textboxKeyEvent = null;
+
+/**
+ * Fired when the AutoComplete instance makes a query to the DataSource.
+ * 
+ * @event dataRequestEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param sQuery {String} The query string.
+ */
+YAHOO.widget.AutoComplete.prototype.dataRequestEvent = null;
+
+/**
+ * Fired when the AutoComplete instance receives query results from the data
+ * source.
+ *
+ * @event dataReturnEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param sQuery {String} The query string.
+ * @param aResults {Object[]} Results array.
+ */
+YAHOO.widget.AutoComplete.prototype.dataReturnEvent = null;
+
+/**
+ * Fired when the AutoComplete instance does not receive query results from the
+ * DataSource due to an error.
+ *
+ * @event dataErrorEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param sQuery {String} The query string.
+ */
+YAHOO.widget.AutoComplete.prototype.dataErrorEvent = null;
+
+/**
+ * Fired when the results container is expanded.
+ *
+ * @event containerExpandEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.containerExpandEvent = null;
+
+/**
+ * Fired when the input field has been prefilled by the type-ahead
+ * feature. 
+ *
+ * @event typeAheadEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param sQuery {String} The query string.
+ * @param sPrefill {String} The prefill string.
+ */
+YAHOO.widget.AutoComplete.prototype.typeAheadEvent = null;
+
+/**
+ * Fired when result item has been moused over.
+ *
+ * @event itemMouseOverEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param elItem {HTMLElement} The &lt;li&gt element item moused to.
+ */
+YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent = null;
+
+/**
+ * Fired when result item has been moused out.
+ *
+ * @event itemMouseOutEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param elItem {HTMLElement} The &lt;li&gt; element item moused from.
+ */
+YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent = null;
+
+/**
+ * Fired when result item has been arrowed to. 
+ *
+ * @event itemArrowToEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param elItem {HTMLElement} The &lt;li&gt; element item arrowed to.
+ */
+YAHOO.widget.AutoComplete.prototype.itemArrowToEvent = null;
+
+/**
+ * Fired when result item has been arrowed away from.
+ *
+ * @event itemArrowFromEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param elItem {HTMLElement} The &lt;li&gt; element item arrowed from.
+ */
+YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent = null;
+
+/**
+ * Fired when an item is selected via mouse click, ENTER key, or TAB key.
+ *
+ * @event itemSelectEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param elItem {HTMLElement} The selected &lt;li&gt; element item.
+ * @param oData {Object} The data returned for the item, either as an object,
+ * or mapped from the schema into an array.
+ */
+YAHOO.widget.AutoComplete.prototype.itemSelectEvent = null;
+
+/**
+ * Fired when a user selection does not match any of the displayed result items.
+ * Note that this event may not behave as expected when delimiter characters
+ * have been defined. 
+ *
+ * @event unmatchedItemSelectEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param sQuery {String} The user-typed query string.
+ */
+YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent = null;
+
+/**
+ * Fired if forceSelection is enabled and the user's input has been cleared
+ * because it did not match one of the returned query results.
+ *
+ * @event selectionEnforceEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent = null;
+
+/**
+ * Fired when the results container is collapsed.
+ *
+ * @event containerCollapseEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.containerCollapseEvent = null;
+
+/**
+ * Fired when the input field loses focus.
+ *
+ * @event textboxBlurEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.textboxBlurEvent = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class variable to index multiple AutoComplete instances.
+ *
+ * @property _nIndex
+ * @type Number
+ * @default 0
+ * @private
+ */
+YAHOO.widget.AutoComplete._nIndex = 0;
+
+/**
+ * Name of AutoComplete instance.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._sName = null;
+
+/**
+ * Text input field DOM element.
+ *
+ * @property _oTextbox
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._oTextbox = null;
+
+/**
+ * Whether or not the input field is currently in focus. If query results come back
+ * but the user has already moved on, do not proceed with auto complete behavior.
+ *
+ * @property _bFocused
+ * @type Boolean
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._bFocused = true;
+
+/**
+ * Animation instance for container expand/collapse.
+ *
+ * @property _oAnim
+ * @type Boolean
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._oAnim = null;
+
+/**
+ * Container DOM element.
+ *
+ * @property _oContainer
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._oContainer = null;
+
+/**
+ * Whether or not the results container is currently open.
+ *
+ * @property _bContainerOpen
+ * @type Boolean
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._bContainerOpen = false;
+
+/**
+ * Whether or not the mouse is currently over the results
+ * container. This is necessary in order to prevent clicks on container items
+ * from being text input field blur events.
+ *
+ * @property _bOverContainer
+ * @type Boolean
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._bOverContainer = false;
+
+/**
+ * Array of &lt;li&gt; elements references that contain query results within the
+ * results container.
+ *
+ * @property _aListItems
+ * @type HTMLElement[]
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._aListItems = null;
+
+/**
+ * Number of &lt;li&gt; elements currently displayed in results container.
+ *
+ * @property _nDisplayedItems
+ * @type Number
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._nDisplayedItems = 0;
+
+/**
+ * Internal count of &lt;li&gt; elements displayed and hidden in results container.
+ *
+ * @property _maxResultsDisplayed
+ * @type Number
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed = 0;
+
+/**
+ * Current query string
+ *
+ * @property _sCurQuery
+ * @type String
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._sCurQuery = null;
+
+/**
+ * Past queries this session (for saving delimited queries).
+ *
+ * @property _sSavedQuery
+ * @type String
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._sSavedQuery = null;
+
+/**
+ * Pointer to the currently highlighted &lt;li&gt; element in the container.
+ *
+ * @property _oCurItem
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._oCurItem = null;
+
+/**
+ * Whether or not an item has been selected since the container was populated
+ * with results. Reset to false by _populateList, and set to true when item is
+ * selected.
+ *
+ * @property _bItemSelected
+ * @type Boolean
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._bItemSelected = false;
+
+/**
+ * Key code of the last key pressed in textbox.
+ *
+ * @property _nKeyCode
+ * @type Number
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._nKeyCode = null;
+
+/**
+ * Delay timeout ID.
+ *
+ * @property _nDelayID
+ * @type Number
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._nDelayID = -1;
+
+/**
+ * Src to iFrame used when useIFrame = true. Supports implementations over SSL
+ * as well.
+ *
+ * @property _iFrameSrc
+ * @type String
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._iFrameSrc = "javascript:false;";
+
+/**
+ * For users typing via certain IMEs, queries must be triggered by intervals,
+ * since key events yet supported across all browsers for all IMEs.
+ *
+ * @property _queryInterval
+ * @type Object
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._queryInterval = null;
+
+/**
+ * Internal tracker to last known textbox value, used to determine whether or not
+ * to trigger a query via interval for certain IME users.
+ *
+ * @event _sLastTextboxValue
+ * @type String
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._sLastTextboxValue = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Updates and validates latest public config properties.
+ *
+ * @method __initProps
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._initProps = function() {
+    // Correct any invalid values
+    var minQueryLength = this.minQueryLength;
+    if(!YAHOO.lang.isNumber(minQueryLength)) {
+        this.minQueryLength = 1;
+    }
+    var maxResultsDisplayed = this.maxResultsDisplayed;
+    if(!YAHOO.lang.isNumber(maxResultsDisplayed) || (maxResultsDisplayed < 1)) {
+        this.maxResultsDisplayed = 10;
+    }
+    var queryDelay = this.queryDelay;
+    if(!YAHOO.lang.isNumber(queryDelay) || (queryDelay < 0)) {
+        this.queryDelay = 0.2;
+    }
+    var delimChar = this.delimChar;
+    if(YAHOO.lang.isString(delimChar)) {
+        this.delimChar = [delimChar];
+    }
+    else if(!YAHOO.lang.isArray(delimChar)) {
+        this.delimChar = null;
+    }
+    var animSpeed = this.animSpeed;
+    if((this.animHoriz || this.animVert) && YAHOO.util.Anim) {
+        if(!YAHOO.lang.isNumber(animSpeed) || (animSpeed < 0)) {
+            this.animSpeed = 0.3;
+        }
+        if(!this._oAnim ) {
+            this._oAnim = new YAHOO.util.Anim(this._oContainer._oContent, {}, this.animSpeed);
+        }
+        else {
+            this._oAnim.duration = this.animSpeed;
+        }
+    }
+    if(this.forceSelection && delimChar) {
+        YAHOO.log("The forceSelection feature has been enabled with delimChar defined.","warn", this.toString());
+    }
+};
+
+/**
+ * Initializes the results container helpers if they are enabled and do
+ * not exist
+ *
+ * @method _initContainerHelpers
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._initContainerHelpers = function() {
+    if(this.useShadow && !this._oContainer._oShadow) {
+        var oShadow = document.createElement("div");
+        oShadow.className = "yui-ac-shadow";
+        this._oContainer._oShadow = this._oContainer.appendChild(oShadow);
+    }
+    if(this.useIFrame && !this._oContainer._oIFrame) {
+        var oIFrame = document.createElement("iframe");
+        oIFrame.src = this._iFrameSrc;
+        oIFrame.frameBorder = 0;
+        oIFrame.scrolling = "no";
+        oIFrame.style.position = "absolute";
+        oIFrame.style.width = "100%";
+        oIFrame.style.height = "100%";
+        oIFrame.tabIndex = -1;
+        this._oContainer._oIFrame = this._oContainer.appendChild(oIFrame);
+    }
+};
+
+/**
+ * Initializes the results container once at object creation
+ *
+ * @method _initContainer
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._initContainer = function() {
+    YAHOO.util.Dom.addClass(this._oContainer, "yui-ac-container");
+    
+    if(!this._oContainer._oContent) {
+        // The oContent div helps size the iframe and shadow properly
+        var oContent = document.createElement("div");
+        oContent.className = "yui-ac-content";
+        oContent.style.display = "none";
+        this._oContainer._oContent = this._oContainer.appendChild(oContent);
+
+        var oHeader = document.createElement("div");
+        oHeader.className = "yui-ac-hd";
+        oHeader.style.display = "none";
+        this._oContainer._oContent._oHeader = this._oContainer._oContent.appendChild(oHeader);
+
+        var oBody = document.createElement("div");
+        oBody.className = "yui-ac-bd";
+        this._oContainer._oContent._oBody = this._oContainer._oContent.appendChild(oBody);
+
+        var oFooter = document.createElement("div");
+        oFooter.className = "yui-ac-ft";
+        oFooter.style.display = "none";
+        this._oContainer._oContent._oFooter = this._oContainer._oContent.appendChild(oFooter);
+    }
+    else {
+        YAHOO.log("Could not initialize the container","warn",this.toString());
+    }
+};
+
+/**
+ * Clears out contents of container body and creates up to
+ * YAHOO.widget.AutoComplete#maxResultsDisplayed &lt;li&gt; elements in an
+ * &lt;ul&gt; element.
+ *
+ * @method _initList
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._initList = function() {
+    this._aListItems = [];
+    while(this._oContainer._oContent._oBody.hasChildNodes()) {
+        var oldListItems = this.getListItems();
+        if(oldListItems) {
+            for(var oldi = oldListItems.length-1; oldi >= 0; oldi--) {
+                oldListItems[oldi] = null;
+            }
+        }
+        this._oContainer._oContent._oBody.innerHTML = "";
+    }
+
+    var oList = document.createElement("ul");
+    oList = this._oContainer._oContent._oBody.appendChild(oList);
+    for(var i=0; i<this.maxResultsDisplayed; i++) {
+        var oItem = document.createElement("li");
+        oItem = oList.appendChild(oItem);
+        this._aListItems[i] = oItem;
+        this._initListItem(oItem, i);
+    }
+    this._maxResultsDisplayed = this.maxResultsDisplayed;
+};
+
+/**
+ * Initializes each &lt;li&gt; element in the container list.
+ *
+ * @method _initListItem
+ * @param oItem {HTMLElement} The &lt;li&gt; DOM element.
+ * @param nItemIndex {Number} The index of the element.
+ * @private
+ */
+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);
+};
+
+/**
+ * Enables interval detection for  Korean IME support.
+ *
+ * @method _onIMEDetected
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onIMEDetected = function(oSelf) {
+    oSelf._enableIntervalDetection();
+};
+
+/**
+ * Enables query triggers based on text input detection by intervals (rather
+ * than by key events).
+ *
+ * @method _enableIntervalDetection
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._enableIntervalDetection = function() {
+    var currValue = this._oTextbox.value;
+    var lastValue = this._sLastTextboxValue;
+    if(currValue != lastValue) {
+        this._sLastTextboxValue = currValue;
+        this._sendQuery(currValue);
+    }
+};
+
+
+/**
+ * Cancels text input detection by intervals.
+ *
+ * @method _cancelIntervalDetection
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._cancelIntervalDetection = function(oSelf) {
+    if(oSelf._queryInterval) {
+        clearInterval(oSelf._queryInterval);
+    }
+};
+
+
+/**
+ * Whether or not key is functional or should be ignored. Note that the right
+ * arrow key is NOT an ignored key since it triggers queries for certain intl
+ * charsets.
+ *
+ * @method _isIgnoreKey
+ * @param nKeycode {Number} Code of key pressed.
+ * @return {Boolean} True if key should be ignored, false otherwise.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._isIgnoreKey = function(nKeyCode) {
+    if((nKeyCode == 9) || (nKeyCode == 13)  || // tab, enter
+            (nKeyCode == 16) || (nKeyCode == 17) || // shift, ctl
+            (nKeyCode >= 18 && nKeyCode <= 20) || // alt,pause/break,caps lock
+            (nKeyCode == 27) || // esc
+            (nKeyCode >= 33 && nKeyCode <= 35) || // page up,page down,end
+            /*(nKeyCode >= 36 && nKeyCode <= 38) || // home,left,up
+            (nKeyCode == 40) || // down*/
+            (nKeyCode >= 36 && nKeyCode <= 40) || // home,left,up, right, down
+            (nKeyCode >= 44 && nKeyCode <= 45)) { // print screen,insert
+        return true;
+    }
+    return false;
+};
+
+/**
+ * Makes query request to the DataSource.
+ *
+ * @method _sendQuery
+ * @param sQuery {String} Query string.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._sendQuery = function(sQuery) {
+    // Widget has been effectively turned off
+    if(this.minQueryLength == -1) {
+        this._toggleContainer(false);
+        YAHOO.log("Property minQueryLength is set to -1", "info", this.toString());
+        return;
+    }
+    // Delimiter has been enabled
+    var aDelimChar = (this.delimChar) ? this.delimChar : null;
+    if(aDelimChar) {
+        // Loop through all possible delimiters and find the latest one
+        // A " " may be a false positive if they are defined as delimiters AND
+        // are used to separate delimited queries
+        var nDelimIndex = -1;
+        for(var i = aDelimChar.length-1; i >= 0; i--) {
+            var nNewIndex = sQuery.lastIndexOf(aDelimChar[i]);
+            if(nNewIndex > nDelimIndex) {
+                nDelimIndex = nNewIndex;
+            }
+        }
+        // If we think the last delimiter is a space (" "), make sure it is NOT
+        // a false positive by also checking the char directly before it
+        if(aDelimChar[i] == " ") {
+            for (var j = aDelimChar.length-1; j >= 0; j--) {
+                if(sQuery[nDelimIndex - 1] == aDelimChar[j]) {
+                    nDelimIndex--;
+                    break;
+                }
+            }
+        }
+        // A delimiter has been found so extract the latest query
+        if(nDelimIndex > -1) {
+            var nQueryStart = nDelimIndex + 1;
+            // Trim any white space from the beginning...
+            while(sQuery.charAt(nQueryStart) == " ") {
+                nQueryStart += 1;
+            }
+            // ...and save the rest of the string for later
+            this._sSavedQuery = sQuery.substring(0,nQueryStart);
+            // Here is the query itself
+            sQuery = sQuery.substr(nQueryStart);
+        }
+        else if(sQuery.indexOf(this._sSavedQuery) < 0){
+            this._sSavedQuery = null;
+        }
+    }
+
+    // Don't search queries that are too short
+    if((sQuery && (sQuery.length < this.minQueryLength)) || (!sQuery && this.minQueryLength > 0)) {
+        if(this._nDelayID != -1) {
+            clearTimeout(this._nDelayID);
+        }
+        this._toggleContainer(false);
+        YAHOO.log("Query \"" + sQuery + "\" is too short", "info", this.toString());
+        return;
+    }
+
+    sQuery = encodeURIComponent(sQuery);
+    this._nDelayID = -1;    // Reset timeout ID because request has been made
+    sQuery = this.doBeforeSendQuery(sQuery);
+    this.dataRequestEvent.fire(this, sQuery);
+    YAHOO.log("Sending query \"" + sQuery + "\"", "info", this.toString());
+    this.dataSource.getResults(this._populateList, sQuery, this);
+};
+
+/**
+ * Populates the array of &lt;li&gt; elements in the container with query
+ * results. This method is passed to YAHOO.widget.DataSource#getResults as a
+ * callback function so results from the DataSource instance are returned to the
+ * AutoComplete instance.
+ *
+ * @method _populateList
+ * @param sQuery {String} The query string.
+ * @param aResults {Object[]} An array of query result objects from the DataSource.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, oSelf) {
+    if(aResults === null) {
+        oSelf.dataErrorEvent.fire(oSelf, sQuery);
+    }
+    if(!oSelf._bFocused || !aResults) {
+        YAHOO.log("Could not populate list", "info", oSelf.toString());
+        return;
+    }
+
+    var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
+    var contentStyle = oSelf._oContainer._oContent.style;
+    contentStyle.width = (!isOpera) ? null : "";
+    contentStyle.height = (!isOpera) ? null : "";
+
+    var sCurQuery = decodeURIComponent(sQuery);
+    oSelf._sCurQuery = sCurQuery;
+    oSelf._bItemSelected = false;
+
+    if(oSelf._maxResultsDisplayed != oSelf.maxResultsDisplayed) {
+        oSelf._initList();
+    }
+
+    var nItems = Math.min(aResults.length,oSelf.maxResultsDisplayed);
+    oSelf._nDisplayedItems = nItems;
+    if(nItems > 0) {
+        oSelf._initContainerHelpers();
+        var aItems = oSelf._aListItems;
+
+        // Fill items with data
+        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;
+
+        }
+
+        // Empty out remaining items if any
+        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;
+        }
+
+        // Expand the container
+        var ok = oSelf.doBeforeExpandContainer(oSelf._oTextbox, oSelf._oContainer, sQuery, aResults);
+        oSelf._toggleContainer(ok);
+        
+        if(oSelf.autoHighlight) {
+            // Go to the first item
+            var oFirstItem = aItems[0];
+            oSelf._toggleHighlight(oFirstItem,"to");
+            oSelf.itemArrowToEvent.fire(oSelf, oFirstItem);
+            YAHOO.log("Arrowed to first item", "info", oSelf.toString());
+            oSelf._typeAhead(oFirstItem,sQuery);
+        }
+        else {
+            oSelf._oCurItem = null;
+        }
+    }
+    else {
+        oSelf._toggleContainer(false);
+    }
+    oSelf.dataReturnEvent.fire(oSelf, sQuery, aResults);
+    YAHOO.log("Container populated with list items", "info", oSelf.toString());
+    
+};
+
+/**
+ * When forceSelection is true and the user attempts
+ * leave the text input box without selecting an item from the query results,
+ * the user selection is cleared.
+ *
+ * @method _clearSelection
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._clearSelection = function() {
+    var sValue = this._oTextbox.value;
+    var sChar = (this.delimChar) ? this.delimChar[0] : null;
+    var nIndex = (sChar) ? sValue.lastIndexOf(sChar, sValue.length-2) : -1;
+    if(nIndex > -1) {
+        this._oTextbox.value = sValue.substring(0,nIndex);
+    }
+    else {
+         this._oTextbox.value = "";
+    }
+    this._sSavedQuery = this._oTextbox.value;
+
+    // Fire custom event
+    this.selectionEnforceEvent.fire(this);
+    YAHOO.log("Selection enforced", "info", this.toString());
+};
+
+/**
+ * Whether or not user-typed value in the text input box matches any of the
+ * query results.
+ *
+ * @method _textMatchesOption
+ * @return {HTMLElement} Matching list item element if user-input text matches
+ * a result, null otherwise.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._textMatchesOption = function() {
+    var foundMatch = null;
+
+    for(var i = this._nDisplayedItems-1; i >= 0 ; i--) {
+        var oItem = this._aListItems[i];
+        var sMatch = oItem._sResultKey.toLowerCase();
+        if(sMatch == this._sCurQuery.toLowerCase()) {
+            foundMatch = oItem;
+            break;
+        }
+    }
+    return(foundMatch);
+};
+
+/**
+ * Updates in the text input box with the first query result as the user types,
+ * selecting the substring that the user has not typed.
+ *
+ * @method _typeAhead
+ * @param oItem {HTMLElement} The &lt;li&gt; element item whose data populates the input field.
+ * @param sQuery {String} Query string.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {
+    // Don't update if turned off
+    if(!this.typeAhead || (this._nKeyCode == 8)) {
+        return;
+    }
+
+    var oTextbox = this._oTextbox;
+    var sValue = this._oTextbox.value; // any saved queries plus what user has typed
+
+    // Don't update with type-ahead if text selection is not supported
+    if(!oTextbox.setSelectionRange && !oTextbox.createTextRange) {
+        return;
+    }
+
+    // Select the portion of text that the user has not typed
+    var nStart = sValue.length;
+    this._updateValue(oItem);
+    var nEnd = oTextbox.value.length;
+    this._selectText(oTextbox,nStart,nEnd);
+    var sPrefill = oTextbox.value.substr(nStart,nEnd);
+    this.typeAheadEvent.fire(this,sQuery,sPrefill);
+    YAHOO.log("Typeahead occured with prefill string \"" + sPrefill + "\"", "info", this.toString());
+};
+
+/**
+ * Selects text in the input field.
+ *
+ * @method _selectText
+ * @param oTextbox {HTMLElement} Text input box element in which to select text.
+ * @param nStart {Number} Starting index of text string to select.
+ * @param nEnd {Number} Ending index of text selection.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._selectText = function(oTextbox, nStart, nEnd) {
+    if(oTextbox.setSelectionRange) { // For Mozilla
+        oTextbox.setSelectionRange(nStart,nEnd);
+    }
+    else if(oTextbox.createTextRange) { // For IE
+        var oTextRange = oTextbox.createTextRange();
+        oTextRange.moveStart("character", nStart);
+        oTextRange.moveEnd("character", nEnd-oTextbox.value.length);
+        oTextRange.select();
+    }
+    else {
+        oTextbox.select();
+    }
+};
+
+/**
+ * Syncs results container with its helpers.
+ *
+ * @method _toggleContainerHelpers
+ * @param bShow {Boolean} True if container is expanded, false if collapsed
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) {
+    var bFireEvent = false;
+    var width = this._oContainer._oContent.offsetWidth + "px";
+    var height = this._oContainer._oContent.offsetHeight + "px";
+
+    if(this.useIFrame && this._oContainer._oIFrame) {
+        bFireEvent = true;
+        if(bShow) {
+            this._oContainer._oIFrame.style.width = width;
+            this._oContainer._oIFrame.style.height = height;
+        }
+        else {
+            this._oContainer._oIFrame.style.width = 0;
+            this._oContainer._oIFrame.style.height = 0;
+        }
+    }
+    if(this.useShadow && this._oContainer._oShadow) {
+        bFireEvent = true;
+        if(bShow) {
+            this._oContainer._oShadow.style.width = width;
+            this._oContainer._oShadow.style.height = height;
+        }
+        else {
+           this._oContainer._oShadow.style.width = 0;
+            this._oContainer._oShadow.style.height = 0;
+        }
+    }
+};
+
+/**
+ * Animates expansion or collapse of the container.
+ *
+ * @method _toggleContainer
+ * @param bShow {Boolean} True if container should be expanded, false if container should be collapsed
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
+    var oContainer = this._oContainer;
+
+    // Implementer has container always open so don't mess with it
+    if(this.alwaysShowContainer && this._bContainerOpen) {
+        return;
+    }
+    
+    // Clear contents of container
+    if(!bShow) {
+        this._oContainer._oContent.scrollTop = 0;
+        var aItems = this._aListItems;
+
+        if(aItems && (aItems.length > 0)) {
+            for(var i = aItems.length-1; i >= 0 ; i--) {
+                aItems[i].style.display = "none";
+            }
+        }
+
+        if(this._oCurItem) {
+            this._toggleHighlight(this._oCurItem,"from");
+        }
+
+        this._oCurItem = null;
+        this._nDisplayedItems = 0;
+        this._sCurQuery = null;
+    }
+
+    // Container is already closed
+    if(!bShow && !this._bContainerOpen) {
+        oContainer._oContent.style.display = "none";
+        return;
+    }
+
+    // If animation is enabled...
+    var oAnim = this._oAnim;
+    if(oAnim && oAnim.getEl() && (this.animHoriz || this.animVert)) {
+        // If helpers need to be collapsed, do it right away...
+        // but if helpers need to be expanded, wait until after the container expands
+        if(!bShow) {
+            this._toggleContainerHelpers(bShow);
+        }
+
+        if(oAnim.isAnimated()) {
+            oAnim.stop();
+        }
+
+        // Clone container to grab current size offscreen
+        var oClone = oContainer._oContent.cloneNode(true);
+        oContainer.appendChild(oClone);
+        oClone.style.top = "-9000px";
+        oClone.style.display = "block";
+
+        // Current size of the container is the EXPANDED size
+        var wExp = oClone.offsetWidth;
+        var hExp = oClone.offsetHeight;
+
+        // Calculate COLLAPSED sizes based on horiz and vert anim
+        var wColl = (this.animHoriz) ? 0 : wExp;
+        var hColl = (this.animVert) ? 0 : hExp;
+
+        // Set animation sizes
+        oAnim.attributes = (bShow) ?
+            {width: { to: wExp }, height: { to: hExp }} :
+            {width: { to: wColl}, height: { to: hColl }};
+
+        // If opening anew, set to a collapsed size...
+        if(bShow && !this._bContainerOpen) {
+            oContainer._oContent.style.width = wColl+"px";
+            oContainer._oContent.style.height = hColl+"px";
+        }
+        // Else, set it to its last known size.
+        else {
+            oContainer._oContent.style.width = wExp+"px";
+            oContainer._oContent.style.height = hExp+"px";
+        }
+
+        oContainer.removeChild(oClone);
+        oClone = null;
+
+       var oSelf = this;
+       var onAnimComplete = function() {
+            // Finish the collapse
+               oAnim.onComplete.unsubscribeAll();
+
+            if(bShow) {
+                oSelf.containerExpandEvent.fire(oSelf);
+                YAHOO.log("Container expanded", "info", oSelf.toString());
+            }
+            else {
+                oContainer._oContent.style.display = "none";
+                oSelf.containerCollapseEvent.fire(oSelf);
+                YAHOO.log("Container collapsed", "info", oSelf.toString());
+            }
+            oSelf._toggleContainerHelpers(bShow);
+       };
+
+        // Display container and animate it
+        oContainer._oContent.style.display = "block";
+        oAnim.onComplete.subscribe(onAnimComplete);
+        oAnim.animate();
+        this._bContainerOpen = bShow;
+    }
+    // Else don't animate, just show or hide
+    else {
+        if(bShow) {
+            oContainer._oContent.style.display = "block";
+            this.containerExpandEvent.fire(this);
+            YAHOO.log("Container expanded", "info", this.toString());
+        }
+        else {
+            oContainer._oContent.style.display = "none";
+            this.containerCollapseEvent.fire(this);
+            YAHOO.log("Container collapsed", "info", this.toString());
+        }
+        this._toggleContainerHelpers(bShow);
+        this._bContainerOpen = bShow;
+   }
+
+};
+
+/**
+ * Toggles the highlight on or off for an item in the container, and also cleans
+ * up highlighting of any previous item.
+ *
+ * @method _toggleHighlight
+ * @param oNewItem {HTMLElement} The &lt;li&gt; element item to receive highlight behavior.
+ * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._toggleHighlight = function(oNewItem, sType) {
+    var sHighlight = this.highlightClassName;
+    if(this._oCurItem) {
+        // Remove highlight from old item
+        YAHOO.util.Dom.removeClass(this._oCurItem, sHighlight);
+    }
+
+    if((sType == "to") && sHighlight) {
+        // Apply highlight to new item
+        YAHOO.util.Dom.addClass(oNewItem, sHighlight);
+        this._oCurItem = oNewItem;
+    }
+};
+
+/**
+ * Toggles the pre-highlight on or off for an item in the container.
+ *
+ * @method _togglePrehighlight
+ * @param oNewItem {HTMLElement} The &lt;li&gt; element item to receive highlight behavior.
+ * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._togglePrehighlight = function(oNewItem, sType) {
+    if(oNewItem == this._oCurItem) {
+        return;
+    }
+
+    var sPrehighlight = this.prehighlightClassName;
+    if((sType == "mouseover") && sPrehighlight) {
+        // Apply prehighlight to new item
+        YAHOO.util.Dom.addClass(oNewItem, sPrehighlight);
+    }
+    else {
+        // Remove prehighlight from old item
+        YAHOO.util.Dom.removeClass(oNewItem, sPrehighlight);
+    }
+};
+
+/**
+ * Updates the text input box value with selected query result. If a delimiter
+ * has been defined, then the value gets appended with the delimiter.
+ *
+ * @method _updateValue
+ * @param oItem {HTMLElement} The &lt;li&gt; element item with which to update the value.
+ * @private
+ */
+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();
+
+    // First clear text field
+    oTextbox.value = "";
+    // Grab data to put into text field
+    if(sDelimChar) {
+        if(sSavedQuery) {
+            oTextbox.value = sSavedQuery;
+        }
+        oTextbox.value += sResultKey + sDelimChar;
+        if(sDelimChar != " ") {
+            oTextbox.value += " ";
+        }
+    }
+    else { oTextbox.value = sResultKey; }
+
+    // scroll to bottom of textarea if necessary
+    if(oTextbox.type == "textarea") {
+        oTextbox.scrollTop = oTextbox.scrollHeight;
+    }
+
+    // move cursor to end
+    var end = oTextbox.value.length;
+    this._selectText(oTextbox,end,end);
+
+    this._oCurItem = oItem;
+};
+
+/**
+ * Selects a result item from the container
+ *
+ * @method _selectItem
+ * @param oItem {HTMLElement} The selected &lt;li&gt; element item.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._selectItem = function(oItem) {
+    this._bItemSelected = true;
+    this._updateValue(oItem);
+    this._cancelIntervalDetection(this);
+    this.itemSelectEvent.fire(this, oItem, oItem._oResultData);
+    YAHOO.log("Item selected: " + YAHOO.lang.dump(oItem._oResultData), "info", this.toString());
+    this._toggleContainer(false);
+};
+
+/**
+ * If an item is highlighted in the container, the right arrow key jumps to the
+ * end of the textbox and selects the highlighted item, otherwise the container
+ * is closed.
+ *
+ * @method _jumpSelection
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._jumpSelection = function() {
+    if(this._oCurItem) {
+        this._selectItem(this._oCurItem);
+    }
+    else {
+        this._toggleContainer(false);
+    }
+};
+
+/**
+ * Triggered by up and down arrow keys, changes the current highlighted
+ * &lt;li&gt; element item. Scrolls container if necessary.
+ *
+ * @method _moveSelection
+ * @param nKeyCode {Number} Code of key pressed.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) {
+    if(this._bContainerOpen) {
+        // Determine current item's id number
+        var oCurItem = this._oCurItem;
+        var nCurItemIndex = -1;
+
+        if(oCurItem) {
+            nCurItemIndex = oCurItem._nItemIndex;
+        }
+
+        var nNewItemIndex = (nKeyCode == 40) ?
+                (nCurItemIndex + 1) : (nCurItemIndex - 1);
+
+        // Out of bounds
+        if(nNewItemIndex < -2 || nNewItemIndex >= this._nDisplayedItems) {
+            return;
+        }
+
+        if(oCurItem) {
+            // Unhighlight current item
+            this._toggleHighlight(oCurItem, "from");
+            this.itemArrowFromEvent.fire(this, oCurItem);
+            YAHOO.log("Item arrowed from", "info", this.toString());
+        }
+        if(nNewItemIndex == -1) {
+           // Go back to query (remove type-ahead string)
+            if(this.delimChar && this._sSavedQuery) {
+                if(!this._textMatchesOption()) {
+                    this._oTextbox.value = this._sSavedQuery;
+                }
+                else {
+                    this._oTextbox.value = this._sSavedQuery + this._sCurQuery;
+                }
+            }
+            else {
+                this._oTextbox.value = this._sCurQuery;
+            }
+            this._oCurItem = null;
+            return;
+        }
+        if(nNewItemIndex == -2) {
+            // Close container
+            this._toggleContainer(false);
+            return;
+        }
+
+        var oNewItem = this._aListItems[nNewItemIndex];
+
+        // Scroll the container if necessary
+        var oContent = this._oContainer._oContent;
+        var scrollOn = ((YAHOO.util.Dom.getStyle(oContent,"overflow") == "auto") ||
+            (YAHOO.util.Dom.getStyle(oContent,"overflowY") == "auto"));
+        if(scrollOn && (nNewItemIndex > -1) &&
+        (nNewItemIndex < this._nDisplayedItems)) {
+            // User is keying down
+            if(nKeyCode == 40) {
+                // Bottom of selected item is below scroll area...
+                if((oNewItem.offsetTop+oNewItem.offsetHeight) > (oContent.scrollTop + oContent.offsetHeight)) {
+                    // Set bottom of scroll area to bottom of selected item
+                    oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;
+                }
+                // Bottom of selected item is above scroll area...
+                else if((oNewItem.offsetTop+oNewItem.offsetHeight) < oContent.scrollTop) {
+                    // Set top of selected item to top of scroll area
+                    oContent.scrollTop = oNewItem.offsetTop;
+
+                }
+            }
+            // User is keying up
+            else {
+                // Top of selected item is above scroll area
+                if(oNewItem.offsetTop < oContent.scrollTop) {
+                    // Set top of scroll area to top of selected item
+                    this._oContainer._oContent.scrollTop = oNewItem.offsetTop;
+                }
+                // Top of selected item is below scroll area
+                else if(oNewItem.offsetTop > (oContent.scrollTop + oContent.offsetHeight)) {
+                    // Set bottom of selected item to bottom of scroll area
+                    this._oContainer._oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;
+                }
+            }
+        }
+
+        this._toggleHighlight(oNewItem, "to");
+        this.itemArrowToEvent.fire(this, oNewItem);
+        YAHOO.log("Item arrowed to", "info", this.toString());
+        if(this.typeAhead) {
+            this._updateValue(oNewItem);
+        }
+    }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private event handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Handles &lt;li&gt; element mouseover events in the container.
+ *
+ * @method _onItemMouseover
+ * @param v {HTMLEvent} The mouseover event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onItemMouseover = function(v,oSelf) {
+    if(oSelf.prehighlightClassName) {
+        oSelf._togglePrehighlight(this,"mouseover");
+    }
+    else {
+        oSelf._toggleHighlight(this,"to");
+    }
+
+    oSelf.itemMouseOverEvent.fire(oSelf, this);
+    YAHOO.log("Item moused over", "info", oSelf.toString());
+};
+
+/**
+ * Handles &lt;li&gt; element mouseout events in the container.
+ *
+ * @method _onItemMouseout
+ * @param v {HTMLEvent} The mouseout event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onItemMouseout = function(v,oSelf) {
+    if(oSelf.prehighlightClassName) {
+        oSelf._togglePrehighlight(this,"mouseout");
+    }
+    else {
+        oSelf._toggleHighlight(this,"from");
+    }
+
+    oSelf.itemMouseOutEvent.fire(oSelf, this);
+    YAHOO.log("Item moused out", "info", oSelf.toString());
+};
+
+/**
+ * Handles &lt;li&gt; element click events in the container.
+ *
+ * @method _onItemMouseclick
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onItemMouseclick = function(v,oSelf) {
+    // In case item has not been moused over
+    oSelf._toggleHighlight(this,"to");
+    oSelf._selectItem(this);
+};
+
+/**
+ * Handles container mouseover events.
+ *
+ * @method _onContainerMouseover
+ * @param v {HTMLEvent} The mouseover event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onContainerMouseover = function(v,oSelf) {
+    oSelf._bOverContainer = true;
+};
+
+/**
+ * Handles container mouseout events.
+ *
+ * @method _onContainerMouseout
+ * @param v {HTMLEvent} The mouseout event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onContainerMouseout = function(v,oSelf) {
+    oSelf._bOverContainer = false;
+    // If container is still active
+    if(oSelf._oCurItem) {
+        oSelf._toggleHighlight(oSelf._oCurItem,"to");
+    }
+};
+
+/**
+ * Handles container scroll events.
+ *
+ * @method _onContainerScroll
+ * @param v {HTMLEvent} The scroll event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onContainerScroll = function(v,oSelf) {
+    oSelf._oTextbox.focus();
+};
+
+/**
+ * Handles container resize events.
+ *
+ * @method _onContainerResize
+ * @param v {HTMLEvent} The resize event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onContainerResize = function(v,oSelf) {
+    oSelf._toggleContainerHelpers(oSelf._bContainerOpen);
+};
+
+
+/**
+ * Handles textbox keydown events of functional keys, mainly for UI behavior.
+ *
+ * @method _onTextboxKeyDown
+ * @param v {HTMLEvent} The keydown event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown = function(v,oSelf) {
+    var nKeyCode = v.keyCode;
+
+    switch (nKeyCode) {
+        case 9: // tab
+            // select an item or clear out
+            if(oSelf._oCurItem) {
+                if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {
+                    if(oSelf._bContainerOpen) {
+                        YAHOO.util.Event.stopEvent(v);
+                    }
+                }
+                oSelf._selectItem(oSelf._oCurItem);
+            }
+            else {
+                oSelf._toggleContainer(false);
+            }
+            break;
+        case 13: // enter
+            if(oSelf._oCurItem) {
+                if(oSelf._nKeyCode != nKeyCode) {
+                    if(oSelf._bContainerOpen) {
+                        YAHOO.util.Event.stopEvent(v);
+                    }
+                }
+                oSelf._selectItem(oSelf._oCurItem);
+            }
+            else {
+                oSelf._toggleContainer(false);
+            }
+            break;
+        case 27: // esc
+            oSelf._toggleContainer(false);
+            return;
+        case 39: // right
+            oSelf._jumpSelection();
+            break;
+        case 38: // up
+            YAHOO.util.Event.stopEvent(v);
+            oSelf._moveSelection(nKeyCode);
+            break;
+        case 40: // down
+            YAHOO.util.Event.stopEvent(v);
+            oSelf._moveSelection(nKeyCode);
+            break;
+        default:
+            break;
+    }
+};
+
+/**
+ * Handles textbox keypress events.
+ * @method _onTextboxKeyPress
+ * @param v {HTMLEvent} The keypress event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress = function(v,oSelf) {
+    var nKeyCode = v.keyCode;
+
+        //Expose only to Mac browsers, where stopEvent is ineffective on keydown events (bug 790337)
+        var isMac = (navigator.userAgent.toLowerCase().indexOf("mac") != -1);
+        if(isMac) {
+            switch (nKeyCode) {
+            case 9: // tab
+                if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {
+                    YAHOO.util.Event.stopEvent(v);
+                }
+                break;
+            case 13: // enter
+                if(oSelf._nKeyCode != nKeyCode) {
+                    YAHOO.util.Event.stopEvent(v);
+                }
+                break;
+            case 38: // up
+            case 40: // down
+                YAHOO.util.Event.stopEvent(v);
+                break;
+            default:
+                break;
+            }
+        }
+
+        //TODO: (?) limit only to non-IE, non-Mac-FF for Korean IME support (bug 811948)
+        // Korean IME detected
+        else if(nKeyCode == 229) {
+            oSelf._queryInterval = setInterval(function() { oSelf._onIMEDetected(oSelf); },500);
+        }
+};
+
+/**
+ * Handles textbox keyup events that trigger queries.
+ *
+ * @method _onTextboxKeyUp
+ * @param v {HTMLEvent} The keyup event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) {
+    // Check to see if any of the public properties have been updated
+    oSelf._initProps();
+
+    var nKeyCode = v.keyCode;
+    oSelf._nKeyCode = nKeyCode;
+    var sText = this.value; //string in textbox
+
+    // Filter out chars that don't trigger queries
+    if(oSelf._isIgnoreKey(nKeyCode) || (sText.toLowerCase() == oSelf._sCurQuery)) {
+        return;
+    }
+    else {
+        oSelf._bItemSelected = false;
+        YAHOO.util.Dom.removeClass(oSelf._oCurItem,  oSelf.highlightClassName);
+        oSelf._oCurItem = null;
+
+        oSelf.textboxKeyEvent.fire(oSelf, nKeyCode);
+        YAHOO.log("Textbox keyed", "info", oSelf.toString());
+    }
+
+    // Set timeout on the request
+    if(oSelf.queryDelay > 0) {
+        var nDelayID =
+            setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay * 1000));
+
+        if(oSelf._nDelayID != -1) {
+            clearTimeout(oSelf._nDelayID);
+        }
+
+        oSelf._nDelayID = nDelayID;
+    }
+    else {
+        // No delay so send request immediately
+        oSelf._sendQuery(sText);
+    }
+};
+
+/**
+ * Handles text input box receiving focus.
+ *
+ * @method _onTextboxFocus
+ * @param v {HTMLEvent} The focus event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) {
+    oSelf._oTextbox.setAttribute("autocomplete","off");
+    oSelf._bFocused = true;
+    if(!oSelf._bItemSelected) {
+        oSelf.textboxFocusEvent.fire(oSelf);
+        YAHOO.log("Textbox focused", "info", oSelf.toString());
+    }
+};
+
+/**
+ * Handles text input box losing focus.
+ *
+ * @method _onTextboxBlur
+ * @param v {HTMLEvent} The focus event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) {
+    // Don't treat as a blur if it was a selection via mouse click
+    if(!oSelf._bOverContainer || (oSelf._nKeyCode == 9)) {
+        // Current query needs to be validated
+        if(!oSelf._bItemSelected) {
+            var oMatch = oSelf._textMatchesOption();
+            if(!oSelf._bContainerOpen || (oSelf._bContainerOpen && (oMatch === null))) {
+                if(oSelf.forceSelection) {
+                    oSelf._clearSelection();
+                }
+                else {
+                    oSelf.unmatchedItemSelectEvent.fire(oSelf, oSelf._sCurQuery);
+                    YAHOO.log("Unmatched item selected", "info", oSelf.toString());
+                }
+            }
+            else {
+                oSelf._selectItem(oMatch);
+            }
+        }
+
+        if(oSelf._bContainerOpen) {
+            oSelf._toggleContainer(false);
+        }
+        oSelf._cancelIntervalDetection(oSelf);
+        oSelf._bFocused = false;
+        oSelf.textboxBlurEvent.fire(oSelf);
+        YAHOO.log("Textbox blurred", "info", oSelf.toString());
+    }
+};
+
+/**
+ * Handles form submission event.
+ *
+ * @method _onFormSubmit
+ * @param v {HTMLEvent} The submit event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onFormSubmit = function(v,oSelf) {
+    if(oSelf.allowBrowserAutocomplete) {
+        oSelf._oTextbox.setAttribute("autocomplete","on");
+    }
+    else {
+        oSelf._oTextbox.setAttribute("autocomplete","off");
+    }
+};
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The DataSource classes manages sending a request and returning response from a live
+ * database. Supported data include local JavaScript arrays and objects and databases
+ * accessible via XHR connections. Supported response formats include JavaScript arrays,
+ * JSON, XML, and flat-file textual data.
+ *  
+ * @class DataSource
+ * @constructor
+ */
+YAHOO.widget.DataSource = function() { 
+    /* abstract class */
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public constants
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Error message for null data responses.
+ *
+ * @property ERROR_DATANULL
+ * @type String
+ * @static
+ * @final
+ */
+YAHOO.widget.DataSource.ERROR_DATANULL = "Response data was null";
+
+/**
+ * Error message for data responses with parsing errors.
+ *
+ * @property ERROR_DATAPARSE
+ * @type String
+ * @static
+ * @final
+ */
+YAHOO.widget.DataSource.ERROR_DATAPARSE = "Response data could not be parsed";
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Max size of the local cache.  Set to 0 to turn off caching.  Caching is
+ * useful to reduce the number of server connections.  Recommended only for data
+ * sources that return comprehensive results for queries or when stale data is
+ * not an issue.
+ *
+ * @property maxCacheEntries
+ * @type Number
+ * @default 15
+ */
+YAHOO.widget.DataSource.prototype.maxCacheEntries = 15;
+
+/**
+ * Use this to fine-tune the matching algorithm used against JS Array types of
+ * DataSource and DataSource caches. If queryMatchContains is true, then the JS
+ * Array or cache returns results that "contain" the query string. By default,
+ * queryMatchContains is set to false, so that only results that "start with"
+ * the query string are returned.
+ *
+ * @property queryMatchContains
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.DataSource.prototype.queryMatchContains = false;
+
+/**
+ * Enables query subset matching. If caching is on and queryMatchSubset is
+ * true, substrings of queries will return matching cached results. For
+ * instance, if the first query is for "abc" susequent queries that start with
+ * "abc", like "abcd", will be queried against the cache, and not the live data
+ * source. Recommended only for DataSources that return comprehensive results
+ * for queries with very few characters.
+ *
+ * @property queryMatchSubset
+ * @type Boolean
+ * @default false
+ *
+ */
+YAHOO.widget.DataSource.prototype.queryMatchSubset = false;
+
+/**
+ * Enables case-sensitivity in the matching algorithm used against JS Array
+ * types of DataSources and DataSource caches. If queryMatchCase is true, only
+ * case-sensitive matches will return.
+ *
+ * @property queryMatchCase
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.DataSource.prototype.queryMatchCase = false;
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Public accessor to the unique name of the DataSource instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the DataSource instance
+ */
+YAHOO.widget.DataSource.prototype.toString = function() {
+    return "DataSource " + this._sName;
+};
+
+/**
+ * Retrieves query results, first checking the local cache, then making the
+ * query request to the live data source as defined by the function doQuery.
+ *
+ * @method getResults
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DataSource.prototype.getResults = function(oCallbackFn, sQuery, oParent) {
+    
+    // First look in cache
+    var aResults = this._doQueryCache(oCallbackFn,sQuery,oParent);
+    // Not in cache, so get results from server
+    if(aResults.length === 0) {
+        this.queryEvent.fire(this, oParent, sQuery);
+        YAHOO.log("Query received \"" + sQuery, "info", this.toString());
+        this.doQuery(oCallbackFn, sQuery, oParent);
+    }
+};
+
+/**
+ * Abstract method implemented by subclasses to make a query to the live data
+ * source. Must call the callback function with the response returned from the
+ * query. Populates cache (if enabled).
+ *
+ * @method doQuery
+ * @param oCallbackFn {HTMLFunction} Callback function implemented by oParent to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DataSource.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {
+    /* override this */ 
+};
+
+/**
+ * Flushes cache.
+ *
+ * @method flushCache
+ */
+YAHOO.widget.DataSource.prototype.flushCache = function() {
+    if(this._aCache) {
+        this._aCache = [];
+    }
+    if(this._aCacheHelper) {
+        this._aCacheHelper = [];
+    }
+    this.cacheFlushEvent.fire(this);
+    YAHOO.log("Cache flushed", "info", this.toString());
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public events
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Fired when a query is made to the live data source.
+ *
+ * @event queryEvent
+ * @param oSelf {Object} The DataSource instance.
+ * @param oParent {Object} The requesting object.
+ * @param sQuery {String} The query string.
+ */
+YAHOO.widget.DataSource.prototype.queryEvent = null;
+
+/**
+ * Fired when a query is made to the local cache.
+ *
+ * @event cacheQueryEvent
+ * @param oSelf {Object} The DataSource instance.
+ * @param oParent {Object} The requesting object.
+ * @param sQuery {String} The query string.
+ */
+YAHOO.widget.DataSource.prototype.cacheQueryEvent = null;
+
+/**
+ * Fired when data is retrieved from the live data source.
+ *
+ * @event getResultsEvent
+ * @param oSelf {Object} The DataSource instance.
+ * @param oParent {Object} The requesting object.
+ * @param sQuery {String} The query string.
+ * @param aResults {Object[]} Array of result objects.
+ */
+YAHOO.widget.DataSource.prototype.getResultsEvent = null;
+    
+/**
+ * Fired when data is retrieved from the local cache.
+ *
+ * @event getCachedResultsEvent
+ * @param oSelf {Object} The DataSource instance.
+ * @param oParent {Object} The requesting object.
+ * @param sQuery {String} The query string.
+ * @param aResults {Object[]} Array of result objects.
+ */
+YAHOO.widget.DataSource.prototype.getCachedResultsEvent = null;
+
+/**
+ * Fired when an error is encountered with the live data source.
+ *
+ * @event dataErrorEvent
+ * @param oSelf {Object} The DataSource instance.
+ * @param oParent {Object} The requesting object.
+ * @param sQuery {String} The query string.
+ * @param sMsg {String} Error message string
+ */
+YAHOO.widget.DataSource.prototype.dataErrorEvent = null;
+
+/**
+ * Fired when the local cache is flushed.
+ *
+ * @event cacheFlushEvent
+ * @param oSelf {Object} The DataSource instance
+ */
+YAHOO.widget.DataSource.prototype.cacheFlushEvent = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class variable to index multiple DataSource instances.
+ *
+ * @property _nIndex
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.widget.DataSource._nIndex = 0;
+
+/**
+ * Name of DataSource instance.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataSource.prototype._sName = null;
+
+/**
+ * Local cache of data result objects indexed chronologically.
+ *
+ * @property _aCache
+ * @type Object[]
+ * @private
+ */
+YAHOO.widget.DataSource.prototype._aCache = null;
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Initializes DataSource instance.
+ *  
+ * @method _init
+ * @private
+ */
+YAHOO.widget.DataSource.prototype._init = function() {
+    // Validate and initialize public configs
+    var maxCacheEntries = this.maxCacheEntries;
+    if(!YAHOO.lang.isNumber(maxCacheEntries) || (maxCacheEntries < 0)) {
+        maxCacheEntries = 0;
+    }
+    // Initialize local cache
+    if(maxCacheEntries > 0 && !this._aCache) {
+        this._aCache = [];
+    }
+    
+    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);
+};
+
+/**
+ * Adds a result object to the local cache, evicting the oldest element if the 
+ * cache is full. Newer items will have higher indexes, the oldest item will have
+ * index of 0. 
+ *
+ * @method _addCacheElem
+ * @param oResult {Object} Data result object, including array of results.
+ * @private
+ */
+YAHOO.widget.DataSource.prototype._addCacheElem = function(oResult) {
+    var aCache = this._aCache;
+    // Don't add if anything important is missing.
+    if(!aCache || !oResult || !oResult.query || !oResult.results) {
+        return;
+    }
+    
+    // If the cache is full, make room by removing from index=0
+    if(aCache.length >= this.maxCacheEntries) {
+        aCache.shift();
+    }
+        
+    // Add to cache, at the end of the array
+    aCache.push(oResult);
+};
+
+/**
+ * Queries the local cache for results. If query has been cached, the callback
+ * function is called with the results, and the cached is refreshed so that it
+ * is now the newest element.  
+ *
+ * @method _doQueryCache
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ * @return aResults {Object[]} Array of results from local cache if found, otherwise null.
+ * @private 
+ */
+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 cache is enabled...
+    if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {
+        this.cacheQueryEvent.fire(this, oParent, sQuery);
+        YAHOO.log("Querying cache: \"" + sQuery + "\"", "info", this.toString());
+        // If case is unimportant, normalize query now instead of in loops
+        if(!this.queryMatchCase) {
+            var sOrigQuery = sQuery;
+            sQuery = sQuery.toLowerCase();
+        }
+
+        // Loop through each cached element's query property...
+        for(var i = nCacheLength-1; i >= 0; i--) {
+            var resultObj = aCache[i];
+            var aAllResultItems = resultObj.results;
+            // If case is unimportant, normalize match key for comparison
+            var matchKey = (!this.queryMatchCase) ?
+                encodeURIComponent(resultObj.query).toLowerCase():
+                encodeURIComponent(resultObj.query);
+            
+            // If a cached match key exactly matches the query...
+            if(matchKey == sQuery) {
+                    // Stash all result objects into aResult[] and stop looping through the cache.
+                    bMatchFound = true;
+                    aResults = aAllResultItems;
+                    
+                    // The matching cache element was not the most recent,
+                    // so now we need to refresh the cache.
+                    if(i != nCacheLength-1) {                        
+                        // Remove element from its original location
+                        aCache.splice(i,1);
+                        // Add element as newest
+                        this._addCacheElem(resultObj);
+                    }
+                    break;
+            }
+            // Else if this query is not an exact match and subset matching is enabled...
+            else if(this.queryMatchSubset) {
+                // Loop through substrings of each cached element's query property...
+                for(var j = sQuery.length-1; j >= 0 ; j--) {
+                    var subQuery = sQuery.substr(0,j);
+                    
+                    // If a substring of a cached sQuery exactly matches the query...
+                    if(matchKey == subQuery) {                    
+                        bMatchFound = true;
+                        
+                        // Go through each cached result object to match against the query...
+                        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);
+                            
+                            // A STARTSWITH match is when the query is found at the beginning of the key string...
+                            if((!bMatchContains && (sKeyIndex === 0)) ||
+                            // A CONTAINS match is when the query is found anywhere within the key string...
+                            (bMatchContains && (sKeyIndex > -1))) {
+                                // Stash a match into aResults[].
+                                aResults.unshift(aRecord);
+                            }
+                        }
+                        
+                        // Add the subset match result set object as the newest element to cache,
+                        // and stop looping through the cache.
+                        resultObj = {};
+                        resultObj.query = sQuery;
+                        resultObj.results = aResults;
+                        this._addCacheElem(resultObj);
+                        break;
+                    }
+                }
+                if(bMatchFound) {
+                    break;
+                }
+            }
+        }
+        
+        // If there was a match, send along the results.
+        if(bMatchFound) {
+            this.getCachedResultsEvent.fire(this, oParent, sOrigQuery, aResults);
+            YAHOO.log("Cached results found for query \"" + sQuery + "\": " +
+                    YAHOO.lang.dump(aResults), "info", this.toString());
+            oCallbackFn(sOrigQuery, aResults, oParent);
+        }
+    }
+    return aResults;
+};
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * Implementation of YAHOO.widget.DataSource using XML HTTP requests that return
+ * query results.
+ *  
+ * @class DS_XHR
+ * @extends YAHOO.widget.DataSource
+ * @requires connection
+ * @constructor
+ * @param sScriptURI {String} Absolute or relative URI to script that returns query
+ * results as JSON, XML, or delimited flat-file data.
+ * @param aSchema {String[]} Data schema definition of results.
+ * @param oConfigs {Object} (optional) Object literal of config params.
+ */
+YAHOO.widget.DS_XHR = function(sScriptURI, aSchema, oConfigs) {
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            this[sConfig] = oConfigs[sConfig];
+        }
+    }
+
+    // Initialization sequence
+    if(!YAHOO.lang.isArray(aSchema) || !YAHOO.lang.isString(sScriptURI)) {
+        YAHOO.log("Could not instantiate XHR DataSource due to invalid arguments", "error", this.toString());
+        return;
+    }
+
+    this.schema = aSchema;
+    this.scriptURI = sScriptURI;
+    
+    this._init();
+    YAHOO.log("XHR DataSource initialized","info",this.toString());
+};
+
+YAHOO.widget.DS_XHR.prototype = new YAHOO.widget.DataSource();
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public constants
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * JSON data type.
+ *
+ * @property TYPE_JSON
+ * @type Number
+ * @static
+ * @final
+ */
+YAHOO.widget.DS_XHR.TYPE_JSON = 0;
+
+/**
+ * XML data type.
+ *
+ * @property TYPE_XML
+ * @type Number
+ * @static
+ * @final
+ */
+YAHOO.widget.DS_XHR.TYPE_XML = 1;
+
+/**
+ * Flat-file data type.
+ *
+ * @property TYPE_FLAT
+ * @type Number
+ * @static
+ * @final
+ */
+YAHOO.widget.DS_XHR.TYPE_FLAT = 2;
+
+/**
+ * Error message for XHR failure.
+ *
+ * @property ERROR_DATAXHR
+ * @type String
+ * @static
+ * @final
+ */
+YAHOO.widget.DS_XHR.ERROR_DATAXHR = "XHR response failed";
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Alias to YUI Connection Manager. Allows implementers to specify their own
+ * subclasses of the YUI Connection Manager utility.
+ *
+ * @property connMgr
+ * @type Object
+ * @default YAHOO.util.Connect
+ */
+YAHOO.widget.DS_XHR.prototype.connMgr = YAHOO.util.Connect;
+
+/**
+ * Number of milliseconds the XHR connection will wait for a server response. A
+ * a value of zero indicates the XHR connection will wait forever. Any value
+ * greater than zero will use the Connection utility's Auto-Abort feature.
+ *
+ * @property connTimeout
+ * @type Number
+ * @default 0
+ */
+YAHOO.widget.DS_XHR.prototype.connTimeout = 0;
+
+/**
+ * Absolute or relative URI to script that returns query results. For instance,
+ * queries will be sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput
+ *
+ * @property scriptURI
+ * @type String
+ */
+YAHOO.widget.DS_XHR.prototype.scriptURI = null;
+
+/**
+ * Query string parameter name sent to scriptURI. For instance, queries will be
+ * sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput
+ *
+ * @property scriptQueryParam
+ * @type String
+ * @default "query"
+ */
+YAHOO.widget.DS_XHR.prototype.scriptQueryParam = "query";
+
+/**
+ * String of key/value pairs to append to requests made to scriptURI. Define
+ * this string when you want to send additional query parameters to your script.
+ * When defined, queries will be sent to
+ * &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput&#38;&#60;scriptQueryAppend&#62;
+ *
+ * @property scriptQueryAppend
+ * @type String
+ * @default ""
+ */
+YAHOO.widget.DS_XHR.prototype.scriptQueryAppend = "";
+
+/**
+ * XHR response data type. Other types that may be defined are YAHOO.widget.DS_XHR.TYPE_XML
+ * and YAHOO.widget.DS_XHR.TYPE_FLAT.
+ *
+ * @property responseType
+ * @type String
+ * @default YAHOO.widget.DS_XHR.TYPE_JSON
+ */
+YAHOO.widget.DS_XHR.prototype.responseType = YAHOO.widget.DS_XHR.TYPE_JSON;
+
+/**
+ * String after which to strip results. If the results from the XHR are sent
+ * back as HTML, the gzip HTML comment appears at the end of the data and should
+ * be ignored.
+ *
+ * @property responseStripAfter
+ * @type String
+ * @default "\n&#60;!-"
+ */
+YAHOO.widget.DS_XHR.prototype.responseStripAfter = "\n<!-";
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Queries the live data source defined by scriptURI for results. Results are
+ * passed back to a callback function.
+ *  
+ * @method doQuery
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DS_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;
+    }
+    YAHOO.log("DataSource is querying URL " + sUri, "info", this.toString());
+    var oResponse = null;
+    
+    var oSelf = this;
+    /*
+     * Sets up ajax request callback
+     *
+     * @param {object} oReq          HTTPXMLRequest object
+     * @private
+     */
+    var responseSuccess = function(oResp) {
+        // Response ID does not match last made request ID.
+        if(!oSelf._oConn || (oResp.tId != oSelf._oConn.tId)) {
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);
+            YAHOO.log(YAHOO.widget.DataSource.ERROR_DATANULL, "error", oSelf.toString());
+            return;
+        }
+//DEBUG
+/*YAHOO.log(oResp.responseXML.getElementsByTagName("Result"),'warn');
+for(var foo in oResp) {
+    YAHOO.log(foo + ": "+oResp[foo],'warn');
+}
+YAHOO.log('responseXML.xml: '+oResp.responseXML.xml,'warn');*/
+        if(!isXML) {
+            oResp = oResp.responseText;
+        }
+        else { 
+            oResp = oResp.responseXML;
+        }
+        if(oResp === null) {
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);
+            YAHOO.log(YAHOO.widget.DataSource.ERROR_DATANULL, "error", oSelf.toString());
+            return;
+        }
+
+        var aResults = oSelf.parseResponse(sQuery, oResp, oParent);
+        var resultObj = {};
+        resultObj.query = decodeURIComponent(sQuery);
+        resultObj.results = aResults;
+        if(aResults === null) {
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATAPARSE);
+            YAHOO.log(YAHOO.widget.DataSource.ERROR_DATAPARSE, "error", oSelf.toString());
+            aResults = [];
+        }
+        else {
+            oSelf.getResultsEvent.fire(oSelf, oParent, sQuery, aResults);
+            YAHOO.log("Results returned for query \"" + sQuery + "\": " +
+                    YAHOO.lang.dump(aResults), "info", oSelf.toString());
+            oSelf._addCacheElem(resultObj);
+        }
+        oCallbackFn(sQuery, aResults, oParent);
+    };
+
+    var responseFailure = function(oResp) {
+        oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DS_XHR.ERROR_DATAXHR);
+        YAHOO.log(YAHOO.widget.DS_XHR.ERROR_DATAXHR + ": " + oResp.statusText, "error", oSelf.toString());
+        return;
+    };
+    
+    var oCallback = {
+        success:responseSuccess,
+        failure:responseFailure
+    };
+    
+    if(YAHOO.lang.isNumber(this.connTimeout) && (this.connTimeout > 0)) {
+        oCallback.timeout = this.connTimeout;
+    }
+    
+    if(this._oConn) {
+        this.connMgr.abort(this._oConn);
+    }
+    
+    oSelf._oConn = this.connMgr.asyncRequest("GET", sUri, oCallback, null);
+};
+
+/**
+ * Parses raw response data into an array of result objects. The result data key
+ * is always stashed in the [0] element of each result object. 
+ *
+ * @method parseResponse
+ * @param sQuery {String} Query string.
+ * @param oResponse {Object} The raw response data to parse.
+ * @param oParent {Object} The object instance that has requested data.
+ * @returns {Object[]} Array of result objects.
+ */
+YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParent) {
+    var aSchema = this.schema;
+    var aResults = [];
+    var bError = false;
+
+    // Strip out comment at the end of results
+    var nEnd = ((this.responseStripAfter !== "") && (oResponse.indexOf)) ?
+        oResponse.indexOf(this.responseStripAfter) : -1;
+    if(nEnd != -1) {
+        oResponse = oResponse.substring(0,nEnd);
+    }
+
+    switch (this.responseType) {
+        case YAHOO.widget.DS_XHR.TYPE_JSON:
+            var jsonList, jsonObjParsed;
+            // Check for JSON lib but divert KHTML clients
+            var isNotMac = (navigator.userAgent.toLowerCase().indexOf('khtml')== -1);
+            if(oResponse.parseJSON && isNotMac) {
+                // Use the new JSON utility if available
+                jsonObjParsed = oResponse.parseJSON();
+                if(!jsonObjParsed) {
+                    bError = true;
+                }
+                else {
+                    try {
+                        // eval is necessary here since aSchema[0] is of unknown depth
+                        jsonList = eval("jsonObjParsed." + aSchema[0]);
+                    }
+                    catch(e) {
+                        bError = true;
+                        break;
+                   }
+                }
+            }
+            else if(window.JSON && isNotMac) {
+                // Use older JSON lib if available
+                jsonObjParsed = JSON.parse(oResponse);
+                if(!jsonObjParsed) {
+                    bError = true;
+                    break;
+                }
+                else {
+                    try {
+                        // eval is necessary here since aSchema[0] is of unknown depth
+                        jsonList = eval("jsonObjParsed." + aSchema[0]);
+                    }
+                    catch(e) {
+                        bError = true;
+                        break;
+                   }
+                }
+            }
+            else {
+                // Parse the JSON response as a string
+                try {
+                    // Trim leading spaces
+                    while (oResponse.substring(0,1) == " ") {
+                        oResponse = oResponse.substring(1, oResponse.length);
+                    }
+
+                    // Invalid JSON response
+                    if(oResponse.indexOf("{") < 0) {
+                        bError = true;
+                        break;
+                    }
+
+                    // Empty (but not invalid) JSON response
+                    if(oResponse.indexOf("{}") === 0) {
+                        break;
+                    }
+
+                    // Turn the string into an object literal...
+                    // ...eval is necessary here
+                    var jsonObjRaw = eval("(" + oResponse + ")");
+                    if(!jsonObjRaw) {
+                        bError = true;
+                        break;
+                    }
+
+                    // Grab the object member that contains an array of all reponses...
+                    // ...eval is necessary here since aSchema[0] is of unknown depth
+                    jsonList = eval("(jsonObjRaw." + aSchema[0]+")");
+                }
+                catch(e) {
+                    bError = true;
+                    break;
+               }
+            }
+
+            if(!jsonList) {
+                bError = true;
+                break;
+            }
+
+            if(!YAHOO.lang.isArray(jsonList)) {
+                jsonList = [jsonList];
+            }
+            
+            // Loop through the array of all responses...
+            for(var i = jsonList.length-1; i >= 0 ; i--) {
+                var aResultItem = [];
+                var jsonResult = jsonList[i];
+                // ...and loop through each data field value of each response
+                for(var j = aSchema.length-1; j >= 1 ; j--) {
+                    // ...and capture data into an array mapped according to the schema...
+                    var dataFieldValue = jsonResult[aSchema[j]];
+                    if(!dataFieldValue) {
+                        dataFieldValue = "";
+                    }
+                    //YAHOO.log("data: " + i + " value:" +j+" = "+dataFieldValue,"debug",this.toString());
+                    aResultItem.unshift(dataFieldValue);
+                }
+                // If schema isn't well defined, pass along the entire result object
+                if(aResultItem.length == 1) {
+                    aResultItem.push(jsonResult);
+                }
+                // Capture the array of data field values in an array of results
+                aResults.unshift(aResultItem);
+            }
+            break;
+        case YAHOO.widget.DS_XHR.TYPE_XML:
+            // Get the collection of results
+            var xmlList = oResponse.getElementsByTagName(aSchema[0]);
+            if(!xmlList) {
+                bError = true;
+                break;
+            }
+            // Loop through each result
+            for(var k = xmlList.length-1; k >= 0 ; k--) {
+                var result = xmlList.item(k);
+                //YAHOO.log("Result"+k+" is "+result.attributes.item(0).firstChild.nodeValue,"debug",this.toString());
+                var aFieldSet = [];
+                // Loop through each data field in each result using the schema
+                for(var m = aSchema.length-1; m >= 1 ; m--) {
+                    //YAHOO.log(aSchema[m]+" is "+result.attributes.getNamedItem(aSchema[m]).firstChild.nodeValue);
+                    var sValue = null;
+                    // Values may be held in an attribute...
+                    var xmlAttr = result.attributes.getNamedItem(aSchema[m]);
+                    if(xmlAttr) {
+                        sValue = xmlAttr.value;
+                        //YAHOO.log("Attr value is "+sValue,"debug",this.toString());
+                    }
+                    // ...or in a node
+                    else{
+                        var xmlNode = result.getElementsByTagName(aSchema[m]);
+                        if(xmlNode && xmlNode.item(0) && xmlNode.item(0).firstChild) {
+                            sValue = xmlNode.item(0).firstChild.nodeValue;
+                            //YAHOO.log("Node value is "+sValue,"debug",this.toString());
+                        }
+                        else {
+                            sValue = "";
+                            //YAHOO.log("Value not found","debug",this.toString());
+                        }
+                    }
+                    // Capture the schema-mapped data field values into an array
+                    aFieldSet.unshift(sValue);
+                }
+                // Capture each array of values into an array of results
+                aResults.unshift(aFieldSet);
+            }
+            break;
+        case YAHOO.widget.DS_XHR.TYPE_FLAT:
+            if(oResponse.length > 0) {
+                // Delete the last line delimiter at the end of the data if it exists
+                var newLength = oResponse.length-aSchema[0].length;
+                if(oResponse.substr(newLength) == aSchema[0]) {
+                    oResponse = oResponse.substr(0, newLength);
+                }
+                var aRecords = oResponse.split(aSchema[0]);
+                for(var n = aRecords.length-1; n >= 0; n--) {
+                    aResults[n] = aRecords[n].split(aSchema[1]);
+                }
+            }
+            break;
+        default:
+            break;
+    }
+    sQuery = null;
+    oResponse = null;
+    oParent = null;
+    if(bError) {
+        return null;
+    }
+    else {
+        return aResults;
+    }
+};            
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * XHR connection object.
+ *
+ * @property _oConn
+ * @type Object
+ * @private
+ */
+YAHOO.widget.DS_XHR.prototype._oConn = null;
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * Implementation of YAHOO.widget.DataSource using a native Javascript function as
+ * its live data source.
+ *  
+ * @class DS_JSFunction
+ * @constructor
+ * @extends YAHOO.widget.DataSource
+ * @param oFunction {HTMLFunction} In-memory Javascript function that returns query results as an array of objects.
+ * @param oConfigs {Object} (optional) Object literal of config params.
+ */
+YAHOO.widget.DS_JSFunction = function(oFunction, oConfigs) {
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            this[sConfig] = oConfigs[sConfig];
+        }
+    }
+
+    // Initialization sequence
+    if(!YAHOO.lang.isFunction(oFunction)) {
+        YAHOO.log("Could not instantiate JSFunction DataSource due to invalid arguments", "error", this.toString());
+        return;
+    }
+    else {
+        this.dataFunction = oFunction;
+        this._init();
+        YAHOO.log("JS Function DataSource initialized","info",this.toString());
+    }
+};
+
+YAHOO.widget.DS_JSFunction.prototype = new YAHOO.widget.DataSource();
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * In-memory Javascript function that returns query results.
+ *
+ * @property dataFunction
+ * @type HTMLFunction
+ */
+YAHOO.widget.DS_JSFunction.prototype.dataFunction = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Queries the live data source defined by function for results. Results are
+ * passed back to a callback function.
+ *  
+ * @method doQuery
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DS_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);
+        YAHOO.log(YAHOO.widget.DataSource.ERROR_DATANULL, "error", this.toString());
+        return;
+    }
+    
+    var resultObj = {};
+    resultObj.query = decodeURIComponent(sQuery);
+    resultObj.results = aResults;
+    this._addCacheElem(resultObj);
+    
+    this.getResultsEvent.fire(this, oParent, sQuery, aResults);
+    YAHOO.log("Results returned for query \"" + sQuery +
+            "\": " + YAHOO.lang.dump(aResults), "info", this.toString());
+    oCallbackFn(sQuery, aResults, oParent);
+    return;
+};
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * Implementation of YAHOO.widget.DataSource using a native Javascript array as
+ * its live data source.
+ *
+ * @class DS_JSArray
+ * @constructor
+ * @extends YAHOO.widget.DataSource
+ * @param aData {String[]} In-memory Javascript array of simple string data.
+ * @param oConfigs {Object} (optional) Object literal of config params.
+ */
+YAHOO.widget.DS_JSArray = function(aData, oConfigs) {
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            this[sConfig] = oConfigs[sConfig];
+        }
+    }
+
+    // Initialization sequence
+    if(!YAHOO.lang.isArray(aData)) {
+        YAHOO.log("Could not instantiate JSArray DataSource due to invalid arguments", "error", this.toString());
+        return;
+    }
+    else {
+        this.data = aData;
+        this._init();
+        YAHOO.log("JS Array DataSource initialized","info",this.toString());
+    }
+};
+
+YAHOO.widget.DS_JSArray.prototype = new YAHOO.widget.DataSource();
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * In-memory Javascript array of strings.
+ *
+ * @property data
+ * @type Array
+ */
+YAHOO.widget.DS_JSArray.prototype.data = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Queries the live data source defined by data for results. Results are passed
+ * back to a callback function.
+ *
+ * @method doQuery
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DS_JSArray.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {
+    var i;
+    var aData = this.data; // the array
+    var aResults = []; // container for results
+    var bMatchFound = false;
+    var bMatchContains = this.queryMatchContains;
+    if(sQuery) {
+        if(!this.queryMatchCase) {
+            sQuery = sQuery.toLowerCase();
+        }
+
+        // Loop through each element of the array...
+        // which can be a string or an array of strings
+        for(i = aData.length-1; i >= 0; i--) {
+            var aDataset = [];
+
+            if(YAHOO.lang.isString(aData[i])) {
+                aDataset[0] = aData[i];
+            }
+            else if(YAHOO.lang.isArray(aData[i])) {
+                aDataset = aData[i];
+            }
+
+            if(YAHOO.lang.isString(aDataset[0])) {
+                var sKeyIndex = (this.queryMatchCase) ?
+                encodeURIComponent(aDataset[0]).indexOf(sQuery):
+                encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);
+
+                // A STARTSWITH match is when the query is found at the beginning of the key string...
+                if((!bMatchContains && (sKeyIndex === 0)) ||
+                // A CONTAINS match is when the query is found anywhere within the key string...
+                (bMatchContains && (sKeyIndex > -1))) {
+                    // Stash a match into aResults[].
+                    aResults.unshift(aDataset);
+                }
+            }
+        }
+    }
+    else {
+        for(i = aData.length-1; i >= 0; i--) {
+            if(YAHOO.lang.isString(aData[i])) {
+                aResults.unshift([aData[i]]);
+            }
+            else if(YAHOO.lang.isArray(aData[i])) {
+                aResults.unshift(aData[i]);
+            }
+        }
+    }
+    
+    this.getResultsEvent.fire(this, oParent, sQuery, aResults);
+    YAHOO.log("Results returned for query \"" + sQuery +
+            "\": " + YAHOO.lang.dump(aResults), "info", this.toString());
+    oCallbackFn(sQuery, aResults, oParent);
+};
+
+YAHOO.register("autocomplete", YAHOO.widget.AutoComplete, {version: "2.3.0", build: "442"});
index 91bba0312c501e2c0f7d8e06cda1d0819a5aa189..d877c981f5f8810cc71922d572c37f90ca743fc7 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-\r
-YAHOO.widget.AutoComplete=function(elInput,elContainer,oDataSource,oConfigs){if(elInput&&elContainer&&oDataSource){if(oDataSource&&(oDataSource instanceof YAHOO.widget.DataSource)){this.dataSource=oDataSource;}\r
-else{return;}\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
-else{this._sName=(elInput.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=elInput;}}\r
-else{return;}\r
-if(YAHOO.util.Dom.inDocument(elContainer)){if(typeof elContainer=="string"){this._oContainer=document.getElementById(elContainer);}\r
-else{this._oContainer=elContainer;}\r
-if(this._oContainer.style.display=="none"){}}\r
-else{return;}\r
-if(typeof oConfigs=="object"){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}\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
-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
-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
-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
-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
-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
-else{this._oContainer._oContent._oBody.innerHTML="";this._oContainer._oContent.style.display="none";}\r
-this._maxResultsDisplayed=0;};YAHOO.widget.AutoComplete.prototype.formatResult=function(oResultItem,sQuery){var sResult=oResultItem[0];if(sResult){return sResult;}\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
-var maxResultsDisplayed=this.maxResultsDisplayed;if(isNaN(this.maxResultsDisplayed)||(this.maxResultsDisplayed<1)){this.maxResultsDisplayed=10;}\r
-var queryDelay=this.queryDelay;if(isNaN(this.queryDelay)||(this.queryDelay<0)){this.queryDelay=0.5;}\r
-var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){if(typeof aDelimChar=="string"){this.delimChar=[aDelimChar];}\r
-else if(aDelimChar.constructor!=Array){this.delimChar=null;}}\r
-var animSpeed=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(isNaN(animSpeed)||(animSpeed<0)){animSpeed=0.3;}\r
-if(!this._oAnim){oAnim=new YAHOO.util.Anim(this._oContainer._oContent,{},this.animSpeed);this._oAnim=oAnim;}\r
-else{this._oAnim.duration=animSpeed;}}\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
-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
-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
-this._oContainer._oContent._oBody.innerHTML="";}\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
-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
-return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){if(this.minQueryLength==-1){this._toggleContainer(false);return;}\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
-if(aDelimChar[i]==" "){for(var j=aDelimChar.length-1;j>=0;j--){if(sQuery[nDelimIndex-1]==aDelimChar[j]){nDelimIndex--;break;}}}\r
-if(nDelimIndex>-1){var nQueryStart=nDelimIndex+1;while(sQuery.charAt(nQueryStart)==" "){nQueryStart+=1;}\r
-this._sSavedQuery=sQuery.substring(0,nQueryStart);sQuery=sQuery.substr(nQueryStart);}\r
-else if(sQuery.indexOf(this._sSavedQuery)<0){this._sSavedQuery=null;}}\r
-if(sQuery&&(sQuery.length<this.minQueryLength)||(!sQuery&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}\r
-this._toggleContainer(false);return;}\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
-if(!oSelf._bFocused||!aResults){return;}\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
-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
-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
-if(oSelf.autoHighlight){var oFirstItem=aItems[0];oSelf._toggleHighlight(oFirstItem,"to");oSelf.itemArrowToEvent.fire(oSelf,oFirstItem);oSelf._typeAhead(oFirstItem,sQuery);}\r
-else{oSelf._oCurItem=null;}\r
-var ok=oSelf.doBeforeExpandContainer(oSelf._oTextbox,oSelf._oContainer,sQuery,aResults);oSelf._toggleContainer(ok);}\r
-else{oSelf._toggleContainer(false);}\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
-else{this._oTextbox.value="";}\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
-return(foundMatch);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(oItem,sQuery){if(!this.typeAhead||(this._nKeyCode==8)){return;}\r
-var oTextbox=this._oTextbox;var sValue=this._oTextbox.value;if(!oTextbox.setSelectionRange&&!oTextbox.createTextRange){return;}\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
-else if(oTextbox.createTextRange){var oTextRange=oTextbox.createTextRange();oTextRange.moveStart("character",nStart);oTextRange.moveEnd("character",nEnd-oTextbox.value.length);oTextRange.select();}\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
-else{this._oContainer._oIFrame.style.width=0;this._oContainer._oIFrame.style.height=0;}}\r
-if(this.useShadow&&this._oContainer._oShadow){bFireEvent=true;if(bShow){this._oContainer._oShadow.style.width=width;this._oContainer._oShadow.style.height=height;}\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
-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
-if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}\r
-this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;}\r
-if(!bShow&&!this._bContainerOpen){oContainer._oContent.style.display="none";return;}\r
-var oAnim=this._oAnim;if(oAnim&&oAnim.getEl()&&(this.animHoriz||this.animVert)){if(!bShow){this._toggleContainerHelpers(bShow);}\r
-if(oAnim.isAnimated()){oAnim.stop();}\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
-else{oContainer._oContent.style.width=wExp+"px";oContainer._oContent.style.height=hExp+"px";}\r
-oContainer.removeChild(oClone);oClone=null;var oSelf=this;var onAnimComplete=function(){oAnim.onComplete.unsubscribeAll();if(bShow){oSelf.containerExpandEvent.fire(oSelf);}\r
-else{oContainer._oContent.style.display="none";oSelf.containerCollapseEvent.fire(oSelf);}\r
-oSelf._toggleContainerHelpers(bShow);};oContainer._oContent.style.display="block";oAnim.onComplete.subscribe(onAnimComplete);oAnim.animate();this._bContainerOpen=bShow;}\r
-else{if(bShow){oContainer._oContent.style.display="block";this.containerExpandEvent.fire(this);}\r
-else{oContainer._oContent.style.display="none";this.containerCollapseEvent.fire(this);}\r
-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
-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
-var sPrehighlight=this.prehighlightClassName;if((sType=="mouseover")&&sPrehighlight){YAHOO.util.Dom.addClass(oNewItem,sPrehighlight);}\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
-oTextbox.value+=sResultKey+sDelimChar;if(sDelimChar!=" "){oTextbox.value+=" ";}}\r
-else{oTextbox.value=sResultKey;}\r
-if(oTextbox.type=="textarea"){oTextbox.scrollTop=oTextbox.scrollHeight;}\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
-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
-var nNewItemIndex=(nKeyCode==40)?(nCurItemIndex+1):(nCurItemIndex-1);if(nNewItemIndex<-2||nNewItemIndex>=this._nDisplayedItems){return;}\r
-if(oCurItem){this._toggleHighlight(oCurItem,"from");this.itemArrowFromEvent.fire(this,oCurItem);}\r
-if(nNewItemIndex==-1){if(this.delimChar&&this._sSavedQuery){if(!this._textMatchesOption()){this._oTextbox.value=this._sSavedQuery;}\r
-else{this._oTextbox.value=this._sSavedQuery+this._sCurQuery;}}\r
-else{this._oTextbox.value=this._sCurQuery;}\r
-this._oCurItem=null;return;}\r
-if(nNewItemIndex==-2){this._toggleContainer(false);return;}\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
-else if((oNewItem.offsetTop+oNewItem.offsetHeight)<oContent.scrollTop){oContent.scrollTop=oNewItem.offsetTop;}}\r
-else{if(oNewItem.offsetTop<oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}\r
-else if(oNewItem.offsetTop>(oContent.scrollTop+oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}}}\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
-else{oSelf._toggleHighlight(this,"to");}\r
-oSelf.itemMouseOverEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseout");}\r
-else{oSelf._toggleHighlight(this,"from");}\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
-if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}\r
-else{oSelf._toggleContainer(false);}\r
-break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}\r
-if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}\r
-else{oSelf._toggleContainer(false);}\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
-break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}\r
-break;case 38:case 40:YAHOO.util.Event.stopEvent(v);break;default:break;}}\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
-else{oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);}\r
-if(oSelf.queryDelay>0){var nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}\r
-oSelf._nDelayID=nDelayID;}\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
-else{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}}\r
-if(oSelf._bContainerOpen){oSelf._toggleContainer(false);}\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
-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
-if(this._aCacheHelper){this._aCacheHelper=[];}\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
-if(maxCacheEntries>0&&!this._aCache){this._aCache=[];}\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
-if(aCache.length>=this.maxCacheEntries){aCache.shift();}\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
-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
-break;}\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
-resultObj={};resultObj.query=sQuery;resultObj.results=aResults;this._addCacheElem(resultObj);break;}}\r
-if(bMatchFound){break;}}}\r
-if(bMatchFound){this.getCachedResultsEvent.fire(this,oParent,sOrigQuery,aResults);oCallbackFn(sOrigQuery,aResults,oParent);}}\r
-return aResults;};YAHOO.widget.DS_XHR=function(sScriptURI,aSchema,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}\r
-if(!aSchema||(aSchema.constructor!=Array)){return;}\r
-else{this.schema=aSchema;}\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
-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
-for(var foo in oResp){}\r
-if(!isXML){oResp=oResp.responseText;}\r
-else{oResp=oResp.responseXML;}\r
-if(oResp===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}\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
-else{oSelf.getResultsEvent.fire(oSelf,oParent,sQuery,aResults);oSelf._addCacheElem(resultObj);}\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
-if(this._oConn){this.connMgr.abort(this._oConn);}\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
-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
-else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}\r
-catch(e){bError=true;break;}}}\r
-else{try{while(oResponse.substring(0,1)==" "){oResponse=oResponse.substring(1,oResponse.length);}\r
-if(oResponse.indexOf("{")<0){bError=true;break;}\r
-if(oResponse.indexOf("{}")===0){break;}\r
-var jsonObjRaw=eval("("+oResponse+")");if(!jsonObjRaw){bError=true;break;}\r
-jsonList=eval("(jsonObjRaw."+aSchema[0]+")");}\r
-catch(e){bError=true;break;}}\r
-if(!jsonList){bError=true;break;}\r
-if(jsonList.constructor!=Array){jsonList=[jsonList];}\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
-aResultItem.unshift(dataFieldValue);}\r
-if(aResultItem.length==1){aResultItem.push(jsonResult);}\r
-aResults.unshift(aResultItem);}\r
-break;case YAHOO.widget.DS_XHR.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}\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
-else{var xmlNode=result.getElementsByTagName(aSchema[m]);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){sValue=xmlNode.item(0).firstChild.nodeValue;}\r
-else{sValue="";}}\r
-aFieldSet.unshift(sValue);}\r
-aResults.unshift(aFieldSet);}\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
-var aRecords=oResponse.split(aSchema[0]);for(var n=aRecords.length-1;n>=0;n--){aResults[n]=aRecords[n].split(aSchema[1]);}}\r
-break;default:break;}\r
-sQuery=null;oResponse=null;oParent=null;if(bError){return null;}\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
-if(!oFunction||(oFunction.constructor!=Function)){return;}\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
-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
-if(!aData||(aData.constructor!=Array)){return;}\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
-for(var i=aData.length-1;i>=0;i--){var aDataset=[];if(aData[i]){if(aData[i].constructor==String){aDataset[0]=aData[i];}\r
-else if(aData[i].constructor==Array){aDataset=aData[i];}}\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
-this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);};
\ No newline at end of file
+
+YAHOO.widget.AutoComplete=function(elInput,elContainer,oDataSource,oConfigs){if(elInput&&elContainer&&oDataSource){if(oDataSource instanceof YAHOO.widget.DataSource){this.dataSource=oDataSource;}
+else{return;}
+if(YAHOO.util.Dom.inDocument(elInput)){if(YAHOO.lang.isString(elInput)){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput;this._oTextbox=document.getElementById(elInput);}
+else{this._sName=(elInput.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=elInput;}
+YAHOO.util.Dom.addClass(this._oTextbox,"yui-ac-input");}
+else{return;}
+if(YAHOO.util.Dom.inDocument(elContainer)){if(YAHOO.lang.isString(elContainer)){this._oContainer=document.getElementById(elContainer);}
+else{this._oContainer=elContainer;}
+if(this._oContainer.style.display=="none"){}
+var elParent=this._oContainer.parentNode;var elTag=elParent.tagName.toLowerCase();while(elParent&&(elParent!="document")){if(elTag=="div"){YAHOO.util.Dom.addClass(elParent,"yui-ac");break;}
+else{elParent=elParent.parentNode;elTag=elParent.tagName.toLowerCase();}}
+if(elTag!="div"){}}
+else{return;}
+if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}
+this._initContainer();this._initProps();this._initList();this._initContainerHelpers();var oSelf=this;var oTextbox=this._oTextbox;var oContent=this._oContainer._oContent;YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);if(oTextbox.form){YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);}
+YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);oTextbox.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}
+else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.2;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen;};YAHOO.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems;};YAHOO.widget.AutoComplete.prototype.getListItemData=function(oListItem){if(oListItem._oResultData){return oListItem._oResultData;}
+else{return false;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(sHeader){if(sHeader){if(this._oContainer._oContent._oHeader){this._oContainer._oContent._oHeader.innerHTML=sHeader;this._oContainer._oContent._oHeader.style.display="block";}}
+else{this._oContainer._oContent._oHeader.innerHTML="";this._oContainer._oContent._oHeader.style.display="none";}};YAHOO.widget.AutoComplete.prototype.setFooter=function(sFooter){if(sFooter){if(this._oContainer._oContent._oFooter){this._oContainer._oContent._oFooter.innerHTML=sFooter;this._oContainer._oContent._oFooter.style.display="block";}}
+else{this._oContainer._oContent._oFooter.innerHTML="";this._oContainer._oContent._oFooter.style.display="none";}};YAHOO.widget.AutoComplete.prototype.setBody=function(sBody){if(sBody){if(this._oContainer._oContent._oBody){this._oContainer._oContent._oBody.innerHTML=sBody;this._oContainer._oContent._oBody.style.display="block";this._oContainer._oContent.style.display="block";}}
+else{this._oContainer._oContent._oBody.innerHTML="";this._oContainer._oContent.style.display="none";}
+this._maxResultsDisplayed=0;};YAHOO.widget.AutoComplete.prototype.formatResult=function(oResultItem,sQuery){var sResult=oResultItem[0];if(sResult){return sResult;}
+else{return"";}};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(oTextbox,oContainer,sQuery,aResults){return true;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(sQuery){this._sendQuery(sQuery);};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(sQuery){return sQuery;};YAHOO.widget.AutoComplete.prototype.destroy=function(){var instanceName=this.toString();var elInput=this._oTextbox;var elContainer=this._oContainer;this.textboxFocusEvent.unsubscribe();this.textboxKeyEvent.unsubscribe();this.dataRequestEvent.unsubscribe();this.dataReturnEvent.unsubscribe();this.dataErrorEvent.unsubscribe();this.containerExpandEvent.unsubscribe();this.typeAheadEvent.unsubscribe();this.itemMouseOverEvent.unsubscribe();this.itemMouseOutEvent.unsubscribe();this.itemArrowToEvent.unsubscribe();this.itemArrowFromEvent.unsubscribe();this.itemSelectEvent.unsubscribe();this.unmatchedItemSelectEvent.unsubscribe();this.selectionEnforceEvent.unsubscribe();this.containerCollapseEvent.unsubscribe();this.textboxBlurEvent.unsubscribe();YAHOO.util.Event.purgeElement(elInput,true);YAHOO.util.Event.purgeElement(elContainer,true);elContainer.innerHTML="";for(var key in this){if(this.hasOwnProperty(key)){this[key]=null;}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._oTextbox=null;YAHOO.widget.AutoComplete.prototype._bFocused=true;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._oContainer=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._aListItems=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sSavedQuery=null;YAHOO.widget.AutoComplete.prototype._oCurItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var minQueryLength=this.minQueryLength;if(!YAHOO.lang.isNumber(minQueryLength)){this.minQueryLength=1;}
+var maxResultsDisplayed=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(maxResultsDisplayed)||(maxResultsDisplayed<1)){this.maxResultsDisplayed=10;}
+var queryDelay=this.queryDelay;if(!YAHOO.lang.isNumber(queryDelay)||(queryDelay<0)){this.queryDelay=0.2;}
+var delimChar=this.delimChar;if(YAHOO.lang.isString(delimChar)){this.delimChar=[delimChar];}
+else if(!YAHOO.lang.isArray(delimChar)){this.delimChar=null;}
+var animSpeed=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(animSpeed)||(animSpeed<0)){this.animSpeed=0.3;}
+if(!this._oAnim){this._oAnim=new YAHOO.util.Anim(this._oContainer._oContent,{},this.animSpeed);}
+else{this._oAnim.duration=this.animSpeed;}}
+if(this.forceSelection&&delimChar){}};YAHOO.widget.AutoComplete.prototype._initContainerHelpers=function(){if(this.useShadow&&!this._oContainer._oShadow){var oShadow=document.createElement("div");oShadow.className="yui-ac-shadow";this._oContainer._oShadow=this._oContainer.appendChild(oShadow);}
+if(this.useIFrame&&!this._oContainer._oIFrame){var oIFrame=document.createElement("iframe");oIFrame.src=this._iFrameSrc;oIFrame.frameBorder=0;oIFrame.scrolling="no";oIFrame.style.position="absolute";oIFrame.style.width="100%";oIFrame.style.height="100%";oIFrame.tabIndex=-1;this._oContainer._oIFrame=this._oContainer.appendChild(oIFrame);}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){YAHOO.util.Dom.addClass(this._oContainer,"yui-ac-container");if(!this._oContainer._oContent){var oContent=document.createElement("div");oContent.className="yui-ac-content";oContent.style.display="none";this._oContainer._oContent=this._oContainer.appendChild(oContent);var oHeader=document.createElement("div");oHeader.className="yui-ac-hd";oHeader.style.display="none";this._oContainer._oContent._oHeader=this._oContainer._oContent.appendChild(oHeader);var oBody=document.createElement("div");oBody.className="yui-ac-bd";this._oContainer._oContent._oBody=this._oContainer._oContent.appendChild(oBody);var oFooter=document.createElement("div");oFooter.className="yui-ac-ft";oFooter.style.display="none";this._oContainer._oContent._oFooter=this._oContainer._oContent.appendChild(oFooter);}
+else{}};YAHOO.widget.AutoComplete.prototype._initList=function(){this._aListItems=[];while(this._oContainer._oContent._oBody.hasChildNodes()){var oldListItems=this.getListItems();if(oldListItems){for(var oldi=oldListItems.length-1;oldi>=0;oldi--){oldListItems[oldi]=null;}}
+this._oContainer._oContent._oBody.innerHTML="";}
+var oList=document.createElement("ul");oList=this._oContainer._oContent._oBody.appendChild(oList);for(var i=0;i<this.maxResultsDisplayed;i++){var oItem=document.createElement("li");oItem=oList.appendChild(oItem);this._aListItems[i]=oItem;this._initListItem(oItem,i);}
+this._maxResultsDisplayed=this.maxResultsDisplayed;};YAHOO.widget.AutoComplete.prototype._initListItem=function(oItem,nItemIndex){var oSelf=this;oItem.style.display="none";oItem._nItemIndex=nItemIndex;oItem.mouseover=oItem.mouseout=oItem.onclick=null;YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);};YAHOO.widget.AutoComplete.prototype._onIMEDetected=function(oSelf){oSelf._enableIntervalDetection();};YAHOO.widget.AutoComplete.prototype._enableIntervalDetection=function(){var currValue=this._oTextbox.value;var lastValue=this._sLastTextboxValue;if(currValue!=lastValue){this._sLastTextboxValue=currValue;this._sendQuery(currValue);}};YAHOO.widget.AutoComplete.prototype._cancelIntervalDetection=function(oSelf){if(oSelf._queryInterval){clearInterval(oSelf._queryInterval);}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(nKeyCode){if((nKeyCode==9)||(nKeyCode==13)||(nKeyCode==16)||(nKeyCode==17)||(nKeyCode>=18&&nKeyCode<=20)||(nKeyCode==27)||(nKeyCode>=33&&nKeyCode<=35)||(nKeyCode>=36&&nKeyCode<=40)||(nKeyCode>=44&&nKeyCode<=45)){return true;}
+return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){if(this.minQueryLength==-1){this._toggleContainer(false);return;}
+var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){var nDelimIndex=-1;for(var i=aDelimChar.length-1;i>=0;i--){var nNewIndex=sQuery.lastIndexOf(aDelimChar[i]);if(nNewIndex>nDelimIndex){nDelimIndex=nNewIndex;}}
+if(aDelimChar[i]==" "){for(var j=aDelimChar.length-1;j>=0;j--){if(sQuery[nDelimIndex-1]==aDelimChar[j]){nDelimIndex--;break;}}}
+if(nDelimIndex>-1){var nQueryStart=nDelimIndex+1;while(sQuery.charAt(nQueryStart)==" "){nQueryStart+=1;}
+this._sSavedQuery=sQuery.substring(0,nQueryStart);sQuery=sQuery.substr(nQueryStart);}
+else if(sQuery.indexOf(this._sSavedQuery)<0){this._sSavedQuery=null;}}
+if((sQuery&&(sQuery.length<this.minQueryLength))||(!sQuery&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}
+this._toggleContainer(false);return;}
+sQuery=encodeURIComponent(sQuery);this._nDelayID=-1;sQuery=this.doBeforeSendQuery(sQuery);this.dataRequestEvent.fire(this,sQuery);this.dataSource.getResults(this._populateList,sQuery,this);};YAHOO.widget.AutoComplete.prototype._populateList=function(sQuery,aResults,oSelf){if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,sQuery);}
+if(!oSelf._bFocused||!aResults){return;}
+var isOpera=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);var contentStyle=oSelf._oContainer._oContent.style;contentStyle.width=(!isOpera)?null:"";contentStyle.height=(!isOpera)?null:"";var sCurQuery=decodeURIComponent(sQuery);oSelf._sCurQuery=sCurQuery;oSelf._bItemSelected=false;if(oSelf._maxResultsDisplayed!=oSelf.maxResultsDisplayed){oSelf._initList();}
+var nItems=Math.min(aResults.length,oSelf.maxResultsDisplayed);oSelf._nDisplayedItems=nItems;if(nItems>0){oSelf._initContainerHelpers();var aItems=oSelf._aListItems;for(var i=nItems-1;i>=0;i--){var oItemi=aItems[i];var oResultItemi=aResults[i];oItemi.innerHTML=oSelf.formatResult(oResultItemi,sCurQuery);oItemi.style.display="list-item";oItemi._sResultKey=oResultItemi[0];oItemi._oResultData=oResultItemi;}
+for(var j=aItems.length-1;j>=nItems;j--){var oItemj=aItems[j];oItemj.innerHTML=null;oItemj.style.display="none";oItemj._sResultKey=null;oItemj._oResultData=null;}
+var ok=oSelf.doBeforeExpandContainer(oSelf._oTextbox,oSelf._oContainer,sQuery,aResults);oSelf._toggleContainer(ok);if(oSelf.autoHighlight){var oFirstItem=aItems[0];oSelf._toggleHighlight(oFirstItem,"to");oSelf.itemArrowToEvent.fire(oSelf,oFirstItem);oSelf._typeAhead(oFirstItem,sQuery);}
+else{oSelf._oCurItem=null;}}
+else{oSelf._toggleContainer(false);}
+oSelf.dataReturnEvent.fire(oSelf,sQuery,aResults);};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var sValue=this._oTextbox.value;var sChar=(this.delimChar)?this.delimChar[0]:null;var nIndex=(sChar)?sValue.lastIndexOf(sChar,sValue.length-2):-1;if(nIndex>-1){this._oTextbox.value=sValue.substring(0,nIndex);}
+else{this._oTextbox.value="";}
+this._sSavedQuery=this._oTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var foundMatch=null;for(var i=this._nDisplayedItems-1;i>=0;i--){var oItem=this._aListItems[i];var sMatch=oItem._sResultKey.toLowerCase();if(sMatch==this._sCurQuery.toLowerCase()){foundMatch=oItem;break;}}
+return(foundMatch);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(oItem,sQuery){if(!this.typeAhead||(this._nKeyCode==8)){return;}
+var oTextbox=this._oTextbox;var sValue=this._oTextbox.value;if(!oTextbox.setSelectionRange&&!oTextbox.createTextRange){return;}
+var nStart=sValue.length;this._updateValue(oItem);var nEnd=oTextbox.value.length;this._selectText(oTextbox,nStart,nEnd);var sPrefill=oTextbox.value.substr(nStart,nEnd);this.typeAheadEvent.fire(this,sQuery,sPrefill);};YAHOO.widget.AutoComplete.prototype._selectText=function(oTextbox,nStart,nEnd){if(oTextbox.setSelectionRange){oTextbox.setSelectionRange(nStart,nEnd);}
+else if(oTextbox.createTextRange){var oTextRange=oTextbox.createTextRange();oTextRange.moveStart("character",nStart);oTextRange.moveEnd("character",nEnd-oTextbox.value.length);oTextRange.select();}
+else{oTextbox.select();}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(bShow){var bFireEvent=false;var width=this._oContainer._oContent.offsetWidth+"px";var height=this._oContainer._oContent.offsetHeight+"px";if(this.useIFrame&&this._oContainer._oIFrame){bFireEvent=true;if(bShow){this._oContainer._oIFrame.style.width=width;this._oContainer._oIFrame.style.height=height;}
+else{this._oContainer._oIFrame.style.width=0;this._oContainer._oIFrame.style.height=0;}}
+if(this.useShadow&&this._oContainer._oShadow){bFireEvent=true;if(bShow){this._oContainer._oShadow.style.width=width;this._oContainer._oShadow.style.height=height;}
+else{this._oContainer._oShadow.style.width=0;this._oContainer._oShadow.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(bShow){var oContainer=this._oContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return;}
+if(!bShow){this._oContainer._oContent.scrollTop=0;var aItems=this._aListItems;if(aItems&&(aItems.length>0)){for(var i=aItems.length-1;i>=0;i--){aItems[i].style.display="none";}}
+if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}
+this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;}
+if(!bShow&&!this._bContainerOpen){oContainer._oContent.style.display="none";return;}
+var oAnim=this._oAnim;if(oAnim&&oAnim.getEl()&&(this.animHoriz||this.animVert)){if(!bShow){this._toggleContainerHelpers(bShow);}
+if(oAnim.isAnimated()){oAnim.stop();}
+var oClone=oContainer._oContent.cloneNode(true);oContainer.appendChild(oClone);oClone.style.top="-9000px";oClone.style.display="block";var wExp=oClone.offsetWidth;var hExp=oClone.offsetHeight;var wColl=(this.animHoriz)?0:wExp;var hColl=(this.animVert)?0:hExp;oAnim.attributes=(bShow)?{width:{to:wExp},height:{to:hExp}}:{width:{to:wColl},height:{to:hColl}};if(bShow&&!this._bContainerOpen){oContainer._oContent.style.width=wColl+"px";oContainer._oContent.style.height=hColl+"px";}
+else{oContainer._oContent.style.width=wExp+"px";oContainer._oContent.style.height=hExp+"px";}
+oContainer.removeChild(oClone);oClone=null;var oSelf=this;var onAnimComplete=function(){oAnim.onComplete.unsubscribeAll();if(bShow){oSelf.containerExpandEvent.fire(oSelf);}
+else{oContainer._oContent.style.display="none";oSelf.containerCollapseEvent.fire(oSelf);}
+oSelf._toggleContainerHelpers(bShow);};oContainer._oContent.style.display="block";oAnim.onComplete.subscribe(onAnimComplete);oAnim.animate();this._bContainerOpen=bShow;}
+else{if(bShow){oContainer._oContent.style.display="block";this.containerExpandEvent.fire(this);}
+else{oContainer._oContent.style.display="none";this.containerCollapseEvent.fire(this);}
+this._toggleContainerHelpers(bShow);this._bContainerOpen=bShow;}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(oNewItem,sType){var sHighlight=this.highlightClassName;if(this._oCurItem){YAHOO.util.Dom.removeClass(this._oCurItem,sHighlight);}
+if((sType=="to")&&sHighlight){YAHOO.util.Dom.addClass(oNewItem,sHighlight);this._oCurItem=oNewItem;}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(oNewItem,sType){if(oNewItem==this._oCurItem){return;}
+var sPrehighlight=this.prehighlightClassName;if((sType=="mouseover")&&sPrehighlight){YAHOO.util.Dom.addClass(oNewItem,sPrehighlight);}
+else{YAHOO.util.Dom.removeClass(oNewItem,sPrehighlight);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(oItem){var oTextbox=this._oTextbox;var sDelimChar=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var sSavedQuery=this._sSavedQuery;var sResultKey=oItem._sResultKey;oTextbox.focus();oTextbox.value="";if(sDelimChar){if(sSavedQuery){oTextbox.value=sSavedQuery;}
+oTextbox.value+=sResultKey+sDelimChar;if(sDelimChar!=" "){oTextbox.value+=" ";}}
+else{oTextbox.value=sResultKey;}
+if(oTextbox.type=="textarea"){oTextbox.scrollTop=oTextbox.scrollHeight;}
+var end=oTextbox.value.length;this._selectText(oTextbox,end,end);this._oCurItem=oItem;};YAHOO.widget.AutoComplete.prototype._selectItem=function(oItem){this._bItemSelected=true;this._updateValue(oItem);this._cancelIntervalDetection(this);this.itemSelectEvent.fire(this,oItem,oItem._oResultData);this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(this._oCurItem){this._selectItem(this._oCurItem);}
+else{this._toggleContainer(false);}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(nKeyCode){if(this._bContainerOpen){var oCurItem=this._oCurItem;var nCurItemIndex=-1;if(oCurItem){nCurItemIndex=oCurItem._nItemIndex;}
+var nNewItemIndex=(nKeyCode==40)?(nCurItemIndex+1):(nCurItemIndex-1);if(nNewItemIndex<-2||nNewItemIndex>=this._nDisplayedItems){return;}
+if(oCurItem){this._toggleHighlight(oCurItem,"from");this.itemArrowFromEvent.fire(this,oCurItem);}
+if(nNewItemIndex==-1){if(this.delimChar&&this._sSavedQuery){if(!this._textMatchesOption()){this._oTextbox.value=this._sSavedQuery;}
+else{this._oTextbox.value=this._sSavedQuery+this._sCurQuery;}}
+else{this._oTextbox.value=this._sCurQuery;}
+this._oCurItem=null;return;}
+if(nNewItemIndex==-2){this._toggleContainer(false);return;}
+var oNewItem=this._aListItems[nNewItemIndex];var oContent=this._oContainer._oContent;var scrollOn=((YAHOO.util.Dom.getStyle(oContent,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(oContent,"overflowY")=="auto"));if(scrollOn&&(nNewItemIndex>-1)&&(nNewItemIndex<this._nDisplayedItems)){if(nKeyCode==40){if((oNewItem.offsetTop+oNewItem.offsetHeight)>(oContent.scrollTop+oContent.offsetHeight)){oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}
+else if((oNewItem.offsetTop+oNewItem.offsetHeight)<oContent.scrollTop){oContent.scrollTop=oNewItem.offsetTop;}}
+else{if(oNewItem.offsetTop<oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}
+else if(oNewItem.offsetTop>(oContent.scrollTop+oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}}}
+this._toggleHighlight(oNewItem,"to");this.itemArrowToEvent.fire(this,oNewItem);if(this.typeAhead){this._updateValue(oNewItem);}}};YAHOO.widget.AutoComplete.prototype._onItemMouseover=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseover");}
+else{oSelf._toggleHighlight(this,"to");}
+oSelf.itemMouseOverEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseout");}
+else{oSelf._toggleHighlight(this,"from");}
+oSelf.itemMouseOutEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseclick=function(v,oSelf){oSelf._toggleHighlight(this,"to");oSelf._selectItem(this);};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(v,oSelf){oSelf._bOverContainer=true;};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(v,oSelf){oSelf._bOverContainer=false;if(oSelf._oCurItem){oSelf._toggleHighlight(oSelf._oCurItem,"to");}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(v,oSelf){oSelf._oTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(v,oSelf){oSelf._toggleContainerHelpers(oSelf._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(v,oSelf){var nKeyCode=v.keyCode;switch(nKeyCode){case 9:if(oSelf._oCurItem){if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
+oSelf._selectItem(oSelf._oCurItem);}
+else{oSelf._toggleContainer(false);}
+break;case 13:if(oSelf._oCurItem){if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
+oSelf._selectItem(oSelf._oCurItem);}
+else{oSelf._toggleContainer(false);}
+break;case 27:oSelf._toggleContainer(false);return;case 39:oSelf._jumpSelection();break;case 38:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;case 40:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(v,oSelf){var nKeyCode=v.keyCode;var isMac=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);if(isMac){switch(nKeyCode){case 9:if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){YAHOO.util.Event.stopEvent(v);}
+break;case 13:if(oSelf._nKeyCode!=nKeyCode){YAHOO.util.Event.stopEvent(v);}
+break;case 38:case 40:YAHOO.util.Event.stopEvent(v);break;default:break;}}
+else if(nKeyCode==229){oSelf._queryInterval=setInterval(function(){oSelf._onIMEDetected(oSelf);},500);}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(v,oSelf){oSelf._initProps();var nKeyCode=v.keyCode;oSelf._nKeyCode=nKeyCode;var sText=this.value;if(oSelf._isIgnoreKey(nKeyCode)||(sText.toLowerCase()==oSelf._sCurQuery)){return;}
+else{oSelf._bItemSelected=false;YAHOO.util.Dom.removeClass(oSelf._oCurItem,oSelf.highlightClassName);oSelf._oCurItem=null;oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);}
+if(oSelf.queryDelay>0){var nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}
+oSelf._nDelayID=nDelayID;}
+else{oSelf._sendQuery(sText);}};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,oSelf){oSelf._oTextbox.setAttribute("autocomplete","off");oSelf._bFocused=true;if(!oSelf._bItemSelected){oSelf.textboxFocusEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,oSelf){if(!oSelf._bOverContainer||(oSelf._nKeyCode==9)){if(!oSelf._bItemSelected){var oMatch=oSelf._textMatchesOption();if(!oSelf._bContainerOpen||(oSelf._bContainerOpen&&(oMatch===null))){if(oSelf.forceSelection){oSelf._clearSelection();}
+else{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}
+else{oSelf._selectItem(oMatch);}}
+if(oSelf._bContainerOpen){oSelf._toggleContainer(false);}
+oSelf._cancelIntervalDetection(oSelf);oSelf._bFocused=false;oSelf.textboxBlurEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onFormSubmit=function(v,oSelf){if(oSelf.allowBrowserAutocomplete){oSelf._oTextbox.setAttribute("autocomplete","on");}
+else{oSelf._oTextbox.setAttribute("autocomplete","off");}};YAHOO.widget.DataSource=function(){};YAHOO.widget.DataSource.ERROR_DATANULL="Response data was null";YAHOO.widget.DataSource.ERROR_DATAPARSE="Response data could not be parsed";YAHOO.widget.DataSource.prototype.maxCacheEntries=15;YAHOO.widget.DataSource.prototype.queryMatchContains=false;YAHOO.widget.DataSource.prototype.queryMatchSubset=false;YAHOO.widget.DataSource.prototype.queryMatchCase=false;YAHOO.widget.DataSource.prototype.toString=function(){return"DataSource "+this._sName;};YAHOO.widget.DataSource.prototype.getResults=function(oCallbackFn,sQuery,oParent){var aResults=this._doQueryCache(oCallbackFn,sQuery,oParent);if(aResults.length===0){this.queryEvent.fire(this,oParent,sQuery);this.doQuery(oCallbackFn,sQuery,oParent);}};YAHOO.widget.DataSource.prototype.doQuery=function(oCallbackFn,sQuery,oParent){};YAHOO.widget.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[];}
+if(this._aCacheHelper){this._aCacheHelper=[];}
+this.cacheFlushEvent.fire(this);};YAHOO.widget.DataSource.prototype.queryEvent=null;YAHOO.widget.DataSource.prototype.cacheQueryEvent=null;YAHOO.widget.DataSource.prototype.getResultsEvent=null;YAHOO.widget.DataSource.prototype.getCachedResultsEvent=null;YAHOO.widget.DataSource.prototype.dataErrorEvent=null;YAHOO.widget.DataSource.prototype.cacheFlushEvent=null;YAHOO.widget.DataSource._nIndex=0;YAHOO.widget.DataSource.prototype._sName=null;YAHOO.widget.DataSource.prototype._aCache=null;YAHOO.widget.DataSource.prototype._init=function(){var maxCacheEntries=this.maxCacheEntries;if(!YAHOO.lang.isNumber(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}
+if(maxCacheEntries>0&&!this._aCache){this._aCache=[];}
+this._sName="instance"+YAHOO.widget.DataSource._nIndex;YAHOO.widget.DataSource._nIndex++;this.queryEvent=new YAHOO.util.CustomEvent("query",this);this.cacheQueryEvent=new YAHOO.util.CustomEvent("cacheQuery",this);this.getResultsEvent=new YAHOO.util.CustomEvent("getResults",this);this.getCachedResultsEvent=new YAHOO.util.CustomEvent("getCachedResults",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.cacheFlushEvent=new YAHOO.util.CustomEvent("cacheFlush",this);};YAHOO.widget.DataSource.prototype._addCacheElem=function(oResult){var aCache=this._aCache;if(!aCache||!oResult||!oResult.query||!oResult.results){return;}
+if(aCache.length>=this.maxCacheEntries){aCache.shift();}
+aCache.push(oResult);};YAHOO.widget.DataSource.prototype._doQueryCache=function(oCallbackFn,sQuery,oParent){var aResults=[];var bMatchFound=false;var aCache=this._aCache;var nCacheLength=(aCache)?aCache.length:0;var bMatchContains=this.queryMatchContains;if((this.maxCacheEntries>0)&&aCache&&(nCacheLength>0)){this.cacheQueryEvent.fire(this,oParent,sQuery);if(!this.queryMatchCase){var sOrigQuery=sQuery;sQuery=sQuery.toLowerCase();}
+for(var i=nCacheLength-1;i>=0;i--){var resultObj=aCache[i];var aAllResultItems=resultObj.results;var matchKey=(!this.queryMatchCase)?encodeURIComponent(resultObj.query).toLowerCase():encodeURIComponent(resultObj.query);if(matchKey==sQuery){bMatchFound=true;aResults=aAllResultItems;if(i!=nCacheLength-1){aCache.splice(i,1);this._addCacheElem(resultObj);}
+break;}
+else if(this.queryMatchSubset){for(var j=sQuery.length-1;j>=0;j--){var subQuery=sQuery.substr(0,j);if(matchKey==subQuery){bMatchFound=true;for(var k=aAllResultItems.length-1;k>=0;k--){var aRecord=aAllResultItems[k];var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aRecord[0]).indexOf(sQuery):encodeURIComponent(aRecord[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aRecord);}}
+resultObj={};resultObj.query=sQuery;resultObj.results=aResults;this._addCacheElem(resultObj);break;}}
+if(bMatchFound){break;}}}
+if(bMatchFound){this.getCachedResultsEvent.fire(this,oParent,sOrigQuery,aResults);oCallbackFn(sOrigQuery,aResults,oParent);}}
+return aResults;};YAHOO.widget.DS_XHR=function(sScriptURI,aSchema,oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
+if(!YAHOO.lang.isArray(aSchema)||!YAHOO.lang.isString(sScriptURI)){return;}
+this.schema=aSchema;this.scriptURI=sScriptURI;this._init();};YAHOO.widget.DS_XHR.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_XHR.TYPE_JSON=0;YAHOO.widget.DS_XHR.TYPE_XML=1;YAHOO.widget.DS_XHR.TYPE_FLAT=2;YAHOO.widget.DS_XHR.ERROR_DATAXHR="XHR response failed";YAHOO.widget.DS_XHR.prototype.connMgr=YAHOO.util.Connect;YAHOO.widget.DS_XHR.prototype.connTimeout=0;YAHOO.widget.DS_XHR.prototype.scriptURI=null;YAHOO.widget.DS_XHR.prototype.scriptQueryParam="query";YAHOO.widget.DS_XHR.prototype.scriptQueryAppend="";YAHOO.widget.DS_XHR.prototype.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;YAHOO.widget.DS_XHR.prototype.responseStripAfter="\n<!-";YAHOO.widget.DS_XHR.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var isXML=(this.responseType==YAHOO.widget.DS_XHR.TYPE_XML);var sUri=this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;if(this.scriptQueryAppend.length>0){sUri+="&"+this.scriptQueryAppend;}
+var oResponse=null;var oSelf=this;var responseSuccess=function(oResp){if(!oSelf._oConn||(oResp.tId!=oSelf._oConn.tId)){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
+for(var foo in oResp){}
+if(!isXML){oResp=oResp.responseText;}
+else{oResp=oResp.responseXML;}
+if(oResp===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
+var aResults=oSelf.parseResponse(sQuery,oResp,oParent);var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATAPARSE);aResults=[];}
+else{oSelf.getResultsEvent.fire(oSelf,oParent,sQuery,aResults);oSelf._addCacheElem(resultObj);}
+oCallbackFn(sQuery,aResults,oParent);};var responseFailure=function(oResp){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DS_XHR.ERROR_DATAXHR);return;};var oCallback={success:responseSuccess,failure:responseFailure};if(YAHOO.lang.isNumber(this.connTimeout)&&(this.connTimeout>0)){oCallback.timeout=this.connTimeout;}
+if(this._oConn){this.connMgr.abort(this._oConn);}
+oSelf._oConn=this.connMgr.asyncRequest("GET",sUri,oCallback,null);};YAHOO.widget.DS_XHR.prototype.parseResponse=function(sQuery,oResponse,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var nEnd=((this.responseStripAfter!=="")&&(oResponse.indexOf))?oResponse.indexOf(this.responseStripAfter):-1;if(nEnd!=-1){oResponse=oResponse.substring(0,nEnd);}
+switch(this.responseType){case YAHOO.widget.DS_XHR.TYPE_JSON:var jsonList,jsonObjParsed;var isNotMac=(navigator.userAgent.toLowerCase().indexOf('khtml')==-1);if(oResponse.parseJSON&&isNotMac){jsonObjParsed=oResponse.parseJSON();if(!jsonObjParsed){bError=true;}
+else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}
+catch(e){bError=true;break;}}}
+else if(window.JSON&&isNotMac){jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}
+else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}
+catch(e){bError=true;break;}}}
+else{try{while(oResponse.substring(0,1)==" "){oResponse=oResponse.substring(1,oResponse.length);}
+if(oResponse.indexOf("{")<0){bError=true;break;}
+if(oResponse.indexOf("{}")===0){break;}
+var jsonObjRaw=eval("("+oResponse+")");if(!jsonObjRaw){bError=true;break;}
+jsonList=eval("(jsonObjRaw."+aSchema[0]+")");}
+catch(e){bError=true;break;}}
+if(!jsonList){bError=true;break;}
+if(!YAHOO.lang.isArray(jsonList)){jsonList=[jsonList];}
+for(var i=jsonList.length-1;i>=0;i--){var aResultItem=[];var jsonResult=jsonList[i];for(var j=aSchema.length-1;j>=1;j--){var dataFieldValue=jsonResult[aSchema[j]];if(!dataFieldValue){dataFieldValue="";}
+aResultItem.unshift(dataFieldValue);}
+if(aResultItem.length==1){aResultItem.push(jsonResult);}
+aResults.unshift(aResultItem);}
+break;case YAHOO.widget.DS_XHR.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}
+for(var k=xmlList.length-1;k>=0;k--){var result=xmlList.item(k);var aFieldSet=[];for(var m=aSchema.length-1;m>=1;m--){var sValue=null;var xmlAttr=result.attributes.getNamedItem(aSchema[m]);if(xmlAttr){sValue=xmlAttr.value;}
+else{var xmlNode=result.getElementsByTagName(aSchema[m]);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){sValue=xmlNode.item(0).firstChild.nodeValue;}
+else{sValue="";}}
+aFieldSet.unshift(sValue);}
+aResults.unshift(aFieldSet);}
+break;case YAHOO.widget.DS_XHR.TYPE_FLAT:if(oResponse.length>0){var newLength=oResponse.length-aSchema[0].length;if(oResponse.substr(newLength)==aSchema[0]){oResponse=oResponse.substr(0,newLength);}
+var aRecords=oResponse.split(aSchema[0]);for(var n=aRecords.length-1;n>=0;n--){aResults[n]=aRecords[n].split(aSchema[1]);}}
+break;default:break;}
+sQuery=null;oResponse=null;oParent=null;if(bError){return null;}
+else{return aResults;}};YAHOO.widget.DS_XHR.prototype._oConn=null;YAHOO.widget.DS_JSFunction=function(oFunction,oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
+if(!YAHOO.lang.isFunction(oFunction)){return;}
+else{this.dataFunction=oFunction;this._init();}};YAHOO.widget.DS_JSFunction.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSFunction.prototype.dataFunction=null;YAHOO.widget.DS_JSFunction.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var oFunction=this.dataFunction;var aResults=[];aResults=oFunction(sQuery);if(aResults===null){this.dataErrorEvent.fire(this,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
+var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;this._addCacheElem(resultObj);this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);return;};YAHOO.widget.DS_JSArray=function(aData,oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
+if(!YAHOO.lang.isArray(aData)){return;}
+else{this.data=aData;this._init();}};YAHOO.widget.DS_JSArray.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSArray.prototype.data=null;YAHOO.widget.DS_JSArray.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var i;var aData=this.data;var aResults=[];var bMatchFound=false;var bMatchContains=this.queryMatchContains;if(sQuery){if(!this.queryMatchCase){sQuery=sQuery.toLowerCase();}
+for(i=aData.length-1;i>=0;i--){var aDataset=[];if(YAHOO.lang.isString(aData[i])){aDataset[0]=aData[i];}
+else if(YAHOO.lang.isArray(aData[i])){aDataset=aData[i];}
+if(YAHOO.lang.isString(aDataset[0])){var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aDataset[0]).indexOf(sQuery):encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aDataset);}}}}
+else{for(i=aData.length-1;i>=0;i--){if(YAHOO.lang.isString(aData[i])){aResults.unshift([aData[i]]);}
+else if(YAHOO.lang.isArray(aData[i])){aResults.unshift(aData[i]);}}}
+this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);};YAHOO.register("autocomplete",YAHOO.widget.AutoComplete,{version:"2.3.0",build:"442"});
\ No newline at end of file
index a39a98780b18e0ad3f7296cfb472d86fcb9b2a8c..72a6772b599b9f52c483b181a7cc70d40f919b97 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
- /**\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 || (this._nKeyCode == 8)) {\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
- * The DataSource classes manages sending a request and returning response from a live\r
- * database. Supported data include local JavaScript arrays and objects and databases\r
- * accessible via XHR connections. Supported response formats include JavaScript arrays,\r
- * JSON, XML, and flat-file textual data.\r
- *  \r
- * @class DataSource\r
- * @constructor\r
- */\r
-YAHOO.widget.DataSource = function() { \r
-    /* abstract class */\r
-};\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public constants\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Error message for null data responses.\r
- *\r
- * @property ERROR_DATANULL\r
- * @type String\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DataSource.ERROR_DATANULL = "Response data was null";\r
-\r
-/**\r
- * Error message for data responses with parsing errors.\r
- *\r
- * @property ERROR_DATAPARSE\r
- * @type String\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DataSource.ERROR_DATAPARSE = "Response data could not be parsed";\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Max size of the local cache.  Set to 0 to turn off caching.  Caching is\r
- * useful to reduce the number of server connections.  Recommended only for data\r
- * sources that return comprehensive results for queries or when stale data is\r
- * not an issue.\r
- *\r
- * @property maxCacheEntries\r
- * @type Number\r
- * @default 15\r
- */\r
-YAHOO.widget.DataSource.prototype.maxCacheEntries = 15;\r
-\r
-/**\r
- * Use this to equate cache matching with the type of matching done by your live\r
- * data source. If caching is on and queryMatchContains is true, the cache\r
- * returns results that "contain" the query string. By default,\r
- * queryMatchContains is set to false, meaning the cache only returns results\r
- * that "start with" the query string.\r
- *\r
- * @property queryMatchContains\r
- * @type Boolean\r
- * @default false\r
- */\r
-YAHOO.widget.DataSource.prototype.queryMatchContains = false;\r
-\r
-/**\r
- * Enables query subset matching. If caching is on and queryMatchSubset is\r
- * true, substrings of queries will return matching cached results. For\r
- * instance, if the first query is for "abc" susequent queries that start with\r
- * "abc", like "abcd", will be queried against the cache, and not the live data\r
- * source. Recommended only for DataSources that return comprehensive results\r
- * for queries with very few characters.\r
- *\r
- * @property queryMatchSubset\r
- * @type Boolean\r
- * @default false\r
- *\r
- */\r
-YAHOO.widget.DataSource.prototype.queryMatchSubset = false;\r
-\r
-/**\r
- * Enables query case-sensitivity matching. If caching is on and\r
- * queryMatchCase is true, queries will only return results for case-sensitive\r
- * matches.\r
- *\r
- * @property queryMatchCase\r
- * @type Boolean\r
- * @default false\r
- */\r
-YAHOO.widget.DataSource.prototype.queryMatchCase = false;\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
- /**\r
- * Public accessor to the unique name of the DataSource instance.\r
- *\r
- * @method toString\r
- * @return {String} Unique name of the DataSource instance\r
- */\r
-YAHOO.widget.DataSource.prototype.toString = function() {\r
-    return "DataSource " + this._sName;\r
-};\r
-\r
-/**\r
- * Retrieves query results, first checking the local cache, then making the\r
- * query request to the live data source as defined by the function doQuery.\r
- *\r
- * @method getResults\r
- * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- */\r
-YAHOO.widget.DataSource.prototype.getResults = function(oCallbackFn, sQuery, oParent) {\r
-    \r
-    // First look in cache\r
-    var aResults = this._doQueryCache(oCallbackFn,sQuery,oParent);\r
-    \r
-    // Not in cache, so get results from server\r
-    if(aResults.length === 0) {\r
-        this.queryEvent.fire(this, oParent, sQuery);\r
-        this.doQuery(oCallbackFn, sQuery, oParent);\r
-    }\r
-};\r
-\r
-/**\r
- * Abstract method implemented by subclasses to make a query to the live data\r
- * source. Must call the callback function with the response returned from the\r
- * query. Populates cache (if enabled).\r
- *\r
- * @method doQuery\r
- * @param oCallbackFn {HTMLFunction} Callback function implemented by oParent to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- */\r
-YAHOO.widget.DataSource.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r
-    /* override this */ \r
-};\r
-\r
-/**\r
- * Flushes cache.\r
- *\r
- * @method flushCache\r
- */\r
-YAHOO.widget.DataSource.prototype.flushCache = function() {\r
-    if(this._aCache) {\r
-        this._aCache = [];\r
-    }\r
-    if(this._aCacheHelper) {\r
-        this._aCacheHelper = [];\r
-    }\r
-    this.cacheFlushEvent.fire(this);\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public events\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Fired when a query is made to the live data source.\r
- *\r
- * @event queryEvent\r
- * @param oSelf {Object} The DataSource instance.\r
- * @param oParent {Object} The requesting object.\r
- * @param sQuery {String} The query string.\r
- */\r
-YAHOO.widget.DataSource.prototype.queryEvent = null;\r
-\r
-/**\r
- * Fired when a query is made to the local cache.\r
- *\r
- * @event cacheQueryEvent\r
- * @param oSelf {Object} The DataSource instance.\r
- * @param oParent {Object} The requesting object.\r
- * @param sQuery {String} The query string.\r
- */\r
-YAHOO.widget.DataSource.prototype.cacheQueryEvent = null;\r
-\r
-/**\r
- * Fired when data is retrieved from the live data source.\r
- *\r
- * @event getResultsEvent\r
- * @param oSelf {Object} The DataSource instance.\r
- * @param oParent {Object} The requesting object.\r
- * @param sQuery {String} The query string.\r
- * @param aResults {Object[]} Array of result objects.\r
- */\r
-YAHOO.widget.DataSource.prototype.getResultsEvent = null;\r
-    \r
-/**\r
- * Fired when data is retrieved from the local cache.\r
- *\r
- * @event getCachedResultsEvent\r
- * @param oSelf {Object} The DataSource instance.\r
- * @param oParent {Object} The requesting object.\r
- * @param sQuery {String} The query string.\r
- * @param aResults {Object[]} Array of result objects.\r
- */\r
-YAHOO.widget.DataSource.prototype.getCachedResultsEvent = null;\r
-\r
-/**\r
- * Fired when an error is encountered with the live data source.\r
- *\r
- * @event dataErrorEvent\r
- * @param oSelf {Object} The DataSource instance.\r
- * @param oParent {Object} The requesting object.\r
- * @param sQuery {String} The query string.\r
- * @param sMsg {String} Error message string\r
- */\r
-YAHOO.widget.DataSource.prototype.dataErrorEvent = null;\r
-\r
-/**\r
- * Fired when the local cache is flushed.\r
- *\r
- * @event cacheFlushEvent\r
- * @param oSelf {Object} The DataSource instance\r
- */\r
-YAHOO.widget.DataSource.prototype.cacheFlushEvent = null;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Internal class variable to index multiple DataSource instances.\r
- *\r
- * @property _nIndex\r
- * @type Number\r
- * @private\r
- * @static\r
- */\r
-YAHOO.widget.DataSource._nIndex = 0;\r
-\r
-/**\r
- * Name of DataSource instance.\r
- *\r
- * @property _sName\r
- * @type String\r
- * @private\r
- */\r
-YAHOO.widget.DataSource.prototype._sName = null;\r
-\r
-/**\r
- * Local cache of data result objects indexed chronologically.\r
- *\r
- * @property _aCache\r
- * @type Object[]\r
- * @private\r
- */\r
-YAHOO.widget.DataSource.prototype._aCache = null;\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Initializes DataSource instance.\r
- *  \r
- * @method _init\r
- * @private\r
- */\r
-YAHOO.widget.DataSource.prototype._init = function() {\r
-    // Validate and initialize public configs\r
-    var maxCacheEntries = this.maxCacheEntries;\r
-    if(isNaN(maxCacheEntries) || (maxCacheEntries < 0)) {\r
-        maxCacheEntries = 0;\r
-    }\r
-    // Initialize local cache\r
-    if(maxCacheEntries > 0 && !this._aCache) {\r
-        this._aCache = [];\r
-    }\r
-    \r
-    this._sName = "instance" + YAHOO.widget.DataSource._nIndex;\r
-    YAHOO.widget.DataSource._nIndex++;\r
-    \r
-    this.queryEvent = new YAHOO.util.CustomEvent("query", this);\r
-    this.cacheQueryEvent = new YAHOO.util.CustomEvent("cacheQuery", this);\r
-    this.getResultsEvent = new YAHOO.util.CustomEvent("getResults", this);\r
-    this.getCachedResultsEvent = new YAHOO.util.CustomEvent("getCachedResults", this);\r
-    this.dataErrorEvent = new YAHOO.util.CustomEvent("dataError", this);\r
-    this.cacheFlushEvent = new YAHOO.util.CustomEvent("cacheFlush", this);\r
-};\r
-\r
-/**\r
- * Adds a result object to the local cache, evicting the oldest element if the \r
- * cache is full. Newer items will have higher indexes, the oldest item will have\r
- * index of 0. \r
- *\r
- * @method _addCacheElem\r
- * @param oResult {Object} Data result object, including array of results.\r
- * @private\r
- */\r
-YAHOO.widget.DataSource.prototype._addCacheElem = function(oResult) {\r
-    var aCache = this._aCache;\r
-    // Don't add if anything important is missing.\r
-    if(!aCache || !oResult || !oResult.query || !oResult.results) {\r
-        return;\r
-    }\r
-    \r
-    // If the cache is full, make room by removing from index=0\r
-    if(aCache.length >= this.maxCacheEntries) {\r
-        aCache.shift();\r
-    }\r
-        \r
-    // Add to cache, at the end of the array\r
-    aCache.push(oResult);\r
-};\r
-\r
-/**\r
- * Queries the local cache for results. If query has been cached, the callback\r
- * function is called with the results, and the cached is refreshed so that it\r
- * is now the newest element.  \r
- *\r
- * @method _doQueryCache\r
- * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- * @return aResults {Object[]} Array of results from local cache if found, otherwise null.\r
- * @private \r
- */\r
-YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery, oParent) {\r
-    var aResults = [];\r
-    var bMatchFound = false;\r
-    var aCache = this._aCache;\r
-    var nCacheLength = (aCache) ? aCache.length : 0;\r
-    var bMatchContains = this.queryMatchContains;\r
-    \r
-    // If cache is enabled...\r
-    if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {\r
-        this.cacheQueryEvent.fire(this, oParent, sQuery);\r
-        // If case is unimportant, normalize query now instead of in loops\r
-        if(!this.queryMatchCase) {\r
-            var sOrigQuery = sQuery;\r
-            sQuery = sQuery.toLowerCase();\r
-        }\r
-\r
-        // Loop through each cached element's query property...\r
-        for(var i = nCacheLength-1; i >= 0; i--) {\r
-            var resultObj = aCache[i];\r
-            var aAllResultItems = resultObj.results;\r
-            // If case is unimportant, normalize match key for comparison\r
-            var matchKey = (!this.queryMatchCase) ?\r
-                encodeURIComponent(resultObj.query).toLowerCase():\r
-                encodeURIComponent(resultObj.query);\r
-            \r
-            // If a cached match key exactly matches the query...\r
-            if(matchKey == sQuery) {\r
-                    // Stash all result objects into aResult[] and stop looping through the cache.\r
-                    bMatchFound = true;\r
-                    aResults = aAllResultItems;\r
-                    \r
-                    // The matching cache element was not the most recent,\r
-                    // so now we need to refresh the cache.\r
-                    if(i != nCacheLength-1) {                        \r
-                        // Remove element from its original location\r
-                        aCache.splice(i,1);\r
-                        // Add element as newest\r
-                        this._addCacheElem(resultObj);\r
-                    }\r
-                    break;\r
-            }\r
-            // Else if this query is not an exact match and subset matching is enabled...\r
-            else if(this.queryMatchSubset) {\r
-                // Loop through substrings of each cached element's query property...\r
-                for(var j = sQuery.length-1; j >= 0 ; j--) {\r
-                    var subQuery = sQuery.substr(0,j);\r
-                    \r
-                    // If a substring of a cached sQuery exactly matches the query...\r
-                    if(matchKey == subQuery) {                    \r
-                        bMatchFound = true;\r
-                        \r
-                        // Go through each cached result object to match against the query...\r
-                        for(var k = aAllResultItems.length-1; k >= 0; k--) {\r
-                            var aRecord = aAllResultItems[k];\r
-                            var sKeyIndex = (this.queryMatchCase) ?\r
-                                encodeURIComponent(aRecord[0]).indexOf(sQuery):\r
-                                encodeURIComponent(aRecord[0]).toLowerCase().indexOf(sQuery);\r
-                            \r
-                            // A STARTSWITH match is when the query is found at the beginning of the key string...\r
-                            if((!bMatchContains && (sKeyIndex === 0)) ||\r
-                            // A CONTAINS match is when the query is found anywhere within the key string...\r
-                            (bMatchContains && (sKeyIndex > -1))) {\r
-                                // Stash a match into aResults[].\r
-                                aResults.unshift(aRecord);\r
-                            }\r
-                        }\r
-                        \r
-                        // Add the subset match result set object as the newest element to cache,\r
-                        // and stop looping through the cache.\r
-                        resultObj = {};\r
-                        resultObj.query = sQuery;\r
-                        resultObj.results = aResults;\r
-                        this._addCacheElem(resultObj);\r
-                        break;\r
-                    }\r
-                }\r
-                if(bMatchFound) {\r
-                    break;\r
-                }\r
-            }\r
-        }\r
-        \r
-        // If there was a match, send along the results.\r
-        if(bMatchFound) {\r
-            this.getCachedResultsEvent.fire(this, oParent, sOrigQuery, aResults);\r
-            oCallbackFn(sOrigQuery, aResults, oParent);\r
-        }\r
-    }\r
-    return aResults;\r
-};\r
-\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * Implementation of YAHOO.widget.DataSource using XML HTTP requests that return\r
- * query results.\r
- *  \r
- * @class DS_XHR\r
- * @extends YAHOO.widget.DataSource\r
- * @requires connection\r
- * @constructor\r
- * @param sScriptURI {String} Absolute or relative URI to script that returns query\r
- * results as JSON, XML, or delimited flat-file data.\r
- * @param aSchema {String[]} Data schema definition of results.\r
- * @param oConfigs {Object} (optional) Object literal of config params.\r
- */\r
-YAHOO.widget.DS_XHR = function(sScriptURI, aSchema, oConfigs) {\r
-    // Set any config params passed in to override defaults\r
-    if(typeof oConfigs == "object") {\r
-        for(var sConfig in oConfigs) {\r
-            this[sConfig] = oConfigs[sConfig];\r
-        }\r
-    }\r
-    \r
-    // Initialization sequence\r
-    if(!aSchema || (aSchema.constructor != Array)) {\r
-        return;\r
-    }\r
-    else {\r
-        this.schema = aSchema;\r
-    }\r
-    this.scriptURI = sScriptURI;\r
-    this._init();\r
-};\r
-\r
-YAHOO.widget.DS_XHR.prototype = new YAHOO.widget.DataSource();\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public constants\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * JSON data type.\r
- *\r
- * @property TYPE_JSON\r
- * @type Number\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DS_XHR.TYPE_JSON = 0;\r
-\r
-/**\r
- * XML data type.\r
- *\r
- * @property TYPE_XML\r
- * @type Number\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DS_XHR.TYPE_XML = 1;\r
-\r
-/**\r
- * Flat-file data type.\r
- *\r
- * @property TYPE_FLAT\r
- * @type Number\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DS_XHR.TYPE_FLAT = 2;\r
-\r
-/**\r
- * Error message for XHR failure.\r
- *\r
- * @property ERROR_DATAXHR\r
- * @type String\r
- * @static\r
- * @final\r
- */\r
-YAHOO.widget.DS_XHR.ERROR_DATAXHR = "XHR response failed";\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Alias to YUI Connection Manager. Allows implementers to specify their own\r
- * subclasses of the YUI Connection Manager utility.\r
- *\r
- * @property connMgr\r
- * @type Object\r
- * @default YAHOO.util.Connect\r
- */\r
-YAHOO.widget.DS_XHR.prototype.connMgr = YAHOO.util.Connect;\r
-\r
-/**\r
- * Number of milliseconds the XHR connection will wait for a server response. A\r
- * a value of zero indicates the XHR connection will wait forever. Any value\r
- * greater than zero will use the Connection utility's Auto-Abort feature.\r
- *\r
- * @property connTimeout\r
- * @type Number\r
- * @default 0\r
- */\r
-YAHOO.widget.DS_XHR.prototype.connTimeout = 0;\r
-\r
-/**\r
- * Absolute or relative URI to script that returns query results. For instance,\r
- * queries will be sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput\r
- *\r
- * @property scriptURI\r
- * @type String\r
- */\r
-YAHOO.widget.DS_XHR.prototype.scriptURI = null;\r
-\r
-/**\r
- * Query string parameter name sent to scriptURI. For instance, queries will be\r
- * sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput\r
- *\r
- * @property scriptQueryParam\r
- * @type String\r
- * @default "query"\r
- */\r
-YAHOO.widget.DS_XHR.prototype.scriptQueryParam = "query";\r
-\r
-/**\r
- * String of key/value pairs to append to requests made to scriptURI. Define\r
- * this string when you want to send additional query parameters to your script.\r
- * When defined, queries will be sent to\r
- * &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput&#38;&#60;scriptQueryAppend&#62;\r
- *\r
- * @property scriptQueryAppend\r
- * @type String\r
- * @default ""\r
- */\r
-YAHOO.widget.DS_XHR.prototype.scriptQueryAppend = "";\r
-\r
-/**\r
- * XHR response data type. Other types that may be defined are YAHOO.widget.DS_XHR.TYPE_XML\r
- * and YAHOO.widget.DS_XHR.TYPE_FLAT.\r
- *\r
- * @property responseType\r
- * @type String\r
- * @default YAHOO.widget.DS_XHR.TYPE_JSON\r
- */\r
-YAHOO.widget.DS_XHR.prototype.responseType = YAHOO.widget.DS_XHR.TYPE_JSON;\r
-\r
-/**\r
- * String after which to strip results. If the results from the XHR are sent\r
- * back as HTML, the gzip HTML comment appears at the end of the data and should\r
- * be ignored.\r
- *\r
- * @property responseStripAfter\r
- * @type String\r
- * @default "\n&#60;!-"\r
- */\r
-YAHOO.widget.DS_XHR.prototype.responseStripAfter = "\n<!-";\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Queries the live data source defined by scriptURI for results. Results are\r
- * passed back to a callback function.\r
- *  \r
- * @method doQuery\r
- * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- */\r
-YAHOO.widget.DS_XHR.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r
-    var isXML = (this.responseType == YAHOO.widget.DS_XHR.TYPE_XML);\r
-    var sUri = this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;\r
-    if(this.scriptQueryAppend.length > 0) {\r
-        sUri += "&" + this.scriptQueryAppend;\r
-    }\r
-    var oResponse = null;\r
-    \r
-    var oSelf = this;\r
-    /*\r
-     * Sets up ajax request callback\r
-     *\r
-     * @param {object} oReq          HTTPXMLRequest object\r
-     * @private\r
-     */\r
-    var responseSuccess = function(oResp) {\r
-        // Response ID does not match last made request ID.\r
-        if(!oSelf._oConn || (oResp.tId != oSelf._oConn.tId)) {\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r
-            return;\r
-        }\r
-//DEBUG\r
-for(var foo in oResp) {\r
-}\r
-        if(!isXML) {\r
-            oResp = oResp.responseText;\r
-        }\r
-        else { \r
-            oResp = oResp.responseXML;\r
-        }\r
-        if(oResp === null) {\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r
-            return;\r
-        }\r
-\r
-        var aResults = oSelf.parseResponse(sQuery, oResp, oParent);\r
-        var resultObj = {};\r
-        resultObj.query = decodeURIComponent(sQuery);\r
-        resultObj.results = aResults;\r
-        if(aResults === null) {\r
-            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATAPARSE);\r
-            aResults = [];\r
-        }\r
-        else {\r
-            oSelf.getResultsEvent.fire(oSelf, oParent, sQuery, aResults);\r
-            oSelf._addCacheElem(resultObj);\r
-        }\r
-        oCallbackFn(sQuery, aResults, oParent);\r
-    };\r
-\r
-    var responseFailure = function(oResp) {\r
-        oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DS_XHR.ERROR_DATAXHR);\r
-        return;\r
-    };\r
-    \r
-    var oCallback = {\r
-        success:responseSuccess,\r
-        failure:responseFailure\r
-    };\r
-    \r
-    if(!isNaN(this.connTimeout) && this.connTimeout > 0) {\r
-        oCallback.timeout = this.connTimeout;\r
-    }\r
-    \r
-    if(this._oConn) {\r
-        this.connMgr.abort(this._oConn);\r
-    }\r
-    \r
-    oSelf._oConn = this.connMgr.asyncRequest("GET", sUri, oCallback, null);\r
-};\r
-\r
-/**\r
- * Parses raw response data into an array of result objects. The result data key\r
- * is always stashed in the [0] element of each result object. \r
- *\r
- * @method parseResponse\r
- * @param sQuery {String} Query string.\r
- * @param oResponse {Object} The raw response data to parse.\r
- * @param oParent {Object} The object instance that has requested data.\r
- * @returns {Object[]} Array of result objects.\r
- */\r
-YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParent) {\r
-    var aSchema = this.schema;\r
-    var aResults = [];\r
-    var bError = false;\r
-\r
-    // Strip out comment at the end of results\r
-    var nEnd = ((this.responseStripAfter !== "") && (oResponse.indexOf)) ?\r
-        oResponse.indexOf(this.responseStripAfter) : -1;\r
-    if(nEnd != -1) {\r
-        oResponse = oResponse.substring(0,nEnd);\r
-    }\r
-\r
-    switch (this.responseType) {\r
-        case YAHOO.widget.DS_XHR.TYPE_JSON:\r
-            var jsonList;\r
-            // Divert KHTML clients from JSON lib\r
-            if(window.JSON && (navigator.userAgent.toLowerCase().indexOf('khtml')== -1)) {\r
-                // Use the JSON utility if available\r
-                var jsonObjParsed = JSON.parse(oResponse);\r
-                if(!jsonObjParsed) {\r
-                    bError = true;\r
-                    break;\r
-                }\r
-                else {\r
-                    try {\r
-                        // eval is necessary here since aSchema[0] is of unknown depth\r
-                        jsonList = eval("jsonObjParsed." + aSchema[0]);\r
-                    }\r
-                    catch(e) {\r
-                        bError = true;\r
-                        break;\r
-                   }\r
-                }\r
-            }\r
-            else {\r
-                // Parse the JSON response as a string\r
-                try {\r
-                    // Trim leading spaces\r
-                    while (oResponse.substring(0,1) == " ") {\r
-                        oResponse = oResponse.substring(1, oResponse.length);\r
-                    }\r
-\r
-                    // Invalid JSON response\r
-                    if(oResponse.indexOf("{") < 0) {\r
-                        bError = true;\r
-                        break;\r
-                    }\r
-\r
-                    // Empty (but not invalid) JSON response\r
-                    if(oResponse.indexOf("{}") === 0) {\r
-                        break;\r
-                    }\r
-\r
-                    // Turn the string into an object literal...\r
-                    // ...eval is necessary here\r
-                    var jsonObjRaw = eval("(" + oResponse + ")");\r
-                    if(!jsonObjRaw) {\r
-                        bError = true;\r
-                        break;\r
-                    }\r
-\r
-                    // Grab the object member that contains an array of all reponses...\r
-                    // ...eval is necessary here since aSchema[0] is of unknown depth\r
-                    jsonList = eval("(jsonObjRaw." + aSchema[0]+")");\r
-                }\r
-                catch(e) {\r
-                    bError = true;\r
-                    break;\r
-               }\r
-            }\r
-\r
-            if(!jsonList) {\r
-                bError = true;\r
-                break;\r
-            }\r
-\r
-            if(jsonList.constructor != Array) {\r
-                jsonList = [jsonList];\r
-            }\r
-            \r
-            // Loop through the array of all responses...\r
-            for(var i = jsonList.length-1; i >= 0 ; i--) {\r
-                var aResultItem = [];\r
-                var jsonResult = jsonList[i];\r
-                // ...and loop through each data field value of each response\r
-                for(var j = aSchema.length-1; j >= 1 ; j--) {\r
-                    // ...and capture data into an array mapped according to the schema...\r
-                    var dataFieldValue = jsonResult[aSchema[j]];\r
-                    if(!dataFieldValue) {\r
-                        dataFieldValue = "";\r
-                    }\r
-                    aResultItem.unshift(dataFieldValue);\r
-                }\r
-                // If schema isn't well defined, pass along the entire result object\r
-                if(aResultItem.length == 1) {\r
-                    aResultItem.push(jsonResult);\r
-                }\r
-                // Capture the array of data field values in an array of results\r
-                aResults.unshift(aResultItem);\r
-            }\r
-            break;\r
-        case YAHOO.widget.DS_XHR.TYPE_XML:\r
-            // Get the collection of results\r
-            var xmlList = oResponse.getElementsByTagName(aSchema[0]);\r
-            if(!xmlList) {\r
-                bError = true;\r
-                break;\r
-            }\r
-            // Loop through each result\r
-            for(var k = xmlList.length-1; k >= 0 ; k--) {\r
-                var result = xmlList.item(k);\r
-                var aFieldSet = [];\r
-                // Loop through each data field in each result using the schema\r
-                for(var m = aSchema.length-1; m >= 1 ; m--) {\r
-                    var sValue = null;\r
-                    // Values may be held in an attribute...\r
-                    var xmlAttr = result.attributes.getNamedItem(aSchema[m]);\r
-                    if(xmlAttr) {\r
-                        sValue = xmlAttr.value;\r
-                    }\r
-                    // ...or in a node\r
-                    else{\r
-                        var xmlNode = result.getElementsByTagName(aSchema[m]);\r
-                        if(xmlNode && xmlNode.item(0) && xmlNode.item(0).firstChild) {\r
-                            sValue = xmlNode.item(0).firstChild.nodeValue;\r
-                        }\r
-                        else {\r
-                            sValue = "";\r
-                        }\r
-                    }\r
-                    // Capture the schema-mapped data field values into an array\r
-                    aFieldSet.unshift(sValue);\r
-                }\r
-                // Capture each array of values into an array of results\r
-                aResults.unshift(aFieldSet);\r
-            }\r
-            break;\r
-        case YAHOO.widget.DS_XHR.TYPE_FLAT:\r
-            if(oResponse.length > 0) {\r
-                // Delete the last line delimiter at the end of the data if it exists\r
-                var newLength = oResponse.length-aSchema[0].length;\r
-                if(oResponse.substr(newLength) == aSchema[0]) {\r
-                    oResponse = oResponse.substr(0, newLength);\r
-                }\r
-                var aRecords = oResponse.split(aSchema[0]);\r
-                for(var n = aRecords.length-1; n >= 0; n--) {\r
-                    aResults[n] = aRecords[n].split(aSchema[1]);\r
-                }\r
-            }\r
-            break;\r
-        default:\r
-            break;\r
-    }\r
-    sQuery = null;\r
-    oResponse = null;\r
-    oParent = null;\r
-    if(bError) {\r
-        return null;\r
-    }\r
-    else {\r
-        return aResults;\r
-    }\r
-};            \r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * XHR connection object.\r
- *\r
- * @property _oConn\r
- * @type Object\r
- * @private\r
- */\r
-YAHOO.widget.DS_XHR.prototype._oConn = null;\r
-\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * Implementation of YAHOO.widget.DataSource using a native Javascript function as\r
- * its live data source.\r
- *  \r
- * @class DS_JSFunction\r
- * @constructor\r
- * @extends YAHOO.widget.DataSource\r
- * @param oFunction {HTMLFunction} In-memory Javascript function that returns query results as an array of objects.\r
- * @param oConfigs {Object} (optional) Object literal of config params.\r
- */\r
-YAHOO.widget.DS_JSFunction = function(oFunction, oConfigs) {\r
-    // Set any config params passed in to override defaults\r
-    if(typeof oConfigs == "object") {\r
-        for(var sConfig in oConfigs) {\r
-            this[sConfig] = oConfigs[sConfig];\r
-        }\r
-    }\r
-\r
-    // Initialization sequence\r
-    if(!oFunction  || (oFunction.constructor != Function)) {\r
-        return;\r
-    }\r
-    else {\r
-        this.dataFunction = oFunction;\r
-        this._init();\r
-    }\r
-};\r
-\r
-YAHOO.widget.DS_JSFunction.prototype = new YAHOO.widget.DataSource();\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * In-memory Javascript function that returns query results.\r
- *\r
- * @property dataFunction\r
- * @type HTMLFunction\r
- */\r
-YAHOO.widget.DS_JSFunction.prototype.dataFunction = null;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Queries the live data source defined by function for results. Results are\r
- * passed back to a callback function.\r
- *  \r
- * @method doQuery\r
- * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- */\r
-YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r
-    var oFunction = this.dataFunction;\r
-    var aResults = [];\r
-    \r
-    aResults = oFunction(sQuery);\r
-    if(aResults === null) {\r
-        this.dataErrorEvent.fire(this, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r
-        return;\r
-    }\r
-    \r
-    var resultObj = {};\r
-    resultObj.query = decodeURIComponent(sQuery);\r
-    resultObj.results = aResults;\r
-    this._addCacheElem(resultObj);\r
-    \r
-    this.getResultsEvent.fire(this, oParent, sQuery, aResults);\r
-    oCallbackFn(sQuery, aResults, oParent);\r
-    return;\r
-};\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * Implementation of YAHOO.widget.DataSource using a native Javascript array as\r
- * its live data source.\r
- *\r
- * @class DS_JSArray\r
- * @constructor\r
- * @extends YAHOO.widget.DataSource\r
- * @param aData {String[]} In-memory Javascript array of simple string data.\r
- * @param oConfigs {Object} (optional) Object literal of config params.\r
- */\r
-YAHOO.widget.DS_JSArray = function(aData, oConfigs) {\r
-    // Set any config params passed in to override defaults\r
-    if(typeof oConfigs == "object") {\r
-        for(var sConfig in oConfigs) {\r
-            this[sConfig] = oConfigs[sConfig];\r
-        }\r
-    }\r
-\r
-    // Initialization sequence\r
-    if(!aData || (aData.constructor != Array)) {\r
-        return;\r
-    }\r
-    else {\r
-        this.data = aData;\r
-        this._init();\r
-    }\r
-};\r
-\r
-YAHOO.widget.DS_JSArray.prototype = new YAHOO.widget.DataSource();\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * In-memory Javascript array of strings.\r
- *\r
- * @property data\r
- * @type Array\r
- */\r
-YAHOO.widget.DS_JSArray.prototype.data = null;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Queries the live data source defined by data for results. Results are passed\r
- * back to a callback function.\r
- *\r
- * @method doQuery\r
- * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r
- * @param sQuery {String} Query string.\r
- * @param oParent {Object} The object instance that has requested data.\r
- */\r
-YAHOO.widget.DS_JSArray.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r
-    var aData = this.data; // the array\r
-    var aResults = []; // container for results\r
-    var bMatchFound = false;\r
-    var bMatchContains = this.queryMatchContains;\r
-    if(sQuery) {\r
-        if(!this.queryMatchCase) {\r
-            sQuery = sQuery.toLowerCase();\r
-        }\r
-\r
-        // Loop through each element of the array...\r
-        // which can be a string or an array of strings\r
-        for(var i = aData.length-1; i >= 0; i--) {\r
-            var aDataset = [];\r
-\r
-            if(aData[i]) {\r
-                if(aData[i].constructor == String) {\r
-                    aDataset[0] = aData[i];\r
-                }\r
-                else if(aData[i].constructor == Array) {\r
-                    aDataset = aData[i];\r
-                }\r
-            }\r
-\r
-            if(aDataset[0] && (aDataset[0].constructor == String)) {\r
-                var sKeyIndex = (this.queryMatchCase) ?\r
-                encodeURIComponent(aDataset[0]).indexOf(sQuery):\r
-                encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);\r
-\r
-                // A STARTSWITH match is when the query is found at the beginning of the key string...\r
-                if((!bMatchContains && (sKeyIndex === 0)) ||\r
-                // A CONTAINS match is when the query is found anywhere within the key string...\r
-                (bMatchContains && (sKeyIndex > -1))) {\r
-                    // Stash a match into aResults[].\r
-                    aResults.unshift(aDataset);\r
-                }\r
-            }\r
-        }\r
-    }\r
-\r
-    this.getResultsEvent.fire(this, oParent, sQuery, aResults);\r
-    oCallbackFn(sQuery, aResults, oParent);\r
-};\r
+ /**
+ * The AutoComplete control provides the front-end logic for text-entry suggestion and
+ * completion functionality.
+ *
+ * @module autocomplete
+ * @requires yahoo, dom, event, datasource
+ * @optional animation, connection
+ * @namespace YAHOO.widget
+ * @title AutoComplete Widget
+ */
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The AutoComplete class provides the customizable functionality of a plug-and-play DHTML
+ * auto completion widget.  Some key features:
+ * <ul>
+ * <li>Navigate with up/down arrow keys and/or mouse to pick a selection</li>
+ * <li>The drop down container can "roll down" or "fly out" via configurable
+ * animation</li>
+ * <li>UI look-and-feel customizable through CSS, including container
+ * attributes, borders, position, fonts, etc</li>
+ * </ul>
+ *
+ * @class AutoComplete
+ * @constructor
+ * @param elInput {HTMLElement} DOM element reference of an input field.
+ * @param elInput {String} String ID of an input field.
+ * @param elContainer {HTMLElement} DOM element reference of an existing DIV.
+ * @param elContainer {String} String ID of an existing DIV.
+ * @param oDataSource {YAHOO.widget.DataSource} DataSource instance.
+ * @param oConfigs {Object} (optional) Object literal of configuration params.
+ */
+YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {
+    if(elInput && elContainer && oDataSource) {
+        // Validate DataSource
+        if(oDataSource instanceof YAHOO.widget.DataSource) {
+            this.dataSource = oDataSource;
+        }
+        else {
+            return;
+        }
+
+        // Validate input element
+        if(YAHOO.util.Dom.inDocument(elInput)) {
+            if(YAHOO.lang.isString(elInput)) {
+                    this._sName = "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput;
+                    this._oTextbox = document.getElementById(elInput);
+            }
+            else {
+                this._sName = (elInput.id) ?
+                    "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput.id:
+                    "instance" + YAHOO.widget.AutoComplete._nIndex;
+                this._oTextbox = elInput;
+            }
+            YAHOO.util.Dom.addClass(this._oTextbox, "yui-ac-input");
+        }
+        else {
+            return;
+        }
+
+        // Validate container element
+        if(YAHOO.util.Dom.inDocument(elContainer)) {
+            if(YAHOO.lang.isString(elContainer)) {
+                    this._oContainer = document.getElementById(elContainer);
+            }
+            else {
+                this._oContainer = elContainer;
+            }
+            if(this._oContainer.style.display == "none") {
+            }
+            
+            // For skinning
+            var elParent = this._oContainer.parentNode;
+            var elTag = elParent.tagName.toLowerCase();
+            while(elParent && (elParent != "document")) {
+                if(elTag == "div") {
+                    YAHOO.util.Dom.addClass(elParent, "yui-ac");
+                    break;
+                }
+                else {
+                    elParent = elParent.parentNode;
+                    elTag = elParent.tagName.toLowerCase();
+                }
+            }
+            if(elTag != "div") {
+            }
+        }
+        else {
+            return;
+        }
+
+        // Set any config params passed in to override defaults
+        if(oConfigs && (oConfigs.constructor == Object)) {
+            for(var sConfig in oConfigs) {
+                if(sConfig) {
+                    this[sConfig] = oConfigs[sConfig];
+                }
+            }
+        }
+
+        // Initialization sequence
+        this._initContainer();
+        this._initProps();
+        this._initList();
+        this._initContainerHelpers();
+
+        // Set up events
+        var oSelf = this;
+        var oTextbox = this._oTextbox;
+        // Events are actually for the content module within the container
+        var oContent = this._oContainer._oContent;
+
+        // Dom events
+        YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);
+        YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);
+        YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);
+        YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);
+        YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);
+        YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);
+        YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);
+        YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);
+        if(oTextbox.form) {
+            YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);
+        }
+        YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);
+
+        // Custom events
+        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);
+        
+        // Finish up
+        oTextbox.setAttribute("autocomplete","off");
+        YAHOO.widget.AutoComplete._nIndex++;
+    }
+    // Required arguments were not found
+    else {
+    }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * The DataSource object that encapsulates the data used for auto completion.
+ * This object should be an inherited object from YAHOO.widget.DataSource.
+ *
+ * @property dataSource
+ * @type YAHOO.widget.DataSource
+ */
+YAHOO.widget.AutoComplete.prototype.dataSource = null;
+
+/**
+ * Number of characters that must be entered before querying for results. A negative value
+ * effectively turns off the widget. A value of 0 allows queries of null or empty string
+ * values.
+ *
+ * @property minQueryLength
+ * @type Number
+ * @default 1
+ */
+YAHOO.widget.AutoComplete.prototype.minQueryLength = 1;
+
+/**
+ * Maximum number of results to display in results container.
+ *
+ * @property maxResultsDisplayed
+ * @type Number
+ * @default 10
+ */
+YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed = 10;
+
+/**
+ * Number of seconds to delay before submitting a query request.  If a query
+ * request is received before a previous one has completed its delay, the
+ * previous request is cancelled and the new request is set to the delay.
+ * Implementers should take care when setting this value very low (i.e., less
+ * than 0.2) with low latency DataSources and the typeAhead feature enabled, as
+ * fast typers may see unexpected behavior.
+ *
+ * @property queryDelay
+ * @type Number
+ * @default 0.2
+ */
+YAHOO.widget.AutoComplete.prototype.queryDelay = 0.2;
+
+/**
+ * Class name of a highlighted item within results container.
+ *
+ * @property highlightClassName
+ * @type String
+ * @default "yui-ac-highlight"
+ */
+YAHOO.widget.AutoComplete.prototype.highlightClassName = "yui-ac-highlight";
+
+/**
+ * Class name of a pre-highlighted item within results container.
+ *
+ * @property prehighlightClassName
+ * @type String
+ */
+YAHOO.widget.AutoComplete.prototype.prehighlightClassName = null;
+
+/**
+ * Query delimiter. A single character separator for multiple delimited
+ * selections. Multiple delimiter characteres may be defined as an array of
+ * strings. A null value or empty string indicates that query results cannot
+ * be delimited. This feature is not recommended if you need forceSelection to
+ * be true.
+ *
+ * @property delimChar
+ * @type String | String[]
+ */
+YAHOO.widget.AutoComplete.prototype.delimChar = null;
+
+/**
+ * Whether or not the first item in results container should be automatically highlighted
+ * on expand.
+ *
+ * @property autoHighlight
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.AutoComplete.prototype.autoHighlight = true;
+
+/**
+ * Whether or not the input field should be automatically updated
+ * with the first query result as the user types, auto-selecting the substring
+ * that the user has not typed.
+ *
+ * @property typeAhead
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.typeAhead = false;
+
+/**
+ * Whether or not to animate the expansion/collapse of the results container in the
+ * horizontal direction.
+ *
+ * @property animHoriz
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.animHoriz = false;
+
+/**
+ * Whether or not to animate the expansion/collapse of the results container in the
+ * vertical direction.
+ *
+ * @property animVert
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.AutoComplete.prototype.animVert = true;
+
+/**
+ * Speed of container expand/collapse animation, in seconds..
+ *
+ * @property animSpeed
+ * @type Number
+ * @default 0.3
+ */
+YAHOO.widget.AutoComplete.prototype.animSpeed = 0.3;
+
+/**
+ * Whether or not to force the user's selection to match one of the query
+ * results. Enabling this feature essentially transforms the input field into a
+ * &lt;select&gt; field. This feature is not recommended with delimiter character(s)
+ * defined.
+ *
+ * @property forceSelection
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.forceSelection = false;
+
+/**
+ * Whether or not to allow browsers to cache user-typed input in the input
+ * field. Disabling this feature will prevent the widget from setting the
+ * autocomplete="off" on the input field. When autocomplete="off"
+ * and users click the back button after form submission, user-typed input can
+ * be prefilled by the browser from its cache. This caching of user input may
+ * not be desired for sensitive data, such as credit card numbers, in which
+ * case, implementers should consider setting allowBrowserAutocomplete to false.
+ *
+ * @property allowBrowserAutocomplete
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete = true;
+
+/**
+ * Whether or not the results container should always be displayed.
+ * Enabling this feature displays the container when the widget is instantiated
+ * and prevents the toggling of the container to a collapsed state.
+ *
+ * @property alwaysShowContainer
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.alwaysShowContainer = false;
+
+/**
+ * Whether or not to use an iFrame to layer over Windows form elements in
+ * IE. Set to true only when the results container will be on top of a
+ * &lt;select&gt; field in IE and thus exposed to the IE z-index bug (i.e.,
+ * 5.5 < IE < 7).
+ *
+ * @property useIFrame
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.useIFrame = false;
+
+/**
+ * Whether or not the results container should have a shadow.
+ *
+ * @property useShadow
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.AutoComplete.prototype.useShadow = false;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Public accessor to the unique name of the AutoComplete instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.toString = function() {
+    return "AutoComplete " + this._sName;
+};
+
+ /**
+ * Returns true if container is in an expanded state, false otherwise.
+ *
+ * @method isContainerOpen
+ * @return {Boolean} Returns true if container is in an expanded state, false otherwise.
+ */
+YAHOO.widget.AutoComplete.prototype.isContainerOpen = function() {
+    return this._bContainerOpen;
+};
+
+/**
+ * Public accessor to the internal array of DOM &lt;li&gt; elements that
+ * display query results within the results container.
+ *
+ * @method getListItems
+ * @return {HTMLElement[]} Array of &lt;li&gt; elements within the results container.
+ */
+YAHOO.widget.AutoComplete.prototype.getListItems = function() {
+    return this._aListItems;
+};
+
+/**
+ * Public accessor to the data held in an &lt;li&gt; element of the
+ * results container.
+ *
+ * @method getListItemData
+ * @return {Object | Object[]} Object or array of result data or null
+ */
+YAHOO.widget.AutoComplete.prototype.getListItemData = function(oListItem) {
+    if(oListItem._oResultData) {
+        return oListItem._oResultData;
+    }
+    else {
+        return false;
+    }
+};
+
+/**
+ * Sets HTML markup for the results container header. This markup will be
+ * inserted within a &lt;div&gt; tag with a class of "yui-ac-hd".
+ *
+ * @method setHeader
+ * @param sHeader {String} HTML markup for results container header.
+ */
+YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) {
+    if(sHeader) {
+        if(this._oContainer._oContent._oHeader) {
+            this._oContainer._oContent._oHeader.innerHTML = sHeader;
+            this._oContainer._oContent._oHeader.style.display = "block";
+        }
+    }
+    else {
+        this._oContainer._oContent._oHeader.innerHTML = "";
+        this._oContainer._oContent._oHeader.style.display = "none";
+    }
+};
+
+/**
+ * Sets HTML markup for the results container footer. This markup will be
+ * inserted within a &lt;div&gt; tag with a class of "yui-ac-ft".
+ *
+ * @method setFooter
+ * @param sFooter {String} HTML markup for results container footer.
+ */
+YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) {
+    if(sFooter) {
+        if(this._oContainer._oContent._oFooter) {
+            this._oContainer._oContent._oFooter.innerHTML = sFooter;
+            this._oContainer._oContent._oFooter.style.display = "block";
+        }
+    }
+    else {
+        this._oContainer._oContent._oFooter.innerHTML = "";
+        this._oContainer._oContent._oFooter.style.display = "none";
+    }
+};
+
+/**
+ * Sets HTML markup for the results container body. This markup will be
+ * inserted within a &lt;div&gt; tag with a class of "yui-ac-bd".
+ *
+ * @method setBody
+ * @param sBody {String} HTML markup for results container body.
+ */
+YAHOO.widget.AutoComplete.prototype.setBody = function(sBody) {
+    if(sBody) {
+        if(this._oContainer._oContent._oBody) {
+            this._oContainer._oContent._oBody.innerHTML = sBody;
+            this._oContainer._oContent._oBody.style.display = "block";
+            this._oContainer._oContent.style.display = "block";
+        }
+    }
+    else {
+        this._oContainer._oContent._oBody.innerHTML = "";
+        this._oContainer._oContent.style.display = "none";
+    }
+    this._maxResultsDisplayed = 0;
+};
+
+/**
+ * Overridable method that converts a result item object into HTML markup
+ * for display. Return data values are accessible via the oResultItem object,
+ * and the key return value will always be oResultItem[0]. Markup will be
+ * displayed within &lt;li&gt; element tags in the container.
+ *
+ * @method formatResult
+ * @param oResultItem {Object} Result item representing one query result. Data is held in an array.
+ * @param sQuery {String} The current query string.
+ * @return {String} HTML markup of formatted result data.
+ */
+YAHOO.widget.AutoComplete.prototype.formatResult = function(oResultItem, sQuery) {
+    var sResult = oResultItem[0];
+    if(sResult) {
+        return sResult;
+    }
+    else {
+        return "";
+    }
+};
+
+/**
+ * Overridable method called before container expands allows implementers to access data
+ * and DOM elements.
+ *
+ * @method doBeforeExpandContainer
+ * @param oTextbox {HTMLElement} The text input box.
+ * @param oContainer {HTMLElement} The container element.
+ * @param sQuery {String} The query string.
+ * @param aResults {Object[]}  An array of query results.
+ * @return {Boolean} Return true to continue expanding container, false to cancel the expand.
+ */
+YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer = function(oTextbox, oContainer, sQuery, aResults) {
+    return true;
+};
+
+/**
+ * Makes query request to the DataSource.
+ *
+ * @method sendQuery
+ * @param sQuery {String} Query string.
+ */
+YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {
+    this._sendQuery(sQuery);
+};
+
+/**
+ * Overridable method gives implementers access to the query before it gets sent.
+ *
+ * @method doBeforeSendQuery
+ * @param sQuery {String} Query string.
+ * @return {String} Query string.
+ */
+YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery = function(sQuery) {
+    return sQuery;
+};
+
+/**
+ * Nulls out the entire AutoComplete instance and related objects, removes attached
+ * event listeners, and clears out DOM elements inside the container. After
+ * calling this method, the instance reference should be expliclitly nulled by
+ * implementer, as in myDataTable = null. Use with caution!
+ *
+ * @method destroy
+ */
+YAHOO.widget.AutoComplete.prototype.destroy = function() {
+    var instanceName = this.toString();
+    var elInput = this._oTextbox;
+    var elContainer = this._oContainer;
+
+    // Unhook custom events
+    this.textboxFocusEvent.unsubscribe();
+    this.textboxKeyEvent.unsubscribe();
+    this.dataRequestEvent.unsubscribe();
+    this.dataReturnEvent.unsubscribe();
+    this.dataErrorEvent.unsubscribe();
+    this.containerExpandEvent.unsubscribe();
+    this.typeAheadEvent.unsubscribe();
+    this.itemMouseOverEvent.unsubscribe();
+    this.itemMouseOutEvent.unsubscribe();
+    this.itemArrowToEvent.unsubscribe();
+    this.itemArrowFromEvent.unsubscribe();
+    this.itemSelectEvent.unsubscribe();
+    this.unmatchedItemSelectEvent.unsubscribe();
+    this.selectionEnforceEvent.unsubscribe();
+    this.containerCollapseEvent.unsubscribe();
+    this.textboxBlurEvent.unsubscribe();
+
+    // Unhook DOM events
+    YAHOO.util.Event.purgeElement(elInput, true);
+    YAHOO.util.Event.purgeElement(elContainer, true);
+
+    // Remove DOM elements
+    elContainer.innerHTML = "";
+
+    // Null out objects
+    for(var key in this) {
+        if(this.hasOwnProperty(key)) {
+            this[key] = null;
+        }
+    }
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public events
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Fired when the input field receives focus.
+ *
+ * @event textboxFocusEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.textboxFocusEvent = null;
+
+/**
+ * Fired when the input field receives key input.
+ *
+ * @event textboxKeyEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param nKeycode {Number} The keycode number.
+ */
+YAHOO.widget.AutoComplete.prototype.textboxKeyEvent = null;
+
+/**
+ * Fired when the AutoComplete instance makes a query to the DataSource.
+ * 
+ * @event dataRequestEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param sQuery {String} The query string.
+ */
+YAHOO.widget.AutoComplete.prototype.dataRequestEvent = null;
+
+/**
+ * Fired when the AutoComplete instance receives query results from the data
+ * source.
+ *
+ * @event dataReturnEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param sQuery {String} The query string.
+ * @param aResults {Object[]} Results array.
+ */
+YAHOO.widget.AutoComplete.prototype.dataReturnEvent = null;
+
+/**
+ * Fired when the AutoComplete instance does not receive query results from the
+ * DataSource due to an error.
+ *
+ * @event dataErrorEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param sQuery {String} The query string.
+ */
+YAHOO.widget.AutoComplete.prototype.dataErrorEvent = null;
+
+/**
+ * Fired when the results container is expanded.
+ *
+ * @event containerExpandEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.containerExpandEvent = null;
+
+/**
+ * Fired when the input field has been prefilled by the type-ahead
+ * feature. 
+ *
+ * @event typeAheadEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param sQuery {String} The query string.
+ * @param sPrefill {String} The prefill string.
+ */
+YAHOO.widget.AutoComplete.prototype.typeAheadEvent = null;
+
+/**
+ * Fired when result item has been moused over.
+ *
+ * @event itemMouseOverEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param elItem {HTMLElement} The &lt;li&gt element item moused to.
+ */
+YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent = null;
+
+/**
+ * Fired when result item has been moused out.
+ *
+ * @event itemMouseOutEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param elItem {HTMLElement} The &lt;li&gt; element item moused from.
+ */
+YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent = null;
+
+/**
+ * Fired when result item has been arrowed to. 
+ *
+ * @event itemArrowToEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param elItem {HTMLElement} The &lt;li&gt; element item arrowed to.
+ */
+YAHOO.widget.AutoComplete.prototype.itemArrowToEvent = null;
+
+/**
+ * Fired when result item has been arrowed away from.
+ *
+ * @event itemArrowFromEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param elItem {HTMLElement} The &lt;li&gt; element item arrowed from.
+ */
+YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent = null;
+
+/**
+ * Fired when an item is selected via mouse click, ENTER key, or TAB key.
+ *
+ * @event itemSelectEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param elItem {HTMLElement} The selected &lt;li&gt; element item.
+ * @param oData {Object} The data returned for the item, either as an object,
+ * or mapped from the schema into an array.
+ */
+YAHOO.widget.AutoComplete.prototype.itemSelectEvent = null;
+
+/**
+ * Fired when a user selection does not match any of the displayed result items.
+ * Note that this event may not behave as expected when delimiter characters
+ * have been defined. 
+ *
+ * @event unmatchedItemSelectEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @param sQuery {String} The user-typed query string.
+ */
+YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent = null;
+
+/**
+ * Fired if forceSelection is enabled and the user's input has been cleared
+ * because it did not match one of the returned query results.
+ *
+ * @event selectionEnforceEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent = null;
+
+/**
+ * Fired when the results container is collapsed.
+ *
+ * @event containerCollapseEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.containerCollapseEvent = null;
+
+/**
+ * Fired when the input field loses focus.
+ *
+ * @event textboxBlurEvent
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ */
+YAHOO.widget.AutoComplete.prototype.textboxBlurEvent = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class variable to index multiple AutoComplete instances.
+ *
+ * @property _nIndex
+ * @type Number
+ * @default 0
+ * @private
+ */
+YAHOO.widget.AutoComplete._nIndex = 0;
+
+/**
+ * Name of AutoComplete instance.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._sName = null;
+
+/**
+ * Text input field DOM element.
+ *
+ * @property _oTextbox
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._oTextbox = null;
+
+/**
+ * Whether or not the input field is currently in focus. If query results come back
+ * but the user has already moved on, do not proceed with auto complete behavior.
+ *
+ * @property _bFocused
+ * @type Boolean
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._bFocused = true;
+
+/**
+ * Animation instance for container expand/collapse.
+ *
+ * @property _oAnim
+ * @type Boolean
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._oAnim = null;
+
+/**
+ * Container DOM element.
+ *
+ * @property _oContainer
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._oContainer = null;
+
+/**
+ * Whether or not the results container is currently open.
+ *
+ * @property _bContainerOpen
+ * @type Boolean
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._bContainerOpen = false;
+
+/**
+ * Whether or not the mouse is currently over the results
+ * container. This is necessary in order to prevent clicks on container items
+ * from being text input field blur events.
+ *
+ * @property _bOverContainer
+ * @type Boolean
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._bOverContainer = false;
+
+/**
+ * Array of &lt;li&gt; elements references that contain query results within the
+ * results container.
+ *
+ * @property _aListItems
+ * @type HTMLElement[]
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._aListItems = null;
+
+/**
+ * Number of &lt;li&gt; elements currently displayed in results container.
+ *
+ * @property _nDisplayedItems
+ * @type Number
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._nDisplayedItems = 0;
+
+/**
+ * Internal count of &lt;li&gt; elements displayed and hidden in results container.
+ *
+ * @property _maxResultsDisplayed
+ * @type Number
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed = 0;
+
+/**
+ * Current query string
+ *
+ * @property _sCurQuery
+ * @type String
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._sCurQuery = null;
+
+/**
+ * Past queries this session (for saving delimited queries).
+ *
+ * @property _sSavedQuery
+ * @type String
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._sSavedQuery = null;
+
+/**
+ * Pointer to the currently highlighted &lt;li&gt; element in the container.
+ *
+ * @property _oCurItem
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._oCurItem = null;
+
+/**
+ * Whether or not an item has been selected since the container was populated
+ * with results. Reset to false by _populateList, and set to true when item is
+ * selected.
+ *
+ * @property _bItemSelected
+ * @type Boolean
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._bItemSelected = false;
+
+/**
+ * Key code of the last key pressed in textbox.
+ *
+ * @property _nKeyCode
+ * @type Number
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._nKeyCode = null;
+
+/**
+ * Delay timeout ID.
+ *
+ * @property _nDelayID
+ * @type Number
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._nDelayID = -1;
+
+/**
+ * Src to iFrame used when useIFrame = true. Supports implementations over SSL
+ * as well.
+ *
+ * @property _iFrameSrc
+ * @type String
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._iFrameSrc = "javascript:false;";
+
+/**
+ * For users typing via certain IMEs, queries must be triggered by intervals,
+ * since key events yet supported across all browsers for all IMEs.
+ *
+ * @property _queryInterval
+ * @type Object
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._queryInterval = null;
+
+/**
+ * Internal tracker to last known textbox value, used to determine whether or not
+ * to trigger a query via interval for certain IME users.
+ *
+ * @event _sLastTextboxValue
+ * @type String
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._sLastTextboxValue = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Updates and validates latest public config properties.
+ *
+ * @method __initProps
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._initProps = function() {
+    // Correct any invalid values
+    var minQueryLength = this.minQueryLength;
+    if(!YAHOO.lang.isNumber(minQueryLength)) {
+        this.minQueryLength = 1;
+    }
+    var maxResultsDisplayed = this.maxResultsDisplayed;
+    if(!YAHOO.lang.isNumber(maxResultsDisplayed) || (maxResultsDisplayed < 1)) {
+        this.maxResultsDisplayed = 10;
+    }
+    var queryDelay = this.queryDelay;
+    if(!YAHOO.lang.isNumber(queryDelay) || (queryDelay < 0)) {
+        this.queryDelay = 0.2;
+    }
+    var delimChar = this.delimChar;
+    if(YAHOO.lang.isString(delimChar)) {
+        this.delimChar = [delimChar];
+    }
+    else if(!YAHOO.lang.isArray(delimChar)) {
+        this.delimChar = null;
+    }
+    var animSpeed = this.animSpeed;
+    if((this.animHoriz || this.animVert) && YAHOO.util.Anim) {
+        if(!YAHOO.lang.isNumber(animSpeed) || (animSpeed < 0)) {
+            this.animSpeed = 0.3;
+        }
+        if(!this._oAnim ) {
+            this._oAnim = new YAHOO.util.Anim(this._oContainer._oContent, {}, this.animSpeed);
+        }
+        else {
+            this._oAnim.duration = this.animSpeed;
+        }
+    }
+    if(this.forceSelection && delimChar) {
+    }
+};
+
+/**
+ * Initializes the results container helpers if they are enabled and do
+ * not exist
+ *
+ * @method _initContainerHelpers
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._initContainerHelpers = function() {
+    if(this.useShadow && !this._oContainer._oShadow) {
+        var oShadow = document.createElement("div");
+        oShadow.className = "yui-ac-shadow";
+        this._oContainer._oShadow = this._oContainer.appendChild(oShadow);
+    }
+    if(this.useIFrame && !this._oContainer._oIFrame) {
+        var oIFrame = document.createElement("iframe");
+        oIFrame.src = this._iFrameSrc;
+        oIFrame.frameBorder = 0;
+        oIFrame.scrolling = "no";
+        oIFrame.style.position = "absolute";
+        oIFrame.style.width = "100%";
+        oIFrame.style.height = "100%";
+        oIFrame.tabIndex = -1;
+        this._oContainer._oIFrame = this._oContainer.appendChild(oIFrame);
+    }
+};
+
+/**
+ * Initializes the results container once at object creation
+ *
+ * @method _initContainer
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._initContainer = function() {
+    YAHOO.util.Dom.addClass(this._oContainer, "yui-ac-container");
+    
+    if(!this._oContainer._oContent) {
+        // The oContent div helps size the iframe and shadow properly
+        var oContent = document.createElement("div");
+        oContent.className = "yui-ac-content";
+        oContent.style.display = "none";
+        this._oContainer._oContent = this._oContainer.appendChild(oContent);
+
+        var oHeader = document.createElement("div");
+        oHeader.className = "yui-ac-hd";
+        oHeader.style.display = "none";
+        this._oContainer._oContent._oHeader = this._oContainer._oContent.appendChild(oHeader);
+
+        var oBody = document.createElement("div");
+        oBody.className = "yui-ac-bd";
+        this._oContainer._oContent._oBody = this._oContainer._oContent.appendChild(oBody);
+
+        var oFooter = document.createElement("div");
+        oFooter.className = "yui-ac-ft";
+        oFooter.style.display = "none";
+        this._oContainer._oContent._oFooter = this._oContainer._oContent.appendChild(oFooter);
+    }
+    else {
+    }
+};
+
+/**
+ * Clears out contents of container body and creates up to
+ * YAHOO.widget.AutoComplete#maxResultsDisplayed &lt;li&gt; elements in an
+ * &lt;ul&gt; element.
+ *
+ * @method _initList
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._initList = function() {
+    this._aListItems = [];
+    while(this._oContainer._oContent._oBody.hasChildNodes()) {
+        var oldListItems = this.getListItems();
+        if(oldListItems) {
+            for(var oldi = oldListItems.length-1; oldi >= 0; oldi--) {
+                oldListItems[oldi] = null;
+            }
+        }
+        this._oContainer._oContent._oBody.innerHTML = "";
+    }
+
+    var oList = document.createElement("ul");
+    oList = this._oContainer._oContent._oBody.appendChild(oList);
+    for(var i=0; i<this.maxResultsDisplayed; i++) {
+        var oItem = document.createElement("li");
+        oItem = oList.appendChild(oItem);
+        this._aListItems[i] = oItem;
+        this._initListItem(oItem, i);
+    }
+    this._maxResultsDisplayed = this.maxResultsDisplayed;
+};
+
+/**
+ * Initializes each &lt;li&gt; element in the container list.
+ *
+ * @method _initListItem
+ * @param oItem {HTMLElement} The &lt;li&gt; DOM element.
+ * @param nItemIndex {Number} The index of the element.
+ * @private
+ */
+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);
+};
+
+/**
+ * Enables interval detection for  Korean IME support.
+ *
+ * @method _onIMEDetected
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onIMEDetected = function(oSelf) {
+    oSelf._enableIntervalDetection();
+};
+
+/**
+ * Enables query triggers based on text input detection by intervals (rather
+ * than by key events).
+ *
+ * @method _enableIntervalDetection
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._enableIntervalDetection = function() {
+    var currValue = this._oTextbox.value;
+    var lastValue = this._sLastTextboxValue;
+    if(currValue != lastValue) {
+        this._sLastTextboxValue = currValue;
+        this._sendQuery(currValue);
+    }
+};
+
+
+/**
+ * Cancels text input detection by intervals.
+ *
+ * @method _cancelIntervalDetection
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._cancelIntervalDetection = function(oSelf) {
+    if(oSelf._queryInterval) {
+        clearInterval(oSelf._queryInterval);
+    }
+};
+
+
+/**
+ * Whether or not key is functional or should be ignored. Note that the right
+ * arrow key is NOT an ignored key since it triggers queries for certain intl
+ * charsets.
+ *
+ * @method _isIgnoreKey
+ * @param nKeycode {Number} Code of key pressed.
+ * @return {Boolean} True if key should be ignored, false otherwise.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._isIgnoreKey = function(nKeyCode) {
+    if((nKeyCode == 9) || (nKeyCode == 13)  || // tab, enter
+            (nKeyCode == 16) || (nKeyCode == 17) || // shift, ctl
+            (nKeyCode >= 18 && nKeyCode <= 20) || // alt,pause/break,caps lock
+            (nKeyCode == 27) || // esc
+            (nKeyCode >= 33 && nKeyCode <= 35) || // page up,page down,end
+            /*(nKeyCode >= 36 && nKeyCode <= 38) || // home,left,up
+            (nKeyCode == 40) || // down*/
+            (nKeyCode >= 36 && nKeyCode <= 40) || // home,left,up, right, down
+            (nKeyCode >= 44 && nKeyCode <= 45)) { // print screen,insert
+        return true;
+    }
+    return false;
+};
+
+/**
+ * Makes query request to the DataSource.
+ *
+ * @method _sendQuery
+ * @param sQuery {String} Query string.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._sendQuery = function(sQuery) {
+    // Widget has been effectively turned off
+    if(this.minQueryLength == -1) {
+        this._toggleContainer(false);
+        return;
+    }
+    // Delimiter has been enabled
+    var aDelimChar = (this.delimChar) ? this.delimChar : null;
+    if(aDelimChar) {
+        // Loop through all possible delimiters and find the latest one
+        // A " " may be a false positive if they are defined as delimiters AND
+        // are used to separate delimited queries
+        var nDelimIndex = -1;
+        for(var i = aDelimChar.length-1; i >= 0; i--) {
+            var nNewIndex = sQuery.lastIndexOf(aDelimChar[i]);
+            if(nNewIndex > nDelimIndex) {
+                nDelimIndex = nNewIndex;
+            }
+        }
+        // If we think the last delimiter is a space (" "), make sure it is NOT
+        // a false positive by also checking the char directly before it
+        if(aDelimChar[i] == " ") {
+            for (var j = aDelimChar.length-1; j >= 0; j--) {
+                if(sQuery[nDelimIndex - 1] == aDelimChar[j]) {
+                    nDelimIndex--;
+                    break;
+                }
+            }
+        }
+        // A delimiter has been found so extract the latest query
+        if(nDelimIndex > -1) {
+            var nQueryStart = nDelimIndex + 1;
+            // Trim any white space from the beginning...
+            while(sQuery.charAt(nQueryStart) == " ") {
+                nQueryStart += 1;
+            }
+            // ...and save the rest of the string for later
+            this._sSavedQuery = sQuery.substring(0,nQueryStart);
+            // Here is the query itself
+            sQuery = sQuery.substr(nQueryStart);
+        }
+        else if(sQuery.indexOf(this._sSavedQuery) < 0){
+            this._sSavedQuery = null;
+        }
+    }
+
+    // Don't search queries that are too short
+    if((sQuery && (sQuery.length < this.minQueryLength)) || (!sQuery && this.minQueryLength > 0)) {
+        if(this._nDelayID != -1) {
+            clearTimeout(this._nDelayID);
+        }
+        this._toggleContainer(false);
+        return;
+    }
+
+    sQuery = encodeURIComponent(sQuery);
+    this._nDelayID = -1;    // Reset timeout ID because request has been made
+    sQuery = this.doBeforeSendQuery(sQuery);
+    this.dataRequestEvent.fire(this, sQuery);
+    this.dataSource.getResults(this._populateList, sQuery, this);
+};
+
+/**
+ * Populates the array of &lt;li&gt; elements in the container with query
+ * results. This method is passed to YAHOO.widget.DataSource#getResults as a
+ * callback function so results from the DataSource instance are returned to the
+ * AutoComplete instance.
+ *
+ * @method _populateList
+ * @param sQuery {String} The query string.
+ * @param aResults {Object[]} An array of query result objects from the DataSource.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, aResults, oSelf) {
+    if(aResults === null) {
+        oSelf.dataErrorEvent.fire(oSelf, sQuery);
+    }
+    if(!oSelf._bFocused || !aResults) {
+        return;
+    }
+
+    var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
+    var contentStyle = oSelf._oContainer._oContent.style;
+    contentStyle.width = (!isOpera) ? null : "";
+    contentStyle.height = (!isOpera) ? null : "";
+
+    var sCurQuery = decodeURIComponent(sQuery);
+    oSelf._sCurQuery = sCurQuery;
+    oSelf._bItemSelected = false;
+
+    if(oSelf._maxResultsDisplayed != oSelf.maxResultsDisplayed) {
+        oSelf._initList();
+    }
+
+    var nItems = Math.min(aResults.length,oSelf.maxResultsDisplayed);
+    oSelf._nDisplayedItems = nItems;
+    if(nItems > 0) {
+        oSelf._initContainerHelpers();
+        var aItems = oSelf._aListItems;
+
+        // Fill items with data
+        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;
+
+        }
+
+        // Empty out remaining items if any
+        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;
+        }
+
+        // Expand the container
+        var ok = oSelf.doBeforeExpandContainer(oSelf._oTextbox, oSelf._oContainer, sQuery, aResults);
+        oSelf._toggleContainer(ok);
+        
+        if(oSelf.autoHighlight) {
+            // Go to the first item
+            var oFirstItem = aItems[0];
+            oSelf._toggleHighlight(oFirstItem,"to");
+            oSelf.itemArrowToEvent.fire(oSelf, oFirstItem);
+            oSelf._typeAhead(oFirstItem,sQuery);
+        }
+        else {
+            oSelf._oCurItem = null;
+        }
+    }
+    else {
+        oSelf._toggleContainer(false);
+    }
+    oSelf.dataReturnEvent.fire(oSelf, sQuery, aResults);
+    
+};
+
+/**
+ * When forceSelection is true and the user attempts
+ * leave the text input box without selecting an item from the query results,
+ * the user selection is cleared.
+ *
+ * @method _clearSelection
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._clearSelection = function() {
+    var sValue = this._oTextbox.value;
+    var sChar = (this.delimChar) ? this.delimChar[0] : null;
+    var nIndex = (sChar) ? sValue.lastIndexOf(sChar, sValue.length-2) : -1;
+    if(nIndex > -1) {
+        this._oTextbox.value = sValue.substring(0,nIndex);
+    }
+    else {
+         this._oTextbox.value = "";
+    }
+    this._sSavedQuery = this._oTextbox.value;
+
+    // Fire custom event
+    this.selectionEnforceEvent.fire(this);
+};
+
+/**
+ * Whether or not user-typed value in the text input box matches any of the
+ * query results.
+ *
+ * @method _textMatchesOption
+ * @return {HTMLElement} Matching list item element if user-input text matches
+ * a result, null otherwise.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._textMatchesOption = function() {
+    var foundMatch = null;
+
+    for(var i = this._nDisplayedItems-1; i >= 0 ; i--) {
+        var oItem = this._aListItems[i];
+        var sMatch = oItem._sResultKey.toLowerCase();
+        if(sMatch == this._sCurQuery.toLowerCase()) {
+            foundMatch = oItem;
+            break;
+        }
+    }
+    return(foundMatch);
+};
+
+/**
+ * Updates in the text input box with the first query result as the user types,
+ * selecting the substring that the user has not typed.
+ *
+ * @method _typeAhead
+ * @param oItem {HTMLElement} The &lt;li&gt; element item whose data populates the input field.
+ * @param sQuery {String} Query string.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {
+    // Don't update if turned off
+    if(!this.typeAhead || (this._nKeyCode == 8)) {
+        return;
+    }
+
+    var oTextbox = this._oTextbox;
+    var sValue = this._oTextbox.value; // any saved queries plus what user has typed
+
+    // Don't update with type-ahead if text selection is not supported
+    if(!oTextbox.setSelectionRange && !oTextbox.createTextRange) {
+        return;
+    }
+
+    // Select the portion of text that the user has not typed
+    var nStart = sValue.length;
+    this._updateValue(oItem);
+    var nEnd = oTextbox.value.length;
+    this._selectText(oTextbox,nStart,nEnd);
+    var sPrefill = oTextbox.value.substr(nStart,nEnd);
+    this.typeAheadEvent.fire(this,sQuery,sPrefill);
+};
+
+/**
+ * Selects text in the input field.
+ *
+ * @method _selectText
+ * @param oTextbox {HTMLElement} Text input box element in which to select text.
+ * @param nStart {Number} Starting index of text string to select.
+ * @param nEnd {Number} Ending index of text selection.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._selectText = function(oTextbox, nStart, nEnd) {
+    if(oTextbox.setSelectionRange) { // For Mozilla
+        oTextbox.setSelectionRange(nStart,nEnd);
+    }
+    else if(oTextbox.createTextRange) { // For IE
+        var oTextRange = oTextbox.createTextRange();
+        oTextRange.moveStart("character", nStart);
+        oTextRange.moveEnd("character", nEnd-oTextbox.value.length);
+        oTextRange.select();
+    }
+    else {
+        oTextbox.select();
+    }
+};
+
+/**
+ * Syncs results container with its helpers.
+ *
+ * @method _toggleContainerHelpers
+ * @param bShow {Boolean} True if container is expanded, false if collapsed
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) {
+    var bFireEvent = false;
+    var width = this._oContainer._oContent.offsetWidth + "px";
+    var height = this._oContainer._oContent.offsetHeight + "px";
+
+    if(this.useIFrame && this._oContainer._oIFrame) {
+        bFireEvent = true;
+        if(bShow) {
+            this._oContainer._oIFrame.style.width = width;
+            this._oContainer._oIFrame.style.height = height;
+        }
+        else {
+            this._oContainer._oIFrame.style.width = 0;
+            this._oContainer._oIFrame.style.height = 0;
+        }
+    }
+    if(this.useShadow && this._oContainer._oShadow) {
+        bFireEvent = true;
+        if(bShow) {
+            this._oContainer._oShadow.style.width = width;
+            this._oContainer._oShadow.style.height = height;
+        }
+        else {
+           this._oContainer._oShadow.style.width = 0;
+            this._oContainer._oShadow.style.height = 0;
+        }
+    }
+};
+
+/**
+ * Animates expansion or collapse of the container.
+ *
+ * @method _toggleContainer
+ * @param bShow {Boolean} True if container should be expanded, false if container should be collapsed
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) {
+    var oContainer = this._oContainer;
+
+    // Implementer has container always open so don't mess with it
+    if(this.alwaysShowContainer && this._bContainerOpen) {
+        return;
+    }
+    
+    // Clear contents of container
+    if(!bShow) {
+        this._oContainer._oContent.scrollTop = 0;
+        var aItems = this._aListItems;
+
+        if(aItems && (aItems.length > 0)) {
+            for(var i = aItems.length-1; i >= 0 ; i--) {
+                aItems[i].style.display = "none";
+            }
+        }
+
+        if(this._oCurItem) {
+            this._toggleHighlight(this._oCurItem,"from");
+        }
+
+        this._oCurItem = null;
+        this._nDisplayedItems = 0;
+        this._sCurQuery = null;
+    }
+
+    // Container is already closed
+    if(!bShow && !this._bContainerOpen) {
+        oContainer._oContent.style.display = "none";
+        return;
+    }
+
+    // If animation is enabled...
+    var oAnim = this._oAnim;
+    if(oAnim && oAnim.getEl() && (this.animHoriz || this.animVert)) {
+        // If helpers need to be collapsed, do it right away...
+        // but if helpers need to be expanded, wait until after the container expands
+        if(!bShow) {
+            this._toggleContainerHelpers(bShow);
+        }
+
+        if(oAnim.isAnimated()) {
+            oAnim.stop();
+        }
+
+        // Clone container to grab current size offscreen
+        var oClone = oContainer._oContent.cloneNode(true);
+        oContainer.appendChild(oClone);
+        oClone.style.top = "-9000px";
+        oClone.style.display = "block";
+
+        // Current size of the container is the EXPANDED size
+        var wExp = oClone.offsetWidth;
+        var hExp = oClone.offsetHeight;
+
+        // Calculate COLLAPSED sizes based on horiz and vert anim
+        var wColl = (this.animHoriz) ? 0 : wExp;
+        var hColl = (this.animVert) ? 0 : hExp;
+
+        // Set animation sizes
+        oAnim.attributes = (bShow) ?
+            {width: { to: wExp }, height: { to: hExp }} :
+            {width: { to: wColl}, height: { to: hColl }};
+
+        // If opening anew, set to a collapsed size...
+        if(bShow && !this._bContainerOpen) {
+            oContainer._oContent.style.width = wColl+"px";
+            oContainer._oContent.style.height = hColl+"px";
+        }
+        // Else, set it to its last known size.
+        else {
+            oContainer._oContent.style.width = wExp+"px";
+            oContainer._oContent.style.height = hExp+"px";
+        }
+
+        oContainer.removeChild(oClone);
+        oClone = null;
+
+       var oSelf = this;
+       var onAnimComplete = function() {
+            // Finish the collapse
+               oAnim.onComplete.unsubscribeAll();
+
+            if(bShow) {
+                oSelf.containerExpandEvent.fire(oSelf);
+            }
+            else {
+                oContainer._oContent.style.display = "none";
+                oSelf.containerCollapseEvent.fire(oSelf);
+            }
+            oSelf._toggleContainerHelpers(bShow);
+       };
+
+        // Display container and animate it
+        oContainer._oContent.style.display = "block";
+        oAnim.onComplete.subscribe(onAnimComplete);
+        oAnim.animate();
+        this._bContainerOpen = bShow;
+    }
+    // Else don't animate, just show or hide
+    else {
+        if(bShow) {
+            oContainer._oContent.style.display = "block";
+            this.containerExpandEvent.fire(this);
+        }
+        else {
+            oContainer._oContent.style.display = "none";
+            this.containerCollapseEvent.fire(this);
+        }
+        this._toggleContainerHelpers(bShow);
+        this._bContainerOpen = bShow;
+   }
+
+};
+
+/**
+ * Toggles the highlight on or off for an item in the container, and also cleans
+ * up highlighting of any previous item.
+ *
+ * @method _toggleHighlight
+ * @param oNewItem {HTMLElement} The &lt;li&gt; element item to receive highlight behavior.
+ * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._toggleHighlight = function(oNewItem, sType) {
+    var sHighlight = this.highlightClassName;
+    if(this._oCurItem) {
+        // Remove highlight from old item
+        YAHOO.util.Dom.removeClass(this._oCurItem, sHighlight);
+    }
+
+    if((sType == "to") && sHighlight) {
+        // Apply highlight to new item
+        YAHOO.util.Dom.addClass(oNewItem, sHighlight);
+        this._oCurItem = oNewItem;
+    }
+};
+
+/**
+ * Toggles the pre-highlight on or off for an item in the container.
+ *
+ * @method _togglePrehighlight
+ * @param oNewItem {HTMLElement} The &lt;li&gt; element item to receive highlight behavior.
+ * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._togglePrehighlight = function(oNewItem, sType) {
+    if(oNewItem == this._oCurItem) {
+        return;
+    }
+
+    var sPrehighlight = this.prehighlightClassName;
+    if((sType == "mouseover") && sPrehighlight) {
+        // Apply prehighlight to new item
+        YAHOO.util.Dom.addClass(oNewItem, sPrehighlight);
+    }
+    else {
+        // Remove prehighlight from old item
+        YAHOO.util.Dom.removeClass(oNewItem, sPrehighlight);
+    }
+};
+
+/**
+ * Updates the text input box value with selected query result. If a delimiter
+ * has been defined, then the value gets appended with the delimiter.
+ *
+ * @method _updateValue
+ * @param oItem {HTMLElement} The &lt;li&gt; element item with which to update the value.
+ * @private
+ */
+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();
+
+    // First clear text field
+    oTextbox.value = "";
+    // Grab data to put into text field
+    if(sDelimChar) {
+        if(sSavedQuery) {
+            oTextbox.value = sSavedQuery;
+        }
+        oTextbox.value += sResultKey + sDelimChar;
+        if(sDelimChar != " ") {
+            oTextbox.value += " ";
+        }
+    }
+    else { oTextbox.value = sResultKey; }
+
+    // scroll to bottom of textarea if necessary
+    if(oTextbox.type == "textarea") {
+        oTextbox.scrollTop = oTextbox.scrollHeight;
+    }
+
+    // move cursor to end
+    var end = oTextbox.value.length;
+    this._selectText(oTextbox,end,end);
+
+    this._oCurItem = oItem;
+};
+
+/**
+ * Selects a result item from the container
+ *
+ * @method _selectItem
+ * @param oItem {HTMLElement} The selected &lt;li&gt; element item.
+ * @private
+ */
+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);
+};
+
+/**
+ * If an item is highlighted in the container, the right arrow key jumps to the
+ * end of the textbox and selects the highlighted item, otherwise the container
+ * is closed.
+ *
+ * @method _jumpSelection
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._jumpSelection = function() {
+    if(this._oCurItem) {
+        this._selectItem(this._oCurItem);
+    }
+    else {
+        this._toggleContainer(false);
+    }
+};
+
+/**
+ * Triggered by up and down arrow keys, changes the current highlighted
+ * &lt;li&gt; element item. Scrolls container if necessary.
+ *
+ * @method _moveSelection
+ * @param nKeyCode {Number} Code of key pressed.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) {
+    if(this._bContainerOpen) {
+        // Determine current item's id number
+        var oCurItem = this._oCurItem;
+        var nCurItemIndex = -1;
+
+        if(oCurItem) {
+            nCurItemIndex = oCurItem._nItemIndex;
+        }
+
+        var nNewItemIndex = (nKeyCode == 40) ?
+                (nCurItemIndex + 1) : (nCurItemIndex - 1);
+
+        // Out of bounds
+        if(nNewItemIndex < -2 || nNewItemIndex >= this._nDisplayedItems) {
+            return;
+        }
+
+        if(oCurItem) {
+            // Unhighlight current item
+            this._toggleHighlight(oCurItem, "from");
+            this.itemArrowFromEvent.fire(this, oCurItem);
+        }
+        if(nNewItemIndex == -1) {
+           // Go back to query (remove type-ahead string)
+            if(this.delimChar && this._sSavedQuery) {
+                if(!this._textMatchesOption()) {
+                    this._oTextbox.value = this._sSavedQuery;
+                }
+                else {
+                    this._oTextbox.value = this._sSavedQuery + this._sCurQuery;
+                }
+            }
+            else {
+                this._oTextbox.value = this._sCurQuery;
+            }
+            this._oCurItem = null;
+            return;
+        }
+        if(nNewItemIndex == -2) {
+            // Close container
+            this._toggleContainer(false);
+            return;
+        }
+
+        var oNewItem = this._aListItems[nNewItemIndex];
+
+        // Scroll the container if necessary
+        var oContent = this._oContainer._oContent;
+        var scrollOn = ((YAHOO.util.Dom.getStyle(oContent,"overflow") == "auto") ||
+            (YAHOO.util.Dom.getStyle(oContent,"overflowY") == "auto"));
+        if(scrollOn && (nNewItemIndex > -1) &&
+        (nNewItemIndex < this._nDisplayedItems)) {
+            // User is keying down
+            if(nKeyCode == 40) {
+                // Bottom of selected item is below scroll area...
+                if((oNewItem.offsetTop+oNewItem.offsetHeight) > (oContent.scrollTop + oContent.offsetHeight)) {
+                    // Set bottom of scroll area to bottom of selected item
+                    oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;
+                }
+                // Bottom of selected item is above scroll area...
+                else if((oNewItem.offsetTop+oNewItem.offsetHeight) < oContent.scrollTop) {
+                    // Set top of selected item to top of scroll area
+                    oContent.scrollTop = oNewItem.offsetTop;
+
+                }
+            }
+            // User is keying up
+            else {
+                // Top of selected item is above scroll area
+                if(oNewItem.offsetTop < oContent.scrollTop) {
+                    // Set top of scroll area to top of selected item
+                    this._oContainer._oContent.scrollTop = oNewItem.offsetTop;
+                }
+                // Top of selected item is below scroll area
+                else if(oNewItem.offsetTop > (oContent.scrollTop + oContent.offsetHeight)) {
+                    // Set bottom of selected item to bottom of scroll area
+                    this._oContainer._oContent.scrollTop = (oNewItem.offsetTop+oNewItem.offsetHeight) - oContent.offsetHeight;
+                }
+            }
+        }
+
+        this._toggleHighlight(oNewItem, "to");
+        this.itemArrowToEvent.fire(this, oNewItem);
+        if(this.typeAhead) {
+            this._updateValue(oNewItem);
+        }
+    }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private event handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Handles &lt;li&gt; element mouseover events in the container.
+ *
+ * @method _onItemMouseover
+ * @param v {HTMLEvent} The mouseover event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onItemMouseover = function(v,oSelf) {
+    if(oSelf.prehighlightClassName) {
+        oSelf._togglePrehighlight(this,"mouseover");
+    }
+    else {
+        oSelf._toggleHighlight(this,"to");
+    }
+
+    oSelf.itemMouseOverEvent.fire(oSelf, this);
+};
+
+/**
+ * Handles &lt;li&gt; element mouseout events in the container.
+ *
+ * @method _onItemMouseout
+ * @param v {HTMLEvent} The mouseout event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onItemMouseout = function(v,oSelf) {
+    if(oSelf.prehighlightClassName) {
+        oSelf._togglePrehighlight(this,"mouseout");
+    }
+    else {
+        oSelf._toggleHighlight(this,"from");
+    }
+
+    oSelf.itemMouseOutEvent.fire(oSelf, this);
+};
+
+/**
+ * Handles &lt;li&gt; element click events in the container.
+ *
+ * @method _onItemMouseclick
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onItemMouseclick = function(v,oSelf) {
+    // In case item has not been moused over
+    oSelf._toggleHighlight(this,"to");
+    oSelf._selectItem(this);
+};
+
+/**
+ * Handles container mouseover events.
+ *
+ * @method _onContainerMouseover
+ * @param v {HTMLEvent} The mouseover event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onContainerMouseover = function(v,oSelf) {
+    oSelf._bOverContainer = true;
+};
+
+/**
+ * Handles container mouseout events.
+ *
+ * @method _onContainerMouseout
+ * @param v {HTMLEvent} The mouseout event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onContainerMouseout = function(v,oSelf) {
+    oSelf._bOverContainer = false;
+    // If container is still active
+    if(oSelf._oCurItem) {
+        oSelf._toggleHighlight(oSelf._oCurItem,"to");
+    }
+};
+
+/**
+ * Handles container scroll events.
+ *
+ * @method _onContainerScroll
+ * @param v {HTMLEvent} The scroll event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onContainerScroll = function(v,oSelf) {
+    oSelf._oTextbox.focus();
+};
+
+/**
+ * Handles container resize events.
+ *
+ * @method _onContainerResize
+ * @param v {HTMLEvent} The resize event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onContainerResize = function(v,oSelf) {
+    oSelf._toggleContainerHelpers(oSelf._bContainerOpen);
+};
+
+
+/**
+ * Handles textbox keydown events of functional keys, mainly for UI behavior.
+ *
+ * @method _onTextboxKeyDown
+ * @param v {HTMLEvent} The keydown event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown = function(v,oSelf) {
+    var nKeyCode = v.keyCode;
+
+    switch (nKeyCode) {
+        case 9: // tab
+            // select an item or clear out
+            if(oSelf._oCurItem) {
+                if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {
+                    if(oSelf._bContainerOpen) {
+                        YAHOO.util.Event.stopEvent(v);
+                    }
+                }
+                oSelf._selectItem(oSelf._oCurItem);
+            }
+            else {
+                oSelf._toggleContainer(false);
+            }
+            break;
+        case 13: // enter
+            if(oSelf._oCurItem) {
+                if(oSelf._nKeyCode != nKeyCode) {
+                    if(oSelf._bContainerOpen) {
+                        YAHOO.util.Event.stopEvent(v);
+                    }
+                }
+                oSelf._selectItem(oSelf._oCurItem);
+            }
+            else {
+                oSelf._toggleContainer(false);
+            }
+            break;
+        case 27: // esc
+            oSelf._toggleContainer(false);
+            return;
+        case 39: // right
+            oSelf._jumpSelection();
+            break;
+        case 38: // up
+            YAHOO.util.Event.stopEvent(v);
+            oSelf._moveSelection(nKeyCode);
+            break;
+        case 40: // down
+            YAHOO.util.Event.stopEvent(v);
+            oSelf._moveSelection(nKeyCode);
+            break;
+        default:
+            break;
+    }
+};
+
+/**
+ * Handles textbox keypress events.
+ * @method _onTextboxKeyPress
+ * @param v {HTMLEvent} The keypress event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress = function(v,oSelf) {
+    var nKeyCode = v.keyCode;
+
+        //Expose only to Mac browsers, where stopEvent is ineffective on keydown events (bug 790337)
+        var isMac = (navigator.userAgent.toLowerCase().indexOf("mac") != -1);
+        if(isMac) {
+            switch (nKeyCode) {
+            case 9: // tab
+                if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) {
+                    YAHOO.util.Event.stopEvent(v);
+                }
+                break;
+            case 13: // enter
+                if(oSelf._nKeyCode != nKeyCode) {
+                    YAHOO.util.Event.stopEvent(v);
+                }
+                break;
+            case 38: // up
+            case 40: // down
+                YAHOO.util.Event.stopEvent(v);
+                break;
+            default:
+                break;
+            }
+        }
+
+        //TODO: (?) limit only to non-IE, non-Mac-FF for Korean IME support (bug 811948)
+        // Korean IME detected
+        else if(nKeyCode == 229) {
+            oSelf._queryInterval = setInterval(function() { oSelf._onIMEDetected(oSelf); },500);
+        }
+};
+
+/**
+ * Handles textbox keyup events that trigger queries.
+ *
+ * @method _onTextboxKeyUp
+ * @param v {HTMLEvent} The keyup event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) {
+    // Check to see if any of the public properties have been updated
+    oSelf._initProps();
+
+    var nKeyCode = v.keyCode;
+    oSelf._nKeyCode = nKeyCode;
+    var sText = this.value; //string in textbox
+
+    // Filter out chars that don't trigger queries
+    if(oSelf._isIgnoreKey(nKeyCode) || (sText.toLowerCase() == oSelf._sCurQuery)) {
+        return;
+    }
+    else {
+        oSelf._bItemSelected = false;
+        YAHOO.util.Dom.removeClass(oSelf._oCurItem,  oSelf.highlightClassName);
+        oSelf._oCurItem = null;
+
+        oSelf.textboxKeyEvent.fire(oSelf, nKeyCode);
+    }
+
+    // Set timeout on the request
+    if(oSelf.queryDelay > 0) {
+        var nDelayID =
+            setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay * 1000));
+
+        if(oSelf._nDelayID != -1) {
+            clearTimeout(oSelf._nDelayID);
+        }
+
+        oSelf._nDelayID = nDelayID;
+    }
+    else {
+        // No delay so send request immediately
+        oSelf._sendQuery(sText);
+    }
+};
+
+/**
+ * Handles text input box receiving focus.
+ *
+ * @method _onTextboxFocus
+ * @param v {HTMLEvent} The focus event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) {
+    oSelf._oTextbox.setAttribute("autocomplete","off");
+    oSelf._bFocused = true;
+    if(!oSelf._bItemSelected) {
+        oSelf.textboxFocusEvent.fire(oSelf);
+    }
+};
+
+/**
+ * Handles text input box losing focus.
+ *
+ * @method _onTextboxBlur
+ * @param v {HTMLEvent} The focus event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) {
+    // Don't treat as a blur if it was a selection via mouse click
+    if(!oSelf._bOverContainer || (oSelf._nKeyCode == 9)) {
+        // Current query needs to be validated
+        if(!oSelf._bItemSelected) {
+            var oMatch = oSelf._textMatchesOption();
+            if(!oSelf._bContainerOpen || (oSelf._bContainerOpen && (oMatch === null))) {
+                if(oSelf.forceSelection) {
+                    oSelf._clearSelection();
+                }
+                else {
+                    oSelf.unmatchedItemSelectEvent.fire(oSelf, oSelf._sCurQuery);
+                }
+            }
+            else {
+                oSelf._selectItem(oMatch);
+            }
+        }
+
+        if(oSelf._bContainerOpen) {
+            oSelf._toggleContainer(false);
+        }
+        oSelf._cancelIntervalDetection(oSelf);
+        oSelf._bFocused = false;
+        oSelf.textboxBlurEvent.fire(oSelf);
+    }
+};
+
+/**
+ * Handles form submission event.
+ *
+ * @method _onFormSubmit
+ * @param v {HTMLEvent} The submit event.
+ * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance.
+ * @private
+ */
+YAHOO.widget.AutoComplete.prototype._onFormSubmit = function(v,oSelf) {
+    if(oSelf.allowBrowserAutocomplete) {
+        oSelf._oTextbox.setAttribute("autocomplete","on");
+    }
+    else {
+        oSelf._oTextbox.setAttribute("autocomplete","off");
+    }
+};
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The DataSource classes manages sending a request and returning response from a live
+ * database. Supported data include local JavaScript arrays and objects and databases
+ * accessible via XHR connections. Supported response formats include JavaScript arrays,
+ * JSON, XML, and flat-file textual data.
+ *  
+ * @class DataSource
+ * @constructor
+ */
+YAHOO.widget.DataSource = function() { 
+    /* abstract class */
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public constants
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Error message for null data responses.
+ *
+ * @property ERROR_DATANULL
+ * @type String
+ * @static
+ * @final
+ */
+YAHOO.widget.DataSource.ERROR_DATANULL = "Response data was null";
+
+/**
+ * Error message for data responses with parsing errors.
+ *
+ * @property ERROR_DATAPARSE
+ * @type String
+ * @static
+ * @final
+ */
+YAHOO.widget.DataSource.ERROR_DATAPARSE = "Response data could not be parsed";
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Max size of the local cache.  Set to 0 to turn off caching.  Caching is
+ * useful to reduce the number of server connections.  Recommended only for data
+ * sources that return comprehensive results for queries or when stale data is
+ * not an issue.
+ *
+ * @property maxCacheEntries
+ * @type Number
+ * @default 15
+ */
+YAHOO.widget.DataSource.prototype.maxCacheEntries = 15;
+
+/**
+ * Use this to fine-tune the matching algorithm used against JS Array types of
+ * DataSource and DataSource caches. If queryMatchContains is true, then the JS
+ * Array or cache returns results that "contain" the query string. By default,
+ * queryMatchContains is set to false, so that only results that "start with"
+ * the query string are returned.
+ *
+ * @property queryMatchContains
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.DataSource.prototype.queryMatchContains = false;
+
+/**
+ * Enables query subset matching. If caching is on and queryMatchSubset is
+ * true, substrings of queries will return matching cached results. For
+ * instance, if the first query is for "abc" susequent queries that start with
+ * "abc", like "abcd", will be queried against the cache, and not the live data
+ * source. Recommended only for DataSources that return comprehensive results
+ * for queries with very few characters.
+ *
+ * @property queryMatchSubset
+ * @type Boolean
+ * @default false
+ *
+ */
+YAHOO.widget.DataSource.prototype.queryMatchSubset = false;
+
+/**
+ * Enables case-sensitivity in the matching algorithm used against JS Array
+ * types of DataSources and DataSource caches. If queryMatchCase is true, only
+ * case-sensitive matches will return.
+ *
+ * @property queryMatchCase
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.DataSource.prototype.queryMatchCase = false;
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Public accessor to the unique name of the DataSource instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the DataSource instance
+ */
+YAHOO.widget.DataSource.prototype.toString = function() {
+    return "DataSource " + this._sName;
+};
+
+/**
+ * Retrieves query results, first checking the local cache, then making the
+ * query request to the live data source as defined by the function doQuery.
+ *
+ * @method getResults
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DataSource.prototype.getResults = function(oCallbackFn, sQuery, oParent) {
+    
+    // First look in cache
+    var aResults = this._doQueryCache(oCallbackFn,sQuery,oParent);
+    // Not in cache, so get results from server
+    if(aResults.length === 0) {
+        this.queryEvent.fire(this, oParent, sQuery);
+        this.doQuery(oCallbackFn, sQuery, oParent);
+    }
+};
+
+/**
+ * Abstract method implemented by subclasses to make a query to the live data
+ * source. Must call the callback function with the response returned from the
+ * query. Populates cache (if enabled).
+ *
+ * @method doQuery
+ * @param oCallbackFn {HTMLFunction} Callback function implemented by oParent to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DataSource.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {
+    /* override this */ 
+};
+
+/**
+ * Flushes cache.
+ *
+ * @method flushCache
+ */
+YAHOO.widget.DataSource.prototype.flushCache = function() {
+    if(this._aCache) {
+        this._aCache = [];
+    }
+    if(this._aCacheHelper) {
+        this._aCacheHelper = [];
+    }
+    this.cacheFlushEvent.fire(this);
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public events
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Fired when a query is made to the live data source.
+ *
+ * @event queryEvent
+ * @param oSelf {Object} The DataSource instance.
+ * @param oParent {Object} The requesting object.
+ * @param sQuery {String} The query string.
+ */
+YAHOO.widget.DataSource.prototype.queryEvent = null;
+
+/**
+ * Fired when a query is made to the local cache.
+ *
+ * @event cacheQueryEvent
+ * @param oSelf {Object} The DataSource instance.
+ * @param oParent {Object} The requesting object.
+ * @param sQuery {String} The query string.
+ */
+YAHOO.widget.DataSource.prototype.cacheQueryEvent = null;
+
+/**
+ * Fired when data is retrieved from the live data source.
+ *
+ * @event getResultsEvent
+ * @param oSelf {Object} The DataSource instance.
+ * @param oParent {Object} The requesting object.
+ * @param sQuery {String} The query string.
+ * @param aResults {Object[]} Array of result objects.
+ */
+YAHOO.widget.DataSource.prototype.getResultsEvent = null;
+    
+/**
+ * Fired when data is retrieved from the local cache.
+ *
+ * @event getCachedResultsEvent
+ * @param oSelf {Object} The DataSource instance.
+ * @param oParent {Object} The requesting object.
+ * @param sQuery {String} The query string.
+ * @param aResults {Object[]} Array of result objects.
+ */
+YAHOO.widget.DataSource.prototype.getCachedResultsEvent = null;
+
+/**
+ * Fired when an error is encountered with the live data source.
+ *
+ * @event dataErrorEvent
+ * @param oSelf {Object} The DataSource instance.
+ * @param oParent {Object} The requesting object.
+ * @param sQuery {String} The query string.
+ * @param sMsg {String} Error message string
+ */
+YAHOO.widget.DataSource.prototype.dataErrorEvent = null;
+
+/**
+ * Fired when the local cache is flushed.
+ *
+ * @event cacheFlushEvent
+ * @param oSelf {Object} The DataSource instance
+ */
+YAHOO.widget.DataSource.prototype.cacheFlushEvent = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class variable to index multiple DataSource instances.
+ *
+ * @property _nIndex
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.widget.DataSource._nIndex = 0;
+
+/**
+ * Name of DataSource instance.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataSource.prototype._sName = null;
+
+/**
+ * Local cache of data result objects indexed chronologically.
+ *
+ * @property _aCache
+ * @type Object[]
+ * @private
+ */
+YAHOO.widget.DataSource.prototype._aCache = null;
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Initializes DataSource instance.
+ *  
+ * @method _init
+ * @private
+ */
+YAHOO.widget.DataSource.prototype._init = function() {
+    // Validate and initialize public configs
+    var maxCacheEntries = this.maxCacheEntries;
+    if(!YAHOO.lang.isNumber(maxCacheEntries) || (maxCacheEntries < 0)) {
+        maxCacheEntries = 0;
+    }
+    // Initialize local cache
+    if(maxCacheEntries > 0 && !this._aCache) {
+        this._aCache = [];
+    }
+    
+    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);
+};
+
+/**
+ * Adds a result object to the local cache, evicting the oldest element if the 
+ * cache is full. Newer items will have higher indexes, the oldest item will have
+ * index of 0. 
+ *
+ * @method _addCacheElem
+ * @param oResult {Object} Data result object, including array of results.
+ * @private
+ */
+YAHOO.widget.DataSource.prototype._addCacheElem = function(oResult) {
+    var aCache = this._aCache;
+    // Don't add if anything important is missing.
+    if(!aCache || !oResult || !oResult.query || !oResult.results) {
+        return;
+    }
+    
+    // If the cache is full, make room by removing from index=0
+    if(aCache.length >= this.maxCacheEntries) {
+        aCache.shift();
+    }
+        
+    // Add to cache, at the end of the array
+    aCache.push(oResult);
+};
+
+/**
+ * Queries the local cache for results. If query has been cached, the callback
+ * function is called with the results, and the cached is refreshed so that it
+ * is now the newest element.  
+ *
+ * @method _doQueryCache
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ * @return aResults {Object[]} Array of results from local cache if found, otherwise null.
+ * @private 
+ */
+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 cache is enabled...
+    if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {
+        this.cacheQueryEvent.fire(this, oParent, sQuery);
+        // If case is unimportant, normalize query now instead of in loops
+        if(!this.queryMatchCase) {
+            var sOrigQuery = sQuery;
+            sQuery = sQuery.toLowerCase();
+        }
+
+        // Loop through each cached element's query property...
+        for(var i = nCacheLength-1; i >= 0; i--) {
+            var resultObj = aCache[i];
+            var aAllResultItems = resultObj.results;
+            // If case is unimportant, normalize match key for comparison
+            var matchKey = (!this.queryMatchCase) ?
+                encodeURIComponent(resultObj.query).toLowerCase():
+                encodeURIComponent(resultObj.query);
+            
+            // If a cached match key exactly matches the query...
+            if(matchKey == sQuery) {
+                    // Stash all result objects into aResult[] and stop looping through the cache.
+                    bMatchFound = true;
+                    aResults = aAllResultItems;
+                    
+                    // The matching cache element was not the most recent,
+                    // so now we need to refresh the cache.
+                    if(i != nCacheLength-1) {                        
+                        // Remove element from its original location
+                        aCache.splice(i,1);
+                        // Add element as newest
+                        this._addCacheElem(resultObj);
+                    }
+                    break;
+            }
+            // Else if this query is not an exact match and subset matching is enabled...
+            else if(this.queryMatchSubset) {
+                // Loop through substrings of each cached element's query property...
+                for(var j = sQuery.length-1; j >= 0 ; j--) {
+                    var subQuery = sQuery.substr(0,j);
+                    
+                    // If a substring of a cached sQuery exactly matches the query...
+                    if(matchKey == subQuery) {                    
+                        bMatchFound = true;
+                        
+                        // Go through each cached result object to match against the query...
+                        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);
+                            
+                            // A STARTSWITH match is when the query is found at the beginning of the key string...
+                            if((!bMatchContains && (sKeyIndex === 0)) ||
+                            // A CONTAINS match is when the query is found anywhere within the key string...
+                            (bMatchContains && (sKeyIndex > -1))) {
+                                // Stash a match into aResults[].
+                                aResults.unshift(aRecord);
+                            }
+                        }
+                        
+                        // Add the subset match result set object as the newest element to cache,
+                        // and stop looping through the cache.
+                        resultObj = {};
+                        resultObj.query = sQuery;
+                        resultObj.results = aResults;
+                        this._addCacheElem(resultObj);
+                        break;
+                    }
+                }
+                if(bMatchFound) {
+                    break;
+                }
+            }
+        }
+        
+        // If there was a match, send along the results.
+        if(bMatchFound) {
+            this.getCachedResultsEvent.fire(this, oParent, sOrigQuery, aResults);
+            oCallbackFn(sOrigQuery, aResults, oParent);
+        }
+    }
+    return aResults;
+};
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * Implementation of YAHOO.widget.DataSource using XML HTTP requests that return
+ * query results.
+ *  
+ * @class DS_XHR
+ * @extends YAHOO.widget.DataSource
+ * @requires connection
+ * @constructor
+ * @param sScriptURI {String} Absolute or relative URI to script that returns query
+ * results as JSON, XML, or delimited flat-file data.
+ * @param aSchema {String[]} Data schema definition of results.
+ * @param oConfigs {Object} (optional) Object literal of config params.
+ */
+YAHOO.widget.DS_XHR = function(sScriptURI, aSchema, oConfigs) {
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            this[sConfig] = oConfigs[sConfig];
+        }
+    }
+
+    // Initialization sequence
+    if(!YAHOO.lang.isArray(aSchema) || !YAHOO.lang.isString(sScriptURI)) {
+        return;
+    }
+
+    this.schema = aSchema;
+    this.scriptURI = sScriptURI;
+    
+    this._init();
+};
+
+YAHOO.widget.DS_XHR.prototype = new YAHOO.widget.DataSource();
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public constants
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * JSON data type.
+ *
+ * @property TYPE_JSON
+ * @type Number
+ * @static
+ * @final
+ */
+YAHOO.widget.DS_XHR.TYPE_JSON = 0;
+
+/**
+ * XML data type.
+ *
+ * @property TYPE_XML
+ * @type Number
+ * @static
+ * @final
+ */
+YAHOO.widget.DS_XHR.TYPE_XML = 1;
+
+/**
+ * Flat-file data type.
+ *
+ * @property TYPE_FLAT
+ * @type Number
+ * @static
+ * @final
+ */
+YAHOO.widget.DS_XHR.TYPE_FLAT = 2;
+
+/**
+ * Error message for XHR failure.
+ *
+ * @property ERROR_DATAXHR
+ * @type String
+ * @static
+ * @final
+ */
+YAHOO.widget.DS_XHR.ERROR_DATAXHR = "XHR response failed";
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Alias to YUI Connection Manager. Allows implementers to specify their own
+ * subclasses of the YUI Connection Manager utility.
+ *
+ * @property connMgr
+ * @type Object
+ * @default YAHOO.util.Connect
+ */
+YAHOO.widget.DS_XHR.prototype.connMgr = YAHOO.util.Connect;
+
+/**
+ * Number of milliseconds the XHR connection will wait for a server response. A
+ * a value of zero indicates the XHR connection will wait forever. Any value
+ * greater than zero will use the Connection utility's Auto-Abort feature.
+ *
+ * @property connTimeout
+ * @type Number
+ * @default 0
+ */
+YAHOO.widget.DS_XHR.prototype.connTimeout = 0;
+
+/**
+ * Absolute or relative URI to script that returns query results. For instance,
+ * queries will be sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput
+ *
+ * @property scriptURI
+ * @type String
+ */
+YAHOO.widget.DS_XHR.prototype.scriptURI = null;
+
+/**
+ * Query string parameter name sent to scriptURI. For instance, queries will be
+ * sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput
+ *
+ * @property scriptQueryParam
+ * @type String
+ * @default "query"
+ */
+YAHOO.widget.DS_XHR.prototype.scriptQueryParam = "query";
+
+/**
+ * String of key/value pairs to append to requests made to scriptURI. Define
+ * this string when you want to send additional query parameters to your script.
+ * When defined, queries will be sent to
+ * &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput&#38;&#60;scriptQueryAppend&#62;
+ *
+ * @property scriptQueryAppend
+ * @type String
+ * @default ""
+ */
+YAHOO.widget.DS_XHR.prototype.scriptQueryAppend = "";
+
+/**
+ * XHR response data type. Other types that may be defined are YAHOO.widget.DS_XHR.TYPE_XML
+ * and YAHOO.widget.DS_XHR.TYPE_FLAT.
+ *
+ * @property responseType
+ * @type String
+ * @default YAHOO.widget.DS_XHR.TYPE_JSON
+ */
+YAHOO.widget.DS_XHR.prototype.responseType = YAHOO.widget.DS_XHR.TYPE_JSON;
+
+/**
+ * String after which to strip results. If the results from the XHR are sent
+ * back as HTML, the gzip HTML comment appears at the end of the data and should
+ * be ignored.
+ *
+ * @property responseStripAfter
+ * @type String
+ * @default "\n&#60;!-"
+ */
+YAHOO.widget.DS_XHR.prototype.responseStripAfter = "\n<!-";
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Queries the live data source defined by scriptURI for results. Results are
+ * passed back to a callback function.
+ *  
+ * @method doQuery
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DS_XHR.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {
+    var isXML = (this.responseType == YAHOO.widget.DS_XHR.TYPE_XML);
+    var sUri = this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;
+    if(this.scriptQueryAppend.length > 0) {
+        sUri += "&" + this.scriptQueryAppend;
+    }
+    var oResponse = null;
+    
+    var oSelf = this;
+    /*
+     * Sets up ajax request callback
+     *
+     * @param {object} oReq          HTTPXMLRequest object
+     * @private
+     */
+    var responseSuccess = function(oResp) {
+        // Response ID does not match last made request ID.
+        if(!oSelf._oConn || (oResp.tId != oSelf._oConn.tId)) {
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);
+            return;
+        }
+//DEBUG
+for(var foo in oResp) {
+}
+        if(!isXML) {
+            oResp = oResp.responseText;
+        }
+        else { 
+            oResp = oResp.responseXML;
+        }
+        if(oResp === null) {
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);
+            return;
+        }
+
+        var aResults = oSelf.parseResponse(sQuery, oResp, oParent);
+        var resultObj = {};
+        resultObj.query = decodeURIComponent(sQuery);
+        resultObj.results = aResults;
+        if(aResults === null) {
+            oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATAPARSE);
+            aResults = [];
+        }
+        else {
+            oSelf.getResultsEvent.fire(oSelf, oParent, sQuery, aResults);
+            oSelf._addCacheElem(resultObj);
+        }
+        oCallbackFn(sQuery, aResults, oParent);
+    };
+
+    var responseFailure = function(oResp) {
+        oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DS_XHR.ERROR_DATAXHR);
+        return;
+    };
+    
+    var oCallback = {
+        success:responseSuccess,
+        failure:responseFailure
+    };
+    
+    if(YAHOO.lang.isNumber(this.connTimeout) && (this.connTimeout > 0)) {
+        oCallback.timeout = this.connTimeout;
+    }
+    
+    if(this._oConn) {
+        this.connMgr.abort(this._oConn);
+    }
+    
+    oSelf._oConn = this.connMgr.asyncRequest("GET", sUri, oCallback, null);
+};
+
+/**
+ * Parses raw response data into an array of result objects. The result data key
+ * is always stashed in the [0] element of each result object. 
+ *
+ * @method parseResponse
+ * @param sQuery {String} Query string.
+ * @param oResponse {Object} The raw response data to parse.
+ * @param oParent {Object} The object instance that has requested data.
+ * @returns {Object[]} Array of result objects.
+ */
+YAHOO.widget.DS_XHR.prototype.parseResponse = function(sQuery, oResponse, oParent) {
+    var aSchema = this.schema;
+    var aResults = [];
+    var bError = false;
+
+    // Strip out comment at the end of results
+    var nEnd = ((this.responseStripAfter !== "") && (oResponse.indexOf)) ?
+        oResponse.indexOf(this.responseStripAfter) : -1;
+    if(nEnd != -1) {
+        oResponse = oResponse.substring(0,nEnd);
+    }
+
+    switch (this.responseType) {
+        case YAHOO.widget.DS_XHR.TYPE_JSON:
+            var jsonList, jsonObjParsed;
+            // Check for JSON lib but divert KHTML clients
+            var isNotMac = (navigator.userAgent.toLowerCase().indexOf('khtml')== -1);
+            if(oResponse.parseJSON && isNotMac) {
+                // Use the new JSON utility if available
+                jsonObjParsed = oResponse.parseJSON();
+                if(!jsonObjParsed) {
+                    bError = true;
+                }
+                else {
+                    try {
+                        // eval is necessary here since aSchema[0] is of unknown depth
+                        jsonList = eval("jsonObjParsed." + aSchema[0]);
+                    }
+                    catch(e) {
+                        bError = true;
+                        break;
+                   }
+                }
+            }
+            else if(window.JSON && isNotMac) {
+                // Use older JSON lib if available
+                jsonObjParsed = JSON.parse(oResponse);
+                if(!jsonObjParsed) {
+                    bError = true;
+                    break;
+                }
+                else {
+                    try {
+                        // eval is necessary here since aSchema[0] is of unknown depth
+                        jsonList = eval("jsonObjParsed." + aSchema[0]);
+                    }
+                    catch(e) {
+                        bError = true;
+                        break;
+                   }
+                }
+            }
+            else {
+                // Parse the JSON response as a string
+                try {
+                    // Trim leading spaces
+                    while (oResponse.substring(0,1) == " ") {
+                        oResponse = oResponse.substring(1, oResponse.length);
+                    }
+
+                    // Invalid JSON response
+                    if(oResponse.indexOf("{") < 0) {
+                        bError = true;
+                        break;
+                    }
+
+                    // Empty (but not invalid) JSON response
+                    if(oResponse.indexOf("{}") === 0) {
+                        break;
+                    }
+
+                    // Turn the string into an object literal...
+                    // ...eval is necessary here
+                    var jsonObjRaw = eval("(" + oResponse + ")");
+                    if(!jsonObjRaw) {
+                        bError = true;
+                        break;
+                    }
+
+                    // Grab the object member that contains an array of all reponses...
+                    // ...eval is necessary here since aSchema[0] is of unknown depth
+                    jsonList = eval("(jsonObjRaw." + aSchema[0]+")");
+                }
+                catch(e) {
+                    bError = true;
+                    break;
+               }
+            }
+
+            if(!jsonList) {
+                bError = true;
+                break;
+            }
+
+            if(!YAHOO.lang.isArray(jsonList)) {
+                jsonList = [jsonList];
+            }
+            
+            // Loop through the array of all responses...
+            for(var i = jsonList.length-1; i >= 0 ; i--) {
+                var aResultItem = [];
+                var jsonResult = jsonList[i];
+                // ...and loop through each data field value of each response
+                for(var j = aSchema.length-1; j >= 1 ; j--) {
+                    // ...and capture data into an array mapped according to the schema...
+                    var dataFieldValue = jsonResult[aSchema[j]];
+                    if(!dataFieldValue) {
+                        dataFieldValue = "";
+                    }
+                    aResultItem.unshift(dataFieldValue);
+                }
+                // If schema isn't well defined, pass along the entire result object
+                if(aResultItem.length == 1) {
+                    aResultItem.push(jsonResult);
+                }
+                // Capture the array of data field values in an array of results
+                aResults.unshift(aResultItem);
+            }
+            break;
+        case YAHOO.widget.DS_XHR.TYPE_XML:
+            // Get the collection of results
+            var xmlList = oResponse.getElementsByTagName(aSchema[0]);
+            if(!xmlList) {
+                bError = true;
+                break;
+            }
+            // Loop through each result
+            for(var k = xmlList.length-1; k >= 0 ; k--) {
+                var result = xmlList.item(k);
+                var aFieldSet = [];
+                // Loop through each data field in each result using the schema
+                for(var m = aSchema.length-1; m >= 1 ; m--) {
+                    var sValue = null;
+                    // Values may be held in an attribute...
+                    var xmlAttr = result.attributes.getNamedItem(aSchema[m]);
+                    if(xmlAttr) {
+                        sValue = xmlAttr.value;
+                    }
+                    // ...or in a node
+                    else{
+                        var xmlNode = result.getElementsByTagName(aSchema[m]);
+                        if(xmlNode && xmlNode.item(0) && xmlNode.item(0).firstChild) {
+                            sValue = xmlNode.item(0).firstChild.nodeValue;
+                        }
+                        else {
+                            sValue = "";
+                        }
+                    }
+                    // Capture the schema-mapped data field values into an array
+                    aFieldSet.unshift(sValue);
+                }
+                // Capture each array of values into an array of results
+                aResults.unshift(aFieldSet);
+            }
+            break;
+        case YAHOO.widget.DS_XHR.TYPE_FLAT:
+            if(oResponse.length > 0) {
+                // Delete the last line delimiter at the end of the data if it exists
+                var newLength = oResponse.length-aSchema[0].length;
+                if(oResponse.substr(newLength) == aSchema[0]) {
+                    oResponse = oResponse.substr(0, newLength);
+                }
+                var aRecords = oResponse.split(aSchema[0]);
+                for(var n = aRecords.length-1; n >= 0; n--) {
+                    aResults[n] = aRecords[n].split(aSchema[1]);
+                }
+            }
+            break;
+        default:
+            break;
+    }
+    sQuery = null;
+    oResponse = null;
+    oParent = null;
+    if(bError) {
+        return null;
+    }
+    else {
+        return aResults;
+    }
+};            
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * XHR connection object.
+ *
+ * @property _oConn
+ * @type Object
+ * @private
+ */
+YAHOO.widget.DS_XHR.prototype._oConn = null;
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * Implementation of YAHOO.widget.DataSource using a native Javascript function as
+ * its live data source.
+ *  
+ * @class DS_JSFunction
+ * @constructor
+ * @extends YAHOO.widget.DataSource
+ * @param oFunction {HTMLFunction} In-memory Javascript function that returns query results as an array of objects.
+ * @param oConfigs {Object} (optional) Object literal of config params.
+ */
+YAHOO.widget.DS_JSFunction = function(oFunction, oConfigs) {
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            this[sConfig] = oConfigs[sConfig];
+        }
+    }
+
+    // Initialization sequence
+    if(!YAHOO.lang.isFunction(oFunction)) {
+        return;
+    }
+    else {
+        this.dataFunction = oFunction;
+        this._init();
+    }
+};
+
+YAHOO.widget.DS_JSFunction.prototype = new YAHOO.widget.DataSource();
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * In-memory Javascript function that returns query results.
+ *
+ * @property dataFunction
+ * @type HTMLFunction
+ */
+YAHOO.widget.DS_JSFunction.prototype.dataFunction = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Queries the live data source defined by function for results. Results are
+ * passed back to a callback function.
+ *  
+ * @method doQuery
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {
+    var oFunction = this.dataFunction;
+    var aResults = [];
+    
+    aResults = oFunction(sQuery);
+    if(aResults === null) {
+        this.dataErrorEvent.fire(this, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);
+        return;
+    }
+    
+    var resultObj = {};
+    resultObj.query = decodeURIComponent(sQuery);
+    resultObj.results = aResults;
+    this._addCacheElem(resultObj);
+    
+    this.getResultsEvent.fire(this, oParent, sQuery, aResults);
+    oCallbackFn(sQuery, aResults, oParent);
+    return;
+};
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * Implementation of YAHOO.widget.DataSource using a native Javascript array as
+ * its live data source.
+ *
+ * @class DS_JSArray
+ * @constructor
+ * @extends YAHOO.widget.DataSource
+ * @param aData {String[]} In-memory Javascript array of simple string data.
+ * @param oConfigs {Object} (optional) Object literal of config params.
+ */
+YAHOO.widget.DS_JSArray = function(aData, oConfigs) {
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            this[sConfig] = oConfigs[sConfig];
+        }
+    }
+
+    // Initialization sequence
+    if(!YAHOO.lang.isArray(aData)) {
+        return;
+    }
+    else {
+        this.data = aData;
+        this._init();
+    }
+};
+
+YAHOO.widget.DS_JSArray.prototype = new YAHOO.widget.DataSource();
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * In-memory Javascript array of strings.
+ *
+ * @property data
+ * @type Array
+ */
+YAHOO.widget.DS_JSArray.prototype.data = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Queries the live data source defined by data for results. Results are passed
+ * back to a callback function.
+ *
+ * @method doQuery
+ * @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.
+ * @param sQuery {String} Query string.
+ * @param oParent {Object} The object instance that has requested data.
+ */
+YAHOO.widget.DS_JSArray.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {
+    var i;
+    var aData = this.data; // the array
+    var aResults = []; // container for results
+    var bMatchFound = false;
+    var bMatchContains = this.queryMatchContains;
+    if(sQuery) {
+        if(!this.queryMatchCase) {
+            sQuery = sQuery.toLowerCase();
+        }
+
+        // Loop through each element of the array...
+        // which can be a string or an array of strings
+        for(i = aData.length-1; i >= 0; i--) {
+            var aDataset = [];
+
+            if(YAHOO.lang.isString(aData[i])) {
+                aDataset[0] = aData[i];
+            }
+            else if(YAHOO.lang.isArray(aData[i])) {
+                aDataset = aData[i];
+            }
+
+            if(YAHOO.lang.isString(aDataset[0])) {
+                var sKeyIndex = (this.queryMatchCase) ?
+                encodeURIComponent(aDataset[0]).indexOf(sQuery):
+                encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);
+
+                // A STARTSWITH match is when the query is found at the beginning of the key string...
+                if((!bMatchContains && (sKeyIndex === 0)) ||
+                // A CONTAINS match is when the query is found anywhere within the key string...
+                (bMatchContains && (sKeyIndex > -1))) {
+                    // Stash a match into aResults[].
+                    aResults.unshift(aDataset);
+                }
+            }
+        }
+    }
+    else {
+        for(i = aData.length-1; i >= 0; i--) {
+            if(YAHOO.lang.isString(aData[i])) {
+                aResults.unshift([aData[i]]);
+            }
+            else if(YAHOO.lang.isArray(aData[i])) {
+                aResults.unshift(aData[i]);
+            }
+        }
+    }
+    
+    this.getResultsEvent.fire(this, oParent, sQuery, aResults);
+    oCallbackFn(sQuery, aResults, oParent);
+};
+
+YAHOO.register("autocomplete", YAHOO.widget.AutoComplete, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/base/README b/lib/yui/base/README
new file mode 100755 (executable)
index 0000000..287f22e
--- /dev/null
@@ -0,0 +1,5 @@
+YUI Library - Base - Release Notes
+
+Version 2.3.0
+
+  * Initial release.
\ No newline at end of file
diff --git a/lib/yui/base/base-min.css b/lib/yui/base/base-min.css
new file mode 100755 (executable)
index 0000000..a4dcc81
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+h1{font-size:138.5%;}h2{font-size:123.1%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:bold;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style: decimal outside;}ul li{list-style: disc outside;}dl dd{margin-left:1em;}th,td {border:1px solid #000;padding:.5em;}th {font-weight:bold;text-align:center;}caption {margin-bottom:.5em;text-align:center;}p,fieldset,table {margin-bottom:1em;}
\ No newline at end of file
diff --git a/lib/yui/base/base.css b/lib/yui/base/base.css
new file mode 100755 (executable)
index 0000000..85dcca7
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* base.css, part of YUI's CSS Foundation */
+h1 {
+       /*18px via YUI Fonts CSS foundation*/
+       font-size:138.5%;  
+}
+h2 {
+       /*16px via YUI Fonts CSS foundation*/
+       font-size:123.1%; 
+}
+h3 {
+       /*14px via YUI Fonts CSS foundation*/
+       font-size:108%;  
+}
+h1,h2,h3 {
+       /* top & bottom margin based on font size */
+       margin:1em 0;
+}
+h1,h2,h3,h4,h5,h6,strong {
+       /*bringing boldness back to headers and the strong element*/
+       font-weight:bold; 
+}
+abbr,acronym {
+       /*indicating to users that more info is available */
+       border-bottom:1px dotted #000;
+       cursor:help;
+} 
+em {
+       /*bringing italics back to the em element*/
+       font-style:italic;
+}
+blockquote,ul,ol,dl {
+       /*giving blockquotes and lists room to breath*/
+       margin:1em;
+}
+ol,ul,dl {
+       /*bringing lists on to the page with breathing room */
+       margin-left:2em;
+}
+ol li {
+       /*giving OL's LIs generated numbers*/
+       list-style: decimal outside;    
+}
+ul li {
+       /*giving UL's LIs generated disc markers*/
+       list-style: disc outside;
+}
+dl dd {
+       /*giving UL's LIs generated numbers*/
+       margin-left:1em;
+}
+th,td {
+       /*borders and padding to make the table readable*/
+       border:1px solid #000;
+       padding:.5em;
+}
+th {
+       /*distinguishing table headers from data cells*/
+       font-weight:bold;
+       text-align:center;
+}
+caption {
+       /*coordinated marking to match cell's padding*/
+       margin-bottom:.5em;
+       /*centered so it doesn't blend in to other content*/
+       text-align:center;
+}
+p,fieldset,table {
+       /*so things don't run into each other*/
+       margin-bottom:1em;
+}
\ No newline at end of file
diff --git a/lib/yui/button/README b/lib/yui/button/README
new file mode 100755 (executable)
index 0000000..a0bcb58
--- /dev/null
@@ -0,0 +1,272 @@
+*** Version 2.3.0 ***
+
+Added the following features:
+-----------------------------
+
++ Added a "focusmenu" configuration attribute that controls whether or not a 
+  Button instance's menu will automatically be focused when made visible. 
+
++ Added a "lazyloadmenu" configuration attribute that controls the value of 
+  the "lazyload" configuration property of a Button's menu.
+
++ Added "menuclassname" configuration attribute that defines a CSS class name
+  to be applied to the root HTML element of a button's menu.
+
+
+Fixed the following bugs:
+-------------------------
+
++ Setting the "label" attribute of a Button of type "link" to a string with 
+  a "www." prefix will no longer result in the value of the "href" property 
+  being used for the "label" in IE.
+
++ Disabling a Button when its menu is visible will now result in the menu 
+  being hidden.
+
++ Hidden field(s) created by a Button instance are now removed if the 
+  submission of its parent form is cancelled.
+
++ If a Button instance is preceeded by another enabled HTML submit button 
+  (<input type="submit" ...> or <button type="submit" ...>), it will no longer 
+  create a hidden field representing its name and value when its parent form 
+  is submitted.
+
++ If an HTML form contains a mix of YUI Buttons of type "submit" and standard 
+  HTML submit buttons (<input type="submit" ...> or <button type="submit" ...>) 
+  its "submit" event will no longer fire twice when it is submitted by the user 
+  pressing the enter key while focus inside another HTML form control.
+
++ If all Button instances in a form are disabled, the form will no longer be 
+  submitted when the user presses the enter key while focused inside another 
+  HTML form control.
+
++ The first enabled Button instance in a form now correctly adds its name and 
+  value to the form's data set when the form is submitted by the user pressing 
+  the enter key while focused inside another form control.  
+
++ Fixed typo in the source file for the ButtonGroup class that was causing the 
+  private variable "m_oButtons" to be declared as a global.
+
++ Switched to use of the CSS display type "-moz-inline-box" from 
+  "-moz-inline-stack" for Gecko-based browsers so that the entire area of a 
+  Button instance is clickable when it is rendered inside another inline 
+  element.
+
++ Added "yui-button" and "yui-[button type]-button" prefix to CSS classes to 
+  sandbox Button styles.
+
+
+Changes:
+--------
+
++ Default value of "type" configuration attribute now "push" (was "button").
+
++ Type "menubutton" now "menu."
+
++ Type "splitbuton" now "split."
+
++ Added "addStateCSSClasses" method.
+
++ Added "removeStateCSSClasses" method.
+
++ Renamed protected property "_hiddenField" to "_hiddenFields."
+
++ Removed protected "submit" event handler named "_onFormSubmit."
+
++ Renamed public method "createHiddenField" to "createHiddenFields."
+
++ Added new "removeHiddenFields" method.
+
++ Renamed static method "YAHOO.widget.Button.onFormKeyDown" 
+  to "YAHOO.widget.Button.onFormKeyPress."
+
++ Renamed "TAG_NAME" constant (YAHOO.widget.Button.prototype.TAG_NAME and 
+  YAHOO.widget.ButtonGroup.prototype.TAG_NAME) to 
+  "NODE_NAME" (YAHOO.widget.Button.prototype.NODE_NAME and 
+  YAHOO.widget.ButtonGroup.prototype.NODE_NAME).
+
++ The "selectedMenuItem" configuration attribute now correctly gets/sets the 
+  index of the selected MenuItem instance of the button's menu, rather than a
+  MenuItem instance.
+
++ The "container" configuration attribute is now writeonce
+
++ The "menu" configuration attribute is now writeonce
+
++ The root element of each button's menu now will have two CSS classes 
+  appended to it:
+    - The CSS class name specified by the "menuclassname" configuration 
+      attribute (by default is "yui-button-menu")
+    - A type-specific class name (either "yui-split-button-menu" 
+      or "yui-menu-button-menu")
+
++ "menu" configuration attribute now supports creation or use of 
+  YAHOO.widget.Overlay in addition to previously supported 
+  YAHOO.widget.Menu:
+  
+       - To create a menu from existing markup using YAHOO.widget.Overlay, pass the
+         id or node reference of the HTML element to be used to create the Overlay 
+         as the value of the "menu" configuration attribute.
+
+    - YAHOO.widget.Overlay instances passed as a value for the "menu" 
+      configuration attribute need to be fully rendered.  
+
+       - To create a menu from existing markup using YAHOO.widget.Menu, pass the 
+         id or node reference of the HTML element to be used to create the menu 
+         as the value of the "menu" configuration attribute and give the 
+         HTML element the same class name as specified by 
+         YAHOO.widget.Menu.prototype.CSS_CLASS_NAME.
+       
+       - YAHOO.widget.Overlay instances used as a menu are by default not rendered 
+         until they are are made visible for the first time.  This behavior 
+         can be changed so that they are rendered immediately by setting the value 
+         of the "lazyloadmenu" configuration attribute to "false."
+
++ If you pass an element id for the value of the "menu" configuration 
+  attribute, that node is now accessed immediately via the "get" method of the 
+  Dom utility (YAHOO.util.Dom) as opposed to the "onContentReady" method of the
+  Event utility (YAHOO.util.Event).
+
++ Modified code to support a more generic markup format.  Now any number of 
+  HTML elements can exist between a Button's root HTML element and its button 
+  node (be it an <A> or <BUTTON> element):
+
+    <ROOT_NODE> ... <BUTTON_NODE /> ... </ROOT_NODE>
+
++ A Button can now be initialized using any of the following six HTML patterns:
+
+    - <A> TEXT/HTML </A>
+    - <BUTTON> TEXT/HTML </BUTTON>
+    - <INPUT />
+    - <ROOT_NODE> ... <A> TEXT/HTML </A> ... </ROOT_NODE>
+    - <ROOT_NODE> ... <BUTTON> TEXT/HTML </BUTTON> ... </ROOT_NODE>
+    - <ROOT_NODE> ... <INPUT /> ... </ROOT_NODE>
+
++ The id of a Button instance can now match that of its source element.
+
++ CSS changes:
+
+    1) All Buttons have a "yui-" prefix as opposed to "yui":
+    
+    2.2.2          | 2.3
+    -------------------------
+    .yuibutton  | .yui-button
+    
+    
+    2) Each Button type has its own class name with a "yui-" prefix and 
+    "-button" suffix IN ADDITION TO the default "yui-button" class name:
+    
+    2.2.2                      | 2.3
+    ------------------------------------------
+    .yuibutton.splitbutton     | .yui-split-button
+    .yuibutton.menubutton      | .yui-menu-button
+    
+    * Allows for the definition of generic styles that apply to all buttons, 
+    while providing a means for uniquely styling buttons of a specific type.
+    
+    
+    3) For states that are common to all Buttons, two classes are applied: a
+    generic class name (i.e. yui-button-[state]) and a type-specific state class
+    name (yui-[type]-button-[state]):
+    
+    2.2.2                      | 2.3
+    -------------------------------------------
+    .yuibutton.focus   | .yui-button-focus
+    .yuibutton.radio.focus     | .yui-radio-button-focus
+    
+    * States common to all Button types are:
+        + focus
+        + hover
+        + active
+        + disabled
+    
+    ** Allows for the definition of generic styles that apply to all states of 
+    all buttons, while providing a means for uniquely styling states for 
+    buttons of a specific type.
+    
+    
+    4) Buttons of type "radio" and "checkbox" have two classes applied to 
+    represent their "checked" state: a generic class name 
+    (i.e. yui-button-checked) and a type-specific class 
+    name (yui-[type]-button-checked):
+    
+    2.2.2                          | 2.3
+    -------------------------------------------
+    .yuibutton.checked     | .yui-button-checked
+    .yuibutton.radio.checked    | .yui-radio-button-checked
+    .yuibutton.checkbox.checked | .yui-checkbox-button-checked
+    
+    ** This allows for the definition of a universal style for all Buttons that
+    have a "checked" state or the ability to define a type-specific style for 
+    the "checked" state.
+    
+    
+    5) States that are specific to a particular type only get a type-specific 
+    state class name.  Currently this only applies to the "splitbutton" type:
+    
+    2.2.2                          | 2.3
+    -------------------------------------------
+    .yuibutton.activeoption     | .yui-split-button-activeoption
+    
+    
+    6) The "ie6" class name is removed.
+
+
+*** Version 2.2.2 ***
+
++ No changes
+
+
+*** Version 2.2.1 ***
+
+Added the following features:
+-----------------------------
+
++ Added "getHiddenField" method to YAHOO.widget.Button.
+
+
+Fixed the following bugs:
+-------------------------
+
++ Removed built-in use of the Event utility's "onAvailable" method from the
+  constructor of Button and ButtonGroup as it was preventing the addition of 
+  event listeners on instances created from existing markup.  Going forward 
+  Button and ButtonGroup instances created from existing markup can only be 
+  instantiated once their source HTML element is available in the DOM.  The 
+  Button examples illustrate how this can be accomplished.
+
++ Modified code so that disabled Button instances no longer fire DOM events.
+
++ Pressing the enter key while focused on a form field whose parent form 
+  contains a Button instance of type "submit" will now automatically submit 
+  the form using the first Button instance of type "submit".
+
++ Clicking a Button instance of type="submit" will now cause the Button's 
+  parent form's "submit" event to fire.
+
++ Modified Button CSS so that the filter used to apply alpha transparency to 
+  a Button's background PNG is only used by IE 6.  The previous code was 
+  enabling IE's Alpha image loader for IE 7 in Quirks mode. 
+
++ Fixed documentation error for "getForm" method.  
+
+
+Changes:
+--------
+
++ Made the "submitForm" method of YAHOO.widget.Button public (was 
+  previously protected).  
+
++ Removed "init" event and corresponding "oninit" configuration attribute
+  from YAHOO.widget.Button and YAHOO.widget.ButtonGroup.
+
++ Added the CSS class "ie6" to button.css.  This classname is append to root 
+  DOM element of Button instances created with IE 6.  By default this class
+  is used to apply a filter that gives alpha transparency to a Button's 
+  background PNG.
+
+
+
+*** Version 2.2.0 ***
+
+* Button Control introduced
diff --git a/lib/yui/button/assets/background.png b/lib/yui/button/assets/background.png
new file mode 100755 (executable)
index 0000000..32a72e4
Binary files /dev/null and b/lib/yui/button/assets/background.png differ
diff --git a/lib/yui/button/assets/button-core.css b/lib/yui/button/assets/button-core.css
new file mode 100755 (executable)
index 0000000..5aa3015
--- /dev/null
@@ -0,0 +1,6 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
diff --git a/lib/yui/button/assets/button.css b/lib/yui/button/assets/button.css
new file mode 100755 (executable)
index 0000000..fcdcfa2
--- /dev/null
@@ -0,0 +1,215 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-button  {
+
+    display:-moz-inline-box; /* Gecko */
+    display:inline-block; /* IE, Opera and Safari */
+    border-width:1px 0;
+    border-style:solid;
+    border-color:#999;
+    background:#ecece3 url(background.png) left center;
+    margin:auto .25em;
+    
+}
+
+.yui-button.ie6 {
+
+    /* Give the transparent background image to IE 6 */
+    background-image:none;
+    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/button/assets/background.png', sizingMethod = 'scale');
+
+}
+
+.yui-button .first-child {
+
+    display:block;
+    *display:inline-block; /* IE */
+    border-width:0 1px;
+    border-style:solid;
+    border-color:#999;
+    margin:0 -1px;
+    *position:relative;
+    *left:-1px;
+
+}
+
+.yui-button button,
+.yui-button a {
+
+    display:block;
+    *display:inline-block; /* IE */
+    padding:.25em .5em;
+    border:1px solid #ccc;
+
+}
+
+.yui-button button {
+
+    *overflow:visible; /* Remove superfluous padding for IE */
+    font-size:100%; /* Makes form controls resizable in IE */
+    background-color:transparent;
+    cursor:pointer;
+    cursor:hand;
+
+}
+
+.yui-button a {
+
+    text-decoration:none;
+    color:#000;           
+
+}
+
+.yui-split-button button,
+.yui-menu-button button {
+
+    padding-right:20px;
+    background-position:right center;
+    background-repeat:no-repeat;
+    
+}
+
+.yui-menu-button button {
+
+    background-image:url(menuarrow.gif);
+
+}
+
+.yui-split-button button {
+
+    background-image:url(splitarrow.gif);
+
+}
+
+
+/* Focus state */
+
+.yui-button-focus {
+
+    border-color:#5e5c95;
+
+}
+
+.yui-button-focus .first-child {
+
+    border-color:#5e5c95;
+
+}
+
+.yui-button-focus button, 
+.yui-button-focus a {
+
+    border-color:#cec1fc;
+
+}
+
+
+/* Hover state */
+
+.yui-button-hover {
+
+    border-color:#406fac;
+    background-color:#98d5fc;
+
+}
+
+.yui-button-hover .first-child {
+
+    border-color:#406fac;
+
+}
+
+.yui-button-hover button, 
+.yui-button-hover a {
+
+    border-color:#7099ce;
+
+}
+
+
+/* Active state */
+
+.yui-button-active {
+    
+    border-color:#7a8180;
+    background-color:#333;
+    
+}
+
+.yui-button-active .first-child {
+
+    border-color:#7a8180;
+
+}
+
+.yui-button-active button, 
+.yui-button-active a {
+
+    border-color:#98a09f;
+
+}
+
+.yui-split-button-activeoption button {
+
+    background-color:transparent;
+    background-image:url(splitarrow_active.gif);
+    
+}
+
+
+
+/* Checked state */
+
+.yui-radio-button-checked,
+.yui-checkbox-button-checked {
+    
+    border-color:#7a8180;
+    background-color:#333;
+    
+}
+
+.yui-radio-button-checked .first-child,
+.yui-checkbox-button-checked .first-child {
+
+    border-color:#7a8180;
+
+}
+
+.yui-radio-button-checked button,
+.yui-checkbox-button-checked button { 
+
+    border-color:#98a09f;
+
+}
+
+
+
+/* Disabled state */
+
+.yui-button-disabled {
+    
+    border-color:#cbcdc5;
+    background:#ecece3;
+
+    filter:none;
+    
+}
+
+.yui-button-disabled .first-child {
+
+    border-color:#cbcdc5;
+
+}
+
+.yui-button-disabled button, 
+.yui-button-disabled a {
+
+    border-color:transparent;
+    color:#b9b9b9;
+    cursor:default;
+
+}
\ No newline at end of file
diff --git a/lib/yui/button/assets/menuarrow.gif b/lib/yui/button/assets/menuarrow.gif
new file mode 100755 (executable)
index 0000000..ffa2ba9
Binary files /dev/null and b/lib/yui/button/assets/menuarrow.gif differ
diff --git a/lib/yui/button/assets/skins/sam/button-skin.css b/lib/yui/button/assets/skins/sam/button-skin.css
new file mode 100755 (executable)
index 0000000..e8f8011
--- /dev/null
@@ -0,0 +1,245 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-skin-sam .yui-button  {
+
+    display: -moz-inline-box; /* Gecko */
+    display: inline-block; /* IE, Opera and Safari */
+    border-width: 1px 0;
+    border-style: solid;
+    border-color: #808080;
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;
+    margin: auto .25em;
+    
+}
+
+.yui-skin-sam .yui-button .first-child {
+
+    display: block;
+    *display: inline-block; /* IE */
+    border-width: 0 1px;
+    border-style: solid;
+    border-color: #808080;
+    margin: 0 -1px;
+    *position: relative;
+    *left: -1px;
+
+}
+
+.yui-skin-sam .yui-button button,
+.yui-skin-sam .yui-button a {
+
+    display: block;
+    *display: inline-block; /* IE */
+    padding: 0 10px;
+    border: none;
+    font-size: 93%;  /* 12px */
+    line-height: 2;  /* ~24px */
+    *line-height: 1.7; /* For IE */
+    min-height: 2em; /* For Gecko */
+    *min-height: auto; /* For IE */
+    color: #000; 
+
+}
+
+.yui-skin-sam .yui-button button {
+
+    *overflow: visible; /* Remove superfluous padding for IE */
+    background-color: transparent;
+    cursor: pointer;
+    cursor: hand;
+
+}
+
+.yui-skin-sam .yui-button a {
+
+    text-decoration: none;
+
+}
+
+
+.yui-skin-sam .yui-split-button button,
+.yui-skin-sam .yui-menu-button button {
+
+    padding-right: 20px;
+    background-position: right center;
+    background-repeat: no-repeat;
+    
+}
+
+.yui-skin-sam .yui-menu-button button {
+
+    background-image: url(menu-button-arrow.png);
+
+}
+
+.yui-skin-sam .yui-split-button button {
+
+    background-image: url(split-button-arrow.png);
+
+}
+
+
+/* Focus state */
+
+
+.yui-skin-sam .yui-button-focus {
+
+    border-color: #7D98B8;
+    background-position: 0 -1300px;
+
+}
+
+.yui-skin-sam .yui-button-focus .first-child {
+
+    border-color: #7D98B8;
+
+}
+
+.yui-skin-sam .yui-button-focus button, 
+.yui-skin-sam .yui-button-focus a {
+
+    color: #000;
+
+}
+
+.yui-skin-sam .yui-split-button-focus button {
+
+    background-image: url(split-button-arrow-focus.png);
+
+}
+
+
+/* Hover state */
+
+.yui-skin-sam .yui-button-hover {
+
+    border-color: #7D98B8;
+    background-position: 0 -1300px;
+
+}
+
+.yui-skin-sam .yui-button-hover .first-child {
+
+    border-color: #7D98B8;
+
+}
+
+.yui-skin-sam .yui-button-hover button, 
+.yui-skin-sam .yui-button-hover a {
+
+    color: #000;
+
+}
+
+.yui-skin-sam .yui-split-button-hover button {
+
+    background-image: url(split-button-arrow-hover.png);
+
+}
+
+
+/* Active state */
+
+.yui-skin-sam .yui-button-active {
+    
+    border-color: #7D98B8;
+    background-position: 0 -1700px;
+    
+}
+
+.yui-skin-sam .yui-button-active .first-child {
+
+    border-color: #7D98B8;
+
+}
+
+.yui-skin-sam .yui-button-active button, 
+.yui-skin-sam .yui-button-active a {
+
+    color: #000;
+
+}
+
+.yui-skin-sam .yui-split-button-activeoption {
+
+    border-color: #808080;
+    background-position: 0 0;
+
+}
+
+.yui-skin-sam .yui-split-button-activeoption .first-child {
+
+    border-color: #808080;
+
+}
+
+.yui-skin-sam .yui-split-button-activeoption button {
+
+    background-image: url(split-button-arrow-active.png);
+
+}
+
+
+/* Checked state */
+
+.yui-skin-sam .yui-radio-button-checked,
+.yui-skin-sam .yui-checkbox-button-checked {
+    
+    border-color: #304369;
+    background-position: 0 -1400px;
+    
+}
+
+.yui-skin-sam .yui-radio-button-checked .first-child,
+.yui-skin-sam .yui-checkbox-button-checked .first-child {
+
+    border-color: #304369;
+
+}
+
+.yui-skin-sam .yui-radio-button-checked button,
+.yui-skin-sam .yui-checkbox-button-checked button { 
+
+    color: #fff;
+
+}
+
+
+/* Disabled state */
+
+.yui-skin-sam .yui-button-disabled {
+    
+    border-color: #ccc;
+    background-position: 0 -1500px;
+    
+}
+
+.yui-skin-sam .yui-button-disabled .first-child {
+
+    border-color: #ccc;
+
+}
+
+.yui-skin-sam .yui-button-disabled button, 
+.yui-skin-sam .yui-button-disabled a {
+
+    color: #A6A6A6;
+    cursor: default;
+
+}
+
+.yui-skin-sam .yui-menu-button-disabled button {
+
+    background-image: url(menu-button-arrow-disabled.png);
+    
+}
+
+.yui-skin-sam .yui-split-button-disabled button {
+
+    background-image: url(split-button-arrow-disabled.png);
+    
+}
\ No newline at end of file
diff --git a/lib/yui/button/assets/skins/sam/button.css b/lib/yui/button/assets/skins/sam/button.css
new file mode 100755 (executable)
index 0000000..0de5e6e
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-skin-sam .yui-button{display:-moz-inline-box;display:inline-block;border-width:1px 0;border-style:solid;border-color:#808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{display:block;*display:inline-block;border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;*position:relative;*left:-1px;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a{display:block;*display:inline-block;padding:0 10px;border:none;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button button{*overflow:visible;background-color:transparent;cursor:pointer;cursor:hand;}.yui-skin-sam .yui-button a{text-decoration:none;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-focus button,.yui-skin-sam .yui-button-focus a{color:#000;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-hover button,.yui-skin-sam .yui-button-hover a{color:#000;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-active button,.yui-skin-sam .yui-button-active a{color:#000;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);}
diff --git a/lib/yui/button/assets/skins/sam/menu-button-arrow-disabled.png b/lib/yui/button/assets/skins/sam/menu-button-arrow-disabled.png
new file mode 100755 (executable)
index 0000000..8cef2ab
Binary files /dev/null and b/lib/yui/button/assets/skins/sam/menu-button-arrow-disabled.png differ
diff --git a/lib/yui/button/assets/skins/sam/menu-button-arrow.png b/lib/yui/button/assets/skins/sam/menu-button-arrow.png
new file mode 100755 (executable)
index 0000000..f03dfee
Binary files /dev/null and b/lib/yui/button/assets/skins/sam/menu-button-arrow.png differ
diff --git a/lib/yui/button/assets/skins/sam/split-button-arrow-active.png b/lib/yui/button/assets/skins/sam/split-button-arrow-active.png
new file mode 100755 (executable)
index 0000000..fa58c50
Binary files /dev/null and b/lib/yui/button/assets/skins/sam/split-button-arrow-active.png differ
diff --git a/lib/yui/button/assets/skins/sam/split-button-arrow-disabled.png b/lib/yui/button/assets/skins/sam/split-button-arrow-disabled.png
new file mode 100755 (executable)
index 0000000..0a6a82c
Binary files /dev/null and b/lib/yui/button/assets/skins/sam/split-button-arrow-disabled.png differ
diff --git a/lib/yui/button/assets/skins/sam/split-button-arrow-focus.png b/lib/yui/button/assets/skins/sam/split-button-arrow-focus.png
new file mode 100755 (executable)
index 0000000..167d71e
Binary files /dev/null and b/lib/yui/button/assets/skins/sam/split-button-arrow-focus.png differ
diff --git a/lib/yui/button/assets/skins/sam/split-button-arrow-hover.png b/lib/yui/button/assets/skins/sam/split-button-arrow-hover.png
new file mode 100755 (executable)
index 0000000..167d71e
Binary files /dev/null and b/lib/yui/button/assets/skins/sam/split-button-arrow-hover.png differ
diff --git a/lib/yui/button/assets/skins/sam/split-button-arrow.png b/lib/yui/button/assets/skins/sam/split-button-arrow.png
new file mode 100755 (executable)
index 0000000..b33a93f
Binary files /dev/null and b/lib/yui/button/assets/skins/sam/split-button-arrow.png differ
diff --git a/lib/yui/button/assets/splitarrow.gif b/lib/yui/button/assets/splitarrow.gif
new file mode 100755 (executable)
index 0000000..6d1ce65
Binary files /dev/null and b/lib/yui/button/assets/splitarrow.gif differ
diff --git a/lib/yui/button/assets/splitarrow_active.gif b/lib/yui/button/assets/splitarrow_active.gif
new file mode 100755 (executable)
index 0000000..25c0884
Binary files /dev/null and b/lib/yui/button/assets/splitarrow_active.gif differ
diff --git a/lib/yui/button/button-beta-debug.js b/lib/yui/button/button-beta-debug.js
new file mode 100755 (executable)
index 0000000..c9dfa28
--- /dev/null
@@ -0,0 +1,4554 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+* @module button
+* @description <p>The Button Control enables the creation of rich, graphical 
+* buttons that function like traditional HTML form buttons.  <em>Unlike</em> 
+* tradition HTML form buttons, buttons created with the Button Control can have 
+* a label that is different from its value.  With the inclusion of the optional 
+* <a href="module_menu.html">Menu Control</a>, the Button Control can also be
+* used to create menu buttons and split buttons, controls that are not 
+* available natively in HTML.  The Button Control can also be thought of as a 
+* way to create more visually engaging implementations of the browser's 
+* default radio-button and check-box controls.</p>
+* <p>The Button Control supports the following types:</p>
+* <dl>
+* <dt>push</dt>
+* <dd>Basic push button that can execute a user-specified command when 
+* pressed.</dd>
+* <dt>link</dt>
+* <dd>Navigates to a specified url when pressed.</dd>
+* <dt>submit</dt>
+* <dd>Submits the parent form when pressed.</dd>
+* <dt>reset</dt>
+* <dd>Resets the parent form when pressed.</dd>
+* <dt>checkbox</dt>
+* <dd>Maintains a "checked" state that can be toggled on and off.</dd>
+* <dt>radio</dt>
+* <dd>Maintains a "checked" state that can be toggled on and off.  Use with 
+* the ButtonGroup class to create a set of controls that are mutually 
+* exclusive; checking one button in the set will uncheck all others in 
+* the group.</dd>
+* <dt>menu</dt>
+* <dd>When pressed will show/hide a menu.</dd>
+* <dt>split</dt>
+* <dd>Can execute a user-specified command or display a menu when pressed.</dd>
+* </dl>
+* @title Button
+* @namespace YAHOO.widget
+* @requires yahoo, dom, element, event
+* @optional container, menu
+* @beta
+*/
+
+
+(function () {
+
+
+    /**
+    * The Button class creates a rich, graphical button.
+    * @param {String} p_oElement String specifying the id attribute of the 
+    * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>,
+    * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to 
+    * be used to create the button.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org
+    * /TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-34812697">
+    * HTMLButtonElement</a>|<a href="
+    * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#
+    * ID-33759296">HTMLElement</a>} p_oElement Object reference for the 
+    * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>, 
+    * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to be 
+    * used to create the button.
+    * @param {Object} p_oElement Object literal specifying a set of   
+    * configuration attributes used to create the button.
+    * @param {Object} p_oAttributes Optional. Object literal specifying a set  
+    * of configuration attributes used to create the button.
+    * @namespace YAHOO.widget
+    * @class Button
+    * @constructor
+    * @extends YAHOO.util.Element
+    */
+
+
+
+    // Shorthard for utilities
+
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang,
+        Overlay = YAHOO.widget.Overlay,
+        Menu = YAHOO.widget.Menu,
+    
+    
+        // Private member variables
+    
+        m_oButtons = {},    // Collection of all Button instances
+        m_oOverlayManager = null,   // YAHOO.widget.OverlayManager instance
+        m_oSubmitTrigger = null,    // The button that submitted the form 
+        m_oFocusedButton = null;    // The button that has focus
+
+
+
+    // Private methods
+
+    
+    
+    /**
+    * @method createInputElement
+    * @description Creates an <code>&#60;input&#62;</code> element of the 
+    * specified type.
+    * @private
+    * @param {String} p_sType String specifying the type of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_sName String specifying the name of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_sValue String specifying the value of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_bChecked Boolean specifying if the  
+    * <code>&#60;input&#62;</code> element is to be checked.
+    * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>}
+    */
+    function createInputElement(p_sType, p_sName, p_sValue, p_bChecked) {
+    
+        var oInput,
+            sInput;
+    
+        if (Lang.isString(p_sType) && Lang.isString(p_sName)) {
+        
+            if (YAHOO.env.ua.ie) {
+        
+                /*
+                    For IE it is necessary to create the element with the 
+                    "type," "name," "value," and "checked" properties set all 
+                    at once.
+                */
+            
+                sInput = "<input type=\"" + p_sType + "\" name=\"" + 
+                    p_sName + "\"";
+        
+                if (p_bChecked) {
+        
+                    sInput += " checked";
+                
+                }
+                
+                sInput += ">";
+        
+                oInput = document.createElement(sInput);
+        
+            }
+            else {
+            
+                oInput = document.createElement("input");
+                oInput.name = p_sName;
+                oInput.type = p_sType;
+        
+                if (p_bChecked) {
+        
+                    oInput.checked = true;
+                
+                }
+        
+            }
+        
+            oInput.value = p_sValue;
+            
+            return oInput;
+        
+        }
+    
+    }
+    
+    
+    /**
+    * @method setAttributesFromSrcElement
+    * @description Gets the values for all the attributes of the source element 
+    * (either <code>&#60;input&#62;</code> or <code>&#60;a&#62;</code>) that 
+    * map to Button configuration attributes and sets them into a collection 
+    * that is passed to the Button constructor.
+    * @private
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org/
+    * TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-
+    * 48250443">HTMLAnchorElement</a>} p_oElement Object reference to the HTML 
+    * element (either <code>&#60;input&#62;</code> or <code>&#60;span&#62;
+    * </code>) used to create the button.
+    * @param {Object} p_oAttributes Object reference for the collection of 
+    * configuration attributes used to create the button.
+    */
+    function setAttributesFromSrcElement(p_oElement, p_oAttributes) {
+    
+        var sSrcElementNodeName = p_oElement.nodeName.toUpperCase(),
+            me = this,
+            oAttribute,
+            oRootNode,
+            sText;
+            
+    
+        /**
+        * @method setAttributeFromDOMAttribute
+        * @description Gets the value of the specified DOM attribute and sets it 
+        * into the collection of configuration attributes used to configure 
+        * the button.
+        * @private
+        * @param {String} p_sAttribute String representing the name of the 
+        * attribute to retrieve from the DOM element.
+        */
+        function setAttributeFromDOMAttribute(p_sAttribute) {
+    
+            if ( !(p_sAttribute in p_oAttributes) ) {
+    
+                /*
+                    Need to use "getAttributeNode" instead of "getAttribute" 
+                    because using "getAttribute," IE will return the innerText 
+                    of a <code>&#60;button&#62;</code> for the value attribute  
+                    rather than the value of the "value" attribute.
+                */
+        
+                oAttribute = p_oElement.getAttributeNode(p_sAttribute);
+        
+    
+                if (oAttribute && ("value" in oAttribute)) {
+    
+                    me.logger.log("Setting attribute \"" + p_sAttribute + 
+                        "\" using source element's attribute value of \"" + 
+                        oAttribute.value + "\"");
+    
+                    p_oAttributes[p_sAttribute] = oAttribute.value;
+    
+                }
+    
+            }
+        
+        }
+    
+    
+        /**
+        * @method setFormElementProperties
+        * @description Gets the value of the attributes from the form element  
+        * and sets them into the collection of configuration attributes used to 
+        * configure the button.
+        * @private
+        */
+        function setFormElementProperties() {
+    
+            setAttributeFromDOMAttribute("type");
+    
+            if (p_oAttributes.type == "button") {
+            
+                p_oAttributes.type = "push";
+            
+            }
+    
+            if ( !("disabled" in p_oAttributes) ) {
+    
+                p_oAttributes.disabled = p_oElement.disabled;
+    
+            }
+    
+            setAttributeFromDOMAttribute("name");
+            setAttributeFromDOMAttribute("value");
+            setAttributeFromDOMAttribute("title");
+    
+        }
+
+    
+        switch (sSrcElementNodeName) {
+        
+        case "A":
+            
+            p_oAttributes.type = "link";
+            
+            setAttributeFromDOMAttribute("href");
+            setAttributeFromDOMAttribute("target");
+        
+            break;
+    
+        case "INPUT":
+
+            setFormElementProperties();
+
+            if ( !("checked" in p_oAttributes) ) {
+    
+                p_oAttributes.checked = p_oElement.checked;
+    
+            }
+
+            break;
+
+        case "BUTTON":
+
+            setFormElementProperties();
+
+            oRootNode = p_oElement.parentNode.parentNode;
+
+            if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-checked")) {
+            
+                p_oAttributes.checked = true;
+            
+            }
+
+            if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-disabled")) {
+
+                p_oAttributes.disabled = true;
+            
+            }
+
+            p_oElement.removeAttribute("value");
+
+            p_oElement.setAttribute("type", "button");
+
+            break;
+        
+        }
+
+        p_oElement.removeAttribute("id");
+        p_oElement.removeAttribute("name");
+        
+        if ( !("tabindex" in p_oAttributes) ) {
+
+            p_oAttributes.tabindex = p_oElement.tabIndex;
+
+        }
+    
+        if ( !("label" in p_oAttributes) ) {
+    
+            // Set the "label" property
+        
+            sText = sSrcElementNodeName == "INPUT" ? 
+                            p_oElement.value : p_oElement.innerHTML;
+        
+    
+            if (sText && sText.length > 0) {
+                
+                p_oAttributes.label = sText;
+                
+            } 
+    
+        }
+    
+    }
+    
+    
+    /**
+    * @method initConfig
+    * @description Initializes the set of configuration attributes that are 
+    * used to instantiate the button.
+    * @private
+    * @param {Object} Object representing the button's set of 
+    * configuration attributes.
+    */
+    function initConfig(p_oConfig) {
+    
+        var oAttributes = p_oConfig.attributes,
+            oSrcElement = oAttributes.srcelement,
+            sSrcElementNodeName = oSrcElement.nodeName.toUpperCase(),
+            me = this;
+    
+    
+        if (sSrcElementNodeName == this.NODE_NAME) {
+    
+            p_oConfig.element = oSrcElement;
+            p_oConfig.id = oSrcElement.id;
+
+            Dom.getElementsBy(function (p_oElement) {
+            
+                switch (p_oElement.nodeName.toUpperCase()) {
+                
+                case "BUTTON":
+                case "A":
+                case "INPUT":
+
+                    setAttributesFromSrcElement.call(me, p_oElement, 
+                        oAttributes);
+
+                    break;                        
+                
+                }
+            
+            }, "*", oSrcElement);
+        
+        }
+        else {
+    
+            switch (sSrcElementNodeName) {
+
+            case "BUTTON":
+            case "A":
+            case "INPUT":
+
+                setAttributesFromSrcElement.call(this, oSrcElement, 
+                    oAttributes);
+
+                break;
+
+            }
+        
+        }
+    
+    }
+
+
+
+    //  Constructor
+
+    YAHOO.widget.Button = function (p_oElement, p_oAttributes) {
+    
+        var fnSuperClass = YAHOO.widget.Button.superclass.constructor,
+            oConfig,
+            oElement;
+    
+        if (arguments.length == 1 && !Lang.isString(p_oElement) && 
+            !p_oElement.nodeName) {
+    
+            if (!p_oElement.id) {
+    
+                p_oElement.id = Dom.generateId();
+    
+                YAHOO.log("No value specified for the button's \"id\" " + 
+                    "attribute. Setting button id to \"" + p_oElement.id + 
+                    "\".", "warn");
+    
+            }
+    
+            this.logger = new YAHOO.widget.LogWriter("Button " + p_oElement.id);
+    
+            this.logger.log("No source HTML element.  Building the button " +
+                    "using the set of configuration attributes.");
+    
+            fnSuperClass.call(this, 
+                (this.createButtonElement(p_oElement.type)),
+                p_oElement);
+    
+        }
+        else {
+    
+            oConfig = { element: null, attributes: (p_oAttributes || {}) };
+    
+    
+            if (Lang.isString(p_oElement)) {
+    
+                oElement = Dom.get(p_oElement);
+    
+                if (oElement) {
+
+                    if (!oConfig.attributes.id) {
+                    
+                        oConfig.attributes.id = p_oElement;
+                    
+                    }
+    
+                    this.logger = new YAHOO.widget.LogWriter(
+                                        "Button " + oConfig.attributes.id);
+                
+                    this.logger.log("Building the button using an existing " + 
+                            "HTML element as a source element.");
+                
+                
+                    oConfig.attributes.srcelement = oElement;
+                
+                    initConfig.call(this, oConfig);
+                
+                
+                    if (!oConfig.element) {
+                
+                        this.logger.log("Source element could not be used " +
+                                "as is.  Creating a new HTML element for " + 
+                                "the button.");
+                
+                        oConfig.element = 
+                            this.createButtonElement(oConfig.attributes.type);
+                
+                    }
+                
+                    fnSuperClass.call(this, oConfig.element, 
+                        oConfig.attributes);
+    
+                }
+    
+            }
+            else if (p_oElement.nodeName) {
+    
+                if (!oConfig.attributes.id) {
+    
+                    if (p_oElement.id) {
+        
+                        oConfig.attributes.id = p_oElement.id;
+                    
+                    }
+                    else {
+        
+                        oConfig.attributes.id = Dom.generateId();
+        
+                        YAHOO.log("No value specified for the button's " +
+                            "\"id\" attribute. Setting button id to \"" + 
+                            oConfig.attributes.id + "\".", "warn");
+        
+                    }
+    
+                }
+    
+    
+                this.logger = new YAHOO.widget.LogWriter(
+                    "Button " + oConfig.attributes.id);
+    
+                this.logger.log("Building the button using an existing HTML " + 
+                    "element as a source element.");
+    
+    
+                oConfig.attributes.srcelement = p_oElement;
+        
+                initConfig.call(this, oConfig);
+        
+        
+                if (!oConfig.element) {
+    
+                    this.logger.log("Source element could not be used as is." +
+                            "  Creating a new HTML element for the button.");
+            
+                    oConfig.element = 
+                        this.createButtonElement(oConfig.attributes.type);
+            
+                }
+            
+                fnSuperClass.call(this, oConfig.element, oConfig.attributes);
+            
+            }
+    
+        }
+    
+    };
+
+
+
+    YAHOO.extend(YAHOO.widget.Button, YAHOO.util.Element, {
+    
+    
+        // Protected properties
+        
+        
+        /** 
+        * @property _button
+        * @description Object reference to the button's internal 
+        * <code>&#60;a&#62;</code> or <code>&#60;button&#62;</code> element.
+        * @default null
+        * @protected
+        * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-48250443">HTMLAnchorElement</a>|<a href="
+        * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html
+        * #ID-34812697">HTMLButtonElement</a>
+        */
+        _button: null,
+        
+        
+        /** 
+        * @property _menu
+        * @description Object reference to the button's menu.
+        * @default null
+        * @protected
+        * @type {<a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>|
+        * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>}
+        */
+        _menu: null,
+        
+        
+        /** 
+        * @property _hiddenFields
+        * @description Object reference to the <code>&#60;input&#62;</code>  
+        * element, or array of HTML form elements used to represent the button
+        *  when its parent form is submitted.
+        * @default null
+        * @protected
+        * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array
+        */
+        _hiddenFields: null,
+        
+        
+        /** 
+        * @property _onclickAttributeValue
+        * @description Object reference to the button's current value for the 
+        * "onclick" configuration attribute.
+        * @default null
+        * @protected
+        * @type Object
+        */
+        _onclickAttributeValue: null,
+        
+        
+        /** 
+        * @property _activationKeyPressed
+        * @description Boolean indicating if the key(s) that toggle the button's 
+        * "active" state have been pressed.
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _activationKeyPressed: false,
+        
+        
+        /** 
+        * @property _activationButtonPressed
+        * @description Boolean indicating if the mouse button that toggles 
+        * the button's "active" state has been pressed.
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _activationButtonPressed: false,
+        
+        
+        /** 
+        * @property _hasKeyEventHandlers
+        * @description Boolean indicating if the button's "blur", "keydown" and 
+        * "keyup" event handlers are assigned
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _hasKeyEventHandlers: false,
+        
+        
+        /** 
+        * @property _hasMouseEventHandlers
+        * @description Boolean indicating if the button's "mouseout," 
+        * "mousedown," and "mouseup" event handlers are assigned
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _hasMouseEventHandlers: false,
+        
+        
+        
+        // Constants
+        
+        
+        /**
+        * @property NODE_NAME
+        * @description The name of the node to be used for the button's 
+        * root element.
+        * @default "SPAN"
+        * @final
+        * @type String
+        */
+        NODE_NAME: "SPAN",
+        
+        
+        /**
+        * @property CHECK_ACTIVATION_KEYS
+        * @description Array of numbers representing keys that (when pressed) 
+        * toggle the button's "checked" attribute.
+        * @default [32]
+        * @final
+        * @type Array
+        */
+        CHECK_ACTIVATION_KEYS: [32],
+        
+        
+        /**
+        * @property ACTIVATION_KEYS
+        * @description Array of numbers representing keys that (when presed) 
+        * toggle the button's "active" state.
+        * @default [13, 32]
+        * @final
+        * @type Array
+        */
+        ACTIVATION_KEYS: [13, 32],
+        
+        
+        /**
+        * @property OPTION_AREA_WIDTH
+        * @description Width (in pixels) of the area of a split button that  
+        * when pressed will display a menu.
+        * @default 20
+        * @final
+        * @type Number
+        */
+        OPTION_AREA_WIDTH: 20,
+        
+        
+        /**
+        * @property CSS_CLASS_NAME
+        * @description String representing the CSS class(es) to be applied to  
+        * the button's root element.
+        * @default "yui-button"
+        * @final
+        * @type String
+        */
+        CSS_CLASS_NAME: "yui-button",
+        
+        
+        /**
+        * @property RADIO_DEFAULT_TITLE
+        * @description String representing the default title applied to buttons 
+        * of type "radio." 
+        * @default "Unchecked.  Click to check."
+        * @final
+        * @type String
+        */
+        RADIO_DEFAULT_TITLE: "Unchecked.  Click to check.",
+        
+        
+        /**
+        * @property RADIO_CHECKED_TITLE
+        * @description String representing the title applied to buttons of 
+        * type "radio" when checked.
+        * @default "Checked.  Click to uncheck."
+        * @final
+        * @type String
+        */
+        RADIO_CHECKED_TITLE: "Checked.  Click to uncheck.",
+        
+        
+        /**
+        * @property CHECKBOX_DEFAULT_TITLE
+        * @description String representing the default title applied to 
+        * buttons of type "checkbox." 
+        * @default "Unchecked.  Click to check."
+        * @final
+        * @type String
+        */
+        CHECKBOX_DEFAULT_TITLE: "Unchecked.  Click to check.",
+        
+        
+        /**
+        * @property CHECKBOX_CHECKED_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "checkbox" when checked.
+        * @default "Checked.  Click to uncheck."
+        * @final
+        * @type String
+        */
+        CHECKBOX_CHECKED_TITLE: "Checked.  Click to uncheck.",
+        
+        
+        /**
+        * @property MENUBUTTON_DEFAULT_TITLE
+        * @description String representing the default title applied to 
+        * buttons of type "menu." 
+        * @default "Menu collapsed.  Click to expand."
+        * @final
+        * @type String
+        */
+        MENUBUTTON_DEFAULT_TITLE: "Menu collapsed.  Click to expand.",
+        
+        
+        /**
+        * @property MENUBUTTON_MENU_VISIBLE_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "menu" when the button's menu is visible. 
+        * @default "Menu expanded.  Click or press Esc to collapse."
+        * @final
+        * @type String
+        */
+        MENUBUTTON_MENU_VISIBLE_TITLE: 
+            "Menu expanded.  Click or press Esc to collapse.",
+        
+        
+        /**
+        * @property SPLITBUTTON_DEFAULT_TITLE
+        * @description  String representing the default title applied to 
+        * buttons of type "split." 
+        * @default "Menu collapsed.  Click inside option region or press 
+        * Ctrl + Shift + M to show the menu."
+        * @final
+        * @type String
+        */
+        SPLITBUTTON_DEFAULT_TITLE: ("Menu collapsed.  Click inside option " + 
+            "region or press Ctrl + Shift + M to show the menu."),
+        
+        
+        /**
+        * @property SPLITBUTTON_OPTION_VISIBLE_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "split" when the button's menu is visible. 
+        * @default "Menu expanded.  Press Esc or Ctrl + Shift + M to hide 
+        * the menu."
+        * @final
+        * @type String
+        */
+        SPLITBUTTON_OPTION_VISIBLE_TITLE: 
+            "Menu expanded.  Press Esc or Ctrl + Shift + M to hide the menu.",
+        
+        
+        /**
+        * @property SUBMIT_TITLE
+        * @description String representing the title applied to buttons of 
+        * type "submit." 
+        * @default "Click to submit form."
+        * @final
+        * @type String
+        */
+        SUBMIT_TITLE: "Click to submit form.",
+        
+        
+        
+        // Protected attribute setter methods
+        
+        
+        /**
+        * @method _setType
+        * @description Sets the value of the button's "type" attribute.
+        * @protected
+        * @param {String} p_sType String indicating the value for the button's 
+        * "type" attribute.
+        */
+        _setType: function (p_sType) {
+        
+            if (p_sType == "split") {
+        
+                this.on("option", this._onOption);
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setLabel
+        * @description Sets the value of the button's "label" attribute.
+        * @protected
+        * @param {String} p_sLabel String indicating the value for the button's 
+        * "label" attribute.
+        */
+        _setLabel: function (p_sLabel) {
+
+            this._button.innerHTML = p_sLabel;             
+        
+        },
+        
+        
+        /**
+        * @method _setTabIndex
+        * @description Sets the value of the button's "tabindex" attribute.
+        * @protected
+        * @param {Number} p_nTabIndex Number indicating the value for the 
+        * button's "tabindex" attribute.
+        */
+        _setTabIndex: function (p_nTabIndex) {
+        
+            this._button.tabIndex = p_nTabIndex;
+        
+        },
+        
+        
+        /**
+        * @method _setTitle
+        * @description Sets the value of the button's "title" attribute.
+        * @protected
+        * @param {String} p_nTabIndex Number indicating the value for 
+        * the button's "title" attribute.
+        */
+        _setTitle: function (p_sTitle) {
+        
+            var sTitle = p_sTitle;
+        
+            if (this.get("type") != "link") {
+        
+                if (!sTitle) {
+        
+                    switch (this.get("type")) {
+        
+                    case "radio":
+    
+                        sTitle = this.RADIO_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "checkbox":
+    
+                        sTitle = this.CHECKBOX_DEFAULT_TITLE;
+    
+                        break;
+                    
+                    case "menu":
+    
+                        sTitle = this.MENUBUTTON_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "split":
+    
+                        sTitle = this.SPLITBUTTON_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "submit":
+    
+                        sTitle = this.SUBMIT_TITLE;
+    
+                        break;
+        
+                    }
+        
+                }
+        
+                this._button.title = sTitle;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setDisabled
+        * @description Sets the value of the button's "disabled" attribute.
+        * @protected
+        * @param {Boolean} p_bDisabled Boolean indicating the value for 
+        * the button's "disabled" attribute.
+        */
+        _setDisabled: function (p_bDisabled) {
+        
+            if (this.get("type") != "link") {
+        
+                if (p_bDisabled) {
+        
+                    if (this._menu) {
+        
+                        this._menu.hide();
+        
+                    }
+        
+                    if (this.hasFocus()) {
+                    
+                        this.blur();
+                    
+                    }
+        
+                    this._button.setAttribute("disabled", "disabled");
+        
+                    this.addStateCSSClasses("disabled");
+        
+                }
+                else {
+        
+                    this._button.removeAttribute("disabled");
+        
+                    this.removeStateCSSClasses("disabled");
+                
+                }
+        
+            }
+        
+        },
+
+        
+        /**
+        * @method _setHref
+        * @description Sets the value of the button's "href" attribute.
+        * @protected
+        * @param {String} p_sHref String indicating the value for the button's 
+        * "href" attribute.
+        */
+        _setHref: function (p_sHref) {
+        
+            if (this.get("type") == "link") {
+        
+                this._button.href = p_sHref;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setTarget
+        * @description Sets the value of the button's "target" attribute.
+        * @protected
+        * @param {String} p_sTarget String indicating the value for the button's 
+        * "target" attribute.
+        */
+        _setTarget: function (p_sTarget) {
+        
+            if (this.get("type") == "link") {
+        
+                this._button.setAttribute("target", p_sTarget);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setChecked
+        * @description Sets the value of the button's "target" attribute.
+        * @protected
+        * @param {Boolean} p_bChecked Boolean indicating the value for  
+        * the button's "checked" attribute.
+        */
+        _setChecked: function (p_bChecked) {
+        
+            var sType = this.get("type"),
+                sTitle;
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                if (p_bChecked) {
+        
+                    this.addStateCSSClasses("checked");
+                    
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_CHECKED_TITLE : 
+                                this.CHECKBOX_CHECKED_TITLE;
+                
+                }
+                else {
+
+                    this.removeStateCSSClasses("checked");
+        
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_DEFAULT_TITLE : 
+                                this.CHECKBOX_DEFAULT_TITLE;
+                
+                }
+        
+                this.set("title", sTitle);
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setMenu
+        * @description Sets the value of the button's "menu" attribute.
+        * @protected
+        * @param {Object} p_oMenu Object indicating the value for the button's 
+        * "menu" attribute.
+        */
+        _setMenu: function (p_oMenu) {
+
+            var bLazyLoad = this.get("lazyloadmenu"),
+                oButtonElement = this.get("element"),
+        
+                /*
+                    Boolean indicating if the value of p_oMenu is an instance 
+                    of YAHOO.widget.Menu or YAHOO.widget.Overlay.
+                */
+        
+                bInstance = false,
+        
+
+                oMenu,
+                oMenuElement,
+                oSrcElement,
+                aItems,
+                nItems,
+                oItem,
+                i;
+        
+        
+            if (!Overlay) {
+        
+                this.logger.log("YAHOO.widget.Overlay dependency not met.", 
+                    "error");
+        
+                return false;
+            
+            }
+        
+        
+            if (!Menu) {
+        
+                this.logger.log("YAHOO.widget.Menu dependency not met.", 
+                    "error");
+        
+                return false;
+            
+            }
+        
+        
+            function onAppendTo() {
+
+                oMenu.render(oButtonElement.parentNode);
+                
+                this.removeListener("appendTo", onAppendTo);
+            
+            }
+        
+        
+            function initMenu() {
+        
+                if (oMenu) {
+
+                    Dom.addClass(oMenu.element, this.get("menuclassname"));
+                    Dom.addClass(oMenu.element, 
+                            "yui-" + this.get("type") + "-button-menu");
+
+                    oMenu.showEvent.subscribe(this._onMenuShow, null, this);
+                    oMenu.hideEvent.subscribe(this._onMenuHide, null, this);
+                    oMenu.renderEvent.subscribe(this._onMenuRender, null, this);
+        
+        
+                    if (oMenu instanceof Menu) {
+        
+                        oMenu.keyDownEvent.subscribe(this._onMenuKeyDown, 
+                            this, true);
+
+                        oMenu.clickEvent.subscribe(this._onMenuClick, 
+                            this, true);
+
+                        oMenu.itemAddedEvent.subscribe(this._onMenuItemAdded, 
+                            this, true);
+        
+                        oSrcElement = oMenu.srcElement;
+        
+                        if (oSrcElement && 
+                            oSrcElement.nodeName.toUpperCase() == "SELECT") {
+                
+                            oSrcElement.style.display = "none";
+                            oSrcElement.parentNode.removeChild(oSrcElement);
+        
+                        }
+        
+                    }
+                    else if (oMenu instanceof Overlay) {
+        
+                        if (!m_oOverlayManager) {
+        
+                            m_oOverlayManager = 
+                                new YAHOO.widget.OverlayManager();
+                        
+                        }
+                        
+                        m_oOverlayManager.register(oMenu);
+                        
+                    }
+        
+        
+                    this._menu = oMenu;
+
+        
+                    if (!bInstance) {
+        
+                        if (bLazyLoad && !(oMenu instanceof Menu)) {
+        
+                            /*
+                                Mimic Menu's "lazyload" functionality by adding  
+                                a "beforeshow" event listener that renders the 
+                                Overlay instance before it is made visible by  
+                                the button.
+                            */
+        
+                            oMenu.beforeShowEvent.subscribe(
+                                this._onOverlayBeforeShow, null, this);
+            
+                        }
+                        else if (!bLazyLoad) {
+        
+                            if (Dom.inDocument(oButtonElement)) {
+        
+                                oMenu.render(oButtonElement.parentNode);
+                            
+                            }
+                            else {
+            
+                                this.on("appendTo", onAppendTo);
+                            
+                            }
+                        
+                        }
+                    
+                    }
+        
+                }
+        
+            }
+        
+        
+            if (p_oMenu && (p_oMenu instanceof Menu)) {
+        
+                oMenu = p_oMenu;
+                aItems = oMenu.getItems();
+                nItems = aItems.length;
+                bInstance = true;
+        
+        
+                if (nItems > 0) {
+        
+                    i = nItems - 1;
+        
+                    do {
+        
+                        oItem = aItems[i];
+        
+                        if (oItem) {
+        
+                            oItem.cfg.subscribeToConfigEvent("selected", 
+                                this._onMenuItemSelected, 
+                                oItem, 
+                                this);
+        
+                        }
+        
+                    }
+                    while (i--);
+        
+                }
+        
+                initMenu.call(this);
+        
+            }
+            else if (p_oMenu && (p_oMenu instanceof Overlay)) {
+        
+                oMenu = p_oMenu;
+                bInstance = true;
+        
+                oMenu.cfg.setProperty("visible", false);
+                oMenu.cfg.setProperty("context", [oButtonElement, "tl", "bl"]);
+        
+                initMenu.call(this);
+        
+            }
+            else if (Lang.isArray(p_oMenu)) {
+        
+                this.on("appendTo", function () {
+        
+                    oMenu = new Menu(Dom.generateId(), { lazyload: bLazyLoad, 
+                        itemdata: p_oMenu });
+        
+                    initMenu.call(this);
+        
+                });
+        
+            }
+            else if (Lang.isString(p_oMenu)) {
+        
+                oMenuElement = Dom.get(p_oMenu);
+        
+                if (oMenuElement) {
+        
+                    if (Dom.hasClass(oMenuElement, 
+                        Menu.prototype.CSS_CLASS_NAME) || 
+                        oMenuElement.nodeName == "SELECT") {
+            
+                        oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad });
+            
+                        initMenu.call(this);
+            
+                    }
+                    else {
+        
+                        oMenu = new Overlay(p_oMenu, { visible: false, 
+                            context: [oButtonElement, "tl", "bl"] });
+            
+                        initMenu.call(this);
+            
+                    }
+        
+                }
+        
+            }
+            else if (p_oMenu && p_oMenu.nodeName) {
+        
+                if (Dom.hasClass(p_oMenu, Menu.prototype.CSS_CLASS_NAME) || 
+                        p_oMenu.nodeName == "SELECT") {
+        
+                    oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad });
+                
+                    initMenu.call(this);
+        
+                }
+                else {
+        
+                    if (!p_oMenu.id) {
+                    
+                        Dom.generateId(p_oMenu);
+                    
+                    }
+        
+                    oMenu = new Overlay(p_oMenu, { visible: false, 
+                                    context: [oButtonElement, "tl", "bl"] });
+        
+                    initMenu.call(this);
+                
+                }
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setOnClick
+        * @description Sets the value of the button's "onclick" attribute.
+        * @protected
+        * @param {Object} p_oObject Object indicating the value for the button's 
+        * "onclick" attribute.
+        */
+        _setOnClick: function (p_oObject) {
+        
+            /*
+                Remove any existing listeners if a "click" event handler 
+                has already been specified.
+            */
+        
+            if (this._onclickAttributeValue && 
+                (this._onclickAttributeValue != p_oObject)) {
+        
+                this.removeListener("click", this._onclickAttributeValue.fn);
+        
+                this._onclickAttributeValue = null;
+        
+            }
+        
+        
+            if (!this._onclickAttributeValue && 
+                Lang.isObject(p_oObject) && 
+                Lang.isFunction(p_oObject.fn)) {
+        
+                this.on("click", p_oObject.fn, p_oObject.obj, p_oObject.scope);
+        
+                this._onclickAttributeValue = p_oObject;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setSelectedMenuItem
+        * @description Sets the value of the button's 
+        * "selectedMenuItem" attribute.
+        * @protected
+        * @param {Number} p_nIndex Number representing the index of the item 
+        * in the button's menu that is currently selected.
+        */
+        _setSelectedMenuItem: function (p_nIndex) {
+
+            var oMenu = this._menu,
+                oMenuItem;
+
+
+            if (oMenu && oMenu instanceof Menu) {
+
+                oMenuItem = oMenu.getItem(p_nIndex);
+                
+
+                if (oMenuItem && !oMenuItem.cfg.getProperty("selected")) {
+                
+                    oMenuItem.cfg.setProperty("selected", true);
+                
+                }
+            
+            }
+
+        },
+        
+        
+        // Protected methods
+
+        
+        
+        /**
+        * @method _isActivationKey
+        * @description Determines if the specified keycode is one that toggles  
+        * the button's "active" state.
+        * @protected
+        * @param {Number} p_nKeyCode Number representing the keycode to 
+        * be evaluated.
+        * @return {Boolean}
+        */
+        _isActivationKey: function (p_nKeyCode) {
+        
+            var sType = this.get("type"),
+                aKeyCodes = (sType == "checkbox" || sType == "radio") ? 
+                    this.CHECK_ACTIVATION_KEYS : this.ACTIVATION_KEYS,
+        
+                nKeyCodes = aKeyCodes.length,
+                i;
+        
+            if (nKeyCodes > 0) {
+        
+                i = nKeyCodes - 1;
+        
+                do {
+        
+                    if (p_nKeyCode == aKeyCodes[i]) {
+        
+                        return true;
+        
+                    }
+        
+                }
+                while (i--);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _isSplitButtonOptionKey
+        * @description Determines if the specified keycode is one that toggles  
+        * the display of the split button's menu.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        * @return {Boolean}
+        */
+        _isSplitButtonOptionKey: function (p_oEvent) {
+        
+            return (p_oEvent.ctrlKey && p_oEvent.shiftKey && 
+                Event.getCharCode(p_oEvent) == 77);
+        
+        },
+        
+        
+        /**
+        * @method _addListenersToForm
+        * @description Adds event handlers to the button's form.
+        * @protected
+        */
+        _addListenersToForm: function () {
+        
+            var oForm = this.getForm(),
+                oSrcElement,
+                aListeners,
+                nListeners,
+                i,
+                bHasKeyPressListener;
+        
+        
+            if (oForm) {
+        
+                Event.on(oForm, "reset", this._onFormReset, null, this);
+                Event.on(oForm, "submit", this.createHiddenFields, null, this);
+        
+                oSrcElement = this.get("srcelement");
+        
+        
+                if (this.get("type") == "submit" || 
+                    (oSrcElement && oSrcElement.type == "submit")) 
+                {
+                
+                    aListeners = Event.getListeners(oForm, "keypress");
+                    bHasKeyPressListener = false;
+            
+                    if (aListeners) {
+            
+                        nListeners = aListeners.length;
+        
+                        if (nListeners > 0) {
+            
+                            i = nListeners - 1;
+                            
+                            do {
+               
+                                if (aListeners[i].fn == 
+                                    YAHOO.widget.Button.onFormKeyPress) 
+                                {
+                
+                                    bHasKeyPressListener = true;
+                                    break;
+                                
+                                }
+                
+                            }
+                            while (i--);
+                        
+                        }
+                    
+                    }
+            
+            
+                    if (!bHasKeyPressListener) {
+        
+                        Event.on(oForm, "keypress", 
+                            YAHOO.widget.Button.onFormKeyPress);
+            
+                    }
+        
+                }
+            
+            }
+        
+        },
+        
+        
+        _originalMaxHeight: -1,
+        
+        
+        /**
+        * @method _showMenu
+        * @description Shows the button's menu.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object 
+        * passed back by the event utility (YAHOO.util.Event) that triggered 
+        * the display of the menu.
+        */
+        _showMenu: function (p_oEvent) {
+        
+            YAHOO.widget.MenuManager.hideVisible();
+        
+            if (m_oOverlayManager) {
+        
+                m_oOverlayManager.hideAll();
+            
+            }
+        
+        
+            var oMenu = this._menu,
+                nViewportHeight = Dom.getViewportHeight(),
+                nMenuHeight,
+                nScrollTop,
+                nY;
+        
+        
+            if (oMenu && (oMenu instanceof Menu)) {
+        
+                oMenu.cfg.applyConfig({ context: [this.get("id"), "tl", "bl"],
+                    constraintoviewport: false,
+                    clicktohide: false,
+                    visible: true });
+                    
+                oMenu.cfg.fireQueue();
+            
+                oMenu.align("tl", "bl");
+        
+                /*
+                    Stop the propagation of the event so that the MenuManager 
+                    doesn't blur the menu after it gets focus.
+                */
+        
+                if (p_oEvent.type == "mousedown") {
+        
+                    Event.stopPropagation(p_oEvent);
+        
+                }
+
+
+                if (this.get("focusmenu")) {
+        
+                    this._menu.focus();
+                
+                }
+        
+                nMenuHeight = oMenu.element.offsetHeight;
+        
+        
+                if ((oMenu.cfg.getProperty("y") + nMenuHeight) > 
+                    nViewportHeight) {
+        
+                    this.logger.log("Current menu position will place a " + 
+                        "portion, or the entire menu outside the boundary of " +
+                        "the viewport.  Repositioning the menu to stay " +
+                        "inside the viewport.");
+        
+                    oMenu.align("bl", "tl");
+        
+                    nY = oMenu.cfg.getProperty("y");
+        
+                    nScrollTop = Dom.getDocumentScrollTop();
+        
+        
+                    if (nScrollTop >= nY) {
+        
+                        if (this._originalMaxHeight == -1) {
+        
+                            this._originalMaxHeight = 
+                                    oMenu.cfg.getProperty("maxheight");
+        
+                        }
+        
+                        oMenu.cfg.setProperty("maxheight", 
+                                    (nMenuHeight - ((nScrollTop - nY) + 20)));
+        
+                        oMenu.align("bl", "tl");
+        
+                    }
+        
+                }
+        
+            }
+            else if (oMenu && (oMenu instanceof Overlay)) {
+        
+                oMenu.show();
+                oMenu.align("tl", "bl");
+
+                nMenuHeight = oMenu.element.offsetHeight;
+        
+        
+                if ((oMenu.cfg.getProperty("y") + nMenuHeight) > 
+                    nViewportHeight) {
+        
+                    this.logger.log("Current menu position will place a " +
+                        "portion, or the entire menu outside the boundary of " + 
+                        "the viewport.  Repositioning the menu to stay inside" + 
+                        " the viewport.");
+        
+                    oMenu.align("bl", "tl");
+                    
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _hideMenu
+        * @description Hides the button's menu.
+        * @protected
+        */
+        _hideMenu: function () {
+        
+            var oMenu = this._menu;
+        
+            if (oMenu) {
+        
+                oMenu.hide();
+        
+            }
+        
+        },
+        
+        
+        
+        
+        // Protected event handlers
+        
+        
+        /**
+        * @method _onMouseOver
+        * @description "mouseover" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseOver: function (p_oEvent) {
+        
+            if (!this._hasMouseEventHandlers) {
+        
+                this.on("mouseout", this._onMouseOut);
+                this.on("mousedown", this._onMouseDown);
+                this.on("mouseup", this._onMouseUp);
+        
+                this._hasMouseEventHandlers = true;
+        
+            }
+        
+            this.addStateCSSClasses("hover");
+        
+            if (this._activationButtonPressed) {
+        
+                this.addStateCSSClasses("active");
+        
+            }
+        
+        
+            if (this._bOptionPressed) {
+        
+                this.addStateCSSClasses("activeoption");
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMouseOut
+        * @description "mouseout" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseOut: function (p_oEvent) {
+        
+            this.removeStateCSSClasses("hover");
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+        
+            }
+        
+            if (this._activationButtonPressed || this._bOptionPressed) {
+        
+                Event.on(document, "mouseup", this._onDocumentMouseUp, 
+                    null, this);
+        
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onDocumentMouseUp
+        * @description "mouseup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentMouseUp: function (p_oEvent) {
+        
+            this._activationButtonPressed = false;
+            this._bOptionPressed = false;
+        
+            var sType = this.get("type");
+        
+            if (sType == "menu" || sType == "split") {
+        
+                this.removeStateCSSClasses(
+                    (sType == "menu" ? "active" : "activeoption"));
+        
+                this._hideMenu();
+        
+            }
+        
+            Event.removeListener(document, "mouseup", this._onDocumentMouseUp);
+        
+        },
+        
+        
+        /**
+        * @method _onMouseDown
+        * @description "mousedown" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseDown: function (p_oEvent) {
+        
+            var sType,
+                oElement,
+                nX,
+                me;
+        
+        
+            function onMouseUp() {
+            
+                this._hideMenu();
+                this.removeListener("mouseup", onMouseUp);
+            
+            }
+        
+        
+            if ((p_oEvent.which || p_oEvent.button) == 1) {
+        
+        
+                if (!this.hasFocus()) {
+                
+                    this.focus();
+                
+                }
+        
+        
+                sType = this.get("type");
+        
+        
+                if (sType == "split") {
+                
+                    oElement = this.get("element");
+                    nX = Event.getPageX(p_oEvent) - Dom.getX(oElement);
+        
+                    if ((oElement.offsetWidth - this.OPTION_AREA_WIDTH) < nX) {
+                        
+                        this.fireEvent("option", p_oEvent);
+        
+                    }
+                    else {
+        
+                        this.addStateCSSClasses("active");
+        
+                        this._activationButtonPressed = true;
+        
+                    }
+        
+                }
+                else if (sType == "menu") {
+        
+                    if (this.isActive()) {
+        
+                        this._hideMenu();
+        
+                        this._activationButtonPressed = false;
+        
+                    }
+                    else {
+        
+                        this._showMenu(p_oEvent);
+        
+                        this._activationButtonPressed = true;
+                    
+                    }
+        
+                }
+                else {
+        
+                    this.addStateCSSClasses("active");
+        
+                    this._activationButtonPressed = true;
+                
+                }
+        
+        
+        
+                if (sType == "split" || sType == "menu") {
+
+                    me = this;
+        
+                    this._hideMenuTimerId = window.setTimeout(function () {
+                    
+                        me.on("mouseup", onMouseUp);
+                    
+                    }, 250);
+        
+                }
+        
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onMouseUp
+        * @description "mouseup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseUp: function (p_oEvent) {
+        
+            var sType = this.get("type");
+        
+        
+            if (this._hideMenuTimerId) {
+        
+                window.clearTimeout(this._hideMenuTimerId);
+        
+            }
+        
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                this.set("checked", !(this.get("checked")));
+            
+            }
+        
+        
+            this._activationButtonPressed = false;
+            
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+            
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onFocus
+        * @description "focus" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onFocus: function (p_oEvent) {
+        
+            var oElement;
+        
+            this.addStateCSSClasses("focus");
+        
+            if (this._activationKeyPressed) {
+        
+                this.addStateCSSClasses("active");
+           
+            }
+        
+            m_oFocusedButton = this;
+        
+        
+            if (!this._hasKeyEventHandlers) {
+        
+                oElement = this._button;
+        
+                Event.on(oElement, "blur", this._onBlur, null, this);
+                Event.on(oElement, "keydown", this._onKeyDown, null, this);
+                Event.on(oElement, "keyup", this._onKeyUp, null, this);
+        
+                this._hasKeyEventHandlers = true;
+        
+            }
+        
+        
+            this.fireEvent("focus", p_oEvent);
+        
+        },
+        
+        
+        /**
+        * @method _onBlur
+        * @description "blur" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onBlur: function (p_oEvent) {
+        
+            this.removeStateCSSClasses("focus");
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+        
+            }    
+        
+            if (this._activationKeyPressed) {
+        
+                Event.on(document, "keyup", this._onDocumentKeyUp, null, this);
+        
+            }
+        
+        
+            m_oFocusedButton = null;
+        
+            this.fireEvent("blur", p_oEvent);
+           
+        },
+        
+        
+        /**
+        * @method _onDocumentKeyUp
+        * @description "keyup" event handler for the document.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentKeyUp: function (p_oEvent) {
+        
+            if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                this._activationKeyPressed = false;
+                
+                Event.removeListener(document, "keyup", this._onDocumentKeyUp);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onKeyDown
+        * @description "keydown" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyDown: function (p_oEvent) {
+        
+            var oMenu = this._menu;
+        
+        
+            if (this.get("type") == "split" && 
+                this._isSplitButtonOptionKey(p_oEvent)) {
+        
+                this.fireEvent("option", p_oEvent);
+        
+            }
+            else if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                if (this.get("type") == "menu") {
+        
+                    this._showMenu(p_oEvent);
+        
+                }
+                else {
+        
+                    this._activationKeyPressed = true;
+                    
+                    this.addStateCSSClasses("active");
+                
+                }
+            
+            }
+        
+        
+            if (oMenu && oMenu.cfg.getProperty("visible") && 
+                Event.getCharCode(p_oEvent) == 27) {
+            
+                oMenu.hide();
+                this.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onKeyUp
+        * @description "keyup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyUp: function (p_oEvent) {
+        
+            var sType;
+        
+            if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                sType = this.get("type");
+        
+                if (sType == "checkbox" || sType == "radio") {
+        
+                    this.set("checked", !(this.get("checked")));
+                
+                }
+        
+                this._activationKeyPressed = false;
+        
+                if (this.get("type") != "menu") {
+        
+                    this.removeStateCSSClasses("active");
+        
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onClick
+        * @description "click" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onClick: function (p_oEvent) {
+        
+            var sType = this.get("type"),
+                sTitle,
+                oForm,
+                oSrcElement,
+                oElement,
+                nX;
+        
+        
+            switch (sType) {
+        
+            case "radio":
+            case "checkbox":
+    
+                if (this.get("checked")) {
+                    
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_CHECKED_TITLE : 
+                                this.CHECKBOX_CHECKED_TITLE;
+                
+                }
+                else {
+                
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_DEFAULT_TITLE : 
+                                this.CHECKBOX_DEFAULT_TITLE;
+                
+                }
+                
+                this.set("title", sTitle);
+    
+                break;
+    
+            case "submit":
+    
+                this.submitForm();
+            
+                break;
+    
+            case "reset":
+    
+                oForm = this.getForm();
+    
+                if (oForm) {
+    
+                    oForm.reset();
+                
+                }
+    
+                break;
+    
+            case "menu":
+    
+                sTitle = this._menu.cfg.getProperty("visible") ? 
+                                this.MENUBUTTON_MENU_VISIBLE_TITLE : 
+                                this.MENUBUTTON_DEFAULT_TITLE;
+    
+                this.set("title", sTitle);
+    
+                break;
+    
+            case "split":
+    
+                oElement = this.get("element");
+                nX = Event.getPageX(p_oEvent) - Dom.getX(oElement);
+    
+                if ((oElement.offsetWidth - this.OPTION_AREA_WIDTH) < nX) {
+    
+                    return false;
+                
+                }
+                else {
+    
+                    this._hideMenu();
+        
+                    oSrcElement = this.get("srcelement");
+        
+                    if (oSrcElement && oSrcElement.type == "submit") {
+    
+                        this.submitForm();
+                    
+                    }
+                
+                }
+    
+                sTitle = this._menu.cfg.getProperty("visible") ? 
+                                this.SPLITBUTTON_OPTION_VISIBLE_TITLE : 
+                                this.SPLITBUTTON_DEFAULT_TITLE;
+    
+                this.set("title", sTitle);
+    
+                break;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onAppendTo
+        * @description "appendTo" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onAppendTo: function (p_oEvent) {
+        
+            /*
+                It is necessary to call "getForm" using "setTimeout" to make 
+                sure that the button's "form" property returns a node 
+                reference.  Sometimes, if you try to get the reference 
+                immediately after appending the field, it is null.
+            */
+        
+            var me = this;
+        
+            window.setTimeout(function () {
+        
+                me._addListenersToForm();
+        
+            }, 0);
+        
+        },
+        
+        
+        /**
+        * @method _onFormReset
+        * @description "reset" event handler for the button's form.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event 
+        * object passed back by the event utility (YAHOO.util.Event).
+        */
+        _onFormReset: function (p_oEvent) {
+        
+            var sType = this.get("type"),
+                oMenu = this._menu;
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                this.resetValue("checked");
+        
+            }
+        
+        
+            if (oMenu && (oMenu instanceof Menu)) {
+        
+                this.resetValue("selectedMenuItem");
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onDocumentMouseDown
+        * @description "mousedown" event handler for the document.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentMouseDown: function (p_oEvent) {
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                oButtonElement = this.get("element"),
+                oMenuElement = this._menu.element;
+        
+            if (oTarget != oButtonElement && 
+                !Dom.isAncestor(oButtonElement, oTarget) && 
+                oTarget != oMenuElement && 
+                !Dom.isAncestor(oMenuElement, oTarget)) {
+        
+                this._hideMenu();
+        
+                Event.removeListener(document, "mousedown", 
+                    this._onDocumentMouseDown);    
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOption
+        * @description "option" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onOption: function (p_oEvent) {
+        
+            if (this.hasClass("yui-split-button-activeoption")) {
+        
+                this._hideMenu();
+        
+                this._bOptionPressed = false;
+        
+            }
+            else {
+        
+                this._showMenu(p_oEvent);    
+        
+                this._bOptionPressed = true;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOverlayBeforeShow
+        * @description "beforeshow" event handler for the 
+        * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a> instance 
+        * serving as the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onOverlayBeforeShow: function (p_sType) {
+        
+            var oMenu = this._menu;
+        
+            oMenu.render(this.get("element").parentNode);
+            
+            oMenu.beforeShowEvent.unsubscribe(this._onOverlayBeforeShow);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuShow
+        * @description "show" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onMenuShow: function (p_sType) {
+        
+            Event.on(document, "mousedown", this._onDocumentMouseDown, 
+                null, this);
+        
+            var sTitle,
+                sState;
+            
+            if (this.get("type") == "split") {
+        
+                sTitle = this.SPLITBUTTON_OPTION_VISIBLE_TITLE;
+                sState = "activeoption";
+            
+            }
+            else {
+        
+                sTitle = this.MENUBUTTON_MENU_VISIBLE_TITLE;        
+                sState = "active";
+        
+            }
+        
+            this.addStateCSSClasses(sState);
+            this.set("title", sTitle);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuHide
+        * @description "hide" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onMenuHide: function (p_sType) {
+            
+            var oMenu = this._menu,
+                sTitle,
+                sState;
+        
+            if (oMenu && (oMenu instanceof Menu) && 
+                this._originalMaxHeight != -1) {
+            
+                this._menu.cfg.setProperty("maxheight", 
+                    this._originalMaxHeight);
+        
+            }
+        
+            
+            if (this.get("type") == "split") {
+        
+                sTitle = this.SPLITBUTTON_DEFAULT_TITLE;
+                sState = "activeoption";
+        
+            }
+            else {
+        
+                sTitle = this.MENUBUTTON_DEFAULT_TITLE;        
+                sState = "active";
+            }
+        
+        
+            this.removeStateCSSClasses(sState);
+            this.set("title", sTitle);
+        
+        
+            if (this.get("type") == "split") {
+        
+                this._bOptionPressed = false;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuKeyDown
+        * @description "keydown" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        _onMenuKeyDown: function (p_sType, p_aArgs) {
+        
+            var oEvent = p_aArgs[0];
+        
+            if (Event.getCharCode(oEvent) == 27) {
+        
+                this.focus();
+        
+                if (this.get("type") == "split") {
+                
+                    this._bOptionPressed = false;
+                
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuRender
+        * @description "render" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the  
+        * event thatwas fired.
+        */
+        _onMenuRender: function (p_sType) {
+        
+            var oButtonElement = this.get("element"),
+                oButtonParent = oButtonElement.parentNode,
+                oMenuElement = this._menu.element;
+        
+        
+            if (oButtonParent != oMenuElement.parentNode) {
+        
+                oButtonParent.appendChild(oMenuElement);
+            
+            }
+
+            this.set("selectedMenuItem", this.get("selectedMenuItem"));
+
+        },
+        
+        
+        /**
+        * @method _onMenuItemSelected
+        * @description "selectedchange" event handler for each item in the 
+        * button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {Number} p_nItem Number representing the index of the menu
+        * item that subscribed to the event.
+        */
+        _onMenuItemSelected: function (p_sType, p_aArgs, p_nItem) {
+
+            var bSelected = p_aArgs[0];
+
+            if (bSelected) {
+            
+                this.set("selectedMenuItem", p_nItem);
+
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuItemAdded
+        * @description "itemadded" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event
+        * was fired.
+        * @param {<a href="YAHOO.widget.MenuItem.html">
+        * YAHOO.widget.MenuItem</a>} p_oItem Object representing the menu 
+        * item that subscribed to the event.
+        */
+        _onMenuItemAdded: function (p_sType, p_aArgs, p_oItem) {
+            
+            var oItem = p_aArgs[0];
+        
+            oItem.cfg.subscribeToConfigEvent("selected", 
+                this._onMenuItemSelected, 
+                oItem.index, 
+                this);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuClick
+        * @description "click" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        _onMenuClick: function (p_sType, p_aArgs) {
+        
+            var oItem = p_aArgs[1],
+                oSrcElement;
+        
+            if (oItem) {
+        
+                oSrcElement = this.get("srcelement");
+            
+                if (oSrcElement && oSrcElement.type == "submit") {
+        
+                    this.submitForm();
+            
+                }
+            
+                this._hideMenu();
+            
+            }
+        
+        },
+        
+        
+        
+        // Public methods
+        
+        
+        /**
+        * @method createButtonElement
+        * @description Creates the button's HTML elements.
+        * @param {String} p_sType String indicating the type of element 
+        * to create.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-58190037">HTMLElement</a>}
+        */
+        createButtonElement: function (p_sType) {
+        
+            var sNodeName = this.NODE_NAME,
+                oElement = document.createElement(sNodeName);
+        
+            oElement.innerHTML =  "<" + sNodeName + " class=\"first-child\">" + 
+                (p_sType == "link" ? "<a></a>" : 
+                "<button type=\"button\"></button>") + "</" + sNodeName + ">";
+        
+            return oElement;
+        
+        },
+
+        
+        /**
+        * @method addStateCSSClasses
+        * @description Appends state-specific CSS classes to the button's root 
+        * DOM element.
+        */
+        addStateCSSClasses: function (p_sState) {
+        
+            var sType = this.get("type");
+        
+            if (Lang.isString(p_sState)) {
+        
+                if (p_sState != "activeoption") {
+        
+                    this.addClass(this.CSS_CLASS_NAME + ("-" + p_sState));
+        
+                }
+        
+                this.addClass("yui-" + sType + ("-button-" + p_sState));
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeStateCSSClasses
+        * @description Removes state-specific CSS classes to the button's root 
+        * DOM element.
+        */
+        removeStateCSSClasses: function (p_sState) {
+        
+            var sType = this.get("type");
+        
+            if (Lang.isString(p_sState)) {
+        
+                this.removeClass(this.CSS_CLASS_NAME + ("-" + p_sState));
+                this.removeClass("yui-" + sType + ("-button-" + p_sState));
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method createHiddenFields
+        * @description Creates the button's hidden form field and appends it 
+        * to its parent form.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array}
+        */
+        createHiddenFields: function () {
+        
+            this.removeHiddenFields();
+        
+            var oForm = this.getForm(),
+                oButtonField,
+                sType,     
+                bCheckable,
+                oMenu,
+                oMenuItem,
+                sName,
+                oValue,
+                oMenuField;
+        
+        
+            if (oForm && !this.get("disabled")) {
+        
+                sType = this.get("type");
+                bCheckable = (sType == "checkbox" || sType == "radio");
+        
+        
+                if (bCheckable || (m_oSubmitTrigger == this)) {
+                
+                    this.logger.log("Creating hidden field.");
+        
+                    oButtonField = createInputElement(
+                                    (bCheckable ? sType : "hidden"),
+                                    this.get("name"),
+                                    this.get("value"),
+                                    this.get("checked"));
+            
+            
+                    if (oButtonField) {
+            
+                        if (bCheckable) {
+            
+                            oButtonField.style.display = "none";
+            
+                        }
+            
+                        oForm.appendChild(oButtonField);
+            
+                    }
+        
+                }
+                    
+        
+                oMenu = this._menu;
+            
+            
+                if (oMenu && (oMenu instanceof Menu)) {
+        
+                    this.logger.log("Creating hidden field for menu.");
+        
+                    oMenuField = oMenu.srcElement;
+                    oMenuItem = oMenu.getItem(this.get("selectedMenuItem"));
+        
+                    if (oMenuField && 
+                        oMenuField.nodeName.toUpperCase() == "SELECT") {
+        
+                        oForm.appendChild(oMenuField);
+                        oMenuField.selectedIndex = oMenuItem.index;
+        
+                    }
+                    else {
+        
+                        oValue = (oMenuItem.value === null || 
+                                    oMenuItem.value === "") ? 
+                                    oMenuItem.cfg.getProperty("text") : 
+                                    oMenuItem.value;
+        
+                        sName = this.get("name");
+        
+                        if (oValue && sName) {
+        
+                            oMenuField = createInputElement("hidden", 
+                                                (sName + "_options"),
+                                                oValue);
+        
+                            oForm.appendChild(oMenuField);
+        
+                        }
+        
+                    }  
+        
+                }
+            
+            
+                if (oButtonField && oMenuField) {
+        
+                    this._hiddenFields = [oButtonField, oMenuField];
+        
+                }
+                else if (!oButtonField && oMenuField) {
+        
+                    this._hiddenFields = oMenuField;
+                
+                }
+                else if (oButtonField && !oMenuField) {
+        
+                    this._hiddenFields = oButtonField;
+                
+                }
+        
+        
+                return this._hiddenFields;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeHiddenFields
+        * @description Removes the button's hidden form field(s) from its 
+        * parent form.
+        */
+        removeHiddenFields: function () {
+        
+            var oField = this._hiddenFields,
+                nFields,
+                i;
+        
+            function removeChild(p_oElement) {
+        
+                if (Dom.inDocument(p_oElement)) {
+        
+                    p_oElement.parentNode.removeChild(p_oElement);
+                
+                }
+                
+            }
+            
+        
+            if (oField) {
+        
+                if (Lang.isArray(oField)) {
+        
+                    nFields = oField.length;
+                    
+                    if (nFields > 0) {
+                    
+                        i = nFields - 1;
+                        
+                        do {
+        
+                            removeChild(oField[i]);
+        
+                        }
+                        while (i--);
+                    
+                    }
+                
+                }
+                else {
+        
+                    removeChild(oField);
+        
+                }
+        
+                this._hiddenFields = null;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method submitForm
+        * @description Submits the form to which the button belongs.  Returns  
+        * true if the form was submitted successfully, false if the submission 
+        * was cancelled.
+        * @protected
+        * @return {Boolean}
+        */
+        submitForm: function () {
+        
+            var oForm = this.getForm(),
+        
+                oSrcElement = this.get("srcelement"),
+        
+                /*
+                    Boolean indicating if the event fired successfully 
+                    (was not cancelled by any handlers)
+                */
+        
+                bSubmitForm = false,
+                
+                oEvent;
+        
+        
+            if (oForm) {
+        
+                if (this.get("type") == "submit" || 
+                    (oSrcElement && oSrcElement.type == "submit")) 
+                {
+        
+                    m_oSubmitTrigger = this;
+                    
+                }
+        
+        
+                if (YAHOO.env.ua.ie) {
+        
+                    bSubmitForm = oForm.fireEvent("onsubmit");
+        
+                }
+                else {  // Gecko, Opera, and Safari
+        
+                    oEvent = document.createEvent("HTMLEvents");
+                    oEvent.initEvent("submit", true, true);
+        
+                    bSubmitForm = oForm.dispatchEvent(oEvent);
+        
+                }
+        
+        
+                /*
+                    In IE and Safari, dispatching a "submit" event to a form 
+                    WILL cause the form's "submit" event to fire, but WILL NOT 
+                    submit the form.  Therefore, we need to call the "submit" 
+                    method as well.
+                */
+              
+                if ((YAHOO.env.ua.ie || YAHOO.env.ua.webkit) && bSubmitForm) {
+        
+                    oForm.submit();
+                
+                }
+            
+            }
+        
+            return bSubmitForm;
+            
+        },
+        
+        
+        /**
+        * @method init
+        * @description The Button class's initialization method.
+        * @param {String} p_oElement String specifying the id attribute of the 
+        * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>,
+        * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to 
+        * be used to create the button.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://
+        * www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html
+        * #ID-34812697">HTMLButtonElement</a>|<a href="http://www.w3.org/TR
+        * /2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-33759296">
+        * HTMLElement</a>} p_oElement Object reference for the 
+        * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>, 
+        * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to be 
+        * used to create the button.
+        * @param {Object} p_oElement Object literal specifying a set of 
+        * configuration attributes used to create the button.
+        * @param {Object} p_oAttributes Optional. Object literal specifying a 
+        * set of configuration attributes used to create the button.
+        */
+        init: function (p_oElement, p_oAttributes) {
+        
+            var sNodeName = p_oAttributes.type == "link" ? "A" : "BUTTON",
+                oSrcElement = p_oAttributes.srcelement,
+                oButton = p_oElement.getElementsByTagName(sNodeName)[0],
+                oInput;
+        
+
+            if (!oButton) {
+
+                oInput = p_oElement.getElementsByTagName("INPUT")[0];
+
+
+                if (oInput) {
+
+                    oButton = document.createElement("BUTTON");
+                    oButton.setAttribute("type", "button");
+
+                    oInput.parentNode.replaceChild(oButton, oInput);
+                
+                }
+
+            }
+
+            this._button = oButton;
+        
+
+            YAHOO.widget.Button.superclass.init.call(this, p_oElement, 
+                p_oAttributes);
+        
+        
+            m_oButtons[this.get("id")] = this;
+        
+        
+            this.addClass(this.CSS_CLASS_NAME);
+            
+            this.addClass("yui-" + this.get("type") + "-button");
+        
+            Event.on(this._button, "focus", this._onFocus, null, this);
+            this.on("mouseover", this._onMouseOver);
+            this.on("click", this._onClick);
+            this.on("appendTo", this._onAppendTo);
+            
+        
+            var oContainer = this.get("container"),
+                oElement = this.get("element"),
+                bElInDoc = Dom.inDocument(oElement),
+                oParentNode;
+
+
+            if (oContainer) {
+        
+                if (oSrcElement && oSrcElement != oElement) {
+                
+                    oParentNode = oSrcElement.parentNode;
+
+                    if (oParentNode) {
+                    
+                        oParentNode.removeChild(oSrcElement);
+                    
+                    }
+
+                }
+        
+                if (Lang.isString(oContainer)) {
+        
+                    Event.onContentReady(oContainer, function () {
+        
+                        this.appendTo(oContainer);
+                    
+                    }, null, this);
+        
+                }
+                else {
+        
+                    this.appendTo(oContainer);
+        
+                }
+        
+            }
+            else if (!bElInDoc && oSrcElement && oSrcElement != oElement) {
+
+                oParentNode = oSrcElement.parentNode;
+        
+                if (oParentNode) {
+        
+                    this.fireEvent("beforeAppendTo", {
+                        type: "beforeAppendTo",
+                        target: oParentNode
+                    });
+            
+                    oParentNode.replaceChild(oElement, oSrcElement);
+            
+                    this.fireEvent("appendTo", {
+                        type: "appendTo",
+                        target: oParentNode
+                    });
+                
+                }
+        
+            }
+            else if (this.get("type") != "link" && bElInDoc && oSrcElement && 
+                oSrcElement == oElement) {
+        
+                this._addListenersToForm();
+        
+            }
+        
+            this.logger.log("Initialization completed.");
+        
+        },
+        
+        
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to  
+        * create the button.
+        * @param {Object} p_oAttributes Object literal specifying a set of 
+        * configuration attributes used to create the button.
+        */
+        initAttributes: function (p_oAttributes) {
+        
+            var oAttributes = p_oAttributes || {};
+        
+            YAHOO.widget.Button.superclass.initAttributes.call(this, 
+                oAttributes);
+        
+        
+            /**
+            * @config type
+            * @description String specifying the button's type.  Possible 
+            * values are: "push," "link," "submit," "reset," "checkbox," 
+            * "radio," "menu," and "split."
+            * @default "push"
+            * @type String
+            */
+            this.setAttributeConfig("type", {
+        
+                value: (oAttributes.type || "push"),
+                validator: Lang.isString,
+                writeOnce: true,
+                method: this._setType
+        
+            });
+        
+        
+            /**
+            * @config label
+            * @description String specifying the button's text label 
+            * or innerHTML.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("label", {
+        
+                value: oAttributes.label,
+                validator: Lang.isString,
+                method: this._setLabel
+        
+            });
+        
+        
+            /**
+            * @config value
+            * @description Object specifying the value for the button.
+            * @default null
+            * @type Object
+            */
+            this.setAttributeConfig("value", {
+        
+                value: oAttributes.value
+        
+            });
+        
+        
+            /**
+            * @config name
+            * @description String specifying the name for the button.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("name", {
+        
+                value: oAttributes.name,
+                validator: Lang.isString
+        
+            });
+        
+        
+            /**
+            * @config tabindex
+            * @description Number specifying the tabindex for the button.
+            * @default null
+            * @type Number
+            */
+            this.setAttributeConfig("tabindex", {
+        
+                value: oAttributes.tabindex,
+                validator: Lang.isNumber,
+                method: this._setTabIndex
+        
+            });
+        
+        
+            /**
+            * @config title
+            * @description String specifying the title for the button.
+            * @default null
+            * @type String
+            */
+            this.configureAttribute("title", {
+        
+                value: oAttributes.title,
+                validator: Lang.isString,
+                method: this._setTitle
+        
+            });
+        
+        
+            /**
+            * @config disabled
+            * @description Boolean indicating if the button should be disabled.  
+            * (Disabled buttons are dimmed and will not respond to user input 
+            * or fire events.  Does not apply to button's of type "link.")
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("disabled", {
+        
+                value: (oAttributes.disabled || false),
+                validator: Lang.isBoolean,
+                method: this._setDisabled
+        
+            });
+        
+        
+            /**
+            * @config href
+            * @description String specifying the href for the button.  Applies
+            * only to buttons of type "link."
+            * @type String
+            */
+            this.setAttributeConfig("href", {
+        
+                value: oAttributes.href,
+                validator: Lang.isString,
+                method: this._setHref
+        
+            });
+        
+        
+            /**
+            * @config target
+            * @description String specifying the target for the button.  
+            * Applies only to buttons of type "link."
+            * @type String
+            */
+            this.setAttributeConfig("target", {
+        
+                value: oAttributes.target,
+                validator: Lang.isString,
+                method: this._setTarget
+        
+            });
+        
+        
+            /**
+            * @config checked
+            * @description Boolean indicating if the button is checked. 
+            * Applies only to buttons of type "radio" and "checkbox."
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("checked", {
+        
+                value: (oAttributes.checked || false),
+                validator: Lang.isBoolean,
+                method: this._setChecked
+        
+            });
+        
+        
+            /**
+            * @config container
+            * @description HTML element reference or string specifying the id 
+            * attribute of the HTML element that the button's markup should be 
+            * rendered into.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("container", {
+        
+                value: oAttributes.container,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @config srcelement
+            * @description Object reference to the HTML element (either 
+            * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code>) 
+            * used to create the button.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("srcelement", {
+        
+                value: oAttributes.srcelement,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @config menu
+            * @description Object specifying the menu for the button.  
+            * The value can be one of the following:
+            * <ul>
+            * <li>Object specifying a <a href="YAHOO.widget.Menu.html">
+            * YAHOO.widget.Menu</a> instance.</li>
+            * <li>Object specifying a <a href="YAHOO.widget.Overlay.html">
+            * YAHOO.widget.Overlay</a> instance.</li>
+            * <li>String specifying the id attribute of the <code>&#60;div&#62;
+            * </code> element used to create the menu.  By default the menu 
+            * will be created as an instance of 
+            * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>.  
+            * If the <a href="YAHOO.widget.Menu.html#CSS_CLASS_NAME">
+            * default CSS class name for YAHOO.widget.Menu</a> is applied to 
+            * the <code>&#60;div&#62;</code> element, it will be created as an
+            * instance of <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu
+            * </a>.</li><li>String specifying the id attribute of the 
+            * <code>&#60;select&#62;</code> element used to create the menu.
+            * </li><li>Object specifying the <code>&#60;div&#62;</code> element
+            * used to create the menu.</li>
+            * <li>Object specifying the <code>&#60;select&#62;</code> element
+            * used to create the menu.</li>
+            * <li>Array of object literals, each representing a set of 
+            * <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a> 
+            * configuration attributes.</li>
+            * <li>Array of strings representing the text labels for each menu 
+            * item in the menu.</li>
+            * </ul>
+            * @type <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>|<a 
+            * href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>|<a 
+            * href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+            * one-html.html#ID-58190037">HTMLElement</a>|String|Array
+            * @default null
+            */
+            this.setAttributeConfig("menu", {
+        
+                value: null,
+                method: this._setMenu,
+                writeOnce: true
+            
+            });
+        
+        
+            /**
+            * @config lazyloadmenu
+            * @description Boolean indicating the value to set for the 
+            * <a href="YAHOO.widget.Menu.html#lazyLoad">"lazyload"</a>
+            * configuration property of the button's menu.  Setting 
+            * "lazyloadmenu" to <code>true </code> will defer rendering of 
+            * the button's menu until the first time it is made visible.  
+            * If "lazyloadmenu" is set to <code>false</code>, the button's 
+            * menu will be rendered immediately if the button is in the 
+            * document, or in response to the button's "appendTo" event if 
+            * the button is not yet in the document.  In either case, the 
+            * menu is rendered into the button's parent HTML element.  
+            * <em>This attribute does not apply if a 
+            * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a> or 
+            * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a> 
+            * instance is passed as the value of the button's "menu" 
+            * configuration attribute. <a href="YAHOO.widget.Menu.html">
+            * YAHOO.widget.Menu</a> or <a href="YAHOO.widget.Overlay.html">
+            * YAHOO.widget.Overlay</a> instances should be rendered before 
+            * being set as the value for the "menu" configuration 
+            * attribute.</em>
+            * @default true
+            * @type Boolean
+            */
+            this.setAttributeConfig("lazyloadmenu", {
+        
+                value: (oAttributes.lazyloadmenu === false ? false : true),
+                validator: Lang.isBoolean,
+                writeOnce: true
+        
+            });
+
+
+            /**
+            * @config menuclassname
+            * @description String representing the CSS class name to be 
+            * applied to the root element of the button's menu.
+            * @type String
+            * @default "yui-button-menu"
+            */
+            this.setAttributeConfig("menuclassname", {
+        
+                value: (oAttributes.menuclassname || "yui-button-menu"),
+                validator: Lang.isString,
+                method: this._setMenuClassName,
+                writeOnce: true
+        
+            });        
+
+
+            /**
+            * @config selectedMenuItem
+            * @description Number representing the index of the item in the 
+            * button's menu that is currently selected.
+            * @type Number
+            * @default null
+            */
+            this.setAttributeConfig("selectedMenuItem", {
+        
+                value: 0,
+                validator: Lang.isNumber,
+                method: this._setSelectedMenuItem
+        
+            });
+        
+        
+            /**
+            * @config onclick
+            * @description Object literal representing the code to be executed  
+            * when the button is clicked.  Format:<br> <code> {<br> 
+            * <strong>fn:</strong> Function,   &#47;&#47; The handler to call 
+            * when the event fires.<br> <strong>obj:</strong> Object, 
+            * &#47;&#47; An object to pass back to the handler.<br> 
+            * <strong>scope:</strong> Object &#47;&#47;  The object to use 
+            * for the scope of the handler.<br> } </code>
+            * @type Object
+            * @default null
+            */
+            this.setAttributeConfig("onclick", {
+        
+                value: oAttributes.onclick,
+                method: this._setOnClick
+            
+            });
+
+
+            /**
+            * @config focusmenu
+            * @description Boolean indicating whether or not the button's menu 
+            * should be focused when it is made visible.
+            * @type Boolean
+            * @default true
+            */
+            this.setAttributeConfig("focusmenu", {
+        
+                value: (oAttributes.focusmenu === false ? false : true),
+                validator: Lang.isBoolean
+        
+            });
+
+        },
+        
+        
+        /**
+        * @method focus
+        * @description Causes the button to receive the focus and fires the 
+        * button's "focus" event.
+        */
+        focus: function () {
+        
+            if (!this.get("disabled")) {
+        
+                this._button.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method blur
+        * @description Causes the button to lose focus and fires the button's
+        * "blur" event.
+        */
+        blur: function () {
+        
+            if (!this.get("disabled")) {
+        
+                this._button.blur();
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method hasFocus
+        * @description Returns a boolean indicating whether or not the button 
+        * has focus.
+        * @return {Boolean}
+        */
+        hasFocus: function () {
+        
+            return (m_oFocusedButton == this);
+        
+        },
+        
+        
+        /**
+        * @method isActive
+        * @description Returns a boolean indicating whether or not the button 
+        * is active.
+        * @return {Boolean}
+        */
+        isActive: function () {
+        
+            return this.hasClass(this.CSS_CLASS_NAME + "-active");
+        
+        },
+        
+        
+        /**
+        * @method getMenu
+        * @description Returns a reference to the button's menu.
+        * @return {<a href="YAHOO.widget.Overlay.html">
+        * YAHOO.widget.Overlay</a>|<a 
+        * href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>}
+        */
+        getMenu: function () {
+        
+            return this._menu;
+        
+        },
+        
+        
+        /**
+        * @method getForm
+        * @description Returns a reference to the button's parent form.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-
+        * 20000929/level-one-html.html#ID-40002357">HTMLFormElement</a>}
+        */
+        getForm: function () {
+        
+            return this._button.form;
+        
+        },
+        
+        
+        /** 
+        * @method getHiddenFields
+        * @description Returns an <code>&#60;input&#62;</code> element or 
+        * array of form elements used to represent the button when its parent 
+        * form is submitted.  
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array}
+        */
+        getHiddenFields: function () {
+        
+            return this._hiddenFields;
+        
+        },
+        
+        
+        /**
+        * @method destroy
+        * @description Removes the button's element from its parent element and 
+        * removes all event handlers.
+        */
+        destroy: function () {
+        
+            this.logger.log("Destroying ...");
+        
+            var oElement = this.get("element"),
+                oParentNode = oElement.parentNode,
+                oMenu = this._menu;
+        
+            if (oMenu) {
+        
+                this.logger.log("Destroying menu.");
+        
+                oMenu.destroy();
+        
+            }
+        
+            this.logger.log("Removing DOM event handlers.");
+        
+            Event.purgeElement(oElement);
+            Event.purgeElement(this._button);
+            Event.removeListener(document, "mouseup", this._onDocumentMouseUp);
+            Event.removeListener(document, "keyup", this._onDocumentKeyUp);
+            Event.removeListener(document, "mousedown", 
+                this._onDocumentMouseDown);
+        
+        
+            var oForm = this.getForm();
+            
+            if (oForm) {
+        
+                Event.removeListener(oForm, "reset", this._onFormReset);
+                Event.removeListener(oForm, "submit", this.createHiddenFields);
+        
+            }
+        
+        
+            oParentNode.removeChild(oElement);
+        
+            this.logger.log("Removing from document.");
+        
+            delete m_oButtons[this.get("id")];
+        
+            this.logger.log("Destroyed.");
+        
+        },
+        
+        
+        fireEvent: function (p_sType , p_aArgs) {
+        
+            //  Disabled buttons should not respond to DOM events
+        
+            if (this.DOM_EVENTS[p_sType] && this.get("disabled")) {
+        
+                return;
+        
+            }
+        
+            YAHOO.widget.Button.superclass.fireEvent.call(this, p_sType, 
+                p_aArgs);
+        
+        },
+        
+        
+        /**
+        * @method toString
+        * @description Returns a string representing the button.
+        * @return {String}
+        */
+        toString: function () {
+        
+            return ("Button " + this.get("id"));
+        
+        }
+    
+    });
+    
+    
+    /**
+    * @method YAHOO.widget.Button.onFormKeyPress
+    * @description "keypress" event handler for the button's form.
+    * @param {Event} p_oEvent Object representing the DOM event object passed 
+    * back by the event utility (YAHOO.util.Event).
+    */
+    YAHOO.widget.Button.onFormKeyPress = function (p_oEvent) {
+    
+        var oTarget = Event.getTarget(p_oEvent),
+            nCharCode = Event.getCharCode(p_oEvent),
+            sNodeName = oTarget.nodeName && oTarget.nodeName.toUpperCase(),
+            sType = oTarget.type,
+    
+            /*
+                Boolean indicating if the form contains any enabled or 
+                disabled YUI submit buttons
+            */
+    
+            bFormContainsYUIButtons = false,
+    
+            oButton,
+    
+            oYUISubmitButton,   // The form's first, enabled YUI submit button
+    
+            /*
+                 The form's first, enabled HTML submit button that precedes any 
+                 YUI submit button
+            */
+    
+            oPrecedingSubmitButton,
+            
+    
+            /*
+                 The form's first, enabled HTML submit button that follows a 
+                 YUI button
+            */
+            
+            oFollowingSubmitButton; 
+    
+    
+        function isSubmitButton(p_oElement) {
+    
+            var sId,
+                oSrcElement;
+    
+            switch (p_oElement.nodeName.toUpperCase()) {
+    
+            case "INPUT":
+            case "BUTTON":
+            
+                if (p_oElement.type == "submit" && !p_oElement.disabled) {
+                    
+                    if (!bFormContainsYUIButtons && 
+                        !oPrecedingSubmitButton) {
+
+                        oPrecedingSubmitButton = p_oElement;
+
+                    }
+                    
+                    if (oYUISubmitButton && !oFollowingSubmitButton) {
+                    
+                        oFollowingSubmitButton = p_oElement;
+                    
+                    }
+                
+                }
+
+                break;
+            
+
+            default:
+            
+                sId = p_oElement.id;
+    
+                if (sId) {
+    
+                    oButton = m_oButtons[sId];
+        
+                    if (oButton) {
+
+                        bFormContainsYUIButtons = true;
+        
+                        if (!oButton.get("disabled")) {
+
+                            oSrcElement = oButton.get("srcelement");
+    
+                            if (!oYUISubmitButton &&
+                                (oButton.get("type") == "submit" || 
+                                (oSrcElement && oSrcElement.type == "submit"))) 
+                            {
+
+                                oYUISubmitButton = oButton;
+                            
+                            }
+                        
+                        }
+                        
+                    }
+                
+                }
+
+                break;
+    
+            }
+    
+        }
+    
+    
+        if (nCharCode == 13 && ((sNodeName == "INPUT" && (sType == "text" || 
+            sType == "password" || sType == "checkbox" || sType == "radio" || 
+            sType == "file") ) || sNodeName == "SELECT"))
+        {
+    
+            Dom.getElementsBy(isSubmitButton, "*", this);
+    
+    
+            if (oPrecedingSubmitButton) {
+    
+                /*
+                     Need to set focus to the first enabled submit button
+                     to make sure that IE includes its name and value 
+                     in the form's data set.
+                */
+    
+                oPrecedingSubmitButton.focus();
+            
+            }
+            else if (!oPrecedingSubmitButton && oYUISubmitButton) {
+    
+                if (oFollowingSubmitButton) {
+    
+                    /*
+                        Need to call "preventDefault" to ensure that 
+                        the name and value of the regular submit button 
+                        following the YUI button doesn't get added to the 
+                        form's data set when it is submitted.
+                    */
+    
+                    Event.preventDefault(p_oEvent);
+                
+                }
+    
+                oYUISubmitButton.submitForm();
+    
+            }
+            
+        }
+    
+    };
+    
+    
+    /**
+    * @method addHiddenFieldsToForm
+    * @description Searches the specified form and adds hidden fields for  
+    * instances of YAHOO.widget.Button that are of type "radio," "checkbox," 
+    * "menu," and "split."
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-40002357">HTMLFormElement</a>} p_oForm Object reference 
+    * for the form to search.
+    */
+    YAHOO.widget.Button.addHiddenFieldsToForm = function (p_oForm) {
+    
+        var aButtons = Dom.getElementsByClassName(
+                            YAHOO.widget.Button.prototype.CSS_CLASS_NAME, 
+                            "*", 
+                            p_oForm),
+    
+            nButtons = aButtons.length,
+            oButton,
+            sId,
+            i;
+    
+        if (nButtons > 0) {
+    
+            YAHOO.log("Form contains " + nButtons + " YUI buttons.");
+    
+            for (i = 0; i < nButtons; i++) {
+    
+                sId = aButtons[i].id;
+    
+                if (sId) {
+    
+                    oButton = m_oButtons[sId];
+        
+                    if (oButton) {
+           
+                        oButton.createHiddenFields();
+                        
+                    }
+                
+                }
+            
+            }
+    
+        }
+    
+    };
+    
+    
+    
+    // Events
+    
+    
+    /**
+    * @event focus
+    * @description Fires when the menu item receives focus.  Passes back a  
+    * single object representing the original DOM event object passed back by 
+    * the event utility (YAHOO.util.Event) when the event was fired.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> 
+    * for more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+    
+    
+    /**
+    * @event blur
+    * @description Fires when the menu item loses the input focus.  Passes back  
+    * a single object representing the original DOM event object passed back by 
+    * the event utility (YAHOO.util.Event) when the event was fired.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for  
+    * more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+    
+    
+    /**
+    * @event option
+    * @description Fires when the user invokes the button's option.  Passes 
+    * back a single object representing the original DOM event (either 
+    * "mousedown" or "keydown") that caused the "option" event to fire.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> 
+    * for more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+
+})();
+(function () {
+
+    // Shorthard for utilities
+    
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang,
+        Button = YAHOO.widget.Button,  
+    
+        // Private collection of radio buttons
+    
+        m_oButtons = {};
+
+
+
+    /**
+    * The ButtonGroup class creates a set of buttons that are mutually 
+    * exclusive; checking one button in the set will uncheck all others in the 
+    * button group.
+    * @param {String} p_oElement String specifying the id attribute of the 
+    * <code>&#60;div&#62;</code> element of the button group.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+    * specifying the <code>&#60;div&#62;</code> element of the button group.
+    * @param {Object} p_oElement Object literal specifying a set of 
+    * configuration attributes used to create the button group.
+    * @param {Object} p_oAttributes Optional. Object literal specifying a set 
+    * of configuration attributes used to create the button group.
+    * @namespace YAHOO.widget
+    * @class ButtonGroup
+    * @constructor
+    * @extends YAHOO.util.Element
+    */
+    YAHOO.widget.ButtonGroup = function (p_oElement, p_oAttributes) {
+    
+        var fnSuperClass = YAHOO.widget.ButtonGroup.superclass.constructor,
+            sNodeName,
+            oElement,
+            sId;
+    
+        if (arguments.length == 1 && !Lang.isString(p_oElement) && 
+            !p_oElement.nodeName) {
+    
+            if (!p_oElement.id) {
+    
+                sId = Dom.generateId();
+    
+                p_oElement.id = sId;
+    
+                YAHOO.log("No value specified for the button group's \"id\"" +
+                    " attribute. Setting button group id to \"" + sId + "\".",
+                    "warn");
+    
+            }
+    
+            this.logger = new YAHOO.widget.LogWriter("ButtonGroup " + sId);
+    
+            this.logger.log("No source HTML element.  Building the button " +
+                    "group using the set of configuration attributes.");
+    
+            fnSuperClass.call(this, (this._createGroupElement()), p_oElement);
+    
+        }
+        else if (Lang.isString(p_oElement)) {
+    
+            oElement = Dom.get(p_oElement);
+    
+            if (oElement) {
+            
+                if (oElement.nodeName.toUpperCase() == this.NODE_NAME) {
+    
+                    this.logger = 
+                        new YAHOO.widget.LogWriter("ButtonGroup " + p_oElement);
+            
+                    fnSuperClass.call(this, oElement, p_oAttributes);
+    
+                }
+    
+            }
+        
+        }
+        else {
+    
+            sNodeName = p_oElement.nodeName;
+    
+            if (sNodeName && sNodeName == this.NODE_NAME) {
+        
+                if (!p_oElement.id) {
+        
+                    p_oElement.id = Dom.generateId();
+        
+                    YAHOO.log("No value specified for the button group's" +
+                        " \"id\" attribute. Setting button group id " +
+                        "to \"" + p_oElement.id + "\".", "warn");
+        
+                }
+        
+                this.logger = 
+                    new YAHOO.widget.LogWriter("ButtonGroup " + p_oElement.id);
+        
+                fnSuperClass.call(this, p_oElement, p_oAttributes);
+    
+            }
+    
+        }
+    
+    };
+    
+    
+    YAHOO.extend(YAHOO.widget.ButtonGroup, YAHOO.util.Element, {
+    
+    
+        // Protected properties
+        
+        
+        /** 
+        * @property _buttons
+        * @description Array of buttons in the button group.
+        * @default null
+        * @protected
+        * @type Array
+        */
+        _buttons: null,
+        
+        
+        
+        // Constants
+        
+        
+        /**
+        * @property NODE_NAME
+        * @description The name of the tag to be used for the button 
+        * group's element. 
+        * @default "DIV"
+        * @final
+        * @type String
+        */
+        NODE_NAME: "DIV",
+        
+        
+        /**
+        * @property CSS_CLASS_NAME
+        * @description String representing the CSS class(es) to be applied  
+        * to the button group's element.
+        * @default "yui-buttongroup"
+        * @final
+        * @type String
+        */
+        CSS_CLASS_NAME: "yui-buttongroup",
+    
+    
+    
+        // Protected methods
+        
+        
+        /**
+        * @method _createGroupElement
+        * @description Creates the button group's element.
+        * @protected
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-22445964">HTMLDivElement</a>}
+        */
+        _createGroupElement: function () {
+        
+            var oElement = document.createElement(this.NODE_NAME);
+        
+            return oElement;
+        
+        },
+        
+        
+        
+        // Protected attribute setter methods
+        
+        
+        /**
+        * @method _setDisabled
+        * @description Sets the value of the button groups's 
+        * "disabled" attribute.
+        * @protected
+        * @param {Boolean} p_bDisabled Boolean indicating the value for
+        * the button group's "disabled" attribute.
+        */
+        _setDisabled: function (p_bDisabled) {
+        
+            var nButtons = this.getCount(),
+                i;
+        
+            if (nButtons > 0) {
+        
+                i = nButtons - 1;
+                
+                do {
+        
+                    this._buttons[i].set("disabled", p_bDisabled);
+                
+                }
+                while (i--);
+        
+            }
+        
+        },
+        
+        
+        
+        // Protected event handlers
+        
+        
+        /**
+        * @method _onKeyDown
+        * @description "keydown" event handler for the button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyDown: function (p_oEvent) {
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                nCharCode = Event.getCharCode(p_oEvent),
+                sId = oTarget.parentNode.parentNode.id,
+                oButton = m_oButtons[sId],
+                nIndex = -1;
+        
+        
+            if (nCharCode == 37 || nCharCode == 38) {
+        
+                nIndex = (oButton.index === 0) ? 
+                            (this._buttons.length - 1) : (oButton.index - 1);
+            
+            }
+            else if (nCharCode == 39 || nCharCode == 40) {
+        
+                nIndex = (oButton.index === (this._buttons.length - 1)) ? 
+                            0 : (oButton.index + 1);
+        
+            }
+        
+        
+            if (nIndex > -1) {
+        
+                this.check(nIndex);
+                this.getButton(nIndex).focus();
+            
+            }        
+        
+        },
+        
+        
+        /**
+        * @method _onAppendTo
+        * @description "appendTo" event handler for the button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the event that was fired.
+        */
+        _onAppendTo: function (p_oEvent) {
+        
+            var aButtons = this._buttons,
+                nButtons = aButtons.length,
+                i;
+        
+            for (i = 0; i < nButtons; i++) {
+        
+                aButtons[i].appendTo(this.get("element"));
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onButtonCheckedChange
+        * @description "checkedChange" event handler for each button in the 
+        * button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the event that was fired.
+        * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}  
+        * p_oButton Object representing the button that fired the event.
+        */
+        _onButtonCheckedChange: function (p_oEvent, p_oButton) {
+        
+            var bChecked = p_oEvent.newValue,
+                oCheckedButton = this.get("checkedButton");
+        
+            if (bChecked && oCheckedButton != p_oButton) {
+        
+                if (oCheckedButton) {
+        
+                    oCheckedButton.set("checked", false, true);
+        
+                }
+        
+                this.set("checkedButton", p_oButton);
+                this.set("value", p_oButton.get("value"));
+        
+            }
+            else if (oCheckedButton && !oCheckedButton.set("checked")) {
+        
+                oCheckedButton.set("checked", true, true);
+        
+            }
+           
+        },
+        
+        
+        
+        // Public methods
+        
+        
+        /**
+        * @method init
+        * @description The ButtonGroup class's initialization method.
+        * @param {String} p_oElement String specifying the id attribute of the 
+        * <code>&#60;div&#62;</code> element of the button group.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+        * specifying the <code>&#60;div&#62;</code> element of the button group.
+        * @param {Object} p_oElement Object literal specifying a set of  
+        * configuration attributes used to create the button group.
+        * @param {Object} p_oAttributes Optional. Object literal specifying a
+        * set of configuration attributes used to create the button group.
+        */
+        init: function (p_oElement, p_oAttributes) {
+        
+            this._buttons = [];
+        
+            YAHOO.widget.ButtonGroup.superclass.init.call(this, p_oElement, 
+                    p_oAttributes);
+        
+            this.addClass(this.CSS_CLASS_NAME);
+        
+            this.logger.log("Searching for child nodes with the class name " +
+                "\"yui-radio-button\" to add to the button group.");
+        
+            var aButtons = this.getElementsByClassName("yui-radio-button");
+        
+        
+            if (aButtons.length > 0) {
+        
+                this.logger.log("Found " + aButtons.length + 
+                    " child nodes with the class name \"yui-radio-button.\"" + 
+                    "  Attempting to add to button group.");
+        
+                this.addButtons(aButtons);
+        
+            }
+        
+        
+            this.logger.log("Searching for child nodes with the type of " +
+                " \"radio\" to add to the button group.");
+        
+            function isRadioButton(p_oElement) {
+        
+                return (p_oElement.type == "radio");
+        
+            }
+        
+            aButtons = 
+                Dom.getElementsBy(isRadioButton, "input", this.get("element"));
+        
+        
+            if (aButtons.length > 0) {
+        
+                this.logger.log("Found " + aButtons.length + " child nodes" +
+                    " with the type of \"radio.\"  Attempting to add to" +
+                    " button group.");
+        
+                this.addButtons(aButtons);
+        
+            }
+        
+            this.on("keydown", this._onKeyDown);
+            this.on("appendTo", this._onAppendTo);
+        
+
+            var oContainer = this.get("container");
+
+            if (oContainer) {
+        
+                if (Lang.isString(oContainer)) {
+        
+                    Event.onContentReady(oContainer, function () {
+        
+                        this.appendTo(oContainer);            
+                    
+                    }, null, this);
+        
+                }
+                else {
+        
+                    this.appendTo(oContainer);
+        
+                }
+        
+            }
+        
+        
+            this.logger.log("Initialization completed.");
+        
+        },
+        
+        
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to  
+        * create the button group.
+        * @param {Object} p_oAttributes Object literal specifying a set of 
+        * configuration attributes used to create the button group.
+        */
+        initAttributes: function (p_oAttributes) {
+        
+            var oAttributes = p_oAttributes || {};
+        
+            YAHOO.widget.ButtonGroup.superclass.initAttributes.call(
+                this, oAttributes);
+        
+        
+            /**
+            * @config name
+            * @description String specifying the name for the button group.  
+            * This name will be applied to each button in the button group.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("name", {
+        
+                value: oAttributes.name,
+                validator: Lang.isString
+        
+            });
+        
+        
+            /**
+            * @config disabled
+            * @description Boolean indicating if the button group should be 
+            * disabled.  Disabling the button group will disable each button 
+            * in the button group.  Disabled buttons are dimmed and will not 
+            * respond to user input or fire events.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("disabled", {
+        
+                value: (oAttributes.disabled || false),
+                validator: Lang.isBoolean,
+                method: this._setDisabled
+        
+            });
+        
+        
+            /**
+            * @config value
+            * @description Object specifying the value for the button group.
+            * @default null
+            * @type Object
+            */
+            this.setAttributeConfig("value", {
+        
+                value: oAttributes.value
+        
+            });
+        
+        
+            /**
+            * @config container
+            * @description HTML element reference or string specifying the id 
+            * attribute of the HTML element that the button group's markup
+            * should be rendered into.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("container", {
+        
+                value: oAttributes.container,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @config checkedButton
+            * @description Reference for the button in the button group that 
+            * is checked.
+            * @type {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+            * @default null
+            */
+            this.setAttributeConfig("checkedButton", {
+        
+                value: null
+        
+            });
+        
+        },
+        
+        
+        /**
+        * @method addButton
+        * @description Adds the button to the button group.
+        * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}  
+        * p_oButton Object reference for the <a href="YAHOO.widget.Button.html">
+        * YAHOO.widget.Button</a> instance to be added to the button group.
+        * @param {String} p_oButton String specifying the id attribute of the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> element 
+        * to be used to create the button to be added to the button group.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href="
+        * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#
+        * ID-33759296">HTMLElement</a>} p_oButton Object reference for the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> element 
+        * to be used to create the button to be added to the button group.
+        * @param {Object} p_oButton Object literal specifying a set of 
+        * <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> 
+        * configuration attributes used to configure the button to be added to 
+        * the button group.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} 
+        */
+        addButton: function (p_oButton) {
+        
+            var oButton,
+                oButtonElement,
+                oGroupElement,
+                nIndex,
+                sButtonName,
+                sGroupName;
+        
+        
+            if (p_oButton instanceof Button && 
+                p_oButton.get("type") == "radio") {
+        
+                oButton = p_oButton;
+        
+            }
+            else if (!Lang.isString(p_oButton) && !p_oButton.nodeName) {
+        
+                p_oButton.type = "radio";
+        
+                oButton = new Button(p_oButton);
+
+            }
+            else {
+        
+                oButton = new Button(p_oButton, { type: "radio" });
+        
+            }
+        
+        
+            if (oButton) {
+        
+                nIndex = this._buttons.length;
+                sButtonName = oButton.get("name");
+                sGroupName = this.get("name");
+        
+                oButton.index = nIndex;
+        
+                this._buttons[nIndex] = oButton;
+                m_oButtons[oButton.get("id")] = oButton;
+        
+        
+                if (sButtonName != sGroupName) {
+        
+                    oButton.set("name", sGroupName);
+                
+                }
+        
+        
+                if (this.get("disabled")) {
+        
+                    oButton.set("disabled", true);
+        
+                }
+        
+        
+                if (oButton.get("checked")) {
+        
+                    this.set("checkedButton", oButton);
+        
+                }
+
+                
+                oButtonElement = oButton.get("element");
+                oGroupElement = this.get("element");
+                
+                if (oButtonElement.parentNode != oGroupElement) {
+                
+                    oGroupElement.appendChild(oButtonElement);
+                
+                }
+        
+                
+                oButton.on("checkedChange", 
+                    this._onButtonCheckedChange, oButton, this);
+        
+                this.logger.log("Button " + oButton.get("id") + " added.");
+        
+                return oButton;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method addButtons
+        * @description Adds the array of buttons to the button group.
+        * @param {Array} p_aButtons Array of <a href="YAHOO.widget.Button.html">
+        * YAHOO.widget.Button</a> instances to be added 
+        * to the button group.
+        * @param {Array} p_aButtons Array of strings specifying the id 
+        * attribute of the <code>&#60;input&#62;</code> or <code>&#60;span&#62;
+        * </code> elements to be used to create the buttons to be added to the 
+        * button group.
+        * @param {Array} p_aButtons Array of object references for the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> elements 
+        * to be used to create the buttons to be added to the button group.
+        * @param {Array} p_aButtons Array of object literals, each containing
+        * a set of <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>  
+        * configuration attributes used to configure each button to be added 
+        * to the button group.
+        * @return {Array}
+        */
+        addButtons: function (p_aButtons) {
+    
+            var nButtons,
+                oButton,
+                aButtons,
+                i;
+        
+            if (Lang.isArray(p_aButtons)) {
+            
+                nButtons = p_aButtons.length;
+                aButtons = [];
+        
+                if (nButtons > 0) {
+        
+                    for (i = 0; i < nButtons; i++) {
+        
+                        oButton = this.addButton(p_aButtons[i]);
+                        
+                        if (oButton) {
+        
+                            aButtons[aButtons.length] = oButton;
+        
+                        }
+                    
+                    }
+        
+                    if (aButtons.length > 0) {
+        
+                        this.logger.log(aButtons.length + " buttons added.");
+        
+                        return aButtons;
+        
+                    }
+                
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeButton
+        * @description Removes the button at the specified index from the 
+        * button group.
+        * @param {Number} p_nIndex Number specifying the index of the button 
+        * to be removed from the button group.
+        */
+        removeButton: function (p_nIndex) {
+        
+            var oButton = this.getButton(p_nIndex),
+                nButtons,
+                i;
+            
+            if (oButton) {
+        
+                this.logger.log("Removing button " + oButton.get("id") + ".");
+        
+                this._buttons.splice(p_nIndex, 1);
+                delete m_oButtons[oButton.get("id")];
+        
+                oButton.removeListener("checkedChange", 
+                    this._onButtonCheckedChange);
+
+                oButton.destroy();
+        
+        
+                nButtons = this._buttons.length;
+                
+                if (nButtons > 0) {
+        
+                    i = this._buttons.length - 1;
+                    
+                    do {
+        
+                        this._buttons[i].index = i;
+        
+                    }
+                    while (i--);
+                
+                }
+        
+                this.logger.log("Button " + oButton.get("id") + " removed.");
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method getButton
+        * @description Returns the button at the specified index.
+        * @param {Number} p_nIndex The index of the button to retrieve from the 
+        * button group.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        */
+        getButton: function (p_nIndex) {
+        
+            if (Lang.isNumber(p_nIndex)) {
+        
+                return this._buttons[p_nIndex];
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method getButtons
+        * @description Returns an array of the buttons in the button group.
+        * @return {Array}
+        */
+        getButtons: function () {
+        
+            return this._buttons;
+        
+        },
+        
+        
+        /**
+        * @method getCount
+        * @description Returns the number of buttons in the button group.
+        * @return {Number}
+        */
+        getCount: function () {
+        
+            return this._buttons.length;
+        
+        },
+        
+        
+        /**
+        * @method focus
+        * @description Sets focus to the button at the specified index.
+        * @param {Number} p_nIndex Number indicating the index of the button 
+        * to focus. 
+        */
+        focus: function (p_nIndex) {
+        
+            var oButton,
+                nButtons,
+                i;
+        
+            if (Lang.isNumber(p_nIndex)) {
+        
+                oButton = this._buttons[p_nIndex];
+                
+                if (oButton) {
+        
+                    oButton.focus();
+        
+                }
+            
+            }
+            else {
+        
+                nButtons = this.getCount();
+        
+                for (i = 0; i < nButtons; i++) {
+        
+                    oButton = this._buttons[i];
+        
+                    if (!oButton.get("disabled")) {
+        
+                        oButton.focus();
+                        break;
+        
+                    }
+        
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method check
+        * @description Checks the button at the specified index.
+        * @param {Number} p_nIndex Number indicating the index of the button 
+        * to check. 
+        */
+        check: function (p_nIndex) {
+        
+            var oButton = this.getButton(p_nIndex);
+            
+            if (oButton) {
+        
+                oButton.set("checked", true);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method destroy
+        * @description Removes the button group's element from its parent 
+        * element and removes all event handlers.
+        */
+        destroy: function () {
+        
+            this.logger.log("Destroying...");
+        
+            var nButtons = this._buttons.length,
+                oElement = this.get("element"),
+                oParentNode = oElement.parentNode,
+                i;
+            
+            if (nButtons > 0) {
+        
+                i = this._buttons.length - 1;
+        
+                do {
+        
+                    this._buttons[i].destroy();
+        
+                }
+                while (i--);
+            
+            }
+        
+            this.logger.log("Removing DOM event handlers.");
+        
+            Event.purgeElement(oElement);
+            
+            this.logger.log("Removing from document.");
+        
+            oParentNode.removeChild(oElement);
+        
+        },
+        
+        
+        /**
+        * @method toString
+        * @description Returns a string representing the button group.
+        * @return {String}
+        */
+        toString: function () {
+        
+            return ("ButtonGroup " + this.get("id"));
+        
+        }
+    
+    });
+
+})();
+YAHOO.register("button", YAHOO.widget.Button, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/button/button-beta-min.js b/lib/yui/button/button-beta-min.js
new file mode 100755 (executable)
index 0000000..be19b02
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
+(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.lang,Overlay=YAHOO.widget.Overlay,Menu=YAHOO.widget.Menu,m_oButtons={},m_oOverlayManager=null,m_oSubmitTrigger=null,m_oFocusedButton=null;function createInputElement(p_sType,p_sName,p_sValue,p_bChecked){var oInput,sInput;if(Lang.isString(p_sType)&&Lang.isString(p_sName)){if(YAHOO.env.ua.ie){sInput="<input type=\""+p_sType+"\" name=\""+
+p_sName+"\"";if(p_bChecked){sInput+=" checked";}
+sInput+=">";oInput=document.createElement(sInput);}
+else{oInput=document.createElement("input");oInput.name=p_sName;oInput.type=p_sType;if(p_bChecked){oInput.checked=true;}}
+oInput.value=p_sValue;return oInput;}}
+function setAttributesFromSrcElement(p_oElement,p_oAttributes){var sSrcElementNodeName=p_oElement.nodeName.toUpperCase(),me=this,oAttribute,oRootNode,sText;function setAttributeFromDOMAttribute(p_sAttribute){if(!(p_sAttribute in p_oAttributes)){oAttribute=p_oElement.getAttributeNode(p_sAttribute);if(oAttribute&&("value"in oAttribute)){p_oAttributes[p_sAttribute]=oAttribute.value;}}}
+function setFormElementProperties(){setAttributeFromDOMAttribute("type");if(p_oAttributes.type=="button"){p_oAttributes.type="push";}
+if(!("disabled"in p_oAttributes)){p_oAttributes.disabled=p_oElement.disabled;}
+setAttributeFromDOMAttribute("name");setAttributeFromDOMAttribute("value");setAttributeFromDOMAttribute("title");}
+switch(sSrcElementNodeName){case"A":p_oAttributes.type="link";setAttributeFromDOMAttribute("href");setAttributeFromDOMAttribute("target");break;case"INPUT":setFormElementProperties();if(!("checked"in p_oAttributes)){p_oAttributes.checked=p_oElement.checked;}
+break;case"BUTTON":setFormElementProperties();oRootNode=p_oElement.parentNode.parentNode;if(Dom.hasClass(oRootNode,this.CSS_CLASS_NAME+"-checked")){p_oAttributes.checked=true;}
+if(Dom.hasClass(oRootNode,this.CSS_CLASS_NAME+"-disabled")){p_oAttributes.disabled=true;}
+p_oElement.removeAttribute("value");p_oElement.setAttribute("type","button");break;}
+p_oElement.removeAttribute("id");p_oElement.removeAttribute("name");if(!("tabindex"in p_oAttributes)){p_oAttributes.tabindex=p_oElement.tabIndex;}
+if(!("label"in p_oAttributes)){sText=sSrcElementNodeName=="INPUT"?p_oElement.value:p_oElement.innerHTML;if(sText&&sText.length>0){p_oAttributes.label=sText;}}}
+function initConfig(p_oConfig){var oAttributes=p_oConfig.attributes,oSrcElement=oAttributes.srcelement,sSrcElementNodeName=oSrcElement.nodeName.toUpperCase(),me=this;if(sSrcElementNodeName==this.NODE_NAME){p_oConfig.element=oSrcElement;p_oConfig.id=oSrcElement.id;Dom.getElementsBy(function(p_oElement){switch(p_oElement.nodeName.toUpperCase()){case"BUTTON":case"A":case"INPUT":setAttributesFromSrcElement.call(me,p_oElement,oAttributes);break;}},"*",oSrcElement);}
+else{switch(sSrcElementNodeName){case"BUTTON":case"A":case"INPUT":setAttributesFromSrcElement.call(this,oSrcElement,oAttributes);break;}}}
+YAHOO.widget.Button=function(p_oElement,p_oAttributes){var fnSuperClass=YAHOO.widget.Button.superclass.constructor,oConfig,oElement;if(arguments.length==1&&!Lang.isString(p_oElement)&&!p_oElement.nodeName){if(!p_oElement.id){p_oElement.id=Dom.generateId();}
+fnSuperClass.call(this,(this.createButtonElement(p_oElement.type)),p_oElement);}
+else{oConfig={element:null,attributes:(p_oAttributes||{})};if(Lang.isString(p_oElement)){oElement=Dom.get(p_oElement);if(oElement){if(!oConfig.attributes.id){oConfig.attributes.id=p_oElement;}
+oConfig.attributes.srcelement=oElement;initConfig.call(this,oConfig);if(!oConfig.element){oConfig.element=this.createButtonElement(oConfig.attributes.type);}
+fnSuperClass.call(this,oConfig.element,oConfig.attributes);}}
+else if(p_oElement.nodeName){if(!oConfig.attributes.id){if(p_oElement.id){oConfig.attributes.id=p_oElement.id;}
+else{oConfig.attributes.id=Dom.generateId();}}
+oConfig.attributes.srcelement=p_oElement;initConfig.call(this,oConfig);if(!oConfig.element){oConfig.element=this.createButtonElement(oConfig.attributes.type);}
+fnSuperClass.call(this,oConfig.element,oConfig.attributes);}}};YAHOO.extend(YAHOO.widget.Button,YAHOO.util.Element,{_button:null,_menu:null,_hiddenFields:null,_onclickAttributeValue:null,_activationKeyPressed:false,_activationButtonPressed:false,_hasKeyEventHandlers:false,_hasMouseEventHandlers:false,NODE_NAME:"SPAN",CHECK_ACTIVATION_KEYS:[32],ACTIVATION_KEYS:[13,32],OPTION_AREA_WIDTH:20,CSS_CLASS_NAME:"yui-button",RADIO_DEFAULT_TITLE:"Unchecked.  Click to check.",RADIO_CHECKED_TITLE:"Checked.  Click to uncheck.",CHECKBOX_DEFAULT_TITLE:"Unchecked.  Click to check.",CHECKBOX_CHECKED_TITLE:"Checked.  Click to uncheck.",MENUBUTTON_DEFAULT_TITLE:"Menu collapsed.  Click to expand.",MENUBUTTON_MENU_VISIBLE_TITLE:"Menu expanded.  Click or press Esc to collapse.",SPLITBUTTON_DEFAULT_TITLE:("Menu collapsed.  Click inside option "+"region or press Ctrl + Shift + M to show the menu."),SPLITBUTTON_OPTION_VISIBLE_TITLE:"Menu expanded.  Press Esc or Ctrl + Shift + M to hide the menu.",SUBMIT_TITLE:"Click to submit form.",_setType:function(p_sType){if(p_sType=="split"){this.on("option",this._onOption);}},_setLabel:function(p_sLabel){this._button.innerHTML=p_sLabel;},_setTabIndex:function(p_nTabIndex){this._button.tabIndex=p_nTabIndex;},_setTitle:function(p_sTitle){var sTitle=p_sTitle;if(this.get("type")!="link"){if(!sTitle){switch(this.get("type")){case"radio":sTitle=this.RADIO_DEFAULT_TITLE;break;case"checkbox":sTitle=this.CHECKBOX_DEFAULT_TITLE;break;case"menu":sTitle=this.MENUBUTTON_DEFAULT_TITLE;break;case"split":sTitle=this.SPLITBUTTON_DEFAULT_TITLE;break;case"submit":sTitle=this.SUBMIT_TITLE;break;}}
+this._button.title=sTitle;}},_setDisabled:function(p_bDisabled){if(this.get("type")!="link"){if(p_bDisabled){if(this._menu){this._menu.hide();}
+if(this.hasFocus()){this.blur();}
+this._button.setAttribute("disabled","disabled");this.addStateCSSClasses("disabled");}
+else{this._button.removeAttribute("disabled");this.removeStateCSSClasses("disabled");}}},_setHref:function(p_sHref){if(this.get("type")=="link"){this._button.href=p_sHref;}},_setTarget:function(p_sTarget){if(this.get("type")=="link"){this._button.setAttribute("target",p_sTarget);}},_setChecked:function(p_bChecked){var sType=this.get("type"),sTitle;if(sType=="checkbox"||sType=="radio"){if(p_bChecked){this.addStateCSSClasses("checked");sTitle=(sType=="radio")?this.RADIO_CHECKED_TITLE:this.CHECKBOX_CHECKED_TITLE;}
+else{this.removeStateCSSClasses("checked");sTitle=(sType=="radio")?this.RADIO_DEFAULT_TITLE:this.CHECKBOX_DEFAULT_TITLE;}
+this.set("title",sTitle);}},_setMenu:function(p_oMenu){var bLazyLoad=this.get("lazyloadmenu"),oButtonElement=this.get("element"),bInstance=false,oMenu,oMenuElement,oSrcElement,aItems,nItems,oItem,i;if(!Overlay){return false;}
+if(!Menu){return false;}
+function onAppendTo(){oMenu.render(oButtonElement.parentNode);this.removeListener("appendTo",onAppendTo);}
+function initMenu(){if(oMenu){Dom.addClass(oMenu.element,this.get("menuclassname"));Dom.addClass(oMenu.element,"yui-"+this.get("type")+"-button-menu");oMenu.showEvent.subscribe(this._onMenuShow,null,this);oMenu.hideEvent.subscribe(this._onMenuHide,null,this);oMenu.renderEvent.subscribe(this._onMenuRender,null,this);if(oMenu instanceof Menu){oMenu.keyDownEvent.subscribe(this._onMenuKeyDown,this,true);oMenu.clickEvent.subscribe(this._onMenuClick,this,true);oMenu.itemAddedEvent.subscribe(this._onMenuItemAdded,this,true);oSrcElement=oMenu.srcElement;if(oSrcElement&&oSrcElement.nodeName.toUpperCase()=="SELECT"){oSrcElement.style.display="none";oSrcElement.parentNode.removeChild(oSrcElement);}}
+else if(oMenu instanceof Overlay){if(!m_oOverlayManager){m_oOverlayManager=new YAHOO.widget.OverlayManager();}
+m_oOverlayManager.register(oMenu);}
+this._menu=oMenu;if(!bInstance){if(bLazyLoad&&!(oMenu instanceof Menu)){oMenu.beforeShowEvent.subscribe(this._onOverlayBeforeShow,null,this);}
+else if(!bLazyLoad){if(Dom.inDocument(oButtonElement)){oMenu.render(oButtonElement.parentNode);}
+else{this.on("appendTo",onAppendTo);}}}}}
+if(p_oMenu&&(p_oMenu instanceof Menu)){oMenu=p_oMenu;aItems=oMenu.getItems();nItems=aItems.length;bInstance=true;if(nItems>0){i=nItems-1;do{oItem=aItems[i];if(oItem){oItem.cfg.subscribeToConfigEvent("selected",this._onMenuItemSelected,oItem,this);}}
+while(i--);}
+initMenu.call(this);}
+else if(p_oMenu&&(p_oMenu instanceof Overlay)){oMenu=p_oMenu;bInstance=true;oMenu.cfg.setProperty("visible",false);oMenu.cfg.setProperty("context",[oButtonElement,"tl","bl"]);initMenu.call(this);}
+else if(Lang.isArray(p_oMenu)){this.on("appendTo",function(){oMenu=new Menu(Dom.generateId(),{lazyload:bLazyLoad,itemdata:p_oMenu});initMenu.call(this);});}
+else if(Lang.isString(p_oMenu)){oMenuElement=Dom.get(p_oMenu);if(oMenuElement){if(Dom.hasClass(oMenuElement,Menu.prototype.CSS_CLASS_NAME)||oMenuElement.nodeName=="SELECT"){oMenu=new Menu(p_oMenu,{lazyload:bLazyLoad});initMenu.call(this);}
+else{oMenu=new Overlay(p_oMenu,{visible:false,context:[oButtonElement,"tl","bl"]});initMenu.call(this);}}}
+else if(p_oMenu&&p_oMenu.nodeName){if(Dom.hasClass(p_oMenu,Menu.prototype.CSS_CLASS_NAME)||p_oMenu.nodeName=="SELECT"){oMenu=new Menu(p_oMenu,{lazyload:bLazyLoad});initMenu.call(this);}
+else{if(!p_oMenu.id){Dom.generateId(p_oMenu);}
+oMenu=new Overlay(p_oMenu,{visible:false,context:[oButtonElement,"tl","bl"]});initMenu.call(this);}}},_setOnClick:function(p_oObject){if(this._onclickAttributeValue&&(this._onclickAttributeValue!=p_oObject)){this.removeListener("click",this._onclickAttributeValue.fn);this._onclickAttributeValue=null;}
+if(!this._onclickAttributeValue&&Lang.isObject(p_oObject)&&Lang.isFunction(p_oObject.fn)){this.on("click",p_oObject.fn,p_oObject.obj,p_oObject.scope);this._onclickAttributeValue=p_oObject;}},_setSelectedMenuItem:function(p_nIndex){var oMenu=this._menu,oMenuItem;if(oMenu&&oMenu instanceof Menu){oMenuItem=oMenu.getItem(p_nIndex);if(oMenuItem&&!oMenuItem.cfg.getProperty("selected")){oMenuItem.cfg.setProperty("selected",true);}}},_isActivationKey:function(p_nKeyCode){var sType=this.get("type"),aKeyCodes=(sType=="checkbox"||sType=="radio")?this.CHECK_ACTIVATION_KEYS:this.ACTIVATION_KEYS,nKeyCodes=aKeyCodes.length,i;if(nKeyCodes>0){i=nKeyCodes-1;do{if(p_nKeyCode==aKeyCodes[i]){return true;}}
+while(i--);}},_isSplitButtonOptionKey:function(p_oEvent){return(p_oEvent.ctrlKey&&p_oEvent.shiftKey&&Event.getCharCode(p_oEvent)==77);},_addListenersToForm:function(){var oForm=this.getForm(),oSrcElement,aListeners,nListeners,i,bHasKeyPressListener;if(oForm){Event.on(oForm,"reset",this._onFormReset,null,this);Event.on(oForm,"submit",this.createHiddenFields,null,this);oSrcElement=this.get("srcelement");if(this.get("type")=="submit"||(oSrcElement&&oSrcElement.type=="submit"))
+{aListeners=Event.getListeners(oForm,"keypress");bHasKeyPressListener=false;if(aListeners){nListeners=aListeners.length;if(nListeners>0){i=nListeners-1;do{if(aListeners[i].fn==YAHOO.widget.Button.onFormKeyPress)
+{bHasKeyPressListener=true;break;}}
+while(i--);}}
+if(!bHasKeyPressListener){Event.on(oForm,"keypress",YAHOO.widget.Button.onFormKeyPress);}}}},_originalMaxHeight:-1,_showMenu:function(p_oEvent){YAHOO.widget.MenuManager.hideVisible();if(m_oOverlayManager){m_oOverlayManager.hideAll();}
+var oMenu=this._menu,nViewportHeight=Dom.getViewportHeight(),nMenuHeight,nScrollTop,nY;if(oMenu&&(oMenu instanceof Menu)){oMenu.cfg.applyConfig({context:[this.get("id"),"tl","bl"],constraintoviewport:false,clicktohide:false,visible:true});oMenu.cfg.fireQueue();oMenu.align("tl","bl");if(p_oEvent.type=="mousedown"){Event.stopPropagation(p_oEvent);}
+if(this.get("focusmenu")){this._menu.focus();}
+nMenuHeight=oMenu.element.offsetHeight;if((oMenu.cfg.getProperty("y")+nMenuHeight)>nViewportHeight){oMenu.align("bl","tl");nY=oMenu.cfg.getProperty("y");nScrollTop=Dom.getDocumentScrollTop();if(nScrollTop>=nY){if(this._originalMaxHeight==-1){this._originalMaxHeight=oMenu.cfg.getProperty("maxheight");}
+oMenu.cfg.setProperty("maxheight",(nMenuHeight-((nScrollTop-nY)+20)));oMenu.align("bl","tl");}}}
+else if(oMenu&&(oMenu instanceof Overlay)){oMenu.show();oMenu.align("tl","bl");nMenuHeight=oMenu.element.offsetHeight;if((oMenu.cfg.getProperty("y")+nMenuHeight)>nViewportHeight){oMenu.align("bl","tl");}}},_hideMenu:function(){var oMenu=this._menu;if(oMenu){oMenu.hide();}},_onMouseOver:function(p_oEvent){if(!this._hasMouseEventHandlers){this.on("mouseout",this._onMouseOut);this.on("mousedown",this._onMouseDown);this.on("mouseup",this._onMouseUp);this._hasMouseEventHandlers=true;}
+this.addStateCSSClasses("hover");if(this._activationButtonPressed){this.addStateCSSClasses("active");}
+if(this._bOptionPressed){this.addStateCSSClasses("activeoption");}},_onMouseOut:function(p_oEvent){this.removeStateCSSClasses("hover");if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}
+if(this._activationButtonPressed||this._bOptionPressed){Event.on(document,"mouseup",this._onDocumentMouseUp,null,this);}},_onDocumentMouseUp:function(p_oEvent){this._activationButtonPressed=false;this._bOptionPressed=false;var sType=this.get("type");if(sType=="menu"||sType=="split"){this.removeStateCSSClasses((sType=="menu"?"active":"activeoption"));this._hideMenu();}
+Event.removeListener(document,"mouseup",this._onDocumentMouseUp);},_onMouseDown:function(p_oEvent){var sType,oElement,nX,me;function onMouseUp(){this._hideMenu();this.removeListener("mouseup",onMouseUp);}
+if((p_oEvent.which||p_oEvent.button)==1){if(!this.hasFocus()){this.focus();}
+sType=this.get("type");if(sType=="split"){oElement=this.get("element");nX=Event.getPageX(p_oEvent)-Dom.getX(oElement);if((oElement.offsetWidth-this.OPTION_AREA_WIDTH)<nX){this.fireEvent("option",p_oEvent);}
+else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}}
+else if(sType=="menu"){if(this.isActive()){this._hideMenu();this._activationButtonPressed=false;}
+else{this._showMenu(p_oEvent);this._activationButtonPressed=true;}}
+else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}
+if(sType=="split"||sType=="menu"){me=this;this._hideMenuTimerId=window.setTimeout(function(){me.on("mouseup",onMouseUp);},250);}}},_onMouseUp:function(p_oEvent){var sType=this.get("type");if(this._hideMenuTimerId){window.clearTimeout(this._hideMenuTimerId);}
+if(sType=="checkbox"||sType=="radio"){this.set("checked",!(this.get("checked")));}
+this._activationButtonPressed=false;if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}},_onFocus:function(p_oEvent){var oElement;this.addStateCSSClasses("focus");if(this._activationKeyPressed){this.addStateCSSClasses("active");}
+m_oFocusedButton=this;if(!this._hasKeyEventHandlers){oElement=this._button;Event.on(oElement,"blur",this._onBlur,null,this);Event.on(oElement,"keydown",this._onKeyDown,null,this);Event.on(oElement,"keyup",this._onKeyUp,null,this);this._hasKeyEventHandlers=true;}
+this.fireEvent("focus",p_oEvent);},_onBlur:function(p_oEvent){this.removeStateCSSClasses("focus");if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}
+if(this._activationKeyPressed){Event.on(document,"keyup",this._onDocumentKeyUp,null,this);}
+m_oFocusedButton=null;this.fireEvent("blur",p_oEvent);},_onDocumentKeyUp:function(p_oEvent){if(this._isActivationKey(Event.getCharCode(p_oEvent))){this._activationKeyPressed=false;Event.removeListener(document,"keyup",this._onDocumentKeyUp);}},_onKeyDown:function(p_oEvent){var oMenu=this._menu;if(this.get("type")=="split"&&this._isSplitButtonOptionKey(p_oEvent)){this.fireEvent("option",p_oEvent);}
+else if(this._isActivationKey(Event.getCharCode(p_oEvent))){if(this.get("type")=="menu"){this._showMenu(p_oEvent);}
+else{this._activationKeyPressed=true;this.addStateCSSClasses("active");}}
+if(oMenu&&oMenu.cfg.getProperty("visible")&&Event.getCharCode(p_oEvent)==27){oMenu.hide();this.focus();}},_onKeyUp:function(p_oEvent){var sType;if(this._isActivationKey(Event.getCharCode(p_oEvent))){sType=this.get("type");if(sType=="checkbox"||sType=="radio"){this.set("checked",!(this.get("checked")));}
+this._activationKeyPressed=false;if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}}},_onClick:function(p_oEvent){var sType=this.get("type"),sTitle,oForm,oSrcElement,oElement,nX;switch(sType){case"radio":case"checkbox":if(this.get("checked")){sTitle=(sType=="radio")?this.RADIO_CHECKED_TITLE:this.CHECKBOX_CHECKED_TITLE;}
+else{sTitle=(sType=="radio")?this.RADIO_DEFAULT_TITLE:this.CHECKBOX_DEFAULT_TITLE;}
+this.set("title",sTitle);break;case"submit":this.submitForm();break;case"reset":oForm=this.getForm();if(oForm){oForm.reset();}
+break;case"menu":sTitle=this._menu.cfg.getProperty("visible")?this.MENUBUTTON_MENU_VISIBLE_TITLE:this.MENUBUTTON_DEFAULT_TITLE;this.set("title",sTitle);break;case"split":oElement=this.get("element");nX=Event.getPageX(p_oEvent)-Dom.getX(oElement);if((oElement.offsetWidth-this.OPTION_AREA_WIDTH)<nX){return false;}
+else{this._hideMenu();oSrcElement=this.get("srcelement");if(oSrcElement&&oSrcElement.type=="submit"){this.submitForm();}}
+sTitle=this._menu.cfg.getProperty("visible")?this.SPLITBUTTON_OPTION_VISIBLE_TITLE:this.SPLITBUTTON_DEFAULT_TITLE;this.set("title",sTitle);break;}},_onAppendTo:function(p_oEvent){var me=this;window.setTimeout(function(){me._addListenersToForm();},0);},_onFormReset:function(p_oEvent){var sType=this.get("type"),oMenu=this._menu;if(sType=="checkbox"||sType=="radio"){this.resetValue("checked");}
+if(oMenu&&(oMenu instanceof Menu)){this.resetValue("selectedMenuItem");}},_onDocumentMouseDown:function(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oButtonElement=this.get("element"),oMenuElement=this._menu.element;if(oTarget!=oButtonElement&&!Dom.isAncestor(oButtonElement,oTarget)&&oTarget!=oMenuElement&&!Dom.isAncestor(oMenuElement,oTarget)){this._hideMenu();Event.removeListener(document,"mousedown",this._onDocumentMouseDown);}},_onOption:function(p_oEvent){if(this.hasClass("yui-split-button-activeoption")){this._hideMenu();this._bOptionPressed=false;}
+else{this._showMenu(p_oEvent);this._bOptionPressed=true;}},_onOverlayBeforeShow:function(p_sType){var oMenu=this._menu;oMenu.render(this.get("element").parentNode);oMenu.beforeShowEvent.unsubscribe(this._onOverlayBeforeShow);},_onMenuShow:function(p_sType){Event.on(document,"mousedown",this._onDocumentMouseDown,null,this);var sTitle,sState;if(this.get("type")=="split"){sTitle=this.SPLITBUTTON_OPTION_VISIBLE_TITLE;sState="activeoption";}
+else{sTitle=this.MENUBUTTON_MENU_VISIBLE_TITLE;sState="active";}
+this.addStateCSSClasses(sState);this.set("title",sTitle);},_onMenuHide:function(p_sType){var oMenu=this._menu,sTitle,sState;if(oMenu&&(oMenu instanceof Menu)&&this._originalMaxHeight!=-1){this._menu.cfg.setProperty("maxheight",this._originalMaxHeight);}
+if(this.get("type")=="split"){sTitle=this.SPLITBUTTON_DEFAULT_TITLE;sState="activeoption";}
+else{sTitle=this.MENUBUTTON_DEFAULT_TITLE;sState="active";}
+this.removeStateCSSClasses(sState);this.set("title",sTitle);if(this.get("type")=="split"){this._bOptionPressed=false;}},_onMenuKeyDown:function(p_sType,p_aArgs){var oEvent=p_aArgs[0];if(Event.getCharCode(oEvent)==27){this.focus();if(this.get("type")=="split"){this._bOptionPressed=false;}}},_onMenuRender:function(p_sType){var oButtonElement=this.get("element"),oButtonParent=oButtonElement.parentNode,oMenuElement=this._menu.element;if(oButtonParent!=oMenuElement.parentNode){oButtonParent.appendChild(oMenuElement);}
+this.set("selectedMenuItem",this.get("selectedMenuItem"));},_onMenuItemSelected:function(p_sType,p_aArgs,p_nItem){var bSelected=p_aArgs[0];if(bSelected){this.set("selectedMenuItem",p_nItem);}},_onMenuItemAdded:function(p_sType,p_aArgs,p_oItem){var oItem=p_aArgs[0];oItem.cfg.subscribeToConfigEvent("selected",this._onMenuItemSelected,oItem.index,this);},_onMenuClick:function(p_sType,p_aArgs){var oItem=p_aArgs[1],oSrcElement;if(oItem){oSrcElement=this.get("srcelement");if(oSrcElement&&oSrcElement.type=="submit"){this.submitForm();}
+this._hideMenu();}},createButtonElement:function(p_sType){var sNodeName=this.NODE_NAME,oElement=document.createElement(sNodeName);oElement.innerHTML="<"+sNodeName+" class=\"first-child\">"+
+(p_sType=="link"?"<a></a>":"<button type=\"button\"></button>")+"</"+sNodeName+">";return oElement;},addStateCSSClasses:function(p_sState){var sType=this.get("type");if(Lang.isString(p_sState)){if(p_sState!="activeoption"){this.addClass(this.CSS_CLASS_NAME+("-"+p_sState));}
+this.addClass("yui-"+sType+("-button-"+p_sState));}},removeStateCSSClasses:function(p_sState){var sType=this.get("type");if(Lang.isString(p_sState)){this.removeClass(this.CSS_CLASS_NAME+("-"+p_sState));this.removeClass("yui-"+sType+("-button-"+p_sState));}},createHiddenFields:function(){this.removeHiddenFields();var oForm=this.getForm(),oButtonField,sType,bCheckable,oMenu,oMenuItem,sName,oValue,oMenuField;if(oForm&&!this.get("disabled")){sType=this.get("type");bCheckable=(sType=="checkbox"||sType=="radio");if(bCheckable||(m_oSubmitTrigger==this)){oButtonField=createInputElement((bCheckable?sType:"hidden"),this.get("name"),this.get("value"),this.get("checked"));if(oButtonField){if(bCheckable){oButtonField.style.display="none";}
+oForm.appendChild(oButtonField);}}
+oMenu=this._menu;if(oMenu&&(oMenu instanceof Menu)){oMenuField=oMenu.srcElement;oMenuItem=oMenu.getItem(this.get("selectedMenuItem"));if(oMenuField&&oMenuField.nodeName.toUpperCase()=="SELECT"){oForm.appendChild(oMenuField);oMenuField.selectedIndex=oMenuItem.index;}
+else{oValue=(oMenuItem.value===null||oMenuItem.value==="")?oMenuItem.cfg.getProperty("text"):oMenuItem.value;sName=this.get("name");if(oValue&&sName){oMenuField=createInputElement("hidden",(sName+"_options"),oValue);oForm.appendChild(oMenuField);}}}
+if(oButtonField&&oMenuField){this._hiddenFields=[oButtonField,oMenuField];}
+else if(!oButtonField&&oMenuField){this._hiddenFields=oMenuField;}
+else if(oButtonField&&!oMenuField){this._hiddenFields=oButtonField;}
+return this._hiddenFields;}},removeHiddenFields:function(){var oField=this._hiddenFields,nFields,i;function removeChild(p_oElement){if(Dom.inDocument(p_oElement)){p_oElement.parentNode.removeChild(p_oElement);}}
+if(oField){if(Lang.isArray(oField)){nFields=oField.length;if(nFields>0){i=nFields-1;do{removeChild(oField[i]);}
+while(i--);}}
+else{removeChild(oField);}
+this._hiddenFields=null;}},submitForm:function(){var oForm=this.getForm(),oSrcElement=this.get("srcelement"),bSubmitForm=false,oEvent;if(oForm){if(this.get("type")=="submit"||(oSrcElement&&oSrcElement.type=="submit"))
+{m_oSubmitTrigger=this;}
+if(YAHOO.env.ua.ie){bSubmitForm=oForm.fireEvent("onsubmit");}
+else{oEvent=document.createEvent("HTMLEvents");oEvent.initEvent("submit",true,true);bSubmitForm=oForm.dispatchEvent(oEvent);}
+if((YAHOO.env.ua.ie||YAHOO.env.ua.webkit)&&bSubmitForm){oForm.submit();}}
+return bSubmitForm;},init:function(p_oElement,p_oAttributes){var sNodeName=p_oAttributes.type=="link"?"A":"BUTTON",oSrcElement=p_oAttributes.srcelement,oButton=p_oElement.getElementsByTagName(sNodeName)[0],oInput;if(!oButton){oInput=p_oElement.getElementsByTagName("INPUT")[0];if(oInput){oButton=document.createElement("BUTTON");oButton.setAttribute("type","button");oInput.parentNode.replaceChild(oButton,oInput);}}
+this._button=oButton;YAHOO.widget.Button.superclass.init.call(this,p_oElement,p_oAttributes);m_oButtons[this.get("id")]=this;this.addClass(this.CSS_CLASS_NAME);this.addClass("yui-"+this.get("type")+"-button");Event.on(this._button,"focus",this._onFocus,null,this);this.on("mouseover",this._onMouseOver);this.on("click",this._onClick);this.on("appendTo",this._onAppendTo);var oContainer=this.get("container"),oElement=this.get("element"),bElInDoc=Dom.inDocument(oElement),oParentNode;if(oContainer){if(oSrcElement&&oSrcElement!=oElement){oParentNode=oSrcElement.parentNode;if(oParentNode){oParentNode.removeChild(oSrcElement);}}
+if(Lang.isString(oContainer)){Event.onContentReady(oContainer,function(){this.appendTo(oContainer);},null,this);}
+else{this.appendTo(oContainer);}}
+else if(!bElInDoc&&oSrcElement&&oSrcElement!=oElement){oParentNode=oSrcElement.parentNode;if(oParentNode){this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:oParentNode});oParentNode.replaceChild(oElement,oSrcElement);this.fireEvent("appendTo",{type:"appendTo",target:oParentNode});}}
+else if(this.get("type")!="link"&&bElInDoc&&oSrcElement&&oSrcElement==oElement){this._addListenersToForm();}},initAttributes:function(p_oAttributes){var oAttributes=p_oAttributes||{};YAHOO.widget.Button.superclass.initAttributes.call(this,oAttributes);this.setAttributeConfig("type",{value:(oAttributes.type||"push"),validator:Lang.isString,writeOnce:true,method:this._setType});this.setAttributeConfig("label",{value:oAttributes.label,validator:Lang.isString,method:this._setLabel});this.setAttributeConfig("value",{value:oAttributes.value});this.setAttributeConfig("name",{value:oAttributes.name,validator:Lang.isString});this.setAttributeConfig("tabindex",{value:oAttributes.tabindex,validator:Lang.isNumber,method:this._setTabIndex});this.configureAttribute("title",{value:oAttributes.title,validator:Lang.isString,method:this._setTitle});this.setAttributeConfig("disabled",{value:(oAttributes.disabled||false),validator:Lang.isBoolean,method:this._setDisabled});this.setAttributeConfig("href",{value:oAttributes.href,validator:Lang.isString,method:this._setHref});this.setAttributeConfig("target",{value:oAttributes.target,validator:Lang.isString,method:this._setTarget});this.setAttributeConfig("checked",{value:(oAttributes.checked||false),validator:Lang.isBoolean,method:this._setChecked});this.setAttributeConfig("container",{value:oAttributes.container,writeOnce:true});this.setAttributeConfig("srcelement",{value:oAttributes.srcelement,writeOnce:true});this.setAttributeConfig("menu",{value:null,method:this._setMenu,writeOnce:true});this.setAttributeConfig("lazyloadmenu",{value:(oAttributes.lazyloadmenu===false?false:true),validator:Lang.isBoolean,writeOnce:true});this.setAttributeConfig("menuclassname",{value:(oAttributes.menuclassname||"yui-button-menu"),validator:Lang.isString,method:this._setMenuClassName,writeOnce:true});this.setAttributeConfig("selectedMenuItem",{value:0,validator:Lang.isNumber,method:this._setSelectedMenuItem});this.setAttributeConfig("onclick",{value:oAttributes.onclick,method:this._setOnClick});this.setAttributeConfig("focusmenu",{value:(oAttributes.focusmenu===false?false:true),validator:Lang.isBoolean});},focus:function(){if(!this.get("disabled")){this._button.focus();}},blur:function(){if(!this.get("disabled")){this._button.blur();}},hasFocus:function(){return(m_oFocusedButton==this);},isActive:function(){return this.hasClass(this.CSS_CLASS_NAME+"-active");},getMenu:function(){return this._menu;},getForm:function(){return this._button.form;},getHiddenFields:function(){return this._hiddenFields;},destroy:function(){var oElement=this.get("element"),oParentNode=oElement.parentNode,oMenu=this._menu;if(oMenu){oMenu.destroy();}
+Event.purgeElement(oElement);Event.purgeElement(this._button);Event.removeListener(document,"mouseup",this._onDocumentMouseUp);Event.removeListener(document,"keyup",this._onDocumentKeyUp);Event.removeListener(document,"mousedown",this._onDocumentMouseDown);var oForm=this.getForm();if(oForm){Event.removeListener(oForm,"reset",this._onFormReset);Event.removeListener(oForm,"submit",this.createHiddenFields);}
+oParentNode.removeChild(oElement);delete m_oButtons[this.get("id")];},fireEvent:function(p_sType,p_aArgs){if(this.DOM_EVENTS[p_sType]&&this.get("disabled")){return;}
+YAHOO.widget.Button.superclass.fireEvent.call(this,p_sType,p_aArgs);},toString:function(){return("Button "+this.get("id"));}});YAHOO.widget.Button.onFormKeyPress=function(p_oEvent){var oTarget=Event.getTarget(p_oEvent),nCharCode=Event.getCharCode(p_oEvent),sNodeName=oTarget.nodeName&&oTarget.nodeName.toUpperCase(),sType=oTarget.type,bFormContainsYUIButtons=false,oButton,oYUISubmitButton,oPrecedingSubmitButton,oFollowingSubmitButton;function isSubmitButton(p_oElement){var sId,oSrcElement;switch(p_oElement.nodeName.toUpperCase()){case"INPUT":case"BUTTON":if(p_oElement.type=="submit"&&!p_oElement.disabled){if(!bFormContainsYUIButtons&&!oPrecedingSubmitButton){oPrecedingSubmitButton=p_oElement;}
+if(oYUISubmitButton&&!oFollowingSubmitButton){oFollowingSubmitButton=p_oElement;}}
+break;default:sId=p_oElement.id;if(sId){oButton=m_oButtons[sId];if(oButton){bFormContainsYUIButtons=true;if(!oButton.get("disabled")){oSrcElement=oButton.get("srcelement");if(!oYUISubmitButton&&(oButton.get("type")=="submit"||(oSrcElement&&oSrcElement.type=="submit")))
+{oYUISubmitButton=oButton;}}}}
+break;}}
+if(nCharCode==13&&((sNodeName=="INPUT"&&(sType=="text"||sType=="password"||sType=="checkbox"||sType=="radio"||sType=="file"))||sNodeName=="SELECT"))
+{Dom.getElementsBy(isSubmitButton,"*",this);if(oPrecedingSubmitButton){oPrecedingSubmitButton.focus();}
+else if(!oPrecedingSubmitButton&&oYUISubmitButton){if(oFollowingSubmitButton){Event.preventDefault(p_oEvent);}
+oYUISubmitButton.submitForm();}}};YAHOO.widget.Button.addHiddenFieldsToForm=function(p_oForm){var aButtons=Dom.getElementsByClassName(YAHOO.widget.Button.prototype.CSS_CLASS_NAME,"*",p_oForm),nButtons=aButtons.length,oButton,sId,i;if(nButtons>0){for(i=0;i<nButtons;i++){sId=aButtons[i].id;if(sId){oButton=m_oButtons[sId];if(oButton){oButton.createHiddenFields();}}}}};})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.lang,Button=YAHOO.widget.Button,m_oButtons={};YAHOO.widget.ButtonGroup=function(p_oElement,p_oAttributes){var fnSuperClass=YAHOO.widget.ButtonGroup.superclass.constructor,sNodeName,oElement,sId;if(arguments.length==1&&!Lang.isString(p_oElement)&&!p_oElement.nodeName){if(!p_oElement.id){sId=Dom.generateId();p_oElement.id=sId;}
+fnSuperClass.call(this,(this._createGroupElement()),p_oElement);}
+else if(Lang.isString(p_oElement)){oElement=Dom.get(p_oElement);if(oElement){if(oElement.nodeName.toUpperCase()==this.NODE_NAME){fnSuperClass.call(this,oElement,p_oAttributes);}}}
+else{sNodeName=p_oElement.nodeName;if(sNodeName&&sNodeName==this.NODE_NAME){if(!p_oElement.id){p_oElement.id=Dom.generateId();}
+fnSuperClass.call(this,p_oElement,p_oAttributes);}}};YAHOO.extend(YAHOO.widget.ButtonGroup,YAHOO.util.Element,{_buttons:null,NODE_NAME:"DIV",CSS_CLASS_NAME:"yui-buttongroup",_createGroupElement:function(){var oElement=document.createElement(this.NODE_NAME);return oElement;},_setDisabled:function(p_bDisabled){var nButtons=this.getCount(),i;if(nButtons>0){i=nButtons-1;do{this._buttons[i].set("disabled",p_bDisabled);}
+while(i--);}},_onKeyDown:function(p_oEvent){var oTarget=Event.getTarget(p_oEvent),nCharCode=Event.getCharCode(p_oEvent),sId=oTarget.parentNode.parentNode.id,oButton=m_oButtons[sId],nIndex=-1;if(nCharCode==37||nCharCode==38){nIndex=(oButton.index===0)?(this._buttons.length-1):(oButton.index-1);}
+else if(nCharCode==39||nCharCode==40){nIndex=(oButton.index===(this._buttons.length-1))?0:(oButton.index+1);}
+if(nIndex>-1){this.check(nIndex);this.getButton(nIndex).focus();}},_onAppendTo:function(p_oEvent){var aButtons=this._buttons,nButtons=aButtons.length,i;for(i=0;i<nButtons;i++){aButtons[i].appendTo(this.get("element"));}},_onButtonCheckedChange:function(p_oEvent,p_oButton){var bChecked=p_oEvent.newValue,oCheckedButton=this.get("checkedButton");if(bChecked&&oCheckedButton!=p_oButton){if(oCheckedButton){oCheckedButton.set("checked",false,true);}
+this.set("checkedButton",p_oButton);this.set("value",p_oButton.get("value"));}
+else if(oCheckedButton&&!oCheckedButton.set("checked")){oCheckedButton.set("checked",true,true);}},init:function(p_oElement,p_oAttributes){this._buttons=[];YAHOO.widget.ButtonGroup.superclass.init.call(this,p_oElement,p_oAttributes);this.addClass(this.CSS_CLASS_NAME);var aButtons=this.getElementsByClassName("yui-radio-button");if(aButtons.length>0){this.addButtons(aButtons);}
+function isRadioButton(p_oElement){return(p_oElement.type=="radio");}
+aButtons=Dom.getElementsBy(isRadioButton,"input",this.get("element"));if(aButtons.length>0){this.addButtons(aButtons);}
+this.on("keydown",this._onKeyDown);this.on("appendTo",this._onAppendTo);var oContainer=this.get("container");if(oContainer){if(Lang.isString(oContainer)){Event.onContentReady(oContainer,function(){this.appendTo(oContainer);},null,this);}
+else{this.appendTo(oContainer);}}},initAttributes:function(p_oAttributes){var oAttributes=p_oAttributes||{};YAHOO.widget.ButtonGroup.superclass.initAttributes.call(this,oAttributes);this.setAttributeConfig("name",{value:oAttributes.name,validator:Lang.isString});this.setAttributeConfig("disabled",{value:(oAttributes.disabled||false),validator:Lang.isBoolean,method:this._setDisabled});this.setAttributeConfig("value",{value:oAttributes.value});this.setAttributeConfig("container",{value:oAttributes.container,writeOnce:true});this.setAttributeConfig("checkedButton",{value:null});},addButton:function(p_oButton){var oButton,oButtonElement,oGroupElement,nIndex,sButtonName,sGroupName;if(p_oButton instanceof Button&&p_oButton.get("type")=="radio"){oButton=p_oButton;}
+else if(!Lang.isString(p_oButton)&&!p_oButton.nodeName){p_oButton.type="radio";oButton=new Button(p_oButton);}
+else{oButton=new Button(p_oButton,{type:"radio"});}
+if(oButton){nIndex=this._buttons.length;sButtonName=oButton.get("name");sGroupName=this.get("name");oButton.index=nIndex;this._buttons[nIndex]=oButton;m_oButtons[oButton.get("id")]=oButton;if(sButtonName!=sGroupName){oButton.set("name",sGroupName);}
+if(this.get("disabled")){oButton.set("disabled",true);}
+if(oButton.get("checked")){this.set("checkedButton",oButton);}
+oButtonElement=oButton.get("element");oGroupElement=this.get("element");if(oButtonElement.parentNode!=oGroupElement){oGroupElement.appendChild(oButtonElement);}
+oButton.on("checkedChange",this._onButtonCheckedChange,oButton,this);return oButton;}},addButtons:function(p_aButtons){var nButtons,oButton,aButtons,i;if(Lang.isArray(p_aButtons)){nButtons=p_aButtons.length;aButtons=[];if(nButtons>0){for(i=0;i<nButtons;i++){oButton=this.addButton(p_aButtons[i]);if(oButton){aButtons[aButtons.length]=oButton;}}
+if(aButtons.length>0){return aButtons;}}}},removeButton:function(p_nIndex){var oButton=this.getButton(p_nIndex),nButtons,i;if(oButton){this._buttons.splice(p_nIndex,1);delete m_oButtons[oButton.get("id")];oButton.removeListener("checkedChange",this._onButtonCheckedChange);oButton.destroy();nButtons=this._buttons.length;if(nButtons>0){i=this._buttons.length-1;do{this._buttons[i].index=i;}
+while(i--);}}},getButton:function(p_nIndex){if(Lang.isNumber(p_nIndex)){return this._buttons[p_nIndex];}},getButtons:function(){return this._buttons;},getCount:function(){return this._buttons.length;},focus:function(p_nIndex){var oButton,nButtons,i;if(Lang.isNumber(p_nIndex)){oButton=this._buttons[p_nIndex];if(oButton){oButton.focus();}}
+else{nButtons=this.getCount();for(i=0;i<nButtons;i++){oButton=this._buttons[i];if(!oButton.get("disabled")){oButton.focus();break;}}}},check:function(p_nIndex){var oButton=this.getButton(p_nIndex);if(oButton){oButton.set("checked",true);}},destroy:function(){var nButtons=this._buttons.length,oElement=this.get("element"),oParentNode=oElement.parentNode,i;if(nButtons>0){i=this._buttons.length-1;do{this._buttons[i].destroy();}
+while(i--);}
+Event.purgeElement(oElement);oParentNode.removeChild(oElement);},toString:function(){return("ButtonGroup "+this.get("id"));}});})();YAHOO.register("button",YAHOO.widget.Button,{version:"2.3.0",build:"442"});
\ No newline at end of file
diff --git a/lib/yui/button/button-beta.js b/lib/yui/button/button-beta.js
new file mode 100755 (executable)
index 0000000..83195b8
--- /dev/null
@@ -0,0 +1,4477 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+* @module button
+* @description <p>The Button Control enables the creation of rich, graphical 
+* buttons that function like traditional HTML form buttons.  <em>Unlike</em> 
+* tradition HTML form buttons, buttons created with the Button Control can have 
+* a label that is different from its value.  With the inclusion of the optional 
+* <a href="module_menu.html">Menu Control</a>, the Button Control can also be
+* used to create menu buttons and split buttons, controls that are not 
+* available natively in HTML.  The Button Control can also be thought of as a 
+* way to create more visually engaging implementations of the browser's 
+* default radio-button and check-box controls.</p>
+* <p>The Button Control supports the following types:</p>
+* <dl>
+* <dt>push</dt>
+* <dd>Basic push button that can execute a user-specified command when 
+* pressed.</dd>
+* <dt>link</dt>
+* <dd>Navigates to a specified url when pressed.</dd>
+* <dt>submit</dt>
+* <dd>Submits the parent form when pressed.</dd>
+* <dt>reset</dt>
+* <dd>Resets the parent form when pressed.</dd>
+* <dt>checkbox</dt>
+* <dd>Maintains a "checked" state that can be toggled on and off.</dd>
+* <dt>radio</dt>
+* <dd>Maintains a "checked" state that can be toggled on and off.  Use with 
+* the ButtonGroup class to create a set of controls that are mutually 
+* exclusive; checking one button in the set will uncheck all others in 
+* the group.</dd>
+* <dt>menu</dt>
+* <dd>When pressed will show/hide a menu.</dd>
+* <dt>split</dt>
+* <dd>Can execute a user-specified command or display a menu when pressed.</dd>
+* </dl>
+* @title Button
+* @namespace YAHOO.widget
+* @requires yahoo, dom, element, event
+* @optional container, menu
+* @beta
+*/
+
+
+(function () {
+
+
+    /**
+    * The Button class creates a rich, graphical button.
+    * @param {String} p_oElement String specifying the id attribute of the 
+    * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>,
+    * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to 
+    * be used to create the button.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org
+    * /TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-34812697">
+    * HTMLButtonElement</a>|<a href="
+    * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#
+    * ID-33759296">HTMLElement</a>} p_oElement Object reference for the 
+    * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>, 
+    * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to be 
+    * used to create the button.
+    * @param {Object} p_oElement Object literal specifying a set of   
+    * configuration attributes used to create the button.
+    * @param {Object} p_oAttributes Optional. Object literal specifying a set  
+    * of configuration attributes used to create the button.
+    * @namespace YAHOO.widget
+    * @class Button
+    * @constructor
+    * @extends YAHOO.util.Element
+    */
+
+
+
+    // Shorthard for utilities
+
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang,
+        Overlay = YAHOO.widget.Overlay,
+        Menu = YAHOO.widget.Menu,
+    
+    
+        // Private member variables
+    
+        m_oButtons = {},    // Collection of all Button instances
+        m_oOverlayManager = null,   // YAHOO.widget.OverlayManager instance
+        m_oSubmitTrigger = null,    // The button that submitted the form 
+        m_oFocusedButton = null;    // The button that has focus
+
+
+
+    // Private methods
+
+    
+    
+    /**
+    * @method createInputElement
+    * @description Creates an <code>&#60;input&#62;</code> element of the 
+    * specified type.
+    * @private
+    * @param {String} p_sType String specifying the type of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_sName String specifying the name of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_sValue String specifying the value of 
+    * <code>&#60;input&#62;</code> element to create.
+    * @param {String} p_bChecked Boolean specifying if the  
+    * <code>&#60;input&#62;</code> element is to be checked.
+    * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>}
+    */
+    function createInputElement(p_sType, p_sName, p_sValue, p_bChecked) {
+    
+        var oInput,
+            sInput;
+    
+        if (Lang.isString(p_sType) && Lang.isString(p_sName)) {
+        
+            if (YAHOO.env.ua.ie) {
+        
+                /*
+                    For IE it is necessary to create the element with the 
+                    "type," "name," "value," and "checked" properties set all 
+                    at once.
+                */
+            
+                sInput = "<input type=\"" + p_sType + "\" name=\"" + 
+                    p_sName + "\"";
+        
+                if (p_bChecked) {
+        
+                    sInput += " checked";
+                
+                }
+                
+                sInput += ">";
+        
+                oInput = document.createElement(sInput);
+        
+            }
+            else {
+            
+                oInput = document.createElement("input");
+                oInput.name = p_sName;
+                oInput.type = p_sType;
+        
+                if (p_bChecked) {
+        
+                    oInput.checked = true;
+                
+                }
+        
+            }
+        
+            oInput.value = p_sValue;
+            
+            return oInput;
+        
+        }
+    
+    }
+    
+    
+    /**
+    * @method setAttributesFromSrcElement
+    * @description Gets the values for all the attributes of the source element 
+    * (either <code>&#60;input&#62;</code> or <code>&#60;a&#62;</code>) that 
+    * map to Button configuration attributes and sets them into a collection 
+    * that is passed to the Button constructor.
+    * @private
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://www.w3.org/
+    * TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-
+    * 48250443">HTMLAnchorElement</a>} p_oElement Object reference to the HTML 
+    * element (either <code>&#60;input&#62;</code> or <code>&#60;span&#62;
+    * </code>) used to create the button.
+    * @param {Object} p_oAttributes Object reference for the collection of 
+    * configuration attributes used to create the button.
+    */
+    function setAttributesFromSrcElement(p_oElement, p_oAttributes) {
+    
+        var sSrcElementNodeName = p_oElement.nodeName.toUpperCase(),
+            me = this,
+            oAttribute,
+            oRootNode,
+            sText;
+            
+    
+        /**
+        * @method setAttributeFromDOMAttribute
+        * @description Gets the value of the specified DOM attribute and sets it 
+        * into the collection of configuration attributes used to configure 
+        * the button.
+        * @private
+        * @param {String} p_sAttribute String representing the name of the 
+        * attribute to retrieve from the DOM element.
+        */
+        function setAttributeFromDOMAttribute(p_sAttribute) {
+    
+            if ( !(p_sAttribute in p_oAttributes) ) {
+    
+                /*
+                    Need to use "getAttributeNode" instead of "getAttribute" 
+                    because using "getAttribute," IE will return the innerText 
+                    of a <code>&#60;button&#62;</code> for the value attribute  
+                    rather than the value of the "value" attribute.
+                */
+        
+                oAttribute = p_oElement.getAttributeNode(p_sAttribute);
+        
+    
+                if (oAttribute && ("value" in oAttribute)) {
+    
+    
+                    p_oAttributes[p_sAttribute] = oAttribute.value;
+    
+                }
+    
+            }
+        
+        }
+    
+    
+        /**
+        * @method setFormElementProperties
+        * @description Gets the value of the attributes from the form element  
+        * and sets them into the collection of configuration attributes used to 
+        * configure the button.
+        * @private
+        */
+        function setFormElementProperties() {
+    
+            setAttributeFromDOMAttribute("type");
+    
+            if (p_oAttributes.type == "button") {
+            
+                p_oAttributes.type = "push";
+            
+            }
+    
+            if ( !("disabled" in p_oAttributes) ) {
+    
+                p_oAttributes.disabled = p_oElement.disabled;
+    
+            }
+    
+            setAttributeFromDOMAttribute("name");
+            setAttributeFromDOMAttribute("value");
+            setAttributeFromDOMAttribute("title");
+    
+        }
+
+    
+        switch (sSrcElementNodeName) {
+        
+        case "A":
+            
+            p_oAttributes.type = "link";
+            
+            setAttributeFromDOMAttribute("href");
+            setAttributeFromDOMAttribute("target");
+        
+            break;
+    
+        case "INPUT":
+
+            setFormElementProperties();
+
+            if ( !("checked" in p_oAttributes) ) {
+    
+                p_oAttributes.checked = p_oElement.checked;
+    
+            }
+
+            break;
+
+        case "BUTTON":
+
+            setFormElementProperties();
+
+            oRootNode = p_oElement.parentNode.parentNode;
+
+            if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-checked")) {
+            
+                p_oAttributes.checked = true;
+            
+            }
+
+            if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-disabled")) {
+
+                p_oAttributes.disabled = true;
+            
+            }
+
+            p_oElement.removeAttribute("value");
+
+            p_oElement.setAttribute("type", "button");
+
+            break;
+        
+        }
+
+        p_oElement.removeAttribute("id");
+        p_oElement.removeAttribute("name");
+        
+        if ( !("tabindex" in p_oAttributes) ) {
+
+            p_oAttributes.tabindex = p_oElement.tabIndex;
+
+        }
+    
+        if ( !("label" in p_oAttributes) ) {
+    
+            // Set the "label" property
+        
+            sText = sSrcElementNodeName == "INPUT" ? 
+                            p_oElement.value : p_oElement.innerHTML;
+        
+    
+            if (sText && sText.length > 0) {
+                
+                p_oAttributes.label = sText;
+                
+            } 
+    
+        }
+    
+    }
+    
+    
+    /**
+    * @method initConfig
+    * @description Initializes the set of configuration attributes that are 
+    * used to instantiate the button.
+    * @private
+    * @param {Object} Object representing the button's set of 
+    * configuration attributes.
+    */
+    function initConfig(p_oConfig) {
+    
+        var oAttributes = p_oConfig.attributes,
+            oSrcElement = oAttributes.srcelement,
+            sSrcElementNodeName = oSrcElement.nodeName.toUpperCase(),
+            me = this;
+    
+    
+        if (sSrcElementNodeName == this.NODE_NAME) {
+    
+            p_oConfig.element = oSrcElement;
+            p_oConfig.id = oSrcElement.id;
+
+            Dom.getElementsBy(function (p_oElement) {
+            
+                switch (p_oElement.nodeName.toUpperCase()) {
+                
+                case "BUTTON":
+                case "A":
+                case "INPUT":
+
+                    setAttributesFromSrcElement.call(me, p_oElement, 
+                        oAttributes);
+
+                    break;                        
+                
+                }
+            
+            }, "*", oSrcElement);
+        
+        }
+        else {
+    
+            switch (sSrcElementNodeName) {
+
+            case "BUTTON":
+            case "A":
+            case "INPUT":
+
+                setAttributesFromSrcElement.call(this, oSrcElement, 
+                    oAttributes);
+
+                break;
+
+            }
+        
+        }
+    
+    }
+
+
+
+    //  Constructor
+
+    YAHOO.widget.Button = function (p_oElement, p_oAttributes) {
+    
+        var fnSuperClass = YAHOO.widget.Button.superclass.constructor,
+            oConfig,
+            oElement;
+    
+        if (arguments.length == 1 && !Lang.isString(p_oElement) && 
+            !p_oElement.nodeName) {
+    
+            if (!p_oElement.id) {
+    
+                p_oElement.id = Dom.generateId();
+    
+    
+            }
+    
+    
+    
+            fnSuperClass.call(this, 
+                (this.createButtonElement(p_oElement.type)),
+                p_oElement);
+    
+        }
+        else {
+    
+            oConfig = { element: null, attributes: (p_oAttributes || {}) };
+    
+    
+            if (Lang.isString(p_oElement)) {
+    
+                oElement = Dom.get(p_oElement);
+    
+                if (oElement) {
+
+                    if (!oConfig.attributes.id) {
+                    
+                        oConfig.attributes.id = p_oElement;
+                    
+                    }
+    
+                
+                
+                
+                    oConfig.attributes.srcelement = oElement;
+                
+                    initConfig.call(this, oConfig);
+                
+                
+                    if (!oConfig.element) {
+                
+                
+                        oConfig.element = 
+                            this.createButtonElement(oConfig.attributes.type);
+                
+                    }
+                
+                    fnSuperClass.call(this, oConfig.element, 
+                        oConfig.attributes);
+    
+                }
+    
+            }
+            else if (p_oElement.nodeName) {
+    
+                if (!oConfig.attributes.id) {
+    
+                    if (p_oElement.id) {
+        
+                        oConfig.attributes.id = p_oElement.id;
+                    
+                    }
+                    else {
+        
+                        oConfig.attributes.id = Dom.generateId();
+        
+        
+                    }
+    
+                }
+    
+    
+    
+    
+    
+                oConfig.attributes.srcelement = p_oElement;
+        
+                initConfig.call(this, oConfig);
+        
+        
+                if (!oConfig.element) {
+    
+            
+                    oConfig.element = 
+                        this.createButtonElement(oConfig.attributes.type);
+            
+                }
+            
+                fnSuperClass.call(this, oConfig.element, oConfig.attributes);
+            
+            }
+    
+        }
+    
+    };
+
+
+
+    YAHOO.extend(YAHOO.widget.Button, YAHOO.util.Element, {
+    
+    
+        // Protected properties
+        
+        
+        /** 
+        * @property _button
+        * @description Object reference to the button's internal 
+        * <code>&#60;a&#62;</code> or <code>&#60;button&#62;</code> element.
+        * @default null
+        * @protected
+        * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-48250443">HTMLAnchorElement</a>|<a href="
+        * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html
+        * #ID-34812697">HTMLButtonElement</a>
+        */
+        _button: null,
+        
+        
+        /** 
+        * @property _menu
+        * @description Object reference to the button's menu.
+        * @default null
+        * @protected
+        * @type {<a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>|
+        * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>}
+        */
+        _menu: null,
+        
+        
+        /** 
+        * @property _hiddenFields
+        * @description Object reference to the <code>&#60;input&#62;</code>  
+        * element, or array of HTML form elements used to represent the button
+        *  when its parent form is submitted.
+        * @default null
+        * @protected
+        * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array
+        */
+        _hiddenFields: null,
+        
+        
+        /** 
+        * @property _onclickAttributeValue
+        * @description Object reference to the button's current value for the 
+        * "onclick" configuration attribute.
+        * @default null
+        * @protected
+        * @type Object
+        */
+        _onclickAttributeValue: null,
+        
+        
+        /** 
+        * @property _activationKeyPressed
+        * @description Boolean indicating if the key(s) that toggle the button's 
+        * "active" state have been pressed.
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _activationKeyPressed: false,
+        
+        
+        /** 
+        * @property _activationButtonPressed
+        * @description Boolean indicating if the mouse button that toggles 
+        * the button's "active" state has been pressed.
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _activationButtonPressed: false,
+        
+        
+        /** 
+        * @property _hasKeyEventHandlers
+        * @description Boolean indicating if the button's "blur", "keydown" and 
+        * "keyup" event handlers are assigned
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _hasKeyEventHandlers: false,
+        
+        
+        /** 
+        * @property _hasMouseEventHandlers
+        * @description Boolean indicating if the button's "mouseout," 
+        * "mousedown," and "mouseup" event handlers are assigned
+        * @default false
+        * @protected
+        * @type Boolean
+        */
+        _hasMouseEventHandlers: false,
+        
+        
+        
+        // Constants
+        
+        
+        /**
+        * @property NODE_NAME
+        * @description The name of the node to be used for the button's 
+        * root element.
+        * @default "SPAN"
+        * @final
+        * @type String
+        */
+        NODE_NAME: "SPAN",
+        
+        
+        /**
+        * @property CHECK_ACTIVATION_KEYS
+        * @description Array of numbers representing keys that (when pressed) 
+        * toggle the button's "checked" attribute.
+        * @default [32]
+        * @final
+        * @type Array
+        */
+        CHECK_ACTIVATION_KEYS: [32],
+        
+        
+        /**
+        * @property ACTIVATION_KEYS
+        * @description Array of numbers representing keys that (when presed) 
+        * toggle the button's "active" state.
+        * @default [13, 32]
+        * @final
+        * @type Array
+        */
+        ACTIVATION_KEYS: [13, 32],
+        
+        
+        /**
+        * @property OPTION_AREA_WIDTH
+        * @description Width (in pixels) of the area of a split button that  
+        * when pressed will display a menu.
+        * @default 20
+        * @final
+        * @type Number
+        */
+        OPTION_AREA_WIDTH: 20,
+        
+        
+        /**
+        * @property CSS_CLASS_NAME
+        * @description String representing the CSS class(es) to be applied to  
+        * the button's root element.
+        * @default "yui-button"
+        * @final
+        * @type String
+        */
+        CSS_CLASS_NAME: "yui-button",
+        
+        
+        /**
+        * @property RADIO_DEFAULT_TITLE
+        * @description String representing the default title applied to buttons 
+        * of type "radio." 
+        * @default "Unchecked.  Click to check."
+        * @final
+        * @type String
+        */
+        RADIO_DEFAULT_TITLE: "Unchecked.  Click to check.",
+        
+        
+        /**
+        * @property RADIO_CHECKED_TITLE
+        * @description String representing the title applied to buttons of 
+        * type "radio" when checked.
+        * @default "Checked.  Click to uncheck."
+        * @final
+        * @type String
+        */
+        RADIO_CHECKED_TITLE: "Checked.  Click to uncheck.",
+        
+        
+        /**
+        * @property CHECKBOX_DEFAULT_TITLE
+        * @description String representing the default title applied to 
+        * buttons of type "checkbox." 
+        * @default "Unchecked.  Click to check."
+        * @final
+        * @type String
+        */
+        CHECKBOX_DEFAULT_TITLE: "Unchecked.  Click to check.",
+        
+        
+        /**
+        * @property CHECKBOX_CHECKED_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "checkbox" when checked.
+        * @default "Checked.  Click to uncheck."
+        * @final
+        * @type String
+        */
+        CHECKBOX_CHECKED_TITLE: "Checked.  Click to uncheck.",
+        
+        
+        /**
+        * @property MENUBUTTON_DEFAULT_TITLE
+        * @description String representing the default title applied to 
+        * buttons of type "menu." 
+        * @default "Menu collapsed.  Click to expand."
+        * @final
+        * @type String
+        */
+        MENUBUTTON_DEFAULT_TITLE: "Menu collapsed.  Click to expand.",
+        
+        
+        /**
+        * @property MENUBUTTON_MENU_VISIBLE_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "menu" when the button's menu is visible. 
+        * @default "Menu expanded.  Click or press Esc to collapse."
+        * @final
+        * @type String
+        */
+        MENUBUTTON_MENU_VISIBLE_TITLE: 
+            "Menu expanded.  Click or press Esc to collapse.",
+        
+        
+        /**
+        * @property SPLITBUTTON_DEFAULT_TITLE
+        * @description  String representing the default title applied to 
+        * buttons of type "split." 
+        * @default "Menu collapsed.  Click inside option region or press 
+        * Ctrl + Shift + M to show the menu."
+        * @final
+        * @type String
+        */
+        SPLITBUTTON_DEFAULT_TITLE: ("Menu collapsed.  Click inside option " + 
+            "region or press Ctrl + Shift + M to show the menu."),
+        
+        
+        /**
+        * @property SPLITBUTTON_OPTION_VISIBLE_TITLE
+        * @description String representing the title applied to buttons of type 
+        * "split" when the button's menu is visible. 
+        * @default "Menu expanded.  Press Esc or Ctrl + Shift + M to hide 
+        * the menu."
+        * @final
+        * @type String
+        */
+        SPLITBUTTON_OPTION_VISIBLE_TITLE: 
+            "Menu expanded.  Press Esc or Ctrl + Shift + M to hide the menu.",
+        
+        
+        /**
+        * @property SUBMIT_TITLE
+        * @description String representing the title applied to buttons of 
+        * type "submit." 
+        * @default "Click to submit form."
+        * @final
+        * @type String
+        */
+        SUBMIT_TITLE: "Click to submit form.",
+        
+        
+        
+        // Protected attribute setter methods
+        
+        
+        /**
+        * @method _setType
+        * @description Sets the value of the button's "type" attribute.
+        * @protected
+        * @param {String} p_sType String indicating the value for the button's 
+        * "type" attribute.
+        */
+        _setType: function (p_sType) {
+        
+            if (p_sType == "split") {
+        
+                this.on("option", this._onOption);
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setLabel
+        * @description Sets the value of the button's "label" attribute.
+        * @protected
+        * @param {String} p_sLabel String indicating the value for the button's 
+        * "label" attribute.
+        */
+        _setLabel: function (p_sLabel) {
+
+            this._button.innerHTML = p_sLabel;             
+        
+        },
+        
+        
+        /**
+        * @method _setTabIndex
+        * @description Sets the value of the button's "tabindex" attribute.
+        * @protected
+        * @param {Number} p_nTabIndex Number indicating the value for the 
+        * button's "tabindex" attribute.
+        */
+        _setTabIndex: function (p_nTabIndex) {
+        
+            this._button.tabIndex = p_nTabIndex;
+        
+        },
+        
+        
+        /**
+        * @method _setTitle
+        * @description Sets the value of the button's "title" attribute.
+        * @protected
+        * @param {String} p_nTabIndex Number indicating the value for 
+        * the button's "title" attribute.
+        */
+        _setTitle: function (p_sTitle) {
+        
+            var sTitle = p_sTitle;
+        
+            if (this.get("type") != "link") {
+        
+                if (!sTitle) {
+        
+                    switch (this.get("type")) {
+        
+                    case "radio":
+    
+                        sTitle = this.RADIO_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "checkbox":
+    
+                        sTitle = this.CHECKBOX_DEFAULT_TITLE;
+    
+                        break;
+                    
+                    case "menu":
+    
+                        sTitle = this.MENUBUTTON_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "split":
+    
+                        sTitle = this.SPLITBUTTON_DEFAULT_TITLE;
+    
+                        break;
+    
+                    case "submit":
+    
+                        sTitle = this.SUBMIT_TITLE;
+    
+                        break;
+        
+                    }
+        
+                }
+        
+                this._button.title = sTitle;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setDisabled
+        * @description Sets the value of the button's "disabled" attribute.
+        * @protected
+        * @param {Boolean} p_bDisabled Boolean indicating the value for 
+        * the button's "disabled" attribute.
+        */
+        _setDisabled: function (p_bDisabled) {
+        
+            if (this.get("type") != "link") {
+        
+                if (p_bDisabled) {
+        
+                    if (this._menu) {
+        
+                        this._menu.hide();
+        
+                    }
+        
+                    if (this.hasFocus()) {
+                    
+                        this.blur();
+                    
+                    }
+        
+                    this._button.setAttribute("disabled", "disabled");
+        
+                    this.addStateCSSClasses("disabled");
+        
+                }
+                else {
+        
+                    this._button.removeAttribute("disabled");
+        
+                    this.removeStateCSSClasses("disabled");
+                
+                }
+        
+            }
+        
+        },
+
+        
+        /**
+        * @method _setHref
+        * @description Sets the value of the button's "href" attribute.
+        * @protected
+        * @param {String} p_sHref String indicating the value for the button's 
+        * "href" attribute.
+        */
+        _setHref: function (p_sHref) {
+        
+            if (this.get("type") == "link") {
+        
+                this._button.href = p_sHref;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setTarget
+        * @description Sets the value of the button's "target" attribute.
+        * @protected
+        * @param {String} p_sTarget String indicating the value for the button's 
+        * "target" attribute.
+        */
+        _setTarget: function (p_sTarget) {
+        
+            if (this.get("type") == "link") {
+        
+                this._button.setAttribute("target", p_sTarget);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setChecked
+        * @description Sets the value of the button's "target" attribute.
+        * @protected
+        * @param {Boolean} p_bChecked Boolean indicating the value for  
+        * the button's "checked" attribute.
+        */
+        _setChecked: function (p_bChecked) {
+        
+            var sType = this.get("type"),
+                sTitle;
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                if (p_bChecked) {
+        
+                    this.addStateCSSClasses("checked");
+                    
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_CHECKED_TITLE : 
+                                this.CHECKBOX_CHECKED_TITLE;
+                
+                }
+                else {
+
+                    this.removeStateCSSClasses("checked");
+        
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_DEFAULT_TITLE : 
+                                this.CHECKBOX_DEFAULT_TITLE;
+                
+                }
+        
+                this.set("title", sTitle);
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setMenu
+        * @description Sets the value of the button's "menu" attribute.
+        * @protected
+        * @param {Object} p_oMenu Object indicating the value for the button's 
+        * "menu" attribute.
+        */
+        _setMenu: function (p_oMenu) {
+
+            var bLazyLoad = this.get("lazyloadmenu"),
+                oButtonElement = this.get("element"),
+        
+                /*
+                    Boolean indicating if the value of p_oMenu is an instance 
+                    of YAHOO.widget.Menu or YAHOO.widget.Overlay.
+                */
+        
+                bInstance = false,
+        
+
+                oMenu,
+                oMenuElement,
+                oSrcElement,
+                aItems,
+                nItems,
+                oItem,
+                i;
+        
+        
+            if (!Overlay) {
+        
+        
+                return false;
+            
+            }
+        
+        
+            if (!Menu) {
+        
+        
+                return false;
+            
+            }
+        
+        
+            function onAppendTo() {
+
+                oMenu.render(oButtonElement.parentNode);
+                
+                this.removeListener("appendTo", onAppendTo);
+            
+            }
+        
+        
+            function initMenu() {
+        
+                if (oMenu) {
+
+                    Dom.addClass(oMenu.element, this.get("menuclassname"));
+                    Dom.addClass(oMenu.element, 
+                            "yui-" + this.get("type") + "-button-menu");
+
+                    oMenu.showEvent.subscribe(this._onMenuShow, null, this);
+                    oMenu.hideEvent.subscribe(this._onMenuHide, null, this);
+                    oMenu.renderEvent.subscribe(this._onMenuRender, null, this);
+        
+        
+                    if (oMenu instanceof Menu) {
+        
+                        oMenu.keyDownEvent.subscribe(this._onMenuKeyDown, 
+                            this, true);
+
+                        oMenu.clickEvent.subscribe(this._onMenuClick, 
+                            this, true);
+
+                        oMenu.itemAddedEvent.subscribe(this._onMenuItemAdded, 
+                            this, true);
+        
+                        oSrcElement = oMenu.srcElement;
+        
+                        if (oSrcElement && 
+                            oSrcElement.nodeName.toUpperCase() == "SELECT") {
+                
+                            oSrcElement.style.display = "none";
+                            oSrcElement.parentNode.removeChild(oSrcElement);
+        
+                        }
+        
+                    }
+                    else if (oMenu instanceof Overlay) {
+        
+                        if (!m_oOverlayManager) {
+        
+                            m_oOverlayManager = 
+                                new YAHOO.widget.OverlayManager();
+                        
+                        }
+                        
+                        m_oOverlayManager.register(oMenu);
+                        
+                    }
+        
+        
+                    this._menu = oMenu;
+
+        
+                    if (!bInstance) {
+        
+                        if (bLazyLoad && !(oMenu instanceof Menu)) {
+        
+                            /*
+                                Mimic Menu's "lazyload" functionality by adding  
+                                a "beforeshow" event listener that renders the 
+                                Overlay instance before it is made visible by  
+                                the button.
+                            */
+        
+                            oMenu.beforeShowEvent.subscribe(
+                                this._onOverlayBeforeShow, null, this);
+            
+                        }
+                        else if (!bLazyLoad) {
+        
+                            if (Dom.inDocument(oButtonElement)) {
+        
+                                oMenu.render(oButtonElement.parentNode);
+                            
+                            }
+                            else {
+            
+                                this.on("appendTo", onAppendTo);
+                            
+                            }
+                        
+                        }
+                    
+                    }
+        
+                }
+        
+            }
+        
+        
+            if (p_oMenu && (p_oMenu instanceof Menu)) {
+        
+                oMenu = p_oMenu;
+                aItems = oMenu.getItems();
+                nItems = aItems.length;
+                bInstance = true;
+        
+        
+                if (nItems > 0) {
+        
+                    i = nItems - 1;
+        
+                    do {
+        
+                        oItem = aItems[i];
+        
+                        if (oItem) {
+        
+                            oItem.cfg.subscribeToConfigEvent("selected", 
+                                this._onMenuItemSelected, 
+                                oItem, 
+                                this);
+        
+                        }
+        
+                    }
+                    while (i--);
+        
+                }
+        
+                initMenu.call(this);
+        
+            }
+            else if (p_oMenu && (p_oMenu instanceof Overlay)) {
+        
+                oMenu = p_oMenu;
+                bInstance = true;
+        
+                oMenu.cfg.setProperty("visible", false);
+                oMenu.cfg.setProperty("context", [oButtonElement, "tl", "bl"]);
+        
+                initMenu.call(this);
+        
+            }
+            else if (Lang.isArray(p_oMenu)) {
+        
+                this.on("appendTo", function () {
+        
+                    oMenu = new Menu(Dom.generateId(), { lazyload: bLazyLoad, 
+                        itemdata: p_oMenu });
+        
+                    initMenu.call(this);
+        
+                });
+        
+            }
+            else if (Lang.isString(p_oMenu)) {
+        
+                oMenuElement = Dom.get(p_oMenu);
+        
+                if (oMenuElement) {
+        
+                    if (Dom.hasClass(oMenuElement, 
+                        Menu.prototype.CSS_CLASS_NAME) || 
+                        oMenuElement.nodeName == "SELECT") {
+            
+                        oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad });
+            
+                        initMenu.call(this);
+            
+                    }
+                    else {
+        
+                        oMenu = new Overlay(p_oMenu, { visible: false, 
+                            context: [oButtonElement, "tl", "bl"] });
+            
+                        initMenu.call(this);
+            
+                    }
+        
+                }
+        
+            }
+            else if (p_oMenu && p_oMenu.nodeName) {
+        
+                if (Dom.hasClass(p_oMenu, Menu.prototype.CSS_CLASS_NAME) || 
+                        p_oMenu.nodeName == "SELECT") {
+        
+                    oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad });
+                
+                    initMenu.call(this);
+        
+                }
+                else {
+        
+                    if (!p_oMenu.id) {
+                    
+                        Dom.generateId(p_oMenu);
+                    
+                    }
+        
+                    oMenu = new Overlay(p_oMenu, { visible: false, 
+                                    context: [oButtonElement, "tl", "bl"] });
+        
+                    initMenu.call(this);
+                
+                }
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setOnClick
+        * @description Sets the value of the button's "onclick" attribute.
+        * @protected
+        * @param {Object} p_oObject Object indicating the value for the button's 
+        * "onclick" attribute.
+        */
+        _setOnClick: function (p_oObject) {
+        
+            /*
+                Remove any existing listeners if a "click" event handler 
+                has already been specified.
+            */
+        
+            if (this._onclickAttributeValue && 
+                (this._onclickAttributeValue != p_oObject)) {
+        
+                this.removeListener("click", this._onclickAttributeValue.fn);
+        
+                this._onclickAttributeValue = null;
+        
+            }
+        
+        
+            if (!this._onclickAttributeValue && 
+                Lang.isObject(p_oObject) && 
+                Lang.isFunction(p_oObject.fn)) {
+        
+                this.on("click", p_oObject.fn, p_oObject.obj, p_oObject.scope);
+        
+                this._onclickAttributeValue = p_oObject;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _setSelectedMenuItem
+        * @description Sets the value of the button's 
+        * "selectedMenuItem" attribute.
+        * @protected
+        * @param {Number} p_nIndex Number representing the index of the item 
+        * in the button's menu that is currently selected.
+        */
+        _setSelectedMenuItem: function (p_nIndex) {
+
+            var oMenu = this._menu,
+                oMenuItem;
+
+
+            if (oMenu && oMenu instanceof Menu) {
+
+                oMenuItem = oMenu.getItem(p_nIndex);
+                
+
+                if (oMenuItem && !oMenuItem.cfg.getProperty("selected")) {
+                
+                    oMenuItem.cfg.setProperty("selected", true);
+                
+                }
+            
+            }
+
+        },
+        
+        
+        // Protected methods
+
+        
+        
+        /**
+        * @method _isActivationKey
+        * @description Determines if the specified keycode is one that toggles  
+        * the button's "active" state.
+        * @protected
+        * @param {Number} p_nKeyCode Number representing the keycode to 
+        * be evaluated.
+        * @return {Boolean}
+        */
+        _isActivationKey: function (p_nKeyCode) {
+        
+            var sType = this.get("type"),
+                aKeyCodes = (sType == "checkbox" || sType == "radio") ? 
+                    this.CHECK_ACTIVATION_KEYS : this.ACTIVATION_KEYS,
+        
+                nKeyCodes = aKeyCodes.length,
+                i;
+        
+            if (nKeyCodes > 0) {
+        
+                i = nKeyCodes - 1;
+        
+                do {
+        
+                    if (p_nKeyCode == aKeyCodes[i]) {
+        
+                        return true;
+        
+                    }
+        
+                }
+                while (i--);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _isSplitButtonOptionKey
+        * @description Determines if the specified keycode is one that toggles  
+        * the display of the split button's menu.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        * @return {Boolean}
+        */
+        _isSplitButtonOptionKey: function (p_oEvent) {
+        
+            return (p_oEvent.ctrlKey && p_oEvent.shiftKey && 
+                Event.getCharCode(p_oEvent) == 77);
+        
+        },
+        
+        
+        /**
+        * @method _addListenersToForm
+        * @description Adds event handlers to the button's form.
+        * @protected
+        */
+        _addListenersToForm: function () {
+        
+            var oForm = this.getForm(),
+                oSrcElement,
+                aListeners,
+                nListeners,
+                i,
+                bHasKeyPressListener;
+        
+        
+            if (oForm) {
+        
+                Event.on(oForm, "reset", this._onFormReset, null, this);
+                Event.on(oForm, "submit", this.createHiddenFields, null, this);
+        
+                oSrcElement = this.get("srcelement");
+        
+        
+                if (this.get("type") == "submit" || 
+                    (oSrcElement && oSrcElement.type == "submit")) 
+                {
+                
+                    aListeners = Event.getListeners(oForm, "keypress");
+                    bHasKeyPressListener = false;
+            
+                    if (aListeners) {
+            
+                        nListeners = aListeners.length;
+        
+                        if (nListeners > 0) {
+            
+                            i = nListeners - 1;
+                            
+                            do {
+               
+                                if (aListeners[i].fn == 
+                                    YAHOO.widget.Button.onFormKeyPress) 
+                                {
+                
+                                    bHasKeyPressListener = true;
+                                    break;
+                                
+                                }
+                
+                            }
+                            while (i--);
+                        
+                        }
+                    
+                    }
+            
+            
+                    if (!bHasKeyPressListener) {
+        
+                        Event.on(oForm, "keypress", 
+                            YAHOO.widget.Button.onFormKeyPress);
+            
+                    }
+        
+                }
+            
+            }
+        
+        },
+        
+        
+        _originalMaxHeight: -1,
+        
+        
+        /**
+        * @method _showMenu
+        * @description Shows the button's menu.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object 
+        * passed back by the event utility (YAHOO.util.Event) that triggered 
+        * the display of the menu.
+        */
+        _showMenu: function (p_oEvent) {
+        
+            YAHOO.widget.MenuManager.hideVisible();
+        
+            if (m_oOverlayManager) {
+        
+                m_oOverlayManager.hideAll();
+            
+            }
+        
+        
+            var oMenu = this._menu,
+                nViewportHeight = Dom.getViewportHeight(),
+                nMenuHeight,
+                nScrollTop,
+                nY;
+        
+        
+            if (oMenu && (oMenu instanceof Menu)) {
+        
+                oMenu.cfg.applyConfig({ context: [this.get("id"), "tl", "bl"],
+                    constraintoviewport: false,
+                    clicktohide: false,
+                    visible: true });
+                    
+                oMenu.cfg.fireQueue();
+            
+                oMenu.align("tl", "bl");
+        
+                /*
+                    Stop the propagation of the event so that the MenuManager 
+                    doesn't blur the menu after it gets focus.
+                */
+        
+                if (p_oEvent.type == "mousedown") {
+        
+                    Event.stopPropagation(p_oEvent);
+        
+                }
+
+
+                if (this.get("focusmenu")) {
+        
+                    this._menu.focus();
+                
+                }
+        
+                nMenuHeight = oMenu.element.offsetHeight;
+        
+        
+                if ((oMenu.cfg.getProperty("y") + nMenuHeight) > 
+                    nViewportHeight) {
+        
+        
+                    oMenu.align("bl", "tl");
+        
+                    nY = oMenu.cfg.getProperty("y");
+        
+                    nScrollTop = Dom.getDocumentScrollTop();
+        
+        
+                    if (nScrollTop >= nY) {
+        
+                        if (this._originalMaxHeight == -1) {
+        
+                            this._originalMaxHeight = 
+                                    oMenu.cfg.getProperty("maxheight");
+        
+                        }
+        
+                        oMenu.cfg.setProperty("maxheight", 
+                                    (nMenuHeight - ((nScrollTop - nY) + 20)));
+        
+                        oMenu.align("bl", "tl");
+        
+                    }
+        
+                }
+        
+            }
+            else if (oMenu && (oMenu instanceof Overlay)) {
+        
+                oMenu.show();
+                oMenu.align("tl", "bl");
+
+                nMenuHeight = oMenu.element.offsetHeight;
+        
+        
+                if ((oMenu.cfg.getProperty("y") + nMenuHeight) > 
+                    nViewportHeight) {
+        
+        
+                    oMenu.align("bl", "tl");
+                    
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _hideMenu
+        * @description Hides the button's menu.
+        * @protected
+        */
+        _hideMenu: function () {
+        
+            var oMenu = this._menu;
+        
+            if (oMenu) {
+        
+                oMenu.hide();
+        
+            }
+        
+        },
+        
+        
+        
+        
+        // Protected event handlers
+        
+        
+        /**
+        * @method _onMouseOver
+        * @description "mouseover" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseOver: function (p_oEvent) {
+        
+            if (!this._hasMouseEventHandlers) {
+        
+                this.on("mouseout", this._onMouseOut);
+                this.on("mousedown", this._onMouseDown);
+                this.on("mouseup", this._onMouseUp);
+        
+                this._hasMouseEventHandlers = true;
+        
+            }
+        
+            this.addStateCSSClasses("hover");
+        
+            if (this._activationButtonPressed) {
+        
+                this.addStateCSSClasses("active");
+        
+            }
+        
+        
+            if (this._bOptionPressed) {
+        
+                this.addStateCSSClasses("activeoption");
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMouseOut
+        * @description "mouseout" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseOut: function (p_oEvent) {
+        
+            this.removeStateCSSClasses("hover");
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+        
+            }
+        
+            if (this._activationButtonPressed || this._bOptionPressed) {
+        
+                Event.on(document, "mouseup", this._onDocumentMouseUp, 
+                    null, this);
+        
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onDocumentMouseUp
+        * @description "mouseup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentMouseUp: function (p_oEvent) {
+        
+            this._activationButtonPressed = false;
+            this._bOptionPressed = false;
+        
+            var sType = this.get("type");
+        
+            if (sType == "menu" || sType == "split") {
+        
+                this.removeStateCSSClasses(
+                    (sType == "menu" ? "active" : "activeoption"));
+        
+                this._hideMenu();
+        
+            }
+        
+            Event.removeListener(document, "mouseup", this._onDocumentMouseUp);
+        
+        },
+        
+        
+        /**
+        * @method _onMouseDown
+        * @description "mousedown" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseDown: function (p_oEvent) {
+        
+            var sType,
+                oElement,
+                nX,
+                me;
+        
+        
+            function onMouseUp() {
+            
+                this._hideMenu();
+                this.removeListener("mouseup", onMouseUp);
+            
+            }
+        
+        
+            if ((p_oEvent.which || p_oEvent.button) == 1) {
+        
+        
+                if (!this.hasFocus()) {
+                
+                    this.focus();
+                
+                }
+        
+        
+                sType = this.get("type");
+        
+        
+                if (sType == "split") {
+                
+                    oElement = this.get("element");
+                    nX = Event.getPageX(p_oEvent) - Dom.getX(oElement);
+        
+                    if ((oElement.offsetWidth - this.OPTION_AREA_WIDTH) < nX) {
+                        
+                        this.fireEvent("option", p_oEvent);
+        
+                    }
+                    else {
+        
+                        this.addStateCSSClasses("active");
+        
+                        this._activationButtonPressed = true;
+        
+                    }
+        
+                }
+                else if (sType == "menu") {
+        
+                    if (this.isActive()) {
+        
+                        this._hideMenu();
+        
+                        this._activationButtonPressed = false;
+        
+                    }
+                    else {
+        
+                        this._showMenu(p_oEvent);
+        
+                        this._activationButtonPressed = true;
+                    
+                    }
+        
+                }
+                else {
+        
+                    this.addStateCSSClasses("active");
+        
+                    this._activationButtonPressed = true;
+                
+                }
+        
+        
+        
+                if (sType == "split" || sType == "menu") {
+
+                    me = this;
+        
+                    this._hideMenuTimerId = window.setTimeout(function () {
+                    
+                        me.on("mouseup", onMouseUp);
+                    
+                    }, 250);
+        
+                }
+        
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onMouseUp
+        * @description "mouseup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onMouseUp: function (p_oEvent) {
+        
+            var sType = this.get("type");
+        
+        
+            if (this._hideMenuTimerId) {
+        
+                window.clearTimeout(this._hideMenuTimerId);
+        
+            }
+        
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                this.set("checked", !(this.get("checked")));
+            
+            }
+        
+        
+            this._activationButtonPressed = false;
+            
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+            
+            }
+            
+        },
+        
+        
+        /**
+        * @method _onFocus
+        * @description "focus" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onFocus: function (p_oEvent) {
+        
+            var oElement;
+        
+            this.addStateCSSClasses("focus");
+        
+            if (this._activationKeyPressed) {
+        
+                this.addStateCSSClasses("active");
+           
+            }
+        
+            m_oFocusedButton = this;
+        
+        
+            if (!this._hasKeyEventHandlers) {
+        
+                oElement = this._button;
+        
+                Event.on(oElement, "blur", this._onBlur, null, this);
+                Event.on(oElement, "keydown", this._onKeyDown, null, this);
+                Event.on(oElement, "keyup", this._onKeyUp, null, this);
+        
+                this._hasKeyEventHandlers = true;
+        
+            }
+        
+        
+            this.fireEvent("focus", p_oEvent);
+        
+        },
+        
+        
+        /**
+        * @method _onBlur
+        * @description "blur" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onBlur: function (p_oEvent) {
+        
+            this.removeStateCSSClasses("focus");
+        
+            if (this.get("type") != "menu") {
+        
+                this.removeStateCSSClasses("active");
+        
+            }    
+        
+            if (this._activationKeyPressed) {
+        
+                Event.on(document, "keyup", this._onDocumentKeyUp, null, this);
+        
+            }
+        
+        
+            m_oFocusedButton = null;
+        
+            this.fireEvent("blur", p_oEvent);
+           
+        },
+        
+        
+        /**
+        * @method _onDocumentKeyUp
+        * @description "keyup" event handler for the document.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentKeyUp: function (p_oEvent) {
+        
+            if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                this._activationKeyPressed = false;
+                
+                Event.removeListener(document, "keyup", this._onDocumentKeyUp);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onKeyDown
+        * @description "keydown" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyDown: function (p_oEvent) {
+        
+            var oMenu = this._menu;
+        
+        
+            if (this.get("type") == "split" && 
+                this._isSplitButtonOptionKey(p_oEvent)) {
+        
+                this.fireEvent("option", p_oEvent);
+        
+            }
+            else if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                if (this.get("type") == "menu") {
+        
+                    this._showMenu(p_oEvent);
+        
+                }
+                else {
+        
+                    this._activationKeyPressed = true;
+                    
+                    this.addStateCSSClasses("active");
+                
+                }
+            
+            }
+        
+        
+            if (oMenu && oMenu.cfg.getProperty("visible") && 
+                Event.getCharCode(p_oEvent) == 27) {
+            
+                oMenu.hide();
+                this.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onKeyUp
+        * @description "keyup" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyUp: function (p_oEvent) {
+        
+            var sType;
+        
+            if (this._isActivationKey(Event.getCharCode(p_oEvent))) {
+        
+                sType = this.get("type");
+        
+                if (sType == "checkbox" || sType == "radio") {
+        
+                    this.set("checked", !(this.get("checked")));
+                
+                }
+        
+                this._activationKeyPressed = false;
+        
+                if (this.get("type") != "menu") {
+        
+                    this.removeStateCSSClasses("active");
+        
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onClick
+        * @description "click" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onClick: function (p_oEvent) {
+        
+            var sType = this.get("type"),
+                sTitle,
+                oForm,
+                oSrcElement,
+                oElement,
+                nX;
+        
+        
+            switch (sType) {
+        
+            case "radio":
+            case "checkbox":
+    
+                if (this.get("checked")) {
+                    
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_CHECKED_TITLE : 
+                                this.CHECKBOX_CHECKED_TITLE;
+                
+                }
+                else {
+                
+                    sTitle = (sType == "radio") ? 
+                                this.RADIO_DEFAULT_TITLE : 
+                                this.CHECKBOX_DEFAULT_TITLE;
+                
+                }
+                
+                this.set("title", sTitle);
+    
+                break;
+    
+            case "submit":
+    
+                this.submitForm();
+            
+                break;
+    
+            case "reset":
+    
+                oForm = this.getForm();
+    
+                if (oForm) {
+    
+                    oForm.reset();
+                
+                }
+    
+                break;
+    
+            case "menu":
+    
+                sTitle = this._menu.cfg.getProperty("visible") ? 
+                                this.MENUBUTTON_MENU_VISIBLE_TITLE : 
+                                this.MENUBUTTON_DEFAULT_TITLE;
+    
+                this.set("title", sTitle);
+    
+                break;
+    
+            case "split":
+    
+                oElement = this.get("element");
+                nX = Event.getPageX(p_oEvent) - Dom.getX(oElement);
+    
+                if ((oElement.offsetWidth - this.OPTION_AREA_WIDTH) < nX) {
+    
+                    return false;
+                
+                }
+                else {
+    
+                    this._hideMenu();
+        
+                    oSrcElement = this.get("srcelement");
+        
+                    if (oSrcElement && oSrcElement.type == "submit") {
+    
+                        this.submitForm();
+                    
+                    }
+                
+                }
+    
+                sTitle = this._menu.cfg.getProperty("visible") ? 
+                                this.SPLITBUTTON_OPTION_VISIBLE_TITLE : 
+                                this.SPLITBUTTON_DEFAULT_TITLE;
+    
+                this.set("title", sTitle);
+    
+                break;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onAppendTo
+        * @description "appendTo" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onAppendTo: function (p_oEvent) {
+        
+            /*
+                It is necessary to call "getForm" using "setTimeout" to make 
+                sure that the button's "form" property returns a node 
+                reference.  Sometimes, if you try to get the reference 
+                immediately after appending the field, it is null.
+            */
+        
+            var me = this;
+        
+            window.setTimeout(function () {
+        
+                me._addListenersToForm();
+        
+            }, 0);
+        
+        },
+        
+        
+        /**
+        * @method _onFormReset
+        * @description "reset" event handler for the button's form.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event 
+        * object passed back by the event utility (YAHOO.util.Event).
+        */
+        _onFormReset: function (p_oEvent) {
+        
+            var sType = this.get("type"),
+                oMenu = this._menu;
+        
+            if (sType == "checkbox" || sType == "radio") {
+        
+                this.resetValue("checked");
+        
+            }
+        
+        
+            if (oMenu && (oMenu instanceof Menu)) {
+        
+                this.resetValue("selectedMenuItem");
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onDocumentMouseDown
+        * @description "mousedown" event handler for the document.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onDocumentMouseDown: function (p_oEvent) {
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                oButtonElement = this.get("element"),
+                oMenuElement = this._menu.element;
+        
+            if (oTarget != oButtonElement && 
+                !Dom.isAncestor(oButtonElement, oTarget) && 
+                oTarget != oMenuElement && 
+                !Dom.isAncestor(oMenuElement, oTarget)) {
+        
+                this._hideMenu();
+        
+                Event.removeListener(document, "mousedown", 
+                    this._onDocumentMouseDown);    
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOption
+        * @description "option" event handler for the button.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onOption: function (p_oEvent) {
+        
+            if (this.hasClass("yui-split-button-activeoption")) {
+        
+                this._hideMenu();
+        
+                this._bOptionPressed = false;
+        
+            }
+            else {
+        
+                this._showMenu(p_oEvent);    
+        
+                this._bOptionPressed = true;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOverlayBeforeShow
+        * @description "beforeshow" event handler for the 
+        * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a> instance 
+        * serving as the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onOverlayBeforeShow: function (p_sType) {
+        
+            var oMenu = this._menu;
+        
+            oMenu.render(this.get("element").parentNode);
+            
+            oMenu.beforeShowEvent.unsubscribe(this._onOverlayBeforeShow);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuShow
+        * @description "show" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onMenuShow: function (p_sType) {
+        
+            Event.on(document, "mousedown", this._onDocumentMouseDown, 
+                null, this);
+        
+            var sTitle,
+                sState;
+            
+            if (this.get("type") == "split") {
+        
+                sTitle = this.SPLITBUTTON_OPTION_VISIBLE_TITLE;
+                sState = "activeoption";
+            
+            }
+            else {
+        
+                sTitle = this.MENUBUTTON_MENU_VISIBLE_TITLE;        
+                sState = "active";
+        
+            }
+        
+            this.addStateCSSClasses(sState);
+            this.set("title", sTitle);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuHide
+        * @description "hide" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        */
+        _onMenuHide: function (p_sType) {
+            
+            var oMenu = this._menu,
+                sTitle,
+                sState;
+        
+            if (oMenu && (oMenu instanceof Menu) && 
+                this._originalMaxHeight != -1) {
+            
+                this._menu.cfg.setProperty("maxheight", 
+                    this._originalMaxHeight);
+        
+            }
+        
+            
+            if (this.get("type") == "split") {
+        
+                sTitle = this.SPLITBUTTON_DEFAULT_TITLE;
+                sState = "activeoption";
+        
+            }
+            else {
+        
+                sTitle = this.MENUBUTTON_DEFAULT_TITLE;        
+                sState = "active";
+            }
+        
+        
+            this.removeStateCSSClasses(sState);
+            this.set("title", sTitle);
+        
+        
+            if (this.get("type") == "split") {
+        
+                this._bOptionPressed = false;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuKeyDown
+        * @description "keydown" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        _onMenuKeyDown: function (p_sType, p_aArgs) {
+        
+            var oEvent = p_aArgs[0];
+        
+            if (Event.getCharCode(oEvent) == 27) {
+        
+                this.focus();
+        
+                if (this.get("type") == "split") {
+                
+                    this._bOptionPressed = false;
+                
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuRender
+        * @description "render" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the  
+        * event thatwas fired.
+        */
+        _onMenuRender: function (p_sType) {
+        
+            var oButtonElement = this.get("element"),
+                oButtonParent = oButtonElement.parentNode,
+                oMenuElement = this._menu.element;
+        
+        
+            if (oButtonParent != oMenuElement.parentNode) {
+        
+                oButtonParent.appendChild(oMenuElement);
+            
+            }
+
+            this.set("selectedMenuItem", this.get("selectedMenuItem"));
+
+        },
+        
+        
+        /**
+        * @method _onMenuItemSelected
+        * @description "selectedchange" event handler for each item in the 
+        * button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {Number} p_nItem Number representing the index of the menu
+        * item that subscribed to the event.
+        */
+        _onMenuItemSelected: function (p_sType, p_aArgs, p_nItem) {
+
+            var bSelected = p_aArgs[0];
+
+            if (bSelected) {
+            
+                this.set("selectedMenuItem", p_nItem);
+
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onMenuItemAdded
+        * @description "itemadded" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event
+        * was fired.
+        * @param {<a href="YAHOO.widget.MenuItem.html">
+        * YAHOO.widget.MenuItem</a>} p_oItem Object representing the menu 
+        * item that subscribed to the event.
+        */
+        _onMenuItemAdded: function (p_sType, p_aArgs, p_oItem) {
+            
+            var oItem = p_aArgs[0];
+        
+            oItem.cfg.subscribeToConfigEvent("selected", 
+                this._onMenuItemSelected, 
+                oItem.index, 
+                this);
+        
+        },
+        
+        
+        /**
+        * @method _onMenuClick
+        * @description "click" event handler for the button's menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        _onMenuClick: function (p_sType, p_aArgs) {
+        
+            var oItem = p_aArgs[1],
+                oSrcElement;
+        
+            if (oItem) {
+        
+                oSrcElement = this.get("srcelement");
+            
+                if (oSrcElement && oSrcElement.type == "submit") {
+        
+                    this.submitForm();
+            
+                }
+            
+                this._hideMenu();
+            
+            }
+        
+        },
+        
+        
+        
+        // Public methods
+        
+        
+        /**
+        * @method createButtonElement
+        * @description Creates the button's HTML elements.
+        * @param {String} p_sType String indicating the type of element 
+        * to create.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-58190037">HTMLElement</a>}
+        */
+        createButtonElement: function (p_sType) {
+        
+            var sNodeName = this.NODE_NAME,
+                oElement = document.createElement(sNodeName);
+        
+            oElement.innerHTML =  "<" + sNodeName + " class=\"first-child\">" + 
+                (p_sType == "link" ? "<a></a>" : 
+                "<button type=\"button\"></button>") + "</" + sNodeName + ">";
+        
+            return oElement;
+        
+        },
+
+        
+        /**
+        * @method addStateCSSClasses
+        * @description Appends state-specific CSS classes to the button's root 
+        * DOM element.
+        */
+        addStateCSSClasses: function (p_sState) {
+        
+            var sType = this.get("type");
+        
+            if (Lang.isString(p_sState)) {
+        
+                if (p_sState != "activeoption") {
+        
+                    this.addClass(this.CSS_CLASS_NAME + ("-" + p_sState));
+        
+                }
+        
+                this.addClass("yui-" + sType + ("-button-" + p_sState));
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeStateCSSClasses
+        * @description Removes state-specific CSS classes to the button's root 
+        * DOM element.
+        */
+        removeStateCSSClasses: function (p_sState) {
+        
+            var sType = this.get("type");
+        
+            if (Lang.isString(p_sState)) {
+        
+                this.removeClass(this.CSS_CLASS_NAME + ("-" + p_sState));
+                this.removeClass("yui-" + sType + ("-button-" + p_sState));
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method createHiddenFields
+        * @description Creates the button's hidden form field and appends it 
+        * to its parent form.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array}
+        */
+        createHiddenFields: function () {
+        
+            this.removeHiddenFields();
+        
+            var oForm = this.getForm(),
+                oButtonField,
+                sType,     
+                bCheckable,
+                oMenu,
+                oMenuItem,
+                sName,
+                oValue,
+                oMenuField;
+        
+        
+            if (oForm && !this.get("disabled")) {
+        
+                sType = this.get("type");
+                bCheckable = (sType == "checkbox" || sType == "radio");
+        
+        
+                if (bCheckable || (m_oSubmitTrigger == this)) {
+                
+        
+                    oButtonField = createInputElement(
+                                    (bCheckable ? sType : "hidden"),
+                                    this.get("name"),
+                                    this.get("value"),
+                                    this.get("checked"));
+            
+            
+                    if (oButtonField) {
+            
+                        if (bCheckable) {
+            
+                            oButtonField.style.display = "none";
+            
+                        }
+            
+                        oForm.appendChild(oButtonField);
+            
+                    }
+        
+                }
+                    
+        
+                oMenu = this._menu;
+            
+            
+                if (oMenu && (oMenu instanceof Menu)) {
+        
+        
+                    oMenuField = oMenu.srcElement;
+                    oMenuItem = oMenu.getItem(this.get("selectedMenuItem"));
+        
+                    if (oMenuField && 
+                        oMenuField.nodeName.toUpperCase() == "SELECT") {
+        
+                        oForm.appendChild(oMenuField);
+                        oMenuField.selectedIndex = oMenuItem.index;
+        
+                    }
+                    else {
+        
+                        oValue = (oMenuItem.value === null || 
+                                    oMenuItem.value === "") ? 
+                                    oMenuItem.cfg.getProperty("text") : 
+                                    oMenuItem.value;
+        
+                        sName = this.get("name");
+        
+                        if (oValue && sName) {
+        
+                            oMenuField = createInputElement("hidden", 
+                                                (sName + "_options"),
+                                                oValue);
+        
+                            oForm.appendChild(oMenuField);
+        
+                        }
+        
+                    }  
+        
+                }
+            
+            
+                if (oButtonField && oMenuField) {
+        
+                    this._hiddenFields = [oButtonField, oMenuField];
+        
+                }
+                else if (!oButtonField && oMenuField) {
+        
+                    this._hiddenFields = oMenuField;
+                
+                }
+                else if (oButtonField && !oMenuField) {
+        
+                    this._hiddenFields = oButtonField;
+                
+                }
+        
+        
+                return this._hiddenFields;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeHiddenFields
+        * @description Removes the button's hidden form field(s) from its 
+        * parent form.
+        */
+        removeHiddenFields: function () {
+        
+            var oField = this._hiddenFields,
+                nFields,
+                i;
+        
+            function removeChild(p_oElement) {
+        
+                if (Dom.inDocument(p_oElement)) {
+        
+                    p_oElement.parentNode.removeChild(p_oElement);
+                
+                }
+                
+            }
+            
+        
+            if (oField) {
+        
+                if (Lang.isArray(oField)) {
+        
+                    nFields = oField.length;
+                    
+                    if (nFields > 0) {
+                    
+                        i = nFields - 1;
+                        
+                        do {
+        
+                            removeChild(oField[i]);
+        
+                        }
+                        while (i--);
+                    
+                    }
+                
+                }
+                else {
+        
+                    removeChild(oField);
+        
+                }
+        
+                this._hiddenFields = null;
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method submitForm
+        * @description Submits the form to which the button belongs.  Returns  
+        * true if the form was submitted successfully, false if the submission 
+        * was cancelled.
+        * @protected
+        * @return {Boolean}
+        */
+        submitForm: function () {
+        
+            var oForm = this.getForm(),
+        
+                oSrcElement = this.get("srcelement"),
+        
+                /*
+                    Boolean indicating if the event fired successfully 
+                    (was not cancelled by any handlers)
+                */
+        
+                bSubmitForm = false,
+                
+                oEvent;
+        
+        
+            if (oForm) {
+        
+                if (this.get("type") == "submit" || 
+                    (oSrcElement && oSrcElement.type == "submit")) 
+                {
+        
+                    m_oSubmitTrigger = this;
+                    
+                }
+        
+        
+                if (YAHOO.env.ua.ie) {
+        
+                    bSubmitForm = oForm.fireEvent("onsubmit");
+        
+                }
+                else {  // Gecko, Opera, and Safari
+        
+                    oEvent = document.createEvent("HTMLEvents");
+                    oEvent.initEvent("submit", true, true);
+        
+                    bSubmitForm = oForm.dispatchEvent(oEvent);
+        
+                }
+        
+        
+                /*
+                    In IE and Safari, dispatching a "submit" event to a form 
+                    WILL cause the form's "submit" event to fire, but WILL NOT 
+                    submit the form.  Therefore, we need to call the "submit" 
+                    method as well.
+                */
+              
+                if ((YAHOO.env.ua.ie || YAHOO.env.ua.webkit) && bSubmitForm) {
+        
+                    oForm.submit();
+                
+                }
+            
+            }
+        
+            return bSubmitForm;
+            
+        },
+        
+        
+        /**
+        * @method init
+        * @description The Button class's initialization method.
+        * @param {String} p_oElement String specifying the id attribute of the 
+        * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>,
+        * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to 
+        * be used to create the button.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href="http://
+        * www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html
+        * #ID-34812697">HTMLButtonElement</a>|<a href="http://www.w3.org/TR
+        * /2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-33759296">
+        * HTMLElement</a>} p_oElement Object reference for the 
+        * <code>&#60;input&#62;</code>, <code>&#60;button&#62;</code>, 
+        * <code>&#60;a&#62;</code>, or <code>&#60;span&#62;</code> element to be 
+        * used to create the button.
+        * @param {Object} p_oElement Object literal specifying a set of 
+        * configuration attributes used to create the button.
+        * @param {Object} p_oAttributes Optional. Object literal specifying a 
+        * set of configuration attributes used to create the button.
+        */
+        init: function (p_oElement, p_oAttributes) {
+        
+            var sNodeName = p_oAttributes.type == "link" ? "A" : "BUTTON",
+                oSrcElement = p_oAttributes.srcelement,
+                oButton = p_oElement.getElementsByTagName(sNodeName)[0],
+                oInput;
+        
+
+            if (!oButton) {
+
+                oInput = p_oElement.getElementsByTagName("INPUT")[0];
+
+
+                if (oInput) {
+
+                    oButton = document.createElement("BUTTON");
+                    oButton.setAttribute("type", "button");
+
+                    oInput.parentNode.replaceChild(oButton, oInput);
+                
+                }
+
+            }
+
+            this._button = oButton;
+        
+
+            YAHOO.widget.Button.superclass.init.call(this, p_oElement, 
+                p_oAttributes);
+        
+        
+            m_oButtons[this.get("id")] = this;
+        
+        
+            this.addClass(this.CSS_CLASS_NAME);
+            
+            this.addClass("yui-" + this.get("type") + "-button");
+        
+            Event.on(this._button, "focus", this._onFocus, null, this);
+            this.on("mouseover", this._onMouseOver);
+            this.on("click", this._onClick);
+            this.on("appendTo", this._onAppendTo);
+            
+        
+            var oContainer = this.get("container"),
+                oElement = this.get("element"),
+                bElInDoc = Dom.inDocument(oElement),
+                oParentNode;
+
+
+            if (oContainer) {
+        
+                if (oSrcElement && oSrcElement != oElement) {
+                
+                    oParentNode = oSrcElement.parentNode;
+
+                    if (oParentNode) {
+                    
+                        oParentNode.removeChild(oSrcElement);
+                    
+                    }
+
+                }
+        
+                if (Lang.isString(oContainer)) {
+        
+                    Event.onContentReady(oContainer, function () {
+        
+                        this.appendTo(oContainer);
+                    
+                    }, null, this);
+        
+                }
+                else {
+        
+                    this.appendTo(oContainer);
+        
+                }
+        
+            }
+            else if (!bElInDoc && oSrcElement && oSrcElement != oElement) {
+
+                oParentNode = oSrcElement.parentNode;
+        
+                if (oParentNode) {
+        
+                    this.fireEvent("beforeAppendTo", {
+                        type: "beforeAppendTo",
+                        target: oParentNode
+                    });
+            
+                    oParentNode.replaceChild(oElement, oSrcElement);
+            
+                    this.fireEvent("appendTo", {
+                        type: "appendTo",
+                        target: oParentNode
+                    });
+                
+                }
+        
+            }
+            else if (this.get("type") != "link" && bElInDoc && oSrcElement && 
+                oSrcElement == oElement) {
+        
+                this._addListenersToForm();
+        
+            }
+        
+        
+        },
+        
+        
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to  
+        * create the button.
+        * @param {Object} p_oAttributes Object literal specifying a set of 
+        * configuration attributes used to create the button.
+        */
+        initAttributes: function (p_oAttributes) {
+        
+            var oAttributes = p_oAttributes || {};
+        
+            YAHOO.widget.Button.superclass.initAttributes.call(this, 
+                oAttributes);
+        
+        
+            /**
+            * @config type
+            * @description String specifying the button's type.  Possible 
+            * values are: "push," "link," "submit," "reset," "checkbox," 
+            * "radio," "menu," and "split."
+            * @default "push"
+            * @type String
+            */
+            this.setAttributeConfig("type", {
+        
+                value: (oAttributes.type || "push"),
+                validator: Lang.isString,
+                writeOnce: true,
+                method: this._setType
+        
+            });
+        
+        
+            /**
+            * @config label
+            * @description String specifying the button's text label 
+            * or innerHTML.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("label", {
+        
+                value: oAttributes.label,
+                validator: Lang.isString,
+                method: this._setLabel
+        
+            });
+        
+        
+            /**
+            * @config value
+            * @description Object specifying the value for the button.
+            * @default null
+            * @type Object
+            */
+            this.setAttributeConfig("value", {
+        
+                value: oAttributes.value
+        
+            });
+        
+        
+            /**
+            * @config name
+            * @description String specifying the name for the button.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("name", {
+        
+                value: oAttributes.name,
+                validator: Lang.isString
+        
+            });
+        
+        
+            /**
+            * @config tabindex
+            * @description Number specifying the tabindex for the button.
+            * @default null
+            * @type Number
+            */
+            this.setAttributeConfig("tabindex", {
+        
+                value: oAttributes.tabindex,
+                validator: Lang.isNumber,
+                method: this._setTabIndex
+        
+            });
+        
+        
+            /**
+            * @config title
+            * @description String specifying the title for the button.
+            * @default null
+            * @type String
+            */
+            this.configureAttribute("title", {
+        
+                value: oAttributes.title,
+                validator: Lang.isString,
+                method: this._setTitle
+        
+            });
+        
+        
+            /**
+            * @config disabled
+            * @description Boolean indicating if the button should be disabled.  
+            * (Disabled buttons are dimmed and will not respond to user input 
+            * or fire events.  Does not apply to button's of type "link.")
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("disabled", {
+        
+                value: (oAttributes.disabled || false),
+                validator: Lang.isBoolean,
+                method: this._setDisabled
+        
+            });
+        
+        
+            /**
+            * @config href
+            * @description String specifying the href for the button.  Applies
+            * only to buttons of type "link."
+            * @type String
+            */
+            this.setAttributeConfig("href", {
+        
+                value: oAttributes.href,
+                validator: Lang.isString,
+                method: this._setHref
+        
+            });
+        
+        
+            /**
+            * @config target
+            * @description String specifying the target for the button.  
+            * Applies only to buttons of type "link."
+            * @type String
+            */
+            this.setAttributeConfig("target", {
+        
+                value: oAttributes.target,
+                validator: Lang.isString,
+                method: this._setTarget
+        
+            });
+        
+        
+            /**
+            * @config checked
+            * @description Boolean indicating if the button is checked. 
+            * Applies only to buttons of type "radio" and "checkbox."
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("checked", {
+        
+                value: (oAttributes.checked || false),
+                validator: Lang.isBoolean,
+                method: this._setChecked
+        
+            });
+        
+        
+            /**
+            * @config container
+            * @description HTML element reference or string specifying the id 
+            * attribute of the HTML element that the button's markup should be 
+            * rendered into.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("container", {
+        
+                value: oAttributes.container,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @config srcelement
+            * @description Object reference to the HTML element (either 
+            * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code>) 
+            * used to create the button.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("srcelement", {
+        
+                value: oAttributes.srcelement,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @config menu
+            * @description Object specifying the menu for the button.  
+            * The value can be one of the following:
+            * <ul>
+            * <li>Object specifying a <a href="YAHOO.widget.Menu.html">
+            * YAHOO.widget.Menu</a> instance.</li>
+            * <li>Object specifying a <a href="YAHOO.widget.Overlay.html">
+            * YAHOO.widget.Overlay</a> instance.</li>
+            * <li>String specifying the id attribute of the <code>&#60;div&#62;
+            * </code> element used to create the menu.  By default the menu 
+            * will be created as an instance of 
+            * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>.  
+            * If the <a href="YAHOO.widget.Menu.html#CSS_CLASS_NAME">
+            * default CSS class name for YAHOO.widget.Menu</a> is applied to 
+            * the <code>&#60;div&#62;</code> element, it will be created as an
+            * instance of <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu
+            * </a>.</li><li>String specifying the id attribute of the 
+            * <code>&#60;select&#62;</code> element used to create the menu.
+            * </li><li>Object specifying the <code>&#60;div&#62;</code> element
+            * used to create the menu.</li>
+            * <li>Object specifying the <code>&#60;select&#62;</code> element
+            * used to create the menu.</li>
+            * <li>Array of object literals, each representing a set of 
+            * <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a> 
+            * configuration attributes.</li>
+            * <li>Array of strings representing the text labels for each menu 
+            * item in the menu.</li>
+            * </ul>
+            * @type <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>|<a 
+            * href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a>|<a 
+            * href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+            * one-html.html#ID-58190037">HTMLElement</a>|String|Array
+            * @default null
+            */
+            this.setAttributeConfig("menu", {
+        
+                value: null,
+                method: this._setMenu,
+                writeOnce: true
+            
+            });
+        
+        
+            /**
+            * @config lazyloadmenu
+            * @description Boolean indicating the value to set for the 
+            * <a href="YAHOO.widget.Menu.html#lazyLoad">"lazyload"</a>
+            * configuration property of the button's menu.  Setting 
+            * "lazyloadmenu" to <code>true </code> will defer rendering of 
+            * the button's menu until the first time it is made visible.  
+            * If "lazyloadmenu" is set to <code>false</code>, the button's 
+            * menu will be rendered immediately if the button is in the 
+            * document, or in response to the button's "appendTo" event if 
+            * the button is not yet in the document.  In either case, the 
+            * menu is rendered into the button's parent HTML element.  
+            * <em>This attribute does not apply if a 
+            * <a href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a> or 
+            * <a href="YAHOO.widget.Overlay.html">YAHOO.widget.Overlay</a> 
+            * instance is passed as the value of the button's "menu" 
+            * configuration attribute. <a href="YAHOO.widget.Menu.html">
+            * YAHOO.widget.Menu</a> or <a href="YAHOO.widget.Overlay.html">
+            * YAHOO.widget.Overlay</a> instances should be rendered before 
+            * being set as the value for the "menu" configuration 
+            * attribute.</em>
+            * @default true
+            * @type Boolean
+            */
+            this.setAttributeConfig("lazyloadmenu", {
+        
+                value: (oAttributes.lazyloadmenu === false ? false : true),
+                validator: Lang.isBoolean,
+                writeOnce: true
+        
+            });
+
+
+            /**
+            * @config menuclassname
+            * @description String representing the CSS class name to be 
+            * applied to the root element of the button's menu.
+            * @type String
+            * @default "yui-button-menu"
+            */
+            this.setAttributeConfig("menuclassname", {
+        
+                value: (oAttributes.menuclassname || "yui-button-menu"),
+                validator: Lang.isString,
+                method: this._setMenuClassName,
+                writeOnce: true
+        
+            });        
+
+
+            /**
+            * @config selectedMenuItem
+            * @description Number representing the index of the item in the 
+            * button's menu that is currently selected.
+            * @type Number
+            * @default null
+            */
+            this.setAttributeConfig("selectedMenuItem", {
+        
+                value: 0,
+                validator: Lang.isNumber,
+                method: this._setSelectedMenuItem
+        
+            });
+        
+        
+            /**
+            * @config onclick
+            * @description Object literal representing the code to be executed  
+            * when the button is clicked.  Format:<br> <code> {<br> 
+            * <strong>fn:</strong> Function,   &#47;&#47; The handler to call 
+            * when the event fires.<br> <strong>obj:</strong> Object, 
+            * &#47;&#47; An object to pass back to the handler.<br> 
+            * <strong>scope:</strong> Object &#47;&#47;  The object to use 
+            * for the scope of the handler.<br> } </code>
+            * @type Object
+            * @default null
+            */
+            this.setAttributeConfig("onclick", {
+        
+                value: oAttributes.onclick,
+                method: this._setOnClick
+            
+            });
+
+
+            /**
+            * @config focusmenu
+            * @description Boolean indicating whether or not the button's menu 
+            * should be focused when it is made visible.
+            * @type Boolean
+            * @default true
+            */
+            this.setAttributeConfig("focusmenu", {
+        
+                value: (oAttributes.focusmenu === false ? false : true),
+                validator: Lang.isBoolean
+        
+            });
+
+        },
+        
+        
+        /**
+        * @method focus
+        * @description Causes the button to receive the focus and fires the 
+        * button's "focus" event.
+        */
+        focus: function () {
+        
+            if (!this.get("disabled")) {
+        
+                this._button.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method blur
+        * @description Causes the button to lose focus and fires the button's
+        * "blur" event.
+        */
+        blur: function () {
+        
+            if (!this.get("disabled")) {
+        
+                this._button.blur();
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method hasFocus
+        * @description Returns a boolean indicating whether or not the button 
+        * has focus.
+        * @return {Boolean}
+        */
+        hasFocus: function () {
+        
+            return (m_oFocusedButton == this);
+        
+        },
+        
+        
+        /**
+        * @method isActive
+        * @description Returns a boolean indicating whether or not the button 
+        * is active.
+        * @return {Boolean}
+        */
+        isActive: function () {
+        
+            return this.hasClass(this.CSS_CLASS_NAME + "-active");
+        
+        },
+        
+        
+        /**
+        * @method getMenu
+        * @description Returns a reference to the button's menu.
+        * @return {<a href="YAHOO.widget.Overlay.html">
+        * YAHOO.widget.Overlay</a>|<a 
+        * href="YAHOO.widget.Menu.html">YAHOO.widget.Menu</a>}
+        */
+        getMenu: function () {
+        
+            return this._menu;
+        
+        },
+        
+        
+        /**
+        * @method getForm
+        * @description Returns a reference to the button's parent form.
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-
+        * 20000929/level-one-html.html#ID-40002357">HTMLFormElement</a>}
+        */
+        getForm: function () {
+        
+            return this._button.form;
+        
+        },
+        
+        
+        /** 
+        * @method getHiddenFields
+        * @description Returns an <code>&#60;input&#62;</code> element or 
+        * array of form elements used to represent the button when its parent 
+        * form is submitted.  
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|Array}
+        */
+        getHiddenFields: function () {
+        
+            return this._hiddenFields;
+        
+        },
+        
+        
+        /**
+        * @method destroy
+        * @description Removes the button's element from its parent element and 
+        * removes all event handlers.
+        */
+        destroy: function () {
+        
+        
+            var oElement = this.get("element"),
+                oParentNode = oElement.parentNode,
+                oMenu = this._menu;
+        
+            if (oMenu) {
+        
+        
+                oMenu.destroy();
+        
+            }
+        
+        
+            Event.purgeElement(oElement);
+            Event.purgeElement(this._button);
+            Event.removeListener(document, "mouseup", this._onDocumentMouseUp);
+            Event.removeListener(document, "keyup", this._onDocumentKeyUp);
+            Event.removeListener(document, "mousedown", 
+                this._onDocumentMouseDown);
+        
+        
+            var oForm = this.getForm();
+            
+            if (oForm) {
+        
+                Event.removeListener(oForm, "reset", this._onFormReset);
+                Event.removeListener(oForm, "submit", this.createHiddenFields);
+        
+            }
+        
+        
+            oParentNode.removeChild(oElement);
+        
+        
+            delete m_oButtons[this.get("id")];
+        
+        
+        },
+        
+        
+        fireEvent: function (p_sType , p_aArgs) {
+        
+            //  Disabled buttons should not respond to DOM events
+        
+            if (this.DOM_EVENTS[p_sType] && this.get("disabled")) {
+        
+                return;
+        
+            }
+        
+            YAHOO.widget.Button.superclass.fireEvent.call(this, p_sType, 
+                p_aArgs);
+        
+        },
+        
+        
+        /**
+        * @method toString
+        * @description Returns a string representing the button.
+        * @return {String}
+        */
+        toString: function () {
+        
+            return ("Button " + this.get("id"));
+        
+        }
+    
+    });
+    
+    
+    /**
+    * @method YAHOO.widget.Button.onFormKeyPress
+    * @description "keypress" event handler for the button's form.
+    * @param {Event} p_oEvent Object representing the DOM event object passed 
+    * back by the event utility (YAHOO.util.Event).
+    */
+    YAHOO.widget.Button.onFormKeyPress = function (p_oEvent) {
+    
+        var oTarget = Event.getTarget(p_oEvent),
+            nCharCode = Event.getCharCode(p_oEvent),
+            sNodeName = oTarget.nodeName && oTarget.nodeName.toUpperCase(),
+            sType = oTarget.type,
+    
+            /*
+                Boolean indicating if the form contains any enabled or 
+                disabled YUI submit buttons
+            */
+    
+            bFormContainsYUIButtons = false,
+    
+            oButton,
+    
+            oYUISubmitButton,   // The form's first, enabled YUI submit button
+    
+            /*
+                 The form's first, enabled HTML submit button that precedes any 
+                 YUI submit button
+            */
+    
+            oPrecedingSubmitButton,
+            
+    
+            /*
+                 The form's first, enabled HTML submit button that follows a 
+                 YUI button
+            */
+            
+            oFollowingSubmitButton; 
+    
+    
+        function isSubmitButton(p_oElement) {
+    
+            var sId,
+                oSrcElement;
+    
+            switch (p_oElement.nodeName.toUpperCase()) {
+    
+            case "INPUT":
+            case "BUTTON":
+            
+                if (p_oElement.type == "submit" && !p_oElement.disabled) {
+                    
+                    if (!bFormContainsYUIButtons && 
+                        !oPrecedingSubmitButton) {
+
+                        oPrecedingSubmitButton = p_oElement;
+
+                    }
+                    
+                    if (oYUISubmitButton && !oFollowingSubmitButton) {
+                    
+                        oFollowingSubmitButton = p_oElement;
+                    
+                    }
+                
+                }
+
+                break;
+            
+
+            default:
+            
+                sId = p_oElement.id;
+    
+                if (sId) {
+    
+                    oButton = m_oButtons[sId];
+        
+                    if (oButton) {
+
+                        bFormContainsYUIButtons = true;
+        
+                        if (!oButton.get("disabled")) {
+
+                            oSrcElement = oButton.get("srcelement");
+    
+                            if (!oYUISubmitButton &&
+                                (oButton.get("type") == "submit" || 
+                                (oSrcElement && oSrcElement.type == "submit"))) 
+                            {
+
+                                oYUISubmitButton = oButton;
+                            
+                            }
+                        
+                        }
+                        
+                    }
+                
+                }
+
+                break;
+    
+            }
+    
+        }
+    
+    
+        if (nCharCode == 13 && ((sNodeName == "INPUT" && (sType == "text" || 
+            sType == "password" || sType == "checkbox" || sType == "radio" || 
+            sType == "file") ) || sNodeName == "SELECT"))
+        {
+    
+            Dom.getElementsBy(isSubmitButton, "*", this);
+    
+    
+            if (oPrecedingSubmitButton) {
+    
+                /*
+                     Need to set focus to the first enabled submit button
+                     to make sure that IE includes its name and value 
+                     in the form's data set.
+                */
+    
+                oPrecedingSubmitButton.focus();
+            
+            }
+            else if (!oPrecedingSubmitButton && oYUISubmitButton) {
+    
+                if (oFollowingSubmitButton) {
+    
+                    /*
+                        Need to call "preventDefault" to ensure that 
+                        the name and value of the regular submit button 
+                        following the YUI button doesn't get added to the 
+                        form's data set when it is submitted.
+                    */
+    
+                    Event.preventDefault(p_oEvent);
+                
+                }
+    
+                oYUISubmitButton.submitForm();
+    
+            }
+            
+        }
+    
+    };
+    
+    
+    /**
+    * @method addHiddenFieldsToForm
+    * @description Searches the specified form and adds hidden fields for  
+    * instances of YAHOO.widget.Button that are of type "radio," "checkbox," 
+    * "menu," and "split."
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-40002357">HTMLFormElement</a>} p_oForm Object reference 
+    * for the form to search.
+    */
+    YAHOO.widget.Button.addHiddenFieldsToForm = function (p_oForm) {
+    
+        var aButtons = Dom.getElementsByClassName(
+                            YAHOO.widget.Button.prototype.CSS_CLASS_NAME, 
+                            "*", 
+                            p_oForm),
+    
+            nButtons = aButtons.length,
+            oButton,
+            sId,
+            i;
+    
+        if (nButtons > 0) {
+    
+    
+            for (i = 0; i < nButtons; i++) {
+    
+                sId = aButtons[i].id;
+    
+                if (sId) {
+    
+                    oButton = m_oButtons[sId];
+        
+                    if (oButton) {
+           
+                        oButton.createHiddenFields();
+                        
+                    }
+                
+                }
+            
+            }
+    
+        }
+    
+    };
+    
+    
+    
+    // Events
+    
+    
+    /**
+    * @event focus
+    * @description Fires when the menu item receives focus.  Passes back a  
+    * single object representing the original DOM event object passed back by 
+    * the event utility (YAHOO.util.Event) when the event was fired.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> 
+    * for more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+    
+    
+    /**
+    * @event blur
+    * @description Fires when the menu item loses the input focus.  Passes back  
+    * a single object representing the original DOM event object passed back by 
+    * the event utility (YAHOO.util.Event) when the event was fired.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for  
+    * more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+    
+    
+    /**
+    * @event option
+    * @description Fires when the user invokes the button's option.  Passes 
+    * back a single object representing the original DOM event (either 
+    * "mousedown" or "keydown") that caused the "option" event to fire.  See 
+    * <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> 
+    * for more information on listening for this event.
+    * @type YAHOO.util.CustomEvent
+    */
+
+})();
+(function () {
+
+    // Shorthard for utilities
+    
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Lang = YAHOO.lang,
+        Button = YAHOO.widget.Button,  
+    
+        // Private collection of radio buttons
+    
+        m_oButtons = {};
+
+
+
+    /**
+    * The ButtonGroup class creates a set of buttons that are mutually 
+    * exclusive; checking one button in the set will uncheck all others in the 
+    * button group.
+    * @param {String} p_oElement String specifying the id attribute of the 
+    * <code>&#60;div&#62;</code> element of the button group.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+    * specifying the <code>&#60;div&#62;</code> element of the button group.
+    * @param {Object} p_oElement Object literal specifying a set of 
+    * configuration attributes used to create the button group.
+    * @param {Object} p_oAttributes Optional. Object literal specifying a set 
+    * of configuration attributes used to create the button group.
+    * @namespace YAHOO.widget
+    * @class ButtonGroup
+    * @constructor
+    * @extends YAHOO.util.Element
+    */
+    YAHOO.widget.ButtonGroup = function (p_oElement, p_oAttributes) {
+    
+        var fnSuperClass = YAHOO.widget.ButtonGroup.superclass.constructor,
+            sNodeName,
+            oElement,
+            sId;
+    
+        if (arguments.length == 1 && !Lang.isString(p_oElement) && 
+            !p_oElement.nodeName) {
+    
+            if (!p_oElement.id) {
+    
+                sId = Dom.generateId();
+    
+                p_oElement.id = sId;
+    
+    
+            }
+    
+    
+    
+            fnSuperClass.call(this, (this._createGroupElement()), p_oElement);
+    
+        }
+        else if (Lang.isString(p_oElement)) {
+    
+            oElement = Dom.get(p_oElement);
+    
+            if (oElement) {
+            
+                if (oElement.nodeName.toUpperCase() == this.NODE_NAME) {
+    
+            
+                    fnSuperClass.call(this, oElement, p_oAttributes);
+    
+                }
+    
+            }
+        
+        }
+        else {
+    
+            sNodeName = p_oElement.nodeName;
+    
+            if (sNodeName && sNodeName == this.NODE_NAME) {
+        
+                if (!p_oElement.id) {
+        
+                    p_oElement.id = Dom.generateId();
+        
+        
+                }
+        
+        
+                fnSuperClass.call(this, p_oElement, p_oAttributes);
+    
+            }
+    
+        }
+    
+    };
+    
+    
+    YAHOO.extend(YAHOO.widget.ButtonGroup, YAHOO.util.Element, {
+    
+    
+        // Protected properties
+        
+        
+        /** 
+        * @property _buttons
+        * @description Array of buttons in the button group.
+        * @default null
+        * @protected
+        * @type Array
+        */
+        _buttons: null,
+        
+        
+        
+        // Constants
+        
+        
+        /**
+        * @property NODE_NAME
+        * @description The name of the tag to be used for the button 
+        * group's element. 
+        * @default "DIV"
+        * @final
+        * @type String
+        */
+        NODE_NAME: "DIV",
+        
+        
+        /**
+        * @property CSS_CLASS_NAME
+        * @description String representing the CSS class(es) to be applied  
+        * to the button group's element.
+        * @default "yui-buttongroup"
+        * @final
+        * @type String
+        */
+        CSS_CLASS_NAME: "yui-buttongroup",
+    
+    
+    
+        // Protected methods
+        
+        
+        /**
+        * @method _createGroupElement
+        * @description Creates the button group's element.
+        * @protected
+        * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-22445964">HTMLDivElement</a>}
+        */
+        _createGroupElement: function () {
+        
+            var oElement = document.createElement(this.NODE_NAME);
+        
+            return oElement;
+        
+        },
+        
+        
+        
+        // Protected attribute setter methods
+        
+        
+        /**
+        * @method _setDisabled
+        * @description Sets the value of the button groups's 
+        * "disabled" attribute.
+        * @protected
+        * @param {Boolean} p_bDisabled Boolean indicating the value for
+        * the button group's "disabled" attribute.
+        */
+        _setDisabled: function (p_bDisabled) {
+        
+            var nButtons = this.getCount(),
+                i;
+        
+            if (nButtons > 0) {
+        
+                i = nButtons - 1;
+                
+                do {
+        
+                    this._buttons[i].set("disabled", p_bDisabled);
+                
+                }
+                while (i--);
+        
+            }
+        
+        },
+        
+        
+        
+        // Protected event handlers
+        
+        
+        /**
+        * @method _onKeyDown
+        * @description "keydown" event handler for the button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        _onKeyDown: function (p_oEvent) {
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                nCharCode = Event.getCharCode(p_oEvent),
+                sId = oTarget.parentNode.parentNode.id,
+                oButton = m_oButtons[sId],
+                nIndex = -1;
+        
+        
+            if (nCharCode == 37 || nCharCode == 38) {
+        
+                nIndex = (oButton.index === 0) ? 
+                            (this._buttons.length - 1) : (oButton.index - 1);
+            
+            }
+            else if (nCharCode == 39 || nCharCode == 40) {
+        
+                nIndex = (oButton.index === (this._buttons.length - 1)) ? 
+                            0 : (oButton.index + 1);
+        
+            }
+        
+        
+            if (nIndex > -1) {
+        
+                this.check(nIndex);
+                this.getButton(nIndex).focus();
+            
+            }        
+        
+        },
+        
+        
+        /**
+        * @method _onAppendTo
+        * @description "appendTo" event handler for the button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the event that was fired.
+        */
+        _onAppendTo: function (p_oEvent) {
+        
+            var aButtons = this._buttons,
+                nButtons = aButtons.length,
+                i;
+        
+            for (i = 0; i < nButtons; i++) {
+        
+                aButtons[i].appendTo(this.get("element"));
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onButtonCheckedChange
+        * @description "checkedChange" event handler for each button in the 
+        * button group.
+        * @protected
+        * @param {Event} p_oEvent Object representing the event that was fired.
+        * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}  
+        * p_oButton Object representing the button that fired the event.
+        */
+        _onButtonCheckedChange: function (p_oEvent, p_oButton) {
+        
+            var bChecked = p_oEvent.newValue,
+                oCheckedButton = this.get("checkedButton");
+        
+            if (bChecked && oCheckedButton != p_oButton) {
+        
+                if (oCheckedButton) {
+        
+                    oCheckedButton.set("checked", false, true);
+        
+                }
+        
+                this.set("checkedButton", p_oButton);
+                this.set("value", p_oButton.get("value"));
+        
+            }
+            else if (oCheckedButton && !oCheckedButton.set("checked")) {
+        
+                oCheckedButton.set("checked", true, true);
+        
+            }
+           
+        },
+        
+        
+        
+        // Public methods
+        
+        
+        /**
+        * @method init
+        * @description The ButtonGroup class's initialization method.
+        * @param {String} p_oElement String specifying the id attribute of the 
+        * <code>&#60;div&#62;</code> element of the button group.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+        * specifying the <code>&#60;div&#62;</code> element of the button group.
+        * @param {Object} p_oElement Object literal specifying a set of  
+        * configuration attributes used to create the button group.
+        * @param {Object} p_oAttributes Optional. Object literal specifying a
+        * set of configuration attributes used to create the button group.
+        */
+        init: function (p_oElement, p_oAttributes) {
+        
+            this._buttons = [];
+        
+            YAHOO.widget.ButtonGroup.superclass.init.call(this, p_oElement, 
+                    p_oAttributes);
+        
+            this.addClass(this.CSS_CLASS_NAME);
+        
+        
+            var aButtons = this.getElementsByClassName("yui-radio-button");
+        
+        
+            if (aButtons.length > 0) {
+        
+        
+                this.addButtons(aButtons);
+        
+            }
+        
+        
+        
+            function isRadioButton(p_oElement) {
+        
+                return (p_oElement.type == "radio");
+        
+            }
+        
+            aButtons = 
+                Dom.getElementsBy(isRadioButton, "input", this.get("element"));
+        
+        
+            if (aButtons.length > 0) {
+        
+        
+                this.addButtons(aButtons);
+        
+            }
+        
+            this.on("keydown", this._onKeyDown);
+            this.on("appendTo", this._onAppendTo);
+        
+
+            var oContainer = this.get("container");
+
+            if (oContainer) {
+        
+                if (Lang.isString(oContainer)) {
+        
+                    Event.onContentReady(oContainer, function () {
+        
+                        this.appendTo(oContainer);            
+                    
+                    }, null, this);
+        
+                }
+                else {
+        
+                    this.appendTo(oContainer);
+        
+                }
+        
+            }
+        
+        
+        
+        },
+        
+        
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to  
+        * create the button group.
+        * @param {Object} p_oAttributes Object literal specifying a set of 
+        * configuration attributes used to create the button group.
+        */
+        initAttributes: function (p_oAttributes) {
+        
+            var oAttributes = p_oAttributes || {};
+        
+            YAHOO.widget.ButtonGroup.superclass.initAttributes.call(
+                this, oAttributes);
+        
+        
+            /**
+            * @config name
+            * @description String specifying the name for the button group.  
+            * This name will be applied to each button in the button group.
+            * @default null
+            * @type String
+            */
+            this.setAttributeConfig("name", {
+        
+                value: oAttributes.name,
+                validator: Lang.isString
+        
+            });
+        
+        
+            /**
+            * @config disabled
+            * @description Boolean indicating if the button group should be 
+            * disabled.  Disabling the button group will disable each button 
+            * in the button group.  Disabled buttons are dimmed and will not 
+            * respond to user input or fire events.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig("disabled", {
+        
+                value: (oAttributes.disabled || false),
+                validator: Lang.isBoolean,
+                method: this._setDisabled
+        
+            });
+        
+        
+            /**
+            * @config value
+            * @description Object specifying the value for the button group.
+            * @default null
+            * @type Object
+            */
+            this.setAttributeConfig("value", {
+        
+                value: oAttributes.value
+        
+            });
+        
+        
+            /**
+            * @config container
+            * @description HTML element reference or string specifying the id 
+            * attribute of the HTML element that the button group's markup
+            * should be rendered into.
+            * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+            * level-one-html.html#ID-58190037">HTMLElement</a>|String
+            * @default null
+            */
+            this.setAttributeConfig("container", {
+        
+                value: oAttributes.container,
+                writeOnce: true
+        
+            });
+        
+        
+            /**
+            * @config checkedButton
+            * @description Reference for the button in the button group that 
+            * is checked.
+            * @type {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+            * @default null
+            */
+            this.setAttributeConfig("checkedButton", {
+        
+                value: null
+        
+            });
+        
+        },
+        
+        
+        /**
+        * @method addButton
+        * @description Adds the button to the button group.
+        * @param {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}  
+        * p_oButton Object reference for the <a href="YAHOO.widget.Button.html">
+        * YAHOO.widget.Button</a> instance to be added to the button group.
+        * @param {String} p_oButton String specifying the id attribute of the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> element 
+        * to be used to create the button to be added to the button group.
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-6043025">HTMLInputElement</a>|<a href="
+        * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#
+        * ID-33759296">HTMLElement</a>} p_oButton Object reference for the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> element 
+        * to be used to create the button to be added to the button group.
+        * @param {Object} p_oButton Object literal specifying a set of 
+        * <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> 
+        * configuration attributes used to configure the button to be added to 
+        * the button group.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>} 
+        */
+        addButton: function (p_oButton) {
+        
+            var oButton,
+                oButtonElement,
+                oGroupElement,
+                nIndex,
+                sButtonName,
+                sGroupName;
+        
+        
+            if (p_oButton instanceof Button && 
+                p_oButton.get("type") == "radio") {
+        
+                oButton = p_oButton;
+        
+            }
+            else if (!Lang.isString(p_oButton) && !p_oButton.nodeName) {
+        
+                p_oButton.type = "radio";
+        
+                oButton = new Button(p_oButton);
+
+            }
+            else {
+        
+                oButton = new Button(p_oButton, { type: "radio" });
+        
+            }
+        
+        
+            if (oButton) {
+        
+                nIndex = this._buttons.length;
+                sButtonName = oButton.get("name");
+                sGroupName = this.get("name");
+        
+                oButton.index = nIndex;
+        
+                this._buttons[nIndex] = oButton;
+                m_oButtons[oButton.get("id")] = oButton;
+        
+        
+                if (sButtonName != sGroupName) {
+        
+                    oButton.set("name", sGroupName);
+                
+                }
+        
+        
+                if (this.get("disabled")) {
+        
+                    oButton.set("disabled", true);
+        
+                }
+        
+        
+                if (oButton.get("checked")) {
+        
+                    this.set("checkedButton", oButton);
+        
+                }
+
+                
+                oButtonElement = oButton.get("element");
+                oGroupElement = this.get("element");
+                
+                if (oButtonElement.parentNode != oGroupElement) {
+                
+                    oGroupElement.appendChild(oButtonElement);
+                
+                }
+        
+                
+                oButton.on("checkedChange", 
+                    this._onButtonCheckedChange, oButton, this);
+        
+        
+                return oButton;
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method addButtons
+        * @description Adds the array of buttons to the button group.
+        * @param {Array} p_aButtons Array of <a href="YAHOO.widget.Button.html">
+        * YAHOO.widget.Button</a> instances to be added 
+        * to the button group.
+        * @param {Array} p_aButtons Array of strings specifying the id 
+        * attribute of the <code>&#60;input&#62;</code> or <code>&#60;span&#62;
+        * </code> elements to be used to create the buttons to be added to the 
+        * button group.
+        * @param {Array} p_aButtons Array of object references for the 
+        * <code>&#60;input&#62;</code> or <code>&#60;span&#62;</code> elements 
+        * to be used to create the buttons to be added to the button group.
+        * @param {Array} p_aButtons Array of object literals, each containing
+        * a set of <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>  
+        * configuration attributes used to configure each button to be added 
+        * to the button group.
+        * @return {Array}
+        */
+        addButtons: function (p_aButtons) {
+    
+            var nButtons,
+                oButton,
+                aButtons,
+                i;
+        
+            if (Lang.isArray(p_aButtons)) {
+            
+                nButtons = p_aButtons.length;
+                aButtons = [];
+        
+                if (nButtons > 0) {
+        
+                    for (i = 0; i < nButtons; i++) {
+        
+                        oButton = this.addButton(p_aButtons[i]);
+                        
+                        if (oButton) {
+        
+                            aButtons[aButtons.length] = oButton;
+        
+                        }
+                    
+                    }
+        
+                    if (aButtons.length > 0) {
+        
+        
+                        return aButtons;
+        
+                    }
+                
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method removeButton
+        * @description Removes the button at the specified index from the 
+        * button group.
+        * @param {Number} p_nIndex Number specifying the index of the button 
+        * to be removed from the button group.
+        */
+        removeButton: function (p_nIndex) {
+        
+            var oButton = this.getButton(p_nIndex),
+                nButtons,
+                i;
+            
+            if (oButton) {
+        
+        
+                this._buttons.splice(p_nIndex, 1);
+                delete m_oButtons[oButton.get("id")];
+        
+                oButton.removeListener("checkedChange", 
+                    this._onButtonCheckedChange);
+
+                oButton.destroy();
+        
+        
+                nButtons = this._buttons.length;
+                
+                if (nButtons > 0) {
+        
+                    i = this._buttons.length - 1;
+                    
+                    do {
+        
+                        this._buttons[i].index = i;
+        
+                    }
+                    while (i--);
+                
+                }
+        
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method getButton
+        * @description Returns the button at the specified index.
+        * @param {Number} p_nIndex The index of the button to retrieve from the 
+        * button group.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        */
+        getButton: function (p_nIndex) {
+        
+            if (Lang.isNumber(p_nIndex)) {
+        
+                return this._buttons[p_nIndex];
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method getButtons
+        * @description Returns an array of the buttons in the button group.
+        * @return {Array}
+        */
+        getButtons: function () {
+        
+            return this._buttons;
+        
+        },
+        
+        
+        /**
+        * @method getCount
+        * @description Returns the number of buttons in the button group.
+        * @return {Number}
+        */
+        getCount: function () {
+        
+            return this._buttons.length;
+        
+        },
+        
+        
+        /**
+        * @method focus
+        * @description Sets focus to the button at the specified index.
+        * @param {Number} p_nIndex Number indicating the index of the button 
+        * to focus. 
+        */
+        focus: function (p_nIndex) {
+        
+            var oButton,
+                nButtons,
+                i;
+        
+            if (Lang.isNumber(p_nIndex)) {
+        
+                oButton = this._buttons[p_nIndex];
+                
+                if (oButton) {
+        
+                    oButton.focus();
+        
+                }
+            
+            }
+            else {
+        
+                nButtons = this.getCount();
+        
+                for (i = 0; i < nButtons; i++) {
+        
+                    oButton = this._buttons[i];
+        
+                    if (!oButton.get("disabled")) {
+        
+                        oButton.focus();
+                        break;
+        
+                    }
+        
+                }
+        
+            }
+        
+        },
+        
+        
+        /**
+        * @method check
+        * @description Checks the button at the specified index.
+        * @param {Number} p_nIndex Number indicating the index of the button 
+        * to check. 
+        */
+        check: function (p_nIndex) {
+        
+            var oButton = this.getButton(p_nIndex);
+            
+            if (oButton) {
+        
+                oButton.set("checked", true);
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method destroy
+        * @description Removes the button group's element from its parent 
+        * element and removes all event handlers.
+        */
+        destroy: function () {
+        
+        
+            var nButtons = this._buttons.length,
+                oElement = this.get("element"),
+                oParentNode = oElement.parentNode,
+                i;
+            
+            if (nButtons > 0) {
+        
+                i = this._buttons.length - 1;
+        
+                do {
+        
+                    this._buttons[i].destroy();
+        
+                }
+                while (i--);
+            
+            }
+        
+        
+            Event.purgeElement(oElement);
+            
+        
+            oParentNode.removeChild(oElement);
+        
+        },
+        
+        
+        /**
+        * @method toString
+        * @description Returns a string representing the button group.
+        * @return {String}
+        */
+        toString: function () {
+        
+            return ("ButtonGroup " + this.get("id"));
+        
+        }
+    
+    });
+
+})();
+YAHOO.register("button", YAHOO.widget.Button, {version: "2.3.0", build: "442"});
index d4fc65d1439b2b13ae42098f233d0a0322152829..3c04748c14f8a35fd5ab5d6600389df5cbcd7688 100755 (executable)
@@ -1,5 +1,38 @@
 Calendar Release Notes
 
+*** version 2.3.0 ***
+
+       - Added checks to select, selectCell, deselect and deselectCell methods to ensure the Calendar/Calendar group was not set to an invalid state by programmatically selecting unselectable dates or cells.
+       - Added new locale configuration properties for the Month/Year label used in the Calendar header (MY_LABEL_MONTH_POSITION, MY_LABEL_YEAR_POSITION, MY_LABEL_YEAR_SUFFIX, MY_LABEL_MONTH_SUFFIX). Japan is an example locale, where customization of the Month/Year label is required.
+       - Changed "first", "last" class names to "first-of-type", "last-of-type", to avoid collision with YUI Grids' use of the "first" class name.
+       - Added public isDateOOB method, to check if a given date is outside of the minimum/maximum configuration dates of the Calendar.
+       - Deprecated YAHOO.widget.Calendar.browser, refactored to use YAHOO.env.ua instead.
+       - Removed overflow:hidden from default Calendar/CalendarGroup container for non-IE6 browsers to fix clipping issue with IE7 when CalendarGroup was inside a box with a specific width. overflow:hidden is still required for IE6 with an iframe shim.
+       - Added Opera container width calculation fix to CalendarGroup.show method, to fix incorrect wrapping when using a CalendarGroup which is initially rendered hidden (display:none). Previously this fix was only applied on render.
+
+*** version 2.2.2 ***
+
+       - Fixed problem with selected dates being shared across instances, when more than one Calendar/CalendarGroup was on the page
+
+*** version 2.2.1 ***
+
+       - Fixed problem with selectCell adding duplicate selected date entries for dates which were already selected
+       - Fixed problem with CalendarGroup iframe shim not covering the CalendarGroup title area
+       - Removed javascript:void(null) from close button and cell links which was interrupting form submission and firing onbeforeunload in IE
+       - Fixed problem with CalendarGroup getSelectedDates returning invalid results, when used in conjunction with the "selected" Config property (either passed in the constructor config argument or set seperately after construction)
+       - Refactored Calendar and CalendarGroup to improve performance, especially when working with a large number of instances in IE6
+
+*** version 2.2.0 ***
+
+       - Image customization can now be done through CSS. Images for Close, Left and Right Arrows are now pulled in using CSS defined in calendar.css and by default use relative paths to the images in the same directory as calendar.css. 
+       - Deprecated Calendar.IMG_ROOT and NAV_ARROW_LEFT, NAV_ARROW_RIGHT configuration properties. Customizations based on older releases which set these properties will still function as expected.
+       - Deprecated CalendarGroup.CSS_2UPCLOSE. Calendar's Style.CSS_CLOSE property now represents the new default CSS class (calclose) for the close button. CSS_2UPCLOSE is still applied along with CSS_CLOSE to the new markup for the close button to support existing customizations of the CSS_2UPCLOSE CSS class (close-icon)
+       - Fixed problem with Safari setting Calendar pages to incorrect dates if the pages spanned a year boundary in CalendarGroups with 3 or more pages, due to a bug in Safari's implementation of Date setMonth
+       - Fixed problem with CalendarGroup setMonth rendering Calendar pages with incorrect dates in all browsers if current pages spanned year boundary
+       - Fixed incorrect CalendarGroup logging statement in calendar-debug.js
+       - Fixed domEventMap support for Safari versions prior to 2.0.2, caused by hasOwnProperty not being supported
+       - Removed unused private property : _pageDate from Calendar class
+
 *** version 0.12.2 ***
 
        - Corrected documentation for clearTime function to reflect the change from midnight to noon
diff --git a/lib/yui/calendar/assets/calendar-core.css b/lib/yui/calendar/assets/calendar-core.css
new file mode 100755 (executable)
index 0000000..d25fd04
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * CORE
+ *
+ * This is the set of CSS rules required by Calendar to drive core functionality and structure.
+ * Changes to these rules may result in the Calendar not functioning or rendering correctly.
+ *
+ * They should not be modified for skinning.
+ **/
+/* CALENDAR BOUNDING BOX */
+.yui-calcontainer {
+       position:relative;
+       float:left;
+       _overflow:hidden; /* IE6 only, to clip iframe shim */
+}
+
+/* IFRAME SHIM */
+.yui-calcontainer iframe {
+       position:absolute;
+       border:none;
+       margin:0;padding:0;
+       z-index:0;
+       width:100%;
+       height:100%;
+       left:0px;
+       top:0px;
+}
+
+/* IFRAME SHIM IE6 only */
+.yui-calcontainer iframe.fixedsize {
+       width:50em;
+       height:50em;
+       top:-1px;
+       left:-1px;
+}
+
+/* BOUNDING BOX FOR EACH CALENDAR GROUP PAGE */
+.yui-calcontainer.multi .groupcal {
+       z-index:1;
+       float:left;
+       position:relative;
+}
+
+/* TITLE BAR */
+.yui-calcontainer .title {
+       position:relative;
+       z-index:1;
+}
+
+/* CLOSE ICON CONTAINER */
+.yui-calcontainer .close-icon {
+       position:absolute;
+       z-index:1;
+}
+
+/* CALENDAR TABLE */
+.yui-calendar {
+       position:relative;
+}
+
+/* NAVBAR LEFT ARROW CONTAINER */
+.yui-calendar .calnavleft {
+       position:absolute;
+       z-index:1;
+}
+
+/* NAVBAR RIGHT ARROW CONTAINER */
+.yui-calendar .calnavright {
+       position:absolute;
+       z-index:1;
+}
+
+/* NAVBAR TEXT CONTAINER */
+.yui-calendar .calheader {
+       position:relative;
+       width:100%;
+       text-align:center;
+}
+
+/* Specific changes for calendar running under fonts/reset */
+.yui-calendar .calbody a:hover {background:inherit;}
+p#clear {clear:left; padding-top:10px;}
\ No newline at end of file
index b97a705362b384b6418618b4ee11528026cabe33..377b93191ddf0203932b9b147fcb362c5661bd6c 100755 (executable)
@@ -1,28 +1,35 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-Version 0.12
+version: 2.3.0
 */
-
 .yui-calcontainer {
        position:relative;
        padding:5px;
        background-color:#F7F9FB;
        border:1px solid #7B9EBD;
        float:left;
-       overflow:hidden;
+       _overflow:hidden; /* IE6 only, to clip iframe shim */
 }
 
 .yui-calcontainer iframe {
        position:absolute;
        border:none;
        margin:0;padding:0;
-       left:-1px;
-       top:-1px;
        z-index:0;
+       width:100%;
+       height:100%;
+       left:0px;
+       top:0px;
+}
+
+/* IE6 only */
+.yui-calcontainer iframe.fixedsize {
        width:50em;
        height:50em;
+       top:-1px;
+       left:-1px;
 }
 
 .yui-calcontainer.multi {
@@ -57,6 +64,13 @@ Version 0.12
        z-index:1;
 }
 
+.yui-calcontainer .calclose {
+       background: url("calx.gif") no-repeat;
+       width:17px;
+       height:13px;
+       cursor:pointer; 
+}
+
 /* Calendar element styles */
 
 .yui-calendar {
@@ -73,7 +87,6 @@ Version 0.12
 
 .yui-calendar .calnavleft {
        position:absolute;
-       background-repeat:no-repeat;
        cursor:pointer;
        top:2px;
        bottom:0;
@@ -81,18 +94,19 @@ Version 0.12
        height:12px;   
        left:2px;
        z-index:1;
+       background: url("callt.gif") no-repeat;
 }
 
 .yui-calendar .calnavright {
        position:absolute;
-       background-repeat:no-repeat;
        cursor:pointer;
        top:2px;
        bottom:0;
        width:9px;
-       height:12px;  
+       height:12px;
        right:2px;
        z-index:1;
+       background: url("calrt.gif") no-repeat;
 }
 
 .yui-calendar td.calcell {
@@ -186,6 +200,6 @@ Version 0.12
        border-right-width:2px;
 }
 
-/*Specific changes for calendar running under fonts/reset */
-.yui-calendar a:hover {background:inherit;}
+/* Specific changes for calendar running under fonts/reset */
+.yui-calendar .calbody a:hover {background:inherit;}
 p#clear {clear:left; padding-top:10px;}
diff --git a/lib/yui/calendar/assets/skins/sam/calendar-skin.css b/lib/yui/calendar/assets/skins/sam/calendar-skin.css
new file mode 100755 (executable)
index 0000000..66a6df4
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * SAM
+ *
+ * Skin colors used:
+ *
+ * - Control Border : 808080
+ * - Control Chrome : f2f2f2
+ * - Cell Borders : cccccc
+ * - Normal Cell BG : ffffff
+ * - Date Links : 0066cc
+ * - Selected Cells BG : b3d4ff
+ * - Cell Hover BG : 426fd9
+ * - Disabled BG : cccccc
+ * - Disabled Text Color : a6a6a6
+ **/
+
+/* CALENDAR BOUNDING BOX */
+.yui-skin-sam .yui-calcontainer {
+       background-color:#f2f2f2;
+       border:1px solid #808080;
+       padding:10px;
+}
+
+/* CALENDARGROUP BOUNDING BOX */
+.yui-skin-sam .yui-calcontainer.multi {
+       padding:0 5px 0 5px;
+}
+
+/* BOUNDING BOX FOR EACH CALENDAR GROUP PAGE */
+.yui-skin-sam .yui-calcontainer.multi .groupcal {
+       background-color:transparent;
+       border:none;
+       padding:10px 5px 10px 5px;
+       margin:0;
+}
+
+/* TITLE BAR */
+.yui-skin-sam .yui-calcontainer .title {
+       background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;
+       border-bottom:1px solid #cccccc;
+       font:100% sans-serif;
+       color:#000;
+       font-weight:bold;
+       height:auto;
+       padding:.4em;
+       margin:0 -10px 10px -10px;
+       top:0;
+       left:0;
+       text-align:left;
+}
+
+.yui-skin-sam .yui-calcontainer.multi .title {
+       margin:0 -5px 0 -5px;
+}
+
+.yui-skin-sam .yui-calcontainer.withtitle {
+       padding-top:0;
+}
+
+/* CLOSE BUTTON */
+.yui-skin-sam .yui-calcontainer .calclose {
+       background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;
+       width:25px;
+       height:15px;
+       top:.4em;
+       right:.4em;
+       cursor:pointer;
+}
+
+/* CALENDAR TABLE */
+.yui-skin-sam .yui-calendar {
+       border-spacing:0;
+       border-collapse:collapse;
+       font:100% sans-serif;
+       text-align:center;
+}
+
+/* NAVBAR BOUNDING BOX */
+.yui-skin-sam .yui-calendar .calhead {
+       background:transparent;
+       border:none;
+       vertical-align:middle;
+}
+
+/* NAVBAR TEXT CONTAINER */
+.yui-skin-sam .yui-calendar .calheader {
+       background:transparent;
+       font-weight:bold;
+       padding:0 0 .6em 0;
+       text-align:center;
+}
+
+.yui-skin-sam .yui-calendar .calheader img {
+       border:none;
+}
+
+/* NAVBAR LEFT ARROW */
+.yui-skin-sam .yui-calendar .calnavleft {
+       background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -450px;
+       width:25px;
+       height:15px;
+       top:0;
+       bottom:0;
+       left:-10px;
+       margin-left:.4em;
+       cursor:pointer;
+}
+
+/* NAVBAR RIGHT ARROW */
+.yui-skin-sam .yui-calendar .calnavright {
+       background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -500px;
+       width:25px;
+       height:15px;
+       top:0;
+       bottom:0;
+       right:-10px;
+       margin-right:.4em;
+       cursor:pointer;
+}
+
+/* WEEKDAY HEADER ROW */
+.yui-skin-sam .yui-calendar .calweekdayrow {
+       height:2em;
+}
+
+/* WEEKDAY (Su, Mo, Tu...) HEADER CELLS */
+.yui-skin-sam .yui-calendar .calweekdaycell {
+       color:#000;
+       font-weight:bold;
+       text-align:center;
+       width:2em;
+}
+
+/* CALENDAR FOOTER. NOT IMPLEMENTED BY DEFAULT */
+.yui-skin-sam .yui-calendar .calfoot {
+       background-color:#f2f2f2;
+}
+
+/* WEEK NUMBERS (ROW HEADERS/FOOTERS) */
+.yui-skin-sam .yui-calendar .calrowhead, .yui-skin-sam .yui-calendar .calrowfoot {
+       color:#a6a6a6;
+       font-size:85%;
+       font-style:normal;
+       font-weight:normal;
+}
+
+.yui-skin-sam .yui-calendar .calrowhead {
+       text-align:right;
+       padding-right:2px;
+}
+
+.yui-skin-sam .yui-calendar .calrowfoot {
+       text-align:left;
+       padding-left:2px;
+}
+
+/* NORMAL CELLS */
+.yui-skin-sam .yui-calendar td.calcell {
+       border:1px solid #cccccc;
+       background:#fff;
+       padding:1px;
+       height:1.6em;
+       line-height:1.6em; /* set line height equal to cell height to center vertically */
+       text-align:center;
+       white-space:nowrap;
+}
+
+/* LINK INSIDE NORMAL CELLS */
+.yui-skin-sam .yui-calendar td.calcell a {
+       color:#0066cc;
+       display:block;
+       height:100%;
+       text-decoration:none;
+}
+
+/* TODAY'S DATE */
+.yui-skin-sam .yui-calendar td.calcell.today {
+       background-color:#000;
+}
+
+.yui-skin-sam .yui-calendar td.calcell.today a {
+       background-color:#fff;
+}
+
+/* OOM DATES */
+.yui-skin-sam .yui-calendar td.calcell.oom {
+       background-color:#cccccc;
+       color:#a6a6a6;
+       cursor:default;
+}
+
+/* SELECTED DATE */
+.yui-skin-sam .yui-calendar td.calcell.selected {
+       background-color:#fff;
+       color:#000;
+}
+
+.yui-skin-sam .yui-calendar td.calcell.selected a {
+       background-color:#b3d4ff;
+       color:#000;
+}
+
+/* HOVER DATE */
+.yui-skin-sam .yui-calendar td.calcell.calcellhover {
+       background-color:#426fd9;
+       color:#fff;
+       cursor:pointer;
+}
+
+.yui-skin-sam .yui-calendar td.calcell.calcellhover a {
+       background-color:#426fd9;
+       color:#fff;
+}
+
+/* DEFAULT OOB DATES */
+.yui-skin-sam .yui-calendar td.calcell.previous {
+       color:#e0e0e0;
+}
+
+/* CUSTOM RENDERERS */
+.yui-skin-sam .yui-calendar td.calcell.restricted { text-decoration:line-through; }
+.yui-skin-sam .yui-calendar td.calcell.highlight1 { background-color:#ccff99; }
+.yui-skin-sam .yui-calendar td.calcell.highlight2 { background-color:#99ccff; }
+.yui-skin-sam .yui-calendar td.calcell.highlight3 { background-color:#ffcccc; }
+.yui-skin-sam .yui-calendar td.calcell.highlight4 { background-color:#ccff99; }
\ No newline at end of file
diff --git a/lib/yui/calendar/assets/skins/sam/calendar.css b/lib/yui/calendar/assets/skins/sam/calendar.css
new file mode 100755 (executable)
index 0000000..2b6d11a
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;}.yui-calendar .calnavright{position:absolute;z-index:1;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;border-bottom:1px solid #cccccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding-right:2px;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding-left:2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #cccccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#0066cc;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#cccccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#ccff99;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#99ccff;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#ffcccc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#ccff99;}
index 622feef52e818ad5303bda68cb61c7fbf70dacf6..47a54b3d7d73ba1d0c1f2a949adb129aa17096a3 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
-*/
-/**
-* 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.
-* @namespace YAHOO.util
-* @class Config
-* @constructor
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config = function(owner) {
-       if (owner) {
-               this.init(owner);
-       } else {
-               YAHOO.log("No owner specified for Config object", "error");
-       }
-};
-
-YAHOO.util.Config.prototype = {
-       
-       /**
-       * Object reference to the owner of this Config Object
-       * @property owner
-       * @type Object
-       */
-       owner : null,
-
-       /**
-       * Boolean flag that specifies whether a queue is currently being executed
-       * @property queueInProgress
-       * @type Boolean
-       */
-       queueInProgress : false,
-
-
-       /**
-       * Validates that the value passed in is a Boolean.
-       * @method checkBoolean
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */      
-       checkBoolean: function(val) {
-               if (typeof val == 'boolean') {
-                       return true;
-               } else {
-                       return false;
-               }
-       },
-
-       /**
-       * Validates that the value passed in is a number.
-       * @method checkNumber
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */
-       checkNumber: function(val) {
-               if (isNaN(val)) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-};
-
-
-/**
-* Initializes the configuration Object and all of its local members.
-* @method init
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config.prototype.init = function(owner) {
-
-       this.owner = owner;
-
-       /**
-       * Object reference to the owner of this Config Object
-       * @event configChangedEvent
-       */
-       this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");
-       this.queueInProgress = false;
-
-       /* Private Members */
-
-       /**
-       * Maintains the local collection of configuration property objects and their specified values
-       * @property config
-       * @private
-       * @type Object
-       */ 
-       var config = {};
-
-       /**
-       * Maintains the local collection of configuration property objects as they were initially applied.
-       * This object is used when resetting a property.
-       * @property initialConfig
-       * @private
-       * @type Object
-       */ 
-       var initialConfig = {};
-
-       /**
-       * Maintains the local, normalized CustomEvent queue
-       * @property eventQueue
-       * @private
-       * @type Object
-       */ 
-       var eventQueue = [];
-
-       /**
-       * Fires a configuration property event using the specified value. 
-       * @method fireEvent
-       * @private
-       * @param {String}       key                     The configuration property's name
-       * @param {value}        Object          The value of the correct type for the property
-       */ 
-       var fireEvent = function( key, value ) {
-               YAHOO.log("Firing Config event: " + key + "=" + value, "info");
-               
-               key = key.toLowerCase();
-
-               var property = config[key];
-
-               if (typeof property != 'undefined' && property.event) {
-                       property.event.fire(value);
-               }       
-       };
-       /* End Private Members */
-
-       /**
-       * Adds a property to the Config Object's private config hash.
-       * @method addProperty
-       * @param {String}       key     The configuration property's name
-       * @param {Object}       propertyObject  The Object containing all of this property's arguments
-       */
-       this.addProperty = function( key, propertyObject ) {
-               key = key.toLowerCase();
-               
-               YAHOO.log("Added property: " + key, "info");
-
-               config[key] = propertyObject;
-
-               propertyObject.event = new YAHOO.util.CustomEvent(key);
-               propertyObject.key = key;
-
-               if (propertyObject.handler) {
-                       propertyObject.event.subscribe(propertyObject.handler, this.owner, true);
-               }
-
-               this.setProperty(key, propertyObject.value, true);
-               
-               if (! propertyObject.suppressEvent) {
-                       this.queueProperty(key, propertyObject.value);
-               }
-       };
-
-       /**
-       * Returns a key-value configuration map of the values currently set in the Config Object.
-       * @method getConfig
-       * @return {Object} The current config, represented in a key-value map
-       */
-       this.getConfig = function() {
-               var cfg = {};
-                       
-               for (var prop in config) {
-                       var property = config[prop];
-                       if (typeof property != 'undefined' && property.event) {
-                               cfg[prop] = property.value;
-                       }
-               }
-               
-               return cfg;
-       };
-
-       /**
-       * Returns the value of specified property.
-       * @method getProperty
-       * @param {String} key   The name of the property
-       * @return {Object}              The value of the specified property
-       */
-       this.getProperty = function(key) {
-               key = key.toLowerCase();
-
-               var property = config[key];
-               if (typeof property != 'undefined' && property.event) {
-                       return property.value;
-               } else {
-                       return undefined;
-               }
-       };
-
-       /**
-       * Resets the specified property's value to its initial value.
-       * @method resetProperty
-       * @param {String} key   The name of the property
-       * @return {Boolean} True is the property was reset, false if not
-       */
-       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]);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.
-       * @method setProperty
-       * @param {String} key           The name of the property
-       * @param {String} value         The value to set the property to
-       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.
-       * @return {Boolean}                     True, if the set was successful, false if it failed.
-       */
-       this.setProperty = function(key, value, silent) {
-               key = key.toLowerCase();
-               
-               YAHOO.log("setProperty: " + key + "=" + value, "info");
-
-               if (this.queueInProgress && ! silent) {
-                       this.queueProperty(key,value); // Currently running through a queue... 
-                       return true;
-               } else {
-                       var property = config[key];
-                       if (typeof property != 'undefined' && property.event) {
-                               if (property.validator && ! property.validator(value)) { // validator
-                                       return false;
-                               } else {
-                                       property.value = value;
-                                       if (! silent) {
-                                               fireEvent(key, value);
-                                               this.configChangedEvent.fire([key, value]);
-                                       }
-                                       return true;
-                               }
-                       } else {
-                               return false;
-                       }
-               }
-       };
-
-       /**
-       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is
-       * moved from its current position to the end of the queue.
-       * @method queueProperty
-       * @param {String} key   The name of the property
-       * @param {String} value The value to set the property to
-       * @return {Boolean}             true, if the set was successful, false if it failed.
-       */      
-       this.queueProperty = function(key, value) {
-               key = key.toLowerCase();
-
-               YAHOO.log("queueProperty: " + key + "=" + value, "info");
-
-               var property = config[key];
-                                                       
-               if (typeof property != 'undefined' && property.event) {
-                       if (typeof value != 'undefined' && property.validator && ! property.validator(value)) { // validator
-                               return false;
-                       } else {
-
-                               if (typeof value != 'undefined') {
-                                       property.value = value;
-                               } else {
-                                       value = property.value;
-                               }
-
-                               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) {
-                                                       // found a dupe... push to end of queue, null current item, and break
-                                                       eventQueue[i] = null;
-                                                       eventQueue.push([key, (typeof value != 'undefined' ? value : queueItemValue)]);
-                                                       foundDuplicate = true;
-                                                       break;
-                                               }
-                                       }
-                               }
-                               
-                               if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue
-                                       eventQueue.push([key, value]);
-                               }
-                       }
-
-                       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;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-       
-                       YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");
-
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Fires the event for a property using the property's current value.
-       * @method refireEvent
-       * @param {String} key   The name of the property
-       */
-       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);
-                       }
-               }
-       };
-
-       /**
-       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.
-       * Although the values will be set, fireQueue() must be called for their associated events to execute.
-       * @method applyConfig
-       * @param {Object}       userConfig      The configuration Object literal
-       * @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.
-       */
-       this.applyConfig = function(userConfig, init) {
-               if (init) {
-                       initialConfig = userConfig;
-               }
-               for (var prop in userConfig) {
-                       this.queueProperty(prop, userConfig[prop]);
-               }
-       };
-
-       /**
-       * Refires the events for all configuration properties using their current values.
-       * @method refresh
-       */
-       this.refresh = function() {
-               for (var prop in config) {
-                       this.refireEvent(prop);
-               }
-       };
-
-       /**
-       * Fires the normalized list of queued property change events
-       * @method fireQueue
-       */
-       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);
-                       }
-               }
-               
-               this.queueInProgress = false;
-               eventQueue = [];
-       };
-
-       /**
-       * Subscribes an external handler to the change event for any given property. 
-       * @method subscribeToConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.
-       * @return {Boolean}                             True, if the subscription was successful, otherwise false.
-       */      
-       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);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Unsubscribes an external handler from the change event for any given property. 
-       * @method unsubscribeFromConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @return {Boolean}                             True, if the unsubscription was successful, otherwise 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;
-               }
-       };
-
-       /**
-       * Returns a string representation of the Config object
-       * @method toString
-       * @return {String}      The Config object in string format.
-       */
-       this.toString = function() {
-               var output = "Config";
-               if (this.owner) {
-                       output += " [" + this.owner.toString() + "]";
-               }
-               return output;
-       };
-
-       /**
-       * Returns a string representation of the Config object's current CustomEvent queue
-       * @method outputEventQueue
-       * @return {String}      The string list of CustomEvents currently queued for execution
-       */
-       this.outputEventQueue = function() {
-               var output = "";
-               for (var q=0;q<eventQueue.length;q++) {
-                       var queueItem = eventQueue[q];
-                       if (queueItem) {
-                               output += queueItem[0] + "=" + queueItem[1] + ", ";
-                       }
-               }
-               return output;
-       };
-};
-
-/**
-* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent
-* @method YAHOO.util.Config.alreadySubscribed
-* @static
-* @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions
-* @param {Function}    fn      The function to look for in the subscribers list
-* @param {Object}      obj     The execution scope Object for the subscription
-* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in
-*/
-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;
-               }
-       }
-       return false;
-};
+version: 2.3.0
+*/
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.util
+    * @class Config
+    * @constructor
+    * @param {Object} owner The owner Object to which this Config Object belongs
+    */
+    YAHOO.util.Config = function (owner) {
+    
+        if (owner) {
+    
+            this.init(owner);
+    
+        }
+    
+        if (!owner) { 
+        
+            YAHOO.log("No owner specified for Config object", "error"); 
+    
+        }
+    
+    };
+
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,        
+        Config = YAHOO.util.Config;
+    
+
+    /**
+     * Constant representing the CustomEvent type for the config changed event.
+     * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT
+     * @private
+     * @static
+     * @final
+     */
+    Config.CONFIG_CHANGED_EVENT = "configChanged";
+    
+    /**
+     * Constant representing the boolean type string
+     * @property YAHOO.util.Config.BOOLEAN_TYPE
+     * @private
+     * @static
+     * @final
+     */
+    Config.BOOLEAN_TYPE = "boolean";
+    
+    Config.prototype = {
+     
+        /**
+        * Object reference to the owner of this Config Object
+        * @property owner
+        * @type Object
+        */
+        owner: null,
+        
+        /**
+        * Boolean flag that specifies whether a queue is currently 
+        * being executed
+        * @property queueInProgress
+        * @type Boolean
+        */
+        queueInProgress: false,
+        
+        /**
+        * Maintains the local collection of configuration property objects and 
+        * their specified values
+        * @property config
+        * @private
+        * @type Object
+        */ 
+        config: null,
+        
+        /**
+        * Maintains the local collection of configuration property objects as 
+        * they were initially applied.
+        * This object is used when resetting a property.
+        * @property initialConfig
+        * @private
+        * @type Object
+        */ 
+        initialConfig: null,
+        
+        /**
+        * Maintains the local, normalized CustomEvent queue
+        * @property eventQueue
+        * @private
+        * @type Object
+        */ 
+        eventQueue: null,
+        
+        /**
+        * Custom Event, notifying subscribers when Config properties are set 
+        * (setProperty is called without the silent flag
+        * @event configChangedEvent
+        */
+        configChangedEvent: null,
+    
+        /**
+        * Initializes the configuration Object and all of its local members.
+        * @method init
+        * @param {Object} owner The owner Object to which this Config 
+        * Object belongs
+        */
+        init: function (owner) {
+    
+            this.owner = owner;
+    
+            this.configChangedEvent = 
+                this.createEvent(Config.CONFIG_CHANGED_EVENT);
+    
+            this.configChangedEvent.signature = CustomEvent.LIST;
+            this.queueInProgress = false;
+            this.config = {};
+            this.initialConfig = {};
+            this.eventQueue = [];
+        
+        },
+        
+        /**
+        * Validates that the value passed in is a Boolean.
+        * @method checkBoolean
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */ 
+        checkBoolean: function (val) {
+            return (typeof val == Config.BOOLEAN_TYPE);
+        },
+        
+        /**
+        * Validates that the value passed in is a number.
+        * @method checkNumber
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */
+        checkNumber: function (val) {
+            return (!isNaN(val));
+        },
+        
+        /**
+        * Fires a configuration property event using the specified value. 
+        * @method fireEvent
+        * @private
+        * @param {String} key The configuration property's name
+        * @param {value} Object The value of the correct type for the property
+        */ 
+        fireEvent: function ( key, value ) {
+            YAHOO.log("Firing Config event: " + key + "=" + value, "info");
+            var property = this.config[key];
+        
+            if (property && property.event) {
+                property.event.fire(value);
+            } 
+        },
+        
+        /**
+        * Adds a property to the Config Object's private config hash.
+        * @method addProperty
+        * @param {String} key The configuration property's name
+        * @param {Object} propertyObject The Object containing all of this 
+        * property's arguments
+        */
+        addProperty: function ( key, propertyObject ) {
+            key = key.toLowerCase();
+            YAHOO.log("Added property: " + key, "info");
+        
+            this.config[key] = propertyObject;
+        
+            propertyObject.event = this.createEvent(key, { scope: this.owner });
+            propertyObject.event.signature = CustomEvent.LIST;
+            
+            
+            propertyObject.key = key;
+        
+            if (propertyObject.handler) {
+                propertyObject.event.subscribe(propertyObject.handler, 
+                    this.owner);
+            }
+        
+            this.setProperty(key, propertyObject.value, true);
+            
+            if (! propertyObject.suppressEvent) {
+                this.queueProperty(key, propertyObject.value);
+            }
+            
+        },
+        
+        /**
+        * Returns a key-value configuration map of the values currently set in  
+        * the Config Object.
+        * @method getConfig
+        * @return {Object} The current config, represented in a key-value map
+        */
+        getConfig: function () {
+        
+            var cfg = {},
+                prop,
+                property;
+                
+            for (prop in this.config) {
+                property = this.config[prop];
+                if (property && property.event) {
+                    cfg[prop] = property.value;
+                }
+            }
+            
+            return cfg;
+        },
+        
+        /**
+        * Returns the value of specified property.
+        * @method getProperty
+        * @param {String} key The name of the property
+        * @return {Object}  The value of the specified property
+        */
+        getProperty: function (key) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.value;
+            } else {
+                return undefined;
+            }
+        },
+        
+        /**
+        * Resets the specified property's value to its initial value.
+        * @method resetProperty
+        * @param {String} key The name of the property
+        * @return {Boolean} True is the property was reset, false if not
+        */
+        resetProperty: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event) {
+    
+                if (this.initialConfig[key] && 
+                    !Lang.isUndefined(this.initialConfig[key])) {
+    
+                    this.setProperty(key, this.initialConfig[key]);
+    
+                }
+    
+                return true;
+    
+            } else {
+    
+                return false;
+            }
+    
+        },
+        
+        /**
+        * Sets the value of a property. If the silent property is passed as 
+        * true, the property's event will not be fired.
+        * @method setProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @param {Boolean} silent Whether the value should be set silently, 
+        * without firing the property event.
+        * @return {Boolean} True, if the set was successful, false if it failed.
+        */
+        setProperty: function (key, value, silent) {
+        
+            var property;
+        
+            key = key.toLowerCase();
+            YAHOO.log("setProperty: " + key + "=" + value, "info");
+        
+            if (this.queueInProgress && ! silent) {
+                // Currently running through a queue... 
+                this.queueProperty(key,value);
+                return true;
+    
+            } else {
+                property = this.config[key];
+                if (property && property.event) {
+                    if (property.validator && !property.validator(value)) {
+                        return false;
+                    } else {
+                        property.value = value;
+                        if (! silent) {
+                            this.fireEvent(key, value);
+                            this.configChangedEvent.fire([key, value]);
+                        }
+                        return true;
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        
+        /**
+        * Sets the value of a property and queues its event to execute. If the 
+        * event is already scheduled to execute, it is
+        * moved from its current position to the end of the queue.
+        * @method queueProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @return {Boolean}  true, if the set was successful, false if 
+        * it failed.
+        */ 
+        queueProperty: function (key, value) {
+        
+            key = key.toLowerCase();
+            YAHOO.log("queueProperty: " + key + "=" + value, "info");
+        
+            var property = this.config[key],
+                foundDuplicate = false,
+                iLen,
+                queueItem,
+                queueItemKey,
+                queueItemValue,
+                sLen,
+                supercedesCheck,
+                qLen,
+                queueItemCheck,
+                queueItemCheckKey,
+                queueItemCheckValue,
+                i,
+                s,
+                q;
+                                
+            if (property && property.event) {
+    
+                if (!Lang.isUndefined(value) && property.validator && 
+                    !property.validator(value)) { // validator
+                    return false;
+                } else {
+        
+                    if (!Lang.isUndefined(value)) {
+                        property.value = value;
+                    } else {
+                        value = property.value;
+                    }
+        
+                    foundDuplicate = false;
+                    iLen = this.eventQueue.length;
+        
+                    for (i = 0; i < iLen; i++) {
+                        queueItem = this.eventQueue[i];
+        
+                        if (queueItem) {
+                            queueItemKey = queueItem[0];
+                            queueItemValue = queueItem[1];
+                            
+                            if (queueItemKey == key) {
+    
+                                /*
+                                    found a dupe... push to end of queue, null 
+                                    current item, and break
+                                */
+    
+                                this.eventQueue[i] = null;
+    
+                                this.eventQueue.push(
+                                    [key, (!Lang.isUndefined(value) ? 
+                                    value : queueItemValue)]);
+    
+                                foundDuplicate = true;
+                                break;
+                            }
+                        }
+                    }
+                    
+                    // this is a refire, or a new property in the queue
+    
+                    if (! foundDuplicate && !Lang.isUndefined(value)) { 
+                        this.eventQueue.push([key, value]);
+                    }
+                }
+        
+                if (property.supercedes) {
+        
+                    sLen = property.supercedes.length;
+        
+                    for (s = 0; s < sLen; s++) {
+        
+                        supercedesCheck = property.supercedes[s];
+                        qLen = this.eventQueue.length;
+        
+                        for (q = 0; q < qLen; q++) {
+                            queueItemCheck = this.eventQueue[q];
+        
+                            if (queueItemCheck) {
+                                queueItemCheckKey = queueItemCheck[0];
+                                queueItemCheckValue = queueItemCheck[1];
+                                
+                                if (queueItemCheckKey == 
+                                    supercedesCheck.toLowerCase() ) {
+    
+                                    this.eventQueue.push([queueItemCheckKey, 
+                                        queueItemCheckValue]);
+    
+                                    this.eventQueue[q] = null;
+                                    break;
+    
+                                }
+                            }
+                        }
+                    }
+                }
+
+                YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");
+        
+                return true;
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Fires the event for a property using the property's current value.
+        * @method refireEvent
+        * @param {String} key The name of the property
+        */
+        refireEvent: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event && 
+    
+                !Lang.isUndefined(property.value)) {
+    
+                if (this.queueInProgress) {
+    
+                    this.queueProperty(key);
+    
+                } else {
+    
+                    this.fireEvent(key, property.value);
+    
+                }
+    
+            }
+        },
+        
+        /**
+        * Applies a key-value Object literal to the configuration, replacing  
+        * any existing values, and queueing the property events.
+        * Although the values will be set, fireQueue() must be called for their 
+        * associated events to execute.
+        * @method applyConfig
+        * @param {Object} userConfig The configuration Object literal
+        * @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.
+        */
+        applyConfig: function (userConfig, init) {
+        
+            var prop;
+        
+            if (init) {
+                this.initialConfig = userConfig;
+            }
+            for (prop in userConfig) {
+                this.queueProperty(prop, userConfig[prop]);
+            }
+        },
+        
+        /**
+        * Refires the events for all configuration properties using their 
+        * current values.
+        * @method refresh
+        */
+        refresh: function () {
+        
+            var prop;
+        
+            for (prop in this.config) {
+                this.refireEvent(prop);
+            }
+        },
+        
+        /**
+        * Fires the normalized list of queued property change events
+        * @method fireQueue
+        */
+        fireQueue: function () {
+        
+            var i, 
+                queueItem,
+                key,
+                value,
+                property;
+        
+            this.queueInProgress = true;
+            for (i = 0;i < this.eventQueue.length; i++) {
+                queueItem = this.eventQueue[i];
+                if (queueItem) {
+        
+                    key = queueItem[0];
+                    value = queueItem[1];
+                    property = this.config[key];
+        
+                    property.value = value;
+        
+                    this.fireEvent(key,value);
+                }
+            }
+            
+            this.queueInProgress = false;
+            this.eventQueue = [];
+        },
+        
+        /**
+        * Subscribes an external handler to the change event for any 
+        * given property. 
+        * @method subscribeToConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event handler 
+        * (see CustomEvent documentation)
+        * @param {Boolean} override Optional. If true, will override "this"  
+        * within the handler to map to the scope Object passed into the method.
+        * @return {Boolean} True, if the subscription was successful, 
+        * otherwise false.
+        */ 
+        subscribeToConfigEvent: function (key, handler, obj, override) {
+    
+            var property = this.config[key.toLowerCase()];
+    
+            if (property && property.event) {
+    
+                if (!Config.alreadySubscribed(property.event, handler, obj)) {
+    
+                    property.event.subscribe(handler, obj, override);
+    
+                }
+    
+                return true;
+    
+            } else {
+    
+                return false;
+    
+            }
+    
+        },
+        
+        /**
+        * Unsubscribes an external handler from the change event for any 
+        * given property. 
+        * @method unsubscribeFromConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event 
+        * handler (see CustomEvent documentation)
+        * @return {Boolean} True, if the unsubscription was successful, 
+        * otherwise false.
+        */
+        unsubscribeFromConfigEvent: function (key, handler, obj) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.event.unsubscribe(handler, obj);
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Returns a string representation of the Config object
+        * @method toString
+        * @return {String} The Config object in string format.
+        */
+        toString: function () {
+            var output = "Config";
+            if (this.owner) {
+                output += " [" + this.owner.toString() + "]";
+            }
+            return output;
+        },
+        
+        /**
+        * Returns a string representation of the Config object's current 
+        * CustomEvent queue
+        * @method outputEventQueue
+        * @return {String} The string list of CustomEvents currently queued 
+        * for execution
+        */
+        outputEventQueue: function () {
+
+            var output = "",
+                queueItem,
+                q,
+                nQueue = this.eventQueue.length;
+              
+            for (q = 0; q < nQueue; q++) {
+                queueItem = this.eventQueue[q];
+                if (queueItem) {
+                    output += queueItem[0] + "=" + queueItem[1] + ", ";
+                }
+            }
+            return output;
+        },
+
+        /**
+        * Sets all properties to null, unsubscribes all listeners from each 
+        * property's change event and all listeners from the configChangedEvent.
+        * @method destroy
+        */
+        destroy: function () {
+
+            var oConfig = this.config,
+                sProperty,
+                oProperty;
+
+
+            for (sProperty in oConfig) {
+            
+                if (Lang.hasOwnProperty(oConfig, sProperty)) {
+
+                    oProperty = oConfig[sProperty];
+
+                    oProperty.event.unsubscribeAll();
+                    oProperty.event = null;
+
+                }
+            
+            }
+            
+            this.configChangedEvent.unsubscribeAll();
+            
+            this.configChangedEvent = null;
+            this.owner = null;
+            this.config = null;
+            this.initialConfig = null;
+            this.eventQueue = null;
+        
+        }
+
+    };
+    
+    
+    
+    /**
+    * Checks to determine if a particular function/Object pair are already 
+    * subscribed to the specified CustomEvent
+    * @method YAHOO.util.Config.alreadySubscribed
+    * @static
+    * @param {YAHOO.util.CustomEvent} evt The CustomEvent for which to check 
+    * the subscriptions
+    * @param {Function} fn The function to look for in the subscribers list
+    * @param {Object} obj The execution scope Object for the subscription
+    * @return {Boolean} true, if the function/Object pair is already subscribed 
+    * to the CustomEvent passed in
+    */
+    Config.alreadySubscribed = function (evt, fn, obj) {
+    
+        var nSubscribers = evt.subscribers.length,
+            subsc,
+            i;
+
+        if (nSubscribers > 0) {
+
+            i = nSubscribers - 1;
+        
+            do {
+
+                subsc = evt.subscribers[i];
+
+                if (subsc && subsc.obj == obj && subsc.fn == fn) {
+        
+                    return true;
+        
+                }    
+            
+            }
+            while (i--);
+        
+        }
+    
+        return false;
+    
+    };
+    
+    YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
+
+}());
 
 /**
 * YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility
@@ -676,7 +890,6 @@ YAHOO.widget.DateMath = {
        * @param {Date} date    The JavaScript date for which to find the week number
        * @param {Number} calendarYear  OPTIONAL - The calendar year to use for determining the week number. Default is
        *                                                                                       the calendar year of parameter "date".
-       * @param {Number} weekStartsOn  OPTIONAL - The integer (0-6) representing which day a week begins on. Default is 0 (for Sunday).
        * @return {Number}      The week number of the given date.
        */
        getWeekNumber : function(date, calendarYear) {
@@ -757,7 +970,7 @@ YAHOO.widget.DateMath = {
 };
 
 /**
-* 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.
+* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month  or multi-month interface. Calendars are generated entirely via script and can be navigated without any page refreshes.
 * @module    calendar
 * @title     Calendar
 * @namespace YAHOO.widget
@@ -774,7 +987,6 @@ YAHOO.widget.DateMath = {
 *      <xmp>
 *              <div id="cal1Container"></div>
 *      </xmp>
-* Note that the table can be replaced with any kind of element.
 * </p>
 * @namespace YAHOO.widget
 * @class Calendar
@@ -791,9 +1003,10 @@ YAHOO.widget.Calendar = function(id, containerId, config) {
 * The path to be used for images loaded for the Calendar
 * @property YAHOO.widget.Calendar.IMG_ROOT
 * @static
+* @deprecated  You can now customize images by overriding the calclose, calnavleft and calnavright default CSS classes for the close icon, left arrow and right arrow respectively
 * @type String
 */
-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.IMG_ROOT = null;
 
 /**
 * Type constant used for renderers to represent an individual date (M/D/Y)
@@ -858,6 +1071,153 @@ YAHOO.widget.Calendar.DISPLAY_DAYS = 42;
 */
 YAHOO.widget.Calendar.STOP_RENDER = "S";
 
+/**
+* Constant used to represent short date field string formats (e.g. Tu or Feb)
+* @property YAHOO.widget.Calendar.SHORT
+* @static
+* @final
+* @type String
+*/
+YAHOO.widget.Calendar.SHORT = "short";
+
+/**
+* Constant used to represent long date field string formats (e.g. Monday or February)
+* @property YAHOO.widget.Calendar.LONG
+* @static
+* @final
+* @type String
+*/
+YAHOO.widget.Calendar.LONG = "long";
+
+/**
+* Constant used to represent medium date field string formats (e.g. Mon)
+* @property YAHOO.widget.Calendar.MEDIUM
+* @static
+* @final
+* @type String
+*/
+YAHOO.widget.Calendar.MEDIUM = "medium";
+
+/**
+* Constant used to represent single character date field string formats (e.g. M, T, W)
+* @property YAHOO.widget.Calendar.ONE_CHAR
+* @static
+* @final
+* @type String
+*/
+YAHOO.widget.Calendar.ONE_CHAR = "1char";
+
+/**
+* The set of default Config property keys and values for the Calendar
+* @property YAHOO.widget.Calendar._DEFAULT_CONFIG
+* @final
+* @static
+* @private
+* @type Object
+*/
+YAHOO.widget.Calendar._DEFAULT_CONFIG = {
+       // Default values for pagedate and selected are not class level constants - they are set during instance creation 
+       PAGEDATE : {key:"pagedate", value:null},
+       SELECTED : {key:"selected", value:null},
+       TITLE : {key:"title", value:""},
+       CLOSE : {key:"close", value:false},
+       IFRAME : {key:"iframe", value:(YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) ? true : false},
+       MINDATE : {key:"mindate", value:null},
+       MAXDATE : {key:"maxdate", value:null},
+       MULTI_SELECT : {key:"multi_select", value:false},
+       START_WEEKDAY : {key:"start_weekday", value:0},
+       SHOW_WEEKDAYS : {key:"show_weekdays", value:true},
+       SHOW_WEEK_HEADER : {key:"show_week_header", value:false},
+       SHOW_WEEK_FOOTER : {key:"show_week_footer", value:false},
+       HIDE_BLANK_WEEKS : {key:"hide_blank_weeks", value:false},
+       NAV_ARROW_LEFT: {key:"nav_arrow_left", value:null} ,
+       NAV_ARROW_RIGHT : {key:"nav_arrow_right", value:null} ,
+       MONTHS_SHORT : {key:"months_short", value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]},
+       MONTHS_LONG: {key:"months_long", value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]},
+       WEEKDAYS_1CHAR: {key:"weekdays_1char", value:["S", "M", "T", "W", "T", "F", "S"]},
+       WEEKDAYS_SHORT: {key:"weekdays_short", value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]},
+       WEEKDAYS_MEDIUM: {key:"weekdays_medium", value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]},
+       WEEKDAYS_LONG: {key:"weekdays_long", value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]},
+       LOCALE_MONTHS:{key:"locale_months", value:"long"},
+       LOCALE_WEEKDAYS:{key:"locale_weekdays", value:"short"},
+       DATE_DELIMITER:{key:"date_delimiter", value:","},
+       DATE_FIELD_DELIMITER:{key:"date_field_delimiter", value:"/"},
+       DATE_RANGE_DELIMITER:{key:"date_range_delimiter", value:"-"},
+       MY_MONTH_POSITION:{key:"my_month_position", value:1},
+       MY_YEAR_POSITION:{key:"my_year_position", value:2},
+       MD_MONTH_POSITION:{key:"md_month_position", value:1},
+       MD_DAY_POSITION:{key:"md_day_position", value:2},
+       MDY_MONTH_POSITION:{key:"mdy_month_position", value:1},
+       MDY_DAY_POSITION:{key:"mdy_day_position", value:2},
+       MDY_YEAR_POSITION:{key:"mdy_year_position", value:3},
+       MY_LABEL_MONTH_POSITION:{key:"my_label_month_position", value:1},
+       MY_LABEL_YEAR_POSITION:{key:"my_label_year_position", value:2},
+       MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix", value:" "},
+       MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix", value:""}
+};
+
+/**
+* The set of Custom Event types supported by the Calendar
+* @property YAHOO.widget.Calendar._EVENT_TYPES
+* @final
+* @static
+* @private
+* @type Object
+*/
+YAHOO.widget.Calendar._EVENT_TYPES = {
+       BEFORE_SELECT : "beforeSelect", 
+       SELECT : "select",
+       BEFORE_DESELECT : "beforeDeselect",
+       DESELECT : "deselect",
+       CHANGE_PAGE : "changePage",
+       BEFORE_RENDER : "beforeRender",
+       RENDER : "render",
+       RESET : "reset",
+       CLEAR : "clear"
+};
+
+/**
+* The set of default style constants for the Calendar
+* @property YAHOO.widget.Calendar._STYLES
+* @final
+* @static
+* @private
+* @type Object
+*/
+YAHOO.widget.Calendar._STYLES = {
+       CSS_ROW_HEADER: "calrowhead",
+       CSS_ROW_FOOTER: "calrowfoot",
+       CSS_CELL : "calcell",
+       CSS_CELL_SELECTOR : "selector",
+       CSS_CELL_SELECTED : "selected",
+       CSS_CELL_SELECTABLE : "selectable",
+       CSS_CELL_RESTRICTED : "restricted",
+       CSS_CELL_TODAY : "today",
+       CSS_CELL_OOM : "oom",
+       CSS_CELL_OOB : "previous",
+       CSS_HEADER : "calheader",
+       CSS_HEADER_TEXT : "calhead",
+       CSS_BODY : "calbody",
+       CSS_WEEKDAY_CELL : "calweekdaycell",
+       CSS_WEEKDAY_ROW : "calweekdayrow",
+       CSS_FOOTER : "calfoot",
+       CSS_CALENDAR : "yui-calendar",
+       CSS_SINGLE : "single",
+       CSS_CONTAINER : "yui-calcontainer",
+       CSS_NAV_LEFT : "calnavleft",
+       CSS_NAV_RIGHT : "calnavright",
+       CSS_CLOSE : "calclose",
+       CSS_CELL_TOP : "calcelltop",
+       CSS_CELL_LEFT : "calcellleft",
+       CSS_CELL_RIGHT : "calcellright",
+       CSS_CELL_BOTTOM : "calcellbottom",
+       CSS_CELL_HOVER : "calcellhover",
+       CSS_CELL_HIGHLIGHT1 : "highlight1",
+       CSS_CELL_HIGHLIGHT2 : "highlight2",
+       CSS_CELL_HIGHLIGHT3 : "highlight3",
+       CSS_CELL_HIGHLIGHT4 : "highlight4"
+};
+
 YAHOO.widget.Calendar.prototype = {
 
        /**
@@ -933,14 +1293,6 @@ YAHOO.widget.Calendar.prototype = {
        */
        _renderStack : null,
 
-       /**
-       * A Date object representing the month/year that the calendar is initially set to
-       * @property _pageDate
-       * @private
-       * @type Date
-       */
-       _pageDate : null,
-
        /**
        * The private list of initially selected dates.
        * @property _selectedDates
@@ -967,17 +1319,14 @@ YAHOO.widget.Calendar.prototype = {
 * @param {Object}      config          The configuration object containing the Calendar's arguments
 */
 YAHOO.widget.Calendar.prototype.init = function(id, containerId, config) {
-       this.logger = new YAHOO.widget.LogWriter("Calendar_Core " + id);
-       
+       this.logger = new YAHOO.widget.LogWriter("Calendar " + id);
        this.initEvents();
        this.today = new Date();
        YAHOO.widget.DateMath.clearTime(this.today);
 
        this.id = id;
        this.oDomContainer = document.getElementById(containerId);
-       if (! this.oDomContainer) {
-               this.logger.log("No valid container present.", "error");
-       }
+       if (! this.oDomContainer) { this.logger.log("No valid container present.", "error"); }
 
        /**
        * The Config object used to hold the configuration variables for the Calendar
@@ -1004,7 +1353,7 @@ YAHOO.widget.Calendar.prototype.init = function(id, containerId, config) {
 
        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 = [];
@@ -1020,30 +1369,41 @@ YAHOO.widget.Calendar.prototype.init = function(id, containerId, config) {
 };
 
 /**
-* Renders the built-in IFRAME shim for the IE6 and below
+* Default Config listener for the iframe property. If the iframe config property is set to true, 
+* renders the built-in IFRAME shim if the container is relatively or absolutely positioned.
+* 
 * @method configIframe
 */
 YAHOO.widget.Calendar.prototype.configIframe = function(type, args, obj) {
        var useIframe = args[0];
 
-       if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {
-               if (useIframe) {
-                       var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");
+       if (!this.parent) {
+               if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {
+                       if (useIframe) {
+                               var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");
+                               
+                               if (pos == "absolute" || pos == "relative") {
+                                       
+                                       if (!YAHOO.util.Dom.inDocument(this.iframe)) {
+                                               this.iframe = document.createElement("iframe");
+                                               this.iframe.src = "javascript:false;";
+
+                                               YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");
+
+                                               if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
+                                                       YAHOO.util.Dom.addClass(this.iframe, "fixedsize");
+                                               }
 
-                       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);
+                                               this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);
+                                       }
                                }
-                       }
-               } else {
-                       if (this.iframe) {
-                               if (this.iframe.parentNode) {
-                                       this.iframe.parentNode.removeChild(this.iframe);
+                       } else {
+                               if (this.iframe) {
+                                       if (this.iframe.parentNode) {
+                                               this.iframe.parentNode.removeChild(this.iframe);
+                                       }
+                                       this.iframe = null;
                                }
-                               this.iframe = null;
                        }
                }
        }
@@ -1055,7 +1415,7 @@ YAHOO.widget.Calendar.prototype.configIframe = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.configTitle = function(type, args, obj) {
        var title = args[0];
-       var close = this.cfg.getProperty("close");
+       var close = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);
        
        var titleDiv;
 
@@ -1084,24 +1444,31 @@ YAHOO.widget.Calendar.prototype.configTitle = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.configClose = function(type, args, obj) {
        var close = args[0];
-       var title = this.cfg.getProperty("title");
+       var title = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);
+       
+       var DEPR_CLOSE_PATH = "us/my/bn/x_d.gif";
 
        var linkClose;
 
        if (close === true) {
                linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || document.createElement("a");
-               linkClose.href = "javascript:void(null);";
+               linkClose.href = "#";
                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);
+               YAHOO.util.Event.addListener(linkClose, "click", function(e, cal) {cal.hide(); YAHOO.util.Event.preventDefault(e); }, this);
+               
+               if (YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                       var imgClose = document.createElement("img");
+                       imgClose.src = YAHOO.widget.Calendar.IMG_ROOT + DEPR_CLOSE_PATH;
+                       imgClose.className = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;
+                       linkClose.appendChild(imgClose);
+               } else {
+                       linkClose.innerHTML = '<span class="' + YAHOO.widget.CalendarGroup.CSS_2UPCLOSE + ' ' + this.Style.CSS_CLOSE + '"></span>';
+               }
+               
                this.oDomContainer.appendChild(linkClose);
                YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");
        } else {
                linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || null;
-
                if (linkClose) {
                        YAHOO.util.Event.purgeElement(linkClose);
                        this.oDomContainer.removeChild(linkClose);
@@ -1118,61 +1485,63 @@ YAHOO.widget.Calendar.prototype.configClose = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.initEvents = function() {
 
+       var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
+
        /**
        * Fired before a selection is made
        * @event beforeSelectEvent
        */
-       this.beforeSelectEvent = new YAHOO.util.CustomEvent("beforeSelect"); 
+       this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT); 
 
        /**
        * Fired when a selection is made
        * @event selectEvent
        * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
        */
-       this.selectEvent = new YAHOO.util.CustomEvent("select");
+       this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT);
 
        /**
        * Fired before a selection is made
        * @event beforeDeselectEvent
        */
-       this.beforeDeselectEvent = new YAHOO.util.CustomEvent("beforeDeselect");
+       this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);
 
        /**
        * Fired when a selection is made
        * @event deselectEvent
        * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
        */
-       this.deselectEvent = new YAHOO.util.CustomEvent("deselect");
+       this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT);
 
        /**
        * Fired when the Calendar page is changed
        * @event changePageEvent
        */
-       this.changePageEvent = new YAHOO.util.CustomEvent("changePage");
+       this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);
 
        /**
        * Fired before the Calendar is rendered
        * @event beforeRenderEvent
        */
-       this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");
+       this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
 
        /**
        * Fired when the Calendar is rendered
        * @event renderEvent
        */
-       this.renderEvent = new YAHOO.util.CustomEvent("render");
+       this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
 
        /**
        * Fired when the Calendar is reset
        * @event resetEvent
        */
-       this.resetEvent = new YAHOO.util.CustomEvent("reset");
+       this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET);
 
        /**
        * Fired when the Calendar is cleared
        * @event clearEvent
        */
-       this.clearEvent = new YAHOO.util.CustomEvent("clear");
+       this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
 
        this.beforeSelectEvent.subscribe(this.onBeforeSelect, this, true);
        this.selectEvent.subscribe(this.onSelect, this, true);
@@ -1184,7 +1553,6 @@ YAHOO.widget.Calendar.prototype.initEvents = function() {
        this.clearEvent.subscribe(this.onClear, this, true);
 };
 
-
 /**
 * The default event function that is attached to a date link within a calendar cell
 * when the calendar is rendered.
@@ -1193,17 +1561,30 @@ YAHOO.widget.Calendar.prototype.initEvents = function() {
 * @param {Calendar} cal        A reference to the calendar passed by the Event utility
 */
 YAHOO.widget.Calendar.prototype.doSelectCell = function(e, cal) {
+       var cell,index,d,date;
+
        var target = YAHOO.util.Event.getTarget(e);
+       var tagName = target.tagName.toLowerCase();
+       var defSelector = false;
 
-       var cell,index,d,date;
+       while (tagName != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
+
+               if (!defSelector && tagName == "a" && YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTOR)) {
+                       defSelector = true;     
+               }
 
-       while (target.tagName.toLowerCase() != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
                target = target.parentNode;
-               if (target.tagName.toLowerCase() == "html") {
+               tagName = target.tagName.toLowerCase(); 
+               if (tagName == "html") {
                        return;
                }
        }
-       
+
+       if (defSelector) {
+               // Stop link href navigation for default renderer
+               YAHOO.util.Event.preventDefault(e);
+       }
+
        cell = target;
 
        if (YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) {
@@ -1214,22 +1595,21 @@ YAHOO.widget.Calendar.prototype.doSelectCell = function(e, cal) {
                var link;
 
                cal.logger.log("Selecting cell " + index + " via click", "info");
-
                if (cal.Options.MULTI_SELECT) {
                        link = cell.getElementsByTagName("a")[0];
                        if (link) {
                                link.blur();
                        }
-                       
+
                        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) {
@@ -1294,13 +1674,15 @@ YAHOO.widget.Calendar.prototype.doCellMouseOut = function(e, cal) {
 
 YAHOO.widget.Calendar.prototype.setupConfig = function() {
 
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+
        /**
        * The month/year representing the current visible Calendar date (mm/yyyy)
        * @config pagedate
        * @type String
        * @default today's date
        */
-       this.cfg.addProperty("pagedate", { value:new Date(), handler:this.configPageDate } );
+       this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
 
        /**
        * The date or range of dates representing the current Calendar selection
@@ -1308,7 +1690,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default []
        */
-       this.cfg.addProperty("selected", { value:[], handler:this.configSelected } );
+       this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
 
        /**
        * The title to display above the Calendar's month header
@@ -1316,7 +1698,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default ""
        */
-       this.cfg.addProperty("title", { value:"", handler:this.configTitle } );
+       this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
 
        /**
        * Whether or not a close button should be displayed for this Calendar
@@ -1324,15 +1706,18 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("close", { value:false, handler:this.configClose } );
+       this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
 
        /**
        * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
+       * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
+       * enabled if required.
+       * 
        * @config iframe
        * @type Boolean
-       * @default true
+       * @default true for IE6 and below, false for all other browsers
        */
-       this.cfg.addProperty("iframe", { value:true, handler:this.configIframe, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
 
        /**
        * The minimum selectable date in the current Calendar (mm/dd/yyyy)
@@ -1340,7 +1725,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default null
        */
-       this.cfg.addProperty("mindate", { value:null, handler:this.configMinDate } );
+       this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.configMinDate } );
 
        /**
        * The maximum selectable date in the current Calendar (mm/dd/yyyy)
@@ -1348,7 +1733,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default null
        */
-       this.cfg.addProperty("maxdate", { value:null, handler:this.configMaxDate } );
+       this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.configMaxDate } );
 
 
        // Options properties
@@ -1359,7 +1744,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("MULTI_SELECT",    { value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
 
        /**
        * The weekday the week begins on. Default is 0 (Sunday).
@@ -1367,7 +1752,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type number
        * @default 0
        */
-       this.cfg.addProperty("START_WEEKDAY",   { value:0, handler:this.configOptions, validator:this.cfg.checkNumber  } );
+       this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.configOptions, validator:this.cfg.checkNumber  } );
 
        /**
        * True if the Calendar should show weekday labels. True by default.
@@ -1375,7 +1760,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default true
        */
-       this.cfg.addProperty("SHOW_WEEKDAYS",   { value:true, handler:this.configOptions, validator:this.cfg.checkBoolean  } );
+       this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.configOptions, validator:this.cfg.checkBoolean  } );
 
        /**
        * True if the Calendar should show week row headers. False by default.
@@ -1383,7 +1768,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("SHOW_WEEK_HEADER",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key, { value:defCfg.SHOW_WEEK_HEADER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
 
        /**
        * True if the Calendar should show week row footers. False by default.
@@ -1391,7 +1776,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */      
-       this.cfg.addProperty("SHOW_WEEK_FOOTER",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
 
        /**
        * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
@@ -1399,23 +1784,25 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */      
-       this.cfg.addProperty("HIDE_BLANK_WEEKS",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );
-
+       this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key, { value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       
        /**
        * The image that should be used for the left navigation arrow.
        * @config NAV_ARROW_LEFT
        * @type String
-       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif"
+       * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"  
+       * @default null
        */      
-       this.cfg.addProperty("NAV_ARROW_LEFT",  { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif", handler:this.configOptions } );
+       this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.configOptions } );
 
        /**
-       * The image that should be used for the left navigation arrow.
+       * The image that should be used for the right navigation arrow.
        * @config NAV_ARROW_RIGHT
        * @type String
-       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif"
+       * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
+       * @default null
        */      
-       this.cfg.addProperty("NAV_ARROW_RIGHT", { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif", handler:this.configOptions } );
+       this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key, { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.configOptions } );
 
        // Locale properties
 
@@ -1425,7 +1812,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
        */
-       this.cfg.addProperty("MONTHS_SHORT",    { value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.configLocale } );
        
        /**
        * The long month labels for the current locale.
@@ -1433,7 +1820,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
        */      
-       this.cfg.addProperty("MONTHS_LONG",             { value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.configLocale } );
        
        /**
        * The 1-character weekday labels for the current locale.
@@ -1441,7 +1828,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["S", "M", "T", "W", "T", "F", "S"]
        */      
-       this.cfg.addProperty("WEEKDAYS_1CHAR",  { value:["S", "M", "T", "W", "T", "F", "S"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.configLocale } );
        
        /**
        * The short weekday labels for the current locale.
@@ -1449,7 +1836,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
        */      
-       this.cfg.addProperty("WEEKDAYS_SHORT",  { value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.configLocale } );
        
        /**
        * The medium weekday labels for the current locale.
@@ -1457,7 +1844,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
        */      
-       this.cfg.addProperty("WEEKDAYS_MEDIUM", { value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.configLocale } );
        
        /**
        * The long weekday labels for the current locale.
@@ -1465,7 +1852,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
        */      
-       this.cfg.addProperty("WEEKDAYS_LONG",   { value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.configLocale } );
 
        /**
        * Refreshes the locale values used to build the Calendar.
@@ -1473,17 +1860,17 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @private
        */
        var refreshLocale = function() {
-               this.cfg.refireEvent("LOCALE_MONTHS");
-               this.cfg.refireEvent("LOCALE_WEEKDAYS");
+               this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
+               this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
        };
 
-       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.subscribeToConfigEvent(defCfg.START_WEEKDAY.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.MONTHS_SHORT.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.MONTHS_LONG.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_1CHAR.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_SHORT.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_MEDIUM.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_LONG.key, refreshLocale, this, true);
        
        /**
        * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
@@ -1491,7 +1878,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default "long"
        */      
-       this.cfg.addProperty("LOCALE_MONTHS",   { value:"long", handler:this.configLocaleValues } );
+       this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.configLocaleValues } );
        
        /**
        * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
@@ -1499,7 +1886,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default "short"
        */      
-       this.cfg.addProperty("LOCALE_WEEKDAYS", { value:"short", handler:this.configLocaleValues } );
+       this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.configLocaleValues } );
 
        /**
        * The value used to delimit individual dates in a date string passed to various Calendar functions.
@@ -1507,7 +1894,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default ","
        */      
-       this.cfg.addProperty("DATE_DELIMITER",          { value:",", handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.configLocale } );
 
        /**
        * The value used to delimit date fields in a date string passed to various Calendar functions.
@@ -1515,7 +1902,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default "/"
        */      
-       this.cfg.addProperty("DATE_FIELD_DELIMITER",{ value:"/", handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key, { value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.configLocale } );
 
        /**
        * The value used to delimit date ranges in a date string passed to various Calendar functions.
@@ -1523,7 +1910,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default "-"
        */
-       this.cfg.addProperty("DATE_RANGE_DELIMITER",{ value:"-", handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key, { value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.configLocale } );
 
        /**
        * The position of the month in a month/year date string
@@ -1531,7 +1918,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */
-       this.cfg.addProperty("MY_MONTH_POSITION",       { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the year in a month/year date string
@@ -1539,7 +1926,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */
-       this.cfg.addProperty("MY_YEAR_POSITION",        { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the month in a month/day date string
@@ -1547,7 +1934,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */
-       this.cfg.addProperty("MD_MONTH_POSITION",       { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the day in a month/year date string
@@ -1555,7 +1942,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */
-       this.cfg.addProperty("MD_DAY_POSITION",         { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the month in a month/day/year date string
@@ -1563,7 +1950,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */
-       this.cfg.addProperty("MDY_MONTH_POSITION",      { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the day in a month/day/year date string
@@ -1571,7 +1958,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */
-       this.cfg.addProperty("MDY_DAY_POSITION",        { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the year in a month/day/year date string
@@ -1579,7 +1966,39 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 3
        */
-       this.cfg.addProperty("MDY_YEAR_POSITION",       { value:3, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+       /**
+       * The position of the month in the month year label string used as the Calendar header
+       * @config MY_LABEL_MONTH_POSITION
+       * @type Number
+       * @default 1
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+
+       /**
+       * The position of the year in the month year label string used as the Calendar header
+       * @config MY_LABEL_YEAR_POSITION
+       * @type Number
+       * @default 2
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+       /**
+       * The suffix used after the month when rendering the Calendar header
+       * @config MY_LABEL_MONTH_SUFFIX
+       * @type String
+       * @default " "
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.configLocale } );
+       
+       /**
+       * The suffix used after the year when rendering the Calendar header
+       * @config MY_LABEL_YEAR_SUFFIX
+       * @type String
+       * @default ""
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.configLocale } );
 };
 
 /**
@@ -1587,34 +2006,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
 * @method configPageDate
 */
 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");
-                       }
-                       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();
-       }
-       
-       this.cfg.setProperty("pagedate", new Date(year, month, 1), true);
-       
-       this.logger.log("Set month/year to " + month + "/" + year, "info");
-
-       if (! this._pageDate) {
-               this._pageDate = this.cfg.getProperty("pagedate");
-       }
+       this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key, this._parsePageDate(args[0]), true);
 };
 
 /**
@@ -1623,9 +2015,9 @@ YAHOO.widget.Calendar.prototype.configPageDate = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.configMinDate = function(type, args, obj) {
        var val = args[0];
-       if (typeof val == 'string') {
+       if (YAHOO.lang.isString(val)) {
                val = this._parseDate(val);
-               this.cfg.setProperty("mindate", new Date(val[0],(val[1]-1),val[2]));
+               this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key, new Date(val[0],(val[1]-1),val[2]));
        }
 };
 
@@ -1635,9 +2027,9 @@ YAHOO.widget.Calendar.prototype.configMinDate = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.configMaxDate = function(type, args, obj) {
        var val = args[0];
-       if (typeof val == 'string') {
+       if (YAHOO.lang.isString(val)) {
                val = this._parseDate(val);
-               this.cfg.setProperty("maxdate", new Date(val[0],(val[1]-1),val[2]));
+               this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key, new Date(val[0],(val[1]-1),val[2]));
        }
 };
 
@@ -1647,14 +2039,15 @@ YAHOO.widget.Calendar.prototype.configMaxDate = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.configSelected = function(type, args, obj) {
        var selected = args[0];
+       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
        
        if (selected) {
-               if (typeof selected == 'string') {
-                       this.cfg.setProperty("selected", this._parseDates(selected), true);
+               if (YAHOO.lang.isString(selected)) {
+                       this.cfg.setProperty(cfgSelected, this._parseDates(selected), true);
                } 
        }
        if (! this._selectedDates) {
-               this._selectedDates = this.cfg.getProperty("selected");
+               this._selectedDates = this.cfg.getProperty(cfgSelected);
        }
 };
 
@@ -1663,9 +2056,7 @@ YAHOO.widget.Calendar.prototype.configSelected = function(type, args, obj) {
 * @method configOptions
 */
 YAHOO.widget.Calendar.prototype.configOptions = function(type, args, obj) {
-       type = type.toUpperCase();
-       var val = args[0];
-       this.Options[type] = val;
+       this.Options[type.toUpperCase()] = args[0];
 };
 
 /**
@@ -1673,13 +2064,11 @@ YAHOO.widget.Calendar.prototype.configOptions = function(type, args, obj) {
 * @method configLocale
 */
 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");
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       this.Locale[type.toUpperCase()] = args[0];
 
+       this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
+       this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
 };
 
 /**
@@ -1687,37 +2076,39 @@ YAHOO.widget.Calendar.prototype.configLocale = function(type, args, obj) {
 * @method configLocaleValues
 */
 YAHOO.widget.Calendar.prototype.configLocaleValues = function(type, args, obj) {
-       type = type.toUpperCase();
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG; 
+
+       type = type.toLowerCase();
        var val = args[0];
 
        switch (type) {
-               case "LOCALE_MONTHS":
+               case defCfg.LOCALE_MONTHS.key:
                        switch (val) {
-                               case "short":
-                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty("MONTHS_SHORT").concat();
+                               case YAHOO.widget.Calendar.SHORT:
+                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_SHORT.key).concat();
                                        break;
-                               case "long":
-                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty("MONTHS_LONG").concat();
+                               case YAHOO.widget.Calendar.LONG:
+                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_LONG.key).concat();
                                        break;
                        }
                        break;
-               case "LOCALE_WEEKDAYS":
+               case defCfg.LOCALE_WEEKDAYS.key:
                        switch (val) {
-                               case "1char":
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_1CHAR").concat();
+                               case YAHOO.widget.Calendar.ONE_CHAR:
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_1CHAR.key).concat();
                                        break;
-                               case "short":
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_SHORT").concat();
+                               case YAHOO.widget.Calendar.SHORT:
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_SHORT.key).concat();
                                        break;
-                               case "medium":
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_MEDIUM").concat();
+                               case YAHOO.widget.Calendar.MEDIUM:
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_MEDIUM.key).concat();
                                        break;
-                               case "long":
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_LONG").concat();
+                               case YAHOO.widget.Calendar.LONG:
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_LONG.key).concat();
                                        break;
                        }
                        
-                       var START_WEEKDAY = this.cfg.getProperty("START_WEEKDAY");
+                       var START_WEEKDAY = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
 
                        if (START_WEEKDAY > 0) {
                                for (var w=0;w<START_WEEKDAY;++w) {
@@ -1734,123 +2125,133 @@ YAHOO.widget.Calendar.prototype.configLocaleValues = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.initStyles = function() {
 
-       /**
-       * Collection of Style constants for the Calendar
-       * @property Style
-       */
+       var defStyle = YAHOO.widget.Calendar._STYLES;
+
        this.Style = {
                /**
                * @property Style.CSS_ROW_HEADER
                */
-               CSS_ROW_HEADER: "calrowhead",
+               CSS_ROW_HEADER: defStyle.CSS_ROW_HEADER,
                /**
                * @property Style.CSS_ROW_FOOTER
                */
-               CSS_ROW_FOOTER: "calrowfoot",
+               CSS_ROW_FOOTER: defStyle.CSS_ROW_FOOTER,
                /**
                * @property Style.CSS_CELL
                */
-               CSS_CELL : "calcell",
+               CSS_CELL : defStyle.CSS_CELL,
+               /**
+               * @property Style.CSS_CELL_SELECTOR
+               */
+               CSS_CELL_SELECTOR : defStyle.CSS_CELL_SELECTOR,
                /**
                * @property Style.CSS_CELL_SELECTED
                */
-               CSS_CELL_SELECTED : "selected",
+               CSS_CELL_SELECTED : defStyle.CSS_CELL_SELECTED,
                /**
                * @property Style.CSS_CELL_SELECTABLE
                */
-               CSS_CELL_SELECTABLE : "selectable",
+               CSS_CELL_SELECTABLE : defStyle.CSS_CELL_SELECTABLE,
                /**
                * @property Style.CSS_CELL_RESTRICTED
                */
-               CSS_CELL_RESTRICTED : "restricted",
+               CSS_CELL_RESTRICTED : defStyle.CSS_CELL_RESTRICTED,
                /**
                * @property Style.CSS_CELL_TODAY
                */
-               CSS_CELL_TODAY : "today",
+               CSS_CELL_TODAY : defStyle.CSS_CELL_TODAY,
                /**
                * @property Style.CSS_CELL_OOM
                */
-               CSS_CELL_OOM : "oom",
+               CSS_CELL_OOM : defStyle.CSS_CELL_OOM,
                /**
                * @property Style.CSS_CELL_OOB
                */
-               CSS_CELL_OOB : "previous",
+               CSS_CELL_OOB : defStyle.CSS_CELL_OOB,
                /**
                * @property Style.CSS_HEADER
                */
-               CSS_HEADER : "calheader",
+               CSS_HEADER : defStyle.CSS_HEADER,
                /**
                * @property Style.CSS_HEADER_TEXT
                */
-               CSS_HEADER_TEXT : "calhead",
+               CSS_HEADER_TEXT : defStyle.CSS_HEADER_TEXT,
+               /**
+               * @property Style.CSS_BODY
+               */
+               CSS_BODY : defStyle.CSS_BODY,
                /**
                * @property Style.CSS_WEEKDAY_CELL
                */
-               CSS_WEEKDAY_CELL : "calweekdaycell",
+               CSS_WEEKDAY_CELL : defStyle.CSS_WEEKDAY_CELL,
                /**
                * @property Style.CSS_WEEKDAY_ROW
                */
-               CSS_WEEKDAY_ROW : "calweekdayrow",
+               CSS_WEEKDAY_ROW : defStyle.CSS_WEEKDAY_ROW,
                /**
                * @property Style.CSS_FOOTER
                */
-               CSS_FOOTER : "calfoot",
+               CSS_FOOTER : defStyle.CSS_FOOTER,
                /**
                * @property Style.CSS_CALENDAR
                */
-               CSS_CALENDAR : "yui-calendar",
+               CSS_CALENDAR : defStyle.CSS_CALENDAR,
                /**
                * @property Style.CSS_SINGLE
                */
-               CSS_SINGLE : "single",
+               CSS_SINGLE : defStyle.CSS_SINGLE,
                /**
                * @property Style.CSS_CONTAINER
                */
-               CSS_CONTAINER : "yui-calcontainer",
+               CSS_CONTAINER : defStyle.CSS_CONTAINER,
                /**
                * @property Style.CSS_NAV_LEFT
                */
-               CSS_NAV_LEFT : "calnavleft",
+               CSS_NAV_LEFT : defStyle.CSS_NAV_LEFT,
                /**
                * @property Style.CSS_NAV_RIGHT
                */
-               CSS_NAV_RIGHT : "calnavright",
+               CSS_NAV_RIGHT : defStyle.CSS_NAV_RIGHT,
+               /**
+               * @property Style.CSS_CLOSE
+               */
+               CSS_CLOSE : defStyle.CSS_CLOSE,
                /**
                * @property Style.CSS_CELL_TOP
                */
-               CSS_CELL_TOP : "calcelltop",
+               CSS_CELL_TOP : defStyle.CSS_CELL_TOP,
                /**
                * @property Style.CSS_CELL_LEFT
                */
-               CSS_CELL_LEFT : "calcellleft",
+               CSS_CELL_LEFT : defStyle.CSS_CELL_LEFT,
                /**
                * @property Style.CSS_CELL_RIGHT
                */
-               CSS_CELL_RIGHT : "calcellright",
+               CSS_CELL_RIGHT : defStyle.CSS_CELL_RIGHT,
                /**
                * @property Style.CSS_CELL_BOTTOM
                */
-               CSS_CELL_BOTTOM : "calcellbottom",
+               CSS_CELL_BOTTOM : defStyle.CSS_CELL_BOTTOM,
                /**
                * @property Style.CSS_CELL_HOVER
                */
-               CSS_CELL_HOVER : "calcellhover",
+               CSS_CELL_HOVER : defStyle.CSS_CELL_HOVER,
                /**
                * @property Style.CSS_CELL_HIGHLIGHT1
                */
-               CSS_CELL_HIGHLIGHT1 : "highlight1",
+               CSS_CELL_HIGHLIGHT1 : defStyle.CSS_CELL_HIGHLIGHT1,
                /**
                * @property Style.CSS_CELL_HIGHLIGHT2
                */
-               CSS_CELL_HIGHLIGHT2 : "highlight2",
+               CSS_CELL_HIGHLIGHT2 : defStyle.CSS_CELL_HIGHLIGHT2,
                /**
                * @property Style.CSS_CELL_HIGHLIGHT3
                */
-               CSS_CELL_HIGHLIGHT3 : "highlight3",
+               CSS_CELL_HIGHLIGHT3 : defStyle.CSS_CELL_HIGHLIGHT3,
                /**
                * @property Style.CSS_CELL_HIGHLIGHT4
                */
-               CSS_CELL_HIGHLIGHT4 : "highlight4"
+               CSS_CELL_HIGHLIGHT4 : defStyle.CSS_CELL_HIGHLIGHT4
        };
 };
 
@@ -1861,8 +2262,16 @@ YAHOO.widget.Calendar.prototype.initStyles = function() {
 * @return      {String}        The formatted calendar month label
 */
 YAHOO.widget.Calendar.prototype.buildMonthLabel = function() {
-       var text = this.Locale.LOCALE_MONTHS[this.cfg.getProperty("pagedate").getMonth()] + " " + this.cfg.getProperty("pagedate").getFullYear();
-       return text;
+       var pageDate = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);
+
+       var monthLabel  = this.Locale.LOCALE_MONTHS[pageDate.getMonth()] + this.Locale.MY_LABEL_MONTH_SUFFIX;
+       var yearLabel = pageDate.getFullYear() + this.Locale.MY_LABEL_YEAR_SUFFIX;
+
+       if (this.Locale.MY_LABEL_MONTH_POSITION == 2 || this.Locale.MY_LABEL_YEAR_POSITION == 1) {
+               return yearLabel + monthLabel;
+       } else {
+               return monthLabel + yearLabel;
+       }
 };
 
 /**
@@ -1872,8 +2281,7 @@ YAHOO.widget.Calendar.prototype.buildMonthLabel = function() {
 * @return      {String}        The formatted day label
 */
 YAHOO.widget.Calendar.prototype.buildDayLabel = function(workingDate) {
-       var day = workingDate.getDate();
-       return day;
+       return workingDate.getDate();
 };
 
 /**
@@ -1884,14 +2292,17 @@ YAHOO.widget.Calendar.prototype.buildDayLabel = function(workingDate) {
 */
 YAHOO.widget.Calendar.prototype.renderHeader = function(html) {
        this.logger.log("Rendering header", "info");
-
        var colSpan = 7;
        
-       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) {
+       var DEPR_NAV_LEFT = "us/tr/callt.gif";
+       var DEPR_NAV_RIGHT = "us/tr/calrt.gif"; 
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+       if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
                colSpan += 1;
        }
 
-       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) {
+       if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
                colSpan += 1;
        }
 
@@ -1900,38 +2311,46 @@ YAHOO.widget.Calendar.prototype.renderHeader = function(html) {
        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;
+       var renderLeft, renderRight = false;
 
-               if (this.parent) {
-                       if (this.index === 0) {
-                               renderLeft = true;
-                       }
-                       if (this.index == (this.parent.cfg.getProperty("pages") -1)) {
-                               renderRight = true;
-                       }
-               } else {
+       if (this.parent) {
+               if (this.index === 0) {
                        renderLeft = true;
+               }
+               if (this.index == (this.parent.cfg.getProperty("pages") -1)) {
                        renderRight = true;
                }
+       } else {
+               renderLeft = true;
+               renderRight = true;
+       }
 
-               var cal = this.parent || this;
-
-               if (renderLeft) {
-                       html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '" style="background-image:url(' + this.cfg.getProperty("NAV_ARROW_LEFT") + ')">&#160;</a>';
+       var cal = this.parent || this;
+       
+       if (renderLeft) {
+               var leftArrow = this.cfg.getProperty(defCfg.NAV_ARROW_LEFT.key);
+               // Check for deprecated customization - If someone set IMG_ROOT, but didn't set NAV_ARROW_LEFT, then set NAV_ARROW_LEFT to the old deprecated value
+               if (leftArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                       leftArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_LEFT;
                }
-               
-               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>';
+               var leftStyle = (leftArrow === null) ? "" : ' style="background-image:url(' + leftArrow + ')"';
+               html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '"' + leftStyle + ' >&#160;</a>';
+       }
+       
+       html[html.length] = this.buildMonthLabel();
+       
+       if (renderRight) {
+               var rightArrow = this.cfg.getProperty(defCfg.NAV_ARROW_RIGHT.key);
+               if (rightArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                       rightArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_RIGHT;
                }
+               var rightStyle = (rightArrow === null) ? "" : ' style="background-image:url(' + rightArrow + ')"';
+               html[html.length] = '<a class="' + this.Style.CSS_NAV_RIGHT + '"' + rightStyle + ' >&#160;</a>';
+       }
 
+       html[html.length] =     '</div>\n</th>\n</tr>';
 
-       html[html.length] =                             '</div>';
-       html[html.length] =                     '</th>';
-       html[html.length] =             '</tr>';
-
-       if (this.cfg.getProperty("SHOW_WEEKDAYS")) {
+       if (this.cfg.getProperty(defCfg.SHOW_WEEKDAYS.key)) {
                html = this.buildWeekdays(html);
        }
        
@@ -1948,9 +2367,11 @@ YAHOO.widget.Calendar.prototype.renderHeader = function(html) {
 */
 YAHOO.widget.Calendar.prototype.buildWeekdays = function(html) {
 
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+
        html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';
 
-       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) {
+       if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
                html[html.length] = '<th>&#160;</th>';
        }
 
@@ -1958,7 +2379,7 @@ YAHOO.widget.Calendar.prototype.buildWeekdays = function(html) {
                html[html.length] = '<th class="calweekdaycell">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';
        }
 
-       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) {
+       if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
                html[html.length] = '<th>&#160;</th>';
        }
 
@@ -1976,8 +2397,9 @@ YAHOO.widget.Calendar.prototype.buildWeekdays = function(html) {
 */
 YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
        this.logger.log("Rendering body", "info");
-       
-       var startDay = this.cfg.getProperty("START_WEEKDAY");
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+
+       var startDay = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
 
        this.preMonthDays = workingDate.getDay();
        if (startDay > 0) {
@@ -1989,7 +2411,6 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
        
        this.monthDays = YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();
        this.postMonthDays = YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;
-
        this.logger.log(this.preMonthDays + " preciding out-of-month days", "info");
        this.logger.log(this.monthDays + " month days", "info");
        this.logger.log(this.postMonthDays + " post-month days", "info");
@@ -1997,10 +2418,34 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
        workingDate = YAHOO.widget.DateMath.subtract(workingDate, YAHOO.widget.DateMath.DAY, this.preMonthDays);
        this.logger.log("Calendar page starts on " + workingDate, "info");
 
-       var useDate,weekNum,weekClass;
-       useDate = this.cfg.getProperty("pagedate");
-
-       html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + '">';
+       var weekNum,weekClass;
+       var weekPrefix = "w";
+       var cellPrefix = "_cell";
+       var workingDayPrefix = "wd";
+       var dayPrefix = "d";
+       
+       var cellRenderers;
+       var renderer;
+       
+       var todayYear = this.today.getFullYear();
+       var todayMonth = this.today.getMonth();
+       var todayDate = this.today.getDate();
+       
+       var useDate = this.cfg.getProperty(defCfg.PAGEDATE.key);
+       var hideBlankWeeks = this.cfg.getProperty(defCfg.HIDE_BLANK_WEEKS.key);
+       var showWeekFooter = this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key);
+       var showWeekHeader = this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key);
+       var mindate = this.cfg.getProperty(defCfg.MINDATE.key);
+       var maxdate = this.cfg.getProperty(defCfg.MAXDATE.key);
+
+       if (mindate) {
+               mindate = YAHOO.widget.DateMath.clearTime(mindate);
+       }
+       if (maxdate) {
+               maxdate = YAHOO.widget.DateMath.clearTime(maxdate);
+       }
+       
+       html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + ' ' + this.Style.CSS_BODY + '">';
        
        var i = 0;
 
@@ -2015,46 +2460,42 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
        for (var r=0;r<6;r++) {
 
                weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useDate.getFullYear(), startDay);
+               weekClass = weekPrefix + weekNum;
 
-               weekClass = "w" + weekNum;
-
-               if (r !== 0 && this.isDateOOM(workingDate) && this.cfg.getProperty("HIDE_BLANK_WEEKS") === true) {
+               // Local OOM check for performance, since we already have pagedate
+               if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth()) {
                        break;
                } else {
-                                       
+
                        html[html.length] = '<tr class="' + weekClass + '">';
                        
-                       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) { html = this.renderRowHeader(weekNum, html); }
+                       if (showWeekHeader) { html = this.renderRowHeader(weekNum, html); }
                        
                        for (var d=0;d<7;d++){ // Render actual days
 
-                               var cellRenderers = [];
+                               cellRenderers = [];
+                               renderer = null;
 
                                this.clearElement(cell);
-                               
-                               YAHOO.util.Dom.addClass(cell, "calcell");
-
-                               cell.id = this.id + "_cell" + i;
+                               cell.className = this.Style.CSS_CELL;
+                               cell.id = this.id + cellPrefix + i;
                                this.logger.log("Rendering cell " + cell.id + " (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender");
 
-                               cell.innerHTML = i;
-
-                               var renderer = null;
-                               
-                               if (workingDate.getFullYear()   == this.today.getFullYear() &&
-                                       workingDate.getMonth()          == this.today.getMonth() &&
-                                       workingDate.getDate()           == this.today.getDate()) {
+                               if (workingDate.getDate()               == todayDate && 
+                                       workingDate.getMonth()          == todayMonth &&
+                                       workingDate.getFullYear()       == todayYear) {
                                        cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;
                                }
                                
-                               this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]; // Add this date to cellDates
-                                                       
-                               if (this.isDateOOM(workingDate)) {
+                               var workingArray = [workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];
+                               this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates
+                               
+                               // Local OOM check for performance, since we already have pagedate
+                               if (workingDate.getMonth() != useDate.getMonth()) {
                                        cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
                                } else {
-
-                                       YAHOO.util.Dom.addClass(cell, "wd" + workingDate.getDay());
-                                       YAHOO.util.Dom.addClass(cell, "d" + workingDate.getDate());
+                                       YAHOO.util.Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
+                                       YAHOO.util.Dom.addClass(cell, dayPrefix + workingDate.getDate());
                                
                                        for (var s=0;s<this.renderStack.length;++s) {
 
@@ -2132,22 +2573,11 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
 
                                }
 
-                               if (this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]) > -1) {
+                               if (this._indexOfSelectedFieldArray(workingArray) > -1) {
                                        cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected; 
                                }
 
-                               var mindate = this.cfg.getProperty("mindate");
-                               var maxdate = this.cfg.getProperty("maxdate");
-
-                               if (mindate) {
-                                       mindate = YAHOO.widget.DateMath.clearTime(mindate);
-                               }
-                               if (maxdate) {
-                                       maxdate = YAHOO.widget.DateMath.clearTime(maxdate);
-                               }
-
-                               if (
-                                       (mindate && (workingDate.getTime() < mindate.getTime())) ||
+                               if ((mindate && (workingDate.getTime() < mindate.getTime())) ||
                                        (maxdate && (workingDate.getTime() > maxdate.getTime()))
                                ) {
                                        cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;
@@ -2155,14 +2585,10 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
                                        cellRenderers[cellRenderers.length]=cal.styleCellDefault;
                                        cellRenderers[cellRenderers.length]=cal.renderCellDefault;      
                                }
-
                                
-                               
-                               for (var x=0;x<cellRenderers.length;++x) {
-                                       var ren = cellRenderers[x];
+                               for (var x=0; x < cellRenderers.length; ++x) {
                                        this.logger.log("renderer[" + x + "] for (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender");
-
-                                       if (ren.call((this.parent || this),workingDate,cell) == YAHOO.widget.Calendar.STOP_RENDER) {
+                                       if (cellRenderers[x].call(cal, workingDate, cell) == YAHOO.widget.Calendar.STOP_RENDER) {
                                                break;
                                        }
                                }
@@ -2180,7 +2606,7 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
                                }
                                
                                var postDays = this.postMonthDays; 
-                               if (postDays >= 7 && this.cfg.getProperty("HIDE_BLANK_WEEKS")) {
+                               if (hideBlankWeeks && postDays >= 7) {
                                        var blankWeeks = Math.floor(postDays/7);
                                        for (var p=0;p<blankWeeks;++p) {
                                                postDays -= 7;
@@ -2192,11 +2618,10 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
                                }
 
                                html[html.length] = tempDiv.innerHTML;
-                               
                                i++;
                        }
 
-                       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) { html = this.renderRowFooter(weekNum, html); }
+                       if (showWeekFooter) { html = this.renderRowFooter(weekNum, html); }
 
                        html[html.length] = '</tr>';
                }
@@ -2226,14 +2651,16 @@ YAHOO.widget.Calendar.prototype.renderFooter = function(html) { return html; };
 YAHOO.widget.Calendar.prototype.render = function() {
        this.beforeRenderEvent.fire();
 
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+
        // Find starting day of the current month
-       var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty("pagedate"));
+       var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(defCfg.PAGEDATE.key));
 
        this.resetRenderers();
        this.cellDates.length = 0;
-       
+
        YAHOO.util.Event.purgeElement(this.oDomContainer, true);
-       
+
        var html = [];
 
        html[html.length] = '<table cellSpacing="0" class="' + this.Style.CSS_CALENDAR + ' y' + workingDate.getFullYear() + '" id="' + this.id + '">';
@@ -2243,13 +2670,13 @@ YAHOO.widget.Calendar.prototype.render = function() {
        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.cfg.refireEvent(defCfg.TITLE.key);
+       this.cfg.refireEvent(defCfg.CLOSE.key);
+       this.cfg.refireEvent(defCfg.IFRAME.key);
 
        this.renderEvent.fire();
 };
@@ -2262,28 +2689,29 @@ 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);
+       var anchor = "a";
+       var mousedown = "mousedown";
+
+       var linkLeft = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, anchor, root);
+       var linkRight = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, anchor, root);
 
-       if (linkLeft) {
+       if (linkLeft && linkLeft.length > 0) {
                this.linkLeft = linkLeft[0];
-               YAHOO.util.Event.addListener(this.linkLeft, "mousedown", cal.previousMonth, cal, true);
+               YAHOO.util.Event.addListener(this.linkLeft, mousedown, cal.previousMonth, cal, true);
        }
 
-       if (linkRight) {
+       if (linkRight && linkRight.length > 0) {
                this.linkRight = linkRight[0];
-               YAHOO.util.Event.addListener(this.linkRight, "mousedown", cal.nextMonth, cal, true);
+               YAHOO.util.Event.addListener(this.linkRight, mousedown, cal.nextMonth, cal, true);
        }
 
        if (this.domEventMap) {
                var el,elements;
                for (var cls in this.domEventMap) {     
-                       if (this.domEventMap.hasOwnProperty(cls)) {
+                       if (YAHOO.lang.hasOwnProperty(this.domEventMap, cls)) {
                                var items = this.domEventMap[cls];
-                               
+
                                if (! (items instanceof Array)) {
                                        items = [items];
                                }
@@ -2328,7 +2756,7 @@ YAHOO.widget.Calendar.prototype.getDateFieldsByCellId = function(id) {
        id = parseInt(id, 10);
        return this.cellDates[id];
 };
-                                                                                                 
+
 // BEGIN BUILT-IN TABLE CELL RENDERERS
 
 /**
@@ -2378,7 +2806,7 @@ YAHOO.widget.Calendar.prototype.renderRowFooter = function(weekNum, html) {
 * @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
 */
 YAHOO.widget.Calendar.prototype.renderCellDefault = function(workingDate, cell) {
-       cell.innerHTML = '<a href="javascript:void(null);" >' + this.buildDayLabel(workingDate) + "</a>";
+       cell.innerHTML = '<a href="#" class="' + this.Style.CSS_CELL_SELECTOR + '">' + this.buildDayLabel(workingDate) + "</a>";
 };
 
 /**
@@ -2496,7 +2924,8 @@ YAHOO.widget.Calendar.prototype.renderBodyCellRestricted = function(workingDate,
 * @param {Number}      count   The number of months to add to the current calendar
 */
 YAHOO.widget.Calendar.prototype.addMonths = function(count) {
-       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.MONTH, count));
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
        this.resetRenderers();
        this.changePageEvent.fire();
 };
@@ -2508,7 +2937,8 @@ YAHOO.widget.Calendar.prototype.addMonths = function(count) {
 * @param {Number}      count   The number of months to subtract from the current calendar
 */
 YAHOO.widget.Calendar.prototype.subtractMonths = function(count) {
-       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.MONTH, count));
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
        this.resetRenderers();
        this.changePageEvent.fire();
 };
@@ -2520,7 +2950,8 @@ YAHOO.widget.Calendar.prototype.subtractMonths = function(count) {
 * @param {Number}      count   The number of years to add to the current calendar
 */
 YAHOO.widget.Calendar.prototype.addYears = function(count) {
-       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.YEAR, count));
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
        this.resetRenderers();
        this.changePageEvent.fire();
 };
@@ -2532,7 +2963,8 @@ YAHOO.widget.Calendar.prototype.addYears = function(count) {
 * @param {Number}      count   The number of years to subtract from the current calendar
 */
 YAHOO.widget.Calendar.prototype.subtractYears = function(count) {
-       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.YEAR, count));
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
        this.resetRenderers();
        this.changePageEvent.fire();
 };
@@ -2579,8 +3011,9 @@ YAHOO.widget.Calendar.prototype.previousYear = function() {
 * @method reset
 */
 YAHOO.widget.Calendar.prototype.reset = function() {
-       this.cfg.resetProperty("selected");
-       this.cfg.resetProperty("pagedate");
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       this.cfg.resetProperty(defCfg.SELECTED.key);
+       this.cfg.resetProperty(defCfg.PAGEDATE.key);
        this.resetEvent.fire();
 };
 
@@ -2590,8 +3023,9 @@ YAHOO.widget.Calendar.prototype.reset = function() {
 * @method clear
 */
 YAHOO.widget.Calendar.prototype.clear = function() {
-       this.cfg.setProperty("selected", []);
-       this.cfg.setProperty("pagedate", new Date(this.today.getTime()));
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       this.cfg.setProperty(defCfg.SELECTED.key, []);
+       this.cfg.setProperty(defCfg.PAGEDATE.key, new Date(this.today.getTime()));
        this.clearEvent.fire();
 };
 
@@ -2599,6 +3033,12 @@ YAHOO.widget.Calendar.prototype.clear = function() {
 * Selects a date or a collection of dates on the current calendar. This method, by default,
 * does not call the render method explicitly. Once selection has completed, render must be 
 * called for the changes to be reflected visually.
+*
+* Any dates which are OOB (out of bounds, not selectable) will not be selected and the array of 
+* selected dates passed to the selectEvent will not contain OOB dates.
+* 
+* If all dates are OOB, the no state change will occur; beforeSelect and select events will not be fired.
+*
 * @method select
 * @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are
 *                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
@@ -2609,27 +3049,43 @@ YAHOO.widget.Calendar.prototype.clear = function() {
 YAHOO.widget.Calendar.prototype.select = function(date) {
        this.logger.log("Select: " + date, "info");
 
-       this.beforeSelectEvent.fire();
-
-       var selected = this.cfg.getProperty("selected");
        var aToBeSelected = this._toFieldArray(date);
        this.logger.log("Selection field array: " + aToBeSelected, "info");
 
-       for (var a=0;a<aToBeSelected.length;++a) {
-               var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select
-               if (this._indexOfSelectedFieldArray(toSelect) == -1) { // not already selected?
-                       selected[selected.length]=toSelect;
+       // Filtered array of valid dates
+       var validDates = [];
+       var selected = [];
+       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+       
+       for (var a=0; a < aToBeSelected.length; ++a) {
+               var toSelect = aToBeSelected[a];
+
+               if (!this.isDateOOB(this._toDate(toSelect))) {
+                       
+                       if (validDates.length === 0) {
+                               this.beforeSelectEvent.fire();
+                               selected = this.cfg.getProperty(cfgSelected);
+                       }
+
+                       validDates.push(toSelect);
+                       
+                       if (this._indexOfSelectedFieldArray(toSelect) == -1) { 
+                               selected[selected.length] = toSelect;
+                       }
                }
        }
        
-       if (this.parent) {
-               this.parent.cfg.setProperty("selected", selected);
-       } else {
-               this.cfg.setProperty("selected", selected);
+       if (validDates.length === 0) { this.logger.log("All provided dates were OOB. beforeSelect and select events not fired", "info"); }
+
+       if (validDates.length > 0) {
+               if (this.parent) {
+                       this.parent.cfg.setProperty(cfgSelected, selected);
+               } else {
+                       this.cfg.setProperty(cfgSelected, selected);
+               }
+               this.selectEvent.fire(validDates);
        }
 
-       this.selectEvent.fire(aToBeSelected);
-       
        return this.getSelectedDates();
 };
 
@@ -2637,36 +3093,46 @@ YAHOO.widget.Calendar.prototype.select = function(date) {
 * Selects a date on the current calendar by referencing the index of the cell that should be selected.
 * This method is used to easily select a single cell (usually with a mouse click) without having to do
 * a full render. The selected style is applied to the cell directly.
+*
+* If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
+* or out of bounds cells), it will not be selected and in such a case beforeSelect and select events will not be fired.
+* 
 * @method selectCell
 * @param       {Number}        cellIndex       The index of the cell to select in the current calendar. 
 * @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
 */
 YAHOO.widget.Calendar.prototype.selectCell = function(cellIndex) {
-       this.beforeSelectEvent.fire();
-
-       var selected = this.cfg.getProperty("selected");
 
        var cell = this.cells[cellIndex];
        var cellDate = this.cellDates[cellIndex];
-
        var dCellDate = this._toDate(cellDate);
        this.logger.log("Select: " + dCellDate, "info");
+       
+       var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
+       if (!selectable) {this.logger.log("The cell at cellIndex:" + cellIndex + " is not a selectable cell. beforeSelect, select events not fired", "info"); }
 
-       var selectDate = cellDate.concat();
+       if (selectable) {
 
-       selected[selected.length] = selectDate;
+               this.beforeSelectEvent.fire();
 
-       if (this.parent) {
-               this.parent.cfg.setProperty("selected", selected);
-       } else {
-               this.cfg.setProperty("selected", selected);
-       }
+               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+               var selected = this.cfg.getProperty(cfgSelected);
 
-       this.renderCellStyleSelected(dCellDate,cell);
+               var selectDate = cellDate.concat();
 
-       this.selectEvent.fire([selectDate]);
+               if (this._indexOfSelectedFieldArray(selectDate) == -1) {
+                       selected[selected.length] = selectDate;
+               }
+               if (this.parent) {
+                       this.parent.cfg.setProperty(cfgSelected, selected);
+               } else {
+                       this.cfg.setProperty(cfgSelected, selected);
+               }
+               this.renderCellStyleSelected(dCellDate,cell);
+               this.selectEvent.fire([selectDate]);
 
-       this.doCellMouseOut.call(cell, null, this);
+               this.doCellMouseOut.call(cell, null, this);             
+       }
 
        return this.getSelectedDates();
 };
@@ -2675,6 +3141,12 @@ YAHOO.widget.Calendar.prototype.selectCell = function(cellIndex) {
 * Deselects a date or a collection of dates on the current calendar. This method, by default,
 * does not call the render method explicitly. Once deselection has completed, render must be 
 * called for the changes to be reflected visually.
+* 
+* The method will not attempt to deselect any dates which are OOB (out of bounds, and hence not selectable) 
+* and the array of deselected dates passed to the deselectEvent will not contain any OOB dates.
+* 
+* If all dates are OOB, beforeDeselect and deselect events will not be fired.
+* 
 * @method deselect
 * @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
 *                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
@@ -2683,29 +3155,45 @@ YAHOO.widget.Calendar.prototype.selectCell = function(cellIndex) {
 * @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
 */
 YAHOO.widget.Calendar.prototype.deselect = function(date) {
-       this.beforeDeselectEvent.fire();
+       this.logger.log("Deselect: " + date, "info");
 
-       var selected = this.cfg.getProperty("selected");
+       var aToBeDeselected = this._toFieldArray(date);
+       this.logger.log("Deselection field array: " + aToBeDeselected, "info");
 
-       var aToBeSelected = this._toFieldArray(date);
+       var validDates = [];
+       var selected = [];
+       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
 
-       for (var a=0;a<aToBeSelected.length;++a) {
-               var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select
-               var index = this._indexOfSelectedFieldArray(toSelect);
-       
-               if (index != -1) {      
-                       selected.splice(index,1);
+       for (var a=0; a < aToBeDeselected.length; ++a) {
+               var toDeselect = aToBeDeselected[a];
+
+               if (!this.isDateOOB(this._toDate(toDeselect))) {
+
+                       if (validDates.length === 0) {
+                               this.beforeDeselectEvent.fire();
+                               selected = this.cfg.getProperty(cfgSelected);
+                       }
+
+                       validDates.push(toDeselect);
+
+                       var index = this._indexOfSelectedFieldArray(toDeselect);
+                       if (index != -1) {      
+                               selected.splice(index,1);
+                       }
                }
        }
 
-       if (this.parent) {
-               this.parent.cfg.setProperty("selected", selected);
-       } else {
-               this.cfg.setProperty("selected", selected);
+       if (validDates.length === 0) { this.logger.log("All provided dates were OOB. beforeDeselect and deselect events not fired");}
+
+       if (validDates.length > 0) {
+               if (this.parent) {
+                       this.parent.cfg.setProperty(cfgSelected, selected);
+               } else {
+                       this.cfg.setProperty(cfgSelected, selected);
+               }
+               this.deselectEvent.fire(validDates);
        }
 
-       this.deselectEvent.fire(aToBeSelected);
-       
        return this.getSelectedDates();
 };
 
@@ -2713,40 +3201,50 @@ YAHOO.widget.Calendar.prototype.deselect = function(date) {
 * Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
 * This method is used to easily deselect a single cell (usually with a mouse click) without having to do
 * a full render. The selected style is removed from the cell directly.
+* 
+* If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
+* or out of bounds cells), the method will not attempt to deselect it and in such a case, beforeDeselect and 
+* deselect events will not be fired.
+* 
 * @method deselectCell
 * @param       {Number}        cellIndex       The index of the cell to deselect in the current calendar. 
 * @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
 */
-YAHOO.widget.Calendar.prototype.deselectCell = function(i) {
-       this.beforeDeselectEvent.fire();
+YAHOO.widget.Calendar.prototype.deselectCell = function(cellIndex) {
+       var cell = this.cells[cellIndex];
+       var cellDate = this.cellDates[cellIndex];
+       var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);
        
-       var selected = this.cfg.getProperty("selected");
+       var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
+       if (!selectable) { this.logger.log("The cell at cellIndex:" + cellIndex + " is not a selectable/deselectable cell", "info"); }
 
-       var cell = this.cells[i];
-       var cellDate = this.cellDates[i];
-       var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);
+       if (selectable) {
 
-       var dCellDate = this._toDate(cellDate);
+               this.beforeDeselectEvent.fire();
 
-       var selectDate = cellDate.concat();
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               var selected = this.cfg.getProperty(defCfg.SELECTED.key);
 
-       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);
-               }
+               var dCellDate = this._toDate(cellDate);
+               var selectDate = cellDate.concat();
 
-               selected.splice(cellDateIndex, 1);
-       }
+               if (cellDateIndex > -1) {
+                       if (this.cfg.getProperty(defCfg.PAGEDATE.key).getMonth() == dCellDate.getMonth() &&
+                               this.cfg.getProperty(defCfg.PAGEDATE.key).getFullYear() == dCellDate.getFullYear()) {
+                               YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);
+                       }
+                       selected.splice(cellDateIndex, 1);
+               }
 
+               if (this.parent) {
+                       this.parent.cfg.setProperty(defCfg.SELECTED.key, selected);
+               } else {
+                       this.cfg.setProperty(defCfg.SELECTED.key, selected);
+               }
 
-       if (this.parent) {
-               this.parent.cfg.setProperty("selected", selected);
-       } else {
-               this.cfg.setProperty("selected", selected);
+               this.deselectEvent.fire(selectDate);
        }
-       
-       this.deselectEvent.fire(selectDate);
+
        return this.getSelectedDates();
 };
 
@@ -2760,15 +3258,17 @@ YAHOO.widget.Calendar.prototype.deselectCell = function(i) {
 */
 YAHOO.widget.Calendar.prototype.deselectAll = function() {
        this.beforeDeselectEvent.fire();
+       
+       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
 
-       var selected = this.cfg.getProperty("selected");
+       var selected = this.cfg.getProperty(cfgSelected);
        var count = selected.length;
        var sel = selected.concat();
 
        if (this.parent) {
-               this.parent.cfg.setProperty("selected", []);
+               this.parent.cfg.setProperty(cfgSelected, []);
        } else {
-               this.cfg.setProperty("selected", []);
+               this.cfg.setProperty(cfgSelected, []);
        }
        
        if (count > 0) {
@@ -2798,9 +3298,9 @@ YAHOO.widget.Calendar.prototype._toFieldArray = function(date) {
 
        if (date instanceof Date) {
                returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];
-       } else if (typeof date == 'string') {
+       } else if (YAHOO.lang.isString(date)) {
                returnDate = this._parseDates(date);
-       } else if (date instanceof Array) {
+       } else if (YAHOO.lang.isArray(date)) {
                for (var i=0;i<date.length;++i) {
                        var d = date[i];
                        returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];
@@ -2857,7 +3357,7 @@ YAHOO.widget.Calendar.prototype._fieldArraysAreEqual = function(array1, array2)
 */
 YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray = function(find) {
        var selected = -1;
-       var seldates = this.cfg.getProperty("selected");
+       var seldates = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
 
        for (var s=0;s<seldates.length;++s) {
                var sArray = seldates[s];
@@ -2877,11 +3377,64 @@ YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray = function(find) {
 * @return      {Boolean}       true if the date is OOM
 */
 YAHOO.widget.Calendar.prototype.isDateOOM = function(date) {
-       var isOOM = false;
-       if (date.getMonth() != this.cfg.getProperty("pagedate").getMonth()) {
-               isOOM = true;
+       return (date.getMonth() != this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());
+};
+
+/**
+* Determines whether a given date is OOB (out of bounds - less than the mindate or more than the maxdate).
+*
+* @method      isDateOOB
+* @param       {Date}  date    The JavaScript Date object for which to check the OOB status
+* @return      {Boolean}       true if the date is OOB
+*/
+YAHOO.widget.Calendar.prototype.isDateOOB = function(date) {
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+       var minDate = this.cfg.getProperty(defCfg.MINDATE.key);
+       var maxDate = this.cfg.getProperty(defCfg.MAXDATE.key);
+       var dm = YAHOO.widget.DateMath;
+       
+       if (minDate) {
+               minDate = dm.clearTime(minDate);
+       } 
+       if (maxDate) {
+               maxDate = dm.clearTime(maxDate);
+       }
+
+       var clearedDate = new Date(date.getTime());
+       clearedDate = dm.clearTime(clearedDate);
+
+       return ((minDate && clearedDate.getTime() < minDate.getTime()) || (maxDate && clearedDate.getTime() > maxDate.getTime()));
+};
+
+/**
+ * Parses a pagedate configuration property value. The value can either be specified as a string of form "mm/yyyy" or a Date object 
+ * and is parsed into a Date object normalized to the first day of the month. If no value is passed in, the month and year from today's date are used to create the Date object 
+ * @method     _parsePageDate
+ * @private
+ * @param {Date|String}        date    Pagedate value which needs to be parsed
+ * @return {Date}      The Date object representing the pagedate
+ */
+YAHOO.widget.Calendar.prototype._parsePageDate = function(date) {
+       var parsedDate;
+       
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+
+       if (date) {
+               if (date instanceof Date) {
+                       parsedDate = YAHOO.widget.DateMath.findMonthStart(date);
+               } else {
+                       var month, year, aMonthYear;
+                       aMonthYear = date.split(this.cfg.getProperty(defCfg.DATE_FIELD_DELIMITER.key));
+                       month = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_MONTH_POSITION.key)-1], 10)-1;
+                       year = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_YEAR_POSITION.key)-1], 10);
+                       
+                       parsedDate = new Date(year, month, 1);
+               }
+       } else {
+               parsedDate = new Date(this.today.getFullYear(), this.today.getMonth(), 1);
        }
-       return isOOM;
+       return parsedDate;
 };
 
 // END UTILITY METHODS
@@ -2893,7 +3446,7 @@ YAHOO.widget.Calendar.prototype.isDateOOM = function(date) {
 * @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.
 */
 YAHOO.widget.Calendar.prototype.onBeforeSelect = function() {
-       if (this.cfg.getProperty("MULTI_SELECT") === false) {
+       if (this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key) === false) {
                if (this.parent) {
                        this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED);
                        this.parent.deselectAll();
@@ -3154,9 +3707,10 @@ YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles = function(style) {
 * @param {Number}      month           The numeric month, from 0 (January) to 11 (December)
 */
 YAHOO.widget.Calendar.prototype.setMonth = function(month) {
-       var current = this.cfg.getProperty("pagedate");
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       var current = this.cfg.getProperty(cfgPageDate);
        current.setMonth(parseInt(month, 10));
-       this.cfg.setProperty("pagedate", current);
+       this.cfg.setProperty(cfgPageDate, current);
 };
 
 /**
@@ -3165,9 +3719,10 @@ YAHOO.widget.Calendar.prototype.setMonth = function(month) {
 * @param {Number}      year            The numeric 4-digit year
 */
 YAHOO.widget.Calendar.prototype.setYear = function(year) {
-       var current = this.cfg.getProperty("pagedate");
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       var current = this.cfg.getProperty(cfgPageDate);
        current.setFullYear(parseInt(year, 10));
-       this.cfg.setProperty("pagedate", current);
+       this.cfg.setProperty(cfgPageDate, current);
 };
 
 /**
@@ -3177,7 +3732,7 @@ YAHOO.widget.Calendar.prototype.setYear = function(year) {
 */
 YAHOO.widget.Calendar.prototype.getSelectedDates = function() {
        var returnDates = [];
-       var selected = this.cfg.getProperty("selected");
+       var selected = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
 
        for (var d=0;d<selected.length;++d) {
                var dateArray = selected[d];
@@ -3210,6 +3765,8 @@ YAHOO.widget.Calendar.prototype.show = function() {
 
 /**
 * Returns a string representing the current browser.
+* @deprecated As of 2.3.0, environment information is available in YAHOO.env.ua
+* @see YAHOO.env.ua
 * @property browser
 * @type String
 */
@@ -3284,7 +3841,6 @@ YAHOO.widget.CalendarGroup = function(id, containerId, config) {
 */
 YAHOO.widget.CalendarGroup.prototype.init = function(id, containerId, config) {
        this.logger = new YAHOO.widget.LogWriter("CalendarGroup " + id);
-
        this.initEvents();
        this.initStyles();
 
@@ -3349,33 +3905,24 @@ YAHOO.widget.CalendarGroup.prototype.init = function(id, containerId, config) {
        this.cfg.fireQueue();
 
        // OPERA HACK FOR MISWRAPPED FLOATS
-       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;
-                       }
-                       if (w > 0) {
-                               this.oDomContainer.style.width = w + "px";
-                       }
-               };
-               this.renderEvent.subscribe(fixWidth,this,true);
+       if (YAHOO.env.ua.opera){
+               this.renderEvent.subscribe(this._fixWidth, this, true);
        }
-       
-       this.logger.log("Initialized " + pageCount + "-page CalendarGroup", "info");
+       this.logger.log("Initialized " + this.pages.length + "-page CalendarGroup", "info");
 };
 
 
 YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
+       
+       var defCfg = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;
+       
        /**
        * The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments.
        * @config pages
        * @type Number
        * @default 2
        */
-       this.cfg.addProperty("pages", { value:2, validator:this.cfg.checkNumber, handler:this.configPages } );
+       this.cfg.addProperty(defCfg.PAGES.key, { value:defCfg.PAGES.value, validator:this.cfg.checkNumber, handler:this.configPages } );
 
        /**
        * The month/year representing the current visible Calendar date (mm/yyyy)
@@ -3383,7 +3930,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default today's date
        */
-       this.cfg.addProperty("pagedate", { value:new Date(), handler:this.configPageDate } );
+       this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
 
        /**
        * The date or range of dates representing the current Calendar selection
@@ -3391,7 +3938,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default []
        */
-       this.cfg.addProperty("selected", { value:[], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
 
        /**
        * The title to display above the CalendarGroup's month header
@@ -3399,7 +3946,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default ""
        */
-       this.cfg.addProperty("title", { value:"", handler:this.configTitle } );
+       this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
 
        /**
        * Whether or not a close button should be displayed for this CalendarGroup
@@ -3407,15 +3954,18 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("close", { value:false, handler:this.configClose } );
+       this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
 
        /**
        * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
+       * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
+       * enabled if required.
+       * 
        * @config iframe
        * @type Boolean
-       * @default true
+       * @default true for IE6 and below, false for all other browsers
        */
-       this.cfg.addProperty("iframe", { value:true, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
 
        /**
        * The minimum selectable date in the current Calendar (mm/dd/yyyy)
@@ -3423,7 +3973,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default null
        */
-       this.cfg.addProperty("mindate", { value:null, handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.delegateConfig } );
 
        /**
        * The maximum selectable date in the current Calendar (mm/dd/yyyy)
@@ -3431,7 +3981,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default null
        */      
-       this.cfg.addProperty("maxdate", { value:null, handler:this.delegateConfig  } );
+       this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.delegateConfig  } );
 
        // Options properties
 
@@ -3441,7 +3991,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("MULTI_SELECT",    { value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
 
        /**
        * The weekday the week begins on. Default is 0 (Sunday).
@@ -3449,7 +3999,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type number
        * @default 0
        */      
-       this.cfg.addProperty("START_WEEKDAY",   { value:0, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );
+       this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );
        
        /**
        * True if the Calendar should show weekday labels. True by default.
@@ -3457,7 +4007,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default true
        */      
-       this.cfg.addProperty("SHOW_WEEKDAYS",   { value:true, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
        
        /**
        * True if the Calendar should show week row headers. False by default.
@@ -3465,7 +4015,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */      
-       this.cfg.addProperty("SHOW_WEEK_HEADER",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{ value:defCfg.SHOW_WEEK_HEADER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
        
        /**
        * True if the Calendar should show week row footers. False by default.
@@ -3473,7 +4023,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("SHOW_WEEK_FOOTER",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
        
        /**
        * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
@@ -3481,23 +4031,25 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */              
-       this.cfg.addProperty("HIDE_BLANK_WEEKS",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{ value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
        
        /**
        * The image that should be used for the left navigation arrow.
        * @config NAV_ARROW_LEFT
        * @type String
-       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif"
+       * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"
+       * @default null
        */              
-       this.cfg.addProperty("NAV_ARROW_LEFT",  { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.delegateConfig } );
        
        /**
-       * The image that should be used for the left navigation arrow.
+       * The image that should be used for the right navigation arrow.
        * @config NAV_ARROW_RIGHT
        * @type String
-       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif"
+       * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
+       * @default null
        */              
-       this.cfg.addProperty("NAV_ARROW_RIGHT", { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,        { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.delegateConfig } );
 
        // Locale properties
        
@@ -3507,7 +4059,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
        */
-       this.cfg.addProperty("MONTHS_SHORT",    { value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.delegateConfig } );
        
        /**
        * The long month labels for the current locale.
@@ -3515,7 +4067,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
        */              
-       this.cfg.addProperty("MONTHS_LONG",             { value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.delegateConfig } );
        
        /**
        * The 1-character weekday labels for the current locale.
@@ -3523,7 +4075,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["S", "M", "T", "W", "T", "F", "S"]
        */              
-       this.cfg.addProperty("WEEKDAYS_1CHAR",  { value:["S", "M", "T", "W", "T", "F", "S"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.delegateConfig } );
        
        /**
        * The short weekday labels for the current locale.
@@ -3531,7 +4083,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
        */              
-       this.cfg.addProperty("WEEKDAYS_SHORT",  { value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.delegateConfig } );
        
        /**
        * The medium weekday labels for the current locale.
@@ -3539,7 +4091,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
        */              
-       this.cfg.addProperty("WEEKDAYS_MEDIUM", { value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.delegateConfig } );
        
        /**
        * The long weekday labels for the current locale.
@@ -3547,7 +4099,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
        */              
-       this.cfg.addProperty("WEEKDAYS_LONG",   { value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.delegateConfig } );
 
        /**
        * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
@@ -3555,7 +4107,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default "long"
        */
-       this.cfg.addProperty("LOCALE_MONTHS",   { value:"long", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.delegateConfig } );
 
        /**
        * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
@@ -3563,7 +4115,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default "short"
        */      
-       this.cfg.addProperty("LOCALE_WEEKDAYS", { value:"short", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.delegateConfig } );
 
        /**
        * The value used to delimit individual dates in a date string passed to various Calendar functions.
@@ -3571,7 +4123,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default ","
        */
-       this.cfg.addProperty("DATE_DELIMITER",          { value:",", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.delegateConfig } );
 
        /**
        * The value used to delimit date fields in a date string passed to various Calendar functions.
@@ -3579,7 +4131,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default "/"
        */      
-       this.cfg.addProperty("DATE_FIELD_DELIMITER",{ value:"/", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{ value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.delegateConfig } );
 
        /**
        * The value used to delimit date ranges in a date string passed to various Calendar functions.
@@ -3587,7 +4139,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default "-"
        */
-       this.cfg.addProperty("DATE_RANGE_DELIMITER",{ value:"-", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{ value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.delegateConfig } );
 
        /**
        * The position of the month in a month/year date string
@@ -3595,7 +4147,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */
-       this.cfg.addProperty("MY_MONTH_POSITION",       { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the year in a month/year date string
@@ -3603,7 +4155,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */      
-       this.cfg.addProperty("MY_YEAR_POSITION",        { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the month in a month/day date string
@@ -3611,7 +4163,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */      
-       this.cfg.addProperty("MD_MONTH_POSITION",       { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the day in a month/year date string
@@ -3619,7 +4171,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */      
-       this.cfg.addProperty("MD_DAY_POSITION",         { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the month in a month/day/year date string
@@ -3627,7 +4179,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */      
-       this.cfg.addProperty("MDY_MONTH_POSITION",      { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the day in a month/day/year date string
@@ -3635,7 +4187,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */      
-       this.cfg.addProperty("MDY_DAY_POSITION",        { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the year in a month/day/year date string
@@ -3643,8 +4195,39 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 3
        */      
-       this.cfg.addProperty("MDY_YEAR_POSITION",       { value:3, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
 
+       /**
+       * The position of the month in the month year label string used as the Calendar header
+       * @config MY_LABEL_MONTH_POSITION
+       * @type Number
+       * @default 1
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+
+       /**
+       * The position of the year in the month year label string used as the Calendar header
+       * @config MY_LABEL_YEAR_POSITION
+       * @type Number
+       * @default 2
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       
+       /**
+       * The suffix used after the month when rendering the Calendar header
+       * @config MY_LABEL_MONTH_SUFFIX
+       * @type String
+       * @default " "
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.delegateConfig } );
+       
+       /**
+       * The suffix used after the year when rendering the Calendar header
+       * @config MY_LABEL_YEAR_SUFFIX
+       * @type String
+       * @default ""
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.delegateConfig } );
 };
 
 /**
@@ -3653,6 +4236,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
 */
 YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
        var me = this;
+       var strEvent = "Event";
 
        /**
        * Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents
@@ -3665,7 +4249,7 @@ YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
        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);
+                       cal[this.type + strEvent].subscribe(fn, obj, bOverride);
                }
        };
 
@@ -3679,15 +4263,17 @@ YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
        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);
+                       cal[this.type + strEvent].unsubscribe(fn, obj);
                }
        };
+       
+       var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
 
        /**
        * Fired before a selection is made
        * @event beforeSelectEvent
        */
-       this.beforeSelectEvent = new YAHOO.util.CustomEvent("beforeSelect");
+       this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);
        this.beforeSelectEvent.subscribe = sub; this.beforeSelectEvent.unsubscribe = unsub;
 
        /**
@@ -3695,14 +4281,14 @@ YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
        * @event selectEvent
        * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
        */
-       this.selectEvent = new YAHOO.util.CustomEvent("select"); 
+       this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT); 
        this.selectEvent.subscribe = sub; this.selectEvent.unsubscribe = unsub;
 
        /**
        * Fired before a selection is made
        * @event beforeDeselectEvent
        */
-       this.beforeDeselectEvent = new YAHOO.util.CustomEvent("beforeDeselect"); 
+       this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT); 
        this.beforeDeselectEvent.subscribe = sub; this.beforeDeselectEvent.unsubscribe = unsub;
 
        /**
@@ -3710,42 +4296,42 @@ YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
        * @event deselectEvent
        * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
        */
-       this.deselectEvent = new YAHOO.util.CustomEvent("deselect"); 
+       this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT); 
        this.deselectEvent.subscribe = sub; this.deselectEvent.unsubscribe = unsub;
        
        /**
        * Fired when the Calendar page is changed
        * @event changePageEvent
        */
-       this.changePageEvent = new YAHOO.util.CustomEvent("changePage"); 
+       this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE); 
        this.changePageEvent.subscribe = sub; this.changePageEvent.unsubscribe = unsub;
 
        /**
        * Fired before the Calendar is rendered
        * @event beforeRenderEvent
        */
-       this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");
+       this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
        this.beforeRenderEvent.subscribe = sub; this.beforeRenderEvent.unsubscribe = unsub;
 
        /**
        * Fired when the Calendar is rendered
        * @event renderEvent
        */
-       this.renderEvent = new YAHOO.util.CustomEvent("render");
+       this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
        this.renderEvent.subscribe = sub; this.renderEvent.unsubscribe = unsub;
 
        /**
        * Fired when the Calendar is reset
        * @event resetEvent
        */
-       this.resetEvent = new YAHOO.util.CustomEvent("reset"); 
+       this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET); 
        this.resetEvent.subscribe = sub; this.resetEvent.unsubscribe = unsub;
 
        /**
        * Fired when the Calendar is cleared
        * @event clearEvent
        */
-       this.clearEvent = new YAHOO.util.CustomEvent("clear");
+       this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
        this.clearEvent.subscribe = sub; this.clearEvent.unsubscribe = unsub;
 
 };
@@ -3760,30 +4346,39 @@ YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
 YAHOO.widget.CalendarGroup.prototype.configPages = function(type, args, obj) {
        var pageCount = args[0];
 
+       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+
+       // Define literals outside loop 
+       var sep = "_";
+       var groupCalClass = "groupcal";
+
+       var firstClass = "first-of-type";
+       var lastClass = "last-of-type";
+
        for (var p=0;p<pageCount;++p) {
-               var calId = this.id + "_" + p;
-               var calContainerId = this.containerId + "_" + p;
+               var calId = this.id + sep + p;
+               var calContainerId = this.containerId + sep + p;
 
                var childConfig = this.cfg.getConfig();
                childConfig.close = false;
                childConfig.title = false;
 
                var cal = this.constructChild(calId, calContainerId, childConfig);
-               var caldate = cal.cfg.getProperty("pagedate");
-               caldate.setMonth(caldate.getMonth()+p);
-               cal.cfg.setProperty("pagedate", caldate);
-               
+               var caldate = cal.cfg.getProperty(cfgPageDate);
+               this._setMonthOnDate(caldate, caldate.getMonth() + p);
+               cal.cfg.setProperty(cfgPageDate, caldate);
+
                YAHOO.util.Dom.removeClass(cal.oDomContainer, this.Style.CSS_SINGLE);
-               YAHOO.util.Dom.addClass(cal.oDomContainer, "groupcal");
-               
+               YAHOO.util.Dom.addClass(cal.oDomContainer, groupCalClass);
+
                if (p===0) {
-                       YAHOO.util.Dom.addClass(cal.oDomContainer, "first");
+                       YAHOO.util.Dom.addClass(cal.oDomContainer, firstClass);
                }
 
                if (p==(pageCount-1)) {
-                       YAHOO.util.Dom.addClass(cal.oDomContainer, "last");
+                       YAHOO.util.Dom.addClass(cal.oDomContainer, lastClass);
                }
-               
+
                cal.parent = this;
                cal.index = p; 
 
@@ -3800,15 +4395,38 @@ YAHOO.widget.CalendarGroup.prototype.configPages = function(type, args, obj) {
 */
 YAHOO.widget.CalendarGroup.prototype.configPageDate = function(type, args, obj) {
        var val = args[0];
-
+       var firstPageDate;
+       
+       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+       
        for (var p=0;p<this.pages.length;++p) {
                var cal = this.pages[p];
-               cal.cfg.setProperty("pagedate", val);
-               var calDate = cal.cfg.getProperty("pagedate");
-               calDate.setMonth(calDate.getMonth()+p);
+               if (p === 0) {
+                       firstPageDate = cal._parsePageDate(val);
+                       cal.cfg.setProperty(cfgPageDate, firstPageDate);
+               } else {
+                       var pageDate = new Date(firstPageDate);
+                       this._setMonthOnDate(pageDate, pageDate.getMonth() + p);
+                       cal.cfg.setProperty(cfgPageDate, pageDate);
+               }
        }
 };
 
+/**
+* The default Config handler for the CalendarGroup "selected" property
+* @method configSelected
+* @param {String} type The CustomEvent type (usually the property name)
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
+*/
+YAHOO.widget.CalendarGroup.prototype.configSelected = function(type, args, obj) {
+       var cfgSelected = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;
+       this.delegateConfig(type, args, obj);
+       var selected = (this.pages.length > 0) ? this.pages[0].cfg.getProperty(cfgSelected) : []; 
+       this.cfg.setProperty(cfgSelected, selected, true);
+};
+
+
 /**
 * Delegates a configuration property to the CustomEvents associated with the CalendarGroup's children
 * @method delegateConfig
@@ -3834,7 +4452,7 @@ YAHOO.widget.CalendarGroup.prototype.delegateConfig = function(type, args, obj)
 * @param {Function}            fn                      The function to apply to each Calendar page object
 */
 YAHOO.widget.CalendarGroup.prototype.setChildFunction = function(fnName, fn) {
-       var pageCount = this.cfg.getProperty("pages");
+       var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
 
        for (var p=0;p<pageCount;++p) {
                this.pages[p][fnName] = fn;
@@ -3848,7 +4466,7 @@ YAHOO.widget.CalendarGroup.prototype.setChildFunction = function(fnName, fn) {
 * @param {Array}               args            The arguments to pass to the function
 */
 YAHOO.widget.CalendarGroup.prototype.callChildFunction = function(fnName, args) {
-       var pageCount = this.cfg.getProperty("pages");
+       var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
 
        for (var p=0;p<pageCount;++p) {
                var page = this.pages[p];
@@ -3887,10 +4505,20 @@ YAHOO.widget.CalendarGroup.prototype.constructChild = function(id,containerId,co
 */
 YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {
        month = parseInt(month, 10);
-
-       for (var p=0;p<this.pages.length;++p) {
+       var currYear;
+       
+       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+       
+       for (var p=0; p<this.pages.length; ++p) {
                var cal = this.pages[p];
-               cal.setMonth(month+p);
+               var pageDate = cal.cfg.getProperty(cfgPageDate);
+               if (p === 0) {
+                       currYear = pageDate.getFullYear();
+               } else {
+                       pageDate.setYear(currYear);
+               }
+               this._setMonthOnDate(pageDate, month+p); 
+               cal.cfg.setProperty(cfgPageDate, pageDate);
        }
 };
 
@@ -3901,10 +4529,13 @@ YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {
 * @param {Number}      year            The numeric 4-digit year
 */
 YAHOO.widget.CalendarGroup.prototype.setYear = function(year) {
+
+       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+
        year = parseInt(year, 10);
        for (var p=0;p<this.pages.length;++p) {
                var cal = this.pages[p];
-               var pageDate = cal.cfg.getProperty("pageDate");
+               var pageDate = cal.cfg.getProperty(cfgPageDate);
 
                if ((pageDate.getMonth()+1) == 1 && p>0) {
                        year+=1;
@@ -3945,11 +4576,14 @@ YAHOO.widget.CalendarGroup.prototype.select = function(date) {
 };
 
 /**
-* Selects a date on the current calendar by referencing the index of the cell that should be selected.
-* This method is used to easily select a single cell (usually with a mouse click) without having to do
-* a full render. The selected style is applied to the cell directly.
+* Selects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
+* The value of the MULTI_SELECT Configuration attribute will determine the set of dates which get selected. 
+* <ul>
+*    <li>If MULTI_SELECT is false, selectCell will select the cell at the specified index for only the last displayed Calendar page.</li>
+*    <li>If MULTI_SELECT is true, selectCell will select the cell at the specified index, on each displayed Calendar page.</li>
+* </ul>
 * @method selectCell
-* @param       {Number}        cellIndex       The index of the cell to select in the current calendar
+* @param       {Number}        cellIndex       The index of the cell to be selected
 * @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
 */
 YAHOO.widget.CalendarGroup.prototype.selectCell = function(cellIndex) {
@@ -3996,11 +4630,11 @@ YAHOO.widget.CalendarGroup.prototype.deselectAll = function() {
 };
 
 /**
-* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
-* This method is used to easily deselect a single cell (usually with a mouse click) without having to do
-* a full render. The selected style is removed from the cell directly.
+* Deselects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
+* deselectCell will deselect the cell at the specified index on each displayed Calendar page.
+*
 * @method deselectCell
-* @param       {Number}        cellIndex       The index of the cell to deselect in the current calendar
+* @param       {Number}        cellIndex       The index of the cell to deselect. 
 * @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
 */
 YAHOO.widget.CalendarGroup.prototype.deselectCell = function(cellIndex) {
@@ -4087,8 +4721,7 @@ YAHOO.widget.CalendarGroup.prototype.previousYear = function() {
 */
 YAHOO.widget.CalendarGroup.prototype.getSelectedDates = function() { 
        var returnDates = [];
-       var selected = this.cfg.getProperty("selected");
-
+       var selected = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);
        for (var d=0;d<selected.length;++d) {
                var dateArray = selected[d];
 
@@ -4133,7 +4766,7 @@ YAHOO.widget.CalendarGroup.prototype.addMonthRenderer = function(month, fnRender
 * Adds a weekday to the render stack. The function reference passed to this method will be executed
 * when a date cell matches the weekday passed to this method.
 * @method addWeekdayRenderer
-* @param       {Number}        weekday         The weekday (0-6) to associate with this renderer
+* @param       {Number}        weekday         The weekday (1-7) to associate with this renderer. 1=Sunday, 2=Monday etc.
 * @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
 */
 YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer = function(weekday, fnRender) {
@@ -4197,6 +4830,54 @@ YAHOO.widget.CalendarGroup.prototype.subtractYears = function(count) {
        this.callChildFunction("subtractYears", count);
 };
 
+/**
+* Shows the CalendarGroup's outer container.
+* @method show
+*/
+YAHOO.widget.CalendarGroup.prototype.show = function() {
+       this.oDomContainer.style.display = "block";
+       if (YAHOO.env.ua.opera) {
+               this._fixWidth();
+       }
+};
+
+/**
+* Sets the month on a Date object, taking into account year rollover if the month is less than 0 or greater than 11.
+* The Date object passed in is modified. It should be cloned before passing it into this method if the original value needs to be maintained
+* @method      _setMonthOnDate
+* @private
+* @param       {Date}  date    The Date object on which to set the month index
+* @param       {Number}        iMonth  The month index to set
+*/
+YAHOO.widget.CalendarGroup.prototype._setMonthOnDate = function(date, iMonth) {
+       // Bug in Safari 1.3, 2.0 (WebKit build < 420), Date.setMonth does not work consistently if iMonth is not 0-11
+       if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420 && (iMonth < 0 || iMonth > 11)) {
+               var DM = YAHOO.widget.DateMath;
+               var newDate = DM.add(date, DM.MONTH, iMonth-date.getMonth());
+               date.setTime(newDate.getTime());
+       } else {
+               date.setMonth(iMonth);
+       }
+};
+
+/**
+ * Fixes the width of the CalendarGroup container element, to account for miswrapped floats
+ * @method _fixWidth
+ * @private
+ */
+YAHOO.widget.CalendarGroup.prototype._fixWidth = function() {
+       var startW = this.oDomContainer.offsetWidth;
+       var w = 0;
+       for (var p=0;p<this.pages.length;++p) {
+               var cal = this.pages[p];
+               w += cal.oDomContainer.offsetWidth;
+       }
+       if (w > 0) {
+               this.oDomContainer.style.width = w + "px";
+       }
+};
+
+
 /**
 * CSS class representing the container for the calendar
 * @property YAHOO.widget.CalendarGroup.CSS_CONTAINER
@@ -4229,11 +4910,13 @@ YAHOO.widget.CalendarGroup.CSS_2UPTITLE = "title";
 * @property YAHOO.widget.CalendarGroup.CSS_2UPCLOSE
 * @static
 * @final
+* @deprecated  Along with Calendar.IMG_ROOT and NAV_ARROW_LEFT, NAV_ARROW_RIGHT configuration properties.
+*                                      Calendar's <a href="YAHOO.widget.Calendar.html#Style.CSS_CLOSE">Style.CSS_CLOSE</a> property now represents the CSS class used to render the close icon
 * @type String
 */
 YAHOO.widget.CalendarGroup.CSS_2UPCLOSE = "close-icon";
 
-YAHOO.augment(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",
+YAHOO.lang.augmentProto(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",
                                                                                                                                 "buildMonthLabel",
                                                                                                                                 "renderOutOfBoundsDate",
                                                                                                                                 "renderRowHeader",
@@ -4251,10 +4934,21 @@ YAHOO.augment(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel"
                                                                                                                                 "initStyles",
                                                                                                                                 "configTitle",
                                                                                                                                 "configClose",
+                                                                                                                                "configIframe",
                                                                                                                                 "hide",
-                                                                                                                                "show",
                                                                                                                                 "browser");
 
+/**
+* The set of default Config property keys and values for the CalendarGroup
+* @property YAHOO.widget.CalendarGroup._DEFAULT_CONFIG
+* @final
+* @static
+* @private
+* @type Object
+*/
+YAHOO.widget.CalendarGroup._DEFAULT_CONFIG = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES = {key:"pages", value:2};
+
 /**
 * Returns a string representation of the object.
 * @method toString
@@ -4280,4 +4974,6 @@ YAHOO.extend(YAHOO.widget.Calendar2up, YAHOO.widget.CalendarGroup);
 /**
 * @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
 */
-YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
\ No newline at end of file
+YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
+
+YAHOO.register("calendar", YAHOO.widget.Calendar, {version: "2.3.0", build: "442"});
index 53b1d938e2181d60f05d79ce2f334d1b9b61176e..98877bae0a5d9af89b6fcdfba1682a1cd24167fd 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 
-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);}
-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;}}
-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]);}
-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]);}
-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;}
-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;}}}
-if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}
-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;}}}}}
-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;}
-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);}}
-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);}
-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()+"]";}
-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]+", ";}}
-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;}}
-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;}}
+(function(){YAHOO.util.Config=function(owner){if(owner){this.init(owner);}
+if(!owner){}};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config;Config.CONFIG_CHANGED_EVENT="configChanged";Config.BOOLEAN_TYPE="boolean";Config.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(owner){this.owner=owner;this.configChangedEvent=this.createEvent(Config.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=CustomEvent.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(val){return(typeof val==Config.BOOLEAN_TYPE);},checkNumber:function(val){return(!isNaN(val));},fireEvent:function(key,value){var property=this.config[key];if(property&&property.event){property.event.fire(value);}},addProperty:function(key,propertyObject){key=key.toLowerCase();this.config[key]=propertyObject;propertyObject.event=this.createEvent(key,{scope:this.owner});propertyObject.event.signature=CustomEvent.LIST;propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner);}
+this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}},getConfig:function(){var cfg={},prop,property;for(prop in this.config){property=this.config[prop];if(property&&property.event){cfg[prop]=property.value;}}
+return cfg;},getProperty:function(key){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.value;}else{return undefined;}},resetProperty:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event){if(this.initialConfig[key]&&!Lang.isUndefined(this.initialConfig[key])){this.setProperty(key,this.initialConfig[key]);}
+return true;}else{return false;}},setProperty:function(key,value,silent){var property;key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{property=this.config[key];if(property&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){this.fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
+return true;}}else{return false;}}},queueProperty:function(key,value){key=key.toLowerCase();var property=this.config[key],foundDuplicate=false,iLen,queueItem,queueItemKey,queueItemValue,sLen,supercedesCheck,qLen,queueItemCheck,queueItemCheckKey,queueItemCheckValue,i,s,q;if(property&&property.event){if(!Lang.isUndefined(value)&&property.validator&&!property.validator(value)){return false;}else{if(!Lang.isUndefined(value)){property.value=value;}else{value=property.value;}
+foundDuplicate=false;iLen=this.eventQueue.length;for(i=0;i<iLen;i++){queueItem=this.eventQueue[i];if(queueItem){queueItemKey=queueItem[0];queueItemValue=queueItem[1];if(queueItemKey==key){this.eventQueue[i]=null;this.eventQueue.push([key,(!Lang.isUndefined(value)?value:queueItemValue)]);foundDuplicate=true;break;}}}
+if(!foundDuplicate&&!Lang.isUndefined(value)){this.eventQueue.push([key,value]);}}
+if(property.supercedes){sLen=property.supercedes.length;for(s=0;s<sLen;s++){supercedesCheck=property.supercedes[s];qLen=this.eventQueue.length;for(q=0;q<qLen;q++){queueItemCheck=this.eventQueue[q];if(queueItemCheck){queueItemCheckKey=queueItemCheck[0];queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey==supercedesCheck.toLowerCase()){this.eventQueue.push([queueItemCheckKey,queueItemCheckValue]);this.eventQueue[q]=null;break;}}}}}
+return true;}else{return false;}},refireEvent:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event&&!Lang.isUndefined(property.value)){if(this.queueInProgress){this.queueProperty(key);}else{this.fireEvent(key,property.value);}}},applyConfig:function(userConfig,init){var prop;if(init){this.initialConfig=userConfig;}
+for(prop in userConfig){this.queueProperty(prop,userConfig[prop]);}},refresh:function(){var prop;for(prop in this.config){this.refireEvent(prop);}},fireQueue:function(){var i,queueItem,key,value,property;this.queueInProgress=true;for(i=0;i<this.eventQueue.length;i++){queueItem=this.eventQueue[i];if(queueItem){key=queueItem[0];value=queueItem[1];property=this.config[key];property.value=value;this.fireEvent(key,value);}}
+this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(key,handler,obj,override){var property=this.config[key.toLowerCase()];if(property&&property.event){if(!Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
+return true;}else{return false;}},unsubscribeFromConfigEvent:function(key,handler,obj){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}},toString:function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
+return output;},outputEventQueue:function(){var output="",queueItem,q,nQueue=this.eventQueue.length;for(q=0;q<nQueue;q++){queueItem=this.eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
+return output;},destroy:function(){var oConfig=this.config,sProperty,oProperty;for(sProperty in oConfig){if(Lang.hasOwnProperty(oConfig,sProperty)){oProperty=oConfig[sProperty];oProperty.event.unsubscribeAll();oProperty.event=null;}}
+this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};Config.alreadySubscribed=function(evt,fn,obj){var nSubscribers=evt.subscribers.length,subsc,i;if(nSubscribers>0){i=nSubscribers-1;do{subsc=evt.subscribers[i];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
+while(i--);}
+return false;};YAHOO.lang.augmentProto(Config,YAHOO.util.EventProvider);}());YAHOO.widget.DateMath={DAY:"D",WEEK:"W",YEAR:"Y",MONTH:"M",ONE_DAY_MS:1000*60*60*24,add:function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.MONTH:var newMonth=date.getMonth()+amount;var years=0;if(newMonth<0){while(newMonth<0){newMonth+=12;years-=1;}}else if(newMonth>11){while(newMonth>11){newMonth-=12;years+=1;}}
 d.setMonth(newMonth);d.setFullYear(date.getFullYear()+years);break;case this.DAY:d.setDate(date.getDate()+amount);break;case this.YEAR:d.setFullYear(date.getFullYear()+amount);break;case this.WEEK:d.setDate(date.getDate()+(amount*7));break;}
 return d;},subtract:function(date,field,amount){return this.add(date,field,(amount*-1));},before:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()<ms){return true;}else{return false;}},after:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()>ms){return true;}else{return false;}},between:function(date,dateBegin,dateEnd){if(this.after(date,dateBegin)&&this.before(date,dateEnd)){return true;}else{return false;}},getJan1:function(calendarYear){return new Date(calendarYear,0,1);},getDayOffset:function(date,calendarYear){var beginYear=this.getJan1(calendarYear);var dayOffset=Math.ceil((date.getTime()-beginYear.getTime())/this.ONE_DAY_MS);return dayOffset;},getWeekNumber:function(date,calendarYear){date=this.clearTime(date);var nearestThurs=new Date(date.getTime()+(4*this.ONE_DAY_MS)-((date.getDay())*this.ONE_DAY_MS));var jan1=new Date(nearestThurs.getFullYear(),0,1);var dayOfYear=((nearestThurs.getTime()-jan1.getTime())/this.ONE_DAY_MS)-1;var weekNum=Math.ceil((dayOfYear)/7);return weekNum;},isYearOverlapWeek:function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getFullYear()!=weekBeginDate.getFullYear()){overlaps=true;}
 return overlaps;},isMonthOverlapWeek:function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;}
-return overlaps;},findMonthStart:function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;},findMonthEnd:function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;},clearTime:function(date){date.setHours(12,0,0,0);return date;}};YAHOO.widget.Calendar=function(id,containerId,config){this.init(id,containerId,config);};YAHOO.widget.Calendar.IMG_ROOT=(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);}
-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);}
-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);}
-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);}
-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;}}
+return overlaps;},findMonthStart:function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;},findMonthEnd:function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;},clearTime:function(date){date.setHours(12,0,0,0);return date;}};YAHOO.widget.Calendar=function(id,containerId,config){this.init(id,containerId,config);};YAHOO.widget.Calendar.IMG_ROOT=null;YAHOO.widget.Calendar.DATE="D";YAHOO.widget.Calendar.MONTH_DAY="MD";YAHOO.widget.Calendar.WEEKDAY="WD";YAHOO.widget.Calendar.RANGE="R";YAHOO.widget.Calendar.MONTH="M";YAHOO.widget.Calendar.DISPLAY_DAYS=42;YAHOO.widget.Calendar.STOP_RENDER="S";YAHOO.widget.Calendar.SHORT="short";YAHOO.widget.Calendar.LONG="long";YAHOO.widget.Calendar.MEDIUM="medium";YAHOO.widget.Calendar.ONE_CHAR="1char";YAHOO.widget.Calendar._DEFAULT_CONFIG={PAGEDATE:{key:"pagedate",value:null},SELECTED:{key:"selected",value:null},TITLE:{key:"title",value:""},CLOSE:{key:"close",value:false},IFRAME:{key:"iframe",value:(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6)?true:false},MINDATE:{key:"mindate",value:null},MAXDATE:{key:"maxdate",value:null},MULTI_SELECT:{key:"multi_select",value:false},START_WEEKDAY:{key:"start_weekday",value:0},SHOW_WEEKDAYS:{key:"show_weekdays",value:true},SHOW_WEEK_HEADER:{key:"show_week_header",value:false},SHOW_WEEK_FOOTER:{key:"show_week_footer",value:false},HIDE_BLANK_WEEKS:{key:"hide_blank_weeks",value:false},NAV_ARROW_LEFT:{key:"nav_arrow_left",value:null},NAV_ARROW_RIGHT:{key:"nav_arrow_right",value:null},MONTHS_SHORT:{key:"months_short",value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},MONTHS_LONG:{key:"months_long",value:["January","February","March","April","May","June","July","August","September","October","November","December"]},WEEKDAYS_1CHAR:{key:"weekdays_1char",value:["S","M","T","W","T","F","S"]},WEEKDAYS_SHORT:{key:"weekdays_short",value:["Su","Mo","Tu","We","Th","Fr","Sa"]},WEEKDAYS_MEDIUM:{key:"weekdays_medium",value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},WEEKDAYS_LONG:{key:"weekdays_long",value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},LOCALE_MONTHS:{key:"locale_months",value:"long"},LOCALE_WEEKDAYS:{key:"locale_weekdays",value:"short"},DATE_DELIMITER:{key:"date_delimiter",value:","},DATE_FIELD_DELIMITER:{key:"date_field_delimiter",value:"/"},DATE_RANGE_DELIMITER:{key:"date_range_delimiter",value:"-"},MY_MONTH_POSITION:{key:"my_month_position",value:1},MY_YEAR_POSITION:{key:"my_year_position",value:2},MD_MONTH_POSITION:{key:"md_month_position",value:1},MD_DAY_POSITION:{key:"md_day_position",value:2},MDY_MONTH_POSITION:{key:"mdy_month_position",value:1},MDY_DAY_POSITION:{key:"mdy_day_position",value:2},MDY_YEAR_POSITION:{key:"mdy_year_position",value:3},MY_LABEL_MONTH_POSITION:{key:"my_label_month_position",value:1},MY_LABEL_YEAR_POSITION:{key:"my_label_year_position",value:2},MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix",value:" "},MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix",value:""}};YAHOO.widget.Calendar._EVENT_TYPES={BEFORE_SELECT:"beforeSelect",SELECT:"select",BEFORE_DESELECT:"beforeDeselect",DESELECT:"deselect",CHANGE_PAGE:"changePage",BEFORE_RENDER:"beforeRender",RENDER:"render",RESET:"reset",CLEAR:"clear"};YAHOO.widget.Calendar._STYLES={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTOR:"selector",CSS_CELL_SELECTED:"selected",CSS_CELL_SELECTABLE:"selectable",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_BODY:"calbody",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_SINGLE:"single",CSS_CONTAINER:"yui-calcontainer",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_CLOSE:"calclose",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};YAHOO.widget.Calendar.prototype={Config:null,parent:null,index:-1,cells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,_selectedDates:null,domEventMap:null};YAHOO.widget.Calendar.prototype.init=function(id,containerId,config){this.initEvents();this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);this.id=id;this.oDomContainer=document.getElementById(containerId);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.initStyles();YAHOO.util.Dom.addClass(this.oDomContainer,this.Style.CSS_CONTAINER);YAHOO.util.Dom.addClass(this.oDomContainer,this.Style.CSS_SINGLE);this.cellDates=[];this.cells=[];this.renderStack=[];this._renderStack=[];this.setupConfig();if(config){this.cfg.applyConfig(config,true);}
+this.cfg.fireQueue();};YAHOO.widget.Calendar.prototype.configIframe=function(type,args,obj){var useIframe=args[0];if(!this.parent){if(YAHOO.util.Dom.inDocument(this.oDomContainer)){if(useIframe){var pos=YAHOO.util.Dom.getStyle(this.oDomContainer,"position");if(pos=="absolute"||pos=="relative"){if(!YAHOO.util.Dom.inDocument(this.iframe)){this.iframe=document.createElement("iframe");this.iframe.src="javascript:false;";YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6){YAHOO.util.Dom.addClass(this.iframe,"fixedsize");}
+this.oDomContainer.insertBefore(this.iframe,this.oDomContainer.firstChild);}}}else{if(this.iframe){if(this.iframe.parentNode){this.iframe.parentNode.removeChild(this.iframe);}
+this.iframe=null;}}}}};YAHOO.widget.Calendar.prototype.configTitle=function(type,args,obj){var title=args[0];var close=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);var titleDiv;if(title&&title!==""){titleDiv=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||document.createElement("div");titleDiv.className=YAHOO.widget.CalendarGroup.CSS_2UPTITLE;titleDiv.innerHTML=title;this.oDomContainer.insertBefore(titleDiv,this.oDomContainer.firstChild);YAHOO.util.Dom.addClass(this.oDomContainer,"withtitle");}else{titleDiv=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||null;if(titleDiv){YAHOO.util.Event.purgeElement(titleDiv);this.oDomContainer.removeChild(titleDiv);}
+if(!close){YAHOO.util.Dom.removeClass(this.oDomContainer,"withtitle");}}};YAHOO.widget.Calendar.prototype.configClose=function(type,args,obj){var close=args[0];var title=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);var DEPR_CLOSE_PATH="us/my/bn/x_d.gif";var linkClose;if(close===true){linkClose=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||document.createElement("a");linkClose.href="#";linkClose.className="link-close";YAHOO.util.Event.addListener(linkClose,"click",function(e,cal){cal.hide();YAHOO.util.Event.preventDefault(e);},this);if(YAHOO.widget.Calendar.IMG_ROOT!==null){var imgClose=document.createElement("img");imgClose.src=YAHOO.widget.Calendar.IMG_ROOT+DEPR_CLOSE_PATH;imgClose.className=YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;linkClose.appendChild(imgClose);}else{linkClose.innerHTML='<span class="'+YAHOO.widget.CalendarGroup.CSS_2UPCLOSE+' '+this.Style.CSS_CLOSE+'"></span>';}
+this.oDomContainer.appendChild(linkClose);YAHOO.util.Dom.addClass(this.oDomContainer,"withtitle");}else{linkClose=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||null;if(linkClose){YAHOO.util.Event.purgeElement(linkClose);this.oDomContainer.removeChild(linkClose);}
+if(!title||title===""){YAHOO.util.Dom.removeClass(this.oDomContainer,"withtitle");}}};YAHOO.widget.Calendar.prototype.initEvents=function(){var defEvents=YAHOO.widget.Calendar._EVENT_TYPES;this.beforeSelectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);this.selectEvent=new YAHOO.util.CustomEvent(defEvents.SELECT);this.beforeDeselectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);this.deselectEvent=new YAHOO.util.CustomEvent(defEvents.DESELECT);this.changePageEvent=new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);this.beforeRenderEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);this.renderEvent=new YAHOO.util.CustomEvent(defEvents.RENDER);this.resetEvent=new YAHOO.util.CustomEvent(defEvents.RESET);this.clearEvent=new YAHOO.util.CustomEvent(defEvents.CLEAR);this.beforeSelectEvent.subscribe(this.onBeforeSelect,this,true);this.selectEvent.subscribe(this.onSelect,this,true);this.beforeDeselectEvent.subscribe(this.onBeforeDeselect,this,true);this.deselectEvent.subscribe(this.onDeselect,this,true);this.changePageEvent.subscribe(this.onChangePage,this,true);this.renderEvent.subscribe(this.onRender,this,true);this.resetEvent.subscribe(this.onReset,this,true);this.clearEvent.subscribe(this.onClear,this,true);};YAHOO.widget.Calendar.prototype.doSelectCell=function(e,cal){var cell,index,d,date;var target=YAHOO.util.Event.getTarget(e);var tagName=target.tagName.toLowerCase();var defSelector=false;while(tagName!="td"&&!YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){if(!defSelector&&tagName=="a"&&YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTOR)){defSelector=true;}
+target=target.parentNode;tagName=target.tagName.toLowerCase();if(tagName=="html"){return;}}
+if(defSelector){YAHOO.util.Event.preventDefault(e);}
 cell=target;if(YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_SELECTABLE)){index=cell.id.split("cell")[1];d=cal.cellDates[index];date=new Date(d[0],d[1]-1,d[2]);var link;if(cal.Options.MULTI_SELECT){link=cell.getElementsByTagName("a")[0];if(link){link.blur();}
 var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{link=cell.getElementsByTagName("a")[0];if(link){link.blur();}
 cal.selectCell(index);}}};YAHOO.widget.Calendar.prototype.doCellMouseOver=function(e,cal){var target;if(e){target=YAHOO.util.Event.getTarget(e);}else{target=this;}
 while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
 if(YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){YAHOO.util.Dom.addClass(target,cal.Style.CSS_CELL_HOVER);}};YAHOO.widget.Calendar.prototype.doCellMouseOut=function(e,cal){var target;if(e){target=YAHOO.util.Event.getTarget(e);}else{target=this;}
 while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
-if(YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){YAHOO.util.Dom.removeClass(target,cal.Style.CSS_CELL_HOVER);}};YAHOO.widget.Calendar.prototype.setupConfig=function(){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");}
-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();}
-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);}}
-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;}
-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;}
-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());}}
-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;}
-if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){colSpan+=1;}
+if(YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){YAHOO.util.Dom.removeClass(target,cal.Style.CSS_CELL_HOVER);}};YAHOO.widget.Calendar.prototype.setupConfig=function(){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.addProperty(defCfg.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});this.cfg.addProperty(defCfg.SELECTED.key,{value:[],handler:this.configSelected});this.cfg.addProperty(defCfg.TITLE.key,{value:defCfg.TITLE.value,handler:this.configTitle});this.cfg.addProperty(defCfg.CLOSE.key,{value:defCfg.CLOSE.value,handler:this.configClose});this.cfg.addProperty(defCfg.IFRAME.key,{value:defCfg.IFRAME.value,handler:this.configIframe,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.MINDATE.key,{value:defCfg.MINDATE.value,handler:this.configMinDate});this.cfg.addProperty(defCfg.MAXDATE.key,{value:defCfg.MAXDATE.value,handler:this.configMaxDate});this.cfg.addProperty(defCfg.MULTI_SELECT.key,{value:defCfg.MULTI_SELECT.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.START_WEEKDAY.key,{value:defCfg.START_WEEKDAY.value,handler:this.configOptions,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,{value:defCfg.SHOW_WEEKDAYS.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{value:defCfg.SHOW_WEEK_HEADER.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{value:defCfg.SHOW_WEEK_FOOTER.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{value:defCfg.HIDE_BLANK_WEEKS.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key,{value:defCfg.NAV_ARROW_LEFT.value,handler:this.configOptions});this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,{value:defCfg.NAV_ARROW_RIGHT.value,handler:this.configOptions});this.cfg.addProperty(defCfg.MONTHS_SHORT.key,{value:defCfg.MONTHS_SHORT.value,handler:this.configLocale});this.cfg.addProperty(defCfg.MONTHS_LONG.key,{value:defCfg.MONTHS_LONG.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key,{value:defCfg.WEEKDAYS_1CHAR.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key,{value:defCfg.WEEKDAYS_SHORT.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,{value:defCfg.WEEKDAYS_MEDIUM.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,{value:defCfg.WEEKDAYS_LONG.value,handler:this.configLocale});var refreshLocale=function(){this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);};this.cfg.subscribeToConfigEvent(defCfg.START_WEEKDAY.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.MONTHS_SHORT.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.MONTHS_LONG.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_1CHAR.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_SHORT.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_MEDIUM.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_LONG.key,refreshLocale,this,true);this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,{value:defCfg.LOCALE_MONTHS.value,handler:this.configLocaleValues});this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,{value:defCfg.LOCALE_WEEKDAYS.value,handler:this.configLocaleValues});this.cfg.addProperty(defCfg.DATE_DELIMITER.key,{value:defCfg.DATE_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{value:defCfg.DATE_FIELD_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{value:defCfg.DATE_RANGE_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,{value:defCfg.MY_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,{value:defCfg.MY_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,{value:defCfg.MD_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,{value:defCfg.MD_DAY_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,{value:defCfg.MDY_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,{value:defCfg.MDY_DAY_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,{value:defCfg.MDY_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,{value:defCfg.MY_LABEL_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key,{value:defCfg.MY_LABEL_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,{value:defCfg.MY_LABEL_MONTH_SUFFIX.value,handler:this.configLocale});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key,{value:defCfg.MY_LABEL_YEAR_SUFFIX.value,handler:this.configLocale});};YAHOO.widget.Calendar.prototype.configPageDate=function(type,args,obj){this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key,this._parsePageDate(args[0]),true);};YAHOO.widget.Calendar.prototype.configMinDate=function(type,args,obj){var val=args[0];if(YAHOO.lang.isString(val)){val=this._parseDate(val);this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key,new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configMaxDate=function(type,args,obj){var val=args[0];if(YAHOO.lang.isString(val)){val=this._parseDate(val);this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key,new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configSelected=function(type,args,obj){var selected=args[0];var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;if(selected){if(YAHOO.lang.isString(selected)){this.cfg.setProperty(cfgSelected,this._parseDates(selected),true);}}
+if(!this._selectedDates){this._selectedDates=this.cfg.getProperty(cfgSelected);}};YAHOO.widget.Calendar.prototype.configOptions=function(type,args,obj){this.Options[type.toUpperCase()]=args[0];};YAHOO.widget.Calendar.prototype.configLocale=function(type,args,obj){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.Locale[type.toUpperCase()]=args[0];this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);};YAHOO.widget.Calendar.prototype.configLocaleValues=function(type,args,obj){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;type=type.toLowerCase();var val=args[0];switch(type){case defCfg.LOCALE_MONTHS.key:switch(val){case YAHOO.widget.Calendar.SHORT:this.Locale.LOCALE_MONTHS=this.cfg.getProperty(defCfg.MONTHS_SHORT.key).concat();break;case YAHOO.widget.Calendar.LONG:this.Locale.LOCALE_MONTHS=this.cfg.getProperty(defCfg.MONTHS_LONG.key).concat();break;}
+break;case defCfg.LOCALE_WEEKDAYS.key:switch(val){case YAHOO.widget.Calendar.ONE_CHAR:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_1CHAR.key).concat();break;case YAHOO.widget.Calendar.SHORT:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_SHORT.key).concat();break;case YAHOO.widget.Calendar.MEDIUM:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_MEDIUM.key).concat();break;case YAHOO.widget.Calendar.LONG:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_LONG.key).concat();break;}
+var START_WEEKDAY=this.cfg.getProperty(defCfg.START_WEEKDAY.key);if(START_WEEKDAY>0){for(var w=0;w<START_WEEKDAY;++w){this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());}}
+break;}};YAHOO.widget.Calendar.prototype.initStyles=function(){var defStyle=YAHOO.widget.Calendar._STYLES;this.Style={CSS_ROW_HEADER:defStyle.CSS_ROW_HEADER,CSS_ROW_FOOTER:defStyle.CSS_ROW_FOOTER,CSS_CELL:defStyle.CSS_CELL,CSS_CELL_SELECTOR:defStyle.CSS_CELL_SELECTOR,CSS_CELL_SELECTED:defStyle.CSS_CELL_SELECTED,CSS_CELL_SELECTABLE:defStyle.CSS_CELL_SELECTABLE,CSS_CELL_RESTRICTED:defStyle.CSS_CELL_RESTRICTED,CSS_CELL_TODAY:defStyle.CSS_CELL_TODAY,CSS_CELL_OOM:defStyle.CSS_CELL_OOM,CSS_CELL_OOB:defStyle.CSS_CELL_OOB,CSS_HEADER:defStyle.CSS_HEADER,CSS_HEADER_TEXT:defStyle.CSS_HEADER_TEXT,CSS_BODY:defStyle.CSS_BODY,CSS_WEEKDAY_CELL:defStyle.CSS_WEEKDAY_CELL,CSS_WEEKDAY_ROW:defStyle.CSS_WEEKDAY_ROW,CSS_FOOTER:defStyle.CSS_FOOTER,CSS_CALENDAR:defStyle.CSS_CALENDAR,CSS_SINGLE:defStyle.CSS_SINGLE,CSS_CONTAINER:defStyle.CSS_CONTAINER,CSS_NAV_LEFT:defStyle.CSS_NAV_LEFT,CSS_NAV_RIGHT:defStyle.CSS_NAV_RIGHT,CSS_CLOSE:defStyle.CSS_CLOSE,CSS_CELL_TOP:defStyle.CSS_CELL_TOP,CSS_CELL_LEFT:defStyle.CSS_CELL_LEFT,CSS_CELL_RIGHT:defStyle.CSS_CELL_RIGHT,CSS_CELL_BOTTOM:defStyle.CSS_CELL_BOTTOM,CSS_CELL_HOVER:defStyle.CSS_CELL_HOVER,CSS_CELL_HIGHLIGHT1:defStyle.CSS_CELL_HIGHLIGHT1,CSS_CELL_HIGHLIGHT2:defStyle.CSS_CELL_HIGHLIGHT2,CSS_CELL_HIGHLIGHT3:defStyle.CSS_CELL_HIGHLIGHT3,CSS_CELL_HIGHLIGHT4:defStyle.CSS_CELL_HIGHLIGHT4};};YAHOO.widget.Calendar.prototype.buildMonthLabel=function(){var pageDate=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);var monthLabel=this.Locale.LOCALE_MONTHS[pageDate.getMonth()]+this.Locale.MY_LABEL_MONTH_SUFFIX;var yearLabel=pageDate.getFullYear()+this.Locale.MY_LABEL_YEAR_SUFFIX;if(this.Locale.MY_LABEL_MONTH_POSITION==2||this.Locale.MY_LABEL_YEAR_POSITION==1){return yearLabel+monthLabel;}else{return monthLabel+yearLabel;}};YAHOO.widget.Calendar.prototype.buildDayLabel=function(workingDate){return workingDate.getDate();};YAHOO.widget.Calendar.prototype.renderHeader=function(html){var colSpan=7;var DEPR_NAV_LEFT="us/tr/callt.gif";var DEPR_NAV_RIGHT="us/tr/calrt.gif";var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;if(this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)){colSpan+=1;}
+if(this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)){colSpan+=1;}
 html[html.length]="<thead>";html[html.length]="<tr>";html[html.length]='<th colspan="'+colSpan+'" class="'+this.Style.CSS_HEADER_TEXT+'">';html[html.length]='<div class="'+this.Style.CSS_HEADER+'">';var renderLeft,renderRight=false;if(this.parent){if(this.index===0){renderLeft=true;}
 if(this.index==(this.parent.cfg.getProperty("pages")-1)){renderRight=true;}}else{renderLeft=true;renderRight=true;}
-var cal=this.parent||this;if(renderLeft){html[html.length]='<a class="'+this.Style.CSS_NAV_LEFT+'" style="background-image:url('+this.cfg.getProperty("NAV_ARROW_LEFT")+')">&#160;</a>';}
-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>';}
-html[html.length]='</div>';html[html.length]='</th>';html[html.length]='</tr>';if(this.cfg.getProperty("SHOW_WEEKDAYS")){html=this.buildWeekdays(html);}
-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>';}
+var cal=this.parent||this;if(renderLeft){var leftArrow=this.cfg.getProperty(defCfg.NAV_ARROW_LEFT.key);if(leftArrow===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){leftArrow=YAHOO.widget.Calendar.IMG_ROOT+DEPR_NAV_LEFT;}
+var leftStyle=(leftArrow===null)?"":' style="background-image:url('+leftArrow+')"';html[html.length]='<a class="'+this.Style.CSS_NAV_LEFT+'"'+leftStyle+' >&#160;</a>';}
+html[html.length]=this.buildMonthLabel();if(renderRight){var rightArrow=this.cfg.getProperty(defCfg.NAV_ARROW_RIGHT.key);if(rightArrow===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){rightArrow=YAHOO.widget.Calendar.IMG_ROOT+DEPR_NAV_RIGHT;}
+var rightStyle=(rightArrow===null)?"":' style="background-image:url('+rightArrow+')"';html[html.length]='<a class="'+this.Style.CSS_NAV_RIGHT+'"'+rightStyle+' >&#160;</a>';}
+html[html.length]='</div>\n</th>\n</tr>';if(this.cfg.getProperty(defCfg.SHOW_WEEKDAYS.key)){html=this.buildWeekdays(html);}
+html[html.length]='</thead>';return html;};YAHOO.widget.Calendar.prototype.buildWeekdays=function(html){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;html[html.length]='<tr class="'+this.Style.CSS_WEEKDAY_ROW+'">';if(this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)){html[html.length]='<th>&#160;</th>';}
 for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i){html[html.length]='<th class="calweekdaycell">'+this.Locale.LOCALE_WEEKDAYS[i]+'</th>';}
-if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){html[html.length]='<th>&#160;</th>';}
-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;}
+if(this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)){html[html.length]='<th>&#160;</th>';}
+html[html.length]='</tr>';return html;};YAHOO.widget.Calendar.prototype.renderBody=function(workingDate,html){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var startDay=this.cfg.getProperty(defCfg.START_WEEKDAY.key);this.preMonthDays=workingDate.getDay();if(startDay>0){this.preMonthDays-=startDay;}
 if(this.preMonthDays<0){this.preMonthDays+=7;}
-this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var 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);}
-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;}
-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);}
+this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var weekNum,weekClass;var weekPrefix="w";var cellPrefix="_cell";var workingDayPrefix="wd";var dayPrefix="d";var cellRenderers;var renderer;var todayYear=this.today.getFullYear();var todayMonth=this.today.getMonth();var todayDate=this.today.getDate();var useDate=this.cfg.getProperty(defCfg.PAGEDATE.key);var hideBlankWeeks=this.cfg.getProperty(defCfg.HIDE_BLANK_WEEKS.key);var showWeekFooter=this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key);var showWeekHeader=this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key);var mindate=this.cfg.getProperty(defCfg.MINDATE.key);var maxdate=this.cfg.getProperty(defCfg.MAXDATE.key);if(mindate){mindate=YAHOO.widget.DateMath.clearTime(mindate);}
+if(maxdate){maxdate=YAHOO.widget.DateMath.clearTime(maxdate);}
+html[html.length]='<tbody class="m'+(useDate.getMonth()+1)+' '+this.Style.CSS_BODY+'">';var i=0;var tempDiv=document.createElement("div");var cell=document.createElement("td");tempDiv.appendChild(cell);var jan1=new Date(useDate.getFullYear(),0,1);var cal=this.parent||this;for(var r=0;r<6;r++){weekNum=YAHOO.widget.DateMath.getWeekNumber(workingDate,useDate.getFullYear(),startDay);weekClass=weekPrefix+weekNum;if(r!==0&&hideBlankWeeks===true&&workingDate.getMonth()!=useDate.getMonth()){break;}else{html[html.length]='<tr class="'+weekClass+'">';if(showWeekHeader){html=this.renderRowHeader(weekNum,html);}
+for(var d=0;d<7;d++){cellRenderers=[];renderer=null;this.clearElement(cell);cell.className=this.Style.CSS_CELL;cell.id=this.id+cellPrefix+i;if(workingDate.getDate()==todayDate&&workingDate.getMonth()==todayMonth&&workingDate.getFullYear()==todayYear){cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;}
+var workingArray=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];this.cellDates[this.cellDates.length]=workingArray;if(workingDate.getMonth()!=useDate.getMonth()){cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;}else{YAHOO.util.Dom.addClass(cell,workingDayPrefix+workingDate.getDay());YAHOO.util.Dom.addClass(cell,dayPrefix+workingDate.getDate());for(var s=0;s<this.renderStack.length;++s){var rArray=this.renderStack[s];var type=rArray[0];var month;var day;var year;switch(type){case YAHOO.widget.Calendar.DATE:month=rArray[1][1];day=rArray[1][2];year=rArray[1][0];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day&&workingDate.getFullYear()==year){renderer=rArray[2];this.renderStack.splice(s,1);}
 break;case YAHOO.widget.Calendar.MONTH_DAY:month=rArray[1][0];day=rArray[1][1];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day){renderer=rArray[2];this.renderStack.splice(s,1);}
 break;case YAHOO.widget.Calendar.RANGE:var date1=rArray[1][0];var date2=rArray[1][1];var d1month=date1[1];var d1day=date1[2];var d1year=date1[0];var d1=new Date(d1year,d1month-1,d1day);var d2month=date2[1];var d2day=date2[2];var d2year=date2[0];var d2=new Date(d2year,d2month-1,d2day);if(workingDate.getTime()>=d1.getTime()&&workingDate.getTime()<=d2.getTime()){renderer=rArray[2];if(workingDate.getTime()==d2.getTime()){this.renderStack.splice(s,1);}}
 break;case YAHOO.widget.Calendar.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];}
 break;case YAHOO.widget.Calendar.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];}
 break;}
 if(renderer){cellRenderers[cellRenderers.length]=renderer;}}}
-if(this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()])>-1){cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected;}
-var mindate=this.cfg.getProperty("mindate");var maxdate=this.cfg.getProperty("maxdate");if(mindate){mindate=YAHOO.widget.DateMath.clearTime(mindate);}
-if(maxdate){maxdate=YAHOO.widget.DateMath.clearTime(maxdate);}
+if(this._indexOfSelectedFieldArray(workingArray)>-1){cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected;}
 if((mindate&&(workingDate.getTime()<mindate.getTime()))||(maxdate&&(workingDate.getTime()>maxdate.getTime()))){cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;}else{cellRenderers[cellRenderers.length]=cal.styleCellDefault;cellRenderers[cellRenderers.length]=cal.renderCellDefault;}
-for(var x=0;x<cellRenderers.length;++x){var ren=cellRenderers[x];if(ren.call((this.parent||this),workingDate,cell)==YAHOO.widget.Calendar.STOP_RENDER){break;}}
+for(var x=0;x<cellRenderers.length;++x){if(cellRenderers[x].call(cal,workingDate,cell)==YAHOO.widget.Calendar.STOP_RENDER){break;}}
 workingDate.setTime(workingDate.getTime()+YAHOO.widget.DateMath.ONE_DAY_MS);if(i>=0&&i<=6){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TOP);}
 if((i%7)===0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_LEFT);}
 if(((i+1)%7)===0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RIGHT);}
-var postDays=this.postMonthDays;if(postDays>=7&&this.cfg.getProperty("HIDE_BLANK_WEEKS")){var blankWeeks=Math.floor(postDays/7);for(var p=0;p<blankWeeks;++p){postDays-=7;}}
+var postDays=this.postMonthDays;if(hideBlankWeeks&&postDays>=7){var blankWeeks=Math.floor(postDays/7);for(var p=0;p<blankWeeks;++p){postDays-=7;}}
 if(i>=((this.preMonthDays+postDays+this.monthDays)-7)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_BOTTOM);}
 html[html.length]=tempDiv.innerHTML;i++;}
-if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){html=this.renderRowFooter(weekNum,html);}
+if(showWeekFooter){html=this.renderRowFooter(weekNum,html);}
 html[html.length]='</tr>';}}
-html[html.length]='</tbody>';return html;};YAHOO.widget.Calendar.prototype.renderFooter=function(html){return html;};YAHOO.widget.Calendar.prototype.render=function(){this.beforeRenderEvent.fire();var 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);}
-if(linkRight){this.linkRight=linkRight[0];YAHOO.util.Event.addListener(this.linkRight,"mousedown",cal.nextMonth,cal,true);}
-if(this.domEventMap){var el,elements;for(var cls in this.domEventMap){if(this.domEventMap.hasOwnProperty(cls)){var items=this.domEventMap[cls];if(!(items instanceof Array)){items=[items];}
+html[html.length]='</tbody>';return html;};YAHOO.widget.Calendar.prototype.renderFooter=function(html){return html;};YAHOO.widget.Calendar.prototype.render=function(){this.beforeRenderEvent.fire();var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var workingDate=YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(defCfg.PAGEDATE.key));this.resetRenderers();this.cellDates.length=0;YAHOO.util.Event.purgeElement(this.oDomContainer,true);var html=[];html[html.length]='<table cellSpacing="0" class="'+this.Style.CSS_CALENDAR+' y'+workingDate.getFullYear()+'" id="'+this.id+'">';html=this.renderHeader(html);html=this.renderBody(workingDate,html);html=this.renderFooter(html);html[html.length]='</table>';this.oDomContainer.innerHTML=html.join("\n");this.applyListeners();this.cells=this.oDomContainer.getElementsByTagName("td");this.cfg.refireEvent(defCfg.TITLE.key);this.cfg.refireEvent(defCfg.CLOSE.key);this.cfg.refireEvent(defCfg.IFRAME.key);this.renderEvent.fire();};YAHOO.widget.Calendar.prototype.applyListeners=function(){var root=this.oDomContainer;var cal=this.parent||this;var anchor="a";var mousedown="mousedown";var linkLeft=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT,anchor,root);var linkRight=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT,anchor,root);if(linkLeft&&linkLeft.length>0){this.linkLeft=linkLeft[0];YAHOO.util.Event.addListener(this.linkLeft,mousedown,cal.previousMonth,cal,true);}
+if(linkRight&&linkRight.length>0){this.linkRight=linkRight[0];YAHOO.util.Event.addListener(this.linkRight,mousedown,cal.nextMonth,cal,true);}
+if(this.domEventMap){var el,elements;for(var cls in this.domEventMap){if(YAHOO.lang.hasOwnProperty(this.domEventMap,cls)){var items=this.domEventMap[cls];if(!(items instanceof Array)){items=[items];}
 for(var i=0;i<items.length;i++){var item=items[i];elements=YAHOO.util.Dom.getElementsByClassName(cls,item.tag,this.oDomContainer);for(var c=0;c<elements.length;c++){el=elements[c];YAHOO.util.Event.addListener(el,item.event,item.handler,item.scope,item.correct);}}}}}
-YAHOO.util.Event.addListener(this.oDomContainer,"click",this.doSelectCell,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseout",this.doCellMouseOut,this);};YAHOO.widget.Calendar.prototype.getDateByCellId=function(id){var date=this.getDateFieldsByCellId(id);return new Date(date[0],date[1]-1,date[2]);};YAHOO.widget.Calendar.prototype.getDateFieldsByCellId=function(id){id=id.toLowerCase().split("_cell")[1];id=parseInt(id,10);return this.cellDates[id];};YAHOO.widget.Calendar.prototype.renderOutOfBoundsDate=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.renderRowHeader=function(weekNum,html){html[html.length]='<th class="calrowhead">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderRowFooter=function(weekNum,html){html[html.length]='<th class="calrowfoot">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML='<a href="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;}}
-if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}
-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);}
-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);}}
-if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}
-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);}
+YAHOO.util.Event.addListener(this.oDomContainer,"click",this.doSelectCell,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseout",this.doCellMouseOut,this);};YAHOO.widget.Calendar.prototype.getDateByCellId=function(id){var date=this.getDateFieldsByCellId(id);return new Date(date[0],date[1]-1,date[2]);};YAHOO.widget.Calendar.prototype.getDateFieldsByCellId=function(id){id=id.toLowerCase().split("_cell")[1];id=parseInt(id,10);return this.cellDates[id];};YAHOO.widget.Calendar.prototype.renderOutOfBoundsDate=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.renderRowHeader=function(weekNum,html){html[html.length]='<th class="calrowhead">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderRowFooter=function(weekNum,html){html[html.length]='<th class="calrowfoot">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML='<a href="#" class="'+this.Style.CSS_CELL_SELECTOR+'">'+this.buildDayLabel(workingDate)+"</a>";};YAHOO.widget.Calendar.prototype.styleCellDefault=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTABLE);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight1=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT1);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight2=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT2);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight3=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT3);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight4=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT4);};YAHOO.widget.Calendar.prototype.renderCellStyleToday=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TODAY);};YAHOO.widget.Calendar.prototype.renderCellStyleSelected=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTED);};YAHOO.widget.Calendar.prototype.renderCellNotThisMonth=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.renderBodyCellRestricted=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL);YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RESTRICTED);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.addMonths=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractMonths=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.addYears=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.YEAR,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractYears=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.YEAR,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.nextMonth=function(){this.addMonths(1);};YAHOO.widget.Calendar.prototype.previousMonth=function(){this.subtractMonths(1);};YAHOO.widget.Calendar.prototype.nextYear=function(){this.addYears(1);};YAHOO.widget.Calendar.prototype.previousYear=function(){this.subtractYears(1);};YAHOO.widget.Calendar.prototype.reset=function(){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.resetProperty(defCfg.SELECTED.key);this.cfg.resetProperty(defCfg.PAGEDATE.key);this.resetEvent.fire();};YAHOO.widget.Calendar.prototype.clear=function(){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.setProperty(defCfg.SELECTED.key,[]);this.cfg.setProperty(defCfg.PAGEDATE.key,new Date(this.today.getTime()));this.clearEvent.fire();};YAHOO.widget.Calendar.prototype.select=function(date){var aToBeSelected=this._toFieldArray(date);var validDates=[];var selected=[];var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];if(!this.isDateOOB(this._toDate(toSelect))){if(validDates.length===0){this.beforeSelectEvent.fire();selected=this.cfg.getProperty(cfgSelected);}
+validDates.push(toSelect);if(this._indexOfSelectedFieldArray(toSelect)==-1){selected[selected.length]=toSelect;}}}
+if(validDates.length>0){if(this.parent){this.parent.cfg.setProperty(cfgSelected,selected);}else{this.cfg.setProperty(cfgSelected,selected);}
+this.selectEvent.fire(validDates);}
+return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.selectCell=function(cellIndex){var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var dCellDate=this._toDate(cellDate);var selectable=YAHOO.util.Dom.hasClass(cell,this.Style.CSS_CELL_SELECTABLE);if(selectable){this.beforeSelectEvent.fire();var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;var selected=this.cfg.getProperty(cfgSelected);var selectDate=cellDate.concat();if(this._indexOfSelectedFieldArray(selectDate)==-1){selected[selected.length]=selectDate;}
+if(this.parent){this.parent.cfg.setProperty(cfgSelected,selected);}else{this.cfg.setProperty(cfgSelected,selected);}
+this.renderCellStyleSelected(dCellDate,cell);this.selectEvent.fire([selectDate]);this.doCellMouseOut.call(cell,null,this);}
+return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselect=function(date){var aToBeDeselected=this._toFieldArray(date);var validDates=[];var selected=[];var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;for(var a=0;a<aToBeDeselected.length;++a){var toDeselect=aToBeDeselected[a];if(!this.isDateOOB(this._toDate(toDeselect))){if(validDates.length===0){this.beforeDeselectEvent.fire();selected=this.cfg.getProperty(cfgSelected);}
+validDates.push(toDeselect);var index=this._indexOfSelectedFieldArray(toDeselect);if(index!=-1){selected.splice(index,1);}}}
+if(validDates.length>0){if(this.parent){this.parent.cfg.setProperty(cfgSelected,selected);}else{this.cfg.setProperty(cfgSelected,selected);}
+this.deselectEvent.fire(validDates);}
+return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectCell=function(cellIndex){var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var cellDateIndex=this._indexOfSelectedFieldArray(cellDate);var selectable=YAHOO.util.Dom.hasClass(cell,this.Style.CSS_CELL_SELECTABLE);if(selectable){this.beforeDeselectEvent.fire();var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var selected=this.cfg.getProperty(defCfg.SELECTED.key);var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();if(cellDateIndex>-1){if(this.cfg.getProperty(defCfg.PAGEDATE.key).getMonth()==dCellDate.getMonth()&&this.cfg.getProperty(defCfg.PAGEDATE.key).getFullYear()==dCellDate.getFullYear()){YAHOO.util.Dom.removeClass(cell,this.Style.CSS_CELL_SELECTED);}
 selected.splice(cellDateIndex,1);}
-if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}
-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",[]);}
+if(this.parent){this.parent.cfg.setProperty(defCfg.SELECTED.key,selected);}else{this.cfg.setProperty(defCfg.SELECTED.key,selected);}
+this.deselectEvent.fire(selectDate);}
+return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectAll=function(){this.beforeDeselectEvent.fire();var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;var selected=this.cfg.getProperty(cfgSelected);var count=selected.length;var sel=selected.concat();if(this.parent){this.parent.cfg.setProperty(cfgSelected,[]);}else{this.cfg.setProperty(cfgSelected,[]);}
 if(count>0){this.deselectEvent.fire(sel);}
-return this.getSelectedDates();};YAHOO.widget.Calendar.prototype._toFieldArray=function(date){var returnDate=[];if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(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()];}}
+return this.getSelectedDates();};YAHOO.widget.Calendar.prototype._toFieldArray=function(date){var returnDate=[];if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(YAHOO.lang.isString(date)){returnDate=this._parseDates(date);}else if(YAHOO.lang.isArray(date)){for(var i=0;i<date.length;++i){var d=date[i];returnDate[returnDate.length]=[d.getFullYear(),d.getMonth()+1,d.getDate()];}}
 return returnDate;};YAHOO.widget.Calendar.prototype._toDate=function(dateFieldArray){if(dateFieldArray instanceof Date){return dateFieldArray;}else{return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);}};YAHOO.widget.Calendar.prototype._fieldArraysAreEqual=function(array1,array2){var match=false;if(array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]){match=true;}
-return match;};YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray=function(find){var selected=-1;var seldates=this.cfg.getProperty("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;}}
-return selected;};YAHOO.widget.Calendar.prototype.isDateOOM=function(date){var isOOM=false;if(date.getMonth()!=this.cfg.getProperty("pagedate").getMonth()){isOOM=true;}
-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;}
+return match;};YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray=function(find){var selected=-1;var seldates=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);for(var s=0;s<seldates.length;++s){var sArray=seldates[s];if(find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]){selected=s;break;}}
+return selected;};YAHOO.widget.Calendar.prototype.isDateOOM=function(date){return(date.getMonth()!=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());};YAHOO.widget.Calendar.prototype.isDateOOB=function(date){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var minDate=this.cfg.getProperty(defCfg.MINDATE.key);var maxDate=this.cfg.getProperty(defCfg.MAXDATE.key);var dm=YAHOO.widget.DateMath;if(minDate){minDate=dm.clearTime(minDate);}
+if(maxDate){maxDate=dm.clearTime(maxDate);}
+var clearedDate=new Date(date.getTime());clearedDate=dm.clearTime(clearedDate);return((minDate&&clearedDate.getTime()<minDate.getTime())||(maxDate&&clearedDate.getTime()>maxDate.getTime()));};YAHOO.widget.Calendar.prototype._parsePageDate=function(date){var parsedDate;var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;if(date){if(date instanceof Date){parsedDate=YAHOO.widget.DateMath.findMonthStart(date);}else{var month,year,aMonthYear;aMonthYear=date.split(this.cfg.getProperty(defCfg.DATE_FIELD_DELIMITER.key));month=parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_MONTH_POSITION.key)-1],10)-1;year=parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_YEAR_POSITION.key)-1],10);parsedDate=new Date(year,month,1);}}else{parsedDate=new Date(this.today.getFullYear(),this.today.getMonth(),1);}
+return parsedDate;};YAHOO.widget.Calendar.prototype.onBeforeSelect=function(){if(this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key)===false){if(this.parent){this.parent.callChildFunction("clearAllBodyCellStyles",this.Style.CSS_CELL_SELECTED);this.parent.deselectAll();}else{this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);this.deselectAll();}}};YAHOO.widget.Calendar.prototype.onSelect=function(selected){};YAHOO.widget.Calendar.prototype.onBeforeDeselect=function(){};YAHOO.widget.Calendar.prototype.onDeselect=function(deselected){};YAHOO.widget.Calendar.prototype.onChangePage=function(){this.render();};YAHOO.widget.Calendar.prototype.onRender=function(){};YAHOO.widget.Calendar.prototype.onReset=function(){this.render();};YAHOO.widget.Calendar.prototype.onClear=function(){this.render();};YAHOO.widget.Calendar.prototype.validate=function(){return true;};YAHOO.widget.Calendar.prototype._parseDate=function(sDate){var aDate=sDate.split(this.Locale.DATE_FIELD_DELIMITER);var rArray;if(aDate.length==2){rArray=[aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar.MONTH_DAY;}else{rArray=[aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar.DATE;}
 for(var i=0;i<rArray.length;i++){rArray[i]=parseInt(rArray[i],10);}
 return rArray;};YAHOO.widget.Calendar.prototype._parseDates=function(sDates){var aReturn=[];var aDates=sDates.split(this.Locale.DATE_DELIMITER);for(var d=0;d<aDates.length;++d){var sDate=aDates[d];if(sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var aRange=sDate.split(this.Locale.DATE_RANGE_DELIMITER);var dateStart=this._parseDate(aRange[0]);var dateEnd=this._parseDate(aRange[1]);var fullRange=this._parseRange(dateStart,dateEnd);aReturn=aReturn.concat(fullRange);}else{var aDate=this._parseDate(sDate);aReturn.push(aDate);}}
 return aReturn;};YAHOO.widget.Calendar.prototype._parseRange=function(startDate,endDate){var dStart=new Date(startDate[0],startDate[1]-1,startDate[2]);var dCurrent=YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);var dEnd=new Date(endDate[0],endDate[1]-1,endDate[2]);var results=[];results.push(startDate);while(dCurrent.getTime()<=dEnd.getTime()){results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);dCurrent=YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);}
-return results;};YAHOO.widget.Calendar.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat();};YAHOO.widget.Calendar.prototype.clearElement=function(cell){cell.innerHTML="&#160;";cell.className="";};YAHOO.widget.Calendar.prototype.addRenderer=function(sDates,fnRender){var aDates=this._parseDates(sDates);for(var i=0;i<aDates.length;++i){var aDate=aDates[i];if(aDate.length==2){if(aDate[0]instanceof Array){this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);}else{this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);}}else if(aDate.length==3){this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);}}};YAHOO.widget.Calendar.prototype._addRenderer=function(type,aDates,fnRender){var add=[type,aDates,fnRender];this.renderStack.unshift(add);this._renderStack=this.renderStack.concat();};YAHOO.widget.Calendar.prototype.addMonthRenderer=function(month,fnRender){this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);};YAHOO.widget.Calendar.prototype.addWeekdayRenderer=function(weekday,fnRender){this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);};YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles=function(style){for(var c=0;c<this.cells.length;++c){YAHOO.util.Dom.removeClass(this.cells[c],style);}};YAHOO.widget.Calendar.prototype.setMonth=function(month){var current=this.cfg.getProperty("pagedate");current.setMonth(parseInt(month,10));this.cfg.setProperty("pagedate",current);};YAHOO.widget.Calendar.prototype.setYear=function(year){var current=this.cfg.getProperty("pagedate");current.setFullYear(parseInt(year,10));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);}
+return results;};YAHOO.widget.Calendar.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat();};YAHOO.widget.Calendar.prototype.clearElement=function(cell){cell.innerHTML="&#160;";cell.className="";};YAHOO.widget.Calendar.prototype.addRenderer=function(sDates,fnRender){var aDates=this._parseDates(sDates);for(var i=0;i<aDates.length;++i){var aDate=aDates[i];if(aDate.length==2){if(aDate[0]instanceof Array){this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);}else{this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);}}else if(aDate.length==3){this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);}}};YAHOO.widget.Calendar.prototype._addRenderer=function(type,aDates,fnRender){var add=[type,aDates,fnRender];this.renderStack.unshift(add);this._renderStack=this.renderStack.concat();};YAHOO.widget.Calendar.prototype.addMonthRenderer=function(month,fnRender){this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);};YAHOO.widget.Calendar.prototype.addWeekdayRenderer=function(weekday,fnRender){this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);};YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles=function(style){for(var c=0;c<this.cells.length;++c){YAHOO.util.Dom.removeClass(this.cells[c],style);}};YAHOO.widget.Calendar.prototype.setMonth=function(month){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;var current=this.cfg.getProperty(cfgPageDate);current.setMonth(parseInt(month,10));this.cfg.setProperty(cfgPageDate,current);};YAHOO.widget.Calendar.prototype.setYear=function(year){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;var current=this.cfg.getProperty(cfgPageDate);current.setFullYear(parseInt(year,10));this.cfg.setProperty(cfgPageDate,current);};YAHOO.widget.Calendar.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
 returnDates.sort(function(a,b){return a-b;});return returnDates;};YAHOO.widget.Calendar.prototype.hide=function(){this.oDomContainer.style.display="none";};YAHOO.widget.Calendar.prototype.show=function(){this.oDomContainer.style.display="block";};YAHOO.widget.Calendar.prototype.browser=function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}();YAHOO.widget.Calendar.prototype.toString=function(){return"Calendar "+this.id;};YAHOO.widget.Calendar_Core=YAHOO.widget.Calendar;YAHOO.widget.Cal_Core=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(id,containerId,config){if(arguments.length>0){this.init(id,containerId,config);}};YAHOO.widget.CalendarGroup.prototype.init=function(id,containerId,config){this.initEvents();this.initStyles();this.pages=[];this.id=id;this.containerId=containerId;this.oDomContainer=document.getElementById(containerId);YAHOO.util.Dom.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_CONTAINER);YAHOO.util.Dom.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_MULTI_UP);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.setupConfig();if(config){this.cfg.applyConfig(config,true);}
-this.cfg.fireQueue();if(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;}
-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");}
-if(p==(pageCount-1)){YAHOO.util.Dom.addClass(cal.oDomContainer,"last");}
-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);}
-return new YAHOO.widget.Calendar(id,containerId,config);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){month=parseInt(month,10);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){year=parseInt(year,10);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;}
+this.cfg.fireQueue();if(YAHOO.env.ua.opera){this.renderEvent.subscribe(this._fixWidth,this,true);}};YAHOO.widget.CalendarGroup.prototype.setupConfig=function(){var defCfg=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;this.cfg.addProperty(defCfg.PAGES.key,{value:defCfg.PAGES.value,validator:this.cfg.checkNumber,handler:this.configPages});this.cfg.addProperty(defCfg.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});this.cfg.addProperty(defCfg.SELECTED.key,{value:[],handler:this.configSelected});this.cfg.addProperty(defCfg.TITLE.key,{value:defCfg.TITLE.value,handler:this.configTitle});this.cfg.addProperty(defCfg.CLOSE.key,{value:defCfg.CLOSE.value,handler:this.configClose});this.cfg.addProperty(defCfg.IFRAME.key,{value:defCfg.IFRAME.value,handler:this.configIframe,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.MINDATE.key,{value:defCfg.MINDATE.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MAXDATE.key,{value:defCfg.MAXDATE.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MULTI_SELECT.key,{value:defCfg.MULTI_SELECT.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.START_WEEKDAY.key,{value:defCfg.START_WEEKDAY.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,{value:defCfg.SHOW_WEEKDAYS.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{value:defCfg.SHOW_WEEK_HEADER.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{value:defCfg.SHOW_WEEK_FOOTER.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{value:defCfg.HIDE_BLANK_WEEKS.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key,{value:defCfg.NAV_ARROW_LEFT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,{value:defCfg.NAV_ARROW_RIGHT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MONTHS_SHORT.key,{value:defCfg.MONTHS_SHORT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MONTHS_LONG.key,{value:defCfg.MONTHS_LONG.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key,{value:defCfg.WEEKDAYS_1CHAR.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key,{value:defCfg.WEEKDAYS_SHORT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,{value:defCfg.WEEKDAYS_MEDIUM.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,{value:defCfg.WEEKDAYS_LONG.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,{value:defCfg.LOCALE_MONTHS.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,{value:defCfg.LOCALE_WEEKDAYS.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.DATE_DELIMITER.key,{value:defCfg.DATE_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{value:defCfg.DATE_FIELD_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{value:defCfg.DATE_RANGE_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,{value:defCfg.MY_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,{value:defCfg.MY_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,{value:defCfg.MD_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,{value:defCfg.MD_DAY_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,{value:defCfg.MDY_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,{value:defCfg.MDY_DAY_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,{value:defCfg.MDY_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,{value:defCfg.MY_LABEL_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key,{value:defCfg.MY_LABEL_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,{value:defCfg.MY_LABEL_MONTH_SUFFIX.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key,{value:defCfg.MY_LABEL_YEAR_SUFFIX.value,handler:this.delegateConfig});};YAHOO.widget.CalendarGroup.prototype.initEvents=function(){var me=this;var strEvent="Event";var sub=function(fn,obj,bOverride){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+strEvent].subscribe(fn,obj,bOverride);}};var unsub=function(fn,obj){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+strEvent].unsubscribe(fn,obj);}};var defEvents=YAHOO.widget.Calendar._EVENT_TYPES;this.beforeSelectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);this.beforeSelectEvent.subscribe=sub;this.beforeSelectEvent.unsubscribe=unsub;this.selectEvent=new YAHOO.util.CustomEvent(defEvents.SELECT);this.selectEvent.subscribe=sub;this.selectEvent.unsubscribe=unsub;this.beforeDeselectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);this.beforeDeselectEvent.subscribe=sub;this.beforeDeselectEvent.unsubscribe=unsub;this.deselectEvent=new YAHOO.util.CustomEvent(defEvents.DESELECT);this.deselectEvent.subscribe=sub;this.deselectEvent.unsubscribe=unsub;this.changePageEvent=new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);this.changePageEvent.subscribe=sub;this.changePageEvent.unsubscribe=unsub;this.beforeRenderEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);this.beforeRenderEvent.subscribe=sub;this.beforeRenderEvent.unsubscribe=unsub;this.renderEvent=new YAHOO.util.CustomEvent(defEvents.RENDER);this.renderEvent.subscribe=sub;this.renderEvent.unsubscribe=unsub;this.resetEvent=new YAHOO.util.CustomEvent(defEvents.RESET);this.resetEvent.subscribe=sub;this.resetEvent.unsubscribe=unsub;this.clearEvent=new YAHOO.util.CustomEvent(defEvents.CLEAR);this.clearEvent.subscribe=sub;this.clearEvent.unsubscribe=unsub;};YAHOO.widget.CalendarGroup.prototype.configPages=function(type,args,obj){var pageCount=args[0];var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;var sep="_";var groupCalClass="groupcal";var firstClass="first-of-type";var lastClass="last-of-type";for(var p=0;p<pageCount;++p){var calId=this.id+sep+p;var calContainerId=this.containerId+sep+p;var childConfig=this.cfg.getConfig();childConfig.close=false;childConfig.title=false;var cal=this.constructChild(calId,calContainerId,childConfig);var caldate=cal.cfg.getProperty(cfgPageDate);this._setMonthOnDate(caldate,caldate.getMonth()+p);cal.cfg.setProperty(cfgPageDate,caldate);YAHOO.util.Dom.removeClass(cal.oDomContainer,this.Style.CSS_SINGLE);YAHOO.util.Dom.addClass(cal.oDomContainer,groupCalClass);if(p===0){YAHOO.util.Dom.addClass(cal.oDomContainer,firstClass);}
+if(p==(pageCount-1)){YAHOO.util.Dom.addClass(cal.oDomContainer,lastClass);}
+cal.parent=this;cal.index=p;this.pages[this.pages.length]=cal;}};YAHOO.widget.CalendarGroup.prototype.configPageDate=function(type,args,obj){var val=args[0];var firstPageDate;var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];if(p===0){firstPageDate=cal._parsePageDate(val);cal.cfg.setProperty(cfgPageDate,firstPageDate);}else{var pageDate=new Date(firstPageDate);this._setMonthOnDate(pageDate,pageDate.getMonth()+p);cal.cfg.setProperty(cfgPageDate,pageDate);}}};YAHOO.widget.CalendarGroup.prototype.configSelected=function(type,args,obj){var cfgSelected=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;this.delegateConfig(type,args,obj);var selected=(this.pages.length>0)?this.pages[0].cfg.getProperty(cfgSelected):[];this.cfg.setProperty(cfgSelected,selected,true);};YAHOO.widget.CalendarGroup.prototype.delegateConfig=function(type,args,obj){var val=args[0];var cal;for(var p=0;p<this.pages.length;p++){cal=this.pages[p];cal.cfg.setProperty(type,val);}};YAHOO.widget.CalendarGroup.prototype.setChildFunction=function(fnName,fn){var pageCount=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);for(var p=0;p<pageCount;++p){this.pages[p][fnName]=fn;}};YAHOO.widget.CalendarGroup.prototype.callChildFunction=function(fnName,args){var pageCount=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);for(var p=0;p<pageCount;++p){var page=this.pages[p];if(page[fnName]){var fn=page[fnName];fn.call(page,args);}}};YAHOO.widget.CalendarGroup.prototype.constructChild=function(id,containerId,config){var container=document.getElementById(containerId);if(!container){container=document.createElement("div");container.id=containerId;this.oDomContainer.appendChild(container);}
+return new YAHOO.widget.Calendar(id,containerId,config);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){month=parseInt(month,10);var currYear;var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty(cfgPageDate);if(p===0){currYear=pageDate.getFullYear();}else{pageDate.setYear(currYear);}
+this._setMonthOnDate(pageDate,month+p);cal.cfg.setProperty(cfgPageDate,pageDate);}};YAHOO.widget.CalendarGroup.prototype.setYear=function(year){var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;year=parseInt(year,10);for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty(cfgPageDate);if((pageDate.getMonth()+1)==1&&p>0){year+=1;}
 cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){this.renderHeader();for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.render();}
 this.renderFooter();};YAHOO.widget.CalendarGroup.prototype.select=function(date){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.select(date);}
 return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.selectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.selectCell(cellIndex);}
 return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselect=function(date){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselect(date);}
 return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselectAll=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselectAll();}
 return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselectCell(cellIndex);}
-return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.reset=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.reset();}};YAHOO.widget.CalendarGroup.prototype.clear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.clear();}};YAHOO.widget.CalendarGroup.prototype.nextMonth=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextMonth();}};YAHOO.widget.CalendarGroup.prototype.previousMonth=function(){for(var p=this.pages.length-1;p>=0;--p){var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextYear();}};YAHOO.widget.CalendarGroup.prototype.previousYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.previousYear();}};YAHOO.widget.CalendarGroup.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty("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);}
-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
+return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.reset=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.reset();}};YAHOO.widget.CalendarGroup.prototype.clear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.clear();}};YAHOO.widget.CalendarGroup.prototype.nextMonth=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextMonth();}};YAHOO.widget.CalendarGroup.prototype.previousMonth=function(){for(var p=this.pages.length-1;p>=0;--p){var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextYear();}};YAHOO.widget.CalendarGroup.prototype.previousYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.previousYear();}};YAHOO.widget.CalendarGroup.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
+returnDates.sort(function(a,b){return a-b;});return returnDates;};YAHOO.widget.CalendarGroup.prototype.addRenderer=function(sDates,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addRenderer(sDates,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addMonthRenderer=function(month,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addMonthRenderer(month,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer=function(weekday,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addWeekdayRenderer(weekday,fnRender);}};YAHOO.widget.CalendarGroup.prototype.renderHeader=function(){};YAHOO.widget.CalendarGroup.prototype.renderFooter=function(){};YAHOO.widget.CalendarGroup.prototype.addMonths=function(count){this.callChildFunction("addMonths",count);};YAHOO.widget.CalendarGroup.prototype.subtractMonths=function(count){this.callChildFunction("subtractMonths",count);};YAHOO.widget.CalendarGroup.prototype.addYears=function(count){this.callChildFunction("addYears",count);};YAHOO.widget.CalendarGroup.prototype.subtractYears=function(count){this.callChildFunction("subtractYears",count);};YAHOO.widget.CalendarGroup.prototype.show=function(){this.oDomContainer.style.display="block";if(YAHOO.env.ua.opera){this._fixWidth();}};YAHOO.widget.CalendarGroup.prototype._setMonthOnDate=function(date,iMonth){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420&&(iMonth<0||iMonth>11)){var DM=YAHOO.widget.DateMath;var newDate=DM.add(date,DM.MONTH,iMonth-date.getMonth());date.setTime(newDate.getTime());}else{date.setMonth(iMonth);}};YAHOO.widget.CalendarGroup.prototype._fixWidth=function(){var startW=this.oDomContainer.offsetWidth;var w=0;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];w+=cal.oDomContainer.offsetWidth;}
+if(w>0){this.oDomContainer.style.width=w+"px";}};YAHOO.widget.CalendarGroup.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.CalendarGroup.CSS_MULTI_UP="multi";YAHOO.widget.CalendarGroup.CSS_2UPTITLE="title";YAHOO.widget.CalendarGroup.CSS_2UPCLOSE="close-icon";YAHOO.lang.augmentProto(YAHOO.widget.CalendarGroup,YAHOO.widget.Calendar,"buildDayLabel","buildMonthLabel","renderOutOfBoundsDate","renderRowHeader","renderRowFooter","renderCellDefault","styleCellDefault","renderCellStyleHighlight1","renderCellStyleHighlight2","renderCellStyleHighlight3","renderCellStyleHighlight4","renderCellStyleToday","renderCellStyleSelected","renderCellNotThisMonth","renderBodyCellRestricted","initStyles","configTitle","configClose","configIframe","hide","browser");YAHOO.widget.CalendarGroup._DEFAULT_CONFIG=YAHOO.widget.Calendar._DEFAULT_CONFIG;YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES={key:"pages",value:2};YAHOO.widget.CalendarGroup.prototype.toString=function(){return"CalendarGroup "+this.id;};YAHOO.widget.CalGrp=YAHOO.widget.CalendarGroup;YAHOO.widget.Calendar2up=function(id,containerId,config){this.init(id,containerId,config);};YAHOO.extend(YAHOO.widget.Calendar2up,YAHOO.widget.CalendarGroup);YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up;YAHOO.register("calendar",YAHOO.widget.Calendar,{version:"2.3.0",build:"442"});
\ No newline at end of file
index 060b3ca8cda7dac270499e1d7cfb9bac6c774660..0f554186af867f38d14c0dc7754ced3d298e6be3 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
-*/
-/**
-* 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.
-* @namespace YAHOO.util
-* @class Config
-* @constructor
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config = function(owner) {
-       if (owner) {
-               this.init(owner);
-       }
-};
-
-YAHOO.util.Config.prototype = {
-       
-       /**
-       * Object reference to the owner of this Config Object
-       * @property owner
-       * @type Object
-       */
-       owner : null,
-
-       /**
-       * Boolean flag that specifies whether a queue is currently being executed
-       * @property queueInProgress
-       * @type Boolean
-       */
-       queueInProgress : false,
-
-
-       /**
-       * Validates that the value passed in is a Boolean.
-       * @method checkBoolean
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */      
-       checkBoolean: function(val) {
-               if (typeof val == 'boolean') {
-                       return true;
-               } else {
-                       return false;
-               }
-       },
-
-       /**
-       * Validates that the value passed in is a number.
-       * @method checkNumber
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */
-       checkNumber: function(val) {
-               if (isNaN(val)) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-};
-
-
-/**
-* Initializes the configuration Object and all of its local members.
-* @method init
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config.prototype.init = function(owner) {
-
-       this.owner = owner;
-
-       /**
-       * Object reference to the owner of this Config Object
-       * @event configChangedEvent
-       */
-       this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");
-
-       this.queueInProgress = false;
-
-       /* Private Members */
-
-       /**
-       * Maintains the local collection of configuration property objects and their specified values
-       * @property config
-       * @private
-       * @type Object
-       */ 
-       var config = {};
-
-       /**
-       * Maintains the local collection of configuration property objects as they were initially applied.
-       * This object is used when resetting a property.
-       * @property initialConfig
-       * @private
-       * @type Object
-       */ 
-       var initialConfig = {};
-
-       /**
-       * Maintains the local, normalized CustomEvent queue
-       * @property eventQueue
-       * @private
-       * @type Object
-       */ 
-       var eventQueue = [];
-
-       /**
-       * Fires a configuration property event using the specified value. 
-       * @method fireEvent
-       * @private
-       * @param {String}       key                     The configuration property's name
-       * @param {value}        Object          The value of the correct type for the property
-       */ 
-       var fireEvent = function( key, value ) {
-               key = key.toLowerCase();
-
-               var property = config[key];
-
-               if (typeof property != 'undefined' && property.event) {
-                       property.event.fire(value);
-               }       
-       };
-       /* End Private Members */
-
-       /**
-       * Adds a property to the Config Object's private config hash.
-       * @method addProperty
-       * @param {String}       key     The configuration property's name
-       * @param {Object}       propertyObject  The Object containing all of this property's arguments
-       */
-       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);
-               }
-
-               this.setProperty(key, propertyObject.value, true);
-               
-               if (! propertyObject.suppressEvent) {
-                       this.queueProperty(key, propertyObject.value);
-               }
-       };
-
-       /**
-       * Returns a key-value configuration map of the values currently set in the Config Object.
-       * @method getConfig
-       * @return {Object} The current config, represented in a key-value map
-       */
-       this.getConfig = function() {
-               var cfg = {};
-                       
-               for (var prop in config) {
-                       var property = config[prop];
-                       if (typeof property != 'undefined' && property.event) {
-                               cfg[prop] = property.value;
-                       }
-               }
-               
-               return cfg;
-       };
-
-       /**
-       * Returns the value of specified property.
-       * @method getProperty
-       * @param {String} key   The name of the property
-       * @return {Object}              The value of the specified property
-       */
-       this.getProperty = function(key) {
-               key = key.toLowerCase();
-
-               var property = config[key];
-               if (typeof property != 'undefined' && property.event) {
-                       return property.value;
-               } else {
-                       return undefined;
-               }
-       };
-
-       /**
-       * Resets the specified property's value to its initial value.
-       * @method resetProperty
-       * @param {String} key   The name of the property
-       * @return {Boolean} True is the property was reset, false if not
-       */
-       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]);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.
-       * @method setProperty
-       * @param {String} key           The name of the property
-       * @param {String} value         The value to set the property to
-       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.
-       * @return {Boolean}                     True, if the set was successful, false if it failed.
-       */
-       this.setProperty = function(key, value, silent) {
-               key = key.toLowerCase();
-
-               if (this.queueInProgress && ! silent) {
-                       this.queueProperty(key,value); // Currently running through a queue... 
-                       return true;
-               } else {
-                       var property = config[key];
-                       if (typeof property != 'undefined' && property.event) {
-                               if (property.validator && ! property.validator(value)) { // validator
-                                       return false;
-                               } else {
-                                       property.value = value;
-                                       if (! silent) {
-                                               fireEvent(key, value);
-                                               this.configChangedEvent.fire([key, value]);
-                                       }
-                                       return true;
-                               }
-                       } else {
-                               return false;
-                       }
-               }
-       };
-
-       /**
-       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is
-       * moved from its current position to the end of the queue.
-       * @method queueProperty
-       * @param {String} key   The name of the property
-       * @param {String} value The value to set the property to
-       * @return {Boolean}             true, if the set was successful, false if it failed.
-       */      
-       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)) { // validator
-                               return false;
-                       } else {
-
-                               if (typeof value != 'undefined') {
-                                       property.value = value;
-                               } else {
-                                       value = property.value;
-                               }
-
-                               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) {
-                                                       // found a dupe... push to end of queue, null current item, and break
-                                                       eventQueue[i] = null;
-                                                       eventQueue.push([key, (typeof value != 'undefined' ? value : queueItemValue)]);
-                                                       foundDuplicate = true;
-                                                       break;
-                                               }
-                                       }
-                               }
-                               
-                               if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue
-                                       eventQueue.push([key, value]);
-                               }
-                       }
-
-                       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;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Fires the event for a property using the property's current value.
-       * @method refireEvent
-       * @param {String} key   The name of the property
-       */
-       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);
-                       }
-               }
-       };
-
-       /**
-       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.
-       * Although the values will be set, fireQueue() must be called for their associated events to execute.
-       * @method applyConfig
-       * @param {Object}       userConfig      The configuration Object literal
-       * @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.
-       */
-       this.applyConfig = function(userConfig, init) {
-               if (init) {
-                       initialConfig = userConfig;
-               }
-               for (var prop in userConfig) {
-                       this.queueProperty(prop, userConfig[prop]);
-               }
-       };
-
-       /**
-       * Refires the events for all configuration properties using their current values.
-       * @method refresh
-       */
-       this.refresh = function() {
-               for (var prop in config) {
-                       this.refireEvent(prop);
-               }
-       };
-
-       /**
-       * Fires the normalized list of queued property change events
-       * @method fireQueue
-       */
-       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);
-                       }
-               }
-               
-               this.queueInProgress = false;
-               eventQueue = [];
-       };
-
-       /**
-       * Subscribes an external handler to the change event for any given property. 
-       * @method subscribeToConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.
-       * @return {Boolean}                             True, if the subscription was successful, otherwise false.
-       */      
-       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);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Unsubscribes an external handler from the change event for any given property. 
-       * @method unsubscribeFromConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @return {Boolean}                             True, if the unsubscription was successful, otherwise 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;
-               }
-       };
-
-       /**
-       * Returns a string representation of the Config object
-       * @method toString
-       * @return {String}      The Config object in string format.
-       */
-       this.toString = function() {
-               var output = "Config";
-               if (this.owner) {
-                       output += " [" + this.owner.toString() + "]";
-               }
-               return output;
-       };
-
-       /**
-       * Returns a string representation of the Config object's current CustomEvent queue
-       * @method outputEventQueue
-       * @return {String}      The string list of CustomEvents currently queued for execution
-       */
-       this.outputEventQueue = function() {
-               var output = "";
-               for (var q=0;q<eventQueue.length;q++) {
-                       var queueItem = eventQueue[q];
-                       if (queueItem) {
-                               output += queueItem[0] + "=" + queueItem[1] + ", ";
-                       }
-               }
-               return output;
-       };
-};
-
-/**
-* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent
-* @method YAHOO.util.Config.alreadySubscribed
-* @static
-* @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions
-* @param {Function}    fn      The function to look for in the subscribers list
-* @param {Object}      obj     The execution scope Object for the subscription
-* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in
-*/
-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;
-               }
-       }
-       return false;
-};
+version: 2.3.0
+*/
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.util
+    * @class Config
+    * @constructor
+    * @param {Object} owner The owner Object to which this Config Object belongs
+    */
+    YAHOO.util.Config = function (owner) {
+    
+        if (owner) {
+    
+            this.init(owner);
+    
+        }
+    
+        if (!owner) { 
+        
+    
+        }
+    
+    };
+
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,        
+        Config = YAHOO.util.Config;
+    
+
+    /**
+     * Constant representing the CustomEvent type for the config changed event.
+     * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT
+     * @private
+     * @static
+     * @final
+     */
+    Config.CONFIG_CHANGED_EVENT = "configChanged";
+    
+    /**
+     * Constant representing the boolean type string
+     * @property YAHOO.util.Config.BOOLEAN_TYPE
+     * @private
+     * @static
+     * @final
+     */
+    Config.BOOLEAN_TYPE = "boolean";
+    
+    Config.prototype = {
+     
+        /**
+        * Object reference to the owner of this Config Object
+        * @property owner
+        * @type Object
+        */
+        owner: null,
+        
+        /**
+        * Boolean flag that specifies whether a queue is currently 
+        * being executed
+        * @property queueInProgress
+        * @type Boolean
+        */
+        queueInProgress: false,
+        
+        /**
+        * Maintains the local collection of configuration property objects and 
+        * their specified values
+        * @property config
+        * @private
+        * @type Object
+        */ 
+        config: null,
+        
+        /**
+        * Maintains the local collection of configuration property objects as 
+        * they were initially applied.
+        * This object is used when resetting a property.
+        * @property initialConfig
+        * @private
+        * @type Object
+        */ 
+        initialConfig: null,
+        
+        /**
+        * Maintains the local, normalized CustomEvent queue
+        * @property eventQueue
+        * @private
+        * @type Object
+        */ 
+        eventQueue: null,
+        
+        /**
+        * Custom Event, notifying subscribers when Config properties are set 
+        * (setProperty is called without the silent flag
+        * @event configChangedEvent
+        */
+        configChangedEvent: null,
+    
+        /**
+        * Initializes the configuration Object and all of its local members.
+        * @method init
+        * @param {Object} owner The owner Object to which this Config 
+        * Object belongs
+        */
+        init: function (owner) {
+    
+            this.owner = owner;
+    
+            this.configChangedEvent = 
+                this.createEvent(Config.CONFIG_CHANGED_EVENT);
+    
+            this.configChangedEvent.signature = CustomEvent.LIST;
+            this.queueInProgress = false;
+            this.config = {};
+            this.initialConfig = {};
+            this.eventQueue = [];
+        
+        },
+        
+        /**
+        * Validates that the value passed in is a Boolean.
+        * @method checkBoolean
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */ 
+        checkBoolean: function (val) {
+            return (typeof val == Config.BOOLEAN_TYPE);
+        },
+        
+        /**
+        * Validates that the value passed in is a number.
+        * @method checkNumber
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */
+        checkNumber: function (val) {
+            return (!isNaN(val));
+        },
+        
+        /**
+        * Fires a configuration property event using the specified value. 
+        * @method fireEvent
+        * @private
+        * @param {String} key The configuration property's name
+        * @param {value} Object The value of the correct type for the property
+        */ 
+        fireEvent: function ( key, value ) {
+            var property = this.config[key];
+        
+            if (property && property.event) {
+                property.event.fire(value);
+            } 
+        },
+        
+        /**
+        * Adds a property to the Config Object's private config hash.
+        * @method addProperty
+        * @param {String} key The configuration property's name
+        * @param {Object} propertyObject The Object containing all of this 
+        * property's arguments
+        */
+        addProperty: function ( key, propertyObject ) {
+            key = key.toLowerCase();
+        
+            this.config[key] = propertyObject;
+        
+            propertyObject.event = this.createEvent(key, { scope: this.owner });
+            propertyObject.event.signature = CustomEvent.LIST;
+            
+            
+            propertyObject.key = key;
+        
+            if (propertyObject.handler) {
+                propertyObject.event.subscribe(propertyObject.handler, 
+                    this.owner);
+            }
+        
+            this.setProperty(key, propertyObject.value, true);
+            
+            if (! propertyObject.suppressEvent) {
+                this.queueProperty(key, propertyObject.value);
+            }
+            
+        },
+        
+        /**
+        * Returns a key-value configuration map of the values currently set in  
+        * the Config Object.
+        * @method getConfig
+        * @return {Object} The current config, represented in a key-value map
+        */
+        getConfig: function () {
+        
+            var cfg = {},
+                prop,
+                property;
+                
+            for (prop in this.config) {
+                property = this.config[prop];
+                if (property && property.event) {
+                    cfg[prop] = property.value;
+                }
+            }
+            
+            return cfg;
+        },
+        
+        /**
+        * Returns the value of specified property.
+        * @method getProperty
+        * @param {String} key The name of the property
+        * @return {Object}  The value of the specified property
+        */
+        getProperty: function (key) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.value;
+            } else {
+                return undefined;
+            }
+        },
+        
+        /**
+        * Resets the specified property's value to its initial value.
+        * @method resetProperty
+        * @param {String} key The name of the property
+        * @return {Boolean} True is the property was reset, false if not
+        */
+        resetProperty: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event) {
+    
+                if (this.initialConfig[key] && 
+                    !Lang.isUndefined(this.initialConfig[key])) {
+    
+                    this.setProperty(key, this.initialConfig[key]);
+    
+                }
+    
+                return true;
+    
+            } else {
+    
+                return false;
+            }
+    
+        },
+        
+        /**
+        * Sets the value of a property. If the silent property is passed as 
+        * true, the property's event will not be fired.
+        * @method setProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @param {Boolean} silent Whether the value should be set silently, 
+        * without firing the property event.
+        * @return {Boolean} True, if the set was successful, false if it failed.
+        */
+        setProperty: function (key, value, silent) {
+        
+            var property;
+        
+            key = key.toLowerCase();
+        
+            if (this.queueInProgress && ! silent) {
+                // Currently running through a queue... 
+                this.queueProperty(key,value);
+                return true;
+    
+            } else {
+                property = this.config[key];
+                if (property && property.event) {
+                    if (property.validator && !property.validator(value)) {
+                        return false;
+                    } else {
+                        property.value = value;
+                        if (! silent) {
+                            this.fireEvent(key, value);
+                            this.configChangedEvent.fire([key, value]);
+                        }
+                        return true;
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        
+        /**
+        * Sets the value of a property and queues its event to execute. If the 
+        * event is already scheduled to execute, it is
+        * moved from its current position to the end of the queue.
+        * @method queueProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @return {Boolean}  true, if the set was successful, false if 
+        * it failed.
+        */ 
+        queueProperty: function (key, value) {
+        
+            key = key.toLowerCase();
+        
+            var property = this.config[key],
+                foundDuplicate = false,
+                iLen,
+                queueItem,
+                queueItemKey,
+                queueItemValue,
+                sLen,
+                supercedesCheck,
+                qLen,
+                queueItemCheck,
+                queueItemCheckKey,
+                queueItemCheckValue,
+                i,
+                s,
+                q;
+                                
+            if (property && property.event) {
+    
+                if (!Lang.isUndefined(value) && property.validator && 
+                    !property.validator(value)) { // validator
+                    return false;
+                } else {
+        
+                    if (!Lang.isUndefined(value)) {
+                        property.value = value;
+                    } else {
+                        value = property.value;
+                    }
+        
+                    foundDuplicate = false;
+                    iLen = this.eventQueue.length;
+        
+                    for (i = 0; i < iLen; i++) {
+                        queueItem = this.eventQueue[i];
+        
+                        if (queueItem) {
+                            queueItemKey = queueItem[0];
+                            queueItemValue = queueItem[1];
+                            
+                            if (queueItemKey == key) {
+    
+                                /*
+                                    found a dupe... push to end of queue, null 
+                                    current item, and break
+                                */
+    
+                                this.eventQueue[i] = null;
+    
+                                this.eventQueue.push(
+                                    [key, (!Lang.isUndefined(value) ? 
+                                    value : queueItemValue)]);
+    
+                                foundDuplicate = true;
+                                break;
+                            }
+                        }
+                    }
+                    
+                    // this is a refire, or a new property in the queue
+    
+                    if (! foundDuplicate && !Lang.isUndefined(value)) { 
+                        this.eventQueue.push([key, value]);
+                    }
+                }
+        
+                if (property.supercedes) {
+        
+                    sLen = property.supercedes.length;
+        
+                    for (s = 0; s < sLen; s++) {
+        
+                        supercedesCheck = property.supercedes[s];
+                        qLen = this.eventQueue.length;
+        
+                        for (q = 0; q < qLen; q++) {
+                            queueItemCheck = this.eventQueue[q];
+        
+                            if (queueItemCheck) {
+                                queueItemCheckKey = queueItemCheck[0];
+                                queueItemCheckValue = queueItemCheck[1];
+                                
+                                if (queueItemCheckKey == 
+                                    supercedesCheck.toLowerCase() ) {
+    
+                                    this.eventQueue.push([queueItemCheckKey, 
+                                        queueItemCheckValue]);
+    
+                                    this.eventQueue[q] = null;
+                                    break;
+    
+                                }
+                            }
+                        }
+                    }
+                }
+
+        
+                return true;
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Fires the event for a property using the property's current value.
+        * @method refireEvent
+        * @param {String} key The name of the property
+        */
+        refireEvent: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event && 
+    
+                !Lang.isUndefined(property.value)) {
+    
+                if (this.queueInProgress) {
+    
+                    this.queueProperty(key);
+    
+                } else {
+    
+                    this.fireEvent(key, property.value);
+    
+                }
+    
+            }
+        },
+        
+        /**
+        * Applies a key-value Object literal to the configuration, replacing  
+        * any existing values, and queueing the property events.
+        * Although the values will be set, fireQueue() must be called for their 
+        * associated events to execute.
+        * @method applyConfig
+        * @param {Object} userConfig The configuration Object literal
+        * @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.
+        */
+        applyConfig: function (userConfig, init) {
+        
+            var prop;
+        
+            if (init) {
+                this.initialConfig = userConfig;
+            }
+            for (prop in userConfig) {
+                this.queueProperty(prop, userConfig[prop]);
+            }
+        },
+        
+        /**
+        * Refires the events for all configuration properties using their 
+        * current values.
+        * @method refresh
+        */
+        refresh: function () {
+        
+            var prop;
+        
+            for (prop in this.config) {
+                this.refireEvent(prop);
+            }
+        },
+        
+        /**
+        * Fires the normalized list of queued property change events
+        * @method fireQueue
+        */
+        fireQueue: function () {
+        
+            var i, 
+                queueItem,
+                key,
+                value,
+                property;
+        
+            this.queueInProgress = true;
+            for (i = 0;i < this.eventQueue.length; i++) {
+                queueItem = this.eventQueue[i];
+                if (queueItem) {
+        
+                    key = queueItem[0];
+                    value = queueItem[1];
+                    property = this.config[key];
+        
+                    property.value = value;
+        
+                    this.fireEvent(key,value);
+                }
+            }
+            
+            this.queueInProgress = false;
+            this.eventQueue = [];
+        },
+        
+        /**
+        * Subscribes an external handler to the change event for any 
+        * given property. 
+        * @method subscribeToConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event handler 
+        * (see CustomEvent documentation)
+        * @param {Boolean} override Optional. If true, will override "this"  
+        * within the handler to map to the scope Object passed into the method.
+        * @return {Boolean} True, if the subscription was successful, 
+        * otherwise false.
+        */ 
+        subscribeToConfigEvent: function (key, handler, obj, override) {
+    
+            var property = this.config[key.toLowerCase()];
+    
+            if (property && property.event) {
+    
+                if (!Config.alreadySubscribed(property.event, handler, obj)) {
+    
+                    property.event.subscribe(handler, obj, override);
+    
+                }
+    
+                return true;
+    
+            } else {
+    
+                return false;
+    
+            }
+    
+        },
+        
+        /**
+        * Unsubscribes an external handler from the change event for any 
+        * given property. 
+        * @method unsubscribeFromConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event 
+        * handler (see CustomEvent documentation)
+        * @return {Boolean} True, if the unsubscription was successful, 
+        * otherwise false.
+        */
+        unsubscribeFromConfigEvent: function (key, handler, obj) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.event.unsubscribe(handler, obj);
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Returns a string representation of the Config object
+        * @method toString
+        * @return {String} The Config object in string format.
+        */
+        toString: function () {
+            var output = "Config";
+            if (this.owner) {
+                output += " [" + this.owner.toString() + "]";
+            }
+            return output;
+        },
+        
+        /**
+        * Returns a string representation of the Config object's current 
+        * CustomEvent queue
+        * @method outputEventQueue
+        * @return {String} The string list of CustomEvents currently queued 
+        * for execution
+        */
+        outputEventQueue: function () {
+
+            var output = "",
+                queueItem,
+                q,
+                nQueue = this.eventQueue.length;
+              
+            for (q = 0; q < nQueue; q++) {
+                queueItem = this.eventQueue[q];
+                if (queueItem) {
+                    output += queueItem[0] + "=" + queueItem[1] + ", ";
+                }
+            }
+            return output;
+        },
+
+        /**
+        * Sets all properties to null, unsubscribes all listeners from each 
+        * property's change event and all listeners from the configChangedEvent.
+        * @method destroy
+        */
+        destroy: function () {
+
+            var oConfig = this.config,
+                sProperty,
+                oProperty;
+
+
+            for (sProperty in oConfig) {
+            
+                if (Lang.hasOwnProperty(oConfig, sProperty)) {
+
+                    oProperty = oConfig[sProperty];
+
+                    oProperty.event.unsubscribeAll();
+                    oProperty.event = null;
+
+                }
+            
+            }
+            
+            this.configChangedEvent.unsubscribeAll();
+            
+            this.configChangedEvent = null;
+            this.owner = null;
+            this.config = null;
+            this.initialConfig = null;
+            this.eventQueue = null;
+        
+        }
+
+    };
+    
+    
+    
+    /**
+    * Checks to determine if a particular function/Object pair are already 
+    * subscribed to the specified CustomEvent
+    * @method YAHOO.util.Config.alreadySubscribed
+    * @static
+    * @param {YAHOO.util.CustomEvent} evt The CustomEvent for which to check 
+    * the subscriptions
+    * @param {Function} fn The function to look for in the subscribers list
+    * @param {Object} obj The execution scope Object for the subscription
+    * @return {Boolean} true, if the function/Object pair is already subscribed 
+    * to the CustomEvent passed in
+    */
+    Config.alreadySubscribed = function (evt, fn, obj) {
+    
+        var nSubscribers = evt.subscribers.length,
+            subsc,
+            i;
+
+        if (nSubscribers > 0) {
+
+            i = nSubscribers - 1;
+        
+            do {
+
+                subsc = evt.subscribers[i];
+
+                if (subsc && subsc.obj == obj && subsc.fn == fn) {
+        
+                    return true;
+        
+                }    
+            
+            }
+            while (i--);
+        
+        }
+    
+        return false;
+    
+    };
+    
+    YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
+
+}());
 
 /**
 * YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility
@@ -665,7 +884,6 @@ YAHOO.widget.DateMath = {
        * @param {Date} date    The JavaScript date for which to find the week number
        * @param {Number} calendarYear  OPTIONAL - The calendar year to use for determining the week number. Default is
        *                                                                                       the calendar year of parameter "date".
-       * @param {Number} weekStartsOn  OPTIONAL - The integer (0-6) representing which day a week begins on. Default is 0 (for Sunday).
        * @return {Number}      The week number of the given date.
        */
        getWeekNumber : function(date, calendarYear) {
@@ -746,7 +964,7 @@ YAHOO.widget.DateMath = {
 };
 
 /**
-* 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.
+* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month  or multi-month interface. Calendars are generated entirely via script and can be navigated without any page refreshes.
 * @module    calendar
 * @title     Calendar
 * @namespace YAHOO.widget
@@ -763,7 +981,6 @@ YAHOO.widget.DateMath = {
 *      <xmp>
 *              <div id="cal1Container"></div>
 *      </xmp>
-* Note that the table can be replaced with any kind of element.
 * </p>
 * @namespace YAHOO.widget
 * @class Calendar
@@ -780,9 +997,10 @@ YAHOO.widget.Calendar = function(id, containerId, config) {
 * The path to be used for images loaded for the Calendar
 * @property YAHOO.widget.Calendar.IMG_ROOT
 * @static
+* @deprecated  You can now customize images by overriding the calclose, calnavleft and calnavright default CSS classes for the close icon, left arrow and right arrow respectively
 * @type String
 */
-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.IMG_ROOT = null;
 
 /**
 * Type constant used for renderers to represent an individual date (M/D/Y)
@@ -847,6 +1065,153 @@ YAHOO.widget.Calendar.DISPLAY_DAYS = 42;
 */
 YAHOO.widget.Calendar.STOP_RENDER = "S";
 
+/**
+* Constant used to represent short date field string formats (e.g. Tu or Feb)
+* @property YAHOO.widget.Calendar.SHORT
+* @static
+* @final
+* @type String
+*/
+YAHOO.widget.Calendar.SHORT = "short";
+
+/**
+* Constant used to represent long date field string formats (e.g. Monday or February)
+* @property YAHOO.widget.Calendar.LONG
+* @static
+* @final
+* @type String
+*/
+YAHOO.widget.Calendar.LONG = "long";
+
+/**
+* Constant used to represent medium date field string formats (e.g. Mon)
+* @property YAHOO.widget.Calendar.MEDIUM
+* @static
+* @final
+* @type String
+*/
+YAHOO.widget.Calendar.MEDIUM = "medium";
+
+/**
+* Constant used to represent single character date field string formats (e.g. M, T, W)
+* @property YAHOO.widget.Calendar.ONE_CHAR
+* @static
+* @final
+* @type String
+*/
+YAHOO.widget.Calendar.ONE_CHAR = "1char";
+
+/**
+* The set of default Config property keys and values for the Calendar
+* @property YAHOO.widget.Calendar._DEFAULT_CONFIG
+* @final
+* @static
+* @private
+* @type Object
+*/
+YAHOO.widget.Calendar._DEFAULT_CONFIG = {
+       // Default values for pagedate and selected are not class level constants - they are set during instance creation 
+       PAGEDATE : {key:"pagedate", value:null},
+       SELECTED : {key:"selected", value:null},
+       TITLE : {key:"title", value:""},
+       CLOSE : {key:"close", value:false},
+       IFRAME : {key:"iframe", value:(YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) ? true : false},
+       MINDATE : {key:"mindate", value:null},
+       MAXDATE : {key:"maxdate", value:null},
+       MULTI_SELECT : {key:"multi_select", value:false},
+       START_WEEKDAY : {key:"start_weekday", value:0},
+       SHOW_WEEKDAYS : {key:"show_weekdays", value:true},
+       SHOW_WEEK_HEADER : {key:"show_week_header", value:false},
+       SHOW_WEEK_FOOTER : {key:"show_week_footer", value:false},
+       HIDE_BLANK_WEEKS : {key:"hide_blank_weeks", value:false},
+       NAV_ARROW_LEFT: {key:"nav_arrow_left", value:null} ,
+       NAV_ARROW_RIGHT : {key:"nav_arrow_right", value:null} ,
+       MONTHS_SHORT : {key:"months_short", value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]},
+       MONTHS_LONG: {key:"months_long", value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]},
+       WEEKDAYS_1CHAR: {key:"weekdays_1char", value:["S", "M", "T", "W", "T", "F", "S"]},
+       WEEKDAYS_SHORT: {key:"weekdays_short", value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]},
+       WEEKDAYS_MEDIUM: {key:"weekdays_medium", value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]},
+       WEEKDAYS_LONG: {key:"weekdays_long", value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]},
+       LOCALE_MONTHS:{key:"locale_months", value:"long"},
+       LOCALE_WEEKDAYS:{key:"locale_weekdays", value:"short"},
+       DATE_DELIMITER:{key:"date_delimiter", value:","},
+       DATE_FIELD_DELIMITER:{key:"date_field_delimiter", value:"/"},
+       DATE_RANGE_DELIMITER:{key:"date_range_delimiter", value:"-"},
+       MY_MONTH_POSITION:{key:"my_month_position", value:1},
+       MY_YEAR_POSITION:{key:"my_year_position", value:2},
+       MD_MONTH_POSITION:{key:"md_month_position", value:1},
+       MD_DAY_POSITION:{key:"md_day_position", value:2},
+       MDY_MONTH_POSITION:{key:"mdy_month_position", value:1},
+       MDY_DAY_POSITION:{key:"mdy_day_position", value:2},
+       MDY_YEAR_POSITION:{key:"mdy_year_position", value:3},
+       MY_LABEL_MONTH_POSITION:{key:"my_label_month_position", value:1},
+       MY_LABEL_YEAR_POSITION:{key:"my_label_year_position", value:2},
+       MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix", value:" "},
+       MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix", value:""}
+};
+
+/**
+* The set of Custom Event types supported by the Calendar
+* @property YAHOO.widget.Calendar._EVENT_TYPES
+* @final
+* @static
+* @private
+* @type Object
+*/
+YAHOO.widget.Calendar._EVENT_TYPES = {
+       BEFORE_SELECT : "beforeSelect", 
+       SELECT : "select",
+       BEFORE_DESELECT : "beforeDeselect",
+       DESELECT : "deselect",
+       CHANGE_PAGE : "changePage",
+       BEFORE_RENDER : "beforeRender",
+       RENDER : "render",
+       RESET : "reset",
+       CLEAR : "clear"
+};
+
+/**
+* The set of default style constants for the Calendar
+* @property YAHOO.widget.Calendar._STYLES
+* @final
+* @static
+* @private
+* @type Object
+*/
+YAHOO.widget.Calendar._STYLES = {
+       CSS_ROW_HEADER: "calrowhead",
+       CSS_ROW_FOOTER: "calrowfoot",
+       CSS_CELL : "calcell",
+       CSS_CELL_SELECTOR : "selector",
+       CSS_CELL_SELECTED : "selected",
+       CSS_CELL_SELECTABLE : "selectable",
+       CSS_CELL_RESTRICTED : "restricted",
+       CSS_CELL_TODAY : "today",
+       CSS_CELL_OOM : "oom",
+       CSS_CELL_OOB : "previous",
+       CSS_HEADER : "calheader",
+       CSS_HEADER_TEXT : "calhead",
+       CSS_BODY : "calbody",
+       CSS_WEEKDAY_CELL : "calweekdaycell",
+       CSS_WEEKDAY_ROW : "calweekdayrow",
+       CSS_FOOTER : "calfoot",
+       CSS_CALENDAR : "yui-calendar",
+       CSS_SINGLE : "single",
+       CSS_CONTAINER : "yui-calcontainer",
+       CSS_NAV_LEFT : "calnavleft",
+       CSS_NAV_RIGHT : "calnavright",
+       CSS_CLOSE : "calclose",
+       CSS_CELL_TOP : "calcelltop",
+       CSS_CELL_LEFT : "calcellleft",
+       CSS_CELL_RIGHT : "calcellright",
+       CSS_CELL_BOTTOM : "calcellbottom",
+       CSS_CELL_HOVER : "calcellhover",
+       CSS_CELL_HIGHLIGHT1 : "highlight1",
+       CSS_CELL_HIGHLIGHT2 : "highlight2",
+       CSS_CELL_HIGHLIGHT3 : "highlight3",
+       CSS_CELL_HIGHLIGHT4 : "highlight4"
+};
+
 YAHOO.widget.Calendar.prototype = {
 
        /**
@@ -922,14 +1287,6 @@ YAHOO.widget.Calendar.prototype = {
        */
        _renderStack : null,
 
-       /**
-       * A Date object representing the month/year that the calendar is initially set to
-       * @property _pageDate
-       * @private
-       * @type Date
-       */
-       _pageDate : null,
-
        /**
        * The private list of initially selected dates.
        * @property _selectedDates
@@ -988,7 +1345,7 @@ YAHOO.widget.Calendar.prototype.init = function(id, containerId, config) {
 
        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 = [];
@@ -1004,30 +1361,41 @@ YAHOO.widget.Calendar.prototype.init = function(id, containerId, config) {
 };
 
 /**
-* Renders the built-in IFRAME shim for the IE6 and below
+* Default Config listener for the iframe property. If the iframe config property is set to true, 
+* renders the built-in IFRAME shim if the container is relatively or absolutely positioned.
+* 
 * @method configIframe
 */
 YAHOO.widget.Calendar.prototype.configIframe = function(type, args, obj) {
        var useIframe = args[0];
 
-       if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {
-               if (useIframe) {
-                       var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");
+       if (!this.parent) {
+               if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {
+                       if (useIframe) {
+                               var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");
+                               
+                               if (pos == "absolute" || pos == "relative") {
+                                       
+                                       if (!YAHOO.util.Dom.inDocument(this.iframe)) {
+                                               this.iframe = document.createElement("iframe");
+                                               this.iframe.src = "javascript:false;";
+
+                                               YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");
+
+                                               if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
+                                                       YAHOO.util.Dom.addClass(this.iframe, "fixedsize");
+                                               }
 
-                       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);
+                                               this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);
+                                       }
                                }
-                       }
-               } else {
-                       if (this.iframe) {
-                               if (this.iframe.parentNode) {
-                                       this.iframe.parentNode.removeChild(this.iframe);
+                       } else {
+                               if (this.iframe) {
+                                       if (this.iframe.parentNode) {
+                                               this.iframe.parentNode.removeChild(this.iframe);
+                                       }
+                                       this.iframe = null;
                                }
-                               this.iframe = null;
                        }
                }
        }
@@ -1039,7 +1407,7 @@ YAHOO.widget.Calendar.prototype.configIframe = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.configTitle = function(type, args, obj) {
        var title = args[0];
-       var close = this.cfg.getProperty("close");
+       var close = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);
        
        var titleDiv;
 
@@ -1068,24 +1436,31 @@ YAHOO.widget.Calendar.prototype.configTitle = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.configClose = function(type, args, obj) {
        var close = args[0];
-       var title = this.cfg.getProperty("title");
+       var title = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);
+       
+       var DEPR_CLOSE_PATH = "us/my/bn/x_d.gif";
 
        var linkClose;
 
        if (close === true) {
                linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || document.createElement("a");
-               linkClose.href = "javascript:void(null);";
+               linkClose.href = "#";
                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);
+               YAHOO.util.Event.addListener(linkClose, "click", function(e, cal) {cal.hide(); YAHOO.util.Event.preventDefault(e); }, this);
+               
+               if (YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                       var imgClose = document.createElement("img");
+                       imgClose.src = YAHOO.widget.Calendar.IMG_ROOT + DEPR_CLOSE_PATH;
+                       imgClose.className = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;
+                       linkClose.appendChild(imgClose);
+               } else {
+                       linkClose.innerHTML = '<span class="' + YAHOO.widget.CalendarGroup.CSS_2UPCLOSE + ' ' + this.Style.CSS_CLOSE + '"></span>';
+               }
+               
                this.oDomContainer.appendChild(linkClose);
                YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");
        } else {
                linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || null;
-
                if (linkClose) {
                        YAHOO.util.Event.purgeElement(linkClose);
                        this.oDomContainer.removeChild(linkClose);
@@ -1102,61 +1477,63 @@ YAHOO.widget.Calendar.prototype.configClose = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.initEvents = function() {
 
+       var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
+
        /**
        * Fired before a selection is made
        * @event beforeSelectEvent
        */
-       this.beforeSelectEvent = new YAHOO.util.CustomEvent("beforeSelect"); 
+       this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT); 
 
        /**
        * Fired when a selection is made
        * @event selectEvent
        * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
        */
-       this.selectEvent = new YAHOO.util.CustomEvent("select");
+       this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT);
 
        /**
        * Fired before a selection is made
        * @event beforeDeselectEvent
        */
-       this.beforeDeselectEvent = new YAHOO.util.CustomEvent("beforeDeselect");
+       this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);
 
        /**
        * Fired when a selection is made
        * @event deselectEvent
        * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
        */
-       this.deselectEvent = new YAHOO.util.CustomEvent("deselect");
+       this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT);
 
        /**
        * Fired when the Calendar page is changed
        * @event changePageEvent
        */
-       this.changePageEvent = new YAHOO.util.CustomEvent("changePage");
+       this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);
 
        /**
        * Fired before the Calendar is rendered
        * @event beforeRenderEvent
        */
-       this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");
+       this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
 
        /**
        * Fired when the Calendar is rendered
        * @event renderEvent
        */
-       this.renderEvent = new YAHOO.util.CustomEvent("render");
+       this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
 
        /**
        * Fired when the Calendar is reset
        * @event resetEvent
        */
-       this.resetEvent = new YAHOO.util.CustomEvent("reset");
+       this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET);
 
        /**
        * Fired when the Calendar is cleared
        * @event clearEvent
        */
-       this.clearEvent = new YAHOO.util.CustomEvent("clear");
+       this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
 
        this.beforeSelectEvent.subscribe(this.onBeforeSelect, this, true);
        this.selectEvent.subscribe(this.onSelect, this, true);
@@ -1168,7 +1545,6 @@ YAHOO.widget.Calendar.prototype.initEvents = function() {
        this.clearEvent.subscribe(this.onClear, this, true);
 };
 
-
 /**
 * The default event function that is attached to a date link within a calendar cell
 * when the calendar is rendered.
@@ -1177,17 +1553,30 @@ YAHOO.widget.Calendar.prototype.initEvents = function() {
 * @param {Calendar} cal        A reference to the calendar passed by the Event utility
 */
 YAHOO.widget.Calendar.prototype.doSelectCell = function(e, cal) {
+       var cell,index,d,date;
+
        var target = YAHOO.util.Event.getTarget(e);
+       var tagName = target.tagName.toLowerCase();
+       var defSelector = false;
 
-       var cell,index,d,date;
+       while (tagName != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
+
+               if (!defSelector && tagName == "a" && YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTOR)) {
+                       defSelector = true;     
+               }
 
-       while (target.tagName.toLowerCase() != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
                target = target.parentNode;
-               if (target.tagName.toLowerCase() == "html") {
+               tagName = target.tagName.toLowerCase(); 
+               if (tagName == "html") {
                        return;
                }
        }
-       
+
+       if (defSelector) {
+               // Stop link href navigation for default renderer
+               YAHOO.util.Event.preventDefault(e);
+       }
+
        cell = target;
 
        if (YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) {
@@ -1202,16 +1591,16 @@ YAHOO.widget.Calendar.prototype.doSelectCell = function(e, cal) {
                        if (link) {
                                link.blur();
                        }
-                       
+
                        var cellDate = cal.cellDates[index];
                        var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);
-                       
+
                        if (cellDateIndex > -1) {       
                                cal.deselectCell(index);
                        } else {
                                cal.selectCell(index);
                        }       
-                       
+
                } else {
                        link = cell.getElementsByTagName("a")[0];
                        if (link) {
@@ -1276,13 +1665,15 @@ YAHOO.widget.Calendar.prototype.doCellMouseOut = function(e, cal) {
 
 YAHOO.widget.Calendar.prototype.setupConfig = function() {
 
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+
        /**
        * The month/year representing the current visible Calendar date (mm/yyyy)
        * @config pagedate
        * @type String
        * @default today's date
        */
-       this.cfg.addProperty("pagedate", { value:new Date(), handler:this.configPageDate } );
+       this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
 
        /**
        * The date or range of dates representing the current Calendar selection
@@ -1290,7 +1681,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default []
        */
-       this.cfg.addProperty("selected", { value:[], handler:this.configSelected } );
+       this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
 
        /**
        * The title to display above the Calendar's month header
@@ -1298,7 +1689,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default ""
        */
-       this.cfg.addProperty("title", { value:"", handler:this.configTitle } );
+       this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
 
        /**
        * Whether or not a close button should be displayed for this Calendar
@@ -1306,15 +1697,18 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("close", { value:false, handler:this.configClose } );
+       this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
 
        /**
        * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
+       * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
+       * enabled if required.
+       * 
        * @config iframe
        * @type Boolean
-       * @default true
+       * @default true for IE6 and below, false for all other browsers
        */
-       this.cfg.addProperty("iframe", { value:true, handler:this.configIframe, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
 
        /**
        * The minimum selectable date in the current Calendar (mm/dd/yyyy)
@@ -1322,7 +1716,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default null
        */
-       this.cfg.addProperty("mindate", { value:null, handler:this.configMinDate } );
+       this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.configMinDate } );
 
        /**
        * The maximum selectable date in the current Calendar (mm/dd/yyyy)
@@ -1330,7 +1724,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default null
        */
-       this.cfg.addProperty("maxdate", { value:null, handler:this.configMaxDate } );
+       this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.configMaxDate } );
 
 
        // Options properties
@@ -1341,7 +1735,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("MULTI_SELECT",    { value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
 
        /**
        * The weekday the week begins on. Default is 0 (Sunday).
@@ -1349,7 +1743,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type number
        * @default 0
        */
-       this.cfg.addProperty("START_WEEKDAY",   { value:0, handler:this.configOptions, validator:this.cfg.checkNumber  } );
+       this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.configOptions, validator:this.cfg.checkNumber  } );
 
        /**
        * True if the Calendar should show weekday labels. True by default.
@@ -1357,7 +1751,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default true
        */
-       this.cfg.addProperty("SHOW_WEEKDAYS",   { value:true, handler:this.configOptions, validator:this.cfg.checkBoolean  } );
+       this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.configOptions, validator:this.cfg.checkBoolean  } );
 
        /**
        * True if the Calendar should show week row headers. False by default.
@@ -1365,7 +1759,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("SHOW_WEEK_HEADER",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key, { value:defCfg.SHOW_WEEK_HEADER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
 
        /**
        * True if the Calendar should show week row footers. False by default.
@@ -1373,7 +1767,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */      
-       this.cfg.addProperty("SHOW_WEEK_FOOTER",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
 
        /**
        * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
@@ -1381,23 +1775,25 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */      
-       this.cfg.addProperty("HIDE_BLANK_WEEKS",{ value:false, handler:this.configOptions, validator:this.cfg.checkBoolean } );
-
+       this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key, { value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+       
        /**
        * The image that should be used for the left navigation arrow.
        * @config NAV_ARROW_LEFT
        * @type String
-       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif"
+       * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"  
+       * @default null
        */      
-       this.cfg.addProperty("NAV_ARROW_LEFT",  { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif", handler:this.configOptions } );
+       this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.configOptions } );
 
        /**
-       * The image that should be used for the left navigation arrow.
+       * The image that should be used for the right navigation arrow.
        * @config NAV_ARROW_RIGHT
        * @type String
-       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif"
+       * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
+       * @default null
        */      
-       this.cfg.addProperty("NAV_ARROW_RIGHT", { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif", handler:this.configOptions } );
+       this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key, { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.configOptions } );
 
        // Locale properties
 
@@ -1407,7 +1803,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
        */
-       this.cfg.addProperty("MONTHS_SHORT",    { value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.configLocale } );
        
        /**
        * The long month labels for the current locale.
@@ -1415,7 +1811,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
        */      
-       this.cfg.addProperty("MONTHS_LONG",             { value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.configLocale } );
        
        /**
        * The 1-character weekday labels for the current locale.
@@ -1423,7 +1819,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["S", "M", "T", "W", "T", "F", "S"]
        */      
-       this.cfg.addProperty("WEEKDAYS_1CHAR",  { value:["S", "M", "T", "W", "T", "F", "S"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.configLocale } );
        
        /**
        * The short weekday labels for the current locale.
@@ -1431,7 +1827,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
        */      
-       this.cfg.addProperty("WEEKDAYS_SHORT",  { value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.configLocale } );
        
        /**
        * The medium weekday labels for the current locale.
@@ -1439,7 +1835,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
        */      
-       this.cfg.addProperty("WEEKDAYS_MEDIUM", { value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.configLocale } );
        
        /**
        * The long weekday labels for the current locale.
@@ -1447,7 +1843,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
        */      
-       this.cfg.addProperty("WEEKDAYS_LONG",   { value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.configLocale } );
 
        /**
        * Refreshes the locale values used to build the Calendar.
@@ -1455,17 +1851,17 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @private
        */
        var refreshLocale = function() {
-               this.cfg.refireEvent("LOCALE_MONTHS");
-               this.cfg.refireEvent("LOCALE_WEEKDAYS");
+               this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
+               this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
        };
 
-       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.subscribeToConfigEvent(defCfg.START_WEEKDAY.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.MONTHS_SHORT.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.MONTHS_LONG.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_1CHAR.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_SHORT.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_MEDIUM.key, refreshLocale, this, true);
+       this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_LONG.key, refreshLocale, this, true);
        
        /**
        * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
@@ -1473,7 +1869,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default "long"
        */      
-       this.cfg.addProperty("LOCALE_MONTHS",   { value:"long", handler:this.configLocaleValues } );
+       this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.configLocaleValues } );
        
        /**
        * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
@@ -1481,7 +1877,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default "short"
        */      
-       this.cfg.addProperty("LOCALE_WEEKDAYS", { value:"short", handler:this.configLocaleValues } );
+       this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.configLocaleValues } );
 
        /**
        * The value used to delimit individual dates in a date string passed to various Calendar functions.
@@ -1489,7 +1885,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default ","
        */      
-       this.cfg.addProperty("DATE_DELIMITER",          { value:",", handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.configLocale } );
 
        /**
        * The value used to delimit date fields in a date string passed to various Calendar functions.
@@ -1497,7 +1893,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default "/"
        */      
-       this.cfg.addProperty("DATE_FIELD_DELIMITER",{ value:"/", handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key, { value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.configLocale } );
 
        /**
        * The value used to delimit date ranges in a date string passed to various Calendar functions.
@@ -1505,7 +1901,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type String
        * @default "-"
        */
-       this.cfg.addProperty("DATE_RANGE_DELIMITER",{ value:"-", handler:this.configLocale } );
+       this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key, { value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.configLocale } );
 
        /**
        * The position of the month in a month/year date string
@@ -1513,7 +1909,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */
-       this.cfg.addProperty("MY_MONTH_POSITION",       { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the year in a month/year date string
@@ -1521,7 +1917,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */
-       this.cfg.addProperty("MY_YEAR_POSITION",        { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the month in a month/day date string
@@ -1529,7 +1925,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */
-       this.cfg.addProperty("MD_MONTH_POSITION",       { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the day in a month/year date string
@@ -1537,7 +1933,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */
-       this.cfg.addProperty("MD_DAY_POSITION",         { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the month in a month/day/year date string
@@ -1545,7 +1941,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */
-       this.cfg.addProperty("MDY_MONTH_POSITION",      { value:1, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the day in a month/day/year date string
@@ -1553,7 +1949,7 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */
-       this.cfg.addProperty("MDY_DAY_POSITION",        { value:2, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
 
        /**
        * The position of the year in a month/day/year date string
@@ -1561,39 +1957,47 @@ YAHOO.widget.Calendar.prototype.setupConfig = function() {
        * @type Number
        * @default 3
        */
-       this.cfg.addProperty("MDY_YEAR_POSITION",       { value:3, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+       /**
+       * The position of the month in the month year label string used as the Calendar header
+       * @config MY_LABEL_MONTH_POSITION
+       * @type Number
+       * @default 1
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+
+       /**
+       * The position of the year in the month year label string used as the Calendar header
+       * @config MY_LABEL_YEAR_POSITION
+       * @type Number
+       * @default 2
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+       
+       /**
+       * The suffix used after the month when rendering the Calendar header
+       * @config MY_LABEL_MONTH_SUFFIX
+       * @type String
+       * @default " "
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.configLocale } );
+       
+       /**
+       * The suffix used after the year when rendering the Calendar header
+       * @config MY_LABEL_YEAR_SUFFIX
+       * @type String
+       * @default ""
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.configLocale } );
 };
 
 /**
 * The default handler for the "pagedate" property
 * @method configPageDate
 */
-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");
-                       }
-                       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();
-       }
-       
-       this.cfg.setProperty("pagedate", new Date(year, month, 1), true);
-       if (! this._pageDate) {
-               this._pageDate = this.cfg.getProperty("pagedate");
-       }
+YAHOO.widget.Calendar.prototype.configPageDate = function(type, args, obj) {
+       this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key, this._parsePageDate(args[0]), true);
 };
 
 /**
@@ -1602,9 +2006,9 @@ YAHOO.widget.Calendar.prototype.configPageDate = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.configMinDate = function(type, args, obj) {
        var val = args[0];
-       if (typeof val == 'string') {
+       if (YAHOO.lang.isString(val)) {
                val = this._parseDate(val);
-               this.cfg.setProperty("mindate", new Date(val[0],(val[1]-1),val[2]));
+               this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key, new Date(val[0],(val[1]-1),val[2]));
        }
 };
 
@@ -1614,9 +2018,9 @@ YAHOO.widget.Calendar.prototype.configMinDate = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.configMaxDate = function(type, args, obj) {
        var val = args[0];
-       if (typeof val == 'string') {
+       if (YAHOO.lang.isString(val)) {
                val = this._parseDate(val);
-               this.cfg.setProperty("maxdate", new Date(val[0],(val[1]-1),val[2]));
+               this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key, new Date(val[0],(val[1]-1),val[2]));
        }
 };
 
@@ -1626,14 +2030,15 @@ YAHOO.widget.Calendar.prototype.configMaxDate = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.configSelected = function(type, args, obj) {
        var selected = args[0];
+       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
        
        if (selected) {
-               if (typeof selected == 'string') {
-                       this.cfg.setProperty("selected", this._parseDates(selected), true);
+               if (YAHOO.lang.isString(selected)) {
+                       this.cfg.setProperty(cfgSelected, this._parseDates(selected), true);
                } 
        }
        if (! this._selectedDates) {
-               this._selectedDates = this.cfg.getProperty("selected");
+               this._selectedDates = this.cfg.getProperty(cfgSelected);
        }
 };
 
@@ -1642,9 +2047,7 @@ YAHOO.widget.Calendar.prototype.configSelected = function(type, args, obj) {
 * @method configOptions
 */
 YAHOO.widget.Calendar.prototype.configOptions = function(type, args, obj) {
-       type = type.toUpperCase();
-       var val = args[0];
-       this.Options[type] = val;
+       this.Options[type.toUpperCase()] = args[0];
 };
 
 /**
@@ -1652,13 +2055,11 @@ YAHOO.widget.Calendar.prototype.configOptions = function(type, args, obj) {
 * @method configLocale
 */
 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");
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       this.Locale[type.toUpperCase()] = args[0];
 
+       this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
+       this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
 };
 
 /**
@@ -1666,37 +2067,39 @@ YAHOO.widget.Calendar.prototype.configLocale = function(type, args, obj) {
 * @method configLocaleValues
 */
 YAHOO.widget.Calendar.prototype.configLocaleValues = function(type, args, obj) {
-       type = type.toUpperCase();
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG; 
+
+       type = type.toLowerCase();
        var val = args[0];
 
        switch (type) {
-               case "LOCALE_MONTHS":
+               case defCfg.LOCALE_MONTHS.key:
                        switch (val) {
-                               case "short":
-                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty("MONTHS_SHORT").concat();
+                               case YAHOO.widget.Calendar.SHORT:
+                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_SHORT.key).concat();
                                        break;
-                               case "long":
-                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty("MONTHS_LONG").concat();
+                               case YAHOO.widget.Calendar.LONG:
+                                       this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_LONG.key).concat();
                                        break;
                        }
                        break;
-               case "LOCALE_WEEKDAYS":
+               case defCfg.LOCALE_WEEKDAYS.key:
                        switch (val) {
-                               case "1char":
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_1CHAR").concat();
+                               case YAHOO.widget.Calendar.ONE_CHAR:
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_1CHAR.key).concat();
                                        break;
-                               case "short":
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_SHORT").concat();
+                               case YAHOO.widget.Calendar.SHORT:
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_SHORT.key).concat();
                                        break;
-                               case "medium":
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_MEDIUM").concat();
+                               case YAHOO.widget.Calendar.MEDIUM:
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_MEDIUM.key).concat();
                                        break;
-                               case "long":
-                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty("WEEKDAYS_LONG").concat();
+                               case YAHOO.widget.Calendar.LONG:
+                                       this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_LONG.key).concat();
                                        break;
                        }
                        
-                       var START_WEEKDAY = this.cfg.getProperty("START_WEEKDAY");
+                       var START_WEEKDAY = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
 
                        if (START_WEEKDAY > 0) {
                                for (var w=0;w<START_WEEKDAY;++w) {
@@ -1713,123 +2116,133 @@ YAHOO.widget.Calendar.prototype.configLocaleValues = function(type, args, obj) {
 */
 YAHOO.widget.Calendar.prototype.initStyles = function() {
 
-       /**
-       * Collection of Style constants for the Calendar
-       * @property Style
-       */
+       var defStyle = YAHOO.widget.Calendar._STYLES;
+
        this.Style = {
                /**
                * @property Style.CSS_ROW_HEADER
                */
-               CSS_ROW_HEADER: "calrowhead",
+               CSS_ROW_HEADER: defStyle.CSS_ROW_HEADER,
                /**
                * @property Style.CSS_ROW_FOOTER
                */
-               CSS_ROW_FOOTER: "calrowfoot",
+               CSS_ROW_FOOTER: defStyle.CSS_ROW_FOOTER,
                /**
                * @property Style.CSS_CELL
                */
-               CSS_CELL : "calcell",
+               CSS_CELL : defStyle.CSS_CELL,
+               /**
+               * @property Style.CSS_CELL_SELECTOR
+               */
+               CSS_CELL_SELECTOR : defStyle.CSS_CELL_SELECTOR,
                /**
                * @property Style.CSS_CELL_SELECTED
                */
-               CSS_CELL_SELECTED : "selected",
+               CSS_CELL_SELECTED : defStyle.CSS_CELL_SELECTED,
                /**
                * @property Style.CSS_CELL_SELECTABLE
                */
-               CSS_CELL_SELECTABLE : "selectable",
+               CSS_CELL_SELECTABLE : defStyle.CSS_CELL_SELECTABLE,
                /**
                * @property Style.CSS_CELL_RESTRICTED
                */
-               CSS_CELL_RESTRICTED : "restricted",
+               CSS_CELL_RESTRICTED : defStyle.CSS_CELL_RESTRICTED,
                /**
                * @property Style.CSS_CELL_TODAY
                */
-               CSS_CELL_TODAY : "today",
+               CSS_CELL_TODAY : defStyle.CSS_CELL_TODAY,
                /**
                * @property Style.CSS_CELL_OOM
                */
-               CSS_CELL_OOM : "oom",
+               CSS_CELL_OOM : defStyle.CSS_CELL_OOM,
                /**
                * @property Style.CSS_CELL_OOB
                */
-               CSS_CELL_OOB : "previous",
+               CSS_CELL_OOB : defStyle.CSS_CELL_OOB,
                /**
                * @property Style.CSS_HEADER
                */
-               CSS_HEADER : "calheader",
+               CSS_HEADER : defStyle.CSS_HEADER,
                /**
                * @property Style.CSS_HEADER_TEXT
                */
-               CSS_HEADER_TEXT : "calhead",
+               CSS_HEADER_TEXT : defStyle.CSS_HEADER_TEXT,
+               /**
+               * @property Style.CSS_BODY
+               */
+               CSS_BODY : defStyle.CSS_BODY,
                /**
                * @property Style.CSS_WEEKDAY_CELL
                */
-               CSS_WEEKDAY_CELL : "calweekdaycell",
+               CSS_WEEKDAY_CELL : defStyle.CSS_WEEKDAY_CELL,
                /**
                * @property Style.CSS_WEEKDAY_ROW
                */
-               CSS_WEEKDAY_ROW : "calweekdayrow",
+               CSS_WEEKDAY_ROW : defStyle.CSS_WEEKDAY_ROW,
                /**
                * @property Style.CSS_FOOTER
                */
-               CSS_FOOTER : "calfoot",
+               CSS_FOOTER : defStyle.CSS_FOOTER,
                /**
                * @property Style.CSS_CALENDAR
                */
-               CSS_CALENDAR : "yui-calendar",
+               CSS_CALENDAR : defStyle.CSS_CALENDAR,
                /**
                * @property Style.CSS_SINGLE
                */
-               CSS_SINGLE : "single",
+               CSS_SINGLE : defStyle.CSS_SINGLE,
                /**
                * @property Style.CSS_CONTAINER
                */
-               CSS_CONTAINER : "yui-calcontainer",
+               CSS_CONTAINER : defStyle.CSS_CONTAINER,
                /**
                * @property Style.CSS_NAV_LEFT
                */
-               CSS_NAV_LEFT : "calnavleft",
+               CSS_NAV_LEFT : defStyle.CSS_NAV_LEFT,
                /**
                * @property Style.CSS_NAV_RIGHT
                */
-               CSS_NAV_RIGHT : "calnavright",
+               CSS_NAV_RIGHT : defStyle.CSS_NAV_RIGHT,
+               /**
+               * @property Style.CSS_CLOSE
+               */
+               CSS_CLOSE : defStyle.CSS_CLOSE,
                /**
                * @property Style.CSS_CELL_TOP
                */
-               CSS_CELL_TOP : "calcelltop",
+               CSS_CELL_TOP : defStyle.CSS_CELL_TOP,
                /**
                * @property Style.CSS_CELL_LEFT
                */
-               CSS_CELL_LEFT : "calcellleft",
+               CSS_CELL_LEFT : defStyle.CSS_CELL_LEFT,
                /**
                * @property Style.CSS_CELL_RIGHT
                */
-               CSS_CELL_RIGHT : "calcellright",
+               CSS_CELL_RIGHT : defStyle.CSS_CELL_RIGHT,
                /**
                * @property Style.CSS_CELL_BOTTOM
                */
-               CSS_CELL_BOTTOM : "calcellbottom",
+               CSS_CELL_BOTTOM : defStyle.CSS_CELL_BOTTOM,
                /**
                * @property Style.CSS_CELL_HOVER
                */
-               CSS_CELL_HOVER : "calcellhover",
+               CSS_CELL_HOVER : defStyle.CSS_CELL_HOVER,
                /**
                * @property Style.CSS_CELL_HIGHLIGHT1
                */
-               CSS_CELL_HIGHLIGHT1 : "highlight1",
+               CSS_CELL_HIGHLIGHT1 : defStyle.CSS_CELL_HIGHLIGHT1,
                /**
                * @property Style.CSS_CELL_HIGHLIGHT2
                */
-               CSS_CELL_HIGHLIGHT2 : "highlight2",
+               CSS_CELL_HIGHLIGHT2 : defStyle.CSS_CELL_HIGHLIGHT2,
                /**
                * @property Style.CSS_CELL_HIGHLIGHT3
                */
-               CSS_CELL_HIGHLIGHT3 : "highlight3",
+               CSS_CELL_HIGHLIGHT3 : defStyle.CSS_CELL_HIGHLIGHT3,
                /**
                * @property Style.CSS_CELL_HIGHLIGHT4
                */
-               CSS_CELL_HIGHLIGHT4 : "highlight4"
+               CSS_CELL_HIGHLIGHT4 : defStyle.CSS_CELL_HIGHLIGHT4
        };
 };
 
@@ -1840,8 +2253,16 @@ YAHOO.widget.Calendar.prototype.initStyles = function() {
 * @return      {String}        The formatted calendar month label
 */
 YAHOO.widget.Calendar.prototype.buildMonthLabel = function() {
-       var text = this.Locale.LOCALE_MONTHS[this.cfg.getProperty("pagedate").getMonth()] + " " + this.cfg.getProperty("pagedate").getFullYear();
-       return text;
+       var pageDate = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);
+
+       var monthLabel  = this.Locale.LOCALE_MONTHS[pageDate.getMonth()] + this.Locale.MY_LABEL_MONTH_SUFFIX;
+       var yearLabel = pageDate.getFullYear() + this.Locale.MY_LABEL_YEAR_SUFFIX;
+
+       if (this.Locale.MY_LABEL_MONTH_POSITION == 2 || this.Locale.MY_LABEL_YEAR_POSITION == 1) {
+               return yearLabel + monthLabel;
+       } else {
+               return monthLabel + yearLabel;
+       }
 };
 
 /**
@@ -1851,8 +2272,7 @@ YAHOO.widget.Calendar.prototype.buildMonthLabel = function() {
 * @return      {String}        The formatted day label
 */
 YAHOO.widget.Calendar.prototype.buildDayLabel = function(workingDate) {
-       var day = workingDate.getDate();
-       return day;
+       return workingDate.getDate();
 };
 
 /**
@@ -1864,11 +2284,15 @@ YAHOO.widget.Calendar.prototype.buildDayLabel = function(workingDate) {
 YAHOO.widget.Calendar.prototype.renderHeader = function(html) {
        var colSpan = 7;
        
-       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) {
+       var DEPR_NAV_LEFT = "us/tr/callt.gif";
+       var DEPR_NAV_RIGHT = "us/tr/calrt.gif"; 
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+       if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
                colSpan += 1;
        }
 
-       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) {
+       if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
                colSpan += 1;
        }
 
@@ -1877,38 +2301,46 @@ YAHOO.widget.Calendar.prototype.renderHeader = function(html) {
        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;
+       var renderLeft, renderRight = false;
 
-               if (this.parent) {
-                       if (this.index === 0) {
-                               renderLeft = true;
-                       }
-                       if (this.index == (this.parent.cfg.getProperty("pages") -1)) {
-                               renderRight = true;
-                       }
-               } else {
+       if (this.parent) {
+               if (this.index === 0) {
                        renderLeft = true;
+               }
+               if (this.index == (this.parent.cfg.getProperty("pages") -1)) {
                        renderRight = true;
                }
+       } else {
+               renderLeft = true;
+               renderRight = true;
+       }
 
-               var cal = this.parent || this;
-
-               if (renderLeft) {
-                       html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '" style="background-image:url(' + this.cfg.getProperty("NAV_ARROW_LEFT") + ')">&#160;</a>';
+       var cal = this.parent || this;
+       
+       if (renderLeft) {
+               var leftArrow = this.cfg.getProperty(defCfg.NAV_ARROW_LEFT.key);
+               // Check for deprecated customization - If someone set IMG_ROOT, but didn't set NAV_ARROW_LEFT, then set NAV_ARROW_LEFT to the old deprecated value
+               if (leftArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                       leftArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_LEFT;
                }
-               
-               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>';
+               var leftStyle = (leftArrow === null) ? "" : ' style="background-image:url(' + leftArrow + ')"';
+               html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '"' + leftStyle + ' >&#160;</a>';
+       }
+       
+       html[html.length] = this.buildMonthLabel();
+       
+       if (renderRight) {
+               var rightArrow = this.cfg.getProperty(defCfg.NAV_ARROW_RIGHT.key);
+               if (rightArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
+                       rightArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_RIGHT;
                }
+               var rightStyle = (rightArrow === null) ? "" : ' style="background-image:url(' + rightArrow + ')"';
+               html[html.length] = '<a class="' + this.Style.CSS_NAV_RIGHT + '"' + rightStyle + ' >&#160;</a>';
+       }
 
+       html[html.length] =     '</div>\n</th>\n</tr>';
 
-       html[html.length] =                             '</div>';
-       html[html.length] =                     '</th>';
-       html[html.length] =             '</tr>';
-
-       if (this.cfg.getProperty("SHOW_WEEKDAYS")) {
+       if (this.cfg.getProperty(defCfg.SHOW_WEEKDAYS.key)) {
                html = this.buildWeekdays(html);
        }
        
@@ -1925,9 +2357,11 @@ YAHOO.widget.Calendar.prototype.renderHeader = function(html) {
 */
 YAHOO.widget.Calendar.prototype.buildWeekdays = function(html) {
 
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+
        html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';
 
-       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) {
+       if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
                html[html.length] = '<th>&#160;</th>';
        }
 
@@ -1935,7 +2369,7 @@ YAHOO.widget.Calendar.prototype.buildWeekdays = function(html) {
                html[html.length] = '<th class="calweekdaycell">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';
        }
 
-       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) {
+       if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
                html[html.length] = '<th>&#160;</th>';
        }
 
@@ -1952,8 +2386,9 @@ YAHOO.widget.Calendar.prototype.buildWeekdays = function(html) {
 * @return {Array} The current working HTML array
 */
 YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
-       
-       var startDay = this.cfg.getProperty("START_WEEKDAY");
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+
+       var startDay = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
 
        this.preMonthDays = workingDate.getDay();
        if (startDay > 0) {
@@ -1968,10 +2403,34 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
        
        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 weekNum,weekClass;
+       var weekPrefix = "w";
+       var cellPrefix = "_cell";
+       var workingDayPrefix = "wd";
+       var dayPrefix = "d";
+       
+       var cellRenderers;
+       var renderer;
+       
+       var todayYear = this.today.getFullYear();
+       var todayMonth = this.today.getMonth();
+       var todayDate = this.today.getDate();
+       
+       var useDate = this.cfg.getProperty(defCfg.PAGEDATE.key);
+       var hideBlankWeeks = this.cfg.getProperty(defCfg.HIDE_BLANK_WEEKS.key);
+       var showWeekFooter = this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key);
+       var showWeekHeader = this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key);
+       var mindate = this.cfg.getProperty(defCfg.MINDATE.key);
+       var maxdate = this.cfg.getProperty(defCfg.MAXDATE.key);
+
+       if (mindate) {
+               mindate = YAHOO.widget.DateMath.clearTime(mindate);
+       }
+       if (maxdate) {
+               maxdate = YAHOO.widget.DateMath.clearTime(maxdate);
+       }
+       
+       html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + ' ' + this.Style.CSS_BODY + '">';
        
        var i = 0;
 
@@ -1986,45 +2445,41 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
        for (var r=0;r<6;r++) {
 
                weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useDate.getFullYear(), startDay);
+               weekClass = weekPrefix + weekNum;
 
-               weekClass = "w" + weekNum;
-
-               if (r !== 0 && this.isDateOOM(workingDate) && this.cfg.getProperty("HIDE_BLANK_WEEKS") === true) {
+               // Local OOM check for performance, since we already have pagedate
+               if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth()) {
                        break;
                } else {
-                                       
+
                        html[html.length] = '<tr class="' + weekClass + '">';
                        
-                       if (this.cfg.getProperty("SHOW_WEEK_HEADER")) { html = this.renderRowHeader(weekNum, html); }
+                       if (showWeekHeader) { html = this.renderRowHeader(weekNum, html); }
                        
                        for (var d=0;d<7;d++){ // Render actual days
 
-                               var cellRenderers = [];
+                               cellRenderers = [];
+                               renderer = null;
 
                                this.clearElement(cell);
-                               
-                               YAHOO.util.Dom.addClass(cell, "calcell");
-
-                               cell.id = this.id + "_cell" + i;
+                               cell.className = this.Style.CSS_CELL;
+                               cell.id = this.id + cellPrefix + i;
 
-                               cell.innerHTML = i;
-
-                               var renderer = null;
-                               
-                               if (workingDate.getFullYear()   == this.today.getFullYear() &&
-                                       workingDate.getMonth()          == this.today.getMonth() &&
-                                       workingDate.getDate()           == this.today.getDate()) {
+                               if (workingDate.getDate()               == todayDate && 
+                                       workingDate.getMonth()          == todayMonth &&
+                                       workingDate.getFullYear()       == todayYear) {
                                        cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;
                                }
                                
-                               this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]; // Add this date to cellDates
-                                                       
-                               if (this.isDateOOM(workingDate)) {
+                               var workingArray = [workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];
+                               this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates
+                               
+                               // Local OOM check for performance, since we already have pagedate
+                               if (workingDate.getMonth() != useDate.getMonth()) {
                                        cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
                                } else {
-
-                                       YAHOO.util.Dom.addClass(cell, "wd" + workingDate.getDay());
-                                       YAHOO.util.Dom.addClass(cell, "d" + workingDate.getDate());
+                                       YAHOO.util.Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
+                                       YAHOO.util.Dom.addClass(cell, dayPrefix + workingDate.getDate());
                                
                                        for (var s=0;s<this.renderStack.length;++s) {
 
@@ -2102,22 +2557,11 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
 
                                }
 
-                               if (this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]) > -1) {
+                               if (this._indexOfSelectedFieldArray(workingArray) > -1) {
                                        cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected; 
                                }
 
-                               var mindate = this.cfg.getProperty("mindate");
-                               var maxdate = this.cfg.getProperty("maxdate");
-
-                               if (mindate) {
-                                       mindate = YAHOO.widget.DateMath.clearTime(mindate);
-                               }
-                               if (maxdate) {
-                                       maxdate = YAHOO.widget.DateMath.clearTime(maxdate);
-                               }
-
-                               if (
-                                       (mindate && (workingDate.getTime() < mindate.getTime())) ||
+                               if ((mindate && (workingDate.getTime() < mindate.getTime())) ||
                                        (maxdate && (workingDate.getTime() > maxdate.getTime()))
                                ) {
                                        cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;
@@ -2125,12 +2569,9 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
                                        cellRenderers[cellRenderers.length]=cal.styleCellDefault;
                                        cellRenderers[cellRenderers.length]=cal.renderCellDefault;      
                                }
-
-                               
                                
-                               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) {
+                               for (var x=0; x < cellRenderers.length; ++x) {
+                                       if (cellRenderers[x].call(cal, workingDate, cell) == YAHOO.widget.Calendar.STOP_RENDER) {
                                                break;
                                        }
                                }
@@ -2148,7 +2589,7 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
                                }
                                
                                var postDays = this.postMonthDays; 
-                               if (postDays >= 7 && this.cfg.getProperty("HIDE_BLANK_WEEKS")) {
+                               if (hideBlankWeeks && postDays >= 7) {
                                        var blankWeeks = Math.floor(postDays/7);
                                        for (var p=0;p<blankWeeks;++p) {
                                                postDays -= 7;
@@ -2160,11 +2601,10 @@ YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
                                }
 
                                html[html.length] = tempDiv.innerHTML;
-                               
                                i++;
                        }
 
-                       if (this.cfg.getProperty("SHOW_WEEK_FOOTER")) { html = this.renderRowFooter(weekNum, html); }
+                       if (showWeekFooter) { html = this.renderRowFooter(weekNum, html); }
 
                        html[html.length] = '</tr>';
                }
@@ -2194,14 +2634,16 @@ YAHOO.widget.Calendar.prototype.renderFooter = function(html) { return html; };
 YAHOO.widget.Calendar.prototype.render = function() {
        this.beforeRenderEvent.fire();
 
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+
        // Find starting day of the current month
-       var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty("pagedate"));
+       var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(defCfg.PAGEDATE.key));
 
        this.resetRenderers();
        this.cellDates.length = 0;
-       
+
        YAHOO.util.Event.purgeElement(this.oDomContainer, true);
-       
+
        var html = [];
 
        html[html.length] = '<table cellSpacing="0" class="' + this.Style.CSS_CALENDAR + ' y' + workingDate.getFullYear() + '" id="' + this.id + '">';
@@ -2211,13 +2653,13 @@ YAHOO.widget.Calendar.prototype.render = function() {
        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.cfg.refireEvent(defCfg.TITLE.key);
+       this.cfg.refireEvent(defCfg.CLOSE.key);
+       this.cfg.refireEvent(defCfg.IFRAME.key);
 
        this.renderEvent.fire();
 };
@@ -2230,28 +2672,29 @@ 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);
+       var anchor = "a";
+       var mousedown = "mousedown";
+
+       var linkLeft = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, anchor, root);
+       var linkRight = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, anchor, root);
 
-       if (linkLeft) {
+       if (linkLeft && linkLeft.length > 0) {
                this.linkLeft = linkLeft[0];
-               YAHOO.util.Event.addListener(this.linkLeft, "mousedown", cal.previousMonth, cal, true);
+               YAHOO.util.Event.addListener(this.linkLeft, mousedown, cal.previousMonth, cal, true);
        }
 
-       if (linkRight) {
+       if (linkRight && linkRight.length > 0) {
                this.linkRight = linkRight[0];
-               YAHOO.util.Event.addListener(this.linkRight, "mousedown", cal.nextMonth, cal, true);
+               YAHOO.util.Event.addListener(this.linkRight, mousedown, cal.nextMonth, cal, true);
        }
 
        if (this.domEventMap) {
                var el,elements;
                for (var cls in this.domEventMap) {     
-                       if (this.domEventMap.hasOwnProperty(cls)) {
+                       if (YAHOO.lang.hasOwnProperty(this.domEventMap, cls)) {
                                var items = this.domEventMap[cls];
-                               
+
                                if (! (items instanceof Array)) {
                                        items = [items];
                                }
@@ -2296,7 +2739,7 @@ YAHOO.widget.Calendar.prototype.getDateFieldsByCellId = function(id) {
        id = parseInt(id, 10);
        return this.cellDates[id];
 };
-                                                                                                 
+
 // BEGIN BUILT-IN TABLE CELL RENDERERS
 
 /**
@@ -2346,7 +2789,7 @@ YAHOO.widget.Calendar.prototype.renderRowFooter = function(weekNum, html) {
 * @param {HTMLTableCellElement}        cell                    The current working cell in the calendar
 */
 YAHOO.widget.Calendar.prototype.renderCellDefault = function(workingDate, cell) {
-       cell.innerHTML = '<a href="javascript:void(null);" >' + this.buildDayLabel(workingDate) + "</a>";
+       cell.innerHTML = '<a href="#" class="' + this.Style.CSS_CELL_SELECTOR + '">' + this.buildDayLabel(workingDate) + "</a>";
 };
 
 /**
@@ -2464,7 +2907,8 @@ YAHOO.widget.Calendar.prototype.renderBodyCellRestricted = function(workingDate,
 * @param {Number}      count   The number of months to add to the current calendar
 */
 YAHOO.widget.Calendar.prototype.addMonths = function(count) {
-       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.MONTH, count));
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
        this.resetRenderers();
        this.changePageEvent.fire();
 };
@@ -2476,7 +2920,8 @@ YAHOO.widget.Calendar.prototype.addMonths = function(count) {
 * @param {Number}      count   The number of months to subtract from the current calendar
 */
 YAHOO.widget.Calendar.prototype.subtractMonths = function(count) {
-       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.MONTH, count));
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
        this.resetRenderers();
        this.changePageEvent.fire();
 };
@@ -2488,7 +2933,8 @@ YAHOO.widget.Calendar.prototype.subtractMonths = function(count) {
 * @param {Number}      count   The number of years to add to the current calendar
 */
 YAHOO.widget.Calendar.prototype.addYears = function(count) {
-       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.YEAR, count));
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
        this.resetRenderers();
        this.changePageEvent.fire();
 };
@@ -2500,7 +2946,8 @@ YAHOO.widget.Calendar.prototype.addYears = function(count) {
 * @param {Number}      count   The number of years to subtract from the current calendar
 */
 YAHOO.widget.Calendar.prototype.subtractYears = function(count) {
-       this.cfg.setProperty("pagedate", YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"), YAHOO.widget.DateMath.YEAR, count));
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
        this.resetRenderers();
        this.changePageEvent.fire();
 };
@@ -2547,8 +2994,9 @@ YAHOO.widget.Calendar.prototype.previousYear = function() {
 * @method reset
 */
 YAHOO.widget.Calendar.prototype.reset = function() {
-       this.cfg.resetProperty("selected");
-       this.cfg.resetProperty("pagedate");
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       this.cfg.resetProperty(defCfg.SELECTED.key);
+       this.cfg.resetProperty(defCfg.PAGEDATE.key);
        this.resetEvent.fire();
 };
 
@@ -2558,8 +3006,9 @@ YAHOO.widget.Calendar.prototype.reset = function() {
 * @method clear
 */
 YAHOO.widget.Calendar.prototype.clear = function() {
-       this.cfg.setProperty("selected", []);
-       this.cfg.setProperty("pagedate", new Date(this.today.getTime()));
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       this.cfg.setProperty(defCfg.SELECTED.key, []);
+       this.cfg.setProperty(defCfg.PAGEDATE.key, new Date(this.today.getTime()));
        this.clearEvent.fire();
 };
 
@@ -2567,6 +3016,12 @@ YAHOO.widget.Calendar.prototype.clear = function() {
 * Selects a date or a collection of dates on the current calendar. This method, by default,
 * does not call the render method explicitly. Once selection has completed, render must be 
 * called for the changes to be reflected visually.
+*
+* Any dates which are OOB (out of bounds, not selectable) will not be selected and the array of 
+* selected dates passed to the selectEvent will not contain OOB dates.
+* 
+* If all dates are OOB, the no state change will occur; beforeSelect and select events will not be fired.
+*
 * @method select
 * @param       {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are
 *                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
@@ -2575,26 +3030,42 @@ YAHOO.widget.Calendar.prototype.clear = function() {
 * @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
 */
 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]; // For each date item in the list of dates we're trying to select
-               if (this._indexOfSelectedFieldArray(toSelect) == -1) { // not already selected?
-                       selected[selected.length]=toSelect;
+       // Filtered array of valid dates
+       var validDates = [];
+       var selected = [];
+       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+       
+       for (var a=0; a < aToBeSelected.length; ++a) {
+               var toSelect = aToBeSelected[a];
+
+               if (!this.isDateOOB(this._toDate(toSelect))) {
+                       
+                       if (validDates.length === 0) {
+                               this.beforeSelectEvent.fire();
+                               selected = this.cfg.getProperty(cfgSelected);
+                       }
+
+                       validDates.push(toSelect);
+                       
+                       if (this._indexOfSelectedFieldArray(toSelect) == -1) { 
+                               selected[selected.length] = toSelect;
+                       }
                }
        }
        
-       if (this.parent) {
-               this.parent.cfg.setProperty("selected", selected);
-       } else {
-               this.cfg.setProperty("selected", selected);
+
+       if (validDates.length > 0) {
+               if (this.parent) {
+                       this.parent.cfg.setProperty(cfgSelected, selected);
+               } else {
+                       this.cfg.setProperty(cfgSelected, selected);
+               }
+               this.selectEvent.fire(validDates);
        }
 
-       this.selectEvent.fire(aToBeSelected);
-       
        return this.getSelectedDates();
 };
 
@@ -2602,35 +3073,44 @@ YAHOO.widget.Calendar.prototype.select = function(date) {
 * Selects a date on the current calendar by referencing the index of the cell that should be selected.
 * This method is used to easily select a single cell (usually with a mouse click) without having to do
 * a full render. The selected style is applied to the cell directly.
+*
+* If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
+* or out of bounds cells), it will not be selected and in such a case beforeSelect and select events will not be fired.
+* 
 * @method selectCell
 * @param       {Number}        cellIndex       The index of the cell to select in the current calendar. 
 * @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
 */
 YAHOO.widget.Calendar.prototype.selectCell = function(cellIndex) {
-       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 selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
 
-       var selectDate = cellDate.concat();
+       if (selectable) {
 
-       selected[selected.length] = selectDate;
+               this.beforeSelectEvent.fire();
 
-       if (this.parent) {
-               this.parent.cfg.setProperty("selected", selected);
-       } else {
-               this.cfg.setProperty("selected", selected);
-       }
+               var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+               var selected = this.cfg.getProperty(cfgSelected);
 
-       this.renderCellStyleSelected(dCellDate,cell);
+               var selectDate = cellDate.concat();
 
-       this.selectEvent.fire([selectDate]);
+               if (this._indexOfSelectedFieldArray(selectDate) == -1) {
+                       selected[selected.length] = selectDate;
+               }
+               if (this.parent) {
+                       this.parent.cfg.setProperty(cfgSelected, selected);
+               } else {
+                       this.cfg.setProperty(cfgSelected, selected);
+               }
+               this.renderCellStyleSelected(dCellDate,cell);
+               this.selectEvent.fire([selectDate]);
 
-       this.doCellMouseOut.call(cell, null, this);
+               this.doCellMouseOut.call(cell, null, this);             
+       }
 
        return this.getSelectedDates();
 };
@@ -2639,6 +3119,12 @@ YAHOO.widget.Calendar.prototype.selectCell = function(cellIndex) {
 * Deselects a date or a collection of dates on the current calendar. This method, by default,
 * does not call the render method explicitly. Once deselection has completed, render must be 
 * called for the changes to be reflected visually.
+* 
+* The method will not attempt to deselect any dates which are OOB (out of bounds, and hence not selectable) 
+* and the array of deselected dates passed to the deselectEvent will not contain any OOB dates.
+* 
+* If all dates are OOB, beforeDeselect and deselect events will not be fired.
+* 
 * @method deselect
 * @param       {String/Date/Date[]}    date    The date string of dates to deselect in the current calendar. Valid formats are
 *                                                              individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
@@ -2647,29 +3133,42 @@ YAHOO.widget.Calendar.prototype.selectCell = function(cellIndex) {
 * @return      {Date[]}                        Array of JavaScript Date objects representing all individual dates that are currently selected.
 */
 YAHOO.widget.Calendar.prototype.deselect = function(date) {
-       this.beforeDeselectEvent.fire();
 
-       var selected = this.cfg.getProperty("selected");
+       var aToBeDeselected = this._toFieldArray(date);
 
-       var aToBeSelected = this._toFieldArray(date);
+       var validDates = [];
+       var selected = [];
+       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
 
-       for (var a=0;a<aToBeSelected.length;++a) {
-               var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select
-               var index = this._indexOfSelectedFieldArray(toSelect);
-       
-               if (index != -1) {      
-                       selected.splice(index,1);
+       for (var a=0; a < aToBeDeselected.length; ++a) {
+               var toDeselect = aToBeDeselected[a];
+
+               if (!this.isDateOOB(this._toDate(toDeselect))) {
+
+                       if (validDates.length === 0) {
+                               this.beforeDeselectEvent.fire();
+                               selected = this.cfg.getProperty(cfgSelected);
+                       }
+
+                       validDates.push(toDeselect);
+
+                       var index = this._indexOfSelectedFieldArray(toDeselect);
+                       if (index != -1) {      
+                               selected.splice(index,1);
+                       }
                }
        }
 
-       if (this.parent) {
-               this.parent.cfg.setProperty("selected", selected);
-       } else {
-               this.cfg.setProperty("selected", selected);
+
+       if (validDates.length > 0) {
+               if (this.parent) {
+                       this.parent.cfg.setProperty(cfgSelected, selected);
+               } else {
+                       this.cfg.setProperty(cfgSelected, selected);
+               }
+               this.deselectEvent.fire(validDates);
        }
 
-       this.deselectEvent.fire(aToBeSelected);
-       
        return this.getSelectedDates();
 };
 
@@ -2677,40 +3176,49 @@ YAHOO.widget.Calendar.prototype.deselect = function(date) {
 * Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
 * This method is used to easily deselect a single cell (usually with a mouse click) without having to do
 * a full render. The selected style is removed from the cell directly.
+* 
+* If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
+* or out of bounds cells), the method will not attempt to deselect it and in such a case, beforeDeselect and 
+* deselect events will not be fired.
+* 
 * @method deselectCell
 * @param       {Number}        cellIndex       The index of the cell to deselect in the current calendar. 
 * @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
 */
-YAHOO.widget.Calendar.prototype.deselectCell = function(i) {
-       this.beforeDeselectEvent.fire();
+YAHOO.widget.Calendar.prototype.deselectCell = function(cellIndex) {
+       var cell = this.cells[cellIndex];
+       var cellDate = this.cellDates[cellIndex];
+       var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);
        
-       var selected = this.cfg.getProperty("selected");
+       var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
 
-       var cell = this.cells[i];
-       var cellDate = this.cellDates[i];
-       var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);
+       if (selectable) {
 
-       var dCellDate = this._toDate(cellDate);
+               this.beforeDeselectEvent.fire();
 
-       var selectDate = cellDate.concat();
+               var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+               var selected = this.cfg.getProperty(defCfg.SELECTED.key);
 
-       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);
-               }
+               var dCellDate = this._toDate(cellDate);
+               var selectDate = cellDate.concat();
 
-               selected.splice(cellDateIndex, 1);
-       }
+               if (cellDateIndex > -1) {
+                       if (this.cfg.getProperty(defCfg.PAGEDATE.key).getMonth() == dCellDate.getMonth() &&
+                               this.cfg.getProperty(defCfg.PAGEDATE.key).getFullYear() == dCellDate.getFullYear()) {
+                               YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);
+                       }
+                       selected.splice(cellDateIndex, 1);
+               }
 
+               if (this.parent) {
+                       this.parent.cfg.setProperty(defCfg.SELECTED.key, selected);
+               } else {
+                       this.cfg.setProperty(defCfg.SELECTED.key, selected);
+               }
 
-       if (this.parent) {
-               this.parent.cfg.setProperty("selected", selected);
-       } else {
-               this.cfg.setProperty("selected", selected);
+               this.deselectEvent.fire(selectDate);
        }
-       
-       this.deselectEvent.fire(selectDate);
+
        return this.getSelectedDates();
 };
 
@@ -2724,15 +3232,17 @@ YAHOO.widget.Calendar.prototype.deselectCell = function(i) {
 */
 YAHOO.widget.Calendar.prototype.deselectAll = function() {
        this.beforeDeselectEvent.fire();
+       
+       var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
 
-       var selected = this.cfg.getProperty("selected");
+       var selected = this.cfg.getProperty(cfgSelected);
        var count = selected.length;
        var sel = selected.concat();
 
        if (this.parent) {
-               this.parent.cfg.setProperty("selected", []);
+               this.parent.cfg.setProperty(cfgSelected, []);
        } else {
-               this.cfg.setProperty("selected", []);
+               this.cfg.setProperty(cfgSelected, []);
        }
        
        if (count > 0) {
@@ -2762,9 +3272,9 @@ YAHOO.widget.Calendar.prototype._toFieldArray = function(date) {
 
        if (date instanceof Date) {
                returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];
-       } else if (typeof date == 'string') {
+       } else if (YAHOO.lang.isString(date)) {
                returnDate = this._parseDates(date);
-       } else if (date instanceof Array) {
+       } else if (YAHOO.lang.isArray(date)) {
                for (var i=0;i<date.length;++i) {
                        var d = date[i];
                        returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];
@@ -2821,7 +3331,7 @@ YAHOO.widget.Calendar.prototype._fieldArraysAreEqual = function(array1, array2)
 */
 YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray = function(find) {
        var selected = -1;
-       var seldates = this.cfg.getProperty("selected");
+       var seldates = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
 
        for (var s=0;s<seldates.length;++s) {
                var sArray = seldates[s];
@@ -2841,11 +3351,64 @@ YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray = function(find) {
 * @return      {Boolean}       true if the date is OOM
 */
 YAHOO.widget.Calendar.prototype.isDateOOM = function(date) {
-       var isOOM = false;
-       if (date.getMonth() != this.cfg.getProperty("pagedate").getMonth()) {
-               isOOM = true;
+       return (date.getMonth() != this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());
+};
+
+/**
+* Determines whether a given date is OOB (out of bounds - less than the mindate or more than the maxdate).
+*
+* @method      isDateOOB
+* @param       {Date}  date    The JavaScript Date object for which to check the OOB status
+* @return      {Boolean}       true if the date is OOB
+*/
+YAHOO.widget.Calendar.prototype.isDateOOB = function(date) {
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+       
+       var minDate = this.cfg.getProperty(defCfg.MINDATE.key);
+       var maxDate = this.cfg.getProperty(defCfg.MAXDATE.key);
+       var dm = YAHOO.widget.DateMath;
+       
+       if (minDate) {
+               minDate = dm.clearTime(minDate);
+       } 
+       if (maxDate) {
+               maxDate = dm.clearTime(maxDate);
+       }
+
+       var clearedDate = new Date(date.getTime());
+       clearedDate = dm.clearTime(clearedDate);
+
+       return ((minDate && clearedDate.getTime() < minDate.getTime()) || (maxDate && clearedDate.getTime() > maxDate.getTime()));
+};
+
+/**
+ * Parses a pagedate configuration property value. The value can either be specified as a string of form "mm/yyyy" or a Date object 
+ * and is parsed into a Date object normalized to the first day of the month. If no value is passed in, the month and year from today's date are used to create the Date object 
+ * @method     _parsePageDate
+ * @private
+ * @param {Date|String}        date    Pagedate value which needs to be parsed
+ * @return {Date}      The Date object representing the pagedate
+ */
+YAHOO.widget.Calendar.prototype._parsePageDate = function(date) {
+       var parsedDate;
+       
+       var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+
+       if (date) {
+               if (date instanceof Date) {
+                       parsedDate = YAHOO.widget.DateMath.findMonthStart(date);
+               } else {
+                       var month, year, aMonthYear;
+                       aMonthYear = date.split(this.cfg.getProperty(defCfg.DATE_FIELD_DELIMITER.key));
+                       month = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_MONTH_POSITION.key)-1], 10)-1;
+                       year = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_YEAR_POSITION.key)-1], 10);
+                       
+                       parsedDate = new Date(year, month, 1);
+               }
+       } else {
+               parsedDate = new Date(this.today.getFullYear(), this.today.getMonth(), 1);
        }
-       return isOOM;
+       return parsedDate;
 };
 
 // END UTILITY METHODS
@@ -2857,7 +3420,7 @@ YAHOO.widget.Calendar.prototype.isDateOOM = function(date) {
 * @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.
 */
 YAHOO.widget.Calendar.prototype.onBeforeSelect = function() {
-       if (this.cfg.getProperty("MULTI_SELECT") === false) {
+       if (this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key) === false) {
                if (this.parent) {
                        this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED);
                        this.parent.deselectAll();
@@ -3118,9 +3681,10 @@ YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles = function(style) {
 * @param {Number}      month           The numeric month, from 0 (January) to 11 (December)
 */
 YAHOO.widget.Calendar.prototype.setMonth = function(month) {
-       var current = this.cfg.getProperty("pagedate");
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       var current = this.cfg.getProperty(cfgPageDate);
        current.setMonth(parseInt(month, 10));
-       this.cfg.setProperty("pagedate", current);
+       this.cfg.setProperty(cfgPageDate, current);
 };
 
 /**
@@ -3129,9 +3693,10 @@ YAHOO.widget.Calendar.prototype.setMonth = function(month) {
 * @param {Number}      year            The numeric 4-digit year
 */
 YAHOO.widget.Calendar.prototype.setYear = function(year) {
-       var current = this.cfg.getProperty("pagedate");
+       var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+       var current = this.cfg.getProperty(cfgPageDate);
        current.setFullYear(parseInt(year, 10));
-       this.cfg.setProperty("pagedate", current);
+       this.cfg.setProperty(cfgPageDate, current);
 };
 
 /**
@@ -3141,7 +3706,7 @@ YAHOO.widget.Calendar.prototype.setYear = function(year) {
 */
 YAHOO.widget.Calendar.prototype.getSelectedDates = function() {
        var returnDates = [];
-       var selected = this.cfg.getProperty("selected");
+       var selected = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
 
        for (var d=0;d<selected.length;++d) {
                var dateArray = selected[d];
@@ -3174,6 +3739,8 @@ YAHOO.widget.Calendar.prototype.show = function() {
 
 /**
 * Returns a string representing the current browser.
+* @deprecated As of 2.3.0, environment information is available in YAHOO.env.ua
+* @see YAHOO.env.ua
 * @property browser
 * @type String
 */
@@ -3311,31 +3878,23 @@ YAHOO.widget.CalendarGroup.prototype.init = function(id, containerId, config) {
        this.cfg.fireQueue();
 
        // OPERA HACK FOR MISWRAPPED FLOATS
-       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;
-                       }
-                       if (w > 0) {
-                               this.oDomContainer.style.width = w + "px";
-                       }
-               };
-               this.renderEvent.subscribe(fixWidth,this,true);
+       if (YAHOO.env.ua.opera){
+               this.renderEvent.subscribe(this._fixWidth, this, true);
        }
 };
 
 
 YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
+       
+       var defCfg = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;
+       
        /**
        * The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments.
        * @config pages
        * @type Number
        * @default 2
        */
-       this.cfg.addProperty("pages", { value:2, validator:this.cfg.checkNumber, handler:this.configPages } );
+       this.cfg.addProperty(defCfg.PAGES.key, { value:defCfg.PAGES.value, validator:this.cfg.checkNumber, handler:this.configPages } );
 
        /**
        * The month/year representing the current visible Calendar date (mm/yyyy)
@@ -3343,7 +3902,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default today's date
        */
-       this.cfg.addProperty("pagedate", { value:new Date(), handler:this.configPageDate } );
+       this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
 
        /**
        * The date or range of dates representing the current Calendar selection
@@ -3351,7 +3910,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default []
        */
-       this.cfg.addProperty("selected", { value:[], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
 
        /**
        * The title to display above the CalendarGroup's month header
@@ -3359,7 +3918,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default ""
        */
-       this.cfg.addProperty("title", { value:"", handler:this.configTitle } );
+       this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
 
        /**
        * Whether or not a close button should be displayed for this CalendarGroup
@@ -3367,15 +3926,18 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("close", { value:false, handler:this.configClose } );
+       this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
 
        /**
        * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
+       * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
+       * enabled if required.
+       * 
        * @config iframe
        * @type Boolean
-       * @default true
+       * @default true for IE6 and below, false for all other browsers
        */
-       this.cfg.addProperty("iframe", { value:true, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
 
        /**
        * The minimum selectable date in the current Calendar (mm/dd/yyyy)
@@ -3383,7 +3945,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default null
        */
-       this.cfg.addProperty("mindate", { value:null, handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.delegateConfig } );
 
        /**
        * The maximum selectable date in the current Calendar (mm/dd/yyyy)
@@ -3391,7 +3953,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default null
        */      
-       this.cfg.addProperty("maxdate", { value:null, handler:this.delegateConfig  } );
+       this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.delegateConfig  } );
 
        // Options properties
 
@@ -3401,7 +3963,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("MULTI_SELECT",    { value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.MULTI_SELECT.key,   { value:defCfg.MULTI_SELECT.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
 
        /**
        * The weekday the week begins on. Default is 0 (Sunday).
@@ -3409,7 +3971,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type number
        * @default 0
        */      
-       this.cfg.addProperty("START_WEEKDAY",   { value:0, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );
+       this.cfg.addProperty(defCfg.START_WEEKDAY.key,  { value:defCfg.START_WEEKDAY.value, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );
        
        /**
        * True if the Calendar should show weekday labels. True by default.
@@ -3417,7 +3979,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default true
        */      
-       this.cfg.addProperty("SHOW_WEEKDAYS",   { value:true, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,  { value:defCfg.SHOW_WEEKDAYS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
        
        /**
        * True if the Calendar should show week row headers. False by default.
@@ -3425,7 +3987,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */      
-       this.cfg.addProperty("SHOW_WEEK_HEADER",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{ value:defCfg.SHOW_WEEK_HEADER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
        
        /**
        * True if the Calendar should show week row footers. False by default.
@@ -3433,7 +3995,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */
-       this.cfg.addProperty("SHOW_WEEK_FOOTER",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
        
        /**
        * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
@@ -3441,23 +4003,25 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Boolean
        * @default false
        */              
-       this.cfg.addProperty("HIDE_BLANK_WEEKS",{ value:false, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+       this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{ value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
        
        /**
        * The image that should be used for the left navigation arrow.
        * @config NAV_ARROW_LEFT
        * @type String
-       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif"
+       * @deprecated   You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"
+       * @default null
        */              
-       this.cfg.addProperty("NAV_ARROW_LEFT",  { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/callt.gif", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key, { value:defCfg.NAV_ARROW_LEFT.value, handler:this.delegateConfig } );
        
        /**
-       * The image that should be used for the left navigation arrow.
+       * The image that should be used for the right navigation arrow.
        * @config NAV_ARROW_RIGHT
        * @type String
-       * @default YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif"
+       * @deprecated   You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
+       * @default null
        */              
-       this.cfg.addProperty("NAV_ARROW_RIGHT", { value:YAHOO.widget.Calendar.IMG_ROOT + "us/tr/calrt.gif", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,        { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.delegateConfig } );
 
        // Locale properties
        
@@ -3467,7 +4031,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
        */
-       this.cfg.addProperty("MONTHS_SHORT",    { value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.MONTHS_SHORT.key,   { value:defCfg.MONTHS_SHORT.value, handler:this.delegateConfig } );
        
        /**
        * The long month labels for the current locale.
@@ -3475,7 +4039,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
        */              
-       this.cfg.addProperty("MONTHS_LONG",             { value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.MONTHS_LONG.key,            { value:defCfg.MONTHS_LONG.value, handler:this.delegateConfig } );
        
        /**
        * The 1-character weekday labels for the current locale.
@@ -3483,7 +4047,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["S", "M", "T", "W", "T", "F", "S"]
        */              
-       this.cfg.addProperty("WEEKDAYS_1CHAR",  { value:["S", "M", "T", "W", "T", "F", "S"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key, { value:defCfg.WEEKDAYS_1CHAR.value, handler:this.delegateConfig } );
        
        /**
        * The short weekday labels for the current locale.
@@ -3491,7 +4055,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
        */              
-       this.cfg.addProperty("WEEKDAYS_SHORT",  { value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key, { value:defCfg.WEEKDAYS_SHORT.value, handler:this.delegateConfig } );
        
        /**
        * The medium weekday labels for the current locale.
@@ -3499,7 +4063,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
        */              
-       this.cfg.addProperty("WEEKDAYS_MEDIUM", { value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,        { value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.delegateConfig } );
        
        /**
        * The long weekday labels for the current locale.
@@ -3507,7 +4071,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String[]
        * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
        */              
-       this.cfg.addProperty("WEEKDAYS_LONG",   { value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,  { value:defCfg.WEEKDAYS_LONG.value, handler:this.delegateConfig } );
 
        /**
        * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
@@ -3515,7 +4079,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default "long"
        */
-       this.cfg.addProperty("LOCALE_MONTHS",   { value:"long", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,  { value:defCfg.LOCALE_MONTHS.value, handler:this.delegateConfig } );
 
        /**
        * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
@@ -3523,7 +4087,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default "short"
        */      
-       this.cfg.addProperty("LOCALE_WEEKDAYS", { value:"short", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,        { value:defCfg.LOCALE_WEEKDAYS.value, handler:this.delegateConfig } );
 
        /**
        * The value used to delimit individual dates in a date string passed to various Calendar functions.
@@ -3531,7 +4095,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default ","
        */
-       this.cfg.addProperty("DATE_DELIMITER",          { value:",", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.DATE_DELIMITER.key,         { value:defCfg.DATE_DELIMITER.value, handler:this.delegateConfig } );
 
        /**
        * The value used to delimit date fields in a date string passed to various Calendar functions.
@@ -3539,7 +4103,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default "/"
        */      
-       this.cfg.addProperty("DATE_FIELD_DELIMITER",{ value:"/", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{ value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.delegateConfig } );
 
        /**
        * The value used to delimit date ranges in a date string passed to various Calendar functions.
@@ -3547,7 +4111,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type String
        * @default "-"
        */
-       this.cfg.addProperty("DATE_RANGE_DELIMITER",{ value:"-", handler:this.delegateConfig } );
+       this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{ value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.delegateConfig } );
 
        /**
        * The position of the month in a month/year date string
@@ -3555,7 +4119,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */
-       this.cfg.addProperty("MY_MONTH_POSITION",       { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,      { value:defCfg.MY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the year in a month/year date string
@@ -3563,7 +4127,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */      
-       this.cfg.addProperty("MY_YEAR_POSITION",        { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,       { value:defCfg.MY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the month in a month/day date string
@@ -3571,7 +4135,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */      
-       this.cfg.addProperty("MD_MONTH_POSITION",       { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,      { value:defCfg.MD_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the day in a month/year date string
@@ -3579,7 +4143,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */      
-       this.cfg.addProperty("MD_DAY_POSITION",         { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,                { value:defCfg.MD_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the month in a month/day/year date string
@@ -3587,7 +4151,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 1
        */      
-       this.cfg.addProperty("MDY_MONTH_POSITION",      { value:1, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,     { value:defCfg.MDY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the day in a month/day/year date string
@@ -3595,7 +4159,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 2
        */      
-       this.cfg.addProperty("MDY_DAY_POSITION",        { value:2, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,       { value:defCfg.MDY_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
        
        /**
        * The position of the year in a month/day/year date string
@@ -3603,8 +4167,39 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
        * @type Number
        * @default 3
        */      
-       this.cfg.addProperty("MDY_YEAR_POSITION",       { value:3, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,      { value:defCfg.MDY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+
+       /**
+       * The position of the month in the month year label string used as the Calendar header
+       * @config MY_LABEL_MONTH_POSITION
+       * @type Number
+       * @default 1
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,        { value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
 
+       /**
+       * The position of the year in the month year label string used as the Calendar header
+       * @config MY_LABEL_YEAR_POSITION
+       * @type Number
+       * @default 2
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key, { value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+       
+       /**
+       * The suffix used after the month when rendering the Calendar header
+       * @config MY_LABEL_MONTH_SUFFIX
+       * @type String
+       * @default " "
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,  { value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.delegateConfig } );
+       
+       /**
+       * The suffix used after the year when rendering the Calendar header
+       * @config MY_LABEL_YEAR_SUFFIX
+       * @type String
+       * @default ""
+       */
+       this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.delegateConfig } );
 };
 
 /**
@@ -3613,6 +4208,7 @@ YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
 */
 YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
        var me = this;
+       var strEvent = "Event";
 
        /**
        * Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents
@@ -3625,7 +4221,7 @@ YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
        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);
+                       cal[this.type + strEvent].subscribe(fn, obj, bOverride);
                }
        };
 
@@ -3639,15 +4235,17 @@ YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
        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);
+                       cal[this.type + strEvent].unsubscribe(fn, obj);
                }
        };
+       
+       var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
 
        /**
        * Fired before a selection is made
        * @event beforeSelectEvent
        */
-       this.beforeSelectEvent = new YAHOO.util.CustomEvent("beforeSelect");
+       this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);
        this.beforeSelectEvent.subscribe = sub; this.beforeSelectEvent.unsubscribe = unsub;
 
        /**
@@ -3655,14 +4253,14 @@ YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
        * @event selectEvent
        * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
        */
-       this.selectEvent = new YAHOO.util.CustomEvent("select"); 
+       this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT); 
        this.selectEvent.subscribe = sub; this.selectEvent.unsubscribe = unsub;
 
        /**
        * Fired before a selection is made
        * @event beforeDeselectEvent
        */
-       this.beforeDeselectEvent = new YAHOO.util.CustomEvent("beforeDeselect"); 
+       this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT); 
        this.beforeDeselectEvent.subscribe = sub; this.beforeDeselectEvent.unsubscribe = unsub;
 
        /**
@@ -3670,42 +4268,42 @@ YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
        * @event deselectEvent
        * @param {Array}        Array of Date field arrays in the format [YYYY, MM, DD].
        */
-       this.deselectEvent = new YAHOO.util.CustomEvent("deselect"); 
+       this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT); 
        this.deselectEvent.subscribe = sub; this.deselectEvent.unsubscribe = unsub;
        
        /**
        * Fired when the Calendar page is changed
        * @event changePageEvent
        */
-       this.changePageEvent = new YAHOO.util.CustomEvent("changePage"); 
+       this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE); 
        this.changePageEvent.subscribe = sub; this.changePageEvent.unsubscribe = unsub;
 
        /**
        * Fired before the Calendar is rendered
        * @event beforeRenderEvent
        */
-       this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");
+       this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
        this.beforeRenderEvent.subscribe = sub; this.beforeRenderEvent.unsubscribe = unsub;
 
        /**
        * Fired when the Calendar is rendered
        * @event renderEvent
        */
-       this.renderEvent = new YAHOO.util.CustomEvent("render");
+       this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
        this.renderEvent.subscribe = sub; this.renderEvent.unsubscribe = unsub;
 
        /**
        * Fired when the Calendar is reset
        * @event resetEvent
        */
-       this.resetEvent = new YAHOO.util.CustomEvent("reset"); 
+       this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET); 
        this.resetEvent.subscribe = sub; this.resetEvent.unsubscribe = unsub;
 
        /**
        * Fired when the Calendar is cleared
        * @event clearEvent
        */
-       this.clearEvent = new YAHOO.util.CustomEvent("clear");
+       this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
        this.clearEvent.subscribe = sub; this.clearEvent.unsubscribe = unsub;
 
 };
@@ -3720,30 +4318,39 @@ YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
 YAHOO.widget.CalendarGroup.prototype.configPages = function(type, args, obj) {
        var pageCount = args[0];
 
+       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+
+       // Define literals outside loop 
+       var sep = "_";
+       var groupCalClass = "groupcal";
+
+       var firstClass = "first-of-type";
+       var lastClass = "last-of-type";
+
        for (var p=0;p<pageCount;++p) {
-               var calId = this.id + "_" + p;
-               var calContainerId = this.containerId + "_" + p;
+               var calId = this.id + sep + p;
+               var calContainerId = this.containerId + sep + p;
 
                var childConfig = this.cfg.getConfig();
                childConfig.close = false;
                childConfig.title = false;
 
                var cal = this.constructChild(calId, calContainerId, childConfig);
-               var caldate = cal.cfg.getProperty("pagedate");
-               caldate.setMonth(caldate.getMonth()+p);
-               cal.cfg.setProperty("pagedate", caldate);
-               
+               var caldate = cal.cfg.getProperty(cfgPageDate);
+               this._setMonthOnDate(caldate, caldate.getMonth() + p);
+               cal.cfg.setProperty(cfgPageDate, caldate);
+
                YAHOO.util.Dom.removeClass(cal.oDomContainer, this.Style.CSS_SINGLE);
-               YAHOO.util.Dom.addClass(cal.oDomContainer, "groupcal");
-               
+               YAHOO.util.Dom.addClass(cal.oDomContainer, groupCalClass);
+
                if (p===0) {
-                       YAHOO.util.Dom.addClass(cal.oDomContainer, "first");
+                       YAHOO.util.Dom.addClass(cal.oDomContainer, firstClass);
                }
 
                if (p==(pageCount-1)) {
-                       YAHOO.util.Dom.addClass(cal.oDomContainer, "last");
+                       YAHOO.util.Dom.addClass(cal.oDomContainer, lastClass);
                }
-               
+
                cal.parent = this;
                cal.index = p; 
 
@@ -3760,15 +4367,38 @@ YAHOO.widget.CalendarGroup.prototype.configPages = function(type, args, obj) {
 */
 YAHOO.widget.CalendarGroup.prototype.configPageDate = function(type, args, obj) {
        var val = args[0];
-
+       var firstPageDate;
+       
+       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+       
        for (var p=0;p<this.pages.length;++p) {
                var cal = this.pages[p];
-               cal.cfg.setProperty("pagedate", val);
-               var calDate = cal.cfg.getProperty("pagedate");
-               calDate.setMonth(calDate.getMonth()+p);
+               if (p === 0) {
+                       firstPageDate = cal._parsePageDate(val);
+                       cal.cfg.setProperty(cfgPageDate, firstPageDate);
+               } else {
+                       var pageDate = new Date(firstPageDate);
+                       this._setMonthOnDate(pageDate, pageDate.getMonth() + p);
+                       cal.cfg.setProperty(cfgPageDate, pageDate);
+               }
        }
 };
 
+/**
+* The default Config handler for the CalendarGroup "selected" property
+* @method configSelected
+* @param {String} type The CustomEvent type (usually the property name)
+* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
+*/
+YAHOO.widget.CalendarGroup.prototype.configSelected = function(type, args, obj) {
+       var cfgSelected = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;
+       this.delegateConfig(type, args, obj);
+       var selected = (this.pages.length > 0) ? this.pages[0].cfg.getProperty(cfgSelected) : []; 
+       this.cfg.setProperty(cfgSelected, selected, true);
+};
+
+
 /**
 * Delegates a configuration property to the CustomEvents associated with the CalendarGroup's children
 * @method delegateConfig
@@ -3794,7 +4424,7 @@ YAHOO.widget.CalendarGroup.prototype.delegateConfig = function(type, args, obj)
 * @param {Function}            fn                      The function to apply to each Calendar page object
 */
 YAHOO.widget.CalendarGroup.prototype.setChildFunction = function(fnName, fn) {
-       var pageCount = this.cfg.getProperty("pages");
+       var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
 
        for (var p=0;p<pageCount;++p) {
                this.pages[p][fnName] = fn;
@@ -3808,7 +4438,7 @@ YAHOO.widget.CalendarGroup.prototype.setChildFunction = function(fnName, fn) {
 * @param {Array}               args            The arguments to pass to the function
 */
 YAHOO.widget.CalendarGroup.prototype.callChildFunction = function(fnName, args) {
-       var pageCount = this.cfg.getProperty("pages");
+       var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
 
        for (var p=0;p<pageCount;++p) {
                var page = this.pages[p];
@@ -3847,10 +4477,20 @@ YAHOO.widget.CalendarGroup.prototype.constructChild = function(id,containerId,co
 */
 YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {
        month = parseInt(month, 10);
-
-       for (var p=0;p<this.pages.length;++p) {
+       var currYear;
+       
+       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+       
+       for (var p=0; p<this.pages.length; ++p) {
                var cal = this.pages[p];
-               cal.setMonth(month+p);
+               var pageDate = cal.cfg.getProperty(cfgPageDate);
+               if (p === 0) {
+                       currYear = pageDate.getFullYear();
+               } else {
+                       pageDate.setYear(currYear);
+               }
+               this._setMonthOnDate(pageDate, month+p); 
+               cal.cfg.setProperty(cfgPageDate, pageDate);
        }
 };
 
@@ -3861,11 +4501,13 @@ YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {
 * @param {Number}      year            The numeric 4-digit year
 */
 YAHOO.widget.CalendarGroup.prototype.setYear = function(year) {
-       year = parseInt(year, 10);
 
+       var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+
+       year = parseInt(year, 10);
        for (var p=0;p<this.pages.length;++p) {
                var cal = this.pages[p];
-               var pageDate = cal.cfg.getProperty("pageDate");
+               var pageDate = cal.cfg.getProperty(cfgPageDate);
 
                if ((pageDate.getMonth()+1) == 1 && p>0) {
                        year+=1;
@@ -3906,11 +4548,14 @@ YAHOO.widget.CalendarGroup.prototype.select = function(date) {
 };
 
 /**
-* Selects a date on the current calendar by referencing the index of the cell that should be selected.
-* This method is used to easily select a single cell (usually with a mouse click) without having to do
-* a full render. The selected style is applied to the cell directly.
+* Selects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
+* The value of the MULTI_SELECT Configuration attribute will determine the set of dates which get selected. 
+* <ul>
+*    <li>If MULTI_SELECT is false, selectCell will select the cell at the specified index for only the last displayed Calendar page.</li>
+*    <li>If MULTI_SELECT is true, selectCell will select the cell at the specified index, on each displayed Calendar page.</li>
+* </ul>
 * @method selectCell
-* @param       {Number}        cellIndex       The index of the cell to select in the current calendar
+* @param       {Number}        cellIndex       The index of the cell to be selected
 * @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
 */
 YAHOO.widget.CalendarGroup.prototype.selectCell = function(cellIndex) {
@@ -3957,11 +4602,11 @@ YAHOO.widget.CalendarGroup.prototype.deselectAll = function() {
 };
 
 /**
-* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
-* This method is used to easily deselect a single cell (usually with a mouse click) without having to do
-* a full render. The selected style is removed from the cell directly.
+* Deselects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
+* deselectCell will deselect the cell at the specified index on each displayed Calendar page.
+*
 * @method deselectCell
-* @param       {Number}        cellIndex       The index of the cell to deselect in the current calendar
+* @param       {Number}        cellIndex       The index of the cell to deselect. 
 * @return      {Date[]}        Array of JavaScript Date objects representing all individual dates that are currently selected.
 */
 YAHOO.widget.CalendarGroup.prototype.deselectCell = function(cellIndex) {
@@ -4048,8 +4693,7 @@ YAHOO.widget.CalendarGroup.prototype.previousYear = function() {
 */
 YAHOO.widget.CalendarGroup.prototype.getSelectedDates = function() { 
        var returnDates = [];
-       var selected = this.cfg.getProperty("selected");
-
+       var selected = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);
        for (var d=0;d<selected.length;++d) {
                var dateArray = selected[d];
 
@@ -4094,7 +4738,7 @@ YAHOO.widget.CalendarGroup.prototype.addMonthRenderer = function(month, fnRender
 * Adds a weekday to the render stack. The function reference passed to this method will be executed
 * when a date cell matches the weekday passed to this method.
 * @method addWeekdayRenderer
-* @param       {Number}        weekday         The weekday (0-6) to associate with this renderer
+* @param       {Number}        weekday         The weekday (1-7) to associate with this renderer. 1=Sunday, 2=Monday etc.
 * @param       {Function}      fnRender        The function executed to render cells that match the render rules for this renderer.
 */
 YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer = function(weekday, fnRender) {
@@ -4158,6 +4802,54 @@ YAHOO.widget.CalendarGroup.prototype.subtractYears = function(count) {
        this.callChildFunction("subtractYears", count);
 };
 
+/**
+* Shows the CalendarGroup's outer container.
+* @method show
+*/
+YAHOO.widget.CalendarGroup.prototype.show = function() {
+       this.oDomContainer.style.display = "block";
+       if (YAHOO.env.ua.opera) {
+               this._fixWidth();
+       }
+};
+
+/**
+* Sets the month on a Date object, taking into account year rollover if the month is less than 0 or greater than 11.
+* The Date object passed in is modified. It should be cloned before passing it into this method if the original value needs to be maintained
+* @method      _setMonthOnDate
+* @private
+* @param       {Date}  date    The Date object on which to set the month index
+* @param       {Number}        iMonth  The month index to set
+*/
+YAHOO.widget.CalendarGroup.prototype._setMonthOnDate = function(date, iMonth) {
+       // Bug in Safari 1.3, 2.0 (WebKit build < 420), Date.setMonth does not work consistently if iMonth is not 0-11
+       if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420 && (iMonth < 0 || iMonth > 11)) {
+               var DM = YAHOO.widget.DateMath;
+               var newDate = DM.add(date, DM.MONTH, iMonth-date.getMonth());
+               date.setTime(newDate.getTime());
+       } else {
+               date.setMonth(iMonth);
+       }
+};
+
+/**
+ * Fixes the width of the CalendarGroup container element, to account for miswrapped floats
+ * @method _fixWidth
+ * @private
+ */
+YAHOO.widget.CalendarGroup.prototype._fixWidth = function() {
+       var startW = this.oDomContainer.offsetWidth;
+       var w = 0;
+       for (var p=0;p<this.pages.length;++p) {
+               var cal = this.pages[p];
+               w += cal.oDomContainer.offsetWidth;
+       }
+       if (w > 0) {
+               this.oDomContainer.style.width = w + "px";
+       }
+};
+
+
 /**
 * CSS class representing the container for the calendar
 * @property YAHOO.widget.CalendarGroup.CSS_CONTAINER
@@ -4190,11 +4882,13 @@ YAHOO.widget.CalendarGroup.CSS_2UPTITLE = "title";
 * @property YAHOO.widget.CalendarGroup.CSS_2UPCLOSE
 * @static
 * @final
+* @deprecated  Along with Calendar.IMG_ROOT and NAV_ARROW_LEFT, NAV_ARROW_RIGHT configuration properties.
+*                                      Calendar's <a href="YAHOO.widget.Calendar.html#Style.CSS_CLOSE">Style.CSS_CLOSE</a> property now represents the CSS class used to render the close icon
 * @type String
 */
 YAHOO.widget.CalendarGroup.CSS_2UPCLOSE = "close-icon";
 
-YAHOO.augment(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",
+YAHOO.lang.augmentProto(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",
                                                                                                                                 "buildMonthLabel",
                                                                                                                                 "renderOutOfBoundsDate",
                                                                                                                                 "renderRowHeader",
@@ -4212,10 +4906,21 @@ YAHOO.augment(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel"
                                                                                                                                 "initStyles",
                                                                                                                                 "configTitle",
                                                                                                                                 "configClose",
+                                                                                                                                "configIframe",
                                                                                                                                 "hide",
-                                                                                                                                "show",
                                                                                                                                 "browser");
 
+/**
+* The set of default Config property keys and values for the CalendarGroup
+* @property YAHOO.widget.CalendarGroup._DEFAULT_CONFIG
+* @final
+* @static
+* @private
+* @type Object
+*/
+YAHOO.widget.CalendarGroup._DEFAULT_CONFIG = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES = {key:"pages", value:2};
+
 /**
 * Returns a string representation of the object.
 * @method toString
@@ -4241,4 +4946,6 @@ YAHOO.extend(YAHOO.widget.Calendar2up, YAHOO.widget.CalendarGroup);
 /**
 * @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
 */
-YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
\ No newline at end of file
+YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
+
+YAHOO.register("calendar", YAHOO.widget.Calendar, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/colorpicker/README b/lib/yui/colorpicker/README
new file mode 100755 (executable)
index 0000000..330b531
--- /dev/null
@@ -0,0 +1,4 @@
+ColorPicker - Release Notes
+
+2.3.0
+   * Initial release
diff --git a/lib/yui/colorpicker/assets/colorpicker_core.css b/lib/yui/colorpicker/assets/colorpicker_core.css
new file mode 100755 (executable)
index 0000000..5aa3015
--- /dev/null
@@ -0,0 +1,6 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
diff --git a/lib/yui/colorpicker/assets/hue_thumb.png b/lib/yui/colorpicker/assets/hue_thumb.png
new file mode 100755 (executable)
index 0000000..14d5db4
Binary files /dev/null and b/lib/yui/colorpicker/assets/hue_thumb.png differ
diff --git a/lib/yui/colorpicker/assets/picker_mask.png b/lib/yui/colorpicker/assets/picker_mask.png
new file mode 100755 (executable)
index 0000000..f8d9193
Binary files /dev/null and b/lib/yui/colorpicker/assets/picker_mask.png differ
diff --git a/lib/yui/colorpicker/assets/picker_thumb.png b/lib/yui/colorpicker/assets/picker_thumb.png
new file mode 100755 (executable)
index 0000000..78445a2
Binary files /dev/null and b/lib/yui/colorpicker/assets/picker_thumb.png differ
diff --git a/lib/yui/colorpicker/assets/skins/sam/colorpicker-skin.css b/lib/yui/colorpicker/assets/skins/sam/colorpicker-skin.css
new file mode 100755 (executable)
index 0000000..811d9ae
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
+.yui-picker-panel {
+    background: #e3e3e3;
+    border-color: #888;
+}
+
+.yui-picker-panel .hd {
+       background-color:#ccc;
+       font-size:100%;
+       line-height:100%;
+       border:1px solid #e3e3e3;
+       font-weight:bold;
+       overflow:hidden;
+       padding: 6px;
+    color: #000;
+}
+
+.yui-picker-panel .bd {
+    background: #e8e8e8;
+    margin: 1px;
+    height: 200px;
+}
+
+.yui-picker-panel .ft {
+    background: #e8e8e8;
+    margin: 1px;
+    padding: 1px;
+             /*
+    text-align: center;
+    */
+}
+
+.yui-picker {
+    position: relative;
+}
+
+.yui-picker-hue-thumb { cursor:default; width:18px; height:18px; 
+top: -8px;
+left: -2px;
+    z-index: 9; position:absolute; }
+.yui-picker-hue-bg {-moz-outline: none; outline:0px none;
+    position:absolute; left:200px; height:183px; width:14px;
+    background:url(hue_bg.png) no-repeat; 
+    top:4px; 
+}
+
+.yui-picker-bg {
+    -moz-outline: none; 
+    outline:0px none; 
+    position:absolute; 
+    top:4px;
+    left:4px; 
+    height:182px; 
+    width:182px; 
+    background-color:#F00; 
+    background-image: url(picker_mask.png);
+} 
+
+*html .yui-picker-bg {
+    background-image: none;
+    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/colorpicker/assets/picker_mask.png', sizingMethod='scale');
+}
+
+
+.yui-picker-mask { position:absolute; z-index: 1; top:0px; left:0px; } 
+
+.yui-picker-thumb { cursor:default; width:11px; height:11px; z-index: 9; position:absolute; 
+    top:-4px; left:-4px; }
+
+.yui-picker-swatch { position:absolute; left:240px; top:4px; height:60px;
+    width:55px; border:1px solid #888; }
+.yui-picker-websafe-swatch { position:absolute; left:304px; top:4px;
+    height:24px; width:24px; border:1px solid #888; }
+
+.yui-picker-controls { position:absolute; top: 72px; left:226px; font:1em monospace;}
+.yui-picker-controls .hd { background: transparent; border-width: 0px !important;}
+.yui-picker-controls .bd { height: 100px; border-width: 0px !important;}
+.yui-picker-controls ul {float:left;list-style:none;padding:0 2px 0 0;margin:0}
+.yui-picker-controls li {padding:2px;margin:0}
+.yui-picker-controls input { 
+    font-size: 0.85em;
+    width: 2.4em;
+}
+.yui-picker-hex-controls { 
+    clear: both; 
+    padding: 2px;
+}
+.yui-picker-hex-controls input { 
+    width: 4.6em;
+}
+
+.yui-picker-controls a {
+    font: 1em arial,helvetica,clean,sans-serif;
+    display:block;
+    *display:inline-block; /* IE */
+    padding: 0;
+    color: #000;
+
+}
diff --git a/lib/yui/colorpicker/assets/skins/sam/colorpicker.css b/lib/yui/colorpicker/assets/skins/sam/colorpicker.css
new file mode 100755 (executable)
index 0000000..f07aa51
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-picker-panel{background:#e3e3e3;border-color:#888;}.yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}.yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}.yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}.yui-picker{position:relative;}.yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}.yui-picker-hue-bg{-moz-outline:none;outline:0px none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}.yui-picker-bg{-moz-outline:none;outline:0px none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/colorpicker/assets/picker_mask.png',sizingMethod='scale');}.yui-picker-mask{position:absolute;z-index:1;top:0px;left:0px;}.yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}.yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}.yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}.yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}.yui-picker-controls .hd{background:transparent;border-width:0px !important;}.yui-picker-controls .bd{height:100px;border-width:0px !important;}.yui-picker-controls ul{float:left;list-style:none;padding:0 2px 0 0;margin:0}.yui-picker-controls li{padding:2px;margin:0}.yui-picker-controls input{font-size:0.85em;width:2.4em;}.yui-picker-hex-controls{clear:both;padding:2px;}.yui-picker-hex-controls input{width:4.6em;}.yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;}
diff --git a/lib/yui/colorpicker/assets/skins/sam/hue_bg.png b/lib/yui/colorpicker/assets/skins/sam/hue_bg.png
new file mode 100755 (executable)
index 0000000..d9bcdeb
Binary files /dev/null and b/lib/yui/colorpicker/assets/skins/sam/hue_bg.png differ
diff --git a/lib/yui/colorpicker/assets/skins/sam/picker_mask.png b/lib/yui/colorpicker/assets/skins/sam/picker_mask.png
new file mode 100755 (executable)
index 0000000..f8d9193
Binary files /dev/null and b/lib/yui/colorpicker/assets/skins/sam/picker_mask.png differ
diff --git a/lib/yui/colorpicker/colorpicker-beta-debug.js b/lib/yui/colorpicker/colorpicker-beta-debug.js
new file mode 100755 (executable)
index 0000000..83d861b
--- /dev/null
@@ -0,0 +1,1745 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * Provides color conversion and validation utils
+ * @class YAHOO.util.Color
+ * @namespace YAHOO.util
+ */
+YAHOO.util.Color = function() {
+
+    var HCHARS="0123456789ABCDEF", lang=YAHOO.lang;
+
+    return {
+
+        /**
+         * Converts 0-1 to 0-255
+         * @method real2dec
+         * @param n {float} the number to convert
+         * @return {int} a number 0-255
+         */
+        real2dec: function(n) {
+            return Math.min(255, Math.round(n*256));
+        },
+
+        /**
+         * Converts HSV (h[0-360], s[0-1]), v[0-1] to RGB [255,255,255]
+         * @method hsv2rgb
+         * @param h {int|[int, float, float]} the hue, or an
+         *        array containing all three parameters
+         * @param s {float} the saturation
+         * @param v {float} the value/brightness
+         * @return {[int, int, int]} the red, green, blue values in
+         *          decimal.
+         */
+        hsv2rgb: function(h, s, v) { 
+
+            if (lang.isArray(h)) {
+                return this.hsv2rgb.call(this, h[0], h[1], h[2]);
+            }
+
+            var r, g, b, i, f, p, q, t;
+            i = Math.floor((h/60)%6);
+            f = (h/60)-i;
+            p = v*(1-s);
+            q = v*(1-f*s);
+            t = v*(1-(1-f)*s);
+            switch(i) {
+                case 0: r=v; g=t; b=p; break;
+                case 1: r=q; g=v; b=p; break;
+                case 2: r=p; g=v; b=t; break;
+                case 3: r=p; g=q; b=v; break;
+                case 4: r=t; g=p; b=v; break;
+                case 5: r=v; g=p; b=q; break;
+            }
+
+            var fn=this.real2dec;
+
+            return [fn(r), fn(g), fn(b)];
+        },
+
+        /**
+         * Converts to RGB [255,255,255] to HSV (h[0-360], s[0-1]), v[0-1]
+         * @method rgb2hsv
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {[int, float, float]} the value converted to hsv
+         */
+        rgb2hsv: function(r, g, b) {
+
+            if (lang.isArray(r)) {
+                return this.rgb2hsv.call(this, r[0], r[1], r[2]);
+            }
+
+            r=r/255;
+            g=g/255;
+            b=b/255;
+
+            var min,max,delta,h,s,v;
+            min = Math.min(Math.min(r,g),b);
+            max = Math.max(Math.max(r,g),b);
+            delta = max-min;
+
+            switch (max) {
+                case min: h=0; break;
+                case r:   h=60*(g-b)/delta; 
+                          if (g<b) {
+                              h+=360;
+                          }
+                          break;
+                case g:   h=(60*(b-r)/delta)+120; break;
+                case b:   h=(60*(r-g)/delta)+240; break;
+            }
+            
+            s = (max === 0) ? 0 : 1-(min/max);
+
+            var hsv = [Math.round(h), s, max];
+
+            return hsv;
+
+        },
+
+        /**
+         * Converts decimal rgb values into a hex string
+         * 255,255,255 -> FFFFFF
+         * @method rgb2hex
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {string} the hex string
+         */
+        rgb2hex: function(r, g, b) {
+            if (lang.isArray(r)) {
+                return this.rgb2hex.call(this, r[0], r[1], r[2]);
+            }
+
+            var f=this.dec2hex;
+            return f(r) + f(g) + f(b);
+        },
+     
+        /**
+         * Converts an int 0...255 to hex pair 00...FF
+         * @method dec2hex
+         * @param n {int} the number to convert
+         * @return {string} the hex equivalent
+         */
+        dec2hex: function(n) {
+            n = parseInt(n, 10);
+            n = (lang.isNumber(n)) ? n : 0;
+            n = (n > 255 || n < 0) ? 0 : n;
+
+            return HCHARS.charAt((n - n % 16) / 16) + HCHARS.charAt(n % 16);
+        },
+
+        /**
+         * Converts a hex pair 00...FF to an int 0...255 
+         * @method hex2dec
+         * @param str {string} the hex pair to convert
+         * @return {int} the decimal
+         */
+        hex2dec: function(str) {
+            var f = function(c) {
+                return HCHARS.indexOf(c.toUpperCase());
+            };
+
+            var s=str.split('');
+            
+            return ((f(s[0]) * 16) + f(s[1]));
+        },
+
+        /**
+         * Converts a hex string to rgb
+         * @method hex2rgb
+         * @param str {string} the hex string
+         * @return {[int, int, int]} an array containing the rgb values
+         */
+        hex2rgb: function(s) { 
+            var f = this.hex2dec;
+            return [f(s.substr(0, 2)), f(s.substr(2, 2)), f(s.substr(4, 2))];
+        },
+
+        /**
+         * Returns the closest websafe color to the supplied rgb value.
+         * @method websafe
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {[int, int, int]} an array containing the closes
+         *                           websafe rgb colors.
+         */
+        websafe: function(r, g, b) {
+
+            if (lang.isArray(r)) {
+                return this.websafe.call(this, r[0], r[1], r[2]);
+            }
+
+            // returns the closest match [0, 51, 102, 153, 204, 255]
+            var f = function(v) {
+                if (lang.isNumber(v)) {
+                    v = Math.min(Math.max(0, v), 255);
+                    var i, next;
+                    for (i=0; i<256; i=i+51) {
+                        next = i+51;
+                        if (v >= i && v <= next) {
+                            return (v-i > 25) ? next : i;
+                        }
+                    }
+ YAHOO.log("Error calculating the websafe value for " + v, "warn");
+                }
+
+                return v;
+            };
+
+            return [f(r), f(g), f(b)];
+        }
+    };
+}();
+
+
+(function() {
+
+    var pickercount = 0;
+
+    /**
+     * The colorpicker module provides a widget for selecting colors
+     * @module colorpicker
+     * @requires yahoo, dom, event, element, slider
+     */
+
+    /**
+     * A widget to select colors
+     * @namespace YAHOO.widget
+     * @class YAHOO.widget.ColorPicker
+     * @extends YAHOO.util.Element
+     * @constructor
+     * @param {HTMLElement | String | Object} el(optional) The html 
+     * element that represents the colorpicker, or the attribute object to use. 
+     * An element will be created if none provided.
+     * @param {Object} attr (optional) A key map of the colorpicker's 
+     * initial attributes.  Ignored if first arg is attributes object.
+     */
+    YAHOO.widget.ColorPicker = function(el, attr) {
+        pickercount = pickercount + 1;
+        this.logger = new YAHOO.widget.LogWriter("ColorPicker");
+        attr = attr || {};
+        if (arguments.length === 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
+            attr = el; // treat first arg as attr object
+            el = attr.element || null;
+        }
+        
+        if (!el && !attr.element) { // create if we dont have one
+            this.logger.log("creating host element");
+            el = _createHostElement.call(this, attr);
+        }
+
+       YAHOO.widget.ColorPicker.superclass.constructor.call(this, el, attr); 
+    };
+
+    YAHOO.extend(YAHOO.widget.ColorPicker, YAHOO.util.Element);
+    
+    var proto = YAHOO.widget.ColorPicker.prototype,
+        Slider=YAHOO.widget.Slider,
+        Color=YAHOO.util.Color,
+        Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        lang = YAHOO.lang,
+        sub = lang.substitute;
+    
+
+    var b = "yui-picker";
+
+    /**
+     * The element ids used by this control
+     * @property ID
+     * @final
+     */
+    proto.ID = {
+
+        /**
+         * The id for the "red" form field
+         * @property ID.R
+         * @type String
+         * @final
+         * @default yui-picker-r
+         */
+        R: b + "-r",
+
+        /**
+         * The id for the "red" hex pair output
+         * @property ID.R_HEX
+         * @type String
+         * @final
+         * @default yui-picker-rhex
+         */
+        R_HEX: b + "-rhex",
+
+        /**
+         * The id for the "green" form field
+         * @property ID.G
+         * @type String
+         * @final
+         * @default yui-picker-g
+         */
+        G: b + "-g",
+
+        /**
+         * The id for the "green" hex pair output
+         * @property ID.G_HEX
+         * @type String
+         * @final
+         * @default yui-picker-ghex
+         */
+        G_HEX: b + "-ghex",
+
+
+        /**
+         * The id for the "blue" form field
+         * @property ID.B
+         * @type String
+         * @final
+         * @default yui-picker-b
+         */
+        B: b + "-b",
+
+        /**
+         * The id for the "blue" hex pair output
+         * @property ID.B_HEX
+         * @type String
+         * @final
+         * @default yui-picker-bhex
+         */
+        B_HEX: b + "-bhex",
+
+        /**
+         * The id for the "hue" form field
+         * @property ID.H
+         * @type String
+         * @final
+         * @default yui-picker-h
+         */
+        H: b + "-h",
+
+        /**
+         * The id for the "saturation" form field
+         * @property ID.S
+         * @type String
+         * @final
+         * @default yui-picker-s
+         */
+        S: b + "-s",
+
+        /**
+         * The id for the "value" form field
+         * @property ID.V
+         * @type String
+         * @final
+         * @default yui-picker-v
+         */
+        V: b + "-v",
+
+        /**
+         * The id for the picker region slider
+         * @property ID.PICKER_BG
+         * @type String
+         * @final
+         * @default yui-picker-bg
+         */
+        PICKER_BG:      b + "-bg",
+
+        /**
+         * The id for the picker region thumb
+         * @property ID.PICKER_THUMB
+         * @type String
+         * @final
+         * @default yui-picker-thumb
+         */
+        PICKER_THUMB:   b + "-thumb",
+
+        /**
+         * The id for the hue slider
+         * @property ID.HUE_BG
+         * @type String
+         * @final
+         * @default yui-picker-hue-bg
+         */
+        HUE_BG:         b + "-hue-bg",
+
+        /**
+         * The id for the hue thumb
+         * @property ID.HUE_THUMB
+         * @type String
+         * @final
+         * @default yui-picker-hue-thumb
+         */
+        HUE_THUMB:      b + "-hue-thumb",
+
+        /**
+         * The id for the hex value form field
+         * @property ID.HEX
+         * @type String
+         * @final
+         * @default yui-picker-hex
+         */
+        HEX:            b + "-hex",
+
+        /**
+         * The id for the color swatch
+         * @property ID.SWATCH
+         * @type String
+         * @final
+         * @default yui-picker-swatch
+         */
+        SWATCH:         b + "-swatch",
+
+        /**
+         * The id for the websafe color swatch
+         * @property ID.WEBSAFE_SWATCH
+         * @type String
+         * @final
+         * @default yui-picker-websafe-swatch
+         */
+        WEBSAFE_SWATCH: b + "-websafe-swatch",
+
+        /**
+         * The id for the control details
+         * @property ID.CONTROLS
+         * @final
+         * @default yui-picker-controls
+         */
+        CONTROLS: b + "-controls",
+
+        /**
+         * The id for the rgb controls
+         * @property ID.RGB_CONTROLS
+         * @final
+         * @default yui-picker-rgb-controls
+         */
+        RGB_CONTROLS: b + "-rgb-controls",
+
+        /**
+         * The id for the hsv controls
+         * @property ID.HSV_CONTROLS
+         * @final
+         * @default yui-picker-hsv-controls
+         */
+        HSV_CONTROLS: b + "-hsv-controls",
+        
+        /**
+         * The id for the hsv controls
+         * @property ID.HEX_CONTROLS
+         * @final
+         * @default yui-picker-hex-controls
+         */
+        HEX_CONTROLS: b + "-hex-controls",
+
+        /**
+         * The id for the hex summary
+         * @property ID.HEX_SUMMARY
+         * @final
+         * @default yui-picker-hex-summary
+         */
+        HEX_SUMMARY: b + "-hex-summary",
+
+        /**
+         * The id for the controls section header
+         * @property ID.CONTROLS_LABEL
+         * @final
+         * @default yui-picker-controls-label
+         */
+        CONTROLS_LABEL: b + "-controls-label"
+    };
+
+    /**
+     * Constants for any script-generated messages.  The values here
+     * are the default messages.  They can be updated by providing
+     * the complete list to the constructor for the "txt" attribute.
+     * @property TXT
+     * @final
+     */
+    proto.TXT = {
+        ILLEGAL_HEX: "Illegal hex value entered",
+        SHOW_CONTROLS: "Show color details",
+        HIDE_CONTROLS: "Hide color details",
+        CURRENT_COLOR: "Currently selected color: {rgb}",
+        CLOSEST_WEBSAFE: "Closest websafe color: {rgb}. Click to select.",
+        R: "R",
+        G: "G",
+        B: "B",
+        H: "H",
+        S: "S",
+        V: "V",
+        HEX: "#",
+        DEG: "\u00B0",
+        PERCENT: "%"
+    };
+
+    /**
+     * Constants for the default image locations for img tags that are
+     * generated by the control.  They can be modified by passing the
+     * complete list to the contructor for the "images" attribute
+     * @property IMAGE
+     * @final
+     */
+    proto.IMAGE = {
+        PICKER_THUMB: "../../build/colorpicker/assets/picker_thumb.png",
+        HUE_THUMB: "../../build/colorpicker/assets/hue_thumb.png"
+    };
+
+    /*
+     * Constants for the control's custom event names.  subscribe
+     * to the rgbChange event instead.
+     * @property EVENT
+     * @final
+     */
+    //proto.EVENT = {
+        //CHANGE: "change"
+    //};
+
+    //proto.CSS = { };
+
+    /**
+     * Constants for the control's default default values
+     * @property DEFAULT
+     * @final
+     */
+    proto.DEFAULT = {
+        PICKER_SIZE: 180
+    };
+
+    /**
+     * Constants for the control's configuration attributes
+     * @property OPT
+     * @final
+     */
+    proto.OPT = {
+        HUE: "hue",
+        SATURATION: "saturation",
+        VALUE: "value",
+        RED: "red",
+        GREEN: "green",
+        BLUE: "blue",
+        HSV: "hsv",
+        RGB: "rgb",
+        WEBSAFE: "websafe",
+        HEX: "hex",
+        PICKER_SIZE: "pickersize",
+        SHOW_CONTROLS: "showcontrols",
+        SHOW_RGB_CONTROLS: "showrgbcontrols",
+        SHOW_HSV_CONTROLS: "showhsvcontrols",
+        SHOW_HEX_CONTROLS: "showhexcontrols",
+        SHOW_HEX_SUMMARY: "showhexsummary",
+        SHOW_WEBSAFE: "showwebsafe",
+        //SHOW_SUBMIT: "showsubmit",
+        CONTAINER: "container",
+        IDS: "ids",
+        ELEMENTS: "elements",
+        TXT: "txt",
+        IMAGES: "images",
+        ANIMATE: "animate"
+    };
+
+    /**
+     * Sets the control to the specified rgb value and
+     * moves the sliders to the proper positions
+     * @method setValue
+     * @param rgb {[int, int, int]} the rgb value
+     * @param silent {boolean} whether or not to fire the change event
+     */
+    proto.setValue = function(rgb, silent) {
+        silent = (silent) || false;
+        this.set(this.OPT.RGB, rgb, silent);
+        _updateSliders.call(this);
+    };
+
+    /**
+     * The hue slider
+     * @property hueSlider
+     * @type YAHOO.widget.Slider
+     */
+    proto.hueSlider = null; 
+    
+    /**
+     * The picker region
+     * @property pickerSlider
+     * @type YAHOO.widget.Slider
+     */
+    proto.pickerSlider = null;
+
+    /**
+     * Translates the slider value into hue, int[0,359]
+     * @method _getH
+     * @private
+     * @return {int} the hue from 0 to 359
+     */
+    var _getH = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            h = (size - this.hueSlider.getValue()) / size;
+        h = Math.round(h*360);
+        return (h === 360) ? 0 : h;
+    };
+
+    /**
+     * Translates the slider value into saturation, int[0,1], left to right
+     * @method _getS
+     * @private
+     * @return {int} the saturation from 0 to 1
+     */
+    var _getS = function() {
+        return this.pickerSlider.getXValue() / this.get(this.OPT.PICKER_SIZE);
+    };
+
+    /**
+     * Translates the slider value into value/brightness, int[0,1], top
+     * to bottom
+     * @method _getV
+     * @private
+     * @return {int} the value from 0 to 1
+     */
+    var _getV = function() {
+        var size = this.get(this.OPT.PICKER_SIZE);
+        return (size - this.pickerSlider.getYValue()) / size;
+    };
+
+    /**
+     * Updates the background of the swatch with the current rbg value.
+     * Also updates the websafe swatch to the closest websafe color
+     * @method _updateSwatch
+     * @private
+     */
+    var _updateSwatch = function() {
+        var rgb = this.get(this.OPT.RGB),
+            websafe = this.get(this.OPT.WEBSAFE),
+            el = this.getElement(this.ID.SWATCH),
+            color = rgb.join(","),
+            txt = this.get(this.OPT.TXT);
+
+        Dom.setStyle(el, "background-color", "rgb(" + color  + ")");
+        el.title = lang.substitute(txt.CURRENT_COLOR, {
+                "rgb": "#" + this.get(this.OPT.HEX)
+            });
+
+
+        el = this.getElement(this.ID.WEBSAFE_SWATCH);
+        color = websafe.join(",");
+
+        Dom.setStyle(el, "background-color", "rgb(" + color + ")");
+        el.title = lang.substitute(txt.CLOSEST_WEBSAFE, {
+                "rgb": "#" + Color.rgb2hex(websafe)
+            });
+
+    };
+
+    /**
+     * Reads the sliders and converts the values to RGB, updating the
+     * internal state for all the individual form fields
+     * @method _getValuesFromSliders
+     * @private
+     */
+    var _getValuesFromSliders = function() {
+        var h=_getH.call(this), s=_getS.call(this), v=_getV.call(this);
+        YAHOO.log("hsv " + [h, s, v]);
+
+        rgb = Color.hsv2rgb(h, s, v);
+        var websafe = Color.websafe(rgb);
+        var hex = Color.rgb2hex(rgb[0], rgb[1], rgb[2]);
+
+        this.set(this.OPT.RGB, rgb);
+    };
+
+    /**
+     * Updates the form field controls with the state data contained
+     * in the control.
+     * @method _updateFormFields
+     * @private
+     */
+    var _updateFormFields = function() {
+        this.getElement(this.ID.H).value = this.get(this.OPT.HUE);
+        this.getElement(this.ID.S).value = this.get(this.OPT.SATURATION);
+        this.getElement(this.ID.V).value = this.get(this.OPT.VALUE);
+        this.getElement(this.ID.R).value = this.get(this.OPT.RED);
+        this.getElement(this.ID.R_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.RED));
+        this.getElement(this.ID.G).value = this.get(this.OPT.GREEN);
+        this.getElement(this.ID.G_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.GREEN));
+        this.getElement(this.ID.B).value = this.get(this.OPT.BLUE);
+        this.getElement(this.ID.B_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.BLUE));
+        this.getElement(this.ID.HEX).value = this.get(this.OPT.HEX);
+    };
+
+    /**
+     * Event handler for the hue slider.
+     * @method _onHueSliderChange
+     * @param newOffset {int} pixels from the start position
+     * @private
+     */
+    var _onHueSliderChange = function(newOffset) {
+        this.logger.log("hue update: " + newOffset , "warn");
+
+        var h = _getH.call(this);
+        this.set(this.OPT.HUE, h, true);
+
+        // set picker background to the hue
+        var rgb = Color.hsv2rgb(h, 1, 1);
+        var styleDef = "rgb(" + rgb.join(",") + ")";
+
+        Dom.setStyle(this.getElement(this.ID.PICKER_BG), "background-color", styleDef);
+
+        if (this.hueSlider.valueChangeSource === this.hueSlider.SOURCE_UI_EVENT) {
+            _getValuesFromSliders.call(this);
+        }
+
+        _updateFormFields.call(this);
+        _updateSwatch.call(this);
+    };
+
+    /**
+     * Event handler for the picker slider, which controls the
+     * saturation and value/brightness.
+     * @method _onPickerSliderChange
+     * @param newOffset {{x: int, y: int}} x/y pixels from the start position
+     * @private
+     */
+    var _onPickerSliderChange = function(newOffset) {
+        this.logger.log(sub("picker update [{x}, {y}]", newOffset));
+
+        var s=_getS.call(this), v=_getV.call(this);
+        this.set(this.OPT.SATURATION, Math.round(s*100), true);
+        this.set(this.OPT.VALUE, Math.round(v*100), true);
+
+        if (this.pickerSlider.valueChangeSource === this.pickerSlider.SOURCE_UI_EVENT) {
+            _getValuesFromSliders.call(this);
+        }
+
+        _updateFormFields.call(this);
+        _updateSwatch.call(this);
+    };
+
+
+    /**
+     * Key map to well-known commands for txt field input
+     * @method _getCommand
+     * @param e {Event} the keypress or keydown event
+     * @return {int} a command code
+     * <ul>
+     * <li>0 = not a number, letter in range, or special key</li>
+     * <li>1 = number</li>
+     * <li>2 = a-fA-F</li>
+     * <li>3 = increment (up arrow)</li>
+     * <li>4 = decrement (down arrow)</li>
+     * <li>5 = special key (tab, delete, return, escape, left, right)</li> 
+     * <li>6 = return</li>
+     * </ul>
+     * @private
+     */
+    var _getCommand = function(e) {
+        var c = Event.getCharCode(e);
+
+        //alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode);
+
+        // special keys
+        if (c === 38) { // up arrow
+            return 3;
+        } else if (c === 13) { // return
+            return 6;
+        } else if (c === 40) { // down array
+            return 4;
+        } else if (c >= 48 && c<=57) { // 0-9
+            return 1;
+        } else if (c >= 97 && c<=102) { // a-f
+            return 2;
+        } else if (c >= 65 && c<=70) { // A-F
+            return 2;
+        //} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 || 
+        //              (c >= 112 && c <=123)) { // including F-keys
+        // tab, delete, return, escape, left, right
+        } else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1) { // special chars
+            return 5;
+        } else { // something we probably don't want
+            return 0;
+        }
+    };
+
+    /**
+     * Handle keypress on one of the rgb or hsv fields.
+     * @method _rgbFieldKeypress
+     * @param e {Event} the keypress event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _rgbFieldKeypress = function(e, el, prop) {
+        var command = _getCommand(e);
+        var inc = (e.shiftKey) ? 10 : 1;
+        switch (command) {
+            case 6: // return, update the value
+                _useFieldValue.apply(this, arguments);
+                break;
+                        
+            case 3: // up arrow, increment
+                this.set(prop, Math.min(this.get(prop)+inc, 255));
+                _updateFormFields.call(this);
+                //Event.stopEvent(e);
+                break;
+            case 4: // down arrow, decrement
+                this.set(prop, Math.max(this.get(prop)-inc, 0));
+                _updateFormFields.call(this);
+                //Event.stopEvent(e);
+                break;
+
+            default:
+        }
+
+    };
+
+    /**
+     * Handle keydown on the hex field
+     * @method _hexFieldKeypress
+     * @param e {Event} the keypress event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _hexFieldKeypress = function(e, el, prop) {
+        var command = _getCommand(e);
+        if (command === 6) { // return, update the value
+            _useFieldValue.apply(this, arguments);
+        }
+    };
+
+    /**
+     * Use the value of the text field to update the control
+     * @method _hexFieldKeypress
+     * @param e {Event} an event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _useFieldValue = function(e, el, prop) {
+        var val = el.value;
+
+        if (prop !== this.OPT.HEX) {
+            val = parseInt(val, 10);
+        }
+
+        if (val !== this.get(prop)) {
+            this.set(prop, val);
+        }
+    };
+
+    /** 
+     * Allows numbers and special chars only.  Used for the
+     * rgb and hsv fields keypress handler.
+     * @method _numbersOnly
+     * @param e {Event} the event
+     * @private
+     * @return {boolean} false if we are canceling the event
+     */
+    var _numbersOnly = function(e) {
+        return _hexOnly(e, true);
+    };
+
+    /** 
+     * Allows numbers and special chars, and by default allows a-f.  
+     * Used for the hex field keypress handler.
+     * @method _hexOnly
+     * @param e {Event} the event
+     * @param numbersOnly omits a-f if set to true
+     * @private
+     * @return {boolean} false if we are canceling the event
+     */
+    var _hexOnly = function(e, numbersOnly) {
+        var command = _getCommand(e);
+        switch (command) {
+            case 6: // return
+            case 5: // special char
+            case 1: // number
+                break;
+            case 2: // hex char (a-f)
+                if (numbersOnly !== true) {
+                    break;
+                }
+
+                // fallthrough is intentional
+
+            default: // prevent alpha and punctuation
+                Event.stopEvent(e);
+                return false;
+        }
+    };
+
+    /**
+     * Returns the element reference that is saved.  The id can be either
+     * the element id, or the key for this id in the "id" config attribute.
+     * For instance, the host element id can be obtained by passing its
+     * id (default: "yui_picker") or by its key "YUI_PICKER".
+     * @param id {string} the element id, or key 
+     * @return {HTMLElement} a reference to the element
+     */
+    proto.getElement = function(id) { 
+        return this.get(this.OPT.ELEMENTS)[this.get(this.OPT.IDS)[id]]; 
+    };
+
+    _createElements = function() {
+        this.logger.log("Building markup");
+        var el, child, img, fld, i, 
+            ids = this.get(this.OPT.IDS),
+            txt = this.get(this.OPT.TXT),
+            images = this.get(this.OPT.IMAGES),
+            Elem = function(type, o) {
+                var n = document.createElement(type);
+                if (o) {
+                    lang.augmentObject(n, o, true);
+                }
+                return n;
+            },
+            RGBElem = function(type, obj) {
+                var o = lang.merge({
+                        //type: "txt",
+                        autocomplete: "off",
+                        value: "0",
+                        size: 3,
+                        maxlength: 3
+                    }, obj);
+
+                o.name = o.id;
+                return new Elem(type, o);
+            };
+
+        var p = this.get("element");
+
+        // Picker slider (S and V) ---------------------------------------------
+
+        el = new Elem("div", {
+            id: ids[this.ID.PICKER_BG],
+            className: "yui-picker-bg",
+            tabIndex: -1,
+            hideFocus: true
+        });
+
+        child = new Elem("div", {
+            id: ids[this.ID.PICKER_THUMB],
+            className: "yui-picker-thumb"
+        });
+
+        img = new Elem("img", {
+            src: images.PICKER_THUMB
+        });
+
+        child.appendChild(img);
+        el.appendChild(child);
+        p.appendChild(el);
+        
+        // Hue slider ---------------------------------------------
+        el = new Elem("div", {
+            id: ids[this.ID.HUE_BG],
+            className: "yui-picker-hue-bg",
+            tabIndex: -1,
+            hideFocus: true
+        });
+
+        child = new Elem("div", {
+            id: ids[this.ID.HUE_THUMB],
+            className: "yui-picker-hue-thumb"
+        });
+
+        img = new Elem("img", {
+            src: images.HUE_THUMB
+        });
+
+        child.appendChild(img);
+        el.appendChild(child);
+        p.appendChild(el);
+
+
+        // controls ---------------------------------------------
+
+        el = new Elem("div", {
+            id: ids[this.ID.CONTROLS],
+            className: "yui-picker-controls"
+        });
+
+        p.appendChild(el);
+        p = el;
+
+            // controls header
+            el = new Elem("div", {
+                className: "hd"
+            });
+
+            child = new Elem("a", {
+                id: ids[this.ID.CONTROLS_LABEL],
+                //className: "yui-picker-controls-label",
+                href: "#"
+            });
+            el.appendChild(child);
+            p.appendChild(el);
+
+            // bd
+            el = new Elem("div", {
+                className: "bd"
+            });
+
+            p.appendChild(el);
+            p = el;
+
+                // rgb
+                el = new Elem("ul", {
+                    id: ids[this.ID.RGB_CONTROLS],
+                    className: "yui-picker-rgb-controls"
+                });
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.R + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.R],
+                    className: "yui-picker-r"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.G + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.G],
+                    className: "yui-picker-g"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.B + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.B],
+                    className: "yui-picker-b"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                p.appendChild(el);
+
+                // hsv
+                el = new Elem("ul", {
+                    id: ids[this.ID.HSV_CONTROLS],
+                    className: "yui-picker-hsv-controls"
+                });
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.H + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.H],
+                    className: "yui-picker-h"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.DEG));
+
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.S + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.S],
+                    className: "yui-picker-s"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.PERCENT));
+
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.V + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.V],
+                    className: "yui-picker-v"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.PERCENT));
+
+                el.appendChild(child);
+                p.appendChild(el);
+
+
+                // hex summary
+
+                el = new Elem("ul", {
+                    id: ids[this.ID.HEX_SUMMARY],
+                    className: "yui-picker-hex_summary"
+                });
+
+                child = new Elem("li", {
+                    id: ids[this.ID.R_HEX]
+                });
+                el.appendChild(child);
+
+                child = new Elem("li", {
+                    id: ids[this.ID.G_HEX]
+                });
+                el.appendChild(child);
+
+                child = new Elem("li", {
+                    id: ids[this.ID.B_HEX]
+                });
+                el.appendChild(child);
+                p.appendChild(el);
+
+                // hex field
+                el = new Elem("div", {
+                    id: ids[this.ID.HEX_CONTROLS],
+                    className: "yui-picker-hex-controls"
+                });
+                el.appendChild(document.createTextNode(txt.HEX + " "));
+
+                child = new RGBElem("input", {
+                    id: ids[this.ID.HEX],
+                    className: "yui-picker-hex",
+                    size: 6,
+                    maxlength: 6
+                });
+
+                el.appendChild(child);
+                p.appendChild(el);
+
+                p = this.get("element");
+
+                // swatch
+                el = new Elem("div", {
+                    id: ids[this.ID.SWATCH],
+                    className: "yui-picker-swatch"
+                });
+
+                p.appendChild(el);
+
+                // websafe swatch
+                el = new Elem("div", {
+                    id: ids[this.ID.WEBSAFE_SWATCH],
+                    className: "yui-picker-websafe-swatch"
+                });
+
+                p.appendChild(el);
+
+    };
+
+    /**
+     * Sets the initial state of the sliders
+     * @method initPicker
+     */
+    proto.initPicker = function () {
+
+        // bind all of our elements
+        var o=this.OPT, 
+            ids = this.get(o.IDS), 
+            els = this.get(o.ELEMENTS), 
+                  i, el, id;
+
+        // Add the default value as a key for each element for easier lookup
+        for (i in this.ID) {
+            if (lang.hasOwnProperty(this.ID, i)) {
+                ids[this.ID[i]] = ids[i];
+            }
+        }
+
+        // Check for picker element, if not there, create all of them
+        el = Dom.get(ids[this.ID.PICKER_BG]);
+        if (!el) {
+            _createElements.call(this);
+        } else {
+            this.logger.log("Using pre-existing markup");
+        }
+
+        for (i in ids) {
+            if (lang.hasOwnProperty(ids, i)) {
+                // look for element
+                el = Dom.get(ids[i]);
+
+                // generate an id if the implementer passed in an element reference,
+                // and the element did not have an id already
+                id = Dom.generateId(el);
+
+                // update the id in case we generated the id
+                ids[i] = id; // key is WEBSAFE_SWATCH
+                ids[ids[i]] = id; // key is websafe_swatch
+
+                // store the dom ref
+                els[id] = el;
+            }
+        }
+
+        // set the initial visibility state of our controls
+            els = [o.SHOW_CONTROLS, 
+                   o.SHOW_RGB_CONTROLS,
+                   o.SHOW_HSV_CONTROLS,
+                   o.SHOW_HEX_CONTROLS,
+                   o.SHOW_HEX_SUMMARY,
+                   o.SHOW_WEBSAFE
+                   ];
+
+        for (i=0; i<els.length; i=i+1) {
+            this.set(els[i], this.get(els[i]));
+        }
+
+        var s = this.get(o.PICKER_SIZE);
+        this.logger.log("picker size" + s);
+
+        this.hueSlider = Slider.getVertSlider(this.getElement(this.ID.HUE_BG), 
+                                              this.getElement(this.ID.HUE_THUMB), 0, s);
+        this.hueSlider.subscribe("change", _onHueSliderChange, this, true);
+
+        this.pickerSlider = Slider.getSliderRegion(this.getElement(this.ID.PICKER_BG), 
+                                                   this.getElement(this.ID.PICKER_THUMB), 0, s, 0, s);
+        this.pickerSlider.subscribe("change", _onPickerSliderChange, this, true);
+
+        //_onHueSliderChange.call(this, 0);
+
+        Event.on(this.getElement(this.ID.WEBSAFE_SWATCH), "click", function(e) {
+               this.setValue(this.get(o.WEBSAFE));
+               //_updateSliders
+           }, this, true);
+
+        Event.on(this.getElement(this.ID.CONTROLS_LABEL), "click", function(e) {
+               this.set(o.SHOW_CONTROLS, !this.get(o.SHOW_CONTROLS));
+               Event.preventDefault(e);
+           }, this, true);
+
+        _attachRGBHSV.call(this, this.ID.R, this.OPT.RED); 
+        _attachRGBHSV.call(this, this.ID.G, this.OPT.GREEN); 
+        _attachRGBHSV.call(this, this.ID.B, this.OPT.BLUE); 
+        _attachRGBHSV.call(this, this.ID.H, this.OPT.HUE); 
+        _attachRGBHSV.call(this, this.ID.S, this.OPT.SATURATION); 
+        _attachRGBHSV.call(this, this.ID.V, this.OPT.VALUE); 
+
+        Event.on(this.getElement(this.ID.HEX), "keydown", function(e, me) {
+                _hexFieldKeypress.call(me, e, this, me.OPT.HEX);
+            }, this);
+
+        Event.on(this.getElement(this.ID.HEX), "keypress", _hexOnly, this);
+        Event.on(this.getElement(this.ID.HEX), "blur", function(e, me) {
+                _useFieldValue.call(me, e, this, me.OPT.HEX);
+            }, this);
+    };
+
+    _attachRGBHSV = function(id, config) {
+        Event.on(this.getElement(id), "keydown", function(e, me) {
+                _rgbFieldKeypress.call(me, e, this, config);
+            }, this);
+        Event.on(this.getElement(id), "keypress", _numbersOnly, this);
+        Event.on(this.getElement(id), "blur", function(e, me) {
+                _useFieldValue.call(me, e, this, config);
+            }, this);
+    };
+
+
+    /**
+     * Sets up the config attributes and the change listeners for this
+     * properties
+     * @method initAttributes
+     * @param attr An object containing default attribute values
+     */
+    proto.initAttributes = function(attr) {
+
+        attr = attr || {};
+        YAHOO.widget.ColorPicker.superclass.initAttributes.call(this, attr);
+        
+        /**
+         * The size of the picker. Trying to change this is not recommended.
+         * @config pickersize
+         * @default 180
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.PICKER_SIZE, {
+                value: attr.size || this.DEFAULT.PICKER_SIZE
+            });
+
+        /**
+         * The current hue value 0-360
+         * @config hue
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.HUE, {
+                value: attr.hue || 0,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current saturation value 0-100
+         * @config saturation
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.SATURATION, {
+                value: attr.saturation || 0,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current value/brightness value 0-100
+         * @config value
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.VALUE, {
+                value: attr.value || 100,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current red value 0-255
+         * @config red
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.RED, {
+                value: attr.red || 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current green value 0-255
+         * @config green 
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.GREEN, {
+                value: attr.red || 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current blue value 0-255
+         * @config blue
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.BLUE, {
+                value: attr.blue || 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current hex value #000000-#FFFFFF, without the #
+         * @config hex
+         * @type string
+         */
+        this.setAttributeConfig(this.OPT.HEX, {
+                value: attr.hex || "FFFFFF",
+                validator: lang.isString
+            });
+
+        /**
+         * The current rgb value.  Updates the state of all of the
+         * other value fields.  Read-only: use setValue to set the
+         * controls rgb value.
+         * @config hex
+         * @type [int, int, int]
+         * @readonly
+         */
+        this.setAttributeConfig(this.OPT.RGB, {
+                value: attr.rgb || [255,255,255],
+                method: function(rgb) {
+
+                    this.set(this.OPT.RED, rgb[0], true);
+                    this.set(this.OPT.GREEN, rgb[1], true);
+                    this.set(this.OPT.BLUE, rgb[2], true);
+
+                    var websafe = Color.websafe(rgb);
+                    this.set(this.OPT.WEBSAFE, websafe, true);
+
+                    var hex = Color.rgb2hex(rgb);
+                    this.set(this.OPT.HEX, hex, true);
+
+                    var hsv = Color.rgb2hsv(rgb);
+
+                    this.logger.log(sub("RGB value set to {rgb} (hsv: {hsv})", {
+                            "hsv": hsv, "rgb": rgb
+                        }));
+
+                    this.set(this.OPT.HUE, hsv[0], true);
+                    this.set(this.OPT.SATURATION, Math.round(hsv[1]*100), true);
+                    this.set(this.OPT.VALUE, Math.round(hsv[2]*100), true);
+                },
+                readonly: true
+            });
+
+        /**
+         * If the color picker will live inside of a container object,
+         * set, provide a reference to it so the control can use the
+         * container's events.
+         * @config container
+         * @type YAHOO.widget.Panel
+         */
+        this.setAttributeConfig(this.OPT.CONTAINER, {
+                    value: null,
+                    method: function(container) {
+                        if (container) {
+                            // Position can get out of sync when the
+                            // control is manipulated while display is
+                            // none.  Resetting the slider constraints
+                            // when it is visible gets the state back in
+                            // order.
+                            container.showEvent.subscribe(function() {
+                                // this.pickerSlider.thumb.resetConstraints();
+                                // this.hueSlider.thumb.resetConstraints();
+                                this.pickerSlider.focus();
+                            }, this, true);
+                        }
+                    }
+                });
+        /**
+         * The closest current websafe value
+         * @config websafe
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.WEBSAFE, {
+                value: attr.websafe || [255,255,255]
+            });
+
+
+        ids = attr.ids || lang.merge({}, this.ID);
+
+        if (!attr.ids && pickercount > 1) {
+            for (var i in ids) {
+                if (lang.hasOwnProperty(ids, i)) {
+                    ids[i] = ids[i] + pickercount;
+                }
+            }
+        }
+
+
+        /**
+         * A list of element ids and/or element references used by the 
+         * control.  The default is the this.ID list, and can be customized
+         * by passing a list in the contructor
+         * @config ids
+         * @type {referenceid: realid}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.IDS, {
+                value: ids,
+                writeonce: true
+            });
+
+        /**
+         * A list of txt strings for internationalization.  Default
+         * is this.TXT
+         * @config txt
+         * @type {key: txt}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.TXT, {
+                value: attr.txt || this.TXT,
+                writeonce: true
+            });
+
+        /**
+         * The img src default list
+         * is this.IMAGES
+         * @config images
+         * @type {key: image}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.IMAGES, {
+                value: attr.images || this.IMAGE,
+                writeonce: true
+            });
+        /**
+         * The element refs used by this control.  Set at initialization
+         * @config elements
+         * @type {id: HTMLElement}
+         * @readonly
+         */
+        this.setAttributeConfig(this.OPT.ELEMENTS, {
+                value: {},
+                readonly: true
+            });
+
+        /**
+         * Returns the cached element reference.  If the id is not a string, it
+         * is assumed that it is an element and this is returned.
+         * @param id {string|HTMLElement} the element key, id, or ref
+         * @param on {boolean} hide or show.  If true, show
+         * @private */
+        _hideShowEl = function(id, on) {
+            var el = (lang.isString(id) ? this.getElement(id) : id);
+            //Dom.setStyle(id, "visibility", (on) ? "" : "hidden");
+            Dom.setStyle(el, "display", (on) ? "" : "none");
+        };
+
+        /**
+         * Hide/show the entire set of controls
+         * @config showcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_CONTROLS, {
+                value: (attr.showcontrols) || true,
+                method: function(on) {
+
+                    var el = Dom.getElementsByClassName("bd", "div", 
+                            this.getElement(this.ID.CONTROLS))[0];
+
+                    _hideShowEl.call(this, el, on);
+
+                    this.getElement(this.ID.CONTROLS_LABEL).innerHTML = 
+                        (on) ? this.get(this.OPT.TXT).HIDE_CONTROLS :
+                               this.get(this.OPT.TXT).SHOW_CONTROLS;
+
+                }
+            });
+
+        /**
+         * Hide/show the rgb controls
+         * @config showrgbcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_RGB_CONTROLS, {
+                value: (attr.showrgbcontrols) || true,
+                method: function(on) {
+                    //Dom.setStyle(this.getElement(this.ID.RBG_CONTROLS), "visibility", (on) ? "" : "hidden");
+                    _hideShowEl.call(this, this.ID.RGB_CONTROLS, on);
+                }
+            });
+
+        /**
+         * Hide/show the hsv controls
+         * @config showhsvcontrols
+         * @type boolean
+         * @default false
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HSV_CONTROLS, {
+                value: (attr.showhsvcontrols) || false,
+                method: function(on) {
+                    //Dom.setStyle(this.getElement(this.ID.HSV_CONTROLS), "visibility", (on) ? "" : "hidden");
+                    _hideShowEl.call(this, this.ID.HSV_CONTROLS, on);
+
+                    // can't show both the hsv controls and the rbg hex summary
+                    if (on && this.get(this.OPT.SHOW_HEX_SUMMARY)) {
+                        this.set(this.OPT.SHOW_HEX_SUMMARY, false);
+                    }
+                }
+            });
+
+        /**
+         * Hide/show the hex controls
+         * @config showhexcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HEX_CONTROLS, {
+                value: (attr.showhexcontrols) || false,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.HEX_CONTROLS, on);
+                }
+            });
+
+        /**
+         * Hide/show the websafe swatch
+         * @config showwebsafe
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_WEBSAFE, {
+                value: (attr.showwebsafe) || true,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.WEBSAFE_SWATCH, on);
+                }
+            });
+
+        /**
+         * Hide/show the hex summary
+         * @config showhexsummary
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HEX_SUMMARY, {
+                value: (attr.showhexsummary) || true,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.HEX_SUMMARY, on);
+
+                    // can't show both the hsv controls and the rbg hex summary
+                    if (on && this.get(this.OPT.SHOW_HSV_CONTROLS)) {
+                        this.set(this.OPT.SHOW_HSV_CONTROLS, false);
+                    }
+                }
+            });
+        this.setAttributeConfig(this.OPT.ANIMATE, {
+                value: (attr.animate) || true,
+                method: function(on) {
+                    this.pickerSlider.animate = on;
+                    this.hueSlider.animate = on;
+                }
+            });
+
+        this.on(this.OPT.HUE + "Change", _updateRGBFromHSV, this, true);
+        this.on(this.OPT.SATURATION + "Change", _updateRGBFromHSV, this, true);
+        this.on(this.OPT.VALUE + "Change", _updatePickerSlider, this, true);
+
+        this.on(this.OPT.RED + "Change", _updateRGB, this, true);
+        this.on(this.OPT.GREEN + "Change", _updateRGB, this, true);
+        this.on(this.OPT.BLUE + "Change", _updateRGB, this, true);
+
+        this.on(this.OPT.HEX + "Change", _updateHex, this, true);
+
+        this.initPicker();
+    };
+
+    /**
+     * Updates the rgb attribute with the current state of the r,g,b
+     * fields.  This is invoked from change listeners on these
+     * attributes to facilitate updating these values from the
+     * individual form fields
+     * @method _updateRGB
+     * @private
+     */
+    var _updateRGB = function() {
+        var rgb = [this.get(this.OPT.RED), 
+                   this.get(this.OPT.GREEN),
+                   this.get(this.OPT.BLUE)];
+
+        this.logger.log("RGB value set to " + rgb);
+        this.set(this.OPT.RGB, rgb);
+
+        _updateSliders.call(this);
+    };
+
+    /**
+     * Updates the RGB values from the current state of the HSV
+     * values.  Executed when the one of the HSV form fields are
+     * updated
+     * _updateRGBFromHSV
+     * @private
+     */
+    var _updateRGBFromHSV = function() {
+        var hsv = [this.get(this.OPT.HUE), 
+                   this.get(this.OPT.SATURATION)/100,
+                   this.get(this.OPT.VALUE)/100];
+
+        var rgb = Color.hsv2rgb(hsv);
+
+        this.logger.log("HSV converted to RGB " + hsv + " : " + rgb);
+        this.set(this.OPT.RGB, rgb);
+
+        _updateSliders.call(this);
+    };
+
+    /**
+     * Parses the hex string to normalize shorthand values, converts
+     * the hex value to rgb and updates the rgb attribute (which
+     * updates the state for all of the other values)
+     * method _updateHex
+     * @private
+     */
+    var _updateHex = function() {
+       
+        var hex = this.get(this.OPT.HEX), l=hex.length;
+
+        // support #369 -> #336699 shorthand
+        if (l === 3) {
+            var c = hex.split(""), i;
+            for (i=0; i<l; i=i+1) {
+                c[i] = c[i] + c[i];
+            }
+
+            hex = c.join("");
+        }
+
+        if (hex.length !== 6) {
+            this.logger.log(this.get(this.TXT.ILLEGAL_HEX), "error");
+            return false;
+        }
+
+        var rgb = Color.hex2rgb(hex);
+
+        this.logger.log(sub("Hex value set to {hex} ({rgb})", {
+                hex: hex, rgb: rgb
+            }));
+
+        this.setValue(rgb);
+
+        //_updateSliders.call(this);
+
+    };
+
+    /**
+     * Moves the sliders into the position dictated by the current state
+     * of the control
+     * @method _updateSliders
+     * @private
+     */
+    var _updateSliders = function() {
+        _updateHueSlider.call(this);
+        _updatePickerSlider.call(this);
+    };
+
+    /**
+     * Moves the hue slider into the position dictated by the current state
+     * of the control
+     * @method _updateHueSlider
+     * @private
+     */
+    var _updateHueSlider = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            h = this.get(this.OPT.HUE);
+
+        h = size - Math.round(h / 360 * size);
+        
+        // 0 is at the top and bottom of the hue slider.  Always go to
+        // the top so we don't end up sending the thumb to the bottom
+        // when the value didn't actually change (e.g., a conversion
+        // produced 360 instead of 0 and the value was already 0).
+        if (h === size) {
+            h = 0;
+        }
+        this.logger.log("Hue slider is being set to " + h);
+
+        this.hueSlider.setValue(h);
+    };
+
+    /**
+     * Moves the picker slider into the position dictated by the current state
+     * of the control
+     * @method _updatePickerSlider
+     * @private
+     */
+    var _updatePickerSlider = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            s = this.get(this.OPT.SATURATION),
+            v = this.get(this.OPT.VALUE);
+
+        s = Math.round(s * size / 100);
+        v = Math.round(size - (v * size / 100));
+
+        this.logger.log("Setting picker slider to " + [s, v]);
+
+        this.pickerSlider.setRegionValue(s, v);
+    };
+
+    /**
+     * Creates the host element if it doesn't exist
+     * @method _createHostElement
+     * @private
+     */
+    var _createHostElement = function() {
+        var el = document.createElement('div');
+
+        if (this.CSS.BASE) {
+            el.className = this.CSS.BASE;
+        }
+        
+        return el;
+    };
+
+
+})();
+YAHOO.register("colorpicker", YAHOO.widget.ColorPicker, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/colorpicker/colorpicker-beta-min.js b/lib/yui/colorpicker/colorpicker-beta-min.js
new file mode 100755 (executable)
index 0000000..e047a19
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
+YAHOO.util.Color=function(){var HCHARS="0123456789ABCDEF",lang=YAHOO.lang;return{real2dec:function(n){return Math.min(255,Math.round(n*256));},hsv2rgb:function(h,s,v){if(lang.isArray(h)){return this.hsv2rgb.call(this,h[0],h[1],h[2]);}
+var r,g,b,i,f,p,q,t;i=Math.floor((h/60)%6);f=(h/60)-i;p=v*(1-s);q=v*(1-f*s);t=v*(1-(1-f)*s);switch(i){case 0:r=v;g=t;b=p;break;case 1:r=q;g=v;b=p;break;case 2:r=p;g=v;b=t;break;case 3:r=p;g=q;b=v;break;case 4:r=t;g=p;b=v;break;case 5:r=v;g=p;b=q;break;}
+var fn=this.real2dec;return[fn(r),fn(g),fn(b)];},rgb2hsv:function(r,g,b){if(lang.isArray(r)){return this.rgb2hsv.call(this,r[0],r[1],r[2]);}
+r=r/255;g=g/255;b=b/255;var min,max,delta,h,s,v;min=Math.min(Math.min(r,g),b);max=Math.max(Math.max(r,g),b);delta=max-min;switch(max){case min:h=0;break;case r:h=60*(g-b)/delta;if(g<b){h+=360;}
+break;case g:h=(60*(b-r)/delta)+120;break;case b:h=(60*(r-g)/delta)+240;break;}
+s=(max===0)?0:1-(min/max);var hsv=[Math.round(h),s,max];return hsv;},rgb2hex:function(r,g,b){if(lang.isArray(r)){return this.rgb2hex.call(this,r[0],r[1],r[2]);}
+var f=this.dec2hex;return f(r)+f(g)+f(b);},dec2hex:function(n){n=parseInt(n,10);n=(lang.isNumber(n))?n:0;n=(n>255||n<0)?0:n;return HCHARS.charAt((n-n%16)/16)+HCHARS.charAt(n%16);},hex2dec:function(str){var f=function(c){return HCHARS.indexOf(c.toUpperCase());};var s=str.split('');return((f(s[0])*16)+f(s[1]));},hex2rgb:function(s){var f=this.hex2dec;return[f(s.substr(0,2)),f(s.substr(2,2)),f(s.substr(4,2))];},websafe:function(r,g,b){if(lang.isArray(r)){return this.websafe.call(this,r[0],r[1],r[2]);}
+var f=function(v){if(lang.isNumber(v)){v=Math.min(Math.max(0,v),255);var i,next;for(i=0;i<256;i=i+51){next=i+51;if(v>=i&&v<=next){return(v-i>25)?next:i;}}}
+return v;};return[f(r),f(g),f(b)];}};}();(function(){var pickercount=0;YAHOO.widget.ColorPicker=function(el,attr){pickercount=pickercount+1;attr=attr||{};if(arguments.length===1&&!YAHOO.lang.isString(el)&&!el.nodeName){attr=el;el=attr.element||null;}
+if(!el&&!attr.element){el=_createHostElement.call(this,attr);}
+YAHOO.widget.ColorPicker.superclass.constructor.call(this,el,attr);};YAHOO.extend(YAHOO.widget.ColorPicker,YAHOO.util.Element);var proto=YAHOO.widget.ColorPicker.prototype,Slider=YAHOO.widget.Slider,Color=YAHOO.util.Color,Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,lang=YAHOO.lang,sub=lang.substitute;var b="yui-picker";proto.ID={R:b+"-r",R_HEX:b+"-rhex",G:b+"-g",G_HEX:b+"-ghex",B:b+"-b",B_HEX:b+"-bhex",H:b+"-h",S:b+"-s",V:b+"-v",PICKER_BG:b+"-bg",PICKER_THUMB:b+"-thumb",HUE_BG:b+"-hue-bg",HUE_THUMB:b+"-hue-thumb",HEX:b+"-hex",SWATCH:b+"-swatch",WEBSAFE_SWATCH:b+"-websafe-swatch",CONTROLS:b+"-controls",RGB_CONTROLS:b+"-rgb-controls",HSV_CONTROLS:b+"-hsv-controls",HEX_CONTROLS:b+"-hex-controls",HEX_SUMMARY:b+"-hex-summary",CONTROLS_LABEL:b+"-controls-label"};proto.TXT={ILLEGAL_HEX:"Illegal hex value entered",SHOW_CONTROLS:"Show color details",HIDE_CONTROLS:"Hide color details",CURRENT_COLOR:"Currently selected color: {rgb}",CLOSEST_WEBSAFE:"Closest websafe color: {rgb}. Click to select.",R:"R",G:"G",B:"B",H:"H",S:"S",V:"V",HEX:"#",DEG:"\u00B0",PERCENT:"%"};proto.IMAGE={PICKER_THUMB:"../../build/colorpicker/assets/picker_thumb.png",HUE_THUMB:"../../build/colorpicker/assets/hue_thumb.png"};proto.DEFAULT={PICKER_SIZE:180};proto.OPT={HUE:"hue",SATURATION:"saturation",VALUE:"value",RED:"red",GREEN:"green",BLUE:"blue",HSV:"hsv",RGB:"rgb",WEBSAFE:"websafe",HEX:"hex",PICKER_SIZE:"pickersize",SHOW_CONTROLS:"showcontrols",SHOW_RGB_CONTROLS:"showrgbcontrols",SHOW_HSV_CONTROLS:"showhsvcontrols",SHOW_HEX_CONTROLS:"showhexcontrols",SHOW_HEX_SUMMARY:"showhexsummary",SHOW_WEBSAFE:"showwebsafe",CONTAINER:"container",IDS:"ids",ELEMENTS:"elements",TXT:"txt",IMAGES:"images",ANIMATE:"animate"};proto.setValue=function(rgb,silent){silent=(silent)||false;this.set(this.OPT.RGB,rgb,silent);_updateSliders.call(this);};proto.hueSlider=null;proto.pickerSlider=null;var _getH=function(){var size=this.get(this.OPT.PICKER_SIZE),h=(size-this.hueSlider.getValue())/size;h=Math.round(h*360);return(h===360)?0:h;};var _getS=function(){return this.pickerSlider.getXValue()/this.get(this.OPT.PICKER_SIZE);};var _getV=function(){var size=this.get(this.OPT.PICKER_SIZE);return(size-this.pickerSlider.getYValue())/size;};var _updateSwatch=function(){var rgb=this.get(this.OPT.RGB),websafe=this.get(this.OPT.WEBSAFE),el=this.getElement(this.ID.SWATCH),color=rgb.join(","),txt=this.get(this.OPT.TXT);Dom.setStyle(el,"background-color","rgb("+color+")");el.title=lang.substitute(txt.CURRENT_COLOR,{"rgb":"#"+this.get(this.OPT.HEX)});el=this.getElement(this.ID.WEBSAFE_SWATCH);color=websafe.join(",");Dom.setStyle(el,"background-color","rgb("+color+")");el.title=lang.substitute(txt.CLOSEST_WEBSAFE,{"rgb":"#"+Color.rgb2hex(websafe)});};var _getValuesFromSliders=function(){var h=_getH.call(this),s=_getS.call(this),v=_getV.call(this);rgb=Color.hsv2rgb(h,s,v);var websafe=Color.websafe(rgb);var hex=Color.rgb2hex(rgb[0],rgb[1],rgb[2]);this.set(this.OPT.RGB,rgb);};var _updateFormFields=function(){this.getElement(this.ID.H).value=this.get(this.OPT.HUE);this.getElement(this.ID.S).value=this.get(this.OPT.SATURATION);this.getElement(this.ID.V).value=this.get(this.OPT.VALUE);this.getElement(this.ID.R).value=this.get(this.OPT.RED);this.getElement(this.ID.R_HEX).innerHTML=Color.dec2hex(this.get(this.OPT.RED));this.getElement(this.ID.G).value=this.get(this.OPT.GREEN);this.getElement(this.ID.G_HEX).innerHTML=Color.dec2hex(this.get(this.OPT.GREEN));this.getElement(this.ID.B).value=this.get(this.OPT.BLUE);this.getElement(this.ID.B_HEX).innerHTML=Color.dec2hex(this.get(this.OPT.BLUE));this.getElement(this.ID.HEX).value=this.get(this.OPT.HEX);};var _onHueSliderChange=function(newOffset){var h=_getH.call(this);this.set(this.OPT.HUE,h,true);var rgb=Color.hsv2rgb(h,1,1);var styleDef="rgb("+rgb.join(",")+")";Dom.setStyle(this.getElement(this.ID.PICKER_BG),"background-color",styleDef);if(this.hueSlider.valueChangeSource===this.hueSlider.SOURCE_UI_EVENT){_getValuesFromSliders.call(this);}
+_updateFormFields.call(this);_updateSwatch.call(this);};var _onPickerSliderChange=function(newOffset){var s=_getS.call(this),v=_getV.call(this);this.set(this.OPT.SATURATION,Math.round(s*100),true);this.set(this.OPT.VALUE,Math.round(v*100),true);if(this.pickerSlider.valueChangeSource===this.pickerSlider.SOURCE_UI_EVENT){_getValuesFromSliders.call(this);}
+_updateFormFields.call(this);_updateSwatch.call(this);};var _getCommand=function(e){var c=Event.getCharCode(e);if(c===38){return 3;}else if(c===13){return 6;}else if(c===40){return 4;}else if(c>=48&&c<=57){return 1;}else if(c>=97&&c<=102){return 2;}else if(c>=65&&c<=70){return 2;}else if("8, 9, 13, 27, 37, 39".indexOf(c)>-1){return 5;}else{return 0;}};var _rgbFieldKeypress=function(e,el,prop){var command=_getCommand(e);var inc=(e.shiftKey)?10:1;switch(command){case 6:_useFieldValue.apply(this,arguments);break;case 3:this.set(prop,Math.min(this.get(prop)+inc,255));_updateFormFields.call(this);break;case 4:this.set(prop,Math.max(this.get(prop)-inc,0));_updateFormFields.call(this);break;default:}};var _hexFieldKeypress=function(e,el,prop){var command=_getCommand(e);if(command===6){_useFieldValue.apply(this,arguments);}};var _useFieldValue=function(e,el,prop){var val=el.value;if(prop!==this.OPT.HEX){val=parseInt(val,10);}
+if(val!==this.get(prop)){this.set(prop,val);}};var _numbersOnly=function(e){return _hexOnly(e,true);};var _hexOnly=function(e,numbersOnly){var command=_getCommand(e);switch(command){case 6:case 5:case 1:break;case 2:if(numbersOnly!==true){break;}
+default:Event.stopEvent(e);return false;}};proto.getElement=function(id){return this.get(this.OPT.ELEMENTS)[this.get(this.OPT.IDS)[id]];};_createElements=function(){var el,child,img,fld,i,ids=this.get(this.OPT.IDS),txt=this.get(this.OPT.TXT),images=this.get(this.OPT.IMAGES),Elem=function(type,o){var n=document.createElement(type);if(o){lang.augmentObject(n,o,true);}
+return n;},RGBElem=function(type,obj){var o=lang.merge({autocomplete:"off",value:"0",size:3,maxlength:3},obj);o.name=o.id;return new Elem(type,o);};var p=this.get("element");el=new Elem("div",{id:ids[this.ID.PICKER_BG],className:"yui-picker-bg",tabIndex:-1,hideFocus:true});child=new Elem("div",{id:ids[this.ID.PICKER_THUMB],className:"yui-picker-thumb"});img=new Elem("img",{src:images.PICKER_THUMB});child.appendChild(img);el.appendChild(child);p.appendChild(el);el=new Elem("div",{id:ids[this.ID.HUE_BG],className:"yui-picker-hue-bg",tabIndex:-1,hideFocus:true});child=new Elem("div",{id:ids[this.ID.HUE_THUMB],className:"yui-picker-hue-thumb"});img=new Elem("img",{src:images.HUE_THUMB});child.appendChild(img);el.appendChild(child);p.appendChild(el);el=new Elem("div",{id:ids[this.ID.CONTROLS],className:"yui-picker-controls"});p.appendChild(el);p=el;el=new Elem("div",{className:"hd"});child=new Elem("a",{id:ids[this.ID.CONTROLS_LABEL],href:"#"});el.appendChild(child);p.appendChild(el);el=new Elem("div",{className:"bd"});p.appendChild(el);p=el;el=new Elem("ul",{id:ids[this.ID.RGB_CONTROLS],className:"yui-picker-rgb-controls"});child=new Elem("li");child.appendChild(document.createTextNode(txt.R+" "));fld=new RGBElem("input",{id:ids[this.ID.R],className:"yui-picker-r"});child.appendChild(fld);el.appendChild(child);child=new Elem("li");child.appendChild(document.createTextNode(txt.G+" "));fld=new RGBElem("input",{id:ids[this.ID.G],className:"yui-picker-g"});child.appendChild(fld);el.appendChild(child);child=new Elem("li");child.appendChild(document.createTextNode(txt.B+" "));fld=new RGBElem("input",{id:ids[this.ID.B],className:"yui-picker-b"});child.appendChild(fld);el.appendChild(child);p.appendChild(el);el=new Elem("ul",{id:ids[this.ID.HSV_CONTROLS],className:"yui-picker-hsv-controls"});child=new Elem("li");child.appendChild(document.createTextNode(txt.H+" "));fld=new RGBElem("input",{id:ids[this.ID.H],className:"yui-picker-h"});child.appendChild(fld);child.appendChild(document.createTextNode(" "+txt.DEG));el.appendChild(child);child=new Elem("li");child.appendChild(document.createTextNode(txt.S+" "));fld=new RGBElem("input",{id:ids[this.ID.S],className:"yui-picker-s"});child.appendChild(fld);child.appendChild(document.createTextNode(" "+txt.PERCENT));el.appendChild(child);child=new Elem("li");child.appendChild(document.createTextNode(txt.V+" "));fld=new RGBElem("input",{id:ids[this.ID.V],className:"yui-picker-v"});child.appendChild(fld);child.appendChild(document.createTextNode(" "+txt.PERCENT));el.appendChild(child);p.appendChild(el);el=new Elem("ul",{id:ids[this.ID.HEX_SUMMARY],className:"yui-picker-hex_summary"});child=new Elem("li",{id:ids[this.ID.R_HEX]});el.appendChild(child);child=new Elem("li",{id:ids[this.ID.G_HEX]});el.appendChild(child);child=new Elem("li",{id:ids[this.ID.B_HEX]});el.appendChild(child);p.appendChild(el);el=new Elem("div",{id:ids[this.ID.HEX_CONTROLS],className:"yui-picker-hex-controls"});el.appendChild(document.createTextNode(txt.HEX+" "));child=new RGBElem("input",{id:ids[this.ID.HEX],className:"yui-picker-hex",size:6,maxlength:6});el.appendChild(child);p.appendChild(el);p=this.get("element");el=new Elem("div",{id:ids[this.ID.SWATCH],className:"yui-picker-swatch"});p.appendChild(el);el=new Elem("div",{id:ids[this.ID.WEBSAFE_SWATCH],className:"yui-picker-websafe-swatch"});p.appendChild(el);};proto.initPicker=function(){var o=this.OPT,ids=this.get(o.IDS),els=this.get(o.ELEMENTS),i,el,id;for(i in this.ID){if(lang.hasOwnProperty(this.ID,i)){ids[this.ID[i]]=ids[i];}}
+el=Dom.get(ids[this.ID.PICKER_BG]);if(!el){_createElements.call(this);}else{}
+for(i in ids){if(lang.hasOwnProperty(ids,i)){el=Dom.get(ids[i]);id=Dom.generateId(el);ids[i]=id;ids[ids[i]]=id;els[id]=el;}}
+els=[o.SHOW_CONTROLS,o.SHOW_RGB_CONTROLS,o.SHOW_HSV_CONTROLS,o.SHOW_HEX_CONTROLS,o.SHOW_HEX_SUMMARY,o.SHOW_WEBSAFE];for(i=0;i<els.length;i=i+1){this.set(els[i],this.get(els[i]));}
+var s=this.get(o.PICKER_SIZE);this.hueSlider=Slider.getVertSlider(this.getElement(this.ID.HUE_BG),this.getElement(this.ID.HUE_THUMB),0,s);this.hueSlider.subscribe("change",_onHueSliderChange,this,true);this.pickerSlider=Slider.getSliderRegion(this.getElement(this.ID.PICKER_BG),this.getElement(this.ID.PICKER_THUMB),0,s,0,s);this.pickerSlider.subscribe("change",_onPickerSliderChange,this,true);Event.on(this.getElement(this.ID.WEBSAFE_SWATCH),"click",function(e){this.setValue(this.get(o.WEBSAFE));},this,true);Event.on(this.getElement(this.ID.CONTROLS_LABEL),"click",function(e){this.set(o.SHOW_CONTROLS,!this.get(o.SHOW_CONTROLS));Event.preventDefault(e);},this,true);_attachRGBHSV.call(this,this.ID.R,this.OPT.RED);_attachRGBHSV.call(this,this.ID.G,this.OPT.GREEN);_attachRGBHSV.call(this,this.ID.B,this.OPT.BLUE);_attachRGBHSV.call(this,this.ID.H,this.OPT.HUE);_attachRGBHSV.call(this,this.ID.S,this.OPT.SATURATION);_attachRGBHSV.call(this,this.ID.V,this.OPT.VALUE);Event.on(this.getElement(this.ID.HEX),"keydown",function(e,me){_hexFieldKeypress.call(me,e,this,me.OPT.HEX);},this);Event.on(this.getElement(this.ID.HEX),"keypress",_hexOnly,this);Event.on(this.getElement(this.ID.HEX),"blur",function(e,me){_useFieldValue.call(me,e,this,me.OPT.HEX);},this);};_attachRGBHSV=function(id,config){Event.on(this.getElement(id),"keydown",function(e,me){_rgbFieldKeypress.call(me,e,this,config);},this);Event.on(this.getElement(id),"keypress",_numbersOnly,this);Event.on(this.getElement(id),"blur",function(e,me){_useFieldValue.call(me,e,this,config);},this);};proto.initAttributes=function(attr){attr=attr||{};YAHOO.widget.ColorPicker.superclass.initAttributes.call(this,attr);this.setAttributeConfig(this.OPT.PICKER_SIZE,{value:attr.size||this.DEFAULT.PICKER_SIZE});this.setAttributeConfig(this.OPT.HUE,{value:attr.hue||0,validator:lang.isNumber});this.setAttributeConfig(this.OPT.SATURATION,{value:attr.saturation||0,validator:lang.isNumber});this.setAttributeConfig(this.OPT.VALUE,{value:attr.value||100,validator:lang.isNumber});this.setAttributeConfig(this.OPT.RED,{value:attr.red||255,validator:lang.isNumber});this.setAttributeConfig(this.OPT.GREEN,{value:attr.red||255,validator:lang.isNumber});this.setAttributeConfig(this.OPT.BLUE,{value:attr.blue||255,validator:lang.isNumber});this.setAttributeConfig(this.OPT.HEX,{value:attr.hex||"FFFFFF",validator:lang.isString});this.setAttributeConfig(this.OPT.RGB,{value:attr.rgb||[255,255,255],method:function(rgb){this.set(this.OPT.RED,rgb[0],true);this.set(this.OPT.GREEN,rgb[1],true);this.set(this.OPT.BLUE,rgb[2],true);var websafe=Color.websafe(rgb);this.set(this.OPT.WEBSAFE,websafe,true);var hex=Color.rgb2hex(rgb);this.set(this.OPT.HEX,hex,true);var hsv=Color.rgb2hsv(rgb);this.set(this.OPT.HUE,hsv[0],true);this.set(this.OPT.SATURATION,Math.round(hsv[1]*100),true);this.set(this.OPT.VALUE,Math.round(hsv[2]*100),true);},readonly:true});this.setAttributeConfig(this.OPT.CONTAINER,{value:null,method:function(container){if(container){container.showEvent.subscribe(function(){this.pickerSlider.focus();},this,true);}}});this.setAttributeConfig(this.OPT.WEBSAFE,{value:attr.websafe||[255,255,255]});ids=attr.ids||lang.merge({},this.ID);if(!attr.ids&&pickercount>1){for(var i in ids){if(lang.hasOwnProperty(ids,i)){ids[i]=ids[i]+pickercount;}}}
+this.setAttributeConfig(this.OPT.IDS,{value:ids,writeonce:true});this.setAttributeConfig(this.OPT.TXT,{value:attr.txt||this.TXT,writeonce:true});this.setAttributeConfig(this.OPT.IMAGES,{value:attr.images||this.IMAGE,writeonce:true});this.setAttributeConfig(this.OPT.ELEMENTS,{value:{},readonly:true});_hideShowEl=function(id,on){var el=(lang.isString(id)?this.getElement(id):id);Dom.setStyle(el,"display",(on)?"":"none");};this.setAttributeConfig(this.OPT.SHOW_CONTROLS,{value:(attr.showcontrols)||true,method:function(on){var el=Dom.getElementsByClassName("bd","div",this.getElement(this.ID.CONTROLS))[0];_hideShowEl.call(this,el,on);this.getElement(this.ID.CONTROLS_LABEL).innerHTML=(on)?this.get(this.OPT.TXT).HIDE_CONTROLS:this.get(this.OPT.TXT).SHOW_CONTROLS;}});this.setAttributeConfig(this.OPT.SHOW_RGB_CONTROLS,{value:(attr.showrgbcontrols)||true,method:function(on){_hideShowEl.call(this,this.ID.RGB_CONTROLS,on);}});this.setAttributeConfig(this.OPT.SHOW_HSV_CONTROLS,{value:(attr.showhsvcontrols)||false,method:function(on){_hideShowEl.call(this,this.ID.HSV_CONTROLS,on);if(on&&this.get(this.OPT.SHOW_HEX_SUMMARY)){this.set(this.OPT.SHOW_HEX_SUMMARY,false);}}});this.setAttributeConfig(this.OPT.SHOW_HEX_CONTROLS,{value:(attr.showhexcontrols)||false,method:function(on){_hideShowEl.call(this,this.ID.HEX_CONTROLS,on);}});this.setAttributeConfig(this.OPT.SHOW_WEBSAFE,{value:(attr.showwebsafe)||true,method:function(on){_hideShowEl.call(this,this.ID.WEBSAFE_SWATCH,on);}});this.setAttributeConfig(this.OPT.SHOW_HEX_SUMMARY,{value:(attr.showhexsummary)||true,method:function(on){_hideShowEl.call(this,this.ID.HEX_SUMMARY,on);if(on&&this.get(this.OPT.SHOW_HSV_CONTROLS)){this.set(this.OPT.SHOW_HSV_CONTROLS,false);}}});this.setAttributeConfig(this.OPT.ANIMATE,{value:(attr.animate)||true,method:function(on){this.pickerSlider.animate=on;this.hueSlider.animate=on;}});this.on(this.OPT.HUE+"Change",_updateRGBFromHSV,this,true);this.on(this.OPT.SATURATION+"Change",_updateRGBFromHSV,this,true);this.on(this.OPT.VALUE+"Change",_updatePickerSlider,this,true);this.on(this.OPT.RED+"Change",_updateRGB,this,true);this.on(this.OPT.GREEN+"Change",_updateRGB,this,true);this.on(this.OPT.BLUE+"Change",_updateRGB,this,true);this.on(this.OPT.HEX+"Change",_updateHex,this,true);this.initPicker();};var _updateRGB=function(){var rgb=[this.get(this.OPT.RED),this.get(this.OPT.GREEN),this.get(this.OPT.BLUE)];this.set(this.OPT.RGB,rgb);_updateSliders.call(this);};var _updateRGBFromHSV=function(){var hsv=[this.get(this.OPT.HUE),this.get(this.OPT.SATURATION)/100,this.get(this.OPT.VALUE)/100];var rgb=Color.hsv2rgb(hsv);this.set(this.OPT.RGB,rgb);_updateSliders.call(this);};var _updateHex=function(){var hex=this.get(this.OPT.HEX),l=hex.length;if(l===3){var c=hex.split(""),i;for(i=0;i<l;i=i+1){c[i]=c[i]+c[i];}
+hex=c.join("");}
+if(hex.length!==6){return false;}
+var rgb=Color.hex2rgb(hex);this.setValue(rgb);};var _updateSliders=function(){_updateHueSlider.call(this);_updatePickerSlider.call(this);};var _updateHueSlider=function(){var size=this.get(this.OPT.PICKER_SIZE),h=this.get(this.OPT.HUE);h=size-Math.round(h/360*size);if(h===size){h=0;}
+this.hueSlider.setValue(h);};var _updatePickerSlider=function(){var size=this.get(this.OPT.PICKER_SIZE),s=this.get(this.OPT.SATURATION),v=this.get(this.OPT.VALUE);s=Math.round(s*size/100);v=Math.round(size-(v*size/100));this.pickerSlider.setRegionValue(s,v);};var _createHostElement=function(){var el=document.createElement('div');if(this.CSS.BASE){el.className=this.CSS.BASE;}
+return el;};})();YAHOO.register("colorpicker",YAHOO.widget.ColorPicker,{version:"2.3.0",build:"442"});
\ No newline at end of file
diff --git a/lib/yui/colorpicker/colorpicker-beta.js b/lib/yui/colorpicker/colorpicker-beta.js
new file mode 100755 (executable)
index 0000000..56d40f5
--- /dev/null
@@ -0,0 +1,1725 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * Provides color conversion and validation utils
+ * @class YAHOO.util.Color
+ * @namespace YAHOO.util
+ */
+YAHOO.util.Color = function() {
+
+    var HCHARS="0123456789ABCDEF", lang=YAHOO.lang;
+
+    return {
+
+        /**
+         * Converts 0-1 to 0-255
+         * @method real2dec
+         * @param n {float} the number to convert
+         * @return {int} a number 0-255
+         */
+        real2dec: function(n) {
+            return Math.min(255, Math.round(n*256));
+        },
+
+        /**
+         * Converts HSV (h[0-360], s[0-1]), v[0-1] to RGB [255,255,255]
+         * @method hsv2rgb
+         * @param h {int|[int, float, float]} the hue, or an
+         *        array containing all three parameters
+         * @param s {float} the saturation
+         * @param v {float} the value/brightness
+         * @return {[int, int, int]} the red, green, blue values in
+         *          decimal.
+         */
+        hsv2rgb: function(h, s, v) { 
+
+            if (lang.isArray(h)) {
+                return this.hsv2rgb.call(this, h[0], h[1], h[2]);
+            }
+
+            var r, g, b, i, f, p, q, t;
+            i = Math.floor((h/60)%6);
+            f = (h/60)-i;
+            p = v*(1-s);
+            q = v*(1-f*s);
+            t = v*(1-(1-f)*s);
+            switch(i) {
+                case 0: r=v; g=t; b=p; break;
+                case 1: r=q; g=v; b=p; break;
+                case 2: r=p; g=v; b=t; break;
+                case 3: r=p; g=q; b=v; break;
+                case 4: r=t; g=p; b=v; break;
+                case 5: r=v; g=p; b=q; break;
+            }
+
+            var fn=this.real2dec;
+
+            return [fn(r), fn(g), fn(b)];
+        },
+
+        /**
+         * Converts to RGB [255,255,255] to HSV (h[0-360], s[0-1]), v[0-1]
+         * @method rgb2hsv
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {[int, float, float]} the value converted to hsv
+         */
+        rgb2hsv: function(r, g, b) {
+
+            if (lang.isArray(r)) {
+                return this.rgb2hsv.call(this, r[0], r[1], r[2]);
+            }
+
+            r=r/255;
+            g=g/255;
+            b=b/255;
+
+            var min,max,delta,h,s,v;
+            min = Math.min(Math.min(r,g),b);
+            max = Math.max(Math.max(r,g),b);
+            delta = max-min;
+
+            switch (max) {
+                case min: h=0; break;
+                case r:   h=60*(g-b)/delta; 
+                          if (g<b) {
+                              h+=360;
+                          }
+                          break;
+                case g:   h=(60*(b-r)/delta)+120; break;
+                case b:   h=(60*(r-g)/delta)+240; break;
+            }
+            
+            s = (max === 0) ? 0 : 1-(min/max);
+
+            var hsv = [Math.round(h), s, max];
+
+            return hsv;
+
+        },
+
+        /**
+         * Converts decimal rgb values into a hex string
+         * 255,255,255 -> FFFFFF
+         * @method rgb2hex
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {string} the hex string
+         */
+        rgb2hex: function(r, g, b) {
+            if (lang.isArray(r)) {
+                return this.rgb2hex.call(this, r[0], r[1], r[2]);
+            }
+
+            var f=this.dec2hex;
+            return f(r) + f(g) + f(b);
+        },
+     
+        /**
+         * Converts an int 0...255 to hex pair 00...FF
+         * @method dec2hex
+         * @param n {int} the number to convert
+         * @return {string} the hex equivalent
+         */
+        dec2hex: function(n) {
+            n = parseInt(n, 10);
+            n = (lang.isNumber(n)) ? n : 0;
+            n = (n > 255 || n < 0) ? 0 : n;
+
+            return HCHARS.charAt((n - n % 16) / 16) + HCHARS.charAt(n % 16);
+        },
+
+        /**
+         * Converts a hex pair 00...FF to an int 0...255 
+         * @method hex2dec
+         * @param str {string} the hex pair to convert
+         * @return {int} the decimal
+         */
+        hex2dec: function(str) {
+            var f = function(c) {
+                return HCHARS.indexOf(c.toUpperCase());
+            };
+
+            var s=str.split('');
+            
+            return ((f(s[0]) * 16) + f(s[1]));
+        },
+
+        /**
+         * Converts a hex string to rgb
+         * @method hex2rgb
+         * @param str {string} the hex string
+         * @return {[int, int, int]} an array containing the rgb values
+         */
+        hex2rgb: function(s) { 
+            var f = this.hex2dec;
+            return [f(s.substr(0, 2)), f(s.substr(2, 2)), f(s.substr(4, 2))];
+        },
+
+        /**
+         * Returns the closest websafe color to the supplied rgb value.
+         * @method websafe
+         * @param r {int|[int, int, int]} the red value, or an
+         *        array containing all three parameters
+         * @param g {int} the green value
+         * @param b {int} the blue value
+         * @return {[int, int, int]} an array containing the closes
+         *                           websafe rgb colors.
+         */
+        websafe: function(r, g, b) {
+
+            if (lang.isArray(r)) {
+                return this.websafe.call(this, r[0], r[1], r[2]);
+            }
+
+            // returns the closest match [0, 51, 102, 153, 204, 255]
+            var f = function(v) {
+                if (lang.isNumber(v)) {
+                    v = Math.min(Math.max(0, v), 255);
+                    var i, next;
+                    for (i=0; i<256; i=i+51) {
+                        next = i+51;
+                        if (v >= i && v <= next) {
+                            return (v-i > 25) ? next : i;
+                        }
+                    }
+                }
+
+                return v;
+            };
+
+            return [f(r), f(g), f(b)];
+        }
+    };
+}();
+
+
+(function() {
+
+    var pickercount = 0;
+
+    /**
+     * The colorpicker module provides a widget for selecting colors
+     * @module colorpicker
+     * @requires yahoo, dom, event, element, slider
+     */
+
+    /**
+     * A widget to select colors
+     * @namespace YAHOO.widget
+     * @class YAHOO.widget.ColorPicker
+     * @extends YAHOO.util.Element
+     * @constructor
+     * @param {HTMLElement | String | Object} el(optional) The html 
+     * element that represents the colorpicker, or the attribute object to use. 
+     * An element will be created if none provided.
+     * @param {Object} attr (optional) A key map of the colorpicker's 
+     * initial attributes.  Ignored if first arg is attributes object.
+     */
+    YAHOO.widget.ColorPicker = function(el, attr) {
+        pickercount = pickercount + 1;
+        attr = attr || {};
+        if (arguments.length === 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
+            attr = el; // treat first arg as attr object
+            el = attr.element || null;
+        }
+        
+        if (!el && !attr.element) { // create if we dont have one
+            el = _createHostElement.call(this, attr);
+        }
+
+       YAHOO.widget.ColorPicker.superclass.constructor.call(this, el, attr); 
+    };
+
+    YAHOO.extend(YAHOO.widget.ColorPicker, YAHOO.util.Element);
+    
+    var proto = YAHOO.widget.ColorPicker.prototype,
+        Slider=YAHOO.widget.Slider,
+        Color=YAHOO.util.Color,
+        Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        lang = YAHOO.lang,
+        sub = lang.substitute;
+    
+
+    var b = "yui-picker";
+
+    /**
+     * The element ids used by this control
+     * @property ID
+     * @final
+     */
+    proto.ID = {
+
+        /**
+         * The id for the "red" form field
+         * @property ID.R
+         * @type String
+         * @final
+         * @default yui-picker-r
+         */
+        R: b + "-r",
+
+        /**
+         * The id for the "red" hex pair output
+         * @property ID.R_HEX
+         * @type String
+         * @final
+         * @default yui-picker-rhex
+         */
+        R_HEX: b + "-rhex",
+
+        /**
+         * The id for the "green" form field
+         * @property ID.G
+         * @type String
+         * @final
+         * @default yui-picker-g
+         */
+        G: b + "-g",
+
+        /**
+         * The id for the "green" hex pair output
+         * @property ID.G_HEX
+         * @type String
+         * @final
+         * @default yui-picker-ghex
+         */
+        G_HEX: b + "-ghex",
+
+
+        /**
+         * The id for the "blue" form field
+         * @property ID.B
+         * @type String
+         * @final
+         * @default yui-picker-b
+         */
+        B: b + "-b",
+
+        /**
+         * The id for the "blue" hex pair output
+         * @property ID.B_HEX
+         * @type String
+         * @final
+         * @default yui-picker-bhex
+         */
+        B_HEX: b + "-bhex",
+
+        /**
+         * The id for the "hue" form field
+         * @property ID.H
+         * @type String
+         * @final
+         * @default yui-picker-h
+         */
+        H: b + "-h",
+
+        /**
+         * The id for the "saturation" form field
+         * @property ID.S
+         * @type String
+         * @final
+         * @default yui-picker-s
+         */
+        S: b + "-s",
+
+        /**
+         * The id for the "value" form field
+         * @property ID.V
+         * @type String
+         * @final
+         * @default yui-picker-v
+         */
+        V: b + "-v",
+
+        /**
+         * The id for the picker region slider
+         * @property ID.PICKER_BG
+         * @type String
+         * @final
+         * @default yui-picker-bg
+         */
+        PICKER_BG:      b + "-bg",
+
+        /**
+         * The id for the picker region thumb
+         * @property ID.PICKER_THUMB
+         * @type String
+         * @final
+         * @default yui-picker-thumb
+         */
+        PICKER_THUMB:   b + "-thumb",
+
+        /**
+         * The id for the hue slider
+         * @property ID.HUE_BG
+         * @type String
+         * @final
+         * @default yui-picker-hue-bg
+         */
+        HUE_BG:         b + "-hue-bg",
+
+        /**
+         * The id for the hue thumb
+         * @property ID.HUE_THUMB
+         * @type String
+         * @final
+         * @default yui-picker-hue-thumb
+         */
+        HUE_THUMB:      b + "-hue-thumb",
+
+        /**
+         * The id for the hex value form field
+         * @property ID.HEX
+         * @type String
+         * @final
+         * @default yui-picker-hex
+         */
+        HEX:            b + "-hex",
+
+        /**
+         * The id for the color swatch
+         * @property ID.SWATCH
+         * @type String
+         * @final
+         * @default yui-picker-swatch
+         */
+        SWATCH:         b + "-swatch",
+
+        /**
+         * The id for the websafe color swatch
+         * @property ID.WEBSAFE_SWATCH
+         * @type String
+         * @final
+         * @default yui-picker-websafe-swatch
+         */
+        WEBSAFE_SWATCH: b + "-websafe-swatch",
+
+        /**
+         * The id for the control details
+         * @property ID.CONTROLS
+         * @final
+         * @default yui-picker-controls
+         */
+        CONTROLS: b + "-controls",
+
+        /**
+         * The id for the rgb controls
+         * @property ID.RGB_CONTROLS
+         * @final
+         * @default yui-picker-rgb-controls
+         */
+        RGB_CONTROLS: b + "-rgb-controls",
+
+        /**
+         * The id for the hsv controls
+         * @property ID.HSV_CONTROLS
+         * @final
+         * @default yui-picker-hsv-controls
+         */
+        HSV_CONTROLS: b + "-hsv-controls",
+        
+        /**
+         * The id for the hsv controls
+         * @property ID.HEX_CONTROLS
+         * @final
+         * @default yui-picker-hex-controls
+         */
+        HEX_CONTROLS: b + "-hex-controls",
+
+        /**
+         * The id for the hex summary
+         * @property ID.HEX_SUMMARY
+         * @final
+         * @default yui-picker-hex-summary
+         */
+        HEX_SUMMARY: b + "-hex-summary",
+
+        /**
+         * The id for the controls section header
+         * @property ID.CONTROLS_LABEL
+         * @final
+         * @default yui-picker-controls-label
+         */
+        CONTROLS_LABEL: b + "-controls-label"
+    };
+
+    /**
+     * Constants for any script-generated messages.  The values here
+     * are the default messages.  They can be updated by providing
+     * the complete list to the constructor for the "txt" attribute.
+     * @property TXT
+     * @final
+     */
+    proto.TXT = {
+        ILLEGAL_HEX: "Illegal hex value entered",
+        SHOW_CONTROLS: "Show color details",
+        HIDE_CONTROLS: "Hide color details",
+        CURRENT_COLOR: "Currently selected color: {rgb}",
+        CLOSEST_WEBSAFE: "Closest websafe color: {rgb}. Click to select.",
+        R: "R",
+        G: "G",
+        B: "B",
+        H: "H",
+        S: "S",
+        V: "V",
+        HEX: "#",
+        DEG: "\u00B0",
+        PERCENT: "%"
+    };
+
+    /**
+     * Constants for the default image locations for img tags that are
+     * generated by the control.  They can be modified by passing the
+     * complete list to the contructor for the "images" attribute
+     * @property IMAGE
+     * @final
+     */
+    proto.IMAGE = {
+        PICKER_THUMB: "../../build/colorpicker/assets/picker_thumb.png",
+        HUE_THUMB: "../../build/colorpicker/assets/hue_thumb.png"
+    };
+
+    /*
+     * Constants for the control's custom event names.  subscribe
+     * to the rgbChange event instead.
+     * @property EVENT
+     * @final
+     */
+    //proto.EVENT = {
+        //CHANGE: "change"
+    //};
+
+    //proto.CSS = { };
+
+    /**
+     * Constants for the control's default default values
+     * @property DEFAULT
+     * @final
+     */
+    proto.DEFAULT = {
+        PICKER_SIZE: 180
+    };
+
+    /**
+     * Constants for the control's configuration attributes
+     * @property OPT
+     * @final
+     */
+    proto.OPT = {
+        HUE: "hue",
+        SATURATION: "saturation",
+        VALUE: "value",
+        RED: "red",
+        GREEN: "green",
+        BLUE: "blue",
+        HSV: "hsv",
+        RGB: "rgb",
+        WEBSAFE: "websafe",
+        HEX: "hex",
+        PICKER_SIZE: "pickersize",
+        SHOW_CONTROLS: "showcontrols",
+        SHOW_RGB_CONTROLS: "showrgbcontrols",
+        SHOW_HSV_CONTROLS: "showhsvcontrols",
+        SHOW_HEX_CONTROLS: "showhexcontrols",
+        SHOW_HEX_SUMMARY: "showhexsummary",
+        SHOW_WEBSAFE: "showwebsafe",
+        //SHOW_SUBMIT: "showsubmit",
+        CONTAINER: "container",
+        IDS: "ids",
+        ELEMENTS: "elements",
+        TXT: "txt",
+        IMAGES: "images",
+        ANIMATE: "animate"
+    };
+
+    /**
+     * Sets the control to the specified rgb value and
+     * moves the sliders to the proper positions
+     * @method setValue
+     * @param rgb {[int, int, int]} the rgb value
+     * @param silent {boolean} whether or not to fire the change event
+     */
+    proto.setValue = function(rgb, silent) {
+        silent = (silent) || false;
+        this.set(this.OPT.RGB, rgb, silent);
+        _updateSliders.call(this);
+    };
+
+    /**
+     * The hue slider
+     * @property hueSlider
+     * @type YAHOO.widget.Slider
+     */
+    proto.hueSlider = null; 
+    
+    /**
+     * The picker region
+     * @property pickerSlider
+     * @type YAHOO.widget.Slider
+     */
+    proto.pickerSlider = null;
+
+    /**
+     * Translates the slider value into hue, int[0,359]
+     * @method _getH
+     * @private
+     * @return {int} the hue from 0 to 359
+     */
+    var _getH = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            h = (size - this.hueSlider.getValue()) / size;
+        h = Math.round(h*360);
+        return (h === 360) ? 0 : h;
+    };
+
+    /**
+     * Translates the slider value into saturation, int[0,1], left to right
+     * @method _getS
+     * @private
+     * @return {int} the saturation from 0 to 1
+     */
+    var _getS = function() {
+        return this.pickerSlider.getXValue() / this.get(this.OPT.PICKER_SIZE);
+    };
+
+    /**
+     * Translates the slider value into value/brightness, int[0,1], top
+     * to bottom
+     * @method _getV
+     * @private
+     * @return {int} the value from 0 to 1
+     */
+    var _getV = function() {
+        var size = this.get(this.OPT.PICKER_SIZE);
+        return (size - this.pickerSlider.getYValue()) / size;
+    };
+
+    /**
+     * Updates the background of the swatch with the current rbg value.
+     * Also updates the websafe swatch to the closest websafe color
+     * @method _updateSwatch
+     * @private
+     */
+    var _updateSwatch = function() {
+        var rgb = this.get(this.OPT.RGB),
+            websafe = this.get(this.OPT.WEBSAFE),
+            el = this.getElement(this.ID.SWATCH),
+            color = rgb.join(","),
+            txt = this.get(this.OPT.TXT);
+
+        Dom.setStyle(el, "background-color", "rgb(" + color  + ")");
+        el.title = lang.substitute(txt.CURRENT_COLOR, {
+                "rgb": "#" + this.get(this.OPT.HEX)
+            });
+
+
+        el = this.getElement(this.ID.WEBSAFE_SWATCH);
+        color = websafe.join(",");
+
+        Dom.setStyle(el, "background-color", "rgb(" + color + ")");
+        el.title = lang.substitute(txt.CLOSEST_WEBSAFE, {
+                "rgb": "#" + Color.rgb2hex(websafe)
+            });
+
+    };
+
+    /**
+     * Reads the sliders and converts the values to RGB, updating the
+     * internal state for all the individual form fields
+     * @method _getValuesFromSliders
+     * @private
+     */
+    var _getValuesFromSliders = function() {
+        var h=_getH.call(this), s=_getS.call(this), v=_getV.call(this);
+
+        rgb = Color.hsv2rgb(h, s, v);
+        var websafe = Color.websafe(rgb);
+        var hex = Color.rgb2hex(rgb[0], rgb[1], rgb[2]);
+
+        this.set(this.OPT.RGB, rgb);
+    };
+
+    /**
+     * Updates the form field controls with the state data contained
+     * in the control.
+     * @method _updateFormFields
+     * @private
+     */
+    var _updateFormFields = function() {
+        this.getElement(this.ID.H).value = this.get(this.OPT.HUE);
+        this.getElement(this.ID.S).value = this.get(this.OPT.SATURATION);
+        this.getElement(this.ID.V).value = this.get(this.OPT.VALUE);
+        this.getElement(this.ID.R).value = this.get(this.OPT.RED);
+        this.getElement(this.ID.R_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.RED));
+        this.getElement(this.ID.G).value = this.get(this.OPT.GREEN);
+        this.getElement(this.ID.G_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.GREEN));
+        this.getElement(this.ID.B).value = this.get(this.OPT.BLUE);
+        this.getElement(this.ID.B_HEX).innerHTML = Color.dec2hex(this.get(this.OPT.BLUE));
+        this.getElement(this.ID.HEX).value = this.get(this.OPT.HEX);
+    };
+
+    /**
+     * Event handler for the hue slider.
+     * @method _onHueSliderChange
+     * @param newOffset {int} pixels from the start position
+     * @private
+     */
+    var _onHueSliderChange = function(newOffset) {
+
+        var h = _getH.call(this);
+        this.set(this.OPT.HUE, h, true);
+
+        // set picker background to the hue
+        var rgb = Color.hsv2rgb(h, 1, 1);
+        var styleDef = "rgb(" + rgb.join(",") + ")";
+
+        Dom.setStyle(this.getElement(this.ID.PICKER_BG), "background-color", styleDef);
+
+        if (this.hueSlider.valueChangeSource === this.hueSlider.SOURCE_UI_EVENT) {
+            _getValuesFromSliders.call(this);
+        }
+
+        _updateFormFields.call(this);
+        _updateSwatch.call(this);
+    };
+
+    /**
+     * Event handler for the picker slider, which controls the
+     * saturation and value/brightness.
+     * @method _onPickerSliderChange
+     * @param newOffset {{x: int, y: int}} x/y pixels from the start position
+     * @private
+     */
+    var _onPickerSliderChange = function(newOffset) {
+
+        var s=_getS.call(this), v=_getV.call(this);
+        this.set(this.OPT.SATURATION, Math.round(s*100), true);
+        this.set(this.OPT.VALUE, Math.round(v*100), true);
+
+        if (this.pickerSlider.valueChangeSource === this.pickerSlider.SOURCE_UI_EVENT) {
+            _getValuesFromSliders.call(this);
+        }
+
+        _updateFormFields.call(this);
+        _updateSwatch.call(this);
+    };
+
+
+    /**
+     * Key map to well-known commands for txt field input
+     * @method _getCommand
+     * @param e {Event} the keypress or keydown event
+     * @return {int} a command code
+     * <ul>
+     * <li>0 = not a number, letter in range, or special key</li>
+     * <li>1 = number</li>
+     * <li>2 = a-fA-F</li>
+     * <li>3 = increment (up arrow)</li>
+     * <li>4 = decrement (down arrow)</li>
+     * <li>5 = special key (tab, delete, return, escape, left, right)</li> 
+     * <li>6 = return</li>
+     * </ul>
+     * @private
+     */
+    var _getCommand = function(e) {
+        var c = Event.getCharCode(e);
+
+        //alert(Event.getCharCode(e) + ", " + e.keyCode + ", " + e.charCode);
+
+        // special keys
+        if (c === 38) { // up arrow
+            return 3;
+        } else if (c === 13) { // return
+            return 6;
+        } else if (c === 40) { // down array
+            return 4;
+        } else if (c >= 48 && c<=57) { // 0-9
+            return 1;
+        } else if (c >= 97 && c<=102) { // a-f
+            return 2;
+        } else if (c >= 65 && c<=70) { // A-F
+            return 2;
+        //} else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1 || 
+        //              (c >= 112 && c <=123)) { // including F-keys
+        // tab, delete, return, escape, left, right
+        } else if ("8, 9, 13, 27, 37, 39".indexOf(c) > -1) { // special chars
+            return 5;
+        } else { // something we probably don't want
+            return 0;
+        }
+    };
+
+    /**
+     * Handle keypress on one of the rgb or hsv fields.
+     * @method _rgbFieldKeypress
+     * @param e {Event} the keypress event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _rgbFieldKeypress = function(e, el, prop) {
+        var command = _getCommand(e);
+        var inc = (e.shiftKey) ? 10 : 1;
+        switch (command) {
+            case 6: // return, update the value
+                _useFieldValue.apply(this, arguments);
+                break;
+                        
+            case 3: // up arrow, increment
+                this.set(prop, Math.min(this.get(prop)+inc, 255));
+                _updateFormFields.call(this);
+                //Event.stopEvent(e);
+                break;
+            case 4: // down arrow, decrement
+                this.set(prop, Math.max(this.get(prop)-inc, 0));
+                _updateFormFields.call(this);
+                //Event.stopEvent(e);
+                break;
+
+            default:
+        }
+
+    };
+
+    /**
+     * Handle keydown on the hex field
+     * @method _hexFieldKeypress
+     * @param e {Event} the keypress event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _hexFieldKeypress = function(e, el, prop) {
+        var command = _getCommand(e);
+        if (command === 6) { // return, update the value
+            _useFieldValue.apply(this, arguments);
+        }
+    };
+
+    /**
+     * Use the value of the text field to update the control
+     * @method _hexFieldKeypress
+     * @param e {Event} an event
+     * @param el {HTMLElement} the field
+     * @param prop {string} the key to the linked property
+     * @private
+     */
+    var _useFieldValue = function(e, el, prop) {
+        var val = el.value;
+
+        if (prop !== this.OPT.HEX) {
+            val = parseInt(val, 10);
+        }
+
+        if (val !== this.get(prop)) {
+            this.set(prop, val);
+        }
+    };
+
+    /** 
+     * Allows numbers and special chars only.  Used for the
+     * rgb and hsv fields keypress handler.
+     * @method _numbersOnly
+     * @param e {Event} the event
+     * @private
+     * @return {boolean} false if we are canceling the event
+     */
+    var _numbersOnly = function(e) {
+        return _hexOnly(e, true);
+    };
+
+    /** 
+     * Allows numbers and special chars, and by default allows a-f.  
+     * Used for the hex field keypress handler.
+     * @method _hexOnly
+     * @param e {Event} the event
+     * @param numbersOnly omits a-f if set to true
+     * @private
+     * @return {boolean} false if we are canceling the event
+     */
+    var _hexOnly = function(e, numbersOnly) {
+        var command = _getCommand(e);
+        switch (command) {
+            case 6: // return
+            case 5: // special char
+            case 1: // number
+                break;
+            case 2: // hex char (a-f)
+                if (numbersOnly !== true) {
+                    break;
+                }
+
+                // fallthrough is intentional
+
+            default: // prevent alpha and punctuation
+                Event.stopEvent(e);
+                return false;
+        }
+    };
+
+    /**
+     * Returns the element reference that is saved.  The id can be either
+     * the element id, or the key for this id in the "id" config attribute.
+     * For instance, the host element id can be obtained by passing its
+     * id (default: "yui_picker") or by its key "YUI_PICKER".
+     * @param id {string} the element id, or key 
+     * @return {HTMLElement} a reference to the element
+     */
+    proto.getElement = function(id) { 
+        return this.get(this.OPT.ELEMENTS)[this.get(this.OPT.IDS)[id]]; 
+    };
+
+    _createElements = function() {
+        var el, child, img, fld, i, 
+            ids = this.get(this.OPT.IDS),
+            txt = this.get(this.OPT.TXT),
+            images = this.get(this.OPT.IMAGES),
+            Elem = function(type, o) {
+                var n = document.createElement(type);
+                if (o) {
+                    lang.augmentObject(n, o, true);
+                }
+                return n;
+            },
+            RGBElem = function(type, obj) {
+                var o = lang.merge({
+                        //type: "txt",
+                        autocomplete: "off",
+                        value: "0",
+                        size: 3,
+                        maxlength: 3
+                    }, obj);
+
+                o.name = o.id;
+                return new Elem(type, o);
+            };
+
+        var p = this.get("element");
+
+        // Picker slider (S and V) ---------------------------------------------
+
+        el = new Elem("div", {
+            id: ids[this.ID.PICKER_BG],
+            className: "yui-picker-bg",
+            tabIndex: -1,
+            hideFocus: true
+        });
+
+        child = new Elem("div", {
+            id: ids[this.ID.PICKER_THUMB],
+            className: "yui-picker-thumb"
+        });
+
+        img = new Elem("img", {
+            src: images.PICKER_THUMB
+        });
+
+        child.appendChild(img);
+        el.appendChild(child);
+        p.appendChild(el);
+        
+        // Hue slider ---------------------------------------------
+        el = new Elem("div", {
+            id: ids[this.ID.HUE_BG],
+            className: "yui-picker-hue-bg",
+            tabIndex: -1,
+            hideFocus: true
+        });
+
+        child = new Elem("div", {
+            id: ids[this.ID.HUE_THUMB],
+            className: "yui-picker-hue-thumb"
+        });
+
+        img = new Elem("img", {
+            src: images.HUE_THUMB
+        });
+
+        child.appendChild(img);
+        el.appendChild(child);
+        p.appendChild(el);
+
+
+        // controls ---------------------------------------------
+
+        el = new Elem("div", {
+            id: ids[this.ID.CONTROLS],
+            className: "yui-picker-controls"
+        });
+
+        p.appendChild(el);
+        p = el;
+
+            // controls header
+            el = new Elem("div", {
+                className: "hd"
+            });
+
+            child = new Elem("a", {
+                id: ids[this.ID.CONTROLS_LABEL],
+                //className: "yui-picker-controls-label",
+                href: "#"
+            });
+            el.appendChild(child);
+            p.appendChild(el);
+
+            // bd
+            el = new Elem("div", {
+                className: "bd"
+            });
+
+            p.appendChild(el);
+            p = el;
+
+                // rgb
+                el = new Elem("ul", {
+                    id: ids[this.ID.RGB_CONTROLS],
+                    className: "yui-picker-rgb-controls"
+                });
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.R + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.R],
+                    className: "yui-picker-r"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.G + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.G],
+                    className: "yui-picker-g"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.B + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.B],
+                    className: "yui-picker-b"
+                });
+
+                child.appendChild(fld);
+                el.appendChild(child);
+
+                p.appendChild(el);
+
+                // hsv
+                el = new Elem("ul", {
+                    id: ids[this.ID.HSV_CONTROLS],
+                    className: "yui-picker-hsv-controls"
+                });
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.H + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.H],
+                    className: "yui-picker-h"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.DEG));
+
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.S + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.S],
+                    className: "yui-picker-s"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.PERCENT));
+
+                el.appendChild(child);
+
+                child = new Elem("li");
+                child.appendChild(document.createTextNode(txt.V + " "));
+
+                fld = new RGBElem("input", {
+                    id: ids[this.ID.V],
+                    className: "yui-picker-v"
+                });
+
+                child.appendChild(fld);
+                child.appendChild(document.createTextNode(" " + txt.PERCENT));
+
+                el.appendChild(child);
+                p.appendChild(el);
+
+
+                // hex summary
+
+                el = new Elem("ul", {
+                    id: ids[this.ID.HEX_SUMMARY],
+                    className: "yui-picker-hex_summary"
+                });
+
+                child = new Elem("li", {
+                    id: ids[this.ID.R_HEX]
+                });
+                el.appendChild(child);
+
+                child = new Elem("li", {
+                    id: ids[this.ID.G_HEX]
+                });
+                el.appendChild(child);
+
+                child = new Elem("li", {
+                    id: ids[this.ID.B_HEX]
+                });
+                el.appendChild(child);
+                p.appendChild(el);
+
+                // hex field
+                el = new Elem("div", {
+                    id: ids[this.ID.HEX_CONTROLS],
+                    className: "yui-picker-hex-controls"
+                });
+                el.appendChild(document.createTextNode(txt.HEX + " "));
+
+                child = new RGBElem("input", {
+                    id: ids[this.ID.HEX],
+                    className: "yui-picker-hex",
+                    size: 6,
+                    maxlength: 6
+                });
+
+                el.appendChild(child);
+                p.appendChild(el);
+
+                p = this.get("element");
+
+                // swatch
+                el = new Elem("div", {
+                    id: ids[this.ID.SWATCH],
+                    className: "yui-picker-swatch"
+                });
+
+                p.appendChild(el);
+
+                // websafe swatch
+                el = new Elem("div", {
+                    id: ids[this.ID.WEBSAFE_SWATCH],
+                    className: "yui-picker-websafe-swatch"
+                });
+
+                p.appendChild(el);
+
+    };
+
+    /**
+     * Sets the initial state of the sliders
+     * @method initPicker
+     */
+    proto.initPicker = function () {
+
+        // bind all of our elements
+        var o=this.OPT, 
+            ids = this.get(o.IDS), 
+            els = this.get(o.ELEMENTS), 
+                  i, el, id;
+
+        // Add the default value as a key for each element for easier lookup
+        for (i in this.ID) {
+            if (lang.hasOwnProperty(this.ID, i)) {
+                ids[this.ID[i]] = ids[i];
+            }
+        }
+
+        // Check for picker element, if not there, create all of them
+        el = Dom.get(ids[this.ID.PICKER_BG]);
+        if (!el) {
+            _createElements.call(this);
+        } else {
+        }
+
+        for (i in ids) {
+            if (lang.hasOwnProperty(ids, i)) {
+                // look for element
+                el = Dom.get(ids[i]);
+
+                // generate an id if the implementer passed in an element reference,
+                // and the element did not have an id already
+                id = Dom.generateId(el);
+
+                // update the id in case we generated the id
+                ids[i] = id; // key is WEBSAFE_SWATCH
+                ids[ids[i]] = id; // key is websafe_swatch
+
+                // store the dom ref
+                els[id] = el;
+            }
+        }
+
+        // set the initial visibility state of our controls
+            els = [o.SHOW_CONTROLS, 
+                   o.SHOW_RGB_CONTROLS,
+                   o.SHOW_HSV_CONTROLS,
+                   o.SHOW_HEX_CONTROLS,
+                   o.SHOW_HEX_SUMMARY,
+                   o.SHOW_WEBSAFE
+                   ];
+
+        for (i=0; i<els.length; i=i+1) {
+            this.set(els[i], this.get(els[i]));
+        }
+
+        var s = this.get(o.PICKER_SIZE);
+
+        this.hueSlider = Slider.getVertSlider(this.getElement(this.ID.HUE_BG), 
+                                              this.getElement(this.ID.HUE_THUMB), 0, s);
+        this.hueSlider.subscribe("change", _onHueSliderChange, this, true);
+
+        this.pickerSlider = Slider.getSliderRegion(this.getElement(this.ID.PICKER_BG), 
+                                                   this.getElement(this.ID.PICKER_THUMB), 0, s, 0, s);
+        this.pickerSlider.subscribe("change", _onPickerSliderChange, this, true);
+
+        //_onHueSliderChange.call(this, 0);
+
+        Event.on(this.getElement(this.ID.WEBSAFE_SWATCH), "click", function(e) {
+               this.setValue(this.get(o.WEBSAFE));
+               //_updateSliders
+           }, this, true);
+
+        Event.on(this.getElement(this.ID.CONTROLS_LABEL), "click", function(e) {
+               this.set(o.SHOW_CONTROLS, !this.get(o.SHOW_CONTROLS));
+               Event.preventDefault(e);
+           }, this, true);
+
+        _attachRGBHSV.call(this, this.ID.R, this.OPT.RED); 
+        _attachRGBHSV.call(this, this.ID.G, this.OPT.GREEN); 
+        _attachRGBHSV.call(this, this.ID.B, this.OPT.BLUE); 
+        _attachRGBHSV.call(this, this.ID.H, this.OPT.HUE); 
+        _attachRGBHSV.call(this, this.ID.S, this.OPT.SATURATION); 
+        _attachRGBHSV.call(this, this.ID.V, this.OPT.VALUE); 
+
+        Event.on(this.getElement(this.ID.HEX), "keydown", function(e, me) {
+                _hexFieldKeypress.call(me, e, this, me.OPT.HEX);
+            }, this);
+
+        Event.on(this.getElement(this.ID.HEX), "keypress", _hexOnly, this);
+        Event.on(this.getElement(this.ID.HEX), "blur", function(e, me) {
+                _useFieldValue.call(me, e, this, me.OPT.HEX);
+            }, this);
+    };
+
+    _attachRGBHSV = function(id, config) {
+        Event.on(this.getElement(id), "keydown", function(e, me) {
+                _rgbFieldKeypress.call(me, e, this, config);
+            }, this);
+        Event.on(this.getElement(id), "keypress", _numbersOnly, this);
+        Event.on(this.getElement(id), "blur", function(e, me) {
+                _useFieldValue.call(me, e, this, config);
+            }, this);
+    };
+
+
+    /**
+     * Sets up the config attributes and the change listeners for this
+     * properties
+     * @method initAttributes
+     * @param attr An object containing default attribute values
+     */
+    proto.initAttributes = function(attr) {
+
+        attr = attr || {};
+        YAHOO.widget.ColorPicker.superclass.initAttributes.call(this, attr);
+        
+        /**
+         * The size of the picker. Trying to change this is not recommended.
+         * @config pickersize
+         * @default 180
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.PICKER_SIZE, {
+                value: attr.size || this.DEFAULT.PICKER_SIZE
+            });
+
+        /**
+         * The current hue value 0-360
+         * @config hue
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.HUE, {
+                value: attr.hue || 0,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current saturation value 0-100
+         * @config saturation
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.SATURATION, {
+                value: attr.saturation || 0,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current value/brightness value 0-100
+         * @config value
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.VALUE, {
+                value: attr.value || 100,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current red value 0-255
+         * @config red
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.RED, {
+                value: attr.red || 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current green value 0-255
+         * @config green 
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.GREEN, {
+                value: attr.red || 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current blue value 0-255
+         * @config blue
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.BLUE, {
+                value: attr.blue || 255,
+                validator: lang.isNumber
+            });
+
+        /**
+         * The current hex value #000000-#FFFFFF, without the #
+         * @config hex
+         * @type string
+         */
+        this.setAttributeConfig(this.OPT.HEX, {
+                value: attr.hex || "FFFFFF",
+                validator: lang.isString
+            });
+
+        /**
+         * The current rgb value.  Updates the state of all of the
+         * other value fields.  Read-only: use setValue to set the
+         * controls rgb value.
+         * @config hex
+         * @type [int, int, int]
+         * @readonly
+         */
+        this.setAttributeConfig(this.OPT.RGB, {
+                value: attr.rgb || [255,255,255],
+                method: function(rgb) {
+
+                    this.set(this.OPT.RED, rgb[0], true);
+                    this.set(this.OPT.GREEN, rgb[1], true);
+                    this.set(this.OPT.BLUE, rgb[2], true);
+
+                    var websafe = Color.websafe(rgb);
+                    this.set(this.OPT.WEBSAFE, websafe, true);
+
+                    var hex = Color.rgb2hex(rgb);
+                    this.set(this.OPT.HEX, hex, true);
+
+                    var hsv = Color.rgb2hsv(rgb);
+
+
+                    this.set(this.OPT.HUE, hsv[0], true);
+                    this.set(this.OPT.SATURATION, Math.round(hsv[1]*100), true);
+                    this.set(this.OPT.VALUE, Math.round(hsv[2]*100), true);
+                },
+                readonly: true
+            });
+
+        /**
+         * If the color picker will live inside of a container object,
+         * set, provide a reference to it so the control can use the
+         * container's events.
+         * @config container
+         * @type YAHOO.widget.Panel
+         */
+        this.setAttributeConfig(this.OPT.CONTAINER, {
+                    value: null,
+                    method: function(container) {
+                        if (container) {
+                            // Position can get out of sync when the
+                            // control is manipulated while display is
+                            // none.  Resetting the slider constraints
+                            // when it is visible gets the state back in
+                            // order.
+                            container.showEvent.subscribe(function() {
+                                // this.pickerSlider.thumb.resetConstraints();
+                                // this.hueSlider.thumb.resetConstraints();
+                                this.pickerSlider.focus();
+                            }, this, true);
+                        }
+                    }
+                });
+        /**
+         * The closest current websafe value
+         * @config websafe
+         * @type int
+         */
+        this.setAttributeConfig(this.OPT.WEBSAFE, {
+                value: attr.websafe || [255,255,255]
+            });
+
+
+        ids = attr.ids || lang.merge({}, this.ID);
+
+        if (!attr.ids && pickercount > 1) {
+            for (var i in ids) {
+                if (lang.hasOwnProperty(ids, i)) {
+                    ids[i] = ids[i] + pickercount;
+                }
+            }
+        }
+
+
+        /**
+         * A list of element ids and/or element references used by the 
+         * control.  The default is the this.ID list, and can be customized
+         * by passing a list in the contructor
+         * @config ids
+         * @type {referenceid: realid}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.IDS, {
+                value: ids,
+                writeonce: true
+            });
+
+        /**
+         * A list of txt strings for internationalization.  Default
+         * is this.TXT
+         * @config txt
+         * @type {key: txt}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.TXT, {
+                value: attr.txt || this.TXT,
+                writeonce: true
+            });
+
+        /**
+         * The img src default list
+         * is this.IMAGES
+         * @config images
+         * @type {key: image}
+         * @writeonce
+         */
+        this.setAttributeConfig(this.OPT.IMAGES, {
+                value: attr.images || this.IMAGE,
+                writeonce: true
+            });
+        /**
+         * The element refs used by this control.  Set at initialization
+         * @config elements
+         * @type {id: HTMLElement}
+         * @readonly
+         */
+        this.setAttributeConfig(this.OPT.ELEMENTS, {
+                value: {},
+                readonly: true
+            });
+
+        /**
+         * Returns the cached element reference.  If the id is not a string, it
+         * is assumed that it is an element and this is returned.
+         * @param id {string|HTMLElement} the element key, id, or ref
+         * @param on {boolean} hide or show.  If true, show
+         * @private */
+        _hideShowEl = function(id, on) {
+            var el = (lang.isString(id) ? this.getElement(id) : id);
+            //Dom.setStyle(id, "visibility", (on) ? "" : "hidden");
+            Dom.setStyle(el, "display", (on) ? "" : "none");
+        };
+
+        /**
+         * Hide/show the entire set of controls
+         * @config showcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_CONTROLS, {
+                value: (attr.showcontrols) || true,
+                method: function(on) {
+
+                    var el = Dom.getElementsByClassName("bd", "div", 
+                            this.getElement(this.ID.CONTROLS))[0];
+
+                    _hideShowEl.call(this, el, on);
+
+                    this.getElement(this.ID.CONTROLS_LABEL).innerHTML = 
+                        (on) ? this.get(this.OPT.TXT).HIDE_CONTROLS :
+                               this.get(this.OPT.TXT).SHOW_CONTROLS;
+
+                }
+            });
+
+        /**
+         * Hide/show the rgb controls
+         * @config showrgbcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_RGB_CONTROLS, {
+                value: (attr.showrgbcontrols) || true,
+                method: function(on) {
+                    //Dom.setStyle(this.getElement(this.ID.RBG_CONTROLS), "visibility", (on) ? "" : "hidden");
+                    _hideShowEl.call(this, this.ID.RGB_CONTROLS, on);
+                }
+            });
+
+        /**
+         * Hide/show the hsv controls
+         * @config showhsvcontrols
+         * @type boolean
+         * @default false
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HSV_CONTROLS, {
+                value: (attr.showhsvcontrols) || false,
+                method: function(on) {
+                    //Dom.setStyle(this.getElement(this.ID.HSV_CONTROLS), "visibility", (on) ? "" : "hidden");
+                    _hideShowEl.call(this, this.ID.HSV_CONTROLS, on);
+
+                    // can't show both the hsv controls and the rbg hex summary
+                    if (on && this.get(this.OPT.SHOW_HEX_SUMMARY)) {
+                        this.set(this.OPT.SHOW_HEX_SUMMARY, false);
+                    }
+                }
+            });
+
+        /**
+         * Hide/show the hex controls
+         * @config showhexcontrols
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HEX_CONTROLS, {
+                value: (attr.showhexcontrols) || false,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.HEX_CONTROLS, on);
+                }
+            });
+
+        /**
+         * Hide/show the websafe swatch
+         * @config showwebsafe
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_WEBSAFE, {
+                value: (attr.showwebsafe) || true,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.WEBSAFE_SWATCH, on);
+                }
+            });
+
+        /**
+         * Hide/show the hex summary
+         * @config showhexsummary
+         * @type boolean
+         * @default true
+         */
+        this.setAttributeConfig(this.OPT.SHOW_HEX_SUMMARY, {
+                value: (attr.showhexsummary) || true,
+                method: function(on) {
+                    _hideShowEl.call(this, this.ID.HEX_SUMMARY, on);
+
+                    // can't show both the hsv controls and the rbg hex summary
+                    if (on && this.get(this.OPT.SHOW_HSV_CONTROLS)) {
+                        this.set(this.OPT.SHOW_HSV_CONTROLS, false);
+                    }
+                }
+            });
+        this.setAttributeConfig(this.OPT.ANIMATE, {
+                value: (attr.animate) || true,
+                method: function(on) {
+                    this.pickerSlider.animate = on;
+                    this.hueSlider.animate = on;
+                }
+            });
+
+        this.on(this.OPT.HUE + "Change", _updateRGBFromHSV, this, true);
+        this.on(this.OPT.SATURATION + "Change", _updateRGBFromHSV, this, true);
+        this.on(this.OPT.VALUE + "Change", _updatePickerSlider, this, true);
+
+        this.on(this.OPT.RED + "Change", _updateRGB, this, true);
+        this.on(this.OPT.GREEN + "Change", _updateRGB, this, true);
+        this.on(this.OPT.BLUE + "Change", _updateRGB, this, true);
+
+        this.on(this.OPT.HEX + "Change", _updateHex, this, true);
+
+        this.initPicker();
+    };
+
+    /**
+     * Updates the rgb attribute with the current state of the r,g,b
+     * fields.  This is invoked from change listeners on these
+     * attributes to facilitate updating these values from the
+     * individual form fields
+     * @method _updateRGB
+     * @private
+     */
+    var _updateRGB = function() {
+        var rgb = [this.get(this.OPT.RED), 
+                   this.get(this.OPT.GREEN),
+                   this.get(this.OPT.BLUE)];
+
+        this.set(this.OPT.RGB, rgb);
+
+        _updateSliders.call(this);
+    };
+
+    /**
+     * Updates the RGB values from the current state of the HSV
+     * values.  Executed when the one of the HSV form fields are
+     * updated
+     * _updateRGBFromHSV
+     * @private
+     */
+    var _updateRGBFromHSV = function() {
+        var hsv = [this.get(this.OPT.HUE), 
+                   this.get(this.OPT.SATURATION)/100,
+                   this.get(this.OPT.VALUE)/100];
+
+        var rgb = Color.hsv2rgb(hsv);
+
+        this.set(this.OPT.RGB, rgb);
+
+        _updateSliders.call(this);
+    };
+
+    /**
+     * Parses the hex string to normalize shorthand values, converts
+     * the hex value to rgb and updates the rgb attribute (which
+     * updates the state for all of the other values)
+     * method _updateHex
+     * @private
+     */
+    var _updateHex = function() {
+       
+        var hex = this.get(this.OPT.HEX), l=hex.length;
+
+        // support #369 -> #336699 shorthand
+        if (l === 3) {
+            var c = hex.split(""), i;
+            for (i=0; i<l; i=i+1) {
+                c[i] = c[i] + c[i];
+            }
+
+            hex = c.join("");
+        }
+
+        if (hex.length !== 6) {
+            return false;
+        }
+
+        var rgb = Color.hex2rgb(hex);
+
+
+        this.setValue(rgb);
+
+        //_updateSliders.call(this);
+
+    };
+
+    /**
+     * Moves the sliders into the position dictated by the current state
+     * of the control
+     * @method _updateSliders
+     * @private
+     */
+    var _updateSliders = function() {
+        _updateHueSlider.call(this);
+        _updatePickerSlider.call(this);
+    };
+
+    /**
+     * Moves the hue slider into the position dictated by the current state
+     * of the control
+     * @method _updateHueSlider
+     * @private
+     */
+    var _updateHueSlider = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            h = this.get(this.OPT.HUE);
+
+        h = size - Math.round(h / 360 * size);
+        
+        // 0 is at the top and bottom of the hue slider.  Always go to
+        // the top so we don't end up sending the thumb to the bottom
+        // when the value didn't actually change (e.g., a conversion
+        // produced 360 instead of 0 and the value was already 0).
+        if (h === size) {
+            h = 0;
+        }
+
+        this.hueSlider.setValue(h);
+    };
+
+    /**
+     * Moves the picker slider into the position dictated by the current state
+     * of the control
+     * @method _updatePickerSlider
+     * @private
+     */
+    var _updatePickerSlider = function() {
+        var size = this.get(this.OPT.PICKER_SIZE),
+            s = this.get(this.OPT.SATURATION),
+            v = this.get(this.OPT.VALUE);
+
+        s = Math.round(s * size / 100);
+        v = Math.round(size - (v * size / 100));
+
+
+        this.pickerSlider.setRegionValue(s, v);
+    };
+
+    /**
+     * Creates the host element if it doesn't exist
+     * @method _createHostElement
+     * @private
+     */
+    var _createHostElement = function() {
+        var el = document.createElement('div');
+
+        if (this.CSS.BASE) {
+            el.className = this.CSS.BASE;
+        }
+        
+        return el;
+    };
+
+
+})();
+YAHOO.register("colorpicker", YAHOO.widget.ColorPicker, {version: "2.3.0", build: "442"});
index 754bcc429eea82b05f4fd035132f1569d5225530..62d9e978c879a1978e9c285aed33965b55c4f858 100755 (executable)
@@ -1,5 +1,75 @@
 Connection Manager Release Notes
 
+*** version 2.3.0 ***
+
+* Custom Events are introduced in Connection Manager.  These events -- for a
+non-file upload transaction -- are:
+
+   * startEvent
+   * completeEvent
+   * successEvent
+   * failureEvent
+   * abortEvent
+
+For transactions involving file upload with an HTML form, the events are:
+
+   * startEvent
+   * completeEvent
+   * uploadEvent
+   * abortEvent
+
+* Event utility is a now Connection Manager dependency.
+
+* abort() and isCallInProgress() are now functional for file upload
+transactions.
+
+* NOTE: The XHR implementation in Safari 2.0.4 has been confirmed to leak
+memory.
+
+* UPDATE: The XHR implementation in Safari 3.0 beta(and WebKit builds) now
+appear to handle HTTP 204 responses correctly.  XHR in Opera, as of 9.21, still
+does not produce a valid HTTP status code with an HTTP 204 response.
+
+*** version 2.2.2 ***
+
+* No revisions.
+
+*** version 2.2.1 ***
+
+* setForm() will include the correct name-value of the HTML Submit button
+clicked where multiple HTML Submit button options are present in an HTML form.
+To enable this feature, include the Event utility source file as a dependency
+before the Connection Manager source file.
+
+* The XHR implementation in IE6 and IE7, Opera, and Safari do not properly
+handle an HTTP 204 response.  IE6/7 will instead return a Win error 1223.
+handleTransactionResponse() will treat 1223 as an HTTP 204, and route the
+response appropriately to the success callback.  createResponseObject() will
+normalize the response object's status and statusText values to 204 and "No
+Content" respectively.  However, no headers are returned.
+
+Opera and Safari provide no discernable response with HTTP 204(e.g., response
+object's properties are undefined).  This response will trigger the failure
+callback with a status of 0 and statusText of "communication failure".
+
+*** version 2.2.0 ***
+
+* initHeader() now accepts a third argument as a boolean.  When set to true,
+this specific header will automatically be sent with each transaction.
+Otherwise, the header will be set and sent for the specific transaction only.
+Example: initHeader('X-YUI-State','Beta', true); all transactions will send this
+header.
+   * resetDefaultHeaders() will clear the default headers collection.
+
+* All Connection Mananger transactions will broadcast the header: "X-Requested-
+With: XMLHttpRequest".
+   * This can be turned off: YAHOO.util.Connect.setDefaultXhrHeader(false);
+
+* The HTTP method argument in asyncRequest is now case-insensitive.
+
+* uploadFile() will now correctly handle the absence of a callback object,
+allowing the transaction to complete silently.
+
 *** version 0.12.2 ***
 
 * The Opera/Connection Manager concurrent object condition, described in version
@@ -156,6 +226,13 @@ and returns false if the connection object is no longer available.
 
 
 
+
+
+
+
+
+
+
 
 
 
index 78cda4a855c3bdd63815bfeb23ec7f2d3a3a08d4..08e0f80893aab45610c50ab294d2627b5a30db21 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 /**
  * The Connection Manager provides a simplified interface to the XMLHttpRequest
@@ -13,6 +13,7 @@ version: 0.12.2
  * @namespace YAHOO.util
  * @module connection
  * @requires yahoo
+ * @requires event
  */
 
 /**
@@ -44,7 +45,7 @@ YAHOO.util.Connect =
    * @static
    * @type object
    */
-       _http_header:{},
+       _http_headers:{},
 
   /**
    * @description Determines if HTTP headers are set.
@@ -70,14 +71,57 @@ YAHOO.util.Connect =
  /**
   * @description 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
+  * will be added to client HTTP headers sent for POST
   * transactions.
   * @property _default_post_header
   * @private
   * @static
   * @type boolean
   */
-    _default_post_header:'application/x-www-form-urlencoded',
+    _default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',
+
+ /**
+  * @description Determines if a default header of
+  * 'X-Requested-With: XMLHttpRequest'
+  * will be added to each transaction.
+  * @property _use_default_xhr_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _use_default_xhr_header:true,
+
+ /**
+  * @description The default header value for the label
+  * "X-Requested-With".  This is sent with each
+  * transaction, by default, to identify the
+  * request as being made by YUI Connection Manager.
+  * @property _default_xhr_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_xhr_header:'XMLHttpRequest',
+
+ /**
+  * @description Determines if custom, default headers
+  * are set for each transaction.
+  * @property _has_default_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _has_default_headers:true,
+
+ /**
+  * @description Determines if custom, default headers
+  * are set for each transaction.
+  * @property _has_default_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_headers:{},
 
  /**
   * @description Property modified by setForm() to determine if the data
@@ -157,6 +201,117 @@ YAHOO.util.Connect =
    */
      _transaction_id:0,
 
+  /**
+   * @description Tracks the name-value pair of the "clicked" submit button if multiple submit
+   * buttons are present in an HTML form; and, if YAHOO.util.Event is available.
+   * @property _submitElementValue
+   * @private
+   * @static
+   * @type string
+   */
+        _submitElementValue:null,
+
+  /**
+   * @description Determines whether YAHOO.util.Event is available and returns true or false.
+   * If true, an event listener is bound at the document level to trap click events that
+   * resolve to a target type of "Submit".  This listener will enable setForm() to determine
+   * the clicked "Submit" value in a multi-Submit button, HTML form.
+   * @property _hasSubmitListener
+   * @private
+   * @static
+   */
+        _hasSubmitListener:(function()
+        {
+               if(YAHOO.util.Event){
+                       YAHOO.util.Event.addListener(
+                               document,
+                               'click',
+                               function(e){
+                                       var obj = YAHOO.util.Event.getTarget(e);
+                                       if(obj.type == 'submit'){
+                                               YAHOO.util.Connect._submitElementValue = encodeURIComponent(obj.name) + "=" + encodeURIComponent(obj.value);
+                                       }
+                               });
+                       return true;
+           }
+           return false;
+        })(),
+
+  /**
+   * @description Custom event that fires at the start of a transaction
+   * @property startEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       startEvent: new YAHOO.util.CustomEvent('start'),
+
+  /**
+   * @description Custom event that fires when a transaction response has completed.
+   * @property completeEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       completeEvent: new YAHOO.util.CustomEvent('complete'),
+
+  /**
+   * @description Custom event that fires when handleTransactionResponse() determines a
+   * response in the HTTP 2xx range.
+   * @property successEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       successEvent: new YAHOO.util.CustomEvent('success'),
+
+  /**
+   * @description Custom event that fires when handleTransactionResponse() determines a
+   * response in the HTTP 4xx/5xx range.
+   * @property failureEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       failureEvent: new YAHOO.util.CustomEvent('failure'),
+
+  /**
+   * @description Custom event that fires when handleTransactionResponse() determines a
+   * response in the HTTP 4xx/5xx range.
+   * @property failureEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       uploadEvent: new YAHOO.util.CustomEvent('upload'),
+
+  /**
+   * @description Custom event that fires when a transaction is successfully aborted.
+   * @property abortEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       abortEvent: new YAHOO.util.CustomEvent('abort'),
+
+  /**
+   * @description A reference table that maps callback custom events members to its specific
+   * event name.
+   * @property _customEvents
+   * @private
+   * @static
+   * @type object
+   */
+       _customEvents:
+       {
+               onStart:['startEvent', 'start'],
+               onComplete:['completeEvent', 'complete'],
+               onSuccess:['successEvent', 'success'],
+               onFailure:['failureEvent', 'failure'],
+               onUpload:['uploadEvent', 'upload'],
+               onAbort:['abortEvent', 'abort']
+       },
+
   /**
    * @description 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
@@ -187,6 +342,20 @@ YAHOO.util.Connect =
                YAHOO.log('Use default POST header set to  ' + b, 'info', 'Connection');
        },
 
+  /**
+   * @description Member to enable or disable the default POST header.
+   * @method setDefaultXhrHeader
+   * @public
+   * @static
+   * @param {boolean} b Set and use default header - true or false .
+   * @return void
+   */
+       setDefaultXhrHeader:function(b)
+       {
+               this._use_default_xhr_header = b;
+               YAHOO.log('Use default transaction header set to  ' + b, 'info', 'Connection');
+       },
+
   /**
    * @description Member to modify the default polling interval.
    * @method setPollingInterval
@@ -253,14 +422,22 @@ YAHOO.util.Connect =
    * @static
    * @return {object}
    */
-       getConnectionObject:function()
+       getConnectionObject:function(isFileUpload)
        {
                var o;
                var tId = this._transaction_id;
 
                try
                {
-                       o = this.createXhrObject(tId);
+                       if(!isFileUpload){
+                               o = this.createXhrObject(tId);
+                       }
+                       else{
+                               o = {};
+                               o.tId = tId;
+                               o.isUpload = true;
+                       }
+
                        if(o){
                                this._transaction_id++;
                        }
@@ -285,26 +462,30 @@ YAHOO.util.Connect =
    */
        asyncRequest:function(method, uri, callback, postData)
        {
-               var o = this.getConnectionObject();
+               var o = (this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();
 
                if(!o){
                        YAHOO.log('Unable to create connection object.', 'error', 'Connection');
                        return null;
                }
                else{
+
+                       // Intialize any transaction-specific custom events, if provided.
+                       if(callback && callback.customevents){
+                               this.initCustomEvents(o, callback);
+                       }
+
                        if(this._isFormSubmit){
                                if(this._isFileUpload){
-                                       this.uploadFile(o.tId, callback, uri, postData);
-                                       this.releaseObject(o);
-
-                                       return;
+                                       this.uploadFile(o, callback, uri, postData);
+                                       return o;
                                }
 
-                               //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'){
-                                       if(this._sFormData.length != 0){
+                               // 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.toUpperCase() == 'GET'){
+                                       if(this._sFormData.length !== 0){
                                                // If the URI already contains a querystring, append an ampersand
                                                // and then concatenate _sFormData to the URI.
                                                uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;
@@ -313,34 +494,80 @@ YAHOO.util.Connect =
                                                uri += "?" + this._sFormData;
                                        }
                                }
-                               else if(method == 'POST'){
-                                       //If POST data exist in addition to the HTML form data,
-                                       //it will be concatenated to the form data.
+                               else if(method.toUpperCase() == 'POST'){
+                                       // If POST data exist in addition to the HTML form data,
+                                       // it will be concatenated to the form data.
                                        postData = postData?this._sFormData + "&" + postData:this._sFormData;
                                }
                        }
 
                        o.conn.open(method, uri, true);
+                       //this.processTransactionHeaders(o);
+
+                       // Each transaction will automatically include a custom header of
+                       // "X-Requested-With: XMLHttpRequest" to identify the request as
+                       // having originated from Connection Manager.
+                       if(this._use_default_xhr_header){
+                               if(!this._default_headers['X-Requested-With']){
+                                       this.initHeader('X-Requested-With', this._default_xhr_header, true);
+                                       YAHOO.log('Initialize transaction header X-Request-Header to XMLHttpRequest.', 'info', 'Connection');
+                               }
+                       }
 
                        if(this._isFormSubmit || (postData && this._use_default_post_header)){
                                this.initHeader('Content-Type', this._default_post_header);
-                               YAHOO.log('Initialize default header Content-Type to application/x-www-form-urlencoded.', 'info', 'Connection');
+                               YAHOO.log('Initialize header Content-Type to application/x-www-form-urlencoded for POST transaction.', 'info', 'Connection');
                                if(this._isFormSubmit){
                                        this.resetFormState();
                                }
                        }
 
-                       if(this._has_http_headers){
+                       if(this._has_default_headers || this._has_http_headers){
                                this.setHeader(o);
                        }
 
                        this.handleReadyState(o, callback);
                        o.conn.send(postData || null);
 
+                       // Fire global custom event -- startEvent
+                       this.startEvent.fire(o);
+
+                       if(o.startEvent){
+                               // Fire transaction custom event -- startEvent
+                               o.startEvent.fire(o);
+                       }
+
                        return o;
                }
        },
 
+  /**
+   * @description This method creates and subscribes custom events,
+   * specific to each transaction
+   * @method initCustomEvents
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @param {callback} callback The user-defined callback object
+   * @return {void}
+   */
+       initCustomEvents:function(o, callback)
+       {
+               // Enumerate through callback.customevents members and bind/subscribe
+               // events that match in the _customEvents table.
+               for(var prop in callback.customevents){
+                       if(this._customEvents[prop][0]){
+                               // Create the custom event
+                               o[this._customEvents[prop][0]] = new YAHOO.util.CustomEvent(this._customEvents[prop][1], (callback.scope)?callback.scope:null);
+                               YAHOO.log('Transaction-specific Custom Event ' + o[this._customEvents[prop][1]] + ' created.', 'info', 'Connection');
+
+                               // Subscribe the custom event
+                               o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);
+                               YAHOO.log('Transaction-specific Custom Event ' + o[this._customEvents[prop][1]] + ' subscribed.', 'info', 'Connection');
+                       }
+               }
+       },
+
   /**
    * @description This method serves as a timer that polls the XHR object's readyState
    * property during a transaction, instead of binding a callback to the
@@ -353,7 +580,9 @@ YAHOO.util.Connect =
    * @param {callback} callback The user-defined callback object
    * @return {void}
    */
+
     handleReadyState:function(o, callback)
+
     {
                var oConn = this;
 
@@ -363,14 +592,26 @@ YAHOO.util.Connect =
 
                this._poll[o.tId] = window.setInterval(
                        function(){
-                               if(o.conn && o.conn.readyState == 4){
+                               if(o.conn && o.conn.readyState === 4){
+
+                                       // Clear the polling interval for the transaction
+                                       // and remove the reference from _poll.
                                        window.clearInterval(oConn._poll[o.tId]);
                                        delete oConn._poll[o.tId];
 
                                        if(callback && callback.timeout){
+                                               window.clearTimeout(oConn._timeOut[o.tId]);
                                                delete oConn._timeOut[o.tId];
                                        }
 
+                                       // Fire global custom event -- completeEvent
+                                       oConn.completeEvent.fire(o);
+
+                                       if(o.completeEvent){
+                                               // Fire transaction custom event -- completeEvent
+                                               o.completeEvent.fire(o);
+                                       }
+
                                        oConn.handleTransactionResponse(o, callback);
                                }
                        }
@@ -385,8 +626,8 @@ YAHOO.util.Connect =
    * @private
    * @static
    * @param {object} o The connection object
-   * @param {object} callback The sser-defined callback object
-   * @param {boolean} isAbort Determines if the transaction was aborted.
+   * @param {object} callback The user-defined callback object
+   * @param {boolean} isAbort Determines if the transaction was terminated via abort().
    * @return {void}
    */
     handleTransactionResponse:function(o, callback, isAbort)
@@ -394,7 +635,7 @@ YAHOO.util.Connect =
                // 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');
+                       YAHOO.log('No callback object to process. Transaction complete.', 'info', 'Connection');
                        return;
                }
 
@@ -402,7 +643,7 @@ YAHOO.util.Connect =
 
                try
                {
-                       if(o.conn.status !== undefined && o.conn.status != 0){
+                       if(o.conn.status !== undefined && o.conn.status !== 0){
                                httpStatus = o.conn.status;
                        }
                        else{
@@ -410,13 +651,14 @@ YAHOO.util.Connect =
                        }
                }
                catch(e){
-                       // 13030 is the custom code to indicate the condition -- in Mozilla/FF --
-                       // when the o object's status and statusText properties are
-                       // unavailable, and a query attempt throws an exception.
+
+                        // 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){
+               if(httpStatus >= 200 && httpStatus < 300 || httpStatus === 1223){
                        responseObject = this.createResponseObject(o, callback.argument);
                        if(callback.success){
                                if(!callback.scope){
@@ -430,6 +672,14 @@ YAHOO.util.Connect =
                                        YAHOO.log('Success callback with scope. HTTP code is ' + httpStatus, 'info', 'Connection');
                                }
                        }
+
+                       // Fire global custom event -- successEvent
+                       this.successEvent.fire(responseObject);
+
+                       if(o.successEvent){
+                               // Fire transaction custom event -- successEvent
+                               o.successEvent.fire(responseObject);
+                       }
                }
                else{
                        switch(httpStatus){
@@ -465,6 +715,15 @@ YAHOO.util.Connect =
                                                }
                                        }
                        }
+
+                       // Fire global custom event -- failureEvent
+                       this.failureEvent.fire(responseObject);
+
+                       if(o.failureEvent){
+                               // Fire transaction custom event -- failureEvent
+                               o.failureEvent.fire(responseObject);
+                       }
+
                }
 
                this.releaseObject(o);
@@ -501,8 +760,10 @@ YAHOO.util.Connect =
                catch(e){}
 
                obj.tId = o.tId;
-               obj.status = o.conn.status;
-               obj.statusText = o.conn.statusText;
+               // Normalize IE's response to HTTP 204 when Win error 1223.
+               obj.status = (o.conn.status == 1223)?204:o.conn.status;
+               // Normalize IE's statusText to "No Content" instead of "Unknown".
+               obj.statusText = (o.conn.status == 1223)?"No Content":o.conn.statusText;
                obj.getResponseHeader = headerObj;
                obj.getAllResponseHeaders = headerStr;
                obj.responseText = o.conn.responseText;
@@ -558,28 +819,38 @@ YAHOO.util.Connect =
     },
 
   /**
-   * @description Public method that stores the custom HTTP headers for each transaction.
+   * @description Method that initializes the custom HTTP headers for the each transaction.
    * @method initHeader
    * @public
    * @static
    * @param {string} label The HTTP header label
    * @param {string} value The HTTP header value
+   * @param {string} isDefault Determines if the specific header is a default header
+   * automatically sent with each transaction.
    * @return {void}
    */
-       initHeader:function(label,value)
+       initHeader:function(label,value,isDefault)
        {
-               if(this._http_header[label] === undefined){
-                       this._http_header[label] = value;
+               var headerObj = (isDefault)?this._default_headers:this._http_headers;
+
+               if(headerObj[label] === undefined){
+                       headerObj[label] = value;
                }
                else{
                        // Concatenate multiple values, comma-delimited,
                        // for the same header label,
-                       this._http_header[label] =  value + "," + this._http_header[label];
+                       headerObj[label] =  value + "," + headerObj[label];
                }
 
-               this._has_http_headers = true;
+               if(isDefault){
+                       this._has_default_headers = true;
+               }
+               else{
+                       this._has_http_headers = true;
+               }
        },
 
+
   /**
    * @description Accessor that sets the HTTP headers for each transaction.
    * @method setHeader
@@ -590,30 +861,53 @@ YAHOO.util.Connect =
    */
        setHeader:function(o)
        {
-               for(var prop in this._http_header){
-                       if(this._http_header.hasOwnProperty(prop)){
-                               o.conn.setRequestHeader(prop, this._http_header[prop]);
-                               YAHOO.log('HTTP header ' + prop + ' set with value of ' + this._http_header[prop], 'info', 'Connection');
+               if(this._has_default_headers){
+                       for(var prop in this._default_headers){
+                               if(YAHOO.lang.hasOwnProperty(this._default_headers, prop)){
+                                       o.conn.setRequestHeader(prop, this._default_headers[prop]);
+                                       YAHOO.log('Default HTTP header ' + prop + ' set with value of ' + this._default_headers[prop], 'info', 'Connection');
+                               }
                        }
                }
-               delete this._http_header;
 
-               this._http_header = {};
-               this._has_http_headers = false;
+               if(this._has_http_headers){
+                       for(var prop in this._http_headers){
+                               if(YAHOO.lang.hasOwnProperty(this._http_headers, prop)){
+                                       o.conn.setRequestHeader(prop, this._http_headers[prop]);
+                                       YAHOO.log('HTTP header ' + prop + ' set with value of ' + this._http_headers[prop], 'info', 'Connection');
+                               }
+                       }
+                       delete this._http_headers;
+
+                       this._http_headers = {};
+                       this._has_http_headers = false;
+               }
+       },
+
+  /**
+   * @description Resets the default HTTP headers object
+   * @method resetDefaultHeaders
+   * @public
+   * @static
+   * @return {void}
+   */
+       resetDefaultHeaders:function(){
+               delete this._default_headers;
+               this._default_headers = {};
+               this._has_default_headers = false;
        },
 
   /**
    * @description 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.
+   * asyncRequest() will automatically initialize the transaction with a
+   * a HTTP header Content-Type of application/x-www-form-urlencoded.
    * @method setForm
    * @public
    * @static
    * @param {string || object} form id or name attribute, or form object.
-   * @param {string} optional boolean to indicate SSL environment.
-   * @param {string || boolean} optional qualified path of iframe resource for SSL in IE.
+   * @param {boolean} optional enable file upload.
+   * @param {boolean} optional enable file upload over SSL in IE only.
    * @return {string} string of the HTML form field name and value pairs..
    */
        setForm:function(formId, isUpload, secureUri)
@@ -644,14 +938,14 @@ YAHOO.util.Connect =
                if(isUpload){
 
                        // Create iframe in preparation for file upload.
-                       this.createFrame(secureUri?secureUri:null);
-
+                       var io = this.createFrame(secureUri?secureUri:null);
                        // Set form reference and file upload properties to true.
                        this._isFormSubmit = true;
                        this._isFileUpload = true;
                        this._formNode = oForm;
 
                        return;
+
                }
 
                var oElement, oName, oValue, oDisabled;
@@ -669,7 +963,7 @@ YAHOO.util.Connect =
                        // do not have a name attribute value.
                        if(!oDisabled && oName)
                        {
-                               switch (oElement.type)
+                               switch(oElement.type)
                                {
                                        case 'select-one':
                                        case 'select-multiple':
@@ -681,7 +975,6 @@ YAHOO.util.Connect =
                                                                else{
                                                                        this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text) + '&';
                                                                }
-
                                                        }
                                                }
                                                break;
@@ -701,14 +994,19 @@ YAHOO.util.Connect =
                                                // stub case for input type button elements.
                                                break;
                                        case 'submit':
-                                               if(hasSubmit == false){
-                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
+                                               if(hasSubmit === false){
+                                                       if(this._hasSubmitListener && this._submitElementValue){
+                                                               this._sFormData += this._submitElementValue + '&';
+                                                       }
+                                                       else{
+                                                               this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
+                                                       }
+
                                                        hasSubmit = true;
                                                }
                                                break;
                                        default:
                                                this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
-                                               break;
                                }
                        }
                }
@@ -751,8 +1049,9 @@ YAHOO.util.Connect =
                // properties via createElement().  A different iframe creation
                // pattern is required for IE.
                var frameId = 'yuiIO' + this._transaction_id;
+               var io;
                if(window.ActiveXObject){
-                       var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
+                       io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
 
                        // IE will throw a security exception in an SSL environment if the
                        // iframe source is undefined.
@@ -765,7 +1064,7 @@ YAHOO.util.Connect =
                        }
                }
                else{
-                       var io = document.createElement('iframe');
+                       io = document.createElement('iframe');
                        io.id = frameId;
                        io.name = frameId;
                }
@@ -806,72 +1105,125 @@ YAHOO.util.Connect =
        },
 
   /**
-   * @description Uploads HTML form, including files/attachments, to the
-   * iframe created in createFrame.
+   * @description Uploads HTML form, inclusive of files/attachments, using the
+   * iframe created in createFrame to facilitate the transaction.
    * @method uploadFile
    * @private
    * @static
    * @param {int} id The transaction id.
-   * @param {object} callback User-defined callback object.
+   * @param {object} callback User-defined callback object.
    * @param {string} uri Fully qualified path of resource.
+   * @param {string} postData POST data to be submitted in addition to HTML form.
    * @return {void}
    */
-       uploadFile:function(id, callback, uri, postData){
+       uploadFile:function(o, callback, uri, postData){
 
                // Each iframe has an id prefix of "yuiIO" followed
                // by the unique transaction id.
-               var frameId = 'yuiIO' + id;
+               var frameId = 'yuiIO' + o.tId;
+               var uploadEncoding = 'multipart/form-data';
                var io = document.getElementById(frameId);
+               var oConn = this;
+
+               // Track original HTML form attribute values.
+               var rawFormAttributes =
+               {
+                       action:this._formNode.getAttribute('action'),
+                       method:this._formNode.getAttribute('method'),
+                       target:this._formNode.getAttribute('target')
+               };
 
                // Initialize the HTML form properties in case they are
                // not defined in the HTML form.
-               this._formNode.action = uri;
-               this._formNode.method = 'POST';
-               this._formNode.target = frameId;
+               this._formNode.setAttribute('action', uri);
+               this._formNode.setAttribute('method', 'POST');
+               this._formNode.setAttribute('target', frameId);
 
                if(this._formNode.encoding){
                        // IE does not respect property enctype for HTML forms.
-                       // Instead use property encoding.
-                       this._formNode.encoding = 'multipart/form-data';
+                       // Instead it uses the property - "encoding".
+                       this._formNode.setAttribute('encoding', uploadEncoding);
                }
                else{
-                       this._formNode.enctype = 'multipart/form-data';
+                       this._formNode.setAttribute('enctype', uploadEncoding);
                }
 
-
                if(postData){
                        var oElements = this.appendPostData(postData);
                }
 
+               // Start file upload.
                this._formNode.submit();
 
+               // Fire global custom event -- startEvent
+               this.startEvent.fire(o);
+
+               if(o.startEvent){
+                       // Fire transaction custom event -- startEvent
+                       o.startEvent.fire(o);
+               }
+
+               // Start polling if a callback is present and the timeout
+               // property has been defined.
+               if(callback && callback.timeout){
+                       this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
+               }
+
+               // Remove HTML elements created by appendPostData
                if(oElements && oElements.length > 0){
                        for(var i=0; i < oElements.length; i++){
                                this._formNode.removeChild(oElements[i]);
                        }
                }
 
-               // Reset HTML form status properties.
+               // Restore HTML form attributes to their original
+               // values prior to file upload.
+               for(var prop in rawFormAttributes){
+                       if(YAHOO.lang.hasOwnProperty(rawFormAttributes, prop)){
+                               if(rawFormAttributes[prop]){
+                                       this._formNode.setAttribute(prop, rawFormAttributes[prop]);
+                               }
+                               else{
+                                       this._formNode.removeAttribute(prop);
+                               }
+                       }
+               }
+
+               // Reset HTML form state properties.
                this.resetFormState();
 
                // 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()
                {
+                       if(callback && callback.timeout){
+                               window.clearTimeout(oConn._timeOut[o.tId]);
+                               delete oConn._timeOut[o.tId];
+                       }
+
+                       // Fire global custom event -- completeEvent
+                       oConn.completeEvent.fire(o);
+
+                       if(o.completeEvent){
+                               // Fire transaction custom event -- completeEvent
+                               o.completeEvent.fire(o);
+                       }
+
                        var obj = {};
-                       obj.tId = id;
+                       obj.tId = o.tId;
                        obj.argument = callback.argument;
 
                        try
                        {
-                               obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
+                               // responseText and responseXML will be populated with the same data from the iframe.
+                               // Since the HTTP headers cannot be read from the iframe
+                               obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:io.contentWindow.document.documentElement.textContent;
                                obj.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
                        }
                        catch(e){}
 
-                       if(callback.upload){
+                       if(callback && callback.upload){
                                if(!callback.scope){
                                        callback.upload(obj);
                                        YAHOO.log('Upload callback.', 'info', 'Connection');
@@ -882,6 +1234,14 @@ YAHOO.util.Connect =
                                }
                        }
 
+                       // Fire global custom event -- completeEvent
+                       oConn.uploadEvent.fire(obj);
+
+                       if(o.uploadEvent){
+                               // Fire transaction custom event -- completeEvent
+                               o.uploadEvent.fire(obj);
+                       }
+
                        if(YAHOO.util.Event){
                                YAHOO.util.Event.removeListener(io, "load", uploadCallback);
                        }
@@ -894,11 +1254,11 @@ YAHOO.util.Connect =
                        setTimeout(
                                function(){
                                        document.body.removeChild(io);
+                                       oConn.releaseObject(o);
                                        YAHOO.log('File upload iframe destroyed. Id is:' + frameId, 'info', 'Connection');
                                }, 100);
                };
 
-
                // Bind the onload handler to the iframe to detect the file upload response.
                if(YAHOO.util.Event){
                        YAHOO.util.Event.addListener(io, "load", uploadCallback);
@@ -918,28 +1278,67 @@ YAHOO.util.Connect =
    * @static
    * @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.
+   * @param {string} isTimeout boolean to indicate if abort resulted from a callback timeout.
    * @return {boolean}
    */
        abort:function(o, callback, isTimeout)
        {
-               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];
+               var abortStatus;
+
+               if(o.conn){
+                       if(this.isCallInProgress(o)){
+                               // Issue abort request
+                               o.conn.abort();
+
+                               window.clearInterval(this._poll[o.tId]);
+                               delete this._poll[o.tId];
+
+                               if(isTimeout){
+                                       window.clearTimeout(this._timeOut[o.tId]);
+                                       delete this._timeOut[o.tId];
+                               }
+
+                               abortStatus = true;
+                       }
+               }
+               else if(o.isUpload === true){
+                       var frameId = 'yuiIO' + o.tId;
+                       var io = document.getElementById(frameId);
+
+                       if(io){
+                               // Destroy the iframe facilitating the transaction.
+                               document.body.removeChild(io);
+                               YAHOO.log('File upload iframe destroyed. Id is:' + frameId, 'info', 'Connection');
+
+                               if(isTimeout){
+                                       window.clearTimeout(this._timeOut[o.tId]);
+                                       delete this._timeOut[o.tId];
+                               }
+
+                               abortStatus = true;
+                       }
+               }
+               else{
+                       abortStatus = false;
+               }
+
+               if(abortStatus === true){
+                       // Fire global custom event -- abortEvent
+                       this.abortEvent.fire(o);
+
+                       if(o.abortEvent){
+                               // Fire transaction custom event -- abortEvent
+                               o.abortEvent.fire(o);
                        }
 
                        this.handleTransactionResponse(o, callback, true);
                        YAHOO.log('Transaction ' + o.tId + ' aborted.', 'info', 'Connection');
-
-                       return true;
                }
                else{
-                       YAHOO.log('Transaction ' + o.tId + ' abort call failed.', 'warn', 'Connection');
-                       return false;
+                       YAHOO.log('Transaction ' + o.tId + ' abort call failed.  Connection object no longer exists.', 'warn', 'Connection');
                }
+
+               return abortStatus;
        },
 
   /**
@@ -955,11 +1354,14 @@ YAHOO.util.Connect =
        {
                // 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;
+               if(o && o.conn){
+                       return o.conn.readyState !== 4 && o.conn.readyState !== 0;
+               }
+               else if(o && o.isUpload === true){
+                       var frameId = 'yuiIO' + o.tId;
+                       return document.getElementById(frameId)?true:false;
                }
                else{
-                       //The XHR object has been destroyed.
                        return false;
                }
        },
@@ -975,9 +1377,13 @@ YAHOO.util.Connect =
        releaseObject:function(o)
        {
                //dereference the XHR instance.
-               o.conn = null;
+               if(o.conn){
+                       o.conn = null;
+               }
                YAHOO.log('Connection object for transaction ' + o.tId + ' destroyed.', 'info', 'Connection');
                //dereference the connection object.
                o = null;
        }
-};
\ No newline at end of file
+};
+
+YAHOO.register("connection", YAHOO.util.Connect, {version: "2.3.0", build: "442"});
index 7d44fbac290b45f086da9920b1f43c77cbbb9c4b..1da8cb5d3e0209d342648329d709e01780ce0e00 100755 (executable)
@@ -1,12 +1,16 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-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)
+
+YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',_use_default_xhr_header:true,_default_xhr_header:'XMLHttpRequest',_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function()
+{if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,'click',function(e){var obj=YAHOO.util.Event.getTarget(e);if(obj.type=='submit'){YAHOO.util.Connect._submitElementValue=encodeURIComponent(obj.name)+"="+encodeURIComponent(obj.value);}});return true;}
+return false;})(),startEvent:new YAHOO.util.CustomEvent('start'),completeEvent:new YAHOO.util.CustomEvent('complete'),successEvent:new YAHOO.util.CustomEvent('success'),failureEvent:new YAHOO.util.CustomEvent('failure'),uploadEvent:new YAHOO.util.CustomEvent('upload'),abortEvent:new YAHOO.util.CustomEvent('abort'),_customEvents:{onStart:['startEvent','start'],onComplete:['completeEvent','complete'],onSuccess:['successEvent','success'],onFailure:['failureEvent','failure'],onUpload:['uploadEvent','upload'],onAbort:['abortEvent','abort']},setProgId:function(id)
 {this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)
-{this._use_default_post_header=b;},setPollingInterval:function(i)
+{this._use_default_post_header=b;},setDefaultXhrHeader:function(b)
+{this._use_default_xhr_header=b;},setPollingInterval:function(i)
 {if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)
 {var obj,http;try
 {http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
@@ -15,90 +19,112 @@ catch(e)
 {http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId};break;}
 catch(e){}}}
 finally
-{return obj;}},getConnectionObject:function()
+{return obj;}},getConnectionObject:function(isFileUpload)
 {var o;var tId=this._transaction_id;try
-{o=this.createXhrObject(tId);if(o){this._transaction_id++;}}
+{if(!isFileUpload){o=this.createXhrObject(tId);}
+else{o={};o.tId=tId;o.isUpload=true;}
+if(o){this._transaction_id++;}}
 catch(e){}
 finally
 {return o;}},asyncRequest:function(method,uri,callback,postData)
-{var o=this.getConnectionObject();if(!o){return null;}
-else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,callback,uri,postData);this.releaseObject(o);return;}
-if(method=='GET'){if(this._sFormData.length!=0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}
+{var o=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();if(!o){return null;}
+else{if(callback&&callback.customevents){this.initCustomEvents(o,callback);}
+if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o,callback,uri,postData);return o;}
+if(method.toUpperCase()=='GET'){if(this._sFormData.length!==0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}
 else{uri+="?"+this._sFormData;}}
-else if(method=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
-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();}}
-if(this._has_http_headers){this.setHeader(o);}
-this.handleReadyState(o,callback);o.conn.send(postData||null);return o;}},handleReadyState:function(o,callback)
+else if(method.toUpperCase()=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
+o.conn.open(method,uri,true);if(this._use_default_xhr_header){if(!this._default_headers['X-Requested-With']){this.initHeader('X-Requested-With',this._default_xhr_header,true);}}
+if(this._isFormSubmit||(postData&&this._use_default_post_header)){this.initHeader('Content-Type',this._default_post_header);if(this._isFormSubmit){this.resetFormState();}}
+if(this._has_default_headers||this._has_http_headers){this.setHeader(o);}
+this.handleReadyState(o,callback);o.conn.send(postData||null);this.startEvent.fire(o);if(o.startEvent){o.startEvent.fire(o);}
+return o;}},initCustomEvents:function(o,callback)
+{for(var prop in callback.customevents){if(this._customEvents[prop][0]){o[this._customEvents[prop][0]]=new YAHOO.util.CustomEvent(this._customEvents[prop][1],(callback.scope)?callback.scope:null);o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);}}},handleReadyState:function(o,callback)
 {var oConn=this;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
-this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){delete oConn._timeOut[o.tId];}
+this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState===4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
+oConn.completeEvent.fire(o);if(o.completeEvent){o.completeEvent.fire(o);}
 oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort)
 {if(!callback){this.releaseObject(o);return;}
 var httpStatus,responseObject;try
-{if(o.conn.status!==undefined&&o.conn.status!=0){httpStatus=o.conn.status;}
+{if(o.conn.status!==undefined&&o.conn.status!==0){httpStatus=o.conn.status;}
 else{httpStatus=13030;}}
 catch(e){httpStatus=13030;}
-if(httpStatus>=200&&httpStatus<300){try
-{responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
-else{callback.success.apply(callback.scope,[responseObject]);}}}
-catch(e){}}
-else{try
-{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);}
+if(httpStatus>=200&&httpStatus<300||httpStatus===1223){responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
+else{callback.success.apply(callback.scope,[responseObject]);}}
+this.successEvent.fire(responseObject);if(o.successEvent){o.successEvent.fire(responseObject);}}
+else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,(isAbort?isAbort:false));if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
 else{callback.failure.apply(callback.scope,[responseObject]);}}
 break;default:responseObject=this.createResponseObject(o,callback.argument);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
-else{callback.failure.apply(callback.scope,[responseObject]);}}}}
-catch(e){}}
+else{callback.failure.apply(callback.scope,[responseObject]);}}}
+this.failureEvent.fire(responseObject);if(o.failureEvent){o.failureEvent.fire(responseObject);}}
 this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg)
 {var obj={};var headerObj={};try
 {var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}
 catch(e){}
-obj.tId=o.tId;obj.status=o.conn.status;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;}
+obj.tId=o.tId;obj.status=(o.conn.status==1223)?204:o.conn.status;obj.statusText=(o.conn.status==1223)?"No Content":o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof callbackArg!==undefined){obj.argument=callbackArg;}
 return obj;},createExceptionObject:function(tId,callbackArg,isAbort)
 {var COMM_CODE=0;var COMM_ERROR='communication failure';var ABORT_CODE=-1;var ABORT_ERROR='transaction aborted';var obj={};obj.tId=tId;if(isAbort){obj.status=ABORT_CODE;obj.statusText=ABORT_ERROR;}
 else{obj.status=COMM_CODE;obj.statusText=COMM_ERROR;}
 if(callbackArg){obj.argument=callbackArg;}
-return obj;},initHeader:function(label,value)
-{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;},setHeader:function(o)
-{for(var prop in this._http_header){if(this._http_header.hasOwnProperty(prop)){o.conn.setRequestHeader(prop,this._http_header[prop]);}}
-delete this._http_header;this._http_header={};this._has_http_headers=false;},setForm:function(formId,isUpload,secureUri)
+return obj;},initHeader:function(label,value,isDefault)
+{var headerObj=(isDefault)?this._default_headers:this._http_headers;if(headerObj[label]===undefined){headerObj[label]=value;}
+else{headerObj[label]=value+","+headerObj[label];}
+if(isDefault){this._has_default_headers=true;}
+else{this._has_http_headers=true;}},setHeader:function(o)
+{if(this._has_default_headers){for(var prop in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,prop)){o.conn.setRequestHeader(prop,this._default_headers[prop]);}}}
+if(this._has_http_headers){for(var prop in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,prop)){o.conn.setRequestHeader(prop,this._http_headers[prop]);}}
+delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(formId,isUpload,secureUri)
 {this.resetFormState();var oForm;if(typeof formId=='string'){oForm=(document.getElementById(formId)||document.forms[formId]);}
 else if(typeof formId=='object'){oForm=formId;}
 else{return;}
-if(isUpload){this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
+if(isUpload){var io=this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
 var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oElement=oForm.elements[i];oDisabled=oForm.elements[i].disabled;oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)
 {switch(oElement.type)
 {case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text)+'&';}
 else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text)+'&';}}}
 break;case'radio':case'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
-break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit==false){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);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';}
+break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+'&';}
+else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
+hasSubmit=true;}
+break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}}}
+this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(secureUri){var frameId='yuiIO'+this._transaction_id;var io;if(window.ActiveXObject){io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=='boolean'){io.src='javascript:false';}
 else if(typeof secureURI=='string'){io.src=secureUri;}}
-else{var io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
+else{io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
 io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)
 {var formElements=[];var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}
-return formElements;},uploadFile:function(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';}
-else{this._formNode.enctype='multipart/form-data';}
+return formElements;},uploadFile:function(o,callback,uri,postData){var frameId='yuiIO'+o.tId;var uploadEncoding='multipart/form-data';var io=document.getElementById(frameId);var oConn=this;var rawFormAttributes={action:this._formNode.getAttribute('action'),method:this._formNode.getAttribute('method'),target:this._formNode.getAttribute('target')};this._formNode.setAttribute('action',uri);this._formNode.setAttribute('method','POST');this._formNode.setAttribute('target',frameId);if(this._formNode.encoding){this._formNode.setAttribute('encoding',uploadEncoding);}
+else{this._formNode.setAttribute('enctype',uploadEncoding);}
 if(postData){var oElements=this.appendPostData(postData);}
-this._formNode.submit();if(oElements&&oElements.length>0){try
-{for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
-catch(e){}}
+this._formNode.submit();this.startEvent.fire(o);if(o.startEvent){o.startEvent.fire(o);}
+if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
+if(oElements&&oElements.length>0){for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
+for(var prop in rawFormAttributes){if(YAHOO.lang.hasOwnProperty(rawFormAttributes,prop)){if(rawFormAttributes[prop]){this._formNode.setAttribute(prop,rawFormAttributes[prop]);}
+else{this._formNode.removeAttribute(prop);}}}
 this.resetFormState();var uploadCallback=function()
-{var obj={};obj.tId=id;obj.argument=callback.argument;try
-{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;}
+{if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
+oConn.completeEvent.fire(o);if(o.completeEvent){o.completeEvent.fire(o);}
+var obj={};obj.tId=o.tId;obj.argument=callback.argument;try
+{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:io.contentWindow.document.documentElement.textContent;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}
 catch(e){}
-if(callback.upload){if(!callback.scope){callback.upload(obj);}
+if(callback&&callback.upload){if(!callback.scope){callback.upload(obj);}
 else{callback.upload.apply(callback.scope,[obj]);}}
+oConn.uploadEvent.fire(obj);if(o.uploadEvent){o.uploadEvent.fire(obj);}
 if(YAHOO.util.Event){YAHOO.util.Event.removeListener(io,"load",uploadCallback);}
 else if(window.detachEvent){io.detachEvent('onload',uploadCallback);}
 else{io.removeEventListener('load',uploadCallback,false);}
-setTimeout(function(){document.body.removeChild(io);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}
+setTimeout(function(){document.body.removeChild(io);oConn.releaseObject(o);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}
 else if(window.attachEvent){io.attachEvent('onload',uploadCallback);}
 else{io.addEventListener('load',uploadCallback,false);}},abort:function(o,callback,isTimeout)
-{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];}
-this.handleTransactionResponse(o,callback,true);return true;}
-else{return false;}},isCallInProgress:function(o)
-{if(o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}
+{var abortStatus;if(o.conn){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
+abortStatus=true;}}
+else if(o.isUpload===true){var frameId='yuiIO'+o.tId;var io=document.getElementById(frameId);if(io){document.body.removeChild(io);if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
+abortStatus=true;}}
+else{abortStatus=false;}
+if(abortStatus===true){this.abortEvent.fire(o);if(o.abortEvent){o.abortEvent.fire(o);}
+this.handleTransactionResponse(o,callback,true);}
+else{}
+return abortStatus;},isCallInProgress:function(o)
+{if(o&&o.conn){return o.conn.readyState!==4&&o.conn.readyState!==0;}
+else if(o&&o.isUpload===true){var frameId='yuiIO'+o.tId;return document.getElementById(frameId)?true:false;}
 else{return false;}},releaseObject:function(o)
-{o.conn=null;o=null;}};
\ No newline at end of file
+{if(o.conn){o.conn=null;}
+o=null;}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.3.0",build:"442"});
\ No newline at end of file
index 249773e8e74c3af8ae8d6a181a6f9dd43995b03b..a7035ed203eaae322033168eaff188cd7e12d2c2 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 /**
  * The Connection Manager provides a simplified interface to the XMLHttpRequest
@@ -13,6 +13,7 @@ version: 0.12.2
  * @namespace YAHOO.util
  * @module connection
  * @requires yahoo
+ * @requires event
  */
 
 /**
@@ -21,6 +22,7 @@ version: 0.12.2
  *
  * @class Connect
  */
+
 YAHOO.util.Connect =
 {
   /**
@@ -43,7 +45,7 @@ YAHOO.util.Connect =
    * @static
    * @type object
    */
-       _http_header:{},
+       _http_headers:{},
 
   /**
    * @description Determines if HTTP headers are set.
@@ -69,14 +71,57 @@ YAHOO.util.Connect =
  /**
   * @description 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
+  * will be added to client HTTP headers sent for POST
   * transactions.
   * @property _default_post_header
   * @private
   * @static
   * @type boolean
   */
-    _default_post_header:'application/x-www-form-urlencoded',
+    _default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',
+
+ /**
+  * @description Determines if a default header of
+  * 'X-Requested-With: XMLHttpRequest'
+  * will be added to each transaction.
+  * @property _use_default_xhr_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _use_default_xhr_header:true,
+
+ /**
+  * @description The default header value for the label
+  * "X-Requested-With".  This is sent with each
+  * transaction, by default, to identify the
+  * request as being made by YUI Connection Manager.
+  * @property _default_xhr_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_xhr_header:'XMLHttpRequest',
+
+ /**
+  * @description Determines if custom, default headers
+  * are set for each transaction.
+  * @property _has_default_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _has_default_headers:true,
+
+ /**
+  * @description Determines if custom, default headers
+  * are set for each transaction.
+  * @property _has_default_header
+  * @private
+  * @static
+  * @type boolean
+  */
+    _default_headers:{},
 
  /**
   * @description Property modified by setForm() to determine if the data
@@ -156,6 +201,117 @@ YAHOO.util.Connect =
    */
      _transaction_id:0,
 
+  /**
+   * @description Tracks the name-value pair of the "clicked" submit button if multiple submit
+   * buttons are present in an HTML form; and, if YAHOO.util.Event is available.
+   * @property _submitElementValue
+   * @private
+   * @static
+   * @type string
+   */
+        _submitElementValue:null,
+
+  /**
+   * @description Determines whether YAHOO.util.Event is available and returns true or false.
+   * If true, an event listener is bound at the document level to trap click events that
+   * resolve to a target type of "Submit".  This listener will enable setForm() to determine
+   * the clicked "Submit" value in a multi-Submit button, HTML form.
+   * @property _hasSubmitListener
+   * @private
+   * @static
+   */
+        _hasSubmitListener:(function()
+        {
+               if(YAHOO.util.Event){
+                       YAHOO.util.Event.addListener(
+                               document,
+                               'click',
+                               function(e){
+                                       var obj = YAHOO.util.Event.getTarget(e);
+                                       if(obj.type == 'submit'){
+                                               YAHOO.util.Connect._submitElementValue = encodeURIComponent(obj.name) + "=" + encodeURIComponent(obj.value);
+                                       }
+                               });
+                       return true;
+           }
+           return false;
+        })(),
+
+  /**
+   * @description Custom event that fires at the start of a transaction
+   * @property startEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       startEvent: new YAHOO.util.CustomEvent('start'),
+
+  /**
+   * @description Custom event that fires when a transaction response has completed.
+   * @property completeEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       completeEvent: new YAHOO.util.CustomEvent('complete'),
+
+  /**
+   * @description Custom event that fires when handleTransactionResponse() determines a
+   * response in the HTTP 2xx range.
+   * @property successEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       successEvent: new YAHOO.util.CustomEvent('success'),
+
+  /**
+   * @description Custom event that fires when handleTransactionResponse() determines a
+   * response in the HTTP 4xx/5xx range.
+   * @property failureEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       failureEvent: new YAHOO.util.CustomEvent('failure'),
+
+  /**
+   * @description Custom event that fires when handleTransactionResponse() determines a
+   * response in the HTTP 4xx/5xx range.
+   * @property failureEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       uploadEvent: new YAHOO.util.CustomEvent('upload'),
+
+  /**
+   * @description Custom event that fires when a transaction is successfully aborted.
+   * @property abortEvent
+   * @private
+   * @static
+   * @type CustomEvent
+   */
+       abortEvent: new YAHOO.util.CustomEvent('abort'),
+
+  /**
+   * @description A reference table that maps callback custom events members to its specific
+   * event name.
+   * @property _customEvents
+   * @private
+   * @static
+   * @type object
+   */
+       _customEvents:
+       {
+               onStart:['startEvent', 'start'],
+               onComplete:['completeEvent', 'complete'],
+               onSuccess:['successEvent', 'success'],
+               onFailure:['failureEvent', 'failure'],
+               onUpload:['uploadEvent', 'upload'],
+               onAbort:['abortEvent', 'abort']
+       },
+
   /**
    * @description 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
@@ -184,6 +340,19 @@ YAHOO.util.Connect =
                this._use_default_post_header = b;
        },
 
+  /**
+   * @description Member to enable or disable the default POST header.
+   * @method setDefaultXhrHeader
+   * @public
+   * @static
+   * @param {boolean} b Set and use default header - true or false .
+   * @return void
+   */
+       setDefaultXhrHeader:function(b)
+       {
+               this._use_default_xhr_header = b;
+       },
+
   /**
    * @description Member to modify the default polling interval.
    * @method setPollingInterval
@@ -247,14 +416,22 @@ YAHOO.util.Connect =
    * @static
    * @return {object}
    */
-       getConnectionObject:function()
+       getConnectionObject:function(isFileUpload)
        {
                var o;
                var tId = this._transaction_id;
 
                try
                {
-                       o = this.createXhrObject(tId);
+                       if(!isFileUpload){
+                               o = this.createXhrObject(tId);
+                       }
+                       else{
+                               o = {};
+                               o.tId = tId;
+                               o.isUpload = true;
+                       }
+
                        if(o){
                                this._transaction_id++;
                        }
@@ -279,25 +456,29 @@ YAHOO.util.Connect =
    */
        asyncRequest:function(method, uri, callback, postData)
        {
-               var o = this.getConnectionObject();
+               var o = (this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();
 
                if(!o){
                        return null;
                }
                else{
+
+                       // Intialize any transaction-specific custom events, if provided.
+                       if(callback && callback.customevents){
+                               this.initCustomEvents(o, callback);
+                       }
+
                        if(this._isFormSubmit){
                                if(this._isFileUpload){
-                                       this.uploadFile(o.tId, callback, uri, postData);
-                                       this.releaseObject(o);
-
-                                       return;
+                                       this.uploadFile(o, callback, uri, postData);
+                                       return o;
                                }
 
-                               //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'){
-                                       if(this._sFormData.length != 0){
+                               // 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.toUpperCase() == 'GET'){
+                                       if(this._sFormData.length !== 0){
                                                // If the URI already contains a querystring, append an ampersand
                                                // and then concatenate _sFormData to the URI.
                                                uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;
@@ -306,14 +487,24 @@ YAHOO.util.Connect =
                                                uri += "?" + this._sFormData;
                                        }
                                }
-                               else if(method == 'POST'){
-                                       //If POST data exist in addition to the HTML form data,
-                                       //it will be concatenated to the form data.
+                               else if(method.toUpperCase() == 'POST'){
+                                       // If POST data exist in addition to the HTML form data,
+                                       // it will be concatenated to the form data.
                                        postData = postData?this._sFormData + "&" + postData:this._sFormData;
                                }
                        }
 
                        o.conn.open(method, uri, true);
+                       //this.processTransactionHeaders(o);
+
+                       // Each transaction will automatically include a custom header of
+                       // "X-Requested-With: XMLHttpRequest" to identify the request as
+                       // having originated from Connection Manager.
+                       if(this._use_default_xhr_header){
+                               if(!this._default_headers['X-Requested-With']){
+                                       this.initHeader('X-Requested-With', this._default_xhr_header, true);
+                               }
+                       }
 
                        if(this._isFormSubmit || (postData && this._use_default_post_header)){
                                this.initHeader('Content-Type', this._default_post_header);
@@ -322,17 +513,50 @@ YAHOO.util.Connect =
                                }
                        }
 
-                       if(this._has_http_headers){
+                       if(this._has_default_headers || this._has_http_headers){
                                this.setHeader(o);
                        }
 
                        this.handleReadyState(o, callback);
                        o.conn.send(postData || null);
 
+                       // Fire global custom event -- startEvent
+                       this.startEvent.fire(o);
+
+                       if(o.startEvent){
+                               // Fire transaction custom event -- startEvent
+                               o.startEvent.fire(o);
+                       }
+
                        return o;
                }
        },
 
+  /**
+   * @description This method creates and subscribes custom events,
+   * specific to each transaction
+   * @method initCustomEvents
+   * @private
+   * @static
+   * @param {object} o The connection object
+   * @param {callback} callback The user-defined callback object
+   * @return {void}
+   */
+       initCustomEvents:function(o, callback)
+       {
+               // Enumerate through callback.customevents members and bind/subscribe
+               // events that match in the _customEvents table.
+               for(var prop in callback.customevents){
+                       if(this._customEvents[prop][0]){
+                               // Create the custom event
+                               o[this._customEvents[prop][0]] = new YAHOO.util.CustomEvent(this._customEvents[prop][1], (callback.scope)?callback.scope:null);
+
+                               // Subscribe the custom event
+                               o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);
+                       }
+               }
+       },
+
   /**
    * @description This method serves as a timer that polls the XHR object's readyState
    * property during a transaction, instead of binding a callback to the
@@ -345,7 +569,9 @@ YAHOO.util.Connect =
    * @param {callback} callback The user-defined callback object
    * @return {void}
    */
+
     handleReadyState:function(o, callback)
+
     {
                var oConn = this;
 
@@ -355,14 +581,26 @@ YAHOO.util.Connect =
 
                this._poll[o.tId] = window.setInterval(
                        function(){
-                               if(o.conn && o.conn.readyState == 4){
+                               if(o.conn && o.conn.readyState === 4){
+
+                                       // Clear the polling interval for the transaction
+                                       // and remove the reference from _poll.
                                        window.clearInterval(oConn._poll[o.tId]);
                                        delete oConn._poll[o.tId];
 
                                        if(callback && callback.timeout){
+                                               window.clearTimeout(oConn._timeOut[o.tId]);
                                                delete oConn._timeOut[o.tId];
                                        }
 
+                                       // Fire global custom event -- completeEvent
+                                       oConn.completeEvent.fire(o);
+
+                                       if(o.completeEvent){
+                                               // Fire transaction custom event -- completeEvent
+                                               o.completeEvent.fire(o);
+                                       }
+
                                        oConn.handleTransactionResponse(o, callback);
                                }
                        }
@@ -377,8 +615,8 @@ YAHOO.util.Connect =
    * @private
    * @static
    * @param {object} o The connection object
-   * @param {object} callback The sser-defined callback object
-   * @param {boolean} isAbort Determines if the transaction was aborted.
+   * @param {object} callback The user-defined callback object
+   * @param {boolean} isAbort Determines if the transaction was terminated via abort().
    * @return {void}
    */
     handleTransactionResponse:function(o, callback, isAbort)
@@ -393,7 +631,7 @@ YAHOO.util.Connect =
 
                try
                {
-                       if(o.conn.status !== undefined && o.conn.status != 0){
+                       if(o.conn.status !== undefined && o.conn.status !== 0){
                                httpStatus = o.conn.status;
                        }
                        else{
@@ -401,63 +639,73 @@ YAHOO.util.Connect =
                        }
                }
                catch(e){
-                       // 13030 is the custom code to indicate the condition -- in Mozilla/FF --
-                       // when the o object's status and statusText properties are
-                       // unavailable, and a query attempt throws an exception.
+
+                        // 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){
-                       try
-                       {
-                               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]);
-                                       }
+               if(httpStatus >= 200 && httpStatus < 300 || httpStatus === 1223){
+                       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]);
                                }
                        }
-                       catch(e){}
+
+                       // Fire global custom event -- successEvent
+                       this.successEvent.fire(responseObject);
+
+                       if(o.successEvent){
+                               // Fire transaction custom event -- successEvent
+                               o.successEvent.fire(responseObject);
+                       }
                }
                else{
-                       try
-                       {
-                               switch(httpStatus){
-                                       // The following cases are wininet.dll error codes that may be encountered.
-                                       case 12002: // Server timeout
-                                       case 12029: // 12029 to 12031 correspond to dropped connections.
-                                       case 12030:
-                                       case 12031:
-                                       case 12152: // Connection closed by server.
-                                       case 13030: // See above comments for variable status.
-                                               responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort?isAbort:false));
-                                               if(callback.failure){
-                                                       if(!callback.scope){
-                                                               callback.failure(responseObject);
-                                                       }
-                                                       else{
-                                                               callback.failure.apply(callback.scope, [responseObject]);
-                                                       }
+                       switch(httpStatus){
+                               // The following cases are wininet.dll error codes that may be encountered.
+                               case 12002: // Server timeout
+                               case 12029: // 12029 to 12031 correspond to dropped connections.
+                               case 12030:
+                               case 12031:
+                               case 12152: // Connection closed by server.
+                               case 13030: // See above comments for variable status.
+                                       responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort?isAbort:false));
+                                       if(callback.failure){
+                                               if(!callback.scope){
+                                                       callback.failure(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]);
-                                                       }
+                                               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]);
+                                               }
+                                       }
                        }
-                       catch(e){}
+
+                       // Fire global custom event -- failureEvent
+                       this.failureEvent.fire(responseObject);
+
+                       if(o.failureEvent){
+                               // Fire transaction custom event -- failureEvent
+                               o.failureEvent.fire(responseObject);
+                       }
+
                }
 
                this.releaseObject(o);
@@ -494,8 +742,10 @@ YAHOO.util.Connect =
                catch(e){}
 
                obj.tId = o.tId;
-               obj.status = o.conn.status;
-               obj.statusText = o.conn.statusText;
+               // Normalize IE's response to HTTP 204 when Win error 1223.
+               obj.status = (o.conn.status == 1223)?204:o.conn.status;
+               // Normalize IE's statusText to "No Content" instead of "Unknown".
+               obj.statusText = (o.conn.status == 1223)?"No Content":o.conn.statusText;
                obj.getResponseHeader = headerObj;
                obj.getAllResponseHeaders = headerStr;
                obj.responseText = o.conn.responseText;
@@ -551,28 +801,38 @@ YAHOO.util.Connect =
     },
 
   /**
-   * @description Public method that stores the custom HTTP headers for each transaction.
+   * @description Method that initializes the custom HTTP headers for the each transaction.
    * @method initHeader
    * @public
    * @static
    * @param {string} label The HTTP header label
    * @param {string} value The HTTP header value
+   * @param {string} isDefault Determines if the specific header is a default header
+   * automatically sent with each transaction.
    * @return {void}
    */
-       initHeader:function(label,value)
+       initHeader:function(label,value,isDefault)
        {
-               if(this._http_header[label] === undefined){
-                       this._http_header[label] = value;
+               var headerObj = (isDefault)?this._default_headers:this._http_headers;
+
+               if(headerObj[label] === undefined){
+                       headerObj[label] = value;
                }
                else{
                        // Concatenate multiple values, comma-delimited,
                        // for the same header label,
-                       this._http_header[label] =  value + "," + this._http_header[label];
+                       headerObj[label] =  value + "," + headerObj[label];
                }
 
-               this._has_http_headers = true;
+               if(isDefault){
+                       this._has_default_headers = true;
+               }
+               else{
+                       this._has_http_headers = true;
+               }
        },
 
+
   /**
    * @description Accessor that sets the HTTP headers for each transaction.
    * @method setHeader
@@ -583,29 +843,51 @@ YAHOO.util.Connect =
    */
        setHeader:function(o)
        {
-               for(var prop in this._http_header){
-                       if(this._http_header.hasOwnProperty(prop)){
-                               o.conn.setRequestHeader(prop, this._http_header[prop]);
+               if(this._has_default_headers){
+                       for(var prop in this._default_headers){
+                               if(YAHOO.lang.hasOwnProperty(this._default_headers, prop)){
+                                       o.conn.setRequestHeader(prop, this._default_headers[prop]);
+                               }
                        }
                }
-               delete this._http_header;
 
-               this._http_header = {};
-               this._has_http_headers = false;
+               if(this._has_http_headers){
+                       for(var prop in this._http_headers){
+                               if(YAHOO.lang.hasOwnProperty(this._http_headers, prop)){
+                                       o.conn.setRequestHeader(prop, this._http_headers[prop]);
+                               }
+                       }
+                       delete this._http_headers;
+
+                       this._http_headers = {};
+                       this._has_http_headers = false;
+               }
+       },
+
+  /**
+   * @description Resets the default HTTP headers object
+   * @method resetDefaultHeaders
+   * @public
+   * @static
+   * @return {void}
+   */
+       resetDefaultHeaders:function(){
+               delete this._default_headers;
+               this._default_headers = {};
+               this._has_default_headers = false;
        },
 
   /**
    * @description 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.
+   * asyncRequest() will automatically initialize the transaction with a
+   * a HTTP header Content-Type of application/x-www-form-urlencoded.
    * @method setForm
    * @public
    * @static
    * @param {string || object} form id or name attribute, or form object.
-   * @param {string} optional boolean to indicate SSL environment.
-   * @param {string || boolean} optional qualified path of iframe resource for SSL in IE.
+   * @param {boolean} optional enable file upload.
+   * @param {boolean} optional enable file upload over SSL in IE only.
    * @return {string} string of the HTML form field name and value pairs..
    */
        setForm:function(formId, isUpload, secureUri)
@@ -614,7 +896,7 @@ YAHOO.util.Connect =
                var oForm;
                if(typeof formId == 'string'){
                        // Determine if the argument is a form id or a form name.
-                       // Note form name usage is deprecated but supported
+                       // Note form name usage is deprecated by supported
                        // here for legacy reasons.
                        oForm = (document.getElementById(formId) || document.forms[formId]);
                }
@@ -635,14 +917,14 @@ YAHOO.util.Connect =
                if(isUpload){
 
                        // Create iframe in preparation for file upload.
-                       this.createFrame(secureUri?secureUri:null);
-
+                       var io = this.createFrame(secureUri?secureUri:null);
                        // Set form reference and file upload properties to true.
                        this._isFormSubmit = true;
                        this._isFileUpload = true;
                        this._formNode = oForm;
 
                        return;
+
                }
 
                var oElement, oName, oValue, oDisabled;
@@ -660,7 +942,7 @@ YAHOO.util.Connect =
                        // do not have a name attribute value.
                        if(!oDisabled && oName)
                        {
-                               switch (oElement.type)
+                               switch(oElement.type)
                                {
                                        case 'select-one':
                                        case 'select-multiple':
@@ -672,7 +954,6 @@ YAHOO.util.Connect =
                                                                else{
                                                                        this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text) + '&';
                                                                }
-
                                                        }
                                                }
                                                break;
@@ -692,14 +973,19 @@ YAHOO.util.Connect =
                                                // stub case for input type button elements.
                                                break;
                                        case 'submit':
-                                               if(hasSubmit == false){
-                                                       this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
+                                               if(hasSubmit === false){
+                                                       if(this._hasSubmitListener && this._submitElementValue){
+                                                               this._sFormData += this._submitElementValue + '&';
+                                                       }
+                                                       else{
+                                                               this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
+                                                       }
+
                                                        hasSubmit = true;
                                                }
                                                break;
                                        default:
                                                this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oValue) + '&';
-                                               break;
                                }
                        }
                }
@@ -707,6 +993,7 @@ YAHOO.util.Connect =
                this._isFormSubmit = true;
                this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
 
+
                return this._sFormData;
        },
 
@@ -731,7 +1018,7 @@ YAHOO.util.Connect =
    * @method createFrame
    * @private
    * @static
-   * @param {string} secureUri Optional qualified path of iframe resource for SSL in IE.
+   * @param {string} optional qualified path of iframe resource for SSL in IE.
    * @return {void}
    */
        createFrame:function(secureUri){
@@ -740,8 +1027,9 @@ YAHOO.util.Connect =
                // properties via createElement().  A different iframe creation
                // pattern is required for IE.
                var frameId = 'yuiIO' + this._transaction_id;
+               var io;
                if(window.ActiveXObject){
-                       var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
+                       io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
 
                        // IE will throw a security exception in an SSL environment if the
                        // iframe source is undefined.
@@ -754,7 +1042,7 @@ YAHOO.util.Connect =
                        }
                }
                else{
-                       var io = document.createElement('iframe');
+                       io = document.createElement('iframe');
                        io.id = frameId;
                        io.name = frameId;
                }
@@ -794,75 +1082,125 @@ YAHOO.util.Connect =
        },
 
   /**
-   * @description Uploads HTML form, including files/attachments, to the
-   * iframe created in createFrame.
+   * @description Uploads HTML form, inclusive of files/attachments, using the
+   * iframe created in createFrame to facilitate the transaction.
    * @method uploadFile
    * @private
    * @static
    * @param {int} id The transaction id.
-   * @param {object} callback User-defined callback object.
+   * @param {object} callback User-defined callback object.
    * @param {string} uri Fully qualified path of resource.
+   * @param {string} postData POST data to be submitted in addition to HTML form.
    * @return {void}
    */
-       uploadFile:function(id, callback, uri, postData){
+       uploadFile:function(o, callback, uri, postData){
 
                // Each iframe has an id prefix of "yuiIO" followed
                // by the unique transaction id.
-               var frameId = 'yuiIO' + id;
+               var frameId = 'yuiIO' + o.tId;
+               var uploadEncoding = 'multipart/form-data';
                var io = document.getElementById(frameId);
+               var oConn = this;
+
+               // Track original HTML form attribute values.
+               var rawFormAttributes =
+               {
+                       action:this._formNode.getAttribute('action'),
+                       method:this._formNode.getAttribute('method'),
+                       target:this._formNode.getAttribute('target')
+               };
 
                // Initialize the HTML form properties in case they are
                // not defined in the HTML form.
-               this._formNode.action = uri;
-               this._formNode.method = 'POST';
-               this._formNode.target = frameId;
+               this._formNode.setAttribute('action', uri);
+               this._formNode.setAttribute('method', 'POST');
+               this._formNode.setAttribute('target', frameId);
 
                if(this._formNode.encoding){
                        // IE does not respect property enctype for HTML forms.
-                       // Instead use property encoding.
-                       this._formNode.encoding = 'multipart/form-data';
+                       // Instead it uses the property - "encoding".
+                       this._formNode.setAttribute('encoding', uploadEncoding);
                }
                else{
-                       this._formNode.enctype = 'multipart/form-data';
+                       this._formNode.setAttribute('enctype', uploadEncoding);
                }
 
                if(postData){
                        var oElements = this.appendPostData(postData);
                }
 
+               // Start file upload.
                this._formNode.submit();
 
+               // Fire global custom event -- startEvent
+               this.startEvent.fire(o);
+
+               if(o.startEvent){
+                       // Fire transaction custom event -- startEvent
+                       o.startEvent.fire(o);
+               }
+
+               // Start polling if a callback is present and the timeout
+               // property has been defined.
+               if(callback && callback.timeout){
+                       this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
+               }
+
+               // Remove HTML elements created by appendPostData
                if(oElements && oElements.length > 0){
-                       try
-                       {
-                               for(var i=0; i < oElements.length; i++){
-                                       this._formNode.removeChild(oElements[i]);
+                       for(var i=0; i < oElements.length; i++){
+                               this._formNode.removeChild(oElements[i]);
+                       }
+               }
+
+               // Restore HTML form attributes to their original
+               // values prior to file upload.
+               for(var prop in rawFormAttributes){
+                       if(YAHOO.lang.hasOwnProperty(rawFormAttributes, prop)){
+                               if(rawFormAttributes[prop]){
+                                       this._formNode.setAttribute(prop, rawFormAttributes[prop]);
+                               }
+                               else{
+                                       this._formNode.removeAttribute(prop);
                                }
                        }
-                       catch(e){}
                }
 
-               // Reset HTML form status properties.
+               // Reset HTML form state properties.
                this.resetFormState();
 
                // 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()
                {
+                       if(callback && callback.timeout){
+                               window.clearTimeout(oConn._timeOut[o.tId]);
+                               delete oConn._timeOut[o.tId];
+                       }
+
+                       // Fire global custom event -- completeEvent
+                       oConn.completeEvent.fire(o);
+
+                       if(o.completeEvent){
+                               // Fire transaction custom event -- completeEvent
+                               o.completeEvent.fire(o);
+                       }
+
                        var obj = {};
-                       obj.tId = id;
+                       obj.tId = o.tId;
                        obj.argument = callback.argument;
 
                        try
                        {
-                               obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
+                               // responseText and responseXML will be populated with the same data from the iframe.
+                               // Since the HTTP headers cannot be read from the iframe
+                               obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:io.contentWindow.document.documentElement.textContent;
                                obj.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
                        }
                        catch(e){}
 
-                       if(callback.upload){
+                       if(callback && callback.upload){
                                if(!callback.scope){
                                        callback.upload(obj);
                                }
@@ -871,6 +1209,14 @@ YAHOO.util.Connect =
                                }
                        }
 
+                       // Fire global custom event -- completeEvent
+                       oConn.uploadEvent.fire(obj);
+
+                       if(o.uploadEvent){
+                               // Fire transaction custom event -- completeEvent
+                               o.uploadEvent.fire(obj);
+                       }
+
                        if(YAHOO.util.Event){
                                YAHOO.util.Event.removeListener(io, "load", uploadCallback);
                        }
@@ -880,10 +1226,13 @@ YAHOO.util.Connect =
                        else{
                                io.removeEventListener('load', uploadCallback, false);
                        }
-                       setTimeout(function(){ document.body.removeChild(io); }, 100);
+                       setTimeout(
+                               function(){
+                                       document.body.removeChild(io);
+                                       oConn.releaseObject(o);
+                               }, 100);
                };
 
-
                // Bind the onload handler to the iframe to detect the file upload response.
                if(YAHOO.util.Event){
                        YAHOO.util.Event.addListener(io, "load", uploadCallback);
@@ -903,26 +1252,64 @@ YAHOO.util.Connect =
    * @static
    * @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.
+   * @param {string} isTimeout boolean to indicate if abort resulted from a callback timeout.
    * @return {boolean}
    */
        abort:function(o, callback, isTimeout)
        {
-               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];
+               var abortStatus;
+
+               if(o.conn){
+                       if(this.isCallInProgress(o)){
+                               // Issue abort request
+                               o.conn.abort();
+
+                               window.clearInterval(this._poll[o.tId]);
+                               delete this._poll[o.tId];
+
+                               if(isTimeout){
+                                       window.clearTimeout(this._timeOut[o.tId]);
+                                       delete this._timeOut[o.tId];
+                               }
+
+                               abortStatus = true;
                        }
+               }
+               else if(o.isUpload === true){
+                       var frameId = 'yuiIO' + o.tId;
+                       var io = document.getElementById(frameId);
 
-                       this.handleTransactionResponse(o, callback, true);
+                       if(io){
+                               // Destroy the iframe facilitating the transaction.
+                               document.body.removeChild(io);
 
-                       return true;
+                               if(isTimeout){
+                                       window.clearTimeout(this._timeOut[o.tId]);
+                                       delete this._timeOut[o.tId];
+                               }
+
+                               abortStatus = true;
+                       }
                }
                else{
-                       return false;
+                       abortStatus = false;
                }
+
+               if(abortStatus === true){
+                       // Fire global custom event -- abortEvent
+                       this.abortEvent.fire(o);
+
+                       if(o.abortEvent){
+                               // Fire transaction custom event -- abortEvent
+                               o.abortEvent.fire(o);
+                       }
+
+                       this.handleTransactionResponse(o, callback, true);
+               }
+               else{
+               }
+
+               return abortStatus;
        },
 
   /**
@@ -938,11 +1325,14 @@ YAHOO.util.Connect =
        {
                // 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;
+               if(o && o.conn){
+                       return o.conn.readyState !== 4 && o.conn.readyState !== 0;
+               }
+               else if(o && o.isUpload === true){
+                       var frameId = 'yuiIO' + o.tId;
+                       return document.getElementById(frameId)?true:false;
                }
                else{
-                       //The XHR object has been destroyed.
                        return false;
                }
        },
@@ -958,8 +1348,12 @@ YAHOO.util.Connect =
        releaseObject:function(o)
        {
                //dereference the XHR instance.
-               o.conn = null;
+               if(o.conn){
+                       o.conn = null;
+               }
                //dereference the connection object.
                o = null;
        }
-};
\ No newline at end of file
+};
+
+YAHOO.register("connection", YAHOO.util.Connect, {version: "2.3.0", build: "442"});
index c3801da65705047be73370d44c41426fec75aac0..4cf23257e77573ca28acb8a72d4ab98cf408cd53 100755 (executable)
 Container Release Notes
 
+*** version 2.3.0 ***
+
+Fixed the following bugs:
+-------------------------
+
++ Improved creation of the <iframe> element used to monitor changes to the 
+  browser's font size so that:
+  
+    - Safari's status bar no longer displays a "Loading..." message after the 
+      page has loaded.
+  
+    - Firefox no longer reports duplicate cookie information.
+    
+    - The browser scrollbars no longer flash on and off in Firefox.
+
++ It is now possible to set the "button" configuration property of a 
+  YAHOO.widget.Dialog instance after it has be rendered.
+
++ Form elements appended to a YAHOO.widget.Dialog instance via the "setBody"
+  method are now automatically registered using the "registerForm" method.
+
++ The "focusFirst" method of YAHOO.widget.Dialog will no longer result in a 
+  JavaScript error in IE if the first element in the Dialog instance's form
+  is a radio button.
+
++ YAHOO.widget.Panel instances whose "draggable" property is set to "true" and
+  "width" property is set to "auto" are now able to be dragged in IE 6 (Quirks
+  and Strict Mode) and IE 7 Quirks Mode.
+
++ Updated focus methods of YAHOO.widget.Dialog to prevent JavaScript errors 
+  that result from trying to set focus to elements that hidden or disabled.
+
++ Pressing the enter key will no longer result in a YAHOO.widget.Dialog 
+  instance's "validate" method being called twice.
+
++ Pressing the enter key while focused on a form field inside a Dialog will no
+  longer trigger the "click" event handler defined by the Dialog's default 
+  button in IE and Firefox.
+
++ Pressing the enter key when focused on a form field inside a 
+  YAHOO.widget.Dialog instance with no buttons created via its "buttons" 
+  configuration property will no longer result in a JavaScript error.
+
++ Aqua scrollbars will no longer bleed through Container widgets in Firefox
+  for Mac OS X.
+
++ The "width" and "height" configuration properties of YAHOO.widget.Overlay
+  now supersede the "fixedcenter" and "context" configuration properties to 
+  ensure correct positioning of Overlay instances using the "fixedcenter" 
+  and "context" configuration properties.
+
++ Calling the "destroy" method on a YAHOO.widget.Overlay instance no longer 
+  results in a JavaScript error on the subsequent focus of another 
+  Overlay instance.
+
++ YAHOO.widget.Tooltip instances without a value specified for the "width" 
+  configuration property will be rendered at a width equal to the offsetWidth
+  of their root <DIV/> element to prevent their width from being clipped or 
+  constrained by their parent HTML element.
+
+
+Changes:
+--------
+
++ Rendering of YAHOO.widget.Tooltip instances is now deferred using the 
+  "onDOMReady" event handler of YAHOO.util.Event rather than waiting until 
+  the "load" event of the Tooltip's parent window fires.
+
++ Deprecated "browser" property of YAHOO.widget.Module in favor 
+  of YAHOO.env.ua.
+
++ The "moveEvent" of a YAHOO.widget.Panel instance now also fires with the 
+  "endDrag" event of the its YAHOO.util.DD instance.
+
++ Updated modal functionality of YAHOO.widget.Panel:
+    
+    - The creation of a Panel instance's modality mask is now deferred until it
+      is initially made visible.
+
+    - Showing a modal Panel instance will now result in the Panel and its 
+      associated modality mask element having a higher z-index than all other
+      YAHOO.widget.Overlay instances and Overlay subclasses.
+
++ Updated the "underlay" configuration property of YAHOO.widget.Panel:
+
+    - The creation of the underlay element is deferred until the Panel
+      instance is initially made visible.
+
+    - For Gecko-based browsers on Mac OS X the underlay elment is always 
+      created as it is used as a shim to prevent Aqua scrollbars below a Panel 
+      instance from poking through it.
+
+    - For IE 7 (Quirks Mode) and IE 6 (Quirks Mode and Standard Mode) the 
+      underlay element is resized in response to a change to a Panel instance's 
+      "width" or "height" configuration properties, a change to the browser's 
+      font size or the firing of the contentChangedEvent (triggered by use of  
+      the "setHeader," "appendToHeader," "setBody," "appendToBody," 
+      "setFooter," or "appendToFooter" methods). 
+
++ Updated the "iframe" configuration property of YAHOO.widget.Overlay:
+
+    - The creation of the <iframe> shim element is deferred until the Overlay
+      instance is initially made visible.
+
+    - The <iframe> shim element is resized when a change to an Overlay 
+      instance's content is made at runtime via the "setHeader," 
+      "appendToHeader," "setBody," "appendToBody," "setFooter," or 
+      "appendToFooter" methods.
+
++ Updated the "buttons" configuration property of YAHOO.widget.Dialog:
+
+    - YAHOO.widget.Button is now an optional dependancy, and if included, each
+      button in a Dialog will be an instance of Button.
+
+    - The "text" property of each button now accepts HTML
+    
+    - The "handler" property of each button can now be set to:
+    
+        + A reference to a function that should fire when the button is 
+          clicked.  (In this case scope of this function is always its 
+          Dialog instance.)
+
+        + An object literal representing the code to be executed when the 
+          button is clicked.  The format is:  
+          {
+            fn: Function (The handler to call when the event fires.),
+            obj: Object (An object to pass back to the handler.),
+            scope: Object (The object to use for the scope of the handler.)
+          }   
+
+
+Added the following features:
+-----------------------------
+
++ Added ability for YAHOO.widget.Tooltip instances to have shadow:
+
+    - The shadow for a Tooltip is implemented by appending a new element as the 
+      last child of its root <DIV/> element:
+
+        <DIV class="yui-tt">
+            <DIV class="bd"> ... </DIV>
+            <DIV class="yui-tt-shadow"/>
+        </DIV>
+
+    - The code that creates the shadow element resides inside the Tooltip's 
+      public "onRender" prototype method.  To disable the creation of a 
+      Tooltip's shadow override the prototype of the "onRender" method:
+      
+      YAHOO.widget.Tooltip.prototype.onRender = function () {};
+      
+    - The actual creation of the shadow element is deferred until the Tooltip 
+      is made visible for the first time.
+
+    - A Tooltip's shadow element can be styled via two CSS classes:
+
+        + "yui-tt-shadow"  - Applied to the shadow element when it is created.
+        + "yui-tt-shadow-visible" - Applied to the shadow element when the  
+          Tooltip is visible; it is removed the Tooltip is hidden.
+
+    - The shadow element is only styled when using the new "Sam" skin, for
+      the previous default skin its "display" property is set to "none."
+
++ Prototype of all classes (Module, Overlay, Panel, Dialog, SimpleDialog,  
+  Tooltip, Config, and ContainerEffect) are augmented with 
+  YAHOO.util.EventProvider, facilitating subscribing to an instance's 
+  Custom Events by name via a "subscribe" method that is a direct member of 
+  the class.  For example:
+  
+    var oOverlay = new YAHOO.widget.Overlay("myoverlay");
+    
+    oOverlay.subscribe("show", onShow);
+
++ Added a new "bringToTop" method to YAHOO.widget.Overlay that places the 
+  Overlay on top of all other Overlay instances.
+
++ Added a new "bringToTop" method to YAHOO.widget.OverlayManager that places 
+  the specified Overlay instance on top of all other Overlay instances.  This 
+  method is called on each Overlay instance that is registered with an 
+  OverlayManager instance.
+
++ Dialog instances are now able to upload files should the Dialog instance's 
+  form contain <input type="file"/> elements.  PLEASE NOTE: If a Dialog 
+  instance will be handling asyncronous file uploads, its "callback" property 
+  will need to be setup with an "upload" handler rather than the standard 
+  "success" and, or "failure" handlers.  For more information, see the 
+  Connection Manager documenation on file uploads:
+  http://developer.yahoo.com/yui/connection/#file
+
++ Added a new "getButtons" method to YAHOO.widget.Dialog that returns an array 
+  containing each of the Dialog's buttons; by default an array of HTML <BUTTON>
+  elements.  If the Dialog's buttons were created using the 
+  YAHOO.widget.Button class (via the inclusion of the optional Button
+  dependancy on the page), an array of YAHOO.widget.Button instances 
+  is returned.
+
++ Added a "destroy" method to YAHOO.util.Config that sets all properties to 
+  null, unsubscribes all listeners from each property's change event and all 
+  listeners from the configChangedEvent.  The "destroy" method of 
+  YAHOO.widget.Module now automatically calls the "destroy" method of its
+  configuation object.
+
++ Added a "IFRAME_OFFSET" constant to YAHOO.widget.Overlay that controls how 
+  much the <iframe> shim should be offset from each side of an 
+  Overlay instance.
+
++ Added a new "syncIframe" method to YAHOO.widget.Overlay that syncronizes the 
+  size and position of the <iframe> shim to that of the Overlay.
+
++ Added a "ICON_CSS_CLASSNAME" constant to YAHOO.widget.SimpleDialog that 
+  represents the name of the CSS class applied to the element created by the 
+  "icon" configuration property.
+
+  
+Known Issues
+------------
+
++ "Sam" skin Panel missing left and right borders when declared with a height
+  ---------------------------------------------------------------------------
+  If the height of a Panel instance exceeds the total height of its header, 
+  body and footer elements, the space not filled with content will lack a left 
+  and right border.  Therefore, to set a Panel instance to a fixed height 
+  when using the "Sam" skin, apply the desired height to the body element, 
+  taking into account the height of the header and footer elements.  To set the 
+  height of a Panel instance's body via CSS:
+  
+  #mypanel .bd {
+    height: 100px;
+  }
+  
+  Or via JavaScript:
+  
+  oMyPanel.body.style.height = "100px";
+
++ Elements with scrollbars poke through Overlay instances floating above them
+  ---------------------------------------------------------------------------
+  There is a bug in Gecko-based browsers for Mac OS X where an element's 
+  scrollbars will poke through absolutely positioned elements floating above
+  them.  To fix this problem the "overflow" property of an Overlay instance's 
+  root element is toggled between "hidden" and "auto" (through the application 
+  and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes) as its 
+  "visibility" configuration property is toggled between "false" and "true."
+  
+  PLEASE NOTE:  
+  
+  1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are 
+     applied only for Gecko on Mac OS X and are added/removed to/from the 
+     Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and 
+     "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.
+     
+  2) For Panel (and its subclasses) it is the underlay element, not the root 
+     element, whose "overflow" property is toggled between "hidden" and "auto."
+     The underlay element therefore acts as a shim to correct the 
+     scrollbar problem.
+     
+  3) For Tooltip instances using the "Sam" skin it is the shadow element, not 
+     the root element, whose "overflow" property is toggled between "hidden" 
+     and "auto."  The shadow element therefore acts as a shim to correct the 
+     scrollbar problem.
+     
+  4) Once the fix is applied the bug will reappear if the window loses focus.  
+     This can be remedied via Javascript by hiding and showing the Overlay 
+     instance when the window receives focus:
+
+        YAHOO.util.Event.on(window, "focus", function () {
+        
+            oMyOverlay.hide();
+            oMyOverlay.show();
+        
+        });
+
+    ** For more information see 
+     https://bugzilla.mozilla.org/show_bug.cgi?id=187435
+
++ Scrollbars remain visible after an Overlay is hidden
+  ----------------------------------------------------
+  There is a bug in Gecko-based browsers for Mac OS X where an element's 
+  scrollbars and the scrollbars of its child nodes remain visible when its 
+  "visibility" property property is set to "hidden."  To fix this problem,
+  the "overflow" property of an Overlay instance's root element and child nodes
+  is toggled between "hidden" and "auto" (through the application and removal 
+  of the "hide-scrollbars" and "show-scrollbars" CSS classes) as its 
+  "visibility" configuration property is toggled between "false" and "true."
+
+  PLEASE NOTE:  
+  
+  1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are 
+     applied only for Gecko on Mac OS X and are added/removed to/from the 
+     Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and 
+     "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.
+  
+  2) There may be instances where the CSS for a web page or application 
+     contains style rules whose specificity override the rules implemented by 
+     the Container CSS files to fix this bug.  In such cases, is necessary to 
+     leverage the provided "hide-scrollbars" and "show-scrollbars" classes to 
+     write custom style rules to guard against this bug.  For example:
+  
+     To fix the scrollbars issue for an Overlay instance with an id of 
+     "myoverlay" whose body element has scrollbars applied by default:
+
+        #myoverlay .bd {
+        
+            height: 100px;
+        
+            /* Apply scrollbars for all browsers. */
+            overflow: auto;
+        
+        }
+        
+        #myoverlay.hide-scrollbars .bd {
+        
+            /* Hide scrollbars by default for Gecko on OS X */
+            overflow: hidden;
+            
+        }
+        
+        #myoverlay.show-scrollbars .bd {
+        
+            /* Show scrollbars for Gecko on OS X when the Overlay is visible */
+            overflow: auto;
+            
+        }        
+    
+     To fix the scrollbars issue for a Panel instance with an id of "mypanel" 
+     whose body element has scrollbars applied by default:
+    
+        #mypanel .bd {
+        
+            height: 100px;
+        
+            /* Apply scrollbars for all browsers. */
+            overflow: auto;
+        
+        }
+        
+        .yui-panel-container.hide-scrollbars #mypanel .bd {
+        
+            /* Hide scrollbars by default for Gecko on OS X */
+            overflow: hidden;
+            
+        }
+        
+        .yui-panel-container.show-scrollbars #mypanel .bd {
+        
+            /* Show scrollbars for Gecko on OS X when the Panel is visible  */
+            overflow: auto;
+            
+        }
+
+    ** For more information see 
+       https://bugzilla.mozilla.org/show_bug.cgi?id=187435
+
++ Flash Movies appear on top of Overlay instances
+  -----------------------------------------------
+  Flash movies can appear on top of Overlay instances in IE and Gecko-based
+  browsers.  To fix this problem, set the "wmode" of the Flash movie to either
+  "transparent" or "opaque" as indicated below: 
+
+  Via the <object> tag:
+
+    <object>
+        <param name="wmode" value="opaque">
+    </object>
+
+    <object>
+        <param name="wmode" value="transparent"> 
+    </object>
+
+  Via the <embed> tag:
+    
+    <embed wmode="transparent"> ... </embed>
+    <embed wmode="opaque"> ... </embed>
+
+    ** For more information see 
+       http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15523
+
++ Overlay instances not rendered at correct z-index in IE
+  -------------------------------------------------------
+  In IE, when an Overlay instance is rendered inside a relatively positioned 
+  element the z-index of the Overlay instance is now relative to its 
+  relatively positioned parent element.  This is not a bug in the 
+  Overlay class, but rather a bug in IE where relatively positioned elements 
+  establish a new stacking context for their child nodes.  To avoid this 
+  bug it is recommend that all Overlay instances that need to be able to float
+  above any other element in the document be made direct descendants of the 
+  <body> element.
+
+  ** For more information see 
+   http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html
+
++ Header elements for Panel instances using "Sam" skin shrinkwrap in IE 7
+  -----------------------------------------------------------------------
+  In IE 7 (Standards Mode) if a Panel instance is created without specifying a
+  value for the "width" configuration property the width of the Panel's 
+  header element will shrinkwrap to the width of its text node.  To avoid 
+  triggering this bug in IE always specify a value for the "width" 
+  configuration property when using Panel.
+
++ Panel instances render at 100% of the browser viewport
+  ------------------------------------------------------
+  In IE 7 (Quirks Mode) and IE 6 (Quirks Mode and Standards Mode) if any of the 
+  child nodes of a Panel instance's root element have "layout" 
+  (http://msdn2.microsoft.com/en-us/library/ms533776.aspx) and no value
+  has been specified for the "width" configuration property, the Panel will 
+  render at 100% of the width of browser's viewport.  This bug will manifest
+  when using the "Sam" skin as layout is applied to the header, body and 
+  footer elements (by setting the CSS "zoom" property of the element to "1" ) 
+  in order to get the negative margins required for the rounded corners to 
+  render correctly.  To avoid triggering this bug in IE always specify a value
+  for the "width" configuration property when using Panel.
+
++ Panel instances render at 2px wider when using "Sam" skin 
+  ---------------------------------------------------------
+  For the "Sam" skin a Panel instance's rounded corners are created via the 
+  application of negative 1px left and right margins on the header, body and 
+  footer elements.  These negative margins will cause a Panel instance to be 
+  rendered at 2px wider than the value specified by the "width" configuration 
+  property.  Therefore, when using the "Sam" skin consider the negative left 
+  and right margins and subtract 2 from the value passed to the "width" 
+  configuration property in order to have the Panel render at the desired 
+  width.  For example, to render a Panel 300px wide, pass a value of "298px" 
+  to the "width" configuration property.
+
+
+*** version 2.2.2 ***
+
++ Clicking the close button of a Panel (or any instance of a Panel subclass) 
+  registered with an OverlayManager will no longer result in the Panel 
+  receiving focus.
+
++ Overlay instances registered with an OverlayManager will now correctly 
+  blur themselves when hidden.
+
++ Calling the "destroy" method of an Overlay instance will now result in it 
+  being removed from its OverlayManager instance(s).
+
++ The DOM event listener for the event defined by the "focusevent" 
+  configuration property of an OverlayManager instance is now removed from each 
+  Overlay instance when it is removed from its OverlayManager.
+
++ All subscribers for an Overlay instance's "focus" and "blur" events are 
+  now unsubscribed when it is removed from its OverlayManager.
+
+
+*** version 2.2.1 ***
+
++ Made the default scope for all Custom Events published by Module, Overlay, 
+  Panel, Tooltip, Dialog and SimpleDialog the widget instance.  Previously the 
+  default scope for Custom Events was inconsistent across classes; the default
+  scope for Custom Events published by Overlay was always the Overlay instance
+  whereas the Custom Events published by all of the other classes had no 
+  default scope.  
+
++ Added default scope for CustomEvents published by YAHOO.util.Config:
+  - Default scope for the "configChangedEvent" is now the Config instance.
+  - Default scope for Config property events is now the Config's owner (widget).
+
++ Panel and Tooltip now always convert the value of a DOM element's "tagName" 
+  property to uppercase before evaluating it.  This improves 
+  XHTML compatibility.
+  
++ Pressing the enter key while focused on a form field inside a Dialog will 
+  now trigger the "click" event handler defined by the Dialog's default 
+  button in IE and Firefox.  Previously, this behavior only worked in Safari 
+  and Opera.
+
++ Added a "yui" prefix to the default CSS class name for Module to be 
+  consistent with the other Container family widgets.
+
++ Container/Panel's underlay shadow is now defined as partially-transparent
+  black rather than gray.  This prevents the shadow from lightening the 
+  background color of elements beneath it.
+
++ Fixed memory leaks in Panel and Dialog.
+
++ The Drag and Drop library is now a truly optional dependency for Panel and its 
+  subclasses.
+
++ Panel "focus" and "blur" events are now fired when Panels are focused and 
+  blurred via the "focus" and "blurAll" methods of YAHOO.widget.OverlayManager.
+
++ Panel instances rendered without setting the value for the "width" 
+  configuration property will now have their "width" configuration 
+  property set to the value of the Panel's element's "offsetWidth" property 
+  when rendered.  This fixes an issue in IE 6 and 7 where Panels that are 
+  rendered without setting the "width" configuration property will only be 
+  draggable by mousing down on the text inside the header, rather than anywhere 
+  inside the header.
+  
++ Refactored the Container family including the Config class to improve 
+  performance, especially when working with a large number of instances in IE6.
+
+
+
+*** version 2.2.0 ***
+
+       Module
+          - Removed hardcoded file paths for image roots.  Affected properties
+          include:
+               - YAHOO.widget.Module.IMG_ROOT
+               - YAHOO.widget.Module.IMG_ROOT_SSL
+          - HTML elements, created via createElement, now use lowercase.
+
+       Panel
+          - To shield against CSS class collision, the following references now
+          have a "yui-" prefix:
+             - YAHOO.widget.Panel.CSS_PANEL now references CSS class "yui-
+             panel".
+             - YAHOO.widget.Panel.CSS_PANEL_CONTAINER now references CSS class
+             "yui-panel-container".
+          -  Close button can now be configured via the CSS class "container-
+          close".
+          - HTML elements, created via createElement, now use lowercase.
+
+       Dialog
+          - To shield against CSS class collision, the following references now
+          have a "yui-" prefix:
+               - YAHOO.widget.Dialog.CSS_DIALOG now references CSS class "yui-
+               dialog".
+          - HTML elements, created via createElement, now use lowercase.
+
+       SimpleDialog
+          - Removed hardcoded file paths for SimpleDialog icons, which are now
+          configurable in CSS:
+             - YAHOO.widget.SimpleDialog.ICON_BLOCK now references CSS class
+             "blckicon".
+             - YAHOO.widget.SimpleDialog.ICON_ALARM now references CSS class
+             "alrticon".
+             - YAHOO.widget.SimpleDialog.ICON_HELP now references CSS class
+             "hlpicon".
+             - YAHOO.widget.SimpleDialog.ICON_INFO now references CSS class
+             "infoicon".
+             - YAHOO.widget.SimpleDialog.ICON_WARN now references CSS class
+             "warnicon".
+             - YAHOO.widget.SimpleDialog.ICON_TIP now references CSS class
+             "tipicon".
+          - To provide shield against CSS class collision the following
+          references now have a "yui-" prefix:
+             - YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG now references CSS
+             class "yui-simple-dialog";
+
+       Tooltip
+          - To shield against CSS class collision, the following references now
+          have a "yui-" prefix:
+             - YAHOO.widget.Tooltip.CSS_TOOLTIP now references CSS class "yui-
+             tipicon" "yui-tt";
+
 *** version 0.12.2 ***
 
        Module
-          - Corrected issue where listener was not properly removed from resize monitor element when "monitorresize" is disabled
+          - Corrected issue where listener was not properly removed from resize
+          monitor element when "monitorresize" is disabled
 
        Panel
-          - Fixed issue that would sometimes prevent select lists from working properly in Firefox
-       
+          - Fixed issue that would sometimes prevent select lists from working
+          properly in Firefox
+
        Dialog
-          - Fixed error that would occur when trying to create a Dialog where the first form element is set to "disabled"
-          - Modified "close" property handler for Dialog/SimpleDialog to call "cancel" instead of "hide"
+          - Fixed error that would occur when trying to create a Dialog where
+          the first form element is set to "disabled"
+          - Modified "close" property handler for Dialog/SimpleDialog to call
+          "cancel" instead of "hide"
 
 *** version 0.12.1 ***
 
        All Classes
-          - "monitorresize" property now functions in situations where document.domain has been modified.
-          - YAHOO.widget.Module.textResizeEvent now fires when the font size is changed (except for Opera, which uses "zoom" functionality that prevents this)
-          - Event listeners attached to container elements are now properly purged on destroy using YAHOO.util.Event.purgeElement
+          - "monitorresize" property now functions in situations where
+          document.domain has been modified.
+          - YAHOO.widget.Module.textResizeEvent now fires when the font size is
+          changed (except for Opera, which uses "zoom" functionality that
+          prevents this)
+          - Event listeners attached to container elements are now properly
+          purged on destroy using YAHOO.util.Event.purgeElement
 
        Panel
-          - Fixed issue where focus events were broken on the page when a modal Panel was created
+          - Fixed issue where focus events were broken on the page when a modal
+          Panel was created
 
        Dialog
-          - Fixed bug where hitting "enter" on a Dialog was forcing the default submission behavior of the form's action to execute
+          - Fixed bug where hitting "enter" on a Dialog was forcing the default
+          submission behavior of the form's action to execute
           - Dialog no longer tries to give focus to hidden form elements.
-          - Replaced &nbsp; references in Panel with &#160; for XHTML compliance.
-          - Fixed issue that was preventing Safari from successfully using the getData() function
+          - Replaced &nbsp; references in Panel with &#160; for XHTML
+          compliance.
+          - Fixed issue that was preventing Safari from successfully using the
+          getData() function
 
 *** version 0.12 ***
 
        All Classes
-          - New documentation format implemented, and removed unnecessary prototype null references previously used for generating documentation
+          - New documentation format implemented, and removed unnecessary
+          prototype null references previously used for generating
+          documentation
 
        Config
-          - Added 'undefined' check when reading initial properties for .reset() 
+          - Added 'undefined' check when reading initial properties for
+          .reset()
           - Fixed Firefox warning on .resetProperty()
-          - Fixed issue preventing resetProperty() from resetting values correctly
+          - Fixed issue preventing resetProperty() from resetting values
+          correctly
 
        Module
           - Removed unused "childNodesInDom" property
 
        Overlay
           - Converted center() to use Dom utility
-          - Fixed configVisible() to properly detect actual visible/hidden status in Internet Explorer, which reports "inherit" for all elements by default.
+          - Fixed configVisible() to properly detect actual visible/hidden
+          status in Internet Explorer, which reports "inherit" for all elements
+          by default.
           - Updated onDomResize to properly reapply "context" property
-          - Unified scroll/resize handlers so that they fire properly (when the event has completed) as opposed to constantly (as seen in Mozilla-based browsers)
-               
+          - Unified scroll/resize handlers so that they fire properly (when the
+          event has completed) as opposed to constantly (as seen in Mozilla-
+          based browsers)
+
        Panel
-          - Modified modality mask to show before Panel is shown (prior to any animation)
-          - Modified buildWrapper to eliminate cloning of the initial markup module, which fixes issues with select options not maintaining their default selections in IE
-          - Modality mask is now z-indexed properly so that the mask z-index is always one less than the Panel z-index
-               
+          - Modified modality mask to show before Panel is shown (prior to any
+          animation)
+          - Modified buildWrapper to eliminate cloning of the initial markup
+          module, which fixes issues with select options not maintaining their
+          default selections in IE
+          - Modality mask is now z-indexed properly so that the mask z-index is
+          always one less than the Panel z-index
+
        Dialog
-          - Fixed Connection to get "action" attribute using getAttribute, to allow for form fields named "action"
-          - Added support for "GET" by retrieving the form "method" rather than always defaulting to "POST"
-               
+          - Fixed Connection to get "action" attribute using getAttribute, to
+          allow for form fields named "action"
+          - Added support for "GET" by retrieving the form "method" rather than
+          always defaulting to "POST"
+
        KeyListener
-          - Fixed to work properly with Safari 2.0 by matching against keyCode or charCode
+          - Fixed to work properly with Safari 2.0 by matching against keyCode
+          or charCode
 
 *** version 0.11.4 ***
-       
-       - Panel: Modality mask is now properly removed from DOM on Panel destroy.
-       
+
+       - Panel: Modality mask is now properly removed from DOM on Panel
+       destroy.
+
 *** version 0.11.3 ***
 
        - Module: Fixed SSL warning issue in IE
        - Overlay: Fixed memory leak related to iframe shim in IE
        - Panel: No focusable elements under the mask can now be tabbed to
-       - Panel: Set Panel container overflow to hidden to fix scrolling issue in Opera 9
+       - Panel: Set Panel container overflow to hidden to fix scrolling issue
+       in Opera 9
 
 *** version 0.11.2 ***
 
@@ -81,31 +656,41 @@ Container Release Notes
 *** version 0.11.1 ***
 
        - Tooltip: Removed incorrect logger statement
-       - Dialog: Corrected logic that was causing browser lockup in IE for SimpleDialog
+       - Dialog: Corrected logic that was causing browser lockup in IE for
+       SimpleDialog
        - Dialog: Fixed "firstButtom" typo
 
 *** version 0.11.0 ***
 
        - toString function added to all classes for easy logging
-       - YAHOO.extend is now being used for inheritance on all container classes
+       - YAHOO.extend is now being used for inheritance on all container
+       classes
        - Module: monitorresize feature now works on all browsers
        - Module: Fixed bug with image root and isSecure
        - Overlay: Fixed bugs related to IFRAME shim positioning
        - Overlay: center() now works in quirks mode
-       - Overlay: Overlay now has a custom destroy() method that also removes the IFRAME shim
-       - OverlayManager: Fixed bug in the prototype that was preventing multiple Managers on one page
+       - Overlay: Overlay now has a custom destroy() method that also removes
+       the IFRAME shim
+       - OverlayManager: Fixed bug in the prototype that was preventing
+       multiple Managers on one page
        - OverlayManager: focusEvent now fires at all appropriate times
-       - Tooltip: context can now be specified as an array, so Tooltips can be reused across multiple context elements
-       - Tooltip: preventoverlap now functions properly for large context elements (i.e, images)
+       - Tooltip: context can now be specified as an array, so Tooltips can be
+       reused across multiple context elements
+       - Tooltip: preventoverlap now functions properly for large context
+       elements (i.e, images)
        - Tooltip: fixed bugs regarding setTimeout
-       - Tooltip: added mousemove event to allow for more accurate Tooltip positioning
-       - Panel: added dragEvent for monitoring all event handlers for drag and drop
+       - Tooltip: added mousemove event to allow for more accurate Tooltip
+       positioning
+       - Panel: added dragEvent for monitoring all event handlers for drag and
+       drop
        - Panel: modality mask is now resized on scroll
-       - Panel: KeyListeners are now properly destroyed when the Panel is destroyed
+       - Panel: KeyListeners are now properly destroyed when the Panel is
+       destroyed
        - Panel: Header is now sized properly in quirks mode
        - Dialog: Blinking cursor issue is fixed for Firefox
        - Dialog: callback object for Connection is now public (this.callback)
-       - Dialog: onsuccess/onfailure properties removed (as a result of the public callback object)
+       - Dialog: onsuccess/onfailure properties removed (as a result of the
+       public callback object)
        - Dialog: Dialog is now invisible by default
        - Dialog: Buttons are now properly cleaned up on destroy
 
diff --git a/lib/yui/container/assets/container-core.css b/lib/yui/container/assets/container-core.css
new file mode 100755 (executable)
index 0000000..01cd7e5
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-overlay,
+.yui-panel-container {
+
+    visibility: hidden;
+       position: absolute;
+       z-index: 1;
+
+}
+
+yui-panel-container form {
+
+       margin: 0;
+
+}
+
+.masked .yui-panel-container {
+
+    /*
+        Default to a z-index 1 higher than default if the Panel is modal
+        to make sure the panel is above its modality mask.
+    */
+
+   z-index: 2;
+
+}
+
+.mask {
+
+    /*
+        Default to a z-index of 1 less than the default defined 
+        by ".masked .yui-panel-container"
+    */
+
+    z-index: 1; 
+    display: none;
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+
+    /*
+        Application of "overflow:auto" prevents Mac scrollbars from bleeding
+        through the modality mask in Gecko.
+    */
+
+    overflow: auto;
+
+}
+
+
+/* 
+    PLEASE NOTE:
+
+    1) ".masked select" is used to prevent <SELECT> elements bleeding through 
+       the modality mask in IE 6. 
+
+    2) ".drag select" is used to hide <SELECT> elements when dragging a 
+       Panel in IE 6. 
+    
+    3) "hide-select select" is appended to an Overlay instance's root HTML 
+       element when it is being annimated by YAHOO.widget.ContainerEffect 
+
+*/
+
+.masked select, 
+.drag select, 
+.hide-select select {
+
+       _visibility: hidden;   
+
+}
+
+.yui-panel-container select {
+
+       _visibility: inherit;
+
+}
+
+
+/*
+
+There are two known issues with YAHOO.widget.Overlay (and its subclasses) that 
+manifest in Gecko-based browsers on Mac OS X:
+
+    1) Elements with scrollbars will poke through Overlay instances floating 
+       above them.
+    
+    2) An Overlay's scrollbars and the scrollbars of its child nodes remain  
+       visible when the Overlay is hidden.
+
+To fix these bugs:
+
+    1) The "overflow" property of an Overlay instance's root element and child 
+       nodes is toggled between "hidden" and "auto" (through the application  
+       and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes)
+       as its "visibility" configuration property is toggled between 
+       "false" and "true."
+    
+    2) The "display" property of <SELECT> elements that are child nodes of the 
+       Overlay instance's root element is set to "none" when it is hidden.
+
+PLEASE NOTE:  
+  
+    1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are 
+       applied only for Gecko on Mac OS X and are added/removed to/from the 
+       Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and 
+       "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.
+    
+    2) There may be instances where the CSS for a web page or application 
+       contains style rules whose specificity override the rules implemented by 
+       the Container CSS files to fix this bug.  In such cases, is necessary to 
+       leverage the provided "hide-scrollbars" and "show-scrollbars" classes to 
+       write custom style rules to guard against this bug.
+
+** For more information on this issue, see:
+
+   + https://bugzilla.mozilla.org/show_bug.cgi?id=187435
+   + SourceForge bug #1723530
+
+*/
+
+.hide-scrollbars,
+.hide-scrollbars * {
+
+       overflow: hidden;
+
+}
+
+.hide-scrollbars select {
+
+       display: none;
+
+}
+
+.show-scrollbars {
+
+    overflow: auto;
+
+}
+
+.yui-panel-container.show-scrollbars,
+.yui-tt.show-scrollbars {
+
+    overflow: visible;
+
+}
+
+.yui-panel-container.show-scrollbars .underlay,
+.yui-tt.show-scrollbars .yui-tt-shadow {
+
+    overflow: auto;
+
+}
+
+
+/*
+    PLEASE NOTE: The <DIV> element used for a Tooltip's shadow is appended 
+    to its root element via JavaScript once it has been rendered.  The 
+    code that creates the shadow lives in the Tooltip's public "onRender" 
+    event handler that is a prototype method of YAHOO.widget.Tooltip.  
+    Implementers wishing to remove a Tooltip's shadow or add any other markup
+    required for a given skin for Tooltip should override the "onRender" method.
+*/
+
+.yui-tt-shadow {
+
+    position: absolute;
+
+}
\ No newline at end of file
index ee5da15078e19656f5fd8ed5f21f2e22300058a9..711f0f4a000ceff30b9b9f9c456f3281be9f2be5 100755 (executable)
@@ -1,16 +1,28 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-Version 0.11.0
+version: 2.3.0
 */
-
-.overlay {
+.yui-overlay,
+.yui-panel-container {
+    visibility:hidden;
        position:absolute;
-       display:block;
+       z-index: 1;
+}
+
+.masked .yui-panel-container {
+
+    /*
+        Default to a z-index 1 higher than default if the Panel is modal
+        to make sure the panel is above its modality mask.
+    */
+
+   z-index: 2;
+
 }
 
-.tt {
+.yui-tt {
        visibility:hidden;
        position:absolute;
        color:#333;
@@ -22,11 +34,26 @@ Version 0.11.0
        width:auto;
 }
 
+/*
+    PLEASE NOTE: The <DIV> element used for a Tooltip's shadow is appended 
+    to its root element via JavaScript once it has been rendered.  The 
+    code that creates the shadow lives in the Tooltip's public "onRender" 
+    event handler that is a prototype method of YAHOO.widget.Tooltip.  
+    Implementers wishing to remove a Tooltip's shadow or add any other markup
+    required for a given skin for Tooltip should override the "onRender" method.
+*/
+
+.yui-tt-shadow {
+
+    display: none;
+
+}
+
 * html body.masked select {
        visibility:hidden;
 }
 
-* html div.panel-container select {
+* html div.yui-panel-container select {
        visibility:inherit;
 }
 
@@ -39,7 +66,12 @@ Version 0.11.0
 }
 
 .mask {
-    z-index:0;   
+    /*
+        Default to a z-index of 1 less than the default defined 
+        by ".masked .yui-panel-container"
+    */
+
+    z-index: 1; 
     display:none;
     position:absolute;
     top:0;
@@ -50,61 +82,121 @@ Version 0.11.0
     background-color:#CCC;
 }
 
+/*
+
+There are two known issues with YAHOO.widget.Overlay (and its subclasses) that 
+manifest in Gecko-based browsers on Mac OS X:
+
+    1) Elements with scrollbars will poke through Overlay instances floating 
+       above them.
+    
+    2) An Overlay's scrollbars and the scrollbars of its child nodes remain  
+       visible when the Overlay is hidden.
+
+To fix these bugs:
+
+    1) The "overflow" property of an Overlay instance's root element and child 
+       nodes is toggled between "hidden" and "auto" (through the application  
+       and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes)
+       as its "visibility" configuration property is toggled between 
+       "false" and "true."
+    
+    2) The "display" property of <SELECT> elements that are child nodes of the 
+       Overlay instance's root element is set to "none" when it is hidden.
+
+PLEASE NOTE:  
+  
+    1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are 
+       applied only for Gecko on Mac OS X and are added/removed to/from the 
+       Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and 
+       "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.
+    
+    2) There may be instances where the CSS for a web page or application 
+       contains style rules whose specificity override the rules implemented by 
+       the Container CSS files to fix this bug.  In such cases, is necessary to 
+       leverage the provided "hide-scrollbars" and "show-scrollbars" classes to 
+       write custom style rules to guard against this bug.
+
+** For more information on this issue, see:
+
+   + https://bugzilla.mozilla.org/show_bug.cgi?id=187435
+   + SourceForge bug #1723530
+
+*/
+
+.hide-scrollbars,
 .hide-scrollbars * {
-       overflow:hidden;
+
+       overflow: hidden;
+
 }
 
-.hide-scrollbars textarea, .hide-scrollbars select {
-       overflow:hidden;
-       display:none;
+.hide-scrollbars select {
+
+       display: none;
+
 }
 
-.show-scrollbars textarea, .show-scrollbars select {
-       overflow:visible;
+.show-scrollbars {
+
+    overflow: auto;
+
 }
 
-.panel-container {
-       position:absolute;
-       background-color:transparent;
-       z-index:6;
-       visibility:hidden;
-       overflow:visible;
-       width:auto;
+.yui-panel-container.show-scrollbars {
+
+    overflow: visible;
+
 }
 
-.panel-container.matte {
-       padding:3px;
-       background-color:#FFF;
+.yui-panel-container.show-scrollbars .underlay {
+
+    overflow: auto;
+
 }
 
-.panel-container.matte .underlay {
-       display:none;
+.yui-panel-container.focused {
+
 }
 
-.panel-container.shadow {
-       padding:0px;
-       background-color:transparent;
+
+/* Panel underlay styles */
+
+.yui-panel-container .underlay {
+
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+
 }
 
-.panel-container.shadow .underlay {
-       visibility:inherit;
-       position:absolute;
-       background-color:#CCC;
-       top:3px;left:3px;
-       z-index:0;
-       width:100%;
-       height:100%;
-    -moz-opacity: 0.7;
-    opacity:.70;
-    filter:alpha(opacity=70);
-       zoom:1;
-}
-
-.panel {
+.yui-panel-container.matte {
+
+       padding: 3px;
+       background-color: #fff;
+
+}
+
+.yui-panel-container.shadow .underlay {
+
+    top: 3px;
+    bottom: -3px;
+    right: -3px;
+    left: 3px;
+    background-color: #000;
+    opacity: .12;
+    filter: alpha(opacity=12);  /* For IE */
+
+}
+
+.yui-panel {
        visibility:hidden;
        border-collapse:separate;
        position:relative;
-       left:0px;top:0px;
+       left:0;
+       top:0;
        font:1em Arial;
        background-color:#FFF;
        border:1px solid #000;
@@ -112,7 +204,7 @@ Version 0.11.0
        overflow:hidden;
 }
 
-.panel .hd {
+.yui-panel .hd {
        background-color:#3d77cb;
        color:#FFF;
        font-size:100%;
@@ -120,20 +212,20 @@ Version 0.11.0
        border:1px solid #FFF;
        border-bottom:1px solid #000;
        font-weight:bold;
-       overflow:hidden;
        padding:4px;
+    white-space:nowrap;
 }
 
-.panel .bd {
+.yui-panel .bd {
        overflow:hidden;
        padding:4px;
 }
 
-.panel .bd p {
+.yui-panel .bd p {
        margin:0 0 1em;
 }
 
-.panel .close {
+.yui-panel .container-close {
        position:absolute;
        top:5px;
        right:4px;
@@ -142,25 +234,17 @@ Version 0.11.0
        width:12px;
        margin:0px;
        padding:0px;
-       background-repeat:no-repeat;
+       background:url(close12_1.gif) no-repeat;
        cursor:pointer;
        visibility:inherit;
 }
 
-.panel .close.nonsecure {
-       background-image:url(http://us.i1.yimg.com/us.yimg.com/i/nt/ic/ut/alt3/close12_1.gif);
-}
-
-.panel .close.secure {
-       background-image:url(https://a248.e.akamai.net/sec.yimg.com/i/nt/ic/ut/alt3/close12_1.gif);
-}
-
-.panel .ft {
+.yui-panel .ft {
        padding:4px;
        overflow:hidden;
 }
 
-.simple-dialog .bd .icon {
+.yui-simple-dialog .bd .yui-icon {
        background-repeat:no-repeat;
        width:16px;
        height:16px;
@@ -168,13 +252,39 @@ Version 0.11.0
        float:left;
 }
 
-.dialog .ft, .simple-dialog .ft {
+.yui-simple-dialog .bd span.blckicon {
+       background: url("blck16_1.gif") no-repeat;
+}
+
+.yui-simple-dialog .bd span.alrticon {
+       background: url("alrt16_1.gif") no-repeat;
+}
+
+.yui-simple-dialog .bd span.hlpicon {
+       background: url("hlp16_1.gif") no-repeat;
+}
+
+.yui-simple-dialog .bd span.infoicon {
+       background: url("info16_1.gif") no-repeat;
+}
+
+.yui-simple-dialog .bd span.warnicon {
+       background: url("warn16_1.gif") no-repeat;
+}
+
+.yui-simple-dialog .bd span.tipicon {
+       background: url("tip16_1.gif") no-repeat;
+}
+
+.yui-dialog .ft, 
+.yui-simple-dialog .ft {
        padding-bottom:5px;
        padding-right:5px;
        text-align:right;
 }
 
-.dialog form, .simple-dialog form {
+.yui-dialog form, 
+.yui-simple-dialog form {
        margin:0;
 }
 
@@ -196,16 +306,17 @@ Version 0.11.0
        font-weight:bold;
 }
 
-.button-group button:hover, .button-group button.hover { 
+.button-group button:hover, 
+.button-group button.hover {
        border:2px solid #90A029;
        background-color:#EBF09E;
        border-top-color:#FFF;
        border-left-color:#FFF;
 }
 
-.button-group button:active { 
+.button-group button:active {
        border:2px solid #E4E4E4;
        background-color:#BBB;
        border-top-color:#333;
        border-left-color:#333;
-}
+}
\ No newline at end of file
diff --git a/lib/yui/container/assets/skins/sam/container-skin.css b/lib/yui/container/assets/skins/sam/container-skin.css
new file mode 100755 (executable)
index 0000000..b1721ae
--- /dev/null
@@ -0,0 +1,302 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* Panel modality mask styles */
+
+.yui-skin-sam .mask {
+
+    background-color: #000;
+    opacity: .25;
+    *filter: alpha(opacity=25);  /* Set opacity in IE */
+
+}
+
+
+/* Panel styles */
+
+.yui-skin-sam .yui-panel-container {
+
+    padding: 0 1px;
+    *padding: 2px 3px;
+
+}
+
+.yui-skin-sam .yui-panel {
+
+       position: relative;
+       *zoom: 1;
+       left: 0;
+       top: 0;
+    border-style: solid;
+    border-width: 1px 0;
+    border-color: #808080;
+       z-index: 1;
+
+}
+
+.yui-skin-sam .yui-panel .hd, 
+.yui-skin-sam .yui-panel .bd, 
+.yui-skin-sam .yui-panel .ft {
+
+    /*
+        Use of "zoom: 1" is to trigger "haslayout" for IE to get 
+        negative margins working.
+    */
+    
+    *zoom: 1;
+
+    /*
+        Use of "position: relative" is necessary to get negative margins 
+        working in IE.
+    */
+
+    *position: relative; 
+
+    border-style: solid;
+    border-width: 0 1px;
+    border-color: #808080;
+    margin: 0 -1px;
+  
+}
+
+.yui-skin-sam .yui-panel .hd {
+
+    border-bottom: solid 1px #ccc;
+
+}
+
+.yui-skin-sam .yui-panel .bd,
+.yui-skin-sam .yui-panel .ft {
+
+    background-color: #F2F2F2;
+
+}
+
+.yui-skin-sam .yui-panel .hd {
+
+    padding: 0 10px;
+    font-size: 93%;  /* 12px */
+    line-height: 2;  /* ~24px */
+    *line-height: 1.9; /* For IE */
+    font-weight: bold;
+    color: #000;
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;
+    
+}
+
+.yui-skin-sam .yui-panel .bd {
+
+    padding: 10px;
+
+}
+
+.yui-skin-sam .yui-panel .ft {
+
+    border-top: solid 1px #808080;
+    padding: 5px 10px;
+    font-size: 77%;
+
+}
+
+.yui-skin-sam .yui-panel-container.focused .yui-panel .hd {
+
+}
+
+.yui-skin-sam .container-close {
+
+    position: absolute;
+    top: 5px;
+    right: 6px;
+    width: 25px;
+    height: 15px;
+    background: url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;
+
+}
+
+
+/* Panel underlay styles */
+
+.yui-skin-sam .yui-panel-container .underlay {
+
+    right: -1px;
+    left: -1px;
+
+}
+
+.yui-skin-sam .yui-panel-container.matte {
+
+       padding: 9px 10px;
+       background-color: #fff;
+
+}
+
+.yui-skin-sam .yui-panel-container.shadow {
+
+    /* IE 7 Quirks Mode and IE 6 Standards Mode and Quirks mode */
+    _padding: 2px 5px 0 3px; 
+
+}
+
+.yui-skin-sam .yui-panel-container.shadow .underlay {
+
+       position: absolute;
+
+    top: 2px;
+    right: -3px;
+    bottom: -3px;
+    left: -3px;
+
+    /* IE 7 Standards Mode */
+
+    *top: 3px;
+    *left: -1px;
+    *right: -1px;
+    *bottom: -1px;
+
+    /* IE 7 Quirks Mode and IE 6 Standards Mode and Quirks mode */
+
+    _top: 0;
+    _right: 0;
+    _bottom: 0;
+    _left: 0;
+    _margin-top: 3px;
+    _margin-left: -1px;
+
+    background-color: #000;
+    opacity: .12;
+    *filter: alpha(opacity=12);  /* Set opacity in IE */
+
+}
+
+
+/* Dialog styles */
+
+.yui-skin-sam .yui-dialog .ft {
+
+    border-top: none;
+    padding: 0 10px 10px 10px;
+    font-size: 100%;
+
+}
+
+.yui-skin-sam .yui-dialog .ft .button-group {
+
+    display: block;
+    text-align: right;
+
+}
+
+
+/* Dialog default button styles */
+
+.yui-skin-sam .yui-dialog .ft .default {
+
+    border-color: #304369;
+    background-position: 0 -1400px;
+
+}
+
+.yui-skin-sam .yui-dialog .ft .default .first-child {
+
+    border-color: #304369;
+
+}
+
+.yui-skin-sam .yui-dialog .ft .default button {
+
+    color: #fff;
+
+}
+
+
+/* SimpleDialog icon styles */
+
+.yui-skin-sam .yui-simple-dialog .bd .yui-icon {
+
+    background: url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;
+       width: 16px;
+       height: 16px;
+       margin-right: 10px;
+       float: left;
+
+}
+
+.yui-skin-sam .yui-simple-dialog .bd span.blckicon {
+
+    background-position: 0 -1100px;
+
+}
+
+.yui-skin-sam .yui-simple-dialog .bd span.alrticon {
+
+    background-position: 0 -1050px;
+
+}
+
+.yui-skin-sam .yui-simple-dialog .bd span.hlpicon {
+
+    background-position: 0 -1150px;
+
+}
+
+.yui-skin-sam .yui-simple-dialog .bd span.infoicon {
+
+    background-position: 0 -1200px;
+
+}
+
+.yui-skin-sam .yui-simple-dialog .bd span.warnicon {
+
+    background-position: 0 -1900px;
+
+}
+
+.yui-skin-sam .yui-simple-dialog .bd span.tipicon {
+
+    background-position: 0 -1250px;
+
+}
+
+
+/* Tooltip styles */
+
+.yui-skin-sam .yui-tt .bd {
+
+    position: relative;
+    top: 0;
+    left: 0;
+    z-index: 1;
+    color: #000;
+    padding: 2px 5px;
+    border-color: #D4C237 #A6982B #A6982B #A6982B;
+    border-width: 1px;
+    border-style: solid;
+    background-color: #FFEE69;
+
+}
+
+.yui-skin-sam .yui-tt.show-scrollbars .bd {
+
+    overflow: auto;
+
+}
+
+.yui-skin-sam .yui-tt-shadow {
+
+    top: 2px;
+    right: -3px;
+    left: -3px;
+    bottom: -3px;
+    background-color: #000;
+
+}
+
+.yui-skin-sam .yui-tt-shadow-visible {
+
+    opacity: .12;
+    *filter: alpha(opacity=12);  /* For IE */    
+
+}
\ No newline at end of file
diff --git a/lib/yui/container/assets/skins/sam/container.css b/lib/yui/container/assets/skins/sam/container.css
new file mode 100755 (executable)
index 0000000..7ce451c
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:1;}yui-panel-container form{margin:0;}.masked .yui-panel-container{z-index:2;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-tt-shadow{position:absolute;}.yui-skin-sam .mask{background-color:#000;opacity:.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px 3px;}.yui-skin-sam .yui-panel{position:relative;*zoom:1;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{*zoom:1;*position:relative;border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .yui-panel-container.focused .yui-panel .hd{}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 5px 0 3px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;right:-3px;bottom:-3px;left:-3px;*top:3px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_right:0;_bottom:0;_left:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft .default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft .default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft .default button{color:#fff;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;*filter:alpha(opacity=12);}
index 23bf0457039456602d9b3d120d6fdea2f2f2a04a..97b029927731bdd39d04ab5872b0a218f1515756 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
-*/
-/**
-* 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.
-* @namespace YAHOO.util
-* @class Config
-* @constructor
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config = function(owner) {
-       if (owner) {
-               this.init(owner);
-       } else {
-               YAHOO.log("No owner specified for Config object", "error");
-       }
-};
-
-YAHOO.util.Config.prototype = {
-       
-       /**
-       * Object reference to the owner of this Config Object
-       * @property owner
-       * @type Object
-       */
-       owner : null,
-
-       /**
-       * Boolean flag that specifies whether a queue is currently being executed
-       * @property queueInProgress
-       * @type Boolean
-       */
-       queueInProgress : false,
-
-
-       /**
-       * Validates that the value passed in is a Boolean.
-       * @method checkBoolean
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */      
-       checkBoolean: function(val) {
-               if (typeof val == 'boolean') {
-                       return true;
-               } else {
-                       return false;
-               }
-       },
-
-       /**
-       * Validates that the value passed in is a number.
-       * @method checkNumber
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */
-       checkNumber: function(val) {
-               if (isNaN(val)) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-};
-
-
-/**
-* Initializes the configuration Object and all of its local members.
-* @method init
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config.prototype.init = function(owner) {
-
-       this.owner = owner;
-
-       /**
-       * Object reference to the owner of this Config Object
-       * @event configChangedEvent
-       */
-       this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");
-       this.queueInProgress = false;
-
-       /* Private Members */
-
-       /**
-       * Maintains the local collection of configuration property objects and their specified values
-       * @property config
-       * @private
-       * @type Object
-       */ 
-       var config = {};
-
-       /**
-       * Maintains the local collection of configuration property objects as they were initially applied.
-       * This object is used when resetting a property.
-       * @property initialConfig
-       * @private
-       * @type Object
-       */ 
-       var initialConfig = {};
-
-       /**
-       * Maintains the local, normalized CustomEvent queue
-       * @property eventQueue
-       * @private
-       * @type Object
-       */ 
-       var eventQueue = [];
-
-       /**
-       * Fires a configuration property event using the specified value. 
-       * @method fireEvent
-       * @private
-       * @param {String}       key                     The configuration property's name
-       * @param {value}        Object          The value of the correct type for the property
-       */ 
-       var fireEvent = function( key, value ) {
-               YAHOO.log("Firing Config event: " + key + "=" + value, "info");
-               
-               key = key.toLowerCase();
-
-               var property = config[key];
-
-               if (typeof property != 'undefined' && property.event) {
-                       property.event.fire(value);
-               }       
-       };
-       /* End Private Members */
-
-       /**
-       * Adds a property to the Config Object's private config hash.
-       * @method addProperty
-       * @param {String}       key     The configuration property's name
-       * @param {Object}       propertyObject  The Object containing all of this property's arguments
-       */
-       this.addProperty = function( key, propertyObject ) {
-               key = key.toLowerCase();
-               
-               YAHOO.log("Added property: " + key, "info");
-
-               config[key] = propertyObject;
-
-               propertyObject.event = new YAHOO.util.CustomEvent(key);
-               propertyObject.key = key;
-
-               if (propertyObject.handler) {
-                       propertyObject.event.subscribe(propertyObject.handler, this.owner, true);
-               }
-
-               this.setProperty(key, propertyObject.value, true);
-               
-               if (! propertyObject.suppressEvent) {
-                       this.queueProperty(key, propertyObject.value);
-               }
-       };
-
-       /**
-       * Returns a key-value configuration map of the values currently set in the Config Object.
-       * @method getConfig
-       * @return {Object} The current config, represented in a key-value map
-       */
-       this.getConfig = function() {
-               var cfg = {};
-                       
-               for (var prop in config) {
-                       var property = config[prop];
-                       if (typeof property != 'undefined' && property.event) {
-                               cfg[prop] = property.value;
-                       }
-               }
-               
-               return cfg;
-       };
-
-       /**
-       * Returns the value of specified property.
-       * @method getProperty
-       * @param {String} key   The name of the property
-       * @return {Object}              The value of the specified property
-       */
-       this.getProperty = function(key) {
-               key = key.toLowerCase();
-
-               var property = config[key];
-               if (typeof property != 'undefined' && property.event) {
-                       return property.value;
-               } else {
-                       return undefined;
-               }
-       };
-
-       /**
-       * Resets the specified property's value to its initial value.
-       * @method resetProperty
-       * @param {String} key   The name of the property
-       * @return {Boolean} True is the property was reset, false if not
-       */
-       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]);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.
-       * @method setProperty
-       * @param {String} key           The name of the property
-       * @param {String} value         The value to set the property to
-       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.
-       * @return {Boolean}                     True, if the set was successful, false if it failed.
-       */
-       this.setProperty = function(key, value, silent) {
-               key = key.toLowerCase();
-               
-               YAHOO.log("setProperty: " + key + "=" + value, "info");
-
-               if (this.queueInProgress && ! silent) {
-                       this.queueProperty(key,value); // Currently running through a queue... 
-                       return true;
-               } else {
-                       var property = config[key];
-                       if (typeof property != 'undefined' && property.event) {
-                               if (property.validator && ! property.validator(value)) { // validator
-                                       return false;
-                               } else {
-                                       property.value = value;
-                                       if (! silent) {
-                                               fireEvent(key, value);
-                                               this.configChangedEvent.fire([key, value]);
-                                       }
-                                       return true;
-                               }
-                       } else {
-                               return false;
-                       }
-               }
-       };
-
-       /**
-       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is
-       * moved from its current position to the end of the queue.
-       * @method queueProperty
-       * @param {String} key   The name of the property
-       * @param {String} value The value to set the property to
-       * @return {Boolean}             true, if the set was successful, false if it failed.
-       */      
-       this.queueProperty = function(key, value) {
-               key = key.toLowerCase();
-
-               YAHOO.log("queueProperty: " + key + "=" + value, "info");
-
-               var property = config[key];
-                                                       
-               if (typeof property != 'undefined' && property.event) {
-                       if (typeof value != 'undefined' && property.validator && ! property.validator(value)) { // validator
-                               return false;
-                       } else {
-
-                               if (typeof value != 'undefined') {
-                                       property.value = value;
-                               } else {
-                                       value = property.value;
-                               }
-
-                               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) {
-                                                       // found a dupe... push to end of queue, null current item, and break
-                                                       eventQueue[i] = null;
-                                                       eventQueue.push([key, (typeof value != 'undefined' ? value : queueItemValue)]);
-                                                       foundDuplicate = true;
-                                                       break;
-                                               }
-                                       }
-                               }
-                               
-                               if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue
-                                       eventQueue.push([key, value]);
-                               }
-                       }
-
-                       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;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-       
-                       YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");
-
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Fires the event for a property using the property's current value.
-       * @method refireEvent
-       * @param {String} key   The name of the property
-       */
-       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);
-                       }
-               }
-       };
-
-       /**
-       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.
-       * Although the values will be set, fireQueue() must be called for their associated events to execute.
-       * @method applyConfig
-       * @param {Object}       userConfig      The configuration Object literal
-       * @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.
-       */
-       this.applyConfig = function(userConfig, init) {
-               if (init) {
-                       initialConfig = userConfig;
-               }
-               for (var prop in userConfig) {
-                       this.queueProperty(prop, userConfig[prop]);
-               }
-       };
-
-       /**
-       * Refires the events for all configuration properties using their current values.
-       * @method refresh
-       */
-       this.refresh = function() {
-               for (var prop in config) {
-                       this.refireEvent(prop);
-               }
-       };
-
-       /**
-       * Fires the normalized list of queued property change events
-       * @method fireQueue
-       */
-       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);
-                       }
-               }
-               
-               this.queueInProgress = false;
-               eventQueue = [];
-       };
-
-       /**
-       * Subscribes an external handler to the change event for any given property. 
-       * @method subscribeToConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.
-       * @return {Boolean}                             True, if the subscription was successful, otherwise false.
-       */      
-       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);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Unsubscribes an external handler from the change event for any given property. 
-       * @method unsubscribeFromConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @return {Boolean}                             True, if the unsubscription was successful, otherwise 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;
-               }
-       };
-
-       /**
-       * Returns a string representation of the Config object
-       * @method toString
-       * @return {String}      The Config object in string format.
-       */
-       this.toString = function() {
-               var output = "Config";
-               if (this.owner) {
-                       output += " [" + this.owner.toString() + "]";
-               }
-               return output;
-       };
-
-       /**
-       * Returns a string representation of the Config object's current CustomEvent queue
-       * @method outputEventQueue
-       * @return {String}      The string list of CustomEvents currently queued for execution
-       */
-       this.outputEventQueue = function() {
-               var output = "";
-               for (var q=0;q<eventQueue.length;q++) {
-                       var queueItem = eventQueue[q];
-                       if (queueItem) {
-                               output += queueItem[0] + "=" + queueItem[1] + ", ";
-                       }
-               }
-               return output;
-       };
-};
-
-/**
-* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent
-* @method YAHOO.util.Config.alreadySubscribed
-* @static
-* @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions
-* @param {Function}    fn      The function to look for in the subscribers list
-* @param {Object}      obj     The execution scope Object for the subscription
-* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in
-*/
-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;
-               }
-       }
-       return false;
-};
-
-/**
-*  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.
-* @module container
-* @title Container
-* @requires yahoo,dom,event,dragdrop,animation
-*/
+version: 2.3.0
+*/
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.util
+    * @class Config
+    * @constructor
+    * @param {Object} owner The owner Object to which this Config Object belongs
+    */
+    YAHOO.util.Config = function (owner) {
+    
+        if (owner) {
+    
+            this.init(owner);
+    
+        }
+    
+        if (!owner) { 
+        
+            YAHOO.log("No owner specified for Config object", "error"); 
+    
+        }
+    
+    };
 
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Module
-* @constructor
-* @param {String} el                   The element ID representing the Module <em>OR</em>
-* @param {HTMLElement} el              The element representing the Module
-* @param {Object} userConfig   The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
-*/
-YAHOO.widget.Module = function(el, userConfig) {
-       if (el) { 
-               this.init(el, userConfig); 
-       } else {
-               YAHOO.log("No element or element ID specified for Module instantiation", "error");
-       }
-};
-
-/**
-* Constant representing the prefix path to use for non-secure images
-* @property YAHOO.widget.Module.IMG_ROOT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.IMG_ROOT = "http://us.i1.yimg.com/us.yimg.com/i/";
-
-/**
-* Constant representing the prefix path to use for securely served images
-* @property YAHOO.widget.Module.IMG_ROOT_SSL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.IMG_ROOT_SSL = "https://a248.e.akamai.net/sec.yimg.com/i/";
-
-/**
-* Constant for the default CSS class name that represents a Module
-* @property YAHOO.widget.Module.CSS_MODULE
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_MODULE = "module";
-
-/**
-* Constant representing the module header
-* @property YAHOO.widget.Module.CSS_HEADER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_HEADER = "hd";
-
-/**
-* Constant representing the module body
-* @property YAHOO.widget.Module.CSS_BODY
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_BODY = "bd";
-
-/**
-* Constant representing the module footer
-* @property YAHOO.widget.Module.CSS_FOOTER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_FOOTER = "ft";
-
-/**
-* Constant representing the url for the "src" attribute of the iframe used to monitor changes to the browser's base font size
-* @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";
-
-/**
-* Singleton CustomEvent fired when the font size is changed in the browser.
-* Opera's "zoom" functionality currently does not support text size detection.
-* @event YAHOO.widget.Module.textResizeEvent
-*/     
-YAHOO.widget.Module.textResizeEvent = new YAHOO.util.CustomEvent("textResize");
-
-YAHOO.widget.Module.prototype = {
-       /**
-       * The class's constructor function
-       * @property contructor
-       * @type Function
-       */
-       constructor : YAHOO.widget.Module,
-
-       /**
-       * The main module element that contains the header, body, and footer
-       * @property element
-       * @type HTMLElement
-       */
-       element : null, 
-
-       /**
-       * The header element, denoted with CSS class "hd"
-       * @property header
-       * @type HTMLElement
-       */
-       header : null,
-
-       /**
-       * The body element, denoted with CSS class "bd"
-       * @property body
-       * @type HTMLElement
-       */
-       body : null,
-
-       /**
-       * The footer element, denoted with CSS class "ft"
-       * @property footer
-       * @type HTMLElement
-       */
-       footer : null,
-
-       /**
-       * The id of the element
-       * @property id
-       * @type String
-       */
-       id : null,
-
-       /**
-       * The String representing the image root
-       * @property imageRoot
-       * @type String
-       */
-       imageRoot : YAHOO.widget.Module.IMG_ROOT,
-               
-       /**
-       * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-       * @method initEvents
-       */
-       initEvents : function() {
-
-               /**
-               * CustomEvent fired prior to class initalization.
-               * @event beforeInitEvent
-               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
-               */
-               this.beforeInitEvent = new YAHOO.util.CustomEvent("beforeInit");
-
-               /**
-               * CustomEvent fired after class initalization.
-               * @event initEvent
-               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
-               */              
-               this.initEvent = new YAHOO.util.CustomEvent("init");
-
-               /**
-               * CustomEvent fired when the Module is appended to the DOM
-               * @event appendEvent
-               */
-               this.appendEvent = new YAHOO.util.CustomEvent("append");
-
-               /**
-               * CustomEvent fired before the Module is rendered
-               * @event beforeRenderEvent
-               */
-               this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");
-
-               /**
-               * CustomEvent fired after the Module is rendered
-               * @event renderEvent
-               */
-               this.renderEvent = new YAHOO.util.CustomEvent("render");
-       
-               /**
-               * CustomEvent fired when the header content of the Module is modified
-               * @event changeHeaderEvent
-               * @param {String/HTMLElement} content   String/element representing the new header content
-               */
-               this.changeHeaderEvent = new YAHOO.util.CustomEvent("changeHeader");
-               
-               /**
-               * CustomEvent fired when the body content of the Module is modified
-               * @event changeBodyEvent
-               * @param {String/HTMLElement} content   String/element representing the new body content
-               */              
-               this.changeBodyEvent = new YAHOO.util.CustomEvent("changeBody");
-               
-               /**
-               * CustomEvent fired when the footer content of the Module is modified
-               * @event changeFooterEvent
-               * @param {String/HTMLElement} content   String/element representing the new footer content
-               */
-               this.changeFooterEvent = new YAHOO.util.CustomEvent("changeFooter");
-
-               /**
-               * CustomEvent fired when the content of the Module is modified
-               * @event changeContentEvent
-               */
-               this.changeContentEvent = new YAHOO.util.CustomEvent("changeContent");
-
-               /**
-               * CustomEvent fired when the Module is destroyed
-               * @event destroyEvent
-               */
-               this.destroyEvent = new YAHOO.util.CustomEvent("destroy");
-               
-               /**
-               * CustomEvent fired before the Module is shown
-               * @event beforeShowEvent
-               */
-               this.beforeShowEvent = new YAHOO.util.CustomEvent("beforeShow");
-
-               /**
-               * CustomEvent fired after the Module is shown
-               * @event showEvent
-               */
-               this.showEvent = new YAHOO.util.CustomEvent("show");
-
-               /**
-               * CustomEvent fired before the Module is hidden
-               * @event beforeHideEvent
-               */
-               this.beforeHideEvent = new YAHOO.util.CustomEvent("beforeHide");
-
-               /**
-               * CustomEvent fired after the Module is hidden
-               * @event hideEvent
-               */
-               this.hideEvent = new YAHOO.util.CustomEvent("hide");
-       }, 
-
-       /**
-       * String representing the current user-agent platform
-       * @property platform
-       * @type String
-       */
-       platform : function() {
-                                       var ua = navigator.userAgent.toLowerCase();
-                                       if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
-                                               return "windows";
-                                       } else if (ua.indexOf("macintosh") != -1) {
-                                               return "mac";
-                                       } else {
-                                               return false;
-                                       }
-                               }(),
-
-       /**
-       * String representing the current user-agent browser
-       * @property browser
-       * @type String
-       */
-       browser : function() {
-                       var ua = navigator.userAgent.toLowerCase();
-                                 if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
-                                        return 'opera';
-                                 } else if (ua.indexOf('msie 7')!=-1) { // IE7
-                                        return 'ie7';
-                                 } else if (ua.indexOf('msie') !=-1) { // IE
-                                        return 'ie';
-                                 } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
-                                        return 'safari';
-                                 } else if (ua.indexOf('gecko') != -1) { // Gecko
-                                        return 'gecko';
-                                 } else {
-                                        return false;
-                                 }
-                       }(),
-
-       /**
-       * Boolean representing whether or not the current browsing context is secure (https)
-       * @property isSecure
-       * @type Boolean
-       */
-       isSecure : function() {
-               if (window.location.href.toLowerCase().indexOf("https") === 0) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }(),
-
-       /**
-       * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-       */
-       initDefaultConfig : function() {
-               // Add properties //
-               
-               /**
-               * Specifies whether the Module is visible on the page.
-               * @config visible
-               * @type Boolean
-               * @default true
-               */
-               this.cfg.addProperty("visible", { value:true, handler:this.configVisible, validator:this.cfg.checkBoolean } );
-               
-               /**
-               * Object or array of objects representing the ContainerEffect classes that are active for animating the container.
-               * @config effect
-               * @type Object
-               * @default null
-               */
-               this.cfg.addProperty("effect", { suppressEvent:true, supercedes:["visible"] } );
-               
-               /**
-               * Specifies whether to create a special proxy iframe to monitor for user font resizing in the document
-               * @config monitorresize
-               * @type Boolean
-               * @default true
-               */
-               this.cfg.addProperty("monitorresize", { value:true, handler:this.configMonitorResize } );
-       },
-
-       /**
-       * 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.
-       * @method init
-       * @param {String}       el      The element ID representing the Module <em>OR</em>
-       * @param {HTMLElement}  el      The element representing the Module
-       * @param {Object}       userConfig      The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
-       */
-       init : function(el, userConfig) {
-
-               this.initEvents();
-
-               this.beforeInitEvent.fire(YAHOO.widget.Module);
-
-               /**
-               * The Module's Config object used for monitoring configuration properties.
-               * @property cfg
-               * @type YAHOO.util.Config
-               */
-               this.cfg = new YAHOO.util.Config(this);
-               
-               if (this.isSecure) {
-                       this.imageRoot = YAHOO.widget.Module.IMG_ROOT_SSL;
-               }
-
-               if (typeof el == "string") {
-                       var elId = el;
-
-                       el = document.getElementById(el);
-                       if (! el) {
-                               el = document.createElement("DIV");
-                               el.id = elId;
-                       }
-               }
-
-               this.element = el;
-               
-               if (el.id) {
-                       this.id = el.id;
-               } 
-
-               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;
-                               }
-                       }
-               }
-
-               this.initDefaultConfig();
-
-               YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Module.CSS_MODULE);
-
-               if (userConfig) {
-                       this.cfg.applyConfig(userConfig, true);
-               }
-
-               // Subscribe to the fireQueue() method of Config so that any queued configuration changes are
-               // excecuted upon render of the Module
-               if (! YAHOO.util.Config.alreadySubscribed(this.renderEvent, this.cfg.fireQueue, this.cfg)) {
-                       this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
-               }
-
-               this.initEvent.fire(YAHOO.widget.Module);
-       },
-
-       /**
-       * Initialized an empty IFRAME that is placed out of the visible area that can be used to detect text resize.
-       * @method initResizeMonitor
-       */
-       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;
-    
-                }                
-
-                resizeMonitor.id = "_yuiResizeMonitor";
-                resizeMonitor.style.visibility = "hidden";
-                
-                document.body.appendChild(resizeMonitor);
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,        
+        Config = YAHOO.util.Config;
     
-                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";
+
+    /**
+     * Constant representing the CustomEvent type for the config changed event.
+     * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT
+     * @private
+     * @static
+     * @final
+     */
+    Config.CONFIG_CHANGED_EVENT = "configChanged";
+    
+    /**
+     * Constant representing the boolean type string
+     * @property YAHOO.util.Config.BOOLEAN_TYPE
+     * @private
+     * @static
+     * @final
+     */
+    Config.BOOLEAN_TYPE = "boolean";
+    
+    Config.prototype = {
+     
+        /**
+        * Object reference to the owner of this Config Object
+        * @property owner
+        * @type Object
+        */
+        owner: null,
+        
+        /**
+        * Boolean flag that specifies whether a queue is currently 
+        * being executed
+        * @property queueInProgress
+        * @type Boolean
+        */
+        queueInProgress: false,
+        
+        /**
+        * Maintains the local collection of configuration property objects and 
+        * their specified values
+        * @property config
+        * @private
+        * @type Object
+        */ 
+        config: null,
+        
+        /**
+        * Maintains the local collection of configuration property objects as 
+        * they were initially applied.
+        * This object is used when resetting a property.
+        * @property initialConfig
+        * @private
+        * @type Object
+        */ 
+        initialConfig: null,
+        
+        /**
+        * Maintains the local, normalized CustomEvent queue
+        * @property eventQueue
+        * @private
+        * @type Object
+        */ 
+        eventQueue: null,
+        
+        /**
+        * Custom Event, notifying subscribers when Config properties are set 
+        * (setProperty is called without the silent flag
+        * @event configChangedEvent
+        */
+        configChangedEvent: null,
     
-                if(!bIE) {
+        /**
+        * Initializes the configuration Object and all of its local members.
+        * @method init
+        * @param {Object} owner The owner Object to which this Config 
+        * Object belongs
+        */
+        init: function (owner) {
     
-                    var doc = resizeMonitor.contentWindow.document;
+            this.owner = owner;
     
-                    doc.open();
-                    doc.close();
+            this.configChangedEvent = 
+                this.createEvent(Config.CONFIG_CHANGED_EVENT);
+    
+            this.configChangedEvent.signature = CustomEvent.LIST;
+            this.queueInProgress = false;
+            this.config = {};
+            this.initialConfig = {};
+            this.eventQueue = [];
+        
+        },
+        
+        /**
+        * Validates that the value passed in is a Boolean.
+        * @method checkBoolean
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */ 
+        checkBoolean: function (val) {
+            return (typeof val == Config.BOOLEAN_TYPE);
+        },
+        
+        /**
+        * Validates that the value passed in is a number.
+        * @method checkNumber
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */
+        checkNumber: function (val) {
+            return (!isNaN(val));
+        },
+        
+        /**
+        * Fires a configuration property event using the specified value. 
+        * @method fireEvent
+        * @private
+        * @param {String} key The configuration property's name
+        * @param {value} Object The value of the correct type for the property
+        */ 
+        fireEvent: function ( key, value ) {
+            YAHOO.log("Firing Config event: " + key + "=" + value, "info");
+            var property = this.config[key];
+        
+            if (property && property.event) {
+                property.event.fire(value);
+            } 
+        },
+        
+        /**
+        * Adds a property to the Config Object's private config hash.
+        * @method addProperty
+        * @param {String} key The configuration property's name
+        * @param {Object} propertyObject The Object containing all of this 
+        * property's arguments
+        */
+        addProperty: function ( key, propertyObject ) {
+            key = key.toLowerCase();
+            YAHOO.log("Added property: " + key, "info");
+        
+            this.config[key] = propertyObject;
+        
+            propertyObject.event = this.createEvent(key, { scope: this.owner });
+            propertyObject.event.signature = CustomEvent.LIST;
+            
+            
+            propertyObject.key = key;
+        
+            if (propertyObject.handler) {
+                propertyObject.event.subscribe(propertyObject.handler, 
+                    this.owner);
+            }
+        
+            this.setProperty(key, propertyObject.value, true);
+            
+            if (! propertyObject.suppressEvent) {
+                this.queueProperty(key, propertyObject.value);
+            }
+            
+        },
+        
+        /**
+        * Returns a key-value configuration map of the values currently set in  
+        * the Config Object.
+        * @method getConfig
+        * @return {Object} The current config, represented in a key-value map
+        */
+        getConfig: function () {
+        
+            var cfg = {},
+                prop,
+                property;
                 
+            for (prop in this.config) {
+                property = this.config[prop];
+                if (property && property.event) {
+                    cfg[prop] = property.value;
                 }
             }
+            
+            return cfg;
+        },
+        
+        /**
+        * Returns the value of specified property.
+        * @method getProperty
+        * @param {String} key The name of the property
+        * @return {Object}  The value of the specified property
+        */
+        getProperty: function (key) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.value;
+            } else {
+                return undefined;
+            }
+        },
+        
+        /**
+        * Resets the specified property's value to its initial value.
+        * @method resetProperty
+        * @param {String} key The name of the property
+        * @return {Boolean} True is the property was reset, false if not
+        */
+        resetProperty: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event) {
+    
+                if (this.initialConfig[key] && 
+                    !Lang.isUndefined(this.initialConfig[key])) {
     
-                       var fireTextResize = function() {
-                               YAHOO.widget.Module.textResizeEvent.fire();
-                       };
+                    this.setProperty(key, this.initialConfig[key]);
 
-            if(resizeMonitor && resizeMonitor.contentWindow) {
-                this.resizeMonitor = resizeMonitor;
-                               
-                               YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize, this, true);
-                               
-                               if (! YAHOO.widget.Module.textResizeInitialized) {
-                                       if (! YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", fireTextResize)) {
-                                               // This will fail in IE if document.domain has changed, so we must change the listener to
-                                               // use the resizeMonitor element instead
-                                               YAHOO.util.Event.addListener(this.resizeMonitor, "resize", fireTextResize);
-                                       }
-                                       YAHOO.widget.Module.textResizeInitialized = true;
-                               }
+                    return true;
+    
+                }
+    
+            } else {
+    
+                return false;
             }
+    
+        },
         
-        }
+        /**
+        * Sets the value of a property. If the silent property is passed as 
+        * true, the property's event will not be fired.
+        * @method setProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @param {Boolean} silent Whether the value should be set silently, 
+        * without firing the property event.
+        * @return {Boolean} True, if the set was successful, false if it failed.
+        */
+        setProperty: function (key, value, silent) {
+        
+            var property;
+        
+            key = key.toLowerCase();
+            YAHOO.log("setProperty: " + key + "=" + value, "info");
+        
+            if (this.queueInProgress && ! silent) {
+                // Currently running through a queue... 
+                this.queueProperty(key,value);
+                return true;
+    
+            } else {
+                property = this.config[key];
+                if (property && property.event) {
+                    if (property.validator && !property.validator(value)) {
+                        return false;
+                    } else {
+                        property.value = value;
+                        if (! silent) {
+                            this.fireEvent(key, value);
+                            this.configChangedEvent.fire([key, value]);
+                        }
+                        return true;
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        
+        /**
+        * Sets the value of a property and queues its event to execute. If the 
+        * event is already scheduled to execute, it is
+        * moved from its current position to the end of the queue.
+        * @method queueProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @return {Boolean}  true, if the set was successful, false if 
+        * it failed.
+        */ 
+        queueProperty: function (key, value) {
+        
+            key = key.toLowerCase();
+            YAHOO.log("queueProperty: " + key + "=" + value, "info");
+        
+            var property = this.config[key],
+                foundDuplicate = false,
+                iLen,
+                queueItem,
+                queueItemKey,
+                queueItemValue,
+                sLen,
+                supercedesCheck,
+                qLen,
+                queueItemCheck,
+                queueItemCheckKey,
+                queueItemCheckValue,
+                i,
+                s,
+                q;
+                                
+            if (property && property.event) {
+    
+                if (!Lang.isUndefined(value) && property.validator && 
+                    !property.validator(value)) { // validator
+                    return false;
+                } else {
+        
+                    if (!Lang.isUndefined(value)) {
+                        property.value = value;
+                    } else {
+                        value = property.value;
+                    }
+        
+                    foundDuplicate = false;
+                    iLen = this.eventQueue.length;
+        
+                    for (i = 0; i < iLen; i++) {
+                        queueItem = this.eventQueue[i];
+        
+                        if (queueItem) {
+                            queueItemKey = queueItem[0];
+                            queueItemValue = queueItem[1];
+                            
+                            if (queueItemKey == key) {
+    
+                                /*
+                                    found a dupe... push to end of queue, null 
+                                    current item, and break
+                                */
+    
+                                this.eventQueue[i] = null;
+    
+                                this.eventQueue.push(
+                                    [key, (!Lang.isUndefined(value) ? 
+                                    value : queueItemValue)]);
+    
+                                foundDuplicate = true;
+                                break;
+                            }
+                        }
+                    }
+                    
+                    // this is a refire, or a new property in the queue
+    
+                    if (! foundDuplicate && !Lang.isUndefined(value)) { 
+                        this.eventQueue.push([key, value]);
+                    }
+                }
+        
+                if (property.supercedes) {
+        
+                    sLen = property.supercedes.length;
+        
+                    for (s = 0; s < sLen; s++) {
+        
+                        supercedesCheck = property.supercedes[s];
+                        qLen = this.eventQueue.length;
+        
+                        for (q = 0; q < qLen; q++) {
+                            queueItemCheck = this.eventQueue[q];
+        
+                            if (queueItemCheck) {
+                                queueItemCheckKey = queueItemCheck[0];
+                                queueItemCheckValue = queueItemCheck[1];
+                                
+                                if (queueItemCheckKey == 
+                                    supercedesCheck.toLowerCase() ) {
+    
+                                    this.eventQueue.push([queueItemCheckKey, 
+                                        queueItemCheckValue]);
+    
+                                    this.eventQueue[q] = null;
+                                    break;
+    
+                                }
+                            }
+                        }
+                    }
+                }
 
-       },
-
-       /**
-       * Event handler fired when the resize monitor element is resized.
-       * @method onDomResize
-       * @param {DOMEvent} e   The DOM resize event
-       * @param {Object} obj   The scope object passed to the handler
-       */
-       onDomResize : function(e, obj) { 
-
-        var nLeft = -1 * this.resizeMonitor.offsetWidth,
-            nTop = -1 * this.resizeMonitor.offsetHeight;
-        
-        this.resizeMonitor.style.top = nTop + "px";
-        this.resizeMonitor.style.left =  nLeft + "px";
-       
-       },
-
-       /**
-       * Sets the Module's header content to the HTML specified, or appends the passed element to the header. If no header is present, one will be automatically created.
-       * @method setHeader
-       * @param {String}       headerContent   The HTML used to set the header <em>OR</em>
-       * @param {HTMLElement}  headerContent   The HTMLElement to append to the header
-       */      
-       setHeader : function(headerContent) {
-               if (! this.header) {
-                       this.header = document.createElement("DIV");
-                       this.header.className = YAHOO.widget.Module.CSS_HEADER;
-               }
-               
-               if (typeof headerContent == "string") {
-                       this.header.innerHTML = headerContent;
-               } else {
-                       this.header.innerHTML = "";
-                       this.header.appendChild(headerContent);
-               }
-
-               this.changeHeaderEvent.fire(headerContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the header. If no header is present, one will be automatically created.
-       * @method appendToHeader
-       * @param {HTMLElement}  element The element to append to the header
-       */      
-       appendToHeader : function(element) {
-               if (! this.header) {
-                       this.header = document.createElement("DIV");
-                       this.header.className = YAHOO.widget.Module.CSS_HEADER;
-               }
-               
-               this.header.appendChild(element);
-               this.changeHeaderEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Sets the Module's body content to the HTML specified, or appends the passed element to the body. If no body is present, one will be automatically created.
-       * @method setBody
-       * @param {String}       bodyContent     The HTML used to set the body <em>OR</em>
-       * @param {HTMLElement}  bodyContent     The HTMLElement to append to the body
-       */              
-       setBody : function(bodyContent) {
-               if (! this.body) {
-                       this.body = document.createElement("DIV");
-                       this.body.className = YAHOO.widget.Module.CSS_BODY;
-               }
-
-               if (typeof bodyContent == "string")
-               {
-                       this.body.innerHTML = bodyContent;
-               } else {
-                       this.body.innerHTML = "";
-                       this.body.appendChild(bodyContent);
-               }
-
-               this.changeBodyEvent.fire(bodyContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the body. If no body is present, one will be automatically created.
-       * @method appendToBody
-       * @param {HTMLElement}  element The element to append to the body
-       */
-       appendToBody : function(element) {
-               if (! this.body) {
-                       this.body = document.createElement("DIV");
-                       this.body.className = YAHOO.widget.Module.CSS_BODY;
-               }
-
-               this.body.appendChild(element);
-               this.changeBodyEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method setFooter
-       * @param {String}       footerContent   The HTML used to set the footer <em>OR</em>
-       * @param {HTMLElement}  footerContent   The HTMLElement to append to the footer
-       */      
-       setFooter : function(footerContent) {
-               if (! this.footer) {
-                       this.footer = document.createElement("DIV");
-                       this.footer.className = YAHOO.widget.Module.CSS_FOOTER;
-               }
-
-               if (typeof footerContent == "string") {
-                       this.footer.innerHTML = footerContent;
-               } else {
-                       this.footer.innerHTML = "";
-                       this.footer.appendChild(footerContent);
-               }
-
-               this.changeFooterEvent.fire(footerContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the footer. If no footer is present, one will be automatically created.
-       * @method appendToFooter
-       * @param {HTMLElement}  element The element to append to the footer
-       */
-       appendToFooter : function(element) {
-               if (! this.footer) {
-                       this.footer = document.createElement("DIV");
-                       this.footer.className = YAHOO.widget.Module.CSS_FOOTER;
-               }
-
-               this.footer.appendChild(element);
-               this.changeFooterEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method render
-       * @param {String}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>
-       * @param {HTMLElement}  appendToNode    The element to which the Module should be appended to prior to rendering        
-       * @param {HTMLElement}  moduleElement   OPTIONAL. The element that represents the actual Standard Module container. 
-       * @return {Boolean} Success or failure of the render
-       */
-       render : function(appendToNode, moduleElement) {
-               this.beforeRenderEvent.fire();
-
-               if (! moduleElement) {
-                       moduleElement = this.element;
-               }
-
-               var me = this;
-               var appendTo = function(element) {
-                       if (typeof element == "string") {
-                               element = document.getElementById(element);
-                       }
-                       
-                       if (element) {
-                               element.appendChild(me.element);
-                               me.appendEvent.fire();
-                       }
-               };
-
-               if (appendToNode) {
-                       appendTo(appendToNode);
-               } else { // No node was passed in. If the element is not pre-marked up, this fails
-                       if (! YAHOO.util.Dom.inDocument(this.element)) {
-                               YAHOO.log("Render failed. Must specify appendTo node if Module isn't already in the DOM.", "error");
-                               return false;
-                       }
-               }
-
-               // Need to get everything into the DOM if it isn't already
-               
-               if (this.header && ! YAHOO.util.Dom.inDocument(this.header)) {
-                       // There is a header, but it's not in the DOM yet... need to add it
-                       var firstChild = moduleElement.firstChild;
-                       if (firstChild) { // Insert before first child if exists
-                               moduleElement.insertBefore(this.header, firstChild);
-                       } else { // Append to empty body because there are no children
-                               moduleElement.appendChild(this.header);
-                       }
-               }
-
-               if (this.body && ! YAHOO.util.Dom.inDocument(this.body)) {
-                       // There is a body, but it's not in the DOM yet... need to add it
-                       if (this.footer && YAHOO.util.Dom.isAncestor(this.moduleElement, this.footer)) { // Insert before footer if exists in DOM
-                               moduleElement.insertBefore(this.body, this.footer);
-                       } else { // Append to element because there is no footer
-                               moduleElement.appendChild(this.body);
-                       }
-               }
-
-               if (this.footer && ! YAHOO.util.Dom.inDocument(this.footer)) {
-                       // There is a footer, but it's not in the DOM yet... need to add it
-                       moduleElement.appendChild(this.footer);
-               }
-
-               this.renderEvent.fire();
-               return true;
-       },
-
-       /**
-       * Removes the Module element from the DOM and sets all child elements to null.
-       * @method destroy
-       */
-       destroy : function() {
-               var parent;
-
-               if (this.element) {
-                       YAHOO.util.Event.purgeElement(this.element, true);
-                       parent = this.element.parentNode;
-               }
-               if (parent) {
-                       parent.removeChild(this.element);
-               }
-
-               this.element = null;
-               this.header = null;
-               this.body = null;
-               this.footer = null;
-
-               for (var e in this) {
-                       if (e instanceof YAHOO.util.CustomEvent) {
-                               e.unsubscribeAll();
-                       }
-               }
-
-               YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this);
-
-               this.destroyEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method show
-       */
-       show : function() {
-               this.cfg.setProperty("visible", true);
-       },
-
-       /**
-       * 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.
-       * @method hide
-       */
-       hide : function() {
-               this.cfg.setProperty("visible", false);
-       },
-
-       // BUILT-IN EVENT HANDLERS FOR MODULE //
-
-       /**
-       * Default event handler for changing the visibility property of a Module. By default, this is achieved by switching the "display" style between "block" and "none".
-       * This method is responsible for firing showEvent and hideEvent.
-       * @param {String} type  The CustomEvent type (usually the property name)
-       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
-       * @method configVisible
-       */
-       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();
-               }
-       },
-
-       /**
-       * Default event handler for the "monitorresize" configuration property
-       * @param {String} type  The CustomEvent type (usually the property name)
-       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
-       * @method configMonitorResize
-       */
-       configMonitorResize : function(type, args, obj) {
-               var monitor = args[0];
-               if (monitor) {
-                       this.initResizeMonitor();
-               } else {
-                       YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this, true);
-                       this.resizeMonitor = null;
-               }
-       }
-};
-
-/**
-* Returns a String representation of the Object.
-* @method toString
-* @return {String}     The string representation of the Module
-*/ 
-YAHOO.widget.Module.prototype.toString = function() {
-       return "Module " + this.id;
-};
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Overlay
-* @extends YAHOO.widget.Module
-* @param {String}      el      The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement} el      The element representing the Overlay
-* @param {Object}      userConfig      The configuration object literal containing 10/23/2006the configuration that should be set for this Overlay. See configuration documentation for more details.
-* @constructor
-*/
-YAHOO.widget.Overlay = function(el, userConfig) {
-       YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Overlay, YAHOO.widget.Module);
-
-/**
-* The URL that will be placed in the iframe
-* @property YAHOO.widget.Overlay.IFRAME_SRC
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;";
-
-/**
-* Constant representing the top left corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.TOP_LEFT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.TOP_LEFT = "tl";
-
-/**
-* Constant representing the top right corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.TOP_RIGHT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.TOP_RIGHT = "tr";
-
-/**
-* Constant representing the top bottom left corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.BOTTOM_LEFT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.BOTTOM_LEFT = "bl";
-
-/**
-* Constant representing the bottom right corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.BOTTOM_RIGHT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.BOTTOM_RIGHT = "br";
-
-/**
-* Constant representing the default CSS class used for an Overlay
-* @property YAHOO.widget.Overlay.CSS_OVERLAY
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.CSS_OVERLAY = "overlay";
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement} el      The element representing the Overlay
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.
-*/
-YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {
-       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
-       
-       this.beforeInitEvent.fire(YAHOO.widget.Overlay);
+                YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");
+        
+                return true;
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Fires the event for a property using the property's current value.
+        * @method refireEvent
+        * @param {String} key The name of the property
+        */
+        refireEvent: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event && 
+    
+                !Lang.isUndefined(property.value)) {
+    
+                if (this.queueInProgress) {
+    
+                    this.queueProperty(key);
+    
+                } else {
+    
+                    this.fireEvent(key, property.value);
+    
+                }
+    
+            }
+        },
+        
+        /**
+        * Applies a key-value Object literal to the configuration, replacing  
+        * any existing values, and queueing the property events.
+        * Although the values will be set, fireQueue() must be called for their 
+        * associated events to execute.
+        * @method applyConfig
+        * @param {Object} userConfig The configuration Object literal
+        * @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.
+        */
+        applyConfig: function (userConfig, init) {
+        
+            var sKey,
+                oValue,
+                oConfig;
 
-       YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Overlay.CSS_OVERLAY);
+            if (init) {
 
-       if (userConfig) {
-               this.cfg.applyConfig(userConfig, true);
-       }
+                oConfig = {};
 
-       if (this.platform == "mac" && this.browser == "gecko") {
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)) {
-                       this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)) {
-                       this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);
-               }
-       }
+                for (sKey in userConfig) {
+                
+                    if (Lang.hasOwnProperty(userConfig, sKey)) {
 
-       this.initEvent.fire(YAHOO.widget.Overlay);
+                        oConfig[sKey.toLowerCase()] = userConfig[sKey];
 
-};
+                    }
+                
+                }
 
-/**
-* Initializes the custom events for Overlay which are fired automatically at appropriate times by the Overlay class.
-* @method initEvents
-*/
-YAHOO.widget.Overlay.prototype.initEvents = function() {
-       YAHOO.widget.Overlay.superclass.initEvents.call(this);
-
-       /**
-       * CustomEvent fired before the Overlay is moved.
-       * @event beforeMoveEvent
-       * @param {Number} x     x coordinate
-       * @param {Number} y     y coordinate
-       */
-       this.beforeMoveEvent = new YAHOO.util.CustomEvent("beforeMove", this);
-
-       /**
-       * CustomEvent fired after the Overlay is moved.
-       * @event moveEvent
-       * @param {Number} x     x coordinate
-       * @param {Number} y     y coordinate
-       */
-       this.moveEvent = new YAHOO.util.CustomEvent("move", this);
-};
-
-/**
-* Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Overlay.prototype.initDefaultConfig = function() {
-       YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);
-
-       // Add overlay config properties //
-
-       /**
-       * The absolute x-coordinate position of the Overlay
-       * @config x
-       * @type Number
-       * @default null
-       */      
-       this.cfg.addProperty("x", { handler:this.configX, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * The absolute y-coordinate position of the Overlay
-       * @config y
-       * @type Number
-       * @default null
-       */      
-       this.cfg.addProperty("y", { handler:this.configY, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * An array with the absolute x and y positions of the Overlay
-       * @config xy
-       * @type Number[]
-       * @default null
-       */      
-       this.cfg.addProperty("xy",{ handler:this.configXY, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * 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.
-       * @config context
-       * @type Array
-       * @default null
-       */      
-       this.cfg.addProperty("context", { handler:this.configContext, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * True if the Overlay should be anchored to the center of the viewport.
-       * @config fixedcenter
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty("fixedcenter", { value:false, handler:this.configFixedCenter, validator:this.cfg.checkBoolean, supercedes:["iframe","visible"] } );
-
-       /**
-       * CSS width of the Overlay.
-       * @config width
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty("width", { handler:this.configWidth, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * CSS height of the Overlay.
-       * @config height
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty("height", { handler:this.configHeight, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * CSS z-index of the Overlay.
-       * @config zIndex
-       * @type Number
-       * @default null
-       */
-       this.cfg.addProperty("zIndex", { value:null, handler:this.configzIndex } );
-
-       /**
-       * True if the Overlay should be prevented from being positioned out of the viewport.
-       * @config constraintoviewport
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty("constraintoviewport", { value:false, handler:this.configConstrainToViewport, validator:this.cfg.checkBoolean, supercedes:["iframe","x","y","xy"] } );
-
-       /**
-       * True if the Overlay should have an IFRAME shim (for correcting the select z-index bug in IE6 and below).
-       * @config iframe
-       * @type Boolean
-       * @default true for IE6 and below, false for all others
-       */
-       this.cfg.addProperty("iframe", { value:(this.browser == "ie" ? true : false), handler:this.configIframe, validator:this.cfg.checkBoolean, supercedes:["zIndex"] } );
-};
-
-/**
-* Moves the Overlay to the specified position. This function is identical to calling this.cfg.setProperty("xy", [x,y]);
-* @method moveTo
-* @param {Number}      x       The Overlay's new x position
-* @param {Number}      y       The Overlay's new y position
-*/
-YAHOO.widget.Overlay.prototype.moveTo = function(x, y) {
-       this.cfg.setProperty("xy",[x,y]);
-};
-
-/**
-* Adds a special CSS class to the Overlay when Mac/Gecko is in use, to work around a Gecko bug where
-* scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
-* @method hideMacGeckoScrollbars
-*/
-YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars = function() {
-       YAHOO.util.Dom.removeClass(this.element, "show-scrollbars");
-       YAHOO.util.Dom.addClass(this.element, "hide-scrollbars");
-};
-
-/**
-* Removes a special CSS class from the Overlay when Mac/Gecko is in use, to work around a Gecko bug where
-* scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
-* @method showMacGeckoScrollbars
-*/
-YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars = function() {
-       YAHOO.util.Dom.removeClass(this.element, "hide-scrollbars");
-       YAHOO.util.Dom.addClass(this.element, "show-scrollbars");
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* The default event handler fired when the "visible" property is changed. This method is responsible for firing showEvent and hideEvent.
-* @method configVisible
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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; }
-                       e = e.parentNode;
-               }
-               if (currentVis == "inherit") { 
-                       currentVis = "visible";
-               }
-       }
-
-       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);
-               }
-       }
-
-       var isMacGecko = (this.platform == "mac" && this.browser == "gecko");
-
-       if (visible) { // Show
-               if (isMacGecko) {
-                       this.showMacGeckoScrollbars();
-               }       
-
-               if (effect) { // Animate in
-                       if (visible) { // Animate in if not showing
-                               if (currentVis != "visible" || currentVis === "") {
-                                       this.beforeShowEvent.fire();
-                                       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); // Delegate showEvent until end of animateInComplete
-                                               }
-                                               ei.animateIn();
-                                       }
-                               }
-                       }
-               } else { // Show
-                       if (currentVis != "visible" || currentVis === "") {
-                               this.beforeShowEvent.fire();
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "visible");
-                               this.cfg.refireEvent("iframe");
-                               this.showEvent.fire();
-                       }
-               }
-
-       } else { // Hide
-               if (isMacGecko) {
-                       this.hideMacGeckoScrollbars();
-               }       
-
-               if (effect) { // Animate out if showing
-                       if (currentVis == "visible") {
-                               this.beforeHideEvent.fire();
-                               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); // Delegate hideEvent until end of animateOutComplete
-                                       }
-                                       h.animateOut();
-                               }
-                       } else if (currentVis === "") {
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");
-                       }
-               } else { // Simple hide
-                       if (currentVis == "visible" || currentVis === "") {
-                               this.beforeHideEvent.fire();
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");
-                               this.cfg.refireEvent("iframe");
-                               this.hideEvent.fire();
-                       }
-               }       
-       }
-};
-
-/**
-* Center event handler used for centering on scroll/resize, but only if the Overlay is visible
-* @method doCenterOnDOMEvent
-*/
-YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent = function() {
-       if (this.cfg.getProperty("visible")) {
-               this.center();
-       }
-};
-
-/**
-* The default event handler fired when the "fixedcenter" property is changed.
-* @method configFixedCenter
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-               }
-               
-               if (! YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent, this.doCenterOnDOMEvent, this)) {
-                       YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);
-               }
-
-               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);
-       }
-};
-
-/**
-* The default event handler fired when the "height" property is changed.
-* @method configHeight
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "width" property is changed.
-* @method configWidth
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "zIndex" property is changed.
-* @method configzIndex
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-               }
-       }
-
-       if (this.iframe) {
-               if (zIndex <= 0) {
-                       zIndex = 1;
-               }
-               YAHOO.util.Dom.setStyle(this.iframe, "zIndex", (zIndex-1));
-       }
-
-       YAHOO.util.Dom.setStyle(el, "zIndex", zIndex);
-       this.cfg.setProperty("zIndex", zIndex, true);
-};
-
-/**
-* The default event handler fired when the "xy" property is changed.
-* @method configXY
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {
-       var pos = args[0];
-       var x = pos[0];
-       var y = pos[1];
+                this.initialConfig = oConfig;
 
-       this.cfg.setProperty("x", x);
-       this.cfg.setProperty("y", y);
+            }
 
-       this.beforeMoveEvent.fire([x,y]);
+            for (sKey in userConfig) {
+            
+                if (Lang.hasOwnProperty(userConfig, sKey)) {
+            
+                    this.queueProperty(sKey, userConfig[sKey]);
+                
+                }
 
-       x = this.cfg.getProperty("x");
-       y = this.cfg.getProperty("y");
+            }
 
-       YAHOO.log("xy: " + [x,y], "iframe");
+        },
+        
+        /**
+        * Refires the events for all configuration properties using their 
+        * current values.
+        * @method refresh
+        */
+        refresh: function () {
+        
+            var prop;
+        
+            for (prop in this.config) {
+                this.refireEvent(prop);
+            }
+        },
+        
+        /**
+        * Fires the normalized list of queued property change events
+        * @method fireQueue
+        */
+        fireQueue: function () {
+        
+            var i, 
+                queueItem,
+                key,
+                value,
+                property;
+        
+            this.queueInProgress = true;
+            for (i = 0;i < this.eventQueue.length; i++) {
+                queueItem = this.eventQueue[i];
+                if (queueItem) {
+        
+                    key = queueItem[0];
+                    value = queueItem[1];
+                    property = this.config[key];
+        
+                    property.value = value;
+        
+                    this.fireEvent(key,value);
+                }
+            }
+            
+            this.queueInProgress = false;
+            this.eventQueue = [];
+        },
+        
+        /**
+        * Subscribes an external handler to the change event for any 
+        * given property. 
+        * @method subscribeToConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event handler 
+        * (see CustomEvent documentation)
+        * @param {Boolean} override Optional. If true, will override "this"  
+        * within the handler to map to the scope Object passed into the method.
+        * @return {Boolean} True, if the subscription was successful, 
+        * otherwise false.
+        */ 
+        subscribeToConfigEvent: function (key, handler, obj, override) {
+    
+            var property = this.config[key.toLowerCase()];
+    
+            if (property && property.event) {
+    
+                if (!Config.alreadySubscribed(property.event, handler, obj)) {
+    
+                    property.event.subscribe(handler, obj, override);
+    
+                }
+    
+                return true;
+    
+            } else {
+    
+                return false;
+    
+            }
+    
+        },
+        
+        /**
+        * Unsubscribes an external handler from the change event for any 
+        * given property. 
+        * @method unsubscribeFromConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event 
+        * handler (see CustomEvent documentation)
+        * @return {Boolean} True, if the unsubscription was successful, 
+        * otherwise false.
+        */
+        unsubscribeFromConfigEvent: function (key, handler, obj) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.event.unsubscribe(handler, obj);
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Returns a string representation of the Config object
+        * @method toString
+        * @return {String} The Config object in string format.
+        */
+        toString: function () {
+            var output = "Config";
+            if (this.owner) {
+                output += " [" + this.owner.toString() + "]";
+            }
+            return output;
+        },
+        
+        /**
+        * Returns a string representation of the Config object's current 
+        * CustomEvent queue
+        * @method outputEventQueue
+        * @return {String} The string list of CustomEvents currently queued 
+        * for execution
+        */
+        outputEventQueue: function () {
+
+            var output = "",
+                queueItem,
+                q,
+                nQueue = this.eventQueue.length;
+              
+            for (q = 0; q < nQueue; q++) {
+                queueItem = this.eventQueue[q];
+                if (queueItem) {
+                    output += queueItem[0] + "=" + queueItem[1] + ", ";
+                }
+            }
+            return output;
+        },
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x,y]);
-};
+        /**
+        * Sets all properties to null, unsubscribes all listeners from each 
+        * property's change event and all listeners from the configChangedEvent.
+        * @method destroy
+        */
+        destroy: function () {
 
-/**
-* The default event handler fired when the "x" property is changed.
-* @method configX
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configX = function(type, args, obj) {
-       var x = args[0];
-       var y = this.cfg.getProperty("y");
+            var oConfig = this.config,
+                sProperty,
+                oProperty;
 
-       this.cfg.setProperty("x", x, true);
-       this.cfg.setProperty("y", y, true);
 
-       this.beforeMoveEvent.fire([x,y]);
+            for (sProperty in oConfig) {
+            
+                if (Lang.hasOwnProperty(oConfig, sProperty)) {
 
-       x = this.cfg.getProperty("x");
-       y = this.cfg.getProperty("y");
+                    oProperty = oConfig[sProperty];
 
-       YAHOO.util.Dom.setX(this.element, x, true);
-       
-       this.cfg.setProperty("xy", [x, y], true);
+                    oProperty.event.unsubscribeAll();
+                    oProperty.event = null;
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x, y]);
-};
+                }
+            
+            }
+            
+            this.configChangedEvent.unsubscribeAll();
+            
+            this.configChangedEvent = null;
+            this.owner = null;
+            this.config = null;
+            this.initialConfig = null;
+            this.eventQueue = null;
+        
+        }
 
-/**
-* The default event handler fired when the "y" property is changed.
-* @method configY
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {
-       var x = this.cfg.getProperty("x");
-       var y = args[0];
+    };
+    
+    
+    
+    /**
+    * Checks to determine if a particular function/Object pair are already 
+    * subscribed to the specified CustomEvent
+    * @method YAHOO.util.Config.alreadySubscribed
+    * @static
+    * @param {YAHOO.util.CustomEvent} evt The CustomEvent for which to check 
+    * the subscriptions
+    * @param {Function} fn The function to look for in the subscribers list
+    * @param {Object} obj The execution scope Object for the subscription
+    * @return {Boolean} true, if the function/Object pair is already subscribed 
+    * to the CustomEvent passed in
+    */
+    Config.alreadySubscribed = function (evt, fn, obj) {
+    
+        var nSubscribers = evt.subscribers.length,
+            subsc,
+            i;
 
-       this.cfg.setProperty("x", x, true);
-       this.cfg.setProperty("y", y, true);
+        if (nSubscribers > 0) {
 
-       this.beforeMoveEvent.fire([x,y]);
+            i = nSubscribers - 1;
+        
+            do {
 
-       x = this.cfg.getProperty("x");
-       y = this.cfg.getProperty("y");
+                subsc = evt.subscribers[i];
 
-       YAHOO.util.Dom.setY(this.element, y, true);
+                if (subsc && subsc.obj == obj && subsc.fn == fn) {
+        
+                    return true;
+        
+                }    
+            
+            }
+            while (i--);
+        
+        }
+    
+        return false;
+    
+    };
+    
+    YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @module container
+    * @title Container
+    * @requires yahoo, dom, event 
+    * @optional dragdrop, animation, button
+    */
+    
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Module
+    * @constructor
+    * @param {String} el The element ID representing the Module <em>OR</em>
+    * @param {HTMLElement} el The element representing the Module
+    * @param {Object} userConfig The configuration Object literal containing 
+    * the configuration that should be set for this module. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Module = function (el, userConfig) {
+    
+        if (el) {
+    
+            this.init(el, userConfig);
+    
+        } else {
+    
+            YAHOO.log("No element or element ID specified" + 
+                " for Module instantiation", "error");
+    
+        }
+    
+    };
 
-       this.cfg.setProperty("xy", [x, y], true);
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x, y]);
-};
+    var Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        Event = YAHOO.util.Event,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Module = YAHOO.widget.Module,
+        
+        m_oModuleTemplate,
+        m_oHeaderTemplate,
+        m_oBodyTemplate,
+        m_oFooterTemplate,
+
+        /**
+        * Constant representing the name of the Module's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_INIT": "beforeInit",
+            "INIT": "init",
+            "APPEND": "append",
+            "BEFORE_RENDER": "beforeRender",
+            "RENDER": "render",
+            "CHANGE_HEADER": "changeHeader",
+            "CHANGE_BODY": "changeBody",
+            "CHANGE_FOOTER": "changeFooter",
+            "CHANGE_CONTENT": "changeContent",
+            "DESTORY": "destroy",
+            "BEFORE_SHOW": "beforeShow",
+            "SHOW": "show",
+            "BEFORE_HIDE": "beforeHide",
+            "HIDE": "hide"
+        
+        },
+            
+        /**
+        * Constant representing the Module's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "VISIBLE": { 
+                key: "visible", 
+                value: true, 
+                validator: YAHOO.lang.isBoolean 
+            },
+        
+            "EFFECT": { 
+                key: "effect", 
+                suppressEvent: true, 
+                supercedes: ["visible"] 
+            },
+        
+            "MONITOR_RESIZE": { 
+                key: "monitorresize", 
+                value: true  
+            }
+        
+        };
 
-/**
-* Shows the iframe shim, if it has been enabled
-* @method showIframe
-*/
-YAHOO.widget.Overlay.prototype.showIframe = function() {
-       if (this.iframe) {
-               this.iframe.style.display = "block";
-       }
-};
-
-/**
-* Hides the iframe shim, if it has been enabled
-* @method hideIframe
-*/
-YAHOO.widget.Overlay.prototype.hideIframe = function() {
-       if (this.iframe) {
-               this.iframe.style.display = "none";
-       }
-};
-
-/**
-* The default event handler fired when the "iframe" property is changed.
-* @method configIframe
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
-
-       var val = args[0];
-
-       if (val) { // IFRAME shim is enabled
-
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, this.showIframe, this)) {
-                       this.showEvent.subscribe(this.showIframe, this, true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, this.hideIframe, this)) {
-                       this.hideEvent.subscribe(this.hideIframe, this, true);
-               }
-
-               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");
-               }
-
-               YAHOO.log("iframe positioning to: " + [x,y], "iframe");
-
-               if (! isNaN(x) && ! isNaN(y)) {
-                       if (! this.iframe) {
-                               this.iframe = document.createElement("iframe");
-                               if (this.isSecure) {
-                                       this.iframe.src = YAHOO.widget.Overlay.IFRAME_SRC;
-                               }
-                               
-                               var parent = this.element.parentNode;
-                               if (parent) {
-                                       parent.appendChild(this.iframe);
-                               } else {
-                                       document.body.appendChild(this.iframe);
-                               }
-
-                               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();
-                               }
-                       }
-                       
-                       var iframeDisplay = YAHOO.util.Dom.getStyle(this.iframe, "display");
-
-                       if (iframeDisplay == "none") {
-                               this.iframe.style.display = "block";
-                       }
-
-                       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";
-               }
-               this.showEvent.unsubscribe(this.showIframe, this);
-               this.hideEvent.unsubscribe(this.hideIframe, this);
-       }
-};
-
-
-/**
-* The default event handler fired when the "constraintoviewport" property is changed.
-* @method configConstrainToViewport
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-       }
-};
-
-/**
-* The default event handler fired when the "context" property is changed.
-* @method configContext
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-                       }
-                       
-                       if (elementMagnetCorner && contextMagnetCorner) {
-                               this.align(elementMagnetCorner, contextMagnetCorner);
-                       }
-               }       
-       }
-};
-
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Aligns the Overlay to its context element using the specified corner points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, and BOTTOM_RIGHT.
-* @method align
-* @param {String} elementAlign         The String representing the corner of the Overlay that should be aligned to the context element
-* @param {String} contextAlign         The corner of the context element that the elementAlign corner should stick to.
-*/
-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];
-               }
-
-               if (! contextAlign) {
-                       contextAlign = contextArgs[2];
-               }
-
-               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;
-                       }
-               }
-       }
-};
-
-/**
-* The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true.
-* @method enforceConstraints
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-       }
-
-       if (y < topConstraint) {
-               y = topConstraint;
-       } else if (y > bottomConstraint) {
-               y = bottomConstraint;
-       }
-
-       this.cfg.setProperty("x", x, true);
-       this.cfg.setProperty("y", y, true);
-       this.cfg.setProperty("xy", [x,y], true);
-};
-
-/**
-* Centers the container in the viewport.
-* @method center
-*/
-YAHOO.widget.Overlay.prototype.center = function() {
-       var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
-       var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+    
+    /**
+    * Constant representing the prefix path to use for non-secure images
+    * @property YAHOO.widget.Module.IMG_ROOT
+    * @static
+    * @final
+    * @type String
+    */
+    Module.IMG_ROOT = null;
+    
+    /**
+    * Constant representing the prefix path to use for securely served images
+    * @property YAHOO.widget.Module.IMG_ROOT_SSL
+    * @static
+    * @final
+    * @type String
+    */
+    Module.IMG_ROOT_SSL = null;
+    
+    /**
+    * Constant for the default CSS class name that represents a Module
+    * @property YAHOO.widget.Module.CSS_MODULE
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_MODULE = "yui-module";
+    
+    /**
+    * Constant representing the module header
+    * @property YAHOO.widget.Module.CSS_HEADER
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_HEADER = "hd";
+    
+    /**
+    * Constant representing the module body
+    * @property YAHOO.widget.Module.CSS_BODY
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_BODY = "bd";
+    
+    /**
+    * Constant representing the module footer
+    * @property YAHOO.widget.Module.CSS_FOOTER
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_FOOTER = "ft";
+    
+    /**
+    * Constant representing the url for the "src" attribute of the iframe 
+    * used to monitor changes to the browser's base font size
+    * @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL
+    * @static
+    * @final
+    * @type String
+    */
+    Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";
+    
+    /**
+    * Singleton CustomEvent fired when the font size is changed in the browser.
+    * Opera's "zoom" functionality currently does not support text 
+    * size detection.
+    * @event YAHOO.widget.Module.textResizeEvent
+    */
+    Module.textResizeEvent = new CustomEvent("textResize");
 
-       var viewPortWidth = YAHOO.util.Dom.getClientWidth();
-       var viewPortHeight = YAHOO.util.Dom.getClientHeight();
 
-       var elementWidth = this.element.offsetWidth;
-       var elementHeight = this.element.offsetHeight;
+    function createModuleTemplate() {
 
-       var x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX;
-       var y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
-               
-       this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
+        if (!m_oModuleTemplate) {
 
-       this.cfg.refireEvent("iframe");
-};
+            m_oModuleTemplate = document.createElement("div");
+            
+            m_oModuleTemplate.innerHTML = ("<div class=\"" + 
+                Module.CSS_HEADER + "\"></div>" + "<div class=\"" + 
+                Module.CSS_BODY + "\"></div><div class=\"" + 
+                Module.CSS_FOOTER + "\"></div>");
 
-/**
-* 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.
-* @method syncPosition
-*/
-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);
-};
-
-/**
-* Event handler fired when the resize monitor element is resized.
-* @method onDomResize
-* @param {DOMEvent} e  The resize DOM event
-* @param {Object} obj  The scope object
-*/
-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);
-};
-
-/**
-* Removes the Overlay element from the DOM and sets all child elements to null.
-* @method destroy
-*/
-YAHOO.widget.Overlay.prototype.destroy = function() {
-       if (this.iframe) {
-               this.iframe.parentNode.removeChild(this.iframe);
-       }
-       
-       this.iframe = null;
-
-       YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-       YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-
-       YAHOO.widget.Overlay.superclass.destroy.call(this);  
-};
-
-/**
-* Returns a String representation of the object.
-* @method toString
-* @return {String} The string representation of the Overlay.
-*/ 
-YAHOO.widget.Overlay.prototype.toString = function() {
-       return "Overlay " + this.id;
-};
-
-/**
-* A singleton CustomEvent used for reacting to the DOM event for window scroll
-* @event YAHOO.widget.Overlay.windowScrollEvent
-*/
-YAHOO.widget.Overlay.windowScrollEvent = new YAHOO.util.CustomEvent("windowScroll");
+            m_oHeaderTemplate = m_oModuleTemplate.firstChild;
+            m_oBodyTemplate = m_oHeaderTemplate.nextSibling;
+            m_oFooterTemplate = m_oBodyTemplate.nextSibling;
 
-/**
-* A singleton CustomEvent used for reacting to the DOM event for window resize
-* @event YAHOO.widget.Overlay.windowResizeEvent
-*/
-YAHOO.widget.Overlay.windowResizeEvent = new YAHOO.util.CustomEvent("windowResize");
+        }
 
-/**
-* The DOM event handler used to fire the CustomEvent for window scroll
-* @method YAHOO.widget.Overlay.windowScrollHandler
-* @static
-* @param {DOMEvent} e The DOM scroll event
-*/
-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;
-               }
-               clearTimeout(window.scrollEnd);
-               window.scrollEnd = setTimeout(function() { YAHOO.widget.Overlay.windowScrollEvent.fire(); }, 1);
-       } else {
-               YAHOO.widget.Overlay.windowScrollEvent.fire();
-       }
-};
-
-/**
-* The DOM event handler used to fire the CustomEvent for window resize
-* @method YAHOO.widget.Overlay.windowResizeHandler
-* @static
-* @param {DOMEvent} e The DOM resize event
-*/
-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;
-               }
-               clearTimeout(window.resizeEnd);
-               window.resizeEnd = setTimeout(function() { YAHOO.widget.Overlay.windowResizeEvent.fire(); }, 100);
-       } else {
-               YAHOO.widget.Overlay.windowResizeEvent.fire();
-       }
-};
-
-/**
-* A boolean that indicated whether the window resize and scroll events have already been subscribed to.
-* @property YAHOO.widget.Overlay._initialized
-* @private
-* @type Boolean
-*/
-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;
-}
-
-/**
-* OverlayManager is used for maintaining the focus status of multiple Overlays.* @namespace YAHOO.widget
-* @namespace YAHOO.widget
-* @class OverlayManager
-* @constructor
-* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.
-* @param {Object}      userConfig              The object literal representing the user configuration of the OverlayManager
-*/
-YAHOO.widget.OverlayManager = function(userConfig) {
-       this.init(userConfig);
-};
-
-/**
-* The CSS class representing a focused Overlay
-* @property YAHOO.widget.OverlayManager.CSS_FOCUSED
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.OverlayManager.CSS_FOCUSED = "focused";
-
-YAHOO.widget.OverlayManager.prototype = {
-       /**
-       * The class's constructor function
-       * @property contructor
-       * @type Function
-       */
-       constructor : YAHOO.widget.OverlayManager,
-
-       /**
-       * The array of Overlays that are currently registered
-       * @property overlays
-       * @type YAHOO.widget.Overlay[]
-       */
-       overlays : null,
-
-       /**
-       * Initializes the default configuration of the OverlayManager
-       * @method initDefaultConfig
-       */      
-       initDefaultConfig : function() {
-               /**
-               * The collection of registered Overlays in use by the OverlayManager
-               * @config overlays
-               * @type YAHOO.widget.Overlay[]
-               * @default null
-               */
-               this.cfg.addProperty("overlays", { suppressEvent:true } );
-
-               /**
-               * The default DOM event that should be used to focus an Overlay
-               * @config focusevent
-               * @type String
-               * @default "mousedown"
-               */
-               this.cfg.addProperty("focusevent", { value:"mousedown" } );
-       }, 
-
-       /**
-       * Initializes the OverlayManager
-       * @method init
-       * @param {YAHOO.widget.Overlay[]}       overlays        Optional. A collection of Overlays to register with the manager.
-       * @param {Object}       userConfig              The object literal representing the user configuration of the OverlayManager
-       */
-       init : function(userConfig) {
-               /**
-               * The OverlayManager's Config object used for monitoring configuration properties.
-               * @property cfg
-               * @type YAHOO.util.Config
-               */
-               this.cfg = new YAHOO.util.Config(this);
-
-               this.initDefaultConfig();
-
-               if (userConfig) {
-                       this.cfg.applyConfig(userConfig, true);
-               }
-               this.cfg.fireQueue();
-
-               /**
-               * The currently activated Overlay
-               * @property activeOverlay
-               * @private
-               * @type YAHOO.widget.Overlay
-               */
-               var activeOverlay = null;
-
-               /**
-               * Returns the currently focused Overlay
-               * @method getActive
-               * @return {YAHOO.widget.Overlay}        The currently focused Overlay
-               */
-               this.getActive = function() {
-                       return activeOverlay;
-               };
-
-               /**
-               * Focuses the specified Overlay
-               * @method focus
-               * @param {YAHOO.widget.Overlay} overlay The Overlay to focus
-               * @param {String} overlay       The id of the Overlay to focus
-               */
-               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));
-                               }
-                               this.overlays.sort(this.compareZIndexDesc);
-                       }
-               };
-
-               /**
-               * Removes the specified Overlay from the manager
-               * @method remove
-               * @param {YAHOO.widget.Overlay} overlay The Overlay to remove
-               * @param {String} overlay       The id of the Overlay to remove
-               */
-               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;
-                       }
-               };
-
-               /**
-               * Removes focus from all registered Overlays in the manager
-               * @method blurAll
-               */
-               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 = [];
-               }
-
-               if (overlays) {
-                       this.register(overlays);
-                       this.overlays.sort(this.compareZIndexDesc);
-               }
-       },
-
-       /**
-       * 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.
-       * @method register
-       * @param {YAHOO.widget.Overlay} overlay         An Overlay to register with the manager.
-       * @param {YAHOO.widget.Overlay[]}       overlay         An array of Overlays to register with the manager.
-       * @return       {Boolean}       True if any Overlays are registered.
-       */
-       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);
-                       }
-                       
-                       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++;
-                               }
-                       }
-                       if (regcount > 0) {
-                               return true;
-                       }
-               } else {
-                       return false;
-               }
-       },
-
-       /**
-       * Attempts to locate an Overlay by instance or ID.
-       * @method find
-       * @param {YAHOO.widget.Overlay} overlay         An Overlay to locate within the manager
-       * @param {String}       overlay         An Overlay id to locate within the manager
-       * @return       {YAHOO.widget.Overlay}  The requested Overlay, if found, or null if it cannot be located.
-       */
-       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];
-                               }
-                       }                       
-               }
-               return null;
-       },
-
-       /**
-       * Used for sorting the manager's Overlays by z-index.
-       * @method compareZIndexDesc
-       * @private
-       * @return {Number}      0, 1, or -1, depending on where the Overlay should fall in the stacking order.
-       */
-       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;
-               }
-       },
-
-       /**
-       * Shows all Overlays in the manager.
-       * @method showAll
-       */
-       showAll : function() {
-               for (var o=0;o<this.overlays.length;o++) {
-                       this.overlays[o].show();
-               }
-       },
-
-       /**
-       * Hides all Overlays in the manager.
-       * @method hideAll
-       */
-       hideAll : function() {
-               for (var o=0;o<this.overlays.length;o++) {
-                       this.overlays[o].hide();
-               }
-       },
-
-       /**
-       * Returns a string representation of the object.
-       * @method toString
-       * @return {String}      The string representation of the OverlayManager
-       */ 
-       toString : function() {
-               return "OverlayManager";
-       }
-
-};
-
-/**
-* KeyListener is a utility that provides an easy interface for listening for keydown/keyup events fired against DOM elements.
-* @namespace YAHOO.util
-* @class KeyListener
-* @constructor
-* @param {HTMLElement} attachTo        The element or element ID to which the key event should be attached
-* @param {String}      attachTo        The element or element ID to which the key event should be attached
-* @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).
-* @param {Function}    handler         The CustomEvent handler to fire when the key event is detected
-* @param {Object}      handler         An object literal representing the handler. 
-* @param {String}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.
-*/
-YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
-       if (! attachTo) {
-               YAHOO.log("No attachTo element specified", "error");
-       }
-       if (! keyData) {
-               YAHOO.log("No keyData specified", "error");
-       }
-       if (! handler) {
-               YAHOO.log("No handler specified", "error");
-       }
-
-       if (! event) {
-               event = YAHOO.util.KeyListener.KEYDOWN;
-       }
-
-       /**
-       * The CustomEvent fired internally when a key is pressed
-       * @event keyEvent
-       * @private
-       * @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).
-       */
-       var keyEvent = new YAHOO.util.CustomEvent("keyPressed");
-       
-       /**
-       * The CustomEvent fired when the KeyListener is enabled via the enable() function
-       * @event enabledEvent
-       * @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).
-       */
-       this.enabledEvent = new YAHOO.util.CustomEvent("enabled");
-
-       /**
-       * The CustomEvent fired when the KeyListener is disabled via the disable() function
-       * @event disabledEvent
-       * @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).
-       */
-       this.disabledEvent = new YAHOO.util.CustomEvent("disabled");
-
-       if (typeof attachTo == 'string') {
-               attachTo = document.getElementById(attachTo);
-       }
-
-       if (typeof handler == 'function') {
-               keyEvent.subscribe(handler);
-       } else {
-               keyEvent.subscribe(handler.fn, handler.scope, handler.correctScope);
-       }
-
-       /**
-       * Handles the key event when a key is pressed.
-       * @method handleKeyPress
-       * @param {DOMEvent} e   The keypress DOM event
-       * @param {Object}       obj     The DOM event scope object
-       * @private
-       */
-       function handleKeyPress(e, obj) {
-               if (! keyData.shift) {  
-                       keyData.shift = false; 
-               }
-               if (! keyData.alt) {    
-                       keyData.alt = false;
-               }
-               if (! keyData.ctrl) {
-                       keyData.ctrl = false;
-               }
-
-               // check held down modifying keys first
-               if (e.shiftKey == keyData.shift && 
-                       e.altKey   == keyData.alt &&
-                       e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
-                       
-                       var dataItem;
-                       var keyPressed;
-
-                       if (keyData.keys instanceof Array) {
-                               for (var i=0;i<keyData.keys.length;i++) {
-                                       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);
-                               }
-                       }
-               }
-       }
-
-       /**
-       * Enables the KeyListener by attaching the DOM event listeners to the target DOM element
-       * @method enable
-       */
-       this.enable = function() {
-               if (! this.enabled) {
-                       YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);
-                       this.enabledEvent.fire(keyData);
-               }
-               /**
-               * Boolean indicating the enabled/disabled state of the Tooltip
-               * @property enabled
-               * @type Boolean
-               */
-               this.enabled = true;
-       };
-
-       /**
-       * Disables the KeyListener by removing the DOM event listeners from the target DOM element
-       * @method disable
-       */
-       this.disable = function() {
-               if (this.enabled) {
-                       YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);
-                       this.disabledEvent.fire(keyData);
-               }
-               this.enabled = false;
-       };
-
-       /**
-       * Returns a String representation of the object.
-       * @method toString
-       * @return {String}      The string representation of the KeyListener
-       */ 
-       this.toString = function() {
-               return "KeyListener [" + keyData.keys + "] " + attachTo.tagName + (attachTo.id ? "[" + attachTo.id + "]" : "");
-       };
-
-};
-
-/**
-* Constant representing the DOM "keydown" event.
-* @property YAHOO.util.KeyListener.KEYDOWN
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYDOWN = "keydown";
-
-/**
-* Constant representing the DOM "keyup" event.
-* @property YAHOO.util.KeyListener.KEYUP
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYUP = "keyup";
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Tooltip
-* @extends YAHOO.widget.Overlay
-* @constructor
-* @param {String}      el      The element ID representing the Tooltip <em>OR</em>
-* @param {HTMLElement} el      The element representing the Tooltip
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.
-*/
-YAHOO.widget.Tooltip = function(el, userConfig) {
-       YAHOO.widget.Tooltip.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Tooltip, YAHOO.widget.Overlay);
-
-/**
-* Constant representing the Tooltip CSS class
-* @property YAHOO.widget.Tooltip.CSS_TOOLTIP
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Tooltip.CSS_TOOLTIP = "tt";
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the Tooltip <em>OR</em>
-* @param {HTMLElement} el      The element representing the Tooltip
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Tooltip. See configuration documentation for more details.
-*/
-YAHOO.widget.Tooltip.prototype.init = function(el, userConfig) {
-       this.logger = YAHOO.widget.Tooltip.logger;
-
-       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);
-               }
-               
-               this.cfg.queueProperty("visible",false);
-               this.cfg.queueProperty("constraintoviewport",true);
-
-               this.setBody("");
-               this.render(this.cfg.getProperty("container"));
-
-               this.initEvent.fire(YAHOO.widget.Tooltip);
-       }
-};
-
-/**
-* Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Tooltip.prototype.initDefaultConfig = function() {
-       YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);
-
-       /**
-       * Specifies whether the Tooltip should be kept from overlapping its context element.
-       * @config preventoverlap
-       * @type Boolean
-       * @default true
-       */
-       this.cfg.addProperty("preventoverlap",          { value:true, validator:this.cfg.checkBoolean, supercedes:["x","y","xy"] } );
-
-       /**
-       * The number of milliseconds to wait before showing a Tooltip on mouseover.
-       * @config showdelay
-       * @type Number
-       * @default 200
-       */
-       this.cfg.addProperty("showdelay",                       { value:200, handler:this.configShowDelay, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The number of milliseconds to wait before automatically dismissing a Tooltip after the mouse has been resting on the context element.
-       * @config autodismissdelay
-       * @type Number
-       * @default 5000
-       */
-       this.cfg.addProperty("autodismissdelay",        { value:5000, handler:this.configAutoDismissDelay, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The number of milliseconds to wait before hiding a Tooltip on mouseover.
-       * @config hidedelay
-       * @type Number
-       * @default 250
-       */
-       this.cfg.addProperty("hidedelay",                       { value:250, handler:this.configHideDelay, validator:this.cfg.checkNumber } );
-
-       /**
-       * Specifies the Tooltip's text.
-       * @config text
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty("text",                            { handler:this.configText, suppressEvent:true } );
-       
-       /**
-       * Specifies the container element that the Tooltip's markup should be rendered into.
-       * @config container
-       * @type HTMLElement/String
-       * @default document.body
-       */
-       this.cfg.addProperty("container",                       { value:document.body, handler:this.configContainer } );
-
-       /**
-       * Specifies the element or elements that the Tooltip should be anchored to on mouseover.
-       * @config context
-       * @type HTMLElement[]/String[]
-       * @default null
-       */
-
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* The default event handler fired when the "text" property is changed.
-* @method configText
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Tooltip.prototype.configText = function(type, args, obj) {
-       var text = args[0];
-       if (text) {
-               this.setBody(text);
-       }
-};
-
-/**
-* The default event handler fired when the "container" property is changed.
-* @method configContainer
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Tooltip.prototype.configContainer = function(type, args, obj) {
-       var container = args[0];
-       if (typeof container == 'string') {
-               this.cfg.setProperty("container", document.getElementById(container), true);
-       }
-};
-
-/**
-* The default event handler fired when the "context" property is changed.
-* @method configContext
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Tooltip.prototype.configContext = function(type, args, obj) {
-       var context = args[0];
-       if (context) {
-               
-               // Normalize parameter into an array
-               if (! (context instanceof Array)) {
-                       if (typeof context == "string") {
-                               this.cfg.setProperty("context", [document.getElementById(context)], true);
-                       } else { // Assuming this is an element
-                               this.cfg.setProperty("context", [context], true);
-                       }
-                       context = this.cfg.getProperty("context");
-               }
-
-
-               // Remove any existing mouseover/mouseout listeners
-               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);
-                       }
-               }
-
-               // Add mouseover/mouseout listeners to context elements
-               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);
-               }
-       }
-};
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-// BEGIN BUILT-IN DOM EVENT HANDLERS //
-
-/**
-* The default event handler fired when the user moves the mouse while over the context element.
-* @method onContextMouseMove
-* @param {DOMEvent} e  The current DOM event
-* @param {Object}      obj     The object argument
-*/
-YAHOO.widget.Tooltip.prototype.onContextMouseMove = function(e, obj) {
-       obj.pageX = YAHOO.util.Event.getPageX(e);
-       obj.pageY = YAHOO.util.Event.getPageY(e);
+        return m_oModuleTemplate;
 
-};
+    }
 
-/**
-* The default event handler fired when the user mouses over the context element.
-* @method onContextMouseOver
-* @param {DOMEvent} e  The current DOM event
-* @param {Object}      obj     The object argument
-*/
-YAHOO.widget.Tooltip.prototype.onContextMouseOver = function(e, obj) {
-
-       if (obj.hideProcId) {
-               clearTimeout(obj.hideProcId);
-               obj.logger.log("Clearing hide timer: " + obj.hideProcId, "time");
-               obj.hideProcId = null;
-       }
-       
-       var context = this;
-       YAHOO.util.Event.addListener(context, "mousemove", obj.onContextMouseMove, obj);
-
-       if (context.title) {
-               obj._tempTitle = context.title;
-               context.title = "";
-       }
-
-       /**
-       * The unique process ID associated with the thread responsible for showing the Tooltip.
-       * @type int
-       */
-       obj.showProcId = obj.doShow(e, context);
-       obj.logger.log("Setting show tooltip timeout: " + this.showProcId, "time");
-};
-
-/**
-* The default event handler fired when the user mouses out of the context element.
-* @method onContextMouseOut
-* @param {DOMEvent} e  The current DOM event
-* @param {Object}      obj     The object argument
-*/
-YAHOO.widget.Tooltip.prototype.onContextMouseOut = function(e, obj) {
-       var el = this;
-
-       if (obj._tempTitle) {
-               el.title = obj._tempTitle;
-               obj._tempTitle = null;
-       }
-       
-       if (obj.showProcId) {
-               clearTimeout(obj.showProcId);
-               obj.logger.log("Clearing show timer: " + obj.showProcId, "time");
-               obj.showProcId = null;          
-       }
-
-       if (obj.hideProcId) {
-               clearTimeout(obj.hideProcId);
-               obj.logger.log("Clearing hide timer: " + obj.hideProcId, "time");
-               obj.hideProcId = null;
-       }
-
-
-       obj.hideProcId = setTimeout(function() {
-                               obj.hide();
-                               }, obj.cfg.getProperty("hidedelay"));
-};
-
-// END BUILT-IN DOM EVENT HANDLERS //
-
-/**
-* Processes the showing of the Tooltip by setting the timeout delay and offset of the Tooltip.
-* @method doShow
-* @param {DOMEvent} e  The current DOM event
-* @return {Number}     The process ID of the timeout function associated with doShow
-*/
-YAHOO.widget.Tooltip.prototype.doShow = function(e, context) {
-       
-       var yOffset = 25;
-       if (this.browser == "opera" && context.tagName == "A") {
-               yOffset += 12;
-       }
-
-       var me = this;
-       return setTimeout(
-               function() {
-                       if (me._tempTitle) {
-                               me.setBody(me._tempTitle);
-                       } else {
-                               me.cfg.refireEvent("text");
-                       }
-
-                       me.logger.log("Show tooltip", "time");
-                       me.moveTo(me.pageX, me.pageY + yOffset);
-                       if (me.cfg.getProperty("preventoverlap")) {
-                               me.preventOverlap(me.pageX, me.pageY);
-                       }
-                       
-                       YAHOO.util.Event.removeListener(context, "mousemove", me.onContextMouseMove);
-
-                       me.show();
-                       me.hideProcId = me.doHide();
-                       me.logger.log("Hide tooltip time active: " + me.hideProcId, "time");
-               },
-       this.cfg.getProperty("showdelay"));
-};
-
-/**
-* Sets the timeout for the auto-dismiss delay, which by default is 5 seconds, meaning that a tooltip will automatically dismiss itself after 5 seconds of being displayed.
-* @method doHide
-*/
-YAHOO.widget.Tooltip.prototype.doHide = function() {
-       var me = this;
-       me.logger.log("Setting hide tooltip timeout", "time");
-       return setTimeout(
-               function() {
-                       me.logger.log("Hide tooltip", "time");
-                       me.hide();
-               },
-               this.cfg.getProperty("autodismissdelay"));
-};
-
-/**
-* Fired when the Tooltip is moved, this event handler is used to prevent the Tooltip from overlapping with its context element.
-* @method preventOverlay
-* @param {Number} pageX        The x coordinate position of the mouse pointer
-* @param {Number} pageY        The y coordinate position of the mouse pointer
-*/
-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);
-       
-       this.logger.log("context " + elementRegion, "ttip");
-       this.logger.log("mouse " + mousePoint, "ttip");
-
-       if (elementRegion.contains(mousePoint)) {
-               this.logger.log("OVERLAP", "warn");
-               this.cfg.setProperty("y", (pageY-height-5));
-       }
-};
-
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     The string representation of the Tooltip
-*/ 
-YAHOO.widget.Tooltip.prototype.toString = function() {
-       return "Tooltip " + this.id;
-};
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Panel
-* @extends YAHOO.widget.Overlay
-* @constructor
-* @param {String}      el      The element ID representing the Panel <em>OR</em>
-* @param {HTMLElement} el      The element representing the Panel
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Panel. See configuration documentation for more details.
-*/
-YAHOO.widget.Panel = function(el, userConfig) {
-       YAHOO.widget.Panel.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Panel, YAHOO.widget.Overlay);
-
-/**
-* Constant representing the default CSS class used for a Panel
-* @property YAHOO.widget.Panel.CSS_PANEL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Panel.CSS_PANEL = "panel";
-
-/**
-* Constant representing the default CSS class used for a Panel's wrapping container
-* @property YAHOO.widget.Panel.CSS_PANEL_CONTAINER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Panel.CSS_PANEL_CONTAINER = "panel-container";
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement} el      The element representing the Overlay
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.
-*/
-YAHOO.widget.Panel.prototype.init = function(el, userConfig) {
-       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
-       
-       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);
-       }
-
-       this.beforeRenderEvent.subscribe(function() {
-               var draggable = this.cfg.getProperty("draggable");
-               if (draggable) {
-                       if (! this.header) {
-                               this.setHeader("&#160;");
-                       }
-               }
-       }, this, true);
-
-       var me = this;
-
-       var doBlur = function() {
-               this.blur();
-       };
-
-       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.type != "hidden") {
-                               if (! YAHOO.util.Dom.isAncestor(me.element, el)) {
-                                       YAHOO.util.Event.addListener(el, "focus", doBlur, el, true);
-                                       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", doBlur);
-               }
-       }, this, true);
-
-       this.beforeShowEvent.subscribe(function() {
-               this.cfg.refireEvent("underlay");
-       }, this, true);
-       this.initEvent.fire(YAHOO.widget.Panel);
-};
-
-/**
-* Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-*/
-YAHOO.widget.Panel.prototype.initEvents = function() {
-       YAHOO.widget.Panel.superclass.initEvents.call(this);
-
-       /**
-       * CustomEvent fired after the modality mask is shown
-       * @event showMaskEvent
-       */
-       this.showMaskEvent = new YAHOO.util.CustomEvent("showMask");
-
-       /**
-       * CustomEvent fired after the modality mask is hidden
-       * @event hideMaskEvent
-       */
-       this.hideMaskEvent = new YAHOO.util.CustomEvent("hideMask");
-
-       /**
-       * CustomEvent when the Panel is dragged
-       * @event dragEvent
-       */
-       this.dragEvent = new YAHOO.util.CustomEvent("drag");
-};
-
-/**
-* Initializes the class's configurable properties which can be changed using the Panel's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Panel.prototype.initDefaultConfig = function() {
-       YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);
-
-       // Add panel config properties //
-
-       /**
-       * True if the Panel should display a "close" button
-       * @config close
-       * @type Boolean
-       * @default true
-       */      
-       this.cfg.addProperty("close", { value:true, handler:this.configClose, validator:this.cfg.checkBoolean, supercedes:["visible"] } );
-
-       /**
-       * True if the Panel should be draggable
-       * @config draggable
-       * @type Boolean
-       * @default true
-       */      
-       this.cfg.addProperty("draggable", { value:true, handler:this.configDraggable, validator:this.cfg.checkBoolean, supercedes:["visible"] } );
-
-       /**
-       * Sets the type of underlay to display for the Panel. Valid values are "shadow", "matte", and "none".
-       * @config underlay
-       * @type String
-       * @default shadow
-       */
-       this.cfg.addProperty("underlay", { value:"shadow", handler:this.configUnderlay, supercedes:["visible"] } );
-
-       /**
-       * 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.
-       * @config modal
-       * @type Boolean
-       * @default false
-       */      
-       this.cfg.addProperty("modal",   { value:false, handler:this.configModal, validator:this.cfg.checkBoolean, supercedes:["visible"] } );
-
-       /**
-       * A KeyListener (or array of KeyListeners) that will be enabled when the Panel is shown, and disabled when the Panel is hidden.
-       * @config keylisteners
-       * @type YAHOO.util.KeyListener[]
-       * @default null
-       */      
-       this.cfg.addProperty("keylisteners", { handler:this.configKeyListeners, suppressEvent:true, supercedes:["visible"] } );
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* 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.
-* @method configClose
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-                       }
-
-                       this.close.innerHTML = "&#160;";
-                       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";
-               }
-       }
-};
-
-/**
-* The default event handler fired when the "draggable" property is changed.
-* @method configDraggable
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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();
-               }
-               if (this.header) {
-                       YAHOO.util.Dom.setStyle(this.header,"cursor","auto");
-               }
-       }
-};
-
-/**
-* The default event handler fired when the "underlay" property is changed.
-* @method configUnderlay
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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) { // create if not already in DOM
-                               this.underlay = document.createElement("DIV");
-                               this.underlay.className = "underlay";
-                               this.underlay.innerHTML = "&#160;";
-                               this.element.appendChild(this.underlay);
-                       } 
-
-                       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;
-       }
-};
-
-/**
-* 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.
-* @method configModal
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed( this.hideEvent, this.hideMask, this) ) {
-                       this.hideEvent.subscribe(this.hideMask, this, true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed( YAHOO.widget.Overlay.windowResizeEvent, this.sizeMask, this ) ) {
-                       YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask, this, true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed( this.destroyEvent, this.removeMask, this) ) {
-                       this.destroyEvent.subscribe(this.removeMask, this, true);
-               }
-
-               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);
-       }
-};
-
-/**
-* Removes the modality mask.
-* @method removeMask
-*/
-YAHOO.widget.Panel.prototype.removeMask = function() {
-       if (this.mask) {
-               if (this.mask.parentNode) {
-                       this.mask.parentNode.removeChild(this.mask);
-               }
-               this.mask = null;
-       }
-};
-
-/**
-* The default event handler fired when the "keylisteners" property is changed.
-* @method configKeyListeners
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-                               }
-                               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);
-                       }
-                       if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, listeners.disable, listeners)) {
-                               this.hideEvent.subscribe(listeners.disable, listeners, true);
-                               this.destroyEvent.subscribe(listeners.disable, listeners, true); 
-                       }
-               }
-       } 
-};
-
-/**
-* The default event handler fired when the "height" property is changed.
-* @method configHeight
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "width" property is changed.
-* @method configWidth
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "zIndex" property is changed.
-* @method configzIndex
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-               }
-
-               if (currentZ === 0) {
-                       this.cfg.setProperty("zIndex", 1);
-               } else {
-                       maskZ = currentZ - 1;
-                       YAHOO.util.Dom.setStyle(this.mask, "zIndex", maskZ);
-               }
-
-       }
-};
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-
-/**
-* Builds the wrapping container around the Panel that is used for positioning the shadow and matte underlays. The container element is assigned to a  local instance variable called container, and the element is reinserted inside of it.
-* @method buildWrapper
-*/
-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);
-       }
-
-       wrapper.appendChild(originalElement);
-
-       this.element = wrapper;
-       this.innerElement = originalElement;
-
-       YAHOO.util.Dom.setStyle(this.innerElement, "visibility", "inherit");
-};
-
-/**
-* Adjusts the size of the shadow based on the size of the element.
-* @method sizeUnderlay
-*/
-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";
-       }
-};
-
-/**
-* Event handler fired when the resize monitor element is resized.
-* @method onDomResize
-* @param {DOMEvent} e  The resize DOM event
-* @param {Object} obj  The scope object
-*/
-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);
-};
-
-/**
-* Registers the Panel's header for drag & drop capability.
-* @method registerDragDrop
-*/
-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";
-               }
-               
-               var me = this;
-
-               this.dd.startDrag = function() {
-
-                       if (me.browser == "ie") {
-                               YAHOO.util.Dom.addClass(me.element,"drag");
-                       }
-
-                       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;
-                       }
-
-                       me.dragEvent.fire("startDrag", arguments);
-               };
-               
-               this.dd.onDrag = function() {
-                       me.syncPosition();
-                       me.cfg.refireEvent("iframe");
-                       if (this.platform == "mac" && this.browser == "gecko") {
-                               this.showMacGeckoScrollbars();
-                       }
-
-                       me.dragEvent.fire("onDrag", arguments);
-               };
-
-               this.dd.endDrag = function() {
-                       if (me.browser == "ie") {
-                               YAHOO.util.Dom.removeClass(me.element,"drag");
-                       }
-
-                       me.dragEvent.fire("endDrag", arguments);
-               };
-
-               this.dd.setHandleElId(this.header.id);
-               this.dd.addInvalidHandleType("INPUT");
-               this.dd.addInvalidHandleType("SELECT");
-               this.dd.addInvalidHandleType("TEXTAREA");
-       }
-};
-
-/**
-* Builds the mask that is laid over the document when the Panel is configured to be modal.
-* @method buildMask
-*/
-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 = "&#160;";
-
-               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);
-               }
-       }
-};
-
-/**
-* Hides the modality mask.
-* @method hideMask
-*/
-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");
-       }
-};
-
-/**
-* Shows the modality mask.
-* @method showMask
-*/
-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();
-       }
-};
-
-/**
-* Sets the size of the modality mask to cover the entire scrollable area of the document
-* @method sizeMask
-*/
-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";
-       }
-};
-
-/**
-* 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.
-* @method render
-* @param {String}      appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>
-* @param {HTMLElement} appendToNode    The element to which the Module should be appended to prior to rendering        
-* @return {boolean} Success or failure of the render
-*/
-YAHOO.widget.Panel.prototype.render = function(appendToNode) {
-       return YAHOO.widget.Panel.superclass.render.call(this, appendToNode, this.innerElement);
-};
-
-/**
-* Returns a String representation of the object.
-* @method toString
-* @return {String} The string representation of the Panel.
-*/ 
-YAHOO.widget.Panel.prototype.toString = function() {
-       return "Panel " + this.id;
-};
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Dialog
-* @extends YAHOO.widget.Panel
-* @constructor
-* @param {String}      el      The element ID representing the Dialog <em>OR</em>
-* @param {HTMLElement} el      The element representing the Dialog
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.
-*/
-YAHOO.widget.Dialog = function(el, userConfig) {
-       YAHOO.widget.Dialog.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Dialog, YAHOO.widget.Panel);
-
-/**
-* Constant representing the default CSS class used for a Dialog
-* @property YAHOO.widget.Dialog.CSS_DIALOG
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Dialog.CSS_DIALOG = "dialog";
 
-/**
-* Initializes the class's configurable properties which can be changed using the Dialog's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Dialog.prototype.initDefaultConfig = function() {
-       YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);
-
-       /**
-       * The internally maintained callback object for use with the Connection utility
-       * @property callback
-       * @type Object
-       */
-       this.callback = {
-               /**
-               * The function to execute upon success of the Connection submission
-               * @property callback.success
-               * @type Function
-               */
-               success : null,
-               /**
-               * The function to execute upon failure of the Connection submission
-               * @property callback.failure
-               * @type Function
-               */
-               failure : null,
-               /**
-               * The arbitraty argument or arguments to pass to the Connection callback functions
-               * @property callback.argument
-               * @type Object
-               */
-               argument: null
-       };
-
-       // Add form dialog config properties //
-       
-       /**
-       * The method to use for posting the Dialog's form. Possible values are "async", "form", and "manual".
-       * @config postmethod 
-       * @type String
-       * @default async
-       */
-       this.cfg.addProperty("postmethod", { value:"async", handler:this.configPostMethod, validator:function(val) { 
-                                                                                                       if (val != "form" && val != "async" && val != "none" && val != "manual") {
-                                                                                                               return false;
-                                                                                                       } else {
-                                                                                                               return true;
-                                                                                                       }
-                                                                                               } });
-
-       /**
-       * Object literal(s) defining the buttons for the Dialog's footer.
-       * @config buttons
-       * @type Object[]
-       * @default "none"
-       */
-       this.cfg.addProperty("buttons",         { value:"none", handler:this.configButtons } );
-};
-
-/**
-* Initializes the custom events for Dialog which are fired automatically at appropriate times by the Dialog class.
-* @method initEvents
-*/
-YAHOO.widget.Dialog.prototype.initEvents = function() {
-       YAHOO.widget.Dialog.superclass.initEvents.call(this);
-
-       /**
-       * CustomEvent fired prior to submission
-       * @event beforeSumitEvent
-       */      
-       this.beforeSubmitEvent  = new YAHOO.util.CustomEvent("beforeSubmit");
-       
-       /**
-       * CustomEvent fired after submission
-       * @event submitEvent
-       */
-       this.submitEvent                = new YAHOO.util.CustomEvent("submit");
-
-       /**
-       * CustomEvent fired prior to manual submission
-       * @event manualSubmitEvent
-       */
-       this.manualSubmitEvent  = new YAHOO.util.CustomEvent("manualSubmit");
-
-       /**
-       * CustomEvent fired prior to asynchronous submission
-       * @event asyncSubmitEvent
-       */      
-       this.asyncSubmitEvent   = new YAHOO.util.CustomEvent("asyncSubmit");
-
-       /**
-       * CustomEvent fired prior to form-based submission
-       * @event formSubmitEvent
-       */
-       this.formSubmitEvent    = new YAHOO.util.CustomEvent("formSubmit");
-
-       /**
-       * CustomEvent fired after cancel
-       * @event cancelEvent
-       */
-       this.cancelEvent                = new YAHOO.util.CustomEvent("cancel");
-};
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the Dialog <em>OR</em>
-* @param {HTMLElement} el      The element representing the Dialog
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.
-*/
-YAHOO.widget.Dialog.prototype.init = function(el, userConfig) {
-       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
-       
-       this.beforeInitEvent.fire(YAHOO.widget.Dialog);
+    function createHeader() {
+
+        if (!m_oHeaderTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oHeaderTemplate.cloneNode(false));
+
+    }
+    
+
+    function createBody() {
+
+        if (!m_oBodyTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oBodyTemplate.cloneNode(false));
+    
+    }
+    
+
+    function createFooter() {
+
+        if (!m_oFooterTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oFooterTemplate.cloneNode(false));
+
+    }
+    
+
+    Module.prototype = {
+    
+        /**
+        * The class's constructor function
+        * @property contructor
+        * @type Function
+        */
+        constructor: Module,
+        
+        /**
+        * The main module element that contains the header, body, and footer
+        * @property element
+        * @type HTMLElement
+        */
+        element: null,
+        
+        /**
+        * The header element, denoted with CSS class "hd"
+        * @property header
+        * @type HTMLElement
+        */
+        header: null,
+        
+        /**
+        * The body element, denoted with CSS class "bd"
+        * @property body
+        * @type HTMLElement
+        */
+        body: null,
+        
+        /**
+        * The footer element, denoted with CSS class "ft"
+        * @property footer
+        * @type HTMLElement
+        */
+        footer: null,
+        
+        /**
+        * The id of the element
+        * @property id
+        * @type String
+        */
+        id: null,
+        
+        /**
+        * A string representing the root path for all images created by
+        * a Module instance.
+        * @deprecated It is recommend that any images for a Module be applied
+        * via CSS using the "background-image" property.
+        * @property imageRoot
+        * @type String
+        */
+        imageRoot: Module.IMG_ROOT,
+    
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        * @method initEvents
+        */
+        initEvents: function () {
+        
+            var SIGNATURE = CustomEvent.LIST;
+        
+            /**
+            * CustomEvent fired prior to class initalization.
+            * @event beforeInitEvent
+            * @param {class} classRef class reference of the initializing 
+            * class, such as this.beforeInitEvent.fire(Module)
+            */
+            this.beforeInitEvent = this.createEvent(EVENT_TYPES.BEFORE_INIT);
+            this.beforeInitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after class initalization.
+            * @event initEvent
+            * @param {class} classRef class reference of the initializing 
+            * class, such as this.beforeInitEvent.fire(Module)
+            */  
+            this.initEvent = this.createEvent(EVENT_TYPES.INIT);
+            this.initEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the Module is appended to the DOM
+            * @event appendEvent
+            */
+            this.appendEvent = this.createEvent(EVENT_TYPES.APPEND);
+            this.appendEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired before the Module is rendered
+            * @event beforeRenderEvent
+            */
+            this.beforeRenderEvent = 
+                this.createEvent(EVENT_TYPES.BEFORE_RENDER);
+            this.beforeRenderEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is rendered
+            * @event renderEvent
+            */
+            this.renderEvent = this.createEvent(EVENT_TYPES.RENDER);
+            this.renderEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the header content of the Module 
+            * is modified
+            * @event changeHeaderEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new header content
+            */
+            this.changeHeaderEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_HEADER);
+            this.changeHeaderEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired when the body content of the Module is modified
+            * @event changeBodyEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new body content
+            */  
+            this.changeBodyEvent = this.createEvent(EVENT_TYPES.CHANGE_BODY);
+            this.changeBodyEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired when the footer content of the Module 
+            * is modified
+            * @event changeFooterEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new footer content
+            */
+            this.changeFooterEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
+            this.changeFooterEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the content of the Module is modified
+            * @event changeContentEvent
+            */
+            this.changeContentEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
+            this.changeContentEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the Module is destroyed
+            * @event destroyEvent
+            */
+            this.destroyEvent = this.createEvent(EVENT_TYPES.DESTORY);
+            this.destroyEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired before the Module is shown
+            * @event beforeShowEvent
+            */
+            this.beforeShowEvent = this.createEvent(EVENT_TYPES.BEFORE_SHOW);
+            this.beforeShowEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is shown
+            * @event showEvent
+            */
+            this.showEvent = this.createEvent(EVENT_TYPES.SHOW);
+            this.showEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired before the Module is hidden
+            * @event beforeHideEvent
+            */
+            this.beforeHideEvent = this.createEvent(EVENT_TYPES.BEFORE_HIDE);
+            this.beforeHideEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is hidden
+            * @event hideEvent
+            */
+            this.hideEvent = this.createEvent(EVENT_TYPES.HIDE);
+            this.hideEvent.signature = SIGNATURE;
+        }, 
+        
+        /**
+        * String representing the current user-agent platform
+        * @property platform
+        * @type String
+        */
+        platform: function () {
+        
+            var ua = navigator.userAgent.toLowerCase();
+        
+            if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
+        
+                return "windows";
+        
+            } else if (ua.indexOf("macintosh") != -1) {
+        
+                return "mac";
+        
+            } else {
+        
+                return false;
+        
+            }
+        
+        }(),
+        
+        /**
+        * String representing the user-agent of the browser
+        * @deprecated Use YAHOO.env.ua
+        * @property browser
+        * @type String
+        */
+        browser: function () {
+        
+            var ua = navigator.userAgent.toLowerCase();
+            
+            /*
+                 Check Opera first in case of spoof and check Safari before
+                 Gecko since Safari's user agent string includes "like Gecko"
+            */
+
+            if (ua.indexOf('opera') != -1) { 
+            
+                return 'opera';
+            
+            } else if (ua.indexOf('msie 7') != -1) {
+            
+                return 'ie7';
+            
+            } else if (ua.indexOf('msie') != -1) {
+            
+                return 'ie';
+            
+            } else if (ua.indexOf('safari') != -1) { 
+            
+                return 'safari';
+            
+            } else if (ua.indexOf('gecko') != -1) {
+            
+                return 'gecko';
+            
+            } else {
+            
+                return false;
+            
+            }
+        
+        }(),
+        
+        /**
+        * Boolean representing whether or not the current browsing context is 
+        * secure (https)
+        * @property isSecure
+        * @type Boolean
+        */
+        isSecure: function () {
+        
+            if (window.location.href.toLowerCase().indexOf("https") === 0) {
+        
+                return true;
+        
+            } else {
+        
+                return false;
+        
+            }
+        
+        }(),
+        
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        */
+        initDefaultConfig: function () {
+    
+            // Add properties //
+        
+            /**
+            * Specifies whether the Module is visible on the page.
+            * @config visible
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.VISIBLE.key, {
+                handler: this.configVisible, 
+                value: DEFAULT_CONFIG.VISIBLE.value, 
+                validator: DEFAULT_CONFIG.VISIBLE.validator
+            });
+            
+            /**
+            * Object or array of objects representing the ContainerEffect 
+            * classes that are active for animating the container.
+            * @config effect
+            * @type Object
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key, {
+                suppressEvent: DEFAULT_CONFIG.EFFECT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.EFFECT.supercedes
+            });
+            
+            /**
+            * Specifies whether to create a special proxy iframe to monitor 
+            * for user font resizing in the document
+            * @config monitorresize
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key, {
+                handler: this.configMonitorResize,
+                value: DEFAULT_CONFIG.MONITOR_RESIZE.value
+            });
+            
+        },
+        
+        /**
+        * 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.
+        * @method init
+        * @param {String} el The element ID representing the Module <em>OR</em>
+        * @param {HTMLElement} el The element representing the Module
+        * @param {Object} userConfig The configuration Object literal 
+        * containing the configuration that should be set for this module. 
+        * See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
+        
+            var elId, i, child;
+        
+            this.initEvents();
+        
+            this.beforeInitEvent.fire(Module);
+        
+            /**
+            * The Module's Config object used for monitoring 
+            * configuration properties.
+            * @property cfg
+            * @type YAHOO.util.Config
+            */
+            this.cfg = new Config(this);
+        
+            if (this.isSecure) {
+                this.imageRoot = Module.IMG_ROOT_SSL;
+            }
+        
+            if (typeof el == "string") {
+
+                elId = el;
+        
+                el = document.getElementById(el);
+
+                if (! el) {
+
+                    el = (createModuleTemplate()).cloneNode(false);
+
+                    el.id = elId;
+
+                }
+
+            }
+        
+            this.element = el;
+        
+            if (el.id) {
+                this.id = el.id;
+            }
+        
+            child = this.element.firstChild;
+            
+            if (child) {
+
+                do {
+
+                    switch (child.className) {
+    
+                    case Module.CSS_HEADER:
+    
+                        this.header = child;
+    
+                        break;
+    
+                    case Module.CSS_BODY:
+    
+                        this.body = child;
+    
+                        break;
+    
+                    case Module.CSS_FOOTER:
+    
+                        this.footer = child;
+    
+                        break;
+    
+                    }
+                    
+                } while ((child = child.nextSibling));
+            
+            }
+
+        
+            this.initDefaultConfig();
+        
+            Dom.addClass(this.element, Module.CSS_MODULE);
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+        
+            /*
+                Subscribe to the fireQueue() method of Config so that any 
+                queued configuration changes are excecuted upon render of 
+                the Module
+            */ 
+            
+            if (!Config.alreadySubscribed(this.renderEvent, 
+                this.cfg.fireQueue, this.cfg)) {
+
+                this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
+
+            }
+        
+            this.initEvent.fire(Module);
+        },
+        
+        /**
+        * Initialized an empty IFRAME that is placed out of the visible area 
+        * that can be used to detect text resize.
+        * @method initResizeMonitor
+        */
+        initResizeMonitor: function () {
+        
+            var oDoc, 
+                oIFrame, 
+                sHTML;
+        
+            function fireTextResize() {
+        
+                Module.textResizeEvent.fire();
+        
+            }
+        
+            if (!YAHOO.env.ua.opera) {
+        
+                oIFrame = Dom.get("_yuiResizeMonitor");
+        
+                if (!oIFrame) {
+        
+                    oIFrame = document.createElement("iframe");
+        
+                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && 
+                        YAHOO.env.ua.ie) {
+    
+                        oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL;
+    
+                    }
+
+
+                    /*
+                        Need to set "src" attribute of the iframe to 
+                        prevent the browser from reporting duplicate 
+                        cookies. (See SourceForge bug #1721755)
+                    */
+        
+                    if (YAHOO.env.ua.gecko) {
+
+                        sHTML = "<html><head><script " +
+                                "type=\"text/javascript\">" + 
+                                "window.onresize=function(){window.parent." +
+                                "YAHOO.widget.Module.textResizeEvent." +
+                                "fire();};window.parent.YAHOO.widget.Module." +
+                                "textResizeEvent.fire();</script></head>" + 
+                                "<body></body></html>";
+
+                        oIFrame.src = "data:text/html;charset=utf-8," + 
+                            encodeURIComponent(sHTML);
+
+                    }
+
+                    oIFrame.id = "_yuiResizeMonitor";
+                    
+                    /*
+                        Need to set "position" property before inserting the 
+                        iframe into the document or Safari's status bar will 
+                        forever indicate the iframe is loading 
+                        (See SourceForge bug #1723064)
+                    */
+                    
+                    oIFrame.style.position = "absolute";
+                    oIFrame.style.visibility = "hidden";
+        
+                    document.body.appendChild(oIFrame);
+        
+                    oIFrame.style.width = "10em";
+                    oIFrame.style.height = "10em";
+                    oIFrame.style.top = (-1 * oIFrame.offsetHeight) + "px";
+                    oIFrame.style.left = (-1 * oIFrame.offsetWidth) + "px";
+                    oIFrame.style.borderWidth = "0";
+                    oIFrame.style.visibility = "visible";
+        
+                    if (YAHOO.env.ua.webkit) {
+        
+                        oDoc = oIFrame.contentWindow.document;
+        
+                        oDoc.open();
+                        oDoc.close();
+        
+                    }
+
+                }
+        
+                if (oIFrame && oIFrame.contentWindow) {
+
+                    Module.textResizeEvent.subscribe(this.onDomResize, 
+                        this, true);
+        
+                    if (!Module.textResizeInitialized) {
+
+                        if (!Event.on(oIFrame.contentWindow, "resize", 
+                            fireTextResize)) {
+
+                            /*
+                                 This will fail in IE if document.domain has 
+                                 changed, so we must change the listener to 
+                                 use the oIFrame element instead
+                            */
+
+                            Event.on(oIFrame, "resize", fireTextResize);
+
+                        }
+
+                        Module.textResizeInitialized = true;
+
+                    }
+
+                    this.resizeMonitor = oIFrame;
+
+                }
+        
+            }
+        
+        },
+        
+        /**
+        * Event handler fired when the resize monitor element is resized.
+        * @method onDomResize
+        * @param {DOMEvent} e The DOM resize event
+        * @param {Object} obj The scope object passed to the handler
+        */
+        onDomResize: function (e, obj) {
+        
+            var nLeft = -1 * this.resizeMonitor.offsetWidth,
+                nTop = -1 * this.resizeMonitor.offsetHeight;
+        
+            this.resizeMonitor.style.top = nTop + "px";
+            this.resizeMonitor.style.left =  nLeft + "px";
+        
+        },
+        
+        /**
+        * Sets the Module's header content to the HTML specified, or appends 
+        * the passed element to the header. If no header is present, one will 
+        * be automatically created.
+        * @method setHeader
+        * @param {String} headerContent The HTML used to set the header 
+        * <em>OR</em>
+        * @param {HTMLElement} headerContent The HTMLElement to append to 
+        * the header
+        */
+        setHeader: function (headerContent) {
+
+            var oHeader = this.header || (this.header = createHeader());
+        
+            if (typeof headerContent == "string") {
+
+                oHeader.innerHTML = headerContent;
+
+            } else {
+
+                oHeader.innerHTML = "";
+                oHeader.appendChild(headerContent);
+
+            }
+        
+            this.changeHeaderEvent.fire(headerContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the header. If no header is present, 
+        * one will be automatically created.
+        * @method appendToHeader
+        * @param {HTMLElement} element The element to append to the header
+        */
+        appendToHeader: function (element) {
+
+            var oHeader = this.header || (this.header = createHeader());
+        
+            oHeader.appendChild(element);
+
+            this.changeHeaderEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Sets the Module's body content to the HTML specified, or appends the
+        * passed element to the body. If no body is present, one will be 
+        * automatically created.
+        * @method setBody
+        * @param {String} bodyContent The HTML used to set the body <em>OR</em>
+        * @param {HTMLElement} bodyContent The HTMLElement to append to the body
+        */
+        setBody: function (bodyContent) {
+
+            var oBody = this.body || (this.body = createBody());
+        
+            if (typeof bodyContent == "string") {
+
+                oBody.innerHTML = bodyContent;
+
+            } else {
+
+                oBody.innerHTML = "";
+                oBody.appendChild(bodyContent);
+
+            }
+        
+            this.changeBodyEvent.fire(bodyContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the body. If no body is present, one 
+        * will be automatically created.
+        * @method appendToBody
+        * @param {HTMLElement} element The element to append to the body
+        */
+        appendToBody: function (element) {
+
+            var oBody = this.body || (this.body = createBody());
+        
+            oBody.appendChild(element);
+
+            this.changeBodyEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * 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.
+        * @method setFooter
+        * @param {String} footerContent The HTML used to set the footer 
+        * <em>OR</em>
+        * @param {HTMLElement} footerContent The HTMLElement to append to 
+        * the footer
+        */
+        setFooter: function (footerContent) {
+
+            var oFooter = this.footer || (this.footer = createFooter());
+        
+            if (typeof footerContent == "string") {
+
+                oFooter.innerHTML = footerContent;
+
+            } else {
+
+                oFooter.innerHTML = "";
+                oFooter.appendChild(footerContent);
+
+            }
+        
+            this.changeFooterEvent.fire(footerContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the footer. If no footer is present, 
+        * one will be automatically created.
+        * @method appendToFooter
+        * @param {HTMLElement} element The element to append to the footer
+        */
+        appendToFooter: function (element) {
+
+            var oFooter = this.footer || (this.footer = createFooter());
+        
+            oFooter.appendChild(element);
+
+            this.changeFooterEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * 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.
+        * @method render
+        * @param {String} appendToNode The element id to which the Module 
+        * should be appended to prior to rendering <em>OR</em>
+        * @param {HTMLElement} appendToNode The element to which the Module 
+        * should be appended to prior to rendering
+        * @param {HTMLElement} moduleElement OPTIONAL. The element that 
+        * represents the actual Standard Module container.
+        * @return {Boolean} Success or failure of the render
+        */
+        render: function (appendToNode, moduleElement) {
+        
+            var me = this,
+                firstChild;
+        
+            function appendTo(element) {
+                if (typeof element == "string") {
+                    element = document.getElementById(element);
+                }
+        
+                if (element) {
+                    element.appendChild(me.element);
+                    me.appendEvent.fire();
+                }
+            }
+        
+            this.beforeRenderEvent.fire();
+        
+            if (! moduleElement) {
+                moduleElement = this.element;
+            }
+        
+            if (appendToNode) {
+
+                appendTo(appendToNode);
+
+            } else { 
+
+                /*
+                     No node was passed in. If the element is not already in 
+                     the Dom, this fails
+                */
+
+                if (! Dom.inDocument(this.element)) {
+
+                    YAHOO.log("Render failed. Must specify appendTo node if " + 
+                        " Module isn't already in the DOM.", "error");
+
+                    return false;
+
+                }
+
+            }
+        
+            // Need to get everything into the DOM if it isn't already
+        
+            if (this.header && ! Dom.inDocument(this.header)) {
+
+                /*
+                    There is a header, but it's not in the DOM yet... 
+                    need to add it
+                */
+
+                firstChild = moduleElement.firstChild;
+
+                if (firstChild) { // Insert before first child if exists
+
+                    moduleElement.insertBefore(this.header, firstChild);
+
+                } else { // Append to empty body because there are no children
+
+                    moduleElement.appendChild(this.header);
+
+                }
+
+            }
+        
+            if (this.body && ! Dom.inDocument(this.body)) {
+
+                /*
+                     There is a body, but it's not in the DOM yet... 
+                     need to add it
+                */
+
+
+                // Insert before footer if exists in DOM
+
+                if (this.footer && Dom.isAncestor(
+                    this.moduleElement, this.footer)) { 
+
+                    moduleElement.insertBefore(this.body, this.footer);
+
+                } else { // Append to element because there is no footer
+
+                    moduleElement.appendChild(this.body);
+
+                }
+
+            }
+        
+            if (this.footer && ! Dom.inDocument(this.footer)) {
+
+                /*
+                     There is a footer, but it's not in the DOM yet... 
+                     need to add it
+                */
+
+                moduleElement.appendChild(this.footer);
+
+            }
+        
+            this.renderEvent.fire();
+            return true;
+        },
+        
+        /**
+        * Removes the Module element from the DOM and sets all child elements 
+        * to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            var parent,
+                e;
+        
+            if (this.element) {
+                Event.purgeElement(this.element, true);
+                parent = this.element.parentNode;
+            }
+
+            if (parent) {
+                parent.removeChild(this.element);
+            }
+        
+            this.element = null;
+            this.header = null;
+            this.body = null;
+            this.footer = null;
+
+            Module.textResizeEvent.unsubscribe(this.onDomResize, this);
+
+            this.cfg.destroy();
+            this.cfg = null;
+
+            this.destroyEvent.fire();
+        
+            for (e in this) {
+                if (e instanceof CustomEvent) {
+                    e.unsubscribeAll();
+                }
+            }
+
+        },
+        
+        /**
+        * 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.
+        * @method show
+        */
+        show: function () {
+            this.cfg.setProperty("visible", true);
+        },
+        
+        /**
+        * 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.
+        * @method hide
+        */
+        hide: function () {
+            this.cfg.setProperty("visible", false);
+        },
+        
+        // BUILT-IN EVENT HANDLERS FOR MODULE //
+        
+        /**
+        * Default event handler for changing the visibility property of a 
+        * Module. By default, this is achieved by switching the "display" style 
+        * between "block" and "none".
+        * This method is responsible for firing showEvent and hideEvent.
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        * @method configVisible
+        */
+        configVisible: function (type, args, obj) {
+            var visible = args[0];
+            if (visible) {
+                this.beforeShowEvent.fire();
+                Dom.setStyle(this.element, "display", "block");
+                this.showEvent.fire();
+            } else {
+                this.beforeHideEvent.fire();
+                Dom.setStyle(this.element, "display", "none");
+                this.hideEvent.fire();
+            }
+        },
+        
+        /**
+        * Default event handler for the "monitorresize" configuration property
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        * @method configMonitorResize
+        */
+        configMonitorResize: function (type, args, obj) {
+
+            var monitor = args[0];
+
+            if (monitor) {
+
+                this.initResizeMonitor();
+
+            } else {
+
+                Module.textResizeEvent.unsubscribe(
+                    this.onDomResize, this, true);
+
+                this.resizeMonitor = null;
+            }
+
+        },
+        
+        /**
+        * Returns a String representation of the Object.
+        * @method toString
+        * @return {String} The string representation of the Module
+        */
+        toString: function () {
+            return "Module " + this.id;
+        }
+        
+    };
+    
+    YAHOO.lang.augmentProto(Module, YAHOO.util.EventProvider);
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Overlay
+    * @extends Module
+    * @param {String} el The element ID representing the Overlay <em>OR</em>
+    * @param {HTMLElement} el The element representing the Overlay
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Overlay. See configuration 
+    * documentation for more details.
+    * @constructor
+    */
+    YAHOO.widget.Overlay = function (el, userConfig) {
+    
+        YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
+    
+    };
+
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Module = YAHOO.widget.Module,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        Overlay = YAHOO.widget.Overlay,
+        
+        m_oIFrameTemplate,
+
+        /**
+        * Constant representing the name of the Overlay's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_MOVE": "beforeMove",
+            "MOVE": "move"
+        
+        },
+        
+        /**
+        * Constant representing the Overlay's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "X": { 
+                key: "x", 
+                validator: Lang.isNumber, 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "Y": { 
+                key: "y", 
+                validator: Lang.isNumber, 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "XY": { 
+                key: "xy", 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "CONTEXT": { 
+                key: "context", 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "FIXED_CENTER": { 
+                key: "fixedcenter", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["iframe", "visible"] 
+            },
+        
+            "WIDTH": { 
+                key: "width", 
+                suppressEvent: true, 
+                supercedes: ["context", "fixedcenter", "iframe"] 
+            }, 
+        
+            "HEIGHT": { 
+                key: "height", 
+                suppressEvent: true, 
+                supercedes: ["context", "fixedcenter", "iframe"] 
+            }, 
+        
+            "ZINDEX": { 
+                key: "zindex", 
+                value: null 
+            }, 
+        
+            "CONSTRAIN_TO_VIEWPORT": { 
+                key: "constraintoviewport", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["iframe", "x", "y", "xy"] 
+            }, 
+        
+            "IFRAME": { 
+                key: "iframe", 
+                value: (YAHOO.env.ua.ie == 6 ? true : false), 
+                validator: Lang.isBoolean, 
+                supercedes: ["zindex"] 
+            }
+        
+        };
+
+
+    /**
+    * The URL that will be placed in the iframe
+    * @property YAHOO.widget.Overlay.IFRAME_SRC
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.IFRAME_SRC = "javascript:false;";
+
+    /**
+    * Number representing how much the iframe shim should be offset from each 
+    * side of an Overlay instance.
+    * @property YAHOO.widget.Overlay.IFRAME_SRC
+    * @default 3
+    * @static
+    * @final
+    * @type Number
+    */
+    Overlay.IFRAME_OFFSET = 3;
+    
+    /**
+    * Constant representing the top left corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.TOP_LEFT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.TOP_LEFT = "tl";
+    
+    /**
+    * Constant representing the top right corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.TOP_RIGHT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.TOP_RIGHT = "tr";
+    
+    /**
+    * Constant representing the top bottom left corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.BOTTOM_LEFT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.BOTTOM_LEFT = "bl";
+    
+    /**
+    * Constant representing the bottom right corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.BOTTOM_RIGHT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.BOTTOM_RIGHT = "br";
+    
+    /**
+    * Constant representing the default CSS class used for an Overlay
+    * @property YAHOO.widget.Overlay.CSS_OVERLAY
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.CSS_OVERLAY = "yui-overlay";
+    
+    
+    /**
+    * A singleton CustomEvent used for reacting to the DOM event for 
+    * window scroll
+    * @event YAHOO.widget.Overlay.windowScrollEvent
+    */
+    Overlay.windowScrollEvent = new CustomEvent("windowScroll");
+    
+    /**
+    * A singleton CustomEvent used for reacting to the DOM event for
+    * window resize
+    * @event YAHOO.widget.Overlay.windowResizeEvent
+    */
+    Overlay.windowResizeEvent = new CustomEvent("windowResize");
+    
+    /**
+    * The DOM event handler used to fire the CustomEvent for window scroll
+    * @method YAHOO.widget.Overlay.windowScrollHandler
+    * @static
+    * @param {DOMEvent} e The DOM scroll event
+    */
+    Overlay.windowScrollHandler = function (e) {
+    
+        if (YAHOO.env.ua.ie) {
+    
+            if (! window.scrollEnd) {
+    
+                window.scrollEnd = -1;
+    
+            }
+    
+            clearTimeout(window.scrollEnd);
+    
+            window.scrollEnd = setTimeout(function () { 
+            
+                Overlay.windowScrollEvent.fire(); 
+    
+            }, 1);
+    
+        } else {
+    
+            Overlay.windowScrollEvent.fire();
+    
+        }
+    
+    };
+    
+    /**
+    * The DOM event handler used to fire the CustomEvent for window resize
+    * @method YAHOO.widget.Overlay.windowResizeHandler
+    * @static
+    * @param {DOMEvent} e The DOM resize event
+    */
+    Overlay.windowResizeHandler = function (e) {
+    
+        if (YAHOO.env.ua.ie) {
+    
+            if (! window.resizeEnd) {
+                window.resizeEnd = -1;
+            }
+    
+            clearTimeout(window.resizeEnd);
+    
+            window.resizeEnd = setTimeout(function () {
+    
+                Overlay.windowResizeEvent.fire(); 
+    
+            }, 100);
+    
+        } else {
+    
+            Overlay.windowResizeEvent.fire();
+    
+        }
+    
+    };
+    
+    /**
+    * A boolean that indicated whether the window resize and scroll events have 
+    * already been subscribed to.
+    * @property YAHOO.widget.Overlay._initialized
+    * @private
+    * @type Boolean
+    */
+    Overlay._initialized = null;
+    
+    if (Overlay._initialized === null) {
+    
+        Event.on(window, "scroll", Overlay.windowScrollHandler);
+        Event.on(window, "resize", Overlay.windowResizeHandler);
+    
+        Overlay._initialized = true;
+    
+    }
+    
+    YAHOO.extend(Overlay, Module, {
+    
+        /**
+        * The Overlay initialization method, which is executed for Overlay and  
+        * all of its subclasses. This method is automatically called by the 
+        * constructor, and  sets up all DOM references for pre-existing markup, 
+        * and creates required markup if it is not already present.
+        * @method init
+        * @param {String} el The element ID representing the Overlay <em>OR</em>
+        * @param {HTMLElement} el The element representing the Overlay
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Overlay. 
+        * See configuration documentation for more details.
+        */
+        init: function (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
+            */
+    
+            Overlay.superclass.init.call(this, el/*, userConfig*/);  
+            
+            this.beforeInitEvent.fire(Overlay);
+            
+            Dom.addClass(this.element, Overlay.CSS_OVERLAY);
+            
+            if (userConfig) {
+    
+                this.cfg.applyConfig(userConfig, true);
+    
+            }
+            
+            if (this.platform == "mac" && YAHOO.env.ua.gecko) {
+    
+                if (! Config.alreadySubscribed(this.showEvent,
+                    this.showMacGeckoScrollbars, this)) {
+    
+                    this.showEvent.subscribe(this.showMacGeckoScrollbars, 
+                        this, true);
+    
+                }
+    
+                if (! Config.alreadySubscribed(this.hideEvent, 
+                    this.hideMacGeckoScrollbars, this)) {
+    
+                    this.hideEvent.subscribe(this.hideMacGeckoScrollbars, 
+                        this, true);
+    
+                }
+    
+            }
+            
+            this.initEvent.fire(Overlay);
+        
+        },
+        
+        /**
+        * Initializes the custom events for Overlay which are fired  
+        * automatically at appropriate times by the Overlay class.
+        * @method initEvents
+        */
+        initEvents: function () {
+    
+            Overlay.superclass.initEvents.call(this);
+            
+            var SIGNATURE = CustomEvent.LIST;
+            
+            /**
+            * CustomEvent fired before the Overlay is moved.
+            * @event beforeMoveEvent
+            * @param {Number} x x coordinate
+            * @param {Number} y y coordinate
+            */
+            this.beforeMoveEvent = this.createEvent(EVENT_TYPES.BEFORE_MOVE);
+            this.beforeMoveEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired after the Overlay is moved.
+            * @event moveEvent
+            * @param {Number} x x coordinate
+            * @param {Number} y y coordinate
+            */
+            this.moveEvent = this.createEvent(EVENT_TYPES.MOVE);
+            this.moveEvent.signature = SIGNATURE;
+        
+        },
+        
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the Overlay's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+    
+            Overlay.superclass.initDefaultConfig.call(this);
+            
+            
+            // Add overlay config properties //
+            
+            /**
+            * The absolute x-coordinate position of the Overlay
+            * @config x
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.X.key, { 
+    
+                handler: this.configX, 
+                validator: DEFAULT_CONFIG.X.validator, 
+                suppressEvent: DEFAULT_CONFIG.X.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.X.supercedes
+    
+            });
+        
+    
+            /**
+            * The absolute y-coordinate position of the Overlay
+            * @config y
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.Y.key, {
+    
+                handler: this.configY, 
+                validator: DEFAULT_CONFIG.Y.validator, 
+                suppressEvent: DEFAULT_CONFIG.Y.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.Y.supercedes
+    
+            });
+        
+    
+            /**
+            * An array with the absolute x and y positions of the Overlay
+            * @config xy
+            * @type Number[]
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.XY.key, {
+            
+                handler: this.configXY, 
+                suppressEvent: DEFAULT_CONFIG.XY.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.XY.supercedes
+            
+            });
+        
+    
+            /**
+            * 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.
+            * @config context
+            * @type Array
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key, {
+            
+                handler: this.configContext, 
+                suppressEvent: DEFAULT_CONFIG.CONTEXT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.CONTEXT.supercedes
+            
+            });
+        
+    
+            /**
+            * True if the Overlay should be anchored to the center of 
+            * the viewport.
+            * @config fixedcenter
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key, {
+            
+                handler: this.configFixedCenter,
+                value: DEFAULT_CONFIG.FIXED_CENTER.value, 
+                validator: DEFAULT_CONFIG.FIXED_CENTER.validator, 
+                supercedes: DEFAULT_CONFIG.FIXED_CENTER.supercedes
+            
+            });
+        
+    
+            /**
+            * CSS width of the Overlay.
+            * @config width
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key, {
+            
+                handler: this.configWidth, 
+                suppressEvent: DEFAULT_CONFIG.WIDTH.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.WIDTH.supercedes
+            
+            });
+            
+            /**
+            * CSS height of the Overlay.
+            * @config height
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key, {
+            
+                handler: this.configHeight, 
+                suppressEvent: DEFAULT_CONFIG.HEIGHT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.HEIGHT.supercedes
+            
+            });
+            
+            /**
+            * CSS z-index of the Overlay.
+            * @config zIndex
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key, {
+    
+                handler: this.configzIndex,
+                value: DEFAULT_CONFIG.ZINDEX.value
+    
+            });
+            
+            /**
+            * True if the Overlay should be prevented from being positioned 
+            * out of the viewport.
+            * @config constraintoviewport
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, {
+            
+                handler: this.configConstrainToViewport, 
+                value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
+                validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
+                supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes
+            
+            });
+            
+            /**
+            * @config iframe
+            * @description Boolean indicating whether or not the Overlay should 
+            * have an IFRAME shim; used to prevent <SELECT> elements from 
+            * poking through an Overlay instance in IE6.  When set to "true", 
+            * the iframe shim is created when the Overlay instance is intially
+            * made visible.
+            * @type Boolean
+            * @default true for IE6 and below, false for all other browsers.
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key, {
+            
+                handler: this.configIframe, 
+                value: DEFAULT_CONFIG.IFRAME.value, 
+                validator: DEFAULT_CONFIG.IFRAME.validator, 
+                supercedes: DEFAULT_CONFIG.IFRAME.supercedes
+            
+            });
+        
+        },
+        
+        /**
+        * Moves the Overlay to the specified position. This function is  
+        * identical to calling this.cfg.setProperty("xy", [x,y]);
+        * @method moveTo
+        * @param {Number} x The Overlay's new x position
+        * @param {Number} y The Overlay's new y position
+        */
+        moveTo: function (x, y) {
+    
+            this.cfg.setProperty("xy", [x, y]);
+    
+        },
+        
+        /**
+        * Adds a CSS class ("hide-scrollbars") and removes a CSS class 
+        * ("show-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
+        * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435)
+        * @method hideMacGeckoScrollbars
+        */
+        hideMacGeckoScrollbars: function () {
+    
+            Dom.removeClass(this.element, "show-scrollbars");
+            Dom.addClass(this.element, "hide-scrollbars");
+    
+        },
+        
+        /**
+        * Adds a CSS class ("show-scrollbars") and removes a CSS class 
+        * ("hide-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
+        * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435)
+        * @method showMacGeckoScrollbars
+        */
+        showMacGeckoScrollbars: function () {
+    
+            Dom.removeClass(this.element, "hide-scrollbars");
+            Dom.addClass(this.element, "show-scrollbars");
+    
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the "visible" property is 
+        * changed.  This method is responsible for firing showEvent
+        * and hideEvent.
+        * @method configVisible
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configVisible: function (type, args, obj) {
+    
+            var visible = args[0],
+                currentVis = Dom.getStyle(this.element, "visibility"),
+                effect = this.cfg.getProperty("effect"),
+                effectInstances = [],
+                isMacGecko = (this.platform == "mac" && YAHOO.env.ua.gecko),
+                alreadySubscribed = Config.alreadySubscribed,
+                eff, ei, e, i, j, k, h,
+                nEffects,
+                nEffectInstances;
+    
+    
+            if (currentVis == "inherit") {
+    
+                e = this.element.parentNode;
+    
+                while (e.nodeType != 9 && e.nodeType != 11) {
+    
+                    currentVis = Dom.getStyle(e, "visibility");
+    
+                    if (currentVis != "inherit") { 
+    
+                        break; 
+    
+                    }
+    
+                    e = e.parentNode;
+    
+                }
+    
+                if (currentVis == "inherit") {
+    
+                    currentVis = "visible";
+                
+                }
+    
+            }
+        
+    
+            if (effect) {
+    
+                if (effect instanceof Array) {
+
+                    nEffects = effect.length;
+    
+                    for (i = 0; i < nEffects; i++) {
+    
+                        eff = effect[i];
+    
+                        effectInstances[effectInstances.length] = 
+                            eff.effect(this, eff.duration);
+    
+                    }
+    
+                } else {
+    
+                    effectInstances[effectInstances.length] = 
+                        effect.effect(this, effect.duration);
+    
+                }
+    
+            }
+    
+        
+            if (visible) { // Show
+    
+                if (isMacGecko) {
+    
+                    this.showMacGeckoScrollbars();
+    
+                }
+                
+    
+                if (effect) { // Animate in
+    
+    
+                    if (visible) { // Animate in if not showing
+    
+    
+                        if (currentVis != "visible" || currentVis === "") {
+    
+                            this.beforeShowEvent.fire();
+
+                            nEffectInstances = effectInstances.length;
+    
+                            for (j = 0; j < nEffectInstances; j++) {
+    
+                                ei = effectInstances[j];
+    
+                                if (j === 0 && !alreadySubscribed(
+                                        ei.animateInCompleteEvent, 
+                                        this.showEvent.fire, this.showEvent)) {
+    
+                                    /*
+                                         Delegate showEvent until end 
+                                         of animateInComplete
+                                    */
+    
+                                    ei.animateInCompleteEvent.subscribe(
+                                     this.showEvent.fire, this.showEvent, true);
+    
+                                }
+    
+                                ei.animateIn();
+    
+                            }
+    
+                        }
+    
+                    }
+    
+                } else { // Show
+    
+                    if (currentVis != "visible" || currentVis === "") {
+    
+                        this.beforeShowEvent.fire();
+    
+                        Dom.setStyle(this.element, "visibility", "visible");
+    
+                        this.cfg.refireEvent("iframe");
+                        this.showEvent.fire();
+    
+                    }
+        
+                }
+        
+            } else { // Hide
+    
+                if (isMacGecko) {
+    
+                    this.hideMacGeckoScrollbars();
+    
+                }
+                    
+                if (effect) { // Animate out if showing
+    
+                    if (currentVis == "visible") {
+    
+                        this.beforeHideEvent.fire();
+
+                        nEffectInstances = effectInstances.length;
+    
+                        for (k = 0; k < nEffectInstances; k++) {
+    
+                            h = effectInstances[k];
+    
+                            if (k === 0 && !alreadySubscribed(
+                                h.animateOutCompleteEvent, this.hideEvent.fire, 
+                                this.hideEvent)) {
+    
+                                /*
+                                     Delegate hideEvent until end 
+                                     of animateOutComplete
+                                */
+    
+                                h.animateOutCompleteEvent.subscribe(
+                                    this.hideEvent.fire, this.hideEvent, true);
+    
+                            }
+    
+                            h.animateOut();
+    
+                        }
+    
+                    } else if (currentVis === "") {
+    
+                        Dom.setStyle(this.element, "visibility", "hidden");
+    
+                    }
+    
+                } else { // Simple hide
+    
+                    if (currentVis == "visible" || currentVis === "") {
+    
+                        this.beforeHideEvent.fire();
+    
+                        Dom.setStyle(this.element, "visibility", "hidden");
+
+                        this.hideEvent.fire();
+    
+                    }
+    
+                }
+    
+            }
+    
+        },
+        
+        /**
+        * Center event handler used for centering on scroll/resize, but only if 
+        * the Overlay is visible
+        * @method doCenterOnDOMEvent
+        */
+        doCenterOnDOMEvent: function () {
+    
+            if (this.cfg.getProperty("visible")) {
+    
+                this.center();
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "fixedcenter" property 
+        * is changed.
+        * @method configFixedCenter
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configFixedCenter: function (type, args, obj) {
+    
+            var val = args[0],
+                alreadySubscribed = Config.alreadySubscribed,
+                windowResizeEvent = Overlay.windowResizeEvent,
+                windowScrollEvent = Overlay.windowScrollEvent;
+            
+            if (val) {
+    
+                this.center();
+            
+                if (!alreadySubscribed(this.beforeShowEvent, 
+                    this.center, this)) {
+    
+                    this.beforeShowEvent.subscribe(this.center);
+    
+                }
+            
+                if (!alreadySubscribed(windowResizeEvent, 
+                    this.doCenterOnDOMEvent, this)) {
+    
+                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, 
+                        this, true);
+    
+                }
+            
+                if (!alreadySubscribed(windowScrollEvent, 
+                    this.doCenterOnDOMEvent, this)) {
+        
+                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, 
+                        this, true);
+    
+                }
+    
+            } else {
+    
+                this.beforeShowEvent.unsubscribe(this.center);
+    
+                windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
+                windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "height" property is changed.
+        * @method configHeight
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configHeight: function (type, args, obj) {
+    
+            var height = args[0],
+                el = this.element;
+    
+            Dom.setStyle(el, "height", height);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "width" property is changed.
+        * @method configWidth
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configWidth: function (type, args, obj) {
+    
+            var width = args[0],
+                el = this.element;
+    
+            Dom.setStyle(el, "width", width);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "zIndex" property is changed.
+        * @method configzIndex
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configzIndex: function (type, args, obj) {
+    
+            var zIndex = args[0],
+                el = this.element;
+        
+            if (! zIndex) {
+    
+                zIndex = Dom.getStyle(el, "zIndex");
+        
+                if (! zIndex || isNaN(zIndex)) {
+    
+                    zIndex = 0;
+    
+                }
+    
+            }
+            
+            if (this.iframe) {
+    
+                if (zIndex <= 0) {
+    
+                    zIndex = 1;
+    
+                }
+    
+                Dom.setStyle(this.iframe, "zIndex", (zIndex - 1));
+            }
+            
+            Dom.setStyle(el, "zIndex", zIndex);
+            this.cfg.setProperty("zIndex", zIndex, true);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "xy" property is changed.
+        * @method configXY
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configXY: function (type, args, obj) {
+    
+            var pos = args[0],
+                x = pos[0],
+                y = pos[1];
+            
+            this.cfg.setProperty("x", x);
+            this.cfg.setProperty("y", y);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            YAHOO.log(("xy: " + [x, y]), "iframe");
+            
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "x" property is changed.
+        * @method configX
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configX: function (type, args, obj) {
+    
+            var x = args[0],
+                y = this.cfg.getProperty("y");
+            
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            Dom.setX(this.element, x, true);
+            
+            this.cfg.setProperty("xy", [x, y], true);
+           
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "y" property is changed.
+        * @method configY
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configY: function (type, args, obj) {
+    
+            var x = this.cfg.getProperty("x"),
+                y = args[0];
+        
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            Dom.setY(this.element, y, true);
+            
+            this.cfg.setProperty("xy", [x, y], true);
+            
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * Shows the iframe shim, if it has been enabled.
+        * @method showIframe
+        */
+        showIframe: function () {
+
+            var oIFrame = this.iframe,
+                oParentNode;
+
+            if (oIFrame) {
+    
+                oParentNode = this.element.parentNode;
+
+                if (oParentNode != oIFrame.parentNode) {
+
+                    oParentNode.appendChild(oIFrame);
+                
+                }
+
+                oIFrame.style.display = "block";
+    
+            }
+    
+        },
+        
+        /**
+        * Hides the iframe shim, if it has been enabled.
+        * @method hideIframe
+        */
+        hideIframe: function () {
+    
+            if (this.iframe) {
+    
+                this.iframe.style.display = "none";
+    
+            }
+    
+        },
+
+        /**
+        * Syncronizes the size and position of iframe shim to that of its 
+        * corresponding Overlay instance.
+        * @method syncIframe
+        */
+        syncIframe: function () {
+
+            var oIFrame = this.iframe,
+                oElement = this.element,
+                nOffset = Overlay.IFRAME_OFFSET,
+                nDimensionOffset = (nOffset * 2),
+                aXY;
+
+
+            if (oIFrame) {
+
+                // Size <iframe>
+
+                oIFrame.style.width = 
+                    (oElement.offsetWidth + nDimensionOffset + "px");
+
+                oIFrame.style.height = 
+                    (oElement.offsetHeight + nDimensionOffset + "px");
+
+
+                // Position <iframe>
+
+                aXY = this.cfg.getProperty("xy");
+
+                if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) {
+
+                    this.syncPosition();
+
+                    aXY = this.cfg.getProperty("xy");
+
+                }
+
+                Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]);
+
+            }
+        
+        },
+
+        
+        /**
+        * The default event handler fired when the "iframe" property is changed.
+        * @method configIframe
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configIframe: function (type, args, obj) {
+
+            var bIFrame = args[0];
+
+            function createIFrame() {
+
+                var oIFrame = this.iframe,
+                    oElement = this.element,
+                    oParent,
+                    aXY;
+
+
+                if (!oIFrame) {
+
+                    if (!m_oIFrameTemplate) {
+    
+                        m_oIFrameTemplate = document.createElement("iframe");
+
+                        if (this.isSecure) {
+        
+                            m_oIFrameTemplate.src = Overlay.IFRAME_SRC;
+        
+                        }
+
+                        /*
+                            Set the opacity of the <iframe> to 0 so that it 
+                            doesn't modify the opacity of any transparent 
+                            elements that may be on top of it (like a shadow).
+                        */
+        
+                        if (YAHOO.env.ua.ie) {
+        
+                            m_oIFrameTemplate.style.filter = "alpha(opacity=0)";
+        
+                            /*
+                                 Need to set the "frameBorder" property to 0 
+                                 supress the default <iframe> border in IE.  
+                                 Setting the CSS "border" property alone 
+                                 doesn't supress it.
+                            */
+        
+                            m_oIFrameTemplate.frameBorder = 0;
+        
+                        }
+                        else {
+        
+                            m_oIFrameTemplate.style.opacity = "0";
+                        
+                        }
+
+                        m_oIFrameTemplate.style.position = "absolute";
+                        m_oIFrameTemplate.style.border = "none";
+                        m_oIFrameTemplate.style.margin = "0";
+                        m_oIFrameTemplate.style.padding = "0";
+                        m_oIFrameTemplate.style.display = "none";
+    
+                    }
+
+                    oIFrame = m_oIFrameTemplate.cloneNode(false);
+
+                    oParent = oElement.parentNode;
+
+                    if (oParent) {
+
+                        oParent.appendChild(oIFrame);
+
+                    } else {
+
+                        document.body.appendChild(oIFrame);
+
+                    }
+                    
+                    this.iframe = oIFrame;
+
+                }
+
+
+                /*
+                     Show the <iframe> before positioning it since the "setXY" 
+                     method of DOM requires the element be in the document 
+                     and visible.
+                */
+
+                this.showIframe();
+
+
+                /*
+                     Syncronize the size and position of the <iframe> to that 
+                     of the Overlay.
+                */
+                
+                this.syncIframe();
+
+
+                // Add event listeners to update the <iframe> when necessary
+
+                if (!this._hasIframeEventListeners) {
+
+                    this.showEvent.subscribe(this.showIframe);
+                    this.hideEvent.subscribe(this.hideIframe);
+                    this.changeContentEvent.subscribe(this.syncIframe);
+
+                    this._hasIframeEventListeners = true;
+                    
+                }
+                
+            }
+
+
+            function onBeforeShow() {
+            
+                createIFrame.call(this);
+        
+                this.beforeShowEvent.unsubscribe(onBeforeShow);
+                
+                this._iframeDeferred = false;
+            
+            }
+            
+
+            if (bIFrame) { // <iframe> shim is enabled
+                
+                if (this.cfg.getProperty("visible")) {
+
+                    createIFrame.call(this);
+                
+                }
+                else {
+
+                    if (!this._iframeDeferred) {
+
+                        this.beforeShowEvent.subscribe(onBeforeShow);
+
+                        this._iframeDeferred = true;
+                    
+                    }
+                
+                }
+    
+            } else {    // <iframe> shim is disabled
+    
+                this.hideIframe();
+
+                if (this._hasIframeEventListeners) {
+
+                    this.showEvent.unsubscribe(this.showIframe);
+                    this.hideEvent.unsubscribe(this.hideIframe);
+                    this.changeContentEvent.unsubscribe(this.syncIframe);
+
+                    this._hasIframeEventListeners = false;
+
+                }
+                
+            }
+    
+        },
+        
+        
+        /**
+        * The default event handler fired when the "constraintoviewport" 
+        * property is changed.
+        * @method configConstrainToViewport
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for 
+        * the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configConstrainToViewport: function (type, args, obj) {
+    
+            var val = args[0];
+    
+            if (val) {
+    
+                if (! Config.alreadySubscribed(this.beforeMoveEvent, 
+                    this.enforceConstraints, this)) {
+    
+                    this.beforeMoveEvent.subscribe(this.enforceConstraints, 
+                        this, true);
+    
+                }
+    
+            } else {
+    
+                this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "context" property 
+        * is changed.
+        * @method configContext
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configContext: function (type, args, obj) {
+    
+            var contextArgs = args[0],
+                contextEl,
+                elementMagnetCorner,
+                contextMagnetCorner;
+            
+            if (contextArgs) {
+            
+                contextEl = contextArgs[0];
+                elementMagnetCorner = contextArgs[1];
+                contextMagnetCorner = contextArgs[2];
+                
+                if (contextEl) {
+    
+                    if (typeof contextEl == "string") {
+    
+                        this.cfg.setProperty("context", 
+                            [document.getElementById(contextEl), 
+                                elementMagnetCorner, contextMagnetCorner], 
+                                true);
+    
+                    }
+                    
+                    if (elementMagnetCorner && contextMagnetCorner) {
+    
+                        this.align(elementMagnetCorner, contextMagnetCorner);
+    
+                    }
+    
+                }
+    
+            }
+    
+        },
+        
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * Aligns the Overlay to its context element using the specified corner 
+        * points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, 
+        * and BOTTOM_RIGHT.
+        * @method align
+        * @param {String} elementAlign  The String representing the corner of 
+        * the Overlay that should be aligned to the context element
+        * @param {String} contextAlign  The corner of the context element 
+        * that the elementAlign corner should stick to.
+        */
+        align: function (elementAlign, contextAlign) {
+    
+            var contextArgs = this.cfg.getProperty("context"),
+                me = this,
+                context,
+                element,
+                contextRegion;
+    
+    
+            function doAlign(v, h) {
+    
+                switch (elementAlign) {
+    
+                case Overlay.TOP_LEFT:
+    
+                    me.moveTo(h, v);
+    
+                    break;
+    
+                case Overlay.TOP_RIGHT:
+    
+                    me.moveTo((h - element.offsetWidth), v);
+    
+                    break;
+    
+                case Overlay.BOTTOM_LEFT:
+    
+                    me.moveTo(h, (v - element.offsetHeight));
+    
+                    break;
+    
+                case Overlay.BOTTOM_RIGHT:
+    
+                    me.moveTo((h - element.offsetWidth), 
+                        (v - element.offsetHeight));
+    
+                    break;
+    
+                }
+    
+            }
+    
+    
+            if (contextArgs) {
+            
+                context = contextArgs[0];
+                element = this.element;
+                me = this;
+                
+                if (! elementAlign) {
+    
+                    elementAlign = contextArgs[1];
+    
+                }
+                
+                if (! contextAlign) {
+    
+                    contextAlign = contextArgs[2];
+    
+                }
+                
+                if (element && context) {
+    
+                    contextRegion = Dom.getRegion(context);
+                    
+                    switch (contextAlign) {
+    
+                    case Overlay.TOP_LEFT:
+    
+                        doAlign(contextRegion.top, contextRegion.left);
+    
+                        break;
+    
+                    case Overlay.TOP_RIGHT:
+    
+                        doAlign(contextRegion.top, contextRegion.right);
+    
+                        break;
+    
+                    case Overlay.BOTTOM_LEFT:
+    
+                        doAlign(contextRegion.bottom, contextRegion.left);
+    
+                        break;
+    
+                    case Overlay.BOTTOM_RIGHT:
+    
+                        doAlign(contextRegion.bottom, contextRegion.right);
+    
+                        break;
+    
+                    }
+    
+                }
+    
+            }
+            
+        },
+        
+        /**
+        * The default event handler executed when the moveEvent is fired, if the 
+        * "constraintoviewport" is set to true.
+        * @method enforceConstraints
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        enforceConstraints: function (type, args, obj) {
+    
+            var pos = args[0],
+                x = pos[0],
+                y = pos[1],
+                offsetHeight = this.element.offsetHeight,
+                offsetWidth = this.element.offsetWidth,
+                viewPortWidth = Dom.getViewportWidth(),
+                viewPortHeight = Dom.getViewportHeight(),
+                scrollX = Dom.getDocumentScrollLeft(),
+                scrollY = Dom.getDocumentScrollTop(),
+                topConstraint = scrollY + 10,
+                leftConstraint = scrollX + 10,
+                bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,
+                rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;
+        
+    
+            if (x < leftConstraint) {
+    
+                x = leftConstraint;
+    
+            } else if (x > rightConstraint) {
+    
+                x = rightConstraint;
+    
+            }
+            
+            if (y < topConstraint) {
+    
+                y = topConstraint;
+    
+            } else if (y > bottomConstraint) {
+    
+                y = bottomConstraint;
+    
+            }
+            
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            this.cfg.setProperty("xy", [x, y], true);
+    
+        },
+        
+        /**
+        * Centers the container in the viewport.
+        * @method center
+        */
+        center: function () {
+    
+            var scrollX = Dom.getDocumentScrollLeft(),
+                scrollY = Dom.getDocumentScrollTop(),
+    
+                viewPortWidth = Dom.getClientWidth(),
+                viewPortHeight = Dom.getClientHeight(),
+                elementWidth = this.element.offsetWidth,
+                elementHeight = this.element.offsetHeight,
+                x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX,
+                y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
+            
+            this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
+            
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * 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.
+        * @method syncPosition
+        */
+        syncPosition: function () {
+    
+            var pos = Dom.getXY(this.element);
+    
+            this.cfg.setProperty("x", pos[0], true);
+            this.cfg.setProperty("y", pos[1], true);
+            this.cfg.setProperty("xy", pos, true);
+    
+        },
+        
+        /**
+        * Event handler fired when the resize monitor element is resized.
+        * @method onDomResize
+        * @param {DOMEvent} e The resize DOM event
+        * @param {Object} obj The scope object
+        */
+        onDomResize: function (e, obj) {
+    
+            var me = this;
+    
+            Overlay.superclass.onDomResize.call(this, e, obj);
+    
+            setTimeout(function () {
+                me.syncPosition();
+                me.cfg.refireEvent("iframe");
+                me.cfg.refireEvent("context");
+            }, 0);
+    
+        },
+
+        /**
+        * Places the Overlay on top of all other instances of 
+        * YAHOO.widget.Overlay.
+        * @method bringToTop
+        */
+        bringToTop: function() {
+    
+            var aOverlays = [],
+                oElement = this.element;
+    
+            function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {
+        
+                var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
+        
+                    sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),
+        
+                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 
+                        0 : parseInt(sZIndex1, 10),
+        
+                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 
+                        0 : parseInt(sZIndex2, 10);
+        
+                if (nZIndex1 > nZIndex2) {
+        
+                    return -1;
+        
+                } else if (nZIndex1 < nZIndex2) {
+        
+                    return 1;
+        
+                } else {
+        
+                    return 0;
+        
+                }
+        
+            }
+        
+            function isOverlayElement(p_oElement) {
+        
+                var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
+                    Panel = YAHOO.widget.Panel;
+            
+                if (oOverlay && !Dom.isAncestor(oElement, oOverlay)) {
+                
+                    if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
+        
+                        aOverlays[aOverlays.length] = p_oElement.parentNode;
+                    
+                    }
+                    else {
+        
+                        aOverlays[aOverlays.length] = p_oElement;
+        
+                    }
+                
+                }
+            
+            }
+            
+            Dom.getElementsBy(isOverlayElement, "DIV", document.body);
+    
+            aOverlays.sort(compareZIndexDesc);
+            
+            var oTopOverlay = aOverlays[0],
+                nTopZIndex;
+            
+            if (oTopOverlay) {
+    
+                nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");
+    
+                if (!isNaN(nTopZIndex) && oTopOverlay != oElement) {
+    
+                    this.cfg.setProperty("zindex", 
+                        (parseInt(nTopZIndex, 10) + 2));
+    
+                }
+            
+            }
+        
+        },
+        
+        /**
+        * Removes the Overlay element from the DOM and sets all child 
+        * elements to null.
+        * @method destroy
+        */
+        destroy: function () {
+    
+            if (this.iframe) {
+    
+                this.iframe.parentNode.removeChild(this.iframe);
+    
+            }
+        
+            this.iframe = null;
+        
+            Overlay.windowResizeEvent.unsubscribe(
+                this.doCenterOnDOMEvent, this);
+    
+            Overlay.windowScrollEvent.unsubscribe(
+                this.doCenterOnDOMEvent, this);
+        
+            Overlay.superclass.destroy.call(this);
+        },
+        
+        /**
+        * Returns a String representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Overlay.
+        */
+        toString: function () {
+    
+            return "Overlay " + this.id;
+    
+        }
+    
+    });
+    
+}());
+(function () {
+    
+    /**
+    * OverlayManager is used for maintaining the focus status of 
+    * multiple Overlays.
+    * @namespace YAHOO.widget
+    * @namespace YAHOO.widget
+    * @class OverlayManager
+    * @constructor
+    * @param {Array} overlays Optional. A collection of Overlays to register 
+    * with the manager.
+    * @param {Object} userConfig  The object literal representing the user 
+    * configuration of the OverlayManager
+    */
+    YAHOO.widget.OverlayManager = function (userConfig) {
+    
+        this.init(userConfig);
+    
+    };
+
+
+    var Overlay = YAHOO.widget.Overlay,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        CustomEvent = YAHOO.util.CustomEvent,
+        OverlayManager = YAHOO.widget.OverlayManager;
+
+    
+    /**
+    * The CSS class representing a focused Overlay
+    * @property OverlayManager.CSS_FOCUSED
+    * @static
+    * @final
+    * @type String
+    */
+    OverlayManager.CSS_FOCUSED = "focused";
+    
+    OverlayManager.prototype = {
+    
+        /**
+        * The class's constructor function
+        * @property contructor
+        * @type Function
+        */
+        constructor: OverlayManager,
+        
+        /**
+        * The array of Overlays that are currently registered
+        * @property overlays
+        * @type YAHOO.widget.Overlay[]
+        */
+        overlays: null,
+        
+        /**
+        * Initializes the default configuration of the OverlayManager
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+        
+            /**
+            * The collection of registered Overlays in use by 
+            * the OverlayManager
+            * @config overlays
+            * @type YAHOO.widget.Overlay[]
+            * @default null
+            */
+            this.cfg.addProperty("overlays", { suppressEvent: true } );
+        
+            /**
+            * The default DOM event that should be used to focus an Overlay
+            * @config focusevent
+            * @type String
+            * @default "mousedown"
+            */
+            this.cfg.addProperty("focusevent", { value: "mousedown" } );
+        
+        },
+        
+        /**
+        * Initializes the OverlayManager
+        * @method init
+        * @param {Overlay[]} overlays Optional. A collection of Overlays to 
+        * register with the manager.
+        * @param {Object} userConfig  The object literal representing the user 
+        * configuration of the OverlayManager
+        */
+        init: function (userConfig) {
+
+            /**
+            * The OverlayManager's Config object used for monitoring 
+            * configuration properties.
+            * @property cfg
+            * @type Config
+            */
+            this.cfg = new Config(this);
+        
+            this.initDefaultConfig();
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+            this.cfg.fireQueue();
+        
+            /**
+            * The currently activated Overlay
+            * @property activeOverlay
+            * @private
+            * @type YAHOO.widget.Overlay
+            */
+            var activeOverlay = null;
+        
+            /**
+            * Returns the currently focused Overlay
+            * @method getActive
+            * @return {Overlay} The currently focused Overlay
+            */
+            this.getActive = function () {
+                return activeOverlay;
+            };
+        
+            /**
+            * Focuses the specified Overlay
+            * @method focus
+            * @param {Overlay} overlay The Overlay to focus
+            * @param {String} overlay The id of the Overlay to focus
+            */
+            this.focus = function (overlay) {
+        
+                var o = this.find(overlay);
+        
+                if (o) {
+        
+                    if (activeOverlay != o) {
+        
+                        if (activeOverlay) {
+        
+                            activeOverlay.blur();
+        
+                        }
+        
+                        this.bringToTop(o);
+                        
+                        activeOverlay = o;
+        
+                        Dom.addClass(activeOverlay.element, 
+                            OverlayManager.CSS_FOCUSED);
+
+                        o.focusEvent.fire();
+                        
+                    }
+        
+                }
+        
+            };
+        
+            /**
+            * Removes the specified Overlay from the manager
+            * @method remove
+            * @param {Overlay} overlay The Overlay to remove
+            * @param {String} overlay The id of the Overlay to remove
+            */
+            this.remove = function (overlay) {
+    
+                var o = this.find(overlay),
+                    originalZ;
+        
+                if (o) {
+
+                    if (activeOverlay == o) {
+                    
+                        activeOverlay = null;
+                    
+                    }
+
+                    originalZ = Dom.getStyle(o.element, "zIndex");
+
+                    o.cfg.setProperty("zIndex", -1000, true);
+
+                    this.overlays.sort(this.compareZIndexDesc);
+
+                    this.overlays = 
+                        this.overlays.slice(0, (this.overlays.length - 1));
+        
+                    o.hideEvent.unsubscribe(o.blur);
+                    o.destroyEvent.unsubscribe(this._onOverlayDestroy, o);
+        
+                    if (o.element) {
+        
+                        Event.removeListener(o.element, 
+                            this.cfg.getProperty("focusevent"), 
+                            this._onOverlayElementFocus);
+        
+                    }
+        
+                    o.cfg.setProperty("zIndex", originalZ, true);
+                    o.cfg.setProperty("manager", null);
+        
+                    o.focusEvent.unsubscribeAll();
+                    o.blurEvent.unsubscribeAll();
+        
+                    o.focusEvent = null;
+                    o.blurEvent = null;
+        
+                    o.focus = null;
+                    o.blur = null;
+                }
+
+            };
+        
+            /**
+            * Removes focus from all registered Overlays in the manager
+            * @method blurAll
+            */
+            this.blurAll = function () {
+    
+                var nOverlays = this.overlays.length,
+                    i;
+
+                if (nOverlays > 0) {
+
+                    i = nOverlays - 1;
+                    
+                    do {
+
+                        this.overlays[i].blur();                    
+                    
+                    }
+                    while(i--);
+                
+                }
+    
+            };
+        
+        
+            this._onOverlayBlur = function (p_sType, p_aArgs) {
+
+                activeOverlay = null;
+
+            };
+        
+        
+            var overlays = this.cfg.getProperty("overlays");
+        
+            if (! this.overlays) {
+                this.overlays = [];
+            }
+        
+            if (overlays) {
+                this.register(overlays);
+                this.overlays.sort(this.compareZIndexDesc);
+            }
+        },
+        
+        
+        /**
+        * @method _onOverlayElementFocus
+        * @description Event handler for the DOM event that is used to focus 
+        * the Overlay instance as specified by the "focusevent" 
+        * configuration property.
+        * @private
+        * @param {Event} p_oEvent Object representing the DOM event 
+        * object passed back by the event utility (Event).
+        */
+        _onOverlayElementFocus: function (p_oEvent) {
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                oClose = this.close;
+        
+            
+            if (oClose && (oTarget == oClose || 
+                    Dom.isAncestor(oClose, oTarget))) {
+            
+                this.blur();
+            
+            }
+            else {
+            
+                this.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOverlayDestroy
+        * @description "destroy" event handler for the Overlay.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {Overlay} p_oOverlay Object representing the menu that 
+        * fired the event.
+        */
+        _onOverlayDestroy: function (p_sType, p_aArgs, p_oOverlay) {
+        
+            this.remove(p_oOverlay);
+        
+        },
+        
+        /**
+        * 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.
+        * @method register
+        * @param {Overlay} overlay  An Overlay to register with the manager.
+        * @param {Overlay[]} overlay  An array of Overlays to register with 
+        * the manager.
+        * @return {Boolean} True if any Overlays are registered.
+        */
+        register: function (overlay) {
+        
+            var mgr = this,
+                zIndex,
+                regcount,
+                i,
+                nOverlays;
+        
+            if (overlay instanceof Overlay) {
+
+                overlay.cfg.addProperty("manager", { value: this } );
+        
+                overlay.focusEvent = overlay.createEvent("focus");
+                overlay.focusEvent.signature = CustomEvent.LIST;
+        
+                overlay.blurEvent = overlay.createEvent("blur");
+                overlay.blurEvent.signature = CustomEvent.LIST;
+        
+                overlay.focus = function () {
+                    mgr.focus(this);
+                };
+        
+                overlay.blur = function () {
+    
+                    if (mgr.getActive() == this) {
+
+                        Dom.removeClass(this.element, 
+                            OverlayManager.CSS_FOCUSED);
+
+                        this.blurEvent.fire();
+
+                    }
+
+                };
+        
+                overlay.blurEvent.subscribe(mgr._onOverlayBlur);
+        
+                overlay.hideEvent.subscribe(overlay.blur);
+                
+                overlay.destroyEvent.subscribe(this._onOverlayDestroy, 
+                    overlay, this);
+        
+                Event.on(overlay.element, this.cfg.getProperty("focusevent"), 
+                    this._onOverlayElementFocus, null, overlay);
+        
+                zIndex = Dom.getStyle(overlay.element, "zIndex");
+
+                if (!isNaN(zIndex)) {
+
+                    overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));
+
+                } else {
+
+                    overlay.cfg.setProperty("zIndex", 0);
+
+                }
+        
+
+                this.overlays.push(overlay);
+
+                this.bringToTop(overlay);
+
+                return true;
+
+            } else if (overlay instanceof Array) {
+
+                regcount = 0;
+                nOverlays = overlay.length;
+
+                for (i = 0; i < nOverlays; i++) {
+
+                    if (this.register(overlay[i])) {
+
+                        regcount++;
+
+                    }
+                }
+
+                if (regcount > 0) {
+
+                    return true;
+
+                }
+
+            } else {
+
+                return false;
+
+            }
+
+        },
+
+        /**
+        * Places the specified Overlay instance on top of all other 
+        * Overlay instances.
+        * @method bringToTop
+        * @param {YAHOO.widget.Overlay} p_oOverlay Object representing an 
+        * Overlay instance.
+        * @param {String} p_oOverlay String representing the id of an 
+        * Overlay instance.
+        */        
+        bringToTop: function (p_oOverlay) {
+
+            var oOverlay = this.find(p_oOverlay),
+                nTopZIndex,
+                oTopOverlay,
+                aOverlays;
+
+            if (oOverlay) {
+
+                aOverlays = this.overlays;
+
+                aOverlays.sort(this.compareZIndexDesc);
+                
+                oTopOverlay = aOverlays[0];
+                
+                if (oTopOverlay) {
+
+                    nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex");
+    
+                    if (!isNaN(nTopZIndex) && oTopOverlay != oOverlay) {
+    
+                        oOverlay.cfg.setProperty("zIndex", 
+                            (parseInt(nTopZIndex, 10) + 2));
+    
+                    }
+    
+                    aOverlays.sort(this.compareZIndexDesc);
+                
+                }
+
+            }
+        
+        },
+        
+        /**
+        * Attempts to locate an Overlay by instance or ID.
+        * @method find
+        * @param {Overlay} overlay  An Overlay to locate within the manager
+        * @param {String} overlay  An Overlay id to locate within the manager
+        * @return {Overlay} The requested Overlay, if found, or null if it 
+        * cannot be located.
+        */
+        find: function (overlay) {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+
+                i = nOverlays - 1;
+
+                if (overlay instanceof Overlay) {
+
+                    do {
+
+                        if (aOverlays[i] == overlay) {
+
+                            return aOverlays[i];
+
+                        }
+                    
+                    }
+                    while(i--);
+
+                } else if (typeof overlay == "string") {
+
+                    do {
+
+                        if (aOverlays[i].id == overlay) {
+
+                            return aOverlays[i];
+
+                        }
+
+                    }
+                    while(i--);
+
+                }
+
+                return null;
+            
+            }
+
+        },
+        
+        /**
+        * Used for sorting the manager's Overlays by z-index.
+        * @method compareZIndexDesc
+        * @private
+        * @return {Number} 0, 1, or -1, depending on where the Overlay should 
+        * fall in the stacking order.
+        */
+        compareZIndexDesc: function (o1, o2) {
+    
+            var zIndex1 = o1.cfg.getProperty("zIndex"),
+                zIndex2 = o2.cfg.getProperty("zIndex");
+        
+            if (zIndex1 > zIndex2) {
+                return -1;
+            } else if (zIndex1 < zIndex2) {
+                return 1;
+            } else {
+                return 0;
+            }
+        },
+        
+        /**
+        * Shows all Overlays in the manager.
+        * @method showAll
+        */
+        showAll: function () {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+            
+                i = nOverlays - 1;
+                
+                do {
+
+                    aOverlays[i].show();
+                
+                }
+                while(i--);
+            
+            }
+    
+        },
+        
+        /**
+        * Hides all Overlays in the manager.
+        * @method hideAll
+        */
+        hideAll: function () {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+            
+                i = nOverlays - 1;
+                
+                do {
+
+                    aOverlays[i].hide();
+                
+                }
+                while(i--);
+            
+            }
+    
+        },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the OverlayManager
+        */
+        toString: function () {
+            return "OverlayManager";
+        }
+    
+    };
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Tooltip
+    * @extends YAHOO.widget.Overlay
+    * @constructor
+    * @param {String} el The element ID representing the Tooltip <em>OR</em>
+    * @param {HTMLElement} el The element representing the Tooltip
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Overlay. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Tooltip = function (el, userConfig) {
+    
+        YAHOO.widget.Tooltip.superclass.constructor.call(this, el, userConfig);
+    
+    };
+
+
+    var Lang = YAHOO.lang,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Tooltip = YAHOO.widget.Tooltip,
+    
+        m_oShadowTemplate,
+        
+        /**
+        * Constant representing the Tooltip's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "PREVENT_OVERLAP": { 
+                key: "preventoverlap", 
+                value: true, 
+                validator: Lang.isBoolean, 
+                supercedes: ["x", "y", "xy"] 
+            },
+        
+            "SHOW_DELAY": { 
+                key: "showdelay", 
+                value: 200, 
+                validator: Lang.isNumber 
+            }, 
+        
+            "AUTO_DISMISS_DELAY": { 
+                key: "autodismissdelay", 
+                value: 5000, 
+                validator: Lang.isNumber 
+            }, 
+        
+            "HIDE_DELAY": { 
+                key: "hidedelay", 
+                value: 250, 
+                validator: Lang.isNumber 
+            }, 
+        
+            "TEXT": { 
+                key: "text", 
+                suppressEvent: true 
+            }, 
+        
+            "CONTAINER": { 
+                key: "container"
+            }
+        
+        };
+
+    
+    /**
+    * Constant representing the Tooltip CSS class
+    * @property YAHOO.widget.Tooltip.CSS_TOOLTIP
+    * @static
+    * @final
+    * @type String
+    */
+    Tooltip.CSS_TOOLTIP = "yui-tt";
+
+
+    /* 
+        "hide" event handler that sets a Tooltip instance's "width"
+        configuration property back to its original value before 
+        "setWidthToOffsetWidth" was called.
+    */
+    
+    function restoreOriginalWidth(p_sType, p_aArgs, p_oObject) {
+
+        var sOriginalWidth = p_oObject[0],
+            sNewWidth = p_oObject[1],
+            oConfig = this.cfg,
+            sCurrentWidth = oConfig.getProperty("width");
+
+        if (sCurrentWidth == sNewWidth) {
+            
+            oConfig.setProperty("width", sOriginalWidth);
+        
+        }
+
+        this.unsubscribe("hide", this._onHide, p_oObject);
+    
+    }
+
+    /* 
+        "beforeShow" event handler that sets a Tooltip instance's "width"
+        configuration property to the value of its root HTML 
+        elements's offsetWidth
+    */
+
+    function setWidthToOffsetWidth(p_sType, p_aArgs) {
+
+        var oBody = document.body,
+            oConfig = this.cfg,
+            sOriginalWidth = oConfig.getProperty("width"),
+            sNewWidth,
+            oClone;
+
+        
+        if ((!sOriginalWidth || sOriginalWidth == "auto") && 
+            (oConfig.getProperty("container") != oBody || 
+            oConfig.getProperty("x") >= Dom.getViewportWidth() || 
+            oConfig.getProperty("y") >= Dom.getViewportHeight())) {
+
+            oClone = this.element.cloneNode(true);
+            oClone.style.visibility = "hidden";
+            oClone.style.top = "0px";
+            oClone.style.left = "0px";
+            
+            oBody.appendChild(oClone);
+
+            sNewWidth = (oClone.offsetWidth + "px");
+            
+            oBody.removeChild(oClone);
+            
+            oClone = null;
+
+            oConfig.setProperty("width", sNewWidth);
+            
+            oConfig.refireEvent("xy");
+            
+            this.subscribe("hide", restoreOriginalWidth, 
+                [(sOriginalWidth || ""), sNewWidth]);
+        
+        }
+
+    }
+
+
+    // "onDOMReady" that renders the ToolTip
+
+    function onDOMReady(p_sType, p_aArgs, p_oObject) {
+    
+        this.render(p_oObject);
+    
+    }
+
+
+    //  "init" event handler that automatically renders the Tooltip
+
+    function onInit() {
+
+        Event.onDOMReady(onDOMReady, this.cfg.getProperty("container"), this);
+
+    }
+
+    
+    YAHOO.extend(Tooltip, YAHOO.widget.Overlay, { 
+    
+        /**
+        * The Tooltip initialization method. This method is automatically 
+        * called by the constructor. A Tooltip is automatically rendered by 
+        * the init method, and it also is set to be invisible by default, 
+        * and constrained to viewport by default as well.
+        * @method init
+        * @param {String} el The element ID representing the Tooltip <em>OR</em>
+        * @param {HTMLElement} el The element representing the Tooltip
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Tooltip. 
+        * See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
+    
+            this.logger = new YAHOO.widget.LogWriter(this.toString());
+    
+            Tooltip.superclass.init.call(this, el);
+    
+            this.beforeInitEvent.fire(Tooltip);
+    
+            Dom.addClass(this.element, Tooltip.CSS_TOOLTIP);
+    
+            if (userConfig) {
+
+                this.cfg.applyConfig(userConfig, true);
+
+            }
+    
+            this.cfg.queueProperty("visible", false);
+            this.cfg.queueProperty("constraintoviewport", true);
+    
+            this.setBody("");
+
+            this.subscribe("beforeShow", setWidthToOffsetWidth);
+            this.subscribe("init", onInit);
+            this.subscribe("render", this.onRender);
+    
+            this.initEvent.fire(Tooltip);
+
+        },
+        
+        /**
+        * Initializes the class's configurable properties which can be 
+        * changed using the Overlay's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+
+            Tooltip.superclass.initDefaultConfig.call(this);
+        
+            /**
+            * Specifies whether the Tooltip should be kept from overlapping 
+            * its context element.
+            * @config preventoverlap
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.PREVENT_OVERLAP.key, {
+                value: DEFAULT_CONFIG.PREVENT_OVERLAP.value, 
+                validator: DEFAULT_CONFIG.PREVENT_OVERLAP.validator, 
+                supercedes: DEFAULT_CONFIG.PREVENT_OVERLAP.supercedes
+            });
+        
+            /**
+            * The number of milliseconds to wait before showing a Tooltip 
+            * on mouseover.
+            * @config showdelay
+            * @type Number
+            * @default 200
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.SHOW_DELAY.key, {
+                handler: this.configShowDelay,
+                value: 200, 
+                validator: DEFAULT_CONFIG.SHOW_DELAY.validator
+            });
+        
+            /**
+            * The number of milliseconds to wait before automatically 
+            * dismissing a Tooltip after the mouse has been resting on the 
+            * context element.
+            * @config autodismissdelay
+            * @type Number
+            * @default 5000
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.AUTO_DISMISS_DELAY.key, {
+                handler: this.configAutoDismissDelay,
+                value: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.value,
+                validator: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.validator
+            });
+        
+            /**
+            * The number of milliseconds to wait before hiding a Tooltip 
+            * on mouseover.
+            * @config hidedelay
+            * @type Number
+            * @default 250
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.HIDE_DELAY.key, {
+                handler: this.configHideDelay,
+                value: DEFAULT_CONFIG.HIDE_DELAY.value, 
+                validator: DEFAULT_CONFIG.HIDE_DELAY.validator
+            });
+        
+            /**
+            * Specifies the Tooltip's text.
+            * @config text
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key, {
+                handler: this.configText,
+                suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent
+            });
+
+            /**
+            * Specifies the container element that the Tooltip's markup 
+            * should be rendered into.
+            * @config container
+            * @type HTMLElement/String
+            * @default document.body
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONTAINER.key, {
+                handler: this.configContainer,
+                value: document.body
+            });
+        
+            /**
+            * Specifies the element or elements that the Tooltip should be 
+            * anchored to on mouseover.
+            * @config context
+            * @type HTMLElement[]/String[]
+            * @default null
+            */ 
+
+            /**
+            * String representing the width of the Tooltip.  <em>Please note:
+            * </em> As of version 2.3 if either no value or a value of "auto" 
+            * is specified, and the Toolip's "container" configuration property
+            * is set to something other than <code>document.body</code> or 
+            * its "context" element resides outside the immediately visible 
+            * portion of the document, the width of the Tooltip will be 
+            * calculated based on the offsetWidth of its root HTML and set just 
+            * before it is made visible.  The original value will be 
+            * restored when the Tooltip is hidden. This ensures the Tooltip is 
+            * rendered at a usable width.  For more information see 
+            * SourceForge bug #1685496 and SourceForge 
+            * bug #1735423.
+            * @config width
+            * @type String
+            * @default null
+            */
+        
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the "text" property is changed.
+        * @method configText
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configText: function (type, args, obj) {
+            var text = args[0];
+            if (text) {
+                this.setBody(text);
+            }
+        },
+        
+        /**
+        * The default event handler fired when the "container" property 
+        * is changed.
+        * @method configContainer
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For 
+        * configuration handlers, args[0] will equal the newly applied value 
+        * for the property.
+        * @param {Object} obj The scope object. For configuration handlers,
+        * this will usually equal the owner.
+        */
+        configContainer: function (type, args, obj) {
+
+            var container = args[0];
+
+            if (typeof container == 'string') {
+
+                this.cfg.setProperty("container", 
+                    document.getElementById(container), true);
+
+            }
+
+        },
+        
+        /**
+        * @method _removeEventListeners
+        * @description Removes all of the DOM event handlers from the HTML
+        *  element(s) that trigger the display of the tooltip.
+        * @protected
+        */
+        _removeEventListeners: function () {
+        
+            var aElements = this._context,
+                nElements,
+                oElement,
+                i;
+        
+            
+            if (aElements) {
+        
+                nElements = aElements.length;
+                
+                if (nElements > 0) {
+                
+                    i = nElements - 1;
+                    
+                    do {
+        
+                        oElement = aElements[i];
+        
+                        Event.removeListener(oElement, "mouseover", 
+                            this.onContextMouseOver);
+
+                        Event.removeListener(oElement, "mousemove", 
+                            this.onContextMouseMove);
+
+                        Event.removeListener(oElement, "mouseout", 
+                            this.onContextMouseOut);
+                    
+                    }
+                    while (i--);
+                
+                }
+        
+            }
+        
+        },
+        
+        /**
+        * The default event handler fired when the "context" property 
+        * is changed.
+        * @method configContext
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers,
+        * this will usually equal the owner.
+        */
+        configContext: function (type, args, obj) {
+        
+            var context = args[0],
+                aElements,
+                nElements,
+                oElement,
+                i;
+            
+        
+            if (context) {
+        
+                // Normalize parameter into an array
+                if (! (context instanceof Array)) {
+
+                    if (typeof context == "string") {
+
+                        this.cfg.setProperty("context", 
+                            [document.getElementById(context)], true);
+
+                    } else { // Assuming this is an element
+
+                        this.cfg.setProperty("context", [context], true);
+
+                    }
+
+                    context = this.cfg.getProperty("context");
+
+                }
+        
+        
+                // Remove any existing mouseover/mouseout listeners
+                this._removeEventListeners();
+        
+                // Add mouseover/mouseout listeners to context elements
+                this._context = context;
+        
+                aElements = this._context;
+                
+                if (aElements) {
+            
+                    nElements = aElements.length;
+                    
+                    if (nElements > 0) {
+                    
+                        i = nElements - 1;
+                        
+                        do {
+            
+                            oElement = aElements[i];
+            
+                            Event.on(oElement, "mouseover", 
+                                this.onContextMouseOver, this);
+
+                            Event.on(oElement, "mousemove", 
+                                this.onContextMouseMove, this);
+
+                            Event.on(oElement, "mouseout", 
+                                this.onContextMouseOut, this);
+                        
+                        }
+                        while (i--);
+                    
+                    }
+            
+                }
+        
+            }
+        },
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        // BEGIN BUILT-IN DOM EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the user moves the mouse while 
+        * over the context element.
+        * @method onContextMouseMove
+        * @param {DOMEvent} e The current DOM event
+        * @param {Object} obj The object argument
+        */
+        onContextMouseMove: function (e, obj) {
+            obj.pageX = Event.getPageX(e);
+            obj.pageY = Event.getPageY(e);
+        
+        },
+        
+        /**
+        * The default event handler fired when the user mouses over the 
+        * context element.
+        * @method onContextMouseOver
+        * @param {DOMEvent} e The current DOM event
+        * @param {Object} obj The object argument
+        */
+        onContextMouseOver: function (e, obj) {
+        
+            var context = this;
+        
+            if (obj.hideProcId) {
+
+                clearTimeout(obj.hideProcId);
+
+                obj.logger.log("Clearing hide timer: " + 
+                    obj.hideProcId, "time");
+
+                obj.hideProcId = null;
+
+            }
+        
+            Event.on(context, "mousemove", obj.onContextMouseMove, obj);
+        
+            if (context.title) {
+                obj._tempTitle = context.title;
+                context.title = "";
+            }
+        
+            /**
+            * The unique process ID associated with the thread responsible 
+            * for showing the Tooltip.
+            * @type int
+            */
+            obj.showProcId = obj.doShow(e, context);
+            obj.logger.log("Setting show tooltip timeout: " + 
+                obj.showProcId, "time");
+
+        },
+        
+        /**
+        * The default event handler fired when the user mouses out of 
+        * the context element.
+        * @method onContextMouseOut
+        * @param {DOMEvent} e The current DOM event
+        * @param {Object} obj The object argument
+        */
+        onContextMouseOut: function (e, obj) {
+            var el = this;
+        
+            if (obj._tempTitle) {
+                el.title = obj._tempTitle;
+                obj._tempTitle = null;
+            }
+        
+            if (obj.showProcId) {
+                clearTimeout(obj.showProcId);
+                obj.logger.log("Clearing show timer: " + 
+                    obj.showProcId, "time");
+                obj.showProcId = null;
+            }
+        
+            if (obj.hideProcId) {
+                clearTimeout(obj.hideProcId);
+                obj.logger.log("Clearing hide timer: " + 
+                    obj.hideProcId, "time");
+                obj.hideProcId = null;
+            }
+        
+        
+            obj.hideProcId = setTimeout(function () {
+                obj.hide();
+    
+            }, obj.cfg.getProperty("hidedelay"));
+    
+        },
+        
+        // END BUILT-IN DOM EVENT HANDLERS //
+        
+        /**
+        * Processes the showing of the Tooltip by setting the timeout delay 
+        * and offset of the Tooltip.
+        * @method doShow
+        * @param {DOMEvent} e The current DOM event
+        * @return {Number} The process ID of the timeout function associated 
+        * with doShow
+        */
+        doShow: function (e, context) {
+        
+            var yOffset = 25,
+                me = this;
+        
+            if (YAHOO.env.ua.opera && context.tagName && 
+                context.tagName.toUpperCase() == "A") {
+
+                yOffset += 12;
+
+            }
+        
+            return setTimeout(function () {
+        
+                if (me._tempTitle) {
+                    me.setBody(me._tempTitle);
+                } else {
+                    me.cfg.refireEvent("text");
+                }
+        
+                me.logger.log("Show tooltip", "time");
+                me.moveTo(me.pageX, me.pageY + yOffset);
+
+                if (me.cfg.getProperty("preventoverlap")) {
+                    me.preventOverlap(me.pageX, me.pageY);
+                }
+        
+                Event.removeListener(context, "mousemove", 
+                    me.onContextMouseMove);
+        
+                me.show();
+                me.hideProcId = me.doHide();
+
+                me.logger.log("Hide tooltip time active: " +
+                    me.hideProcId, "time");
+
+            }, this.cfg.getProperty("showdelay"));
+        
+        },
+        
+        /**
+        * Sets the timeout for the auto-dismiss delay, which by default is 5 
+        * seconds, meaning that a tooltip will automatically dismiss itself 
+        * after 5 seconds of being displayed.
+        * @method doHide
+        */
+        doHide: function () {
+        
+            var me = this;
+        
+            me.logger.log("Setting hide tooltip timeout", "time");
+        
+            return setTimeout(function () {
+        
+                me.logger.log("Hide tooltip", "time");
+                me.hide();
+        
+            }, this.cfg.getProperty("autodismissdelay"));
+        
+        },
+        
+        /**
+        * Fired when the Tooltip is moved, this event handler is used to 
+        * prevent the Tooltip from overlapping with its context element.
+        * @method preventOverlay
+        * @param {Number} pageX The x coordinate position of the mouse pointer
+        * @param {Number} pageY The y coordinate position of the mouse pointer
+        */
+        preventOverlap: function (pageX, pageY) {
+        
+            var height = this.element.offsetHeight,
+                mousePoint = new YAHOO.util.Point(pageX, pageY),
+                elementRegion = Dom.getRegion(this.element);
+        
+            elementRegion.top -= 5;
+            elementRegion.left -= 5;
+            elementRegion.right += 5;
+            elementRegion.bottom += 5;
+        
+            this.logger.log("context " + elementRegion, "ttip");
+            this.logger.log("mouse " + mousePoint, "ttip");
+        
+            if (elementRegion.contains(mousePoint)) {
+                this.logger.log("OVERLAP", "warn");
+                this.cfg.setProperty("y", (pageY - height - 5));
+            }
+        },
+
+
+        /**
+        * @method onRender
+        * @description "render" event handler for the Tooltip.
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        onRender: function (p_sType, p_aArgs) {
+    
+            function sizeShadow() {
+    
+                var oElement = this.element,
+                    oShadow = this._shadow;
+            
+                if (oShadow) {
+            
+                    oShadow.style.width = (oElement.offsetWidth + 6) + "px";
+                    oShadow.style.height = (oElement.offsetHeight + 1) + "px"; 
+            
+                }
+            
+            }
+
+
+            function addShadowVisibleClass() {
+            
+                Dom.addClass(this._shadow, "yui-tt-shadow-visible");
+            
+            }
+            
+
+            function removeShadowVisibleClass() {
+        
+                Dom.removeClass(this._shadow, "yui-tt-shadow-visible");
+            
+            }
+    
+    
+            function createShadow() {
+    
+                var oShadow = this._shadow,
+                    oElement,
+                    Module,
+                    nIE,
+                    me;
+    
+                if (!oShadow) {
+    
+                    oElement = this.element;
+                    Module = YAHOO.widget.Module;
+                    nIE = YAHOO.env.ua.ie;
+                    me = this;
+    
+                    if (!m_oShadowTemplate) {
+        
+                        m_oShadowTemplate = document.createElement("div");
+                        m_oShadowTemplate.className = "yui-tt-shadow";
+                    
+                    }
+        
+                    oShadow = m_oShadowTemplate.cloneNode(false);
+        
+                    oElement.appendChild(oShadow);
+                    
+                    this._shadow = oShadow;
+    
+                    addShadowVisibleClass.call(this);
+        
+                    this.subscribe("beforeShow", addShadowVisibleClass);
+                    this.subscribe("beforeHide", removeShadowVisibleClass);
+
+                    if (nIE == 6 || 
+                        (nIE == 7 && document.compatMode == "BackCompat")) {
+                
+                        window.setTimeout(function () { 
+        
+                            sizeShadow.call(me); 
+        
+                        }, 0);
+    
+                        this.cfg.subscribeToConfigEvent("width", sizeShadow);
+                        this.cfg.subscribeToConfigEvent("height", sizeShadow);
+                        this.subscribe("changeContent", sizeShadow);
+    
+                        Module.textResizeEvent.subscribe(sizeShadow, 
+                                                            this, true);
+                        
+                        this.subscribe("destroy", function () {
+                        
+                            Module.textResizeEvent.unsubscribe(sizeShadow, 
+                                                                    this);
+                        
+                        });
+                
+                    }
+                
+                }
+    
+            }
+    
+    
+            function onBeforeShow() {
+            
+                createShadow.call(this);
+    
+                this.unsubscribe("beforeShow", onBeforeShow);
+            
+            }
+    
+    
+            if (this.cfg.getProperty("visible")) {
+    
+                createShadow.call(this);
+            
+            }
+            else {
+    
+                this.subscribe("beforeShow", onBeforeShow);
+            
+            }
+        
+        },
+        
+        /**
+        * Removes the Tooltip element from the DOM and sets all child 
+        * elements to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            // Remove any existing mouseover/mouseout listeners
+            this._removeEventListeners();
+        
+            Tooltip.superclass.destroy.call(this);  
+        
+        },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Tooltip
+        */
+        toString: function () {
+            return "Tooltip " + this.id;
+        }
+    
+    });
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Panel
+    * @extends Overlay
+    * @constructor
+    * @param {String} el The element ID representing the Panel <em>OR</em>
+    * @param {HTMLElement} el The element representing the Panel
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Panel. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Panel = function (el, userConfig) {
+    
+        YAHOO.widget.Panel.superclass.constructor.call(this, el, userConfig);
+    
+    };
+
+
+    var Lang = YAHOO.lang,
+        DD = YAHOO.util.DD,
+        Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Overlay = YAHOO.widget.Overlay,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Config = YAHOO.util.Config,
+        Panel = YAHOO.widget.Panel,
+
+        m_oMaskTemplate,
+        m_oUnderlayTemplate,
+        m_oCloseIconTemplate,
+
+        /**
+        * Constant representing the name of the Panel's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "SHOW_MASK": "showMask",
+            "HIDE_MASK": "hideMask",
+            "DRAG": "drag"
+        
+        },
+        
+        /**
+        * Constant representing the Panel's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "CLOSE": { 
+                key: "close", 
+                value: true, 
+                validator: Lang.isBoolean, 
+                supercedes: ["visible"] 
+            },
+            
+            "DRAGGABLE": { 
+                key: "draggable", 
+                value: (DD ? true : false), 
+                validator: Lang.isBoolean, 
+                supercedes: ["visible"]  
+            },
+            
+            "UNDERLAY": { 
+                key: "underlay", 
+                value: "shadow", 
+                supercedes: ["visible"] 
+            },
+            
+            "MODAL": { 
+                key: "modal", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["visible"] 
+            },
+            
+            "KEY_LISTENERS": { 
+                key: "keylisteners", 
+                suppressEvent: true, 
+                supercedes: ["visible"] 
+            }
+        
+        };
+
+
+    /**
+    * Constant representing the default CSS class used for a Panel
+    * @property YAHOO.widget.Panel.CSS_PANEL
+    * @static
+    * @final
+    * @type String
+    */
+    Panel.CSS_PANEL = "yui-panel";
+    
+    /**
+    * Constant representing the default CSS class used for a Panel's 
+    * wrapping container
+    * @property YAHOO.widget.Panel.CSS_PANEL_CONTAINER
+    * @static
+    * @final
+    * @type String
+    */
+    Panel.CSS_PANEL_CONTAINER = "yui-panel-container";
+
+
+    // Private CustomEvent listeners
+
+    /* 
+        "beforeRender" event handler that creates an empty header for a Panel 
+        instance if its "draggable" configuration property is set to "true" 
+        and no header has been created.
+    */
+
+    function createHeader(p_sType, p_aArgs) {
+
+        if (!this.header) {
+
+            this.setHeader("&#160;");
+
+        }
+
+    }
+
+
+    /* 
+        "hide" event handler that sets a Panel instance's "width"
+        configuration property back to its original value before 
+        "setWidthToOffsetWidth" was called.
+    */
+    
+    function restoreOriginalWidth(p_sType, p_aArgs, p_oObject) {
+
+        var sOriginalWidth = p_oObject[0],
+            sNewWidth = p_oObject[1],
+            oConfig = this.cfg,
+            sCurrentWidth = oConfig.getProperty("width");
+
+        if (sCurrentWidth == sNewWidth) {
+            
+            oConfig.setProperty("width", sOriginalWidth);
+        
+        }
+
+        this.unsubscribe("hide", restoreOriginalWidth, p_oObject);
+    
+    }
+
+
+    /* 
+        "beforeShow" event handler that sets a Panel instance's "width"
+        configuration property to the value of its root HTML 
+        elements's offsetWidth
+    */
+
+    function setWidthToOffsetWidth(p_sType, p_aArgs) {
+
+        var nIE = YAHOO.env.ua.ie,
+            oConfig,
+            sOriginalWidth,
+            sNewWidth;
+
+        if (nIE == 6 || (nIE == 7 && document.compatMode == "BackCompat")) {
+
+            oConfig = this.cfg;
+            sOriginalWidth = oConfig.getProperty("width");
+            
+            if (!sOriginalWidth || sOriginalWidth == "auto") {
+    
+                sNewWidth = (this.element.offsetWidth + "px");
+    
+                oConfig.setProperty("width", sNewWidth);
+                
+                this.subscribe("hide", restoreOriginalWidth, 
+                    [(sOriginalWidth || ""), sNewWidth]);
+            
+            }
+        
+        }
+
+    }
+
+    /* 
+        "focus" event handler for a focuable element.  Used to automatically 
+        blur the element when it receives focus to ensure that a Panel 
+        instance's modality is not compromised.
+    */
+
+    function onElementFocus() {
+
+        this.blur();
+
+    }
+
+    /* 
+        "showMask" event handler that adds a "focus" event handler to all
+        focusable elements in the document to enforce a Panel instance's 
+        modality from being compromised.
+    */
+
+    function addFocusEventHandlers(p_sType, p_aArgs) {
+
+        var me = this;
+
+        function isFocusable(el) {
+
+            var sTagName = el.tagName.toUpperCase(),
+                bFocusable = false;
+            
+            switch (sTagName) {
+            
+            case "A":
+            case "BUTTON":
+            case "SELECT":
+            case "TEXTAREA":
+
+                if (!Dom.isAncestor(me.element, el)) {
+                    Event.on(el, "focus", onElementFocus, el, true);
+                    bFocusable = true;
+                }
+
+                break;
+
+            case "INPUT":
+
+                if (el.type != "hidden" && 
+                    !Dom.isAncestor(me.element, el)) {
+
+                    Event.on(el, "focus", onElementFocus, el, true);
+                    bFocusable = true;
+
+                }
+
+                break;
+            
+            }
+
+            return bFocusable;
+
+        }
+
+        this.focusableElements = Dom.getElementsBy(isFocusable);
+    
+    }
+
+    /* 
+        "hideMask" event handler that removes all "focus" event handlers added 
+        by the "addFocusEventHandlers" method.
+    */
+    
+    function removeFocusEventHandlers(p_sType, p_aArgs) {
+
+        var aElements = this.focusableElements,
+            nElements = aElements.length,
+            el2,
+            i;
+
+        for (i = 0; i < nElements; i++) {
+            el2 = aElements[i];
+            Event.removeListener(el2, "focus", onElementFocus);
+        }
+
+    }
+
+    
+    YAHOO.extend(Panel, Overlay, {
+    
+        /**
+        * 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.
+        * @method init
+        * @param {String} el The element ID representing the Overlay <em>OR</em>
+        * @param {HTMLElement} el The element representing the Overlay
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Overlay. 
+        * See configuration documentation for more details.
+        */
+        init: function (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
+            */
+
+            Panel.superclass.init.call(this, el/*, userConfig*/);  
+        
+            this.beforeInitEvent.fire(Panel);
+        
+            Dom.addClass(this.element, Panel.CSS_PANEL);
+        
+            this.buildWrapper();
+        
+            if (userConfig) {
+
+                this.cfg.applyConfig(userConfig, true);
+
+            }
+        
+            this.subscribe("showMask", addFocusEventHandlers);
+            this.subscribe("hideMask", removeFocusEventHandlers);
+
+            this.initEvent.fire(Panel);
+            
+        },
+        
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        */
+        initEvents: function () {
+            Panel.superclass.initEvents.call(this);
+        
+            var SIGNATURE = CustomEvent.LIST;
+        
+            /**
+            * CustomEvent fired after the modality mask is shown
+            * @event showMaskEvent
+            */
+            this.showMaskEvent = this.createEvent(EVENT_TYPES.SHOW_MASK);
+            this.showMaskEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the modality mask is hidden
+            * @event hideMaskEvent
+            */
+            this.hideMaskEvent = this.createEvent(EVENT_TYPES.HIDE_MASK);
+            this.hideMaskEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent when the Panel is dragged
+            * @event dragEvent
+            */
+            this.dragEvent = this.createEvent(EVENT_TYPES.DRAG);
+            this.dragEvent.signature = SIGNATURE;
+        
+        },
+        
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the Panel's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+            Panel.superclass.initDefaultConfig.call(this);
+        
+            // Add panel config properties //
+        
+            /**
+            * True if the Panel should display a "close" button
+            * @config close
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CLOSE.key, { 
+                handler: this.configClose, 
+                value: DEFAULT_CONFIG.CLOSE.value, 
+                validator: DEFAULT_CONFIG.CLOSE.validator, 
+                supercedes: DEFAULT_CONFIG.CLOSE.supercedes 
+            });
+        
+            /**
+            * Boolean specifying if the Panel should be draggable.  The default 
+            * value is "true" if the Drag and Drop utility is included, 
+            * otherwise it is "false." <strong>PLEASE NOTE:</strong> There is a 
+            * known issue in IE 6 (Strict Mode and Quirks Mode) and IE 7 
+            * (Quirks Mode) where Panels that either don't have a value set for 
+            * their "width" configuration property, or their "width" 
+            * configuration property is set to "auto" will only be draggable by
+            * placing the mouse on the text of the Panel's header element.
+            * To fix this bug, draggable Panels missing a value for their 
+            * "width" configuration property, or whose "width" configuration 
+            * property is set to "auto" will have it set to the value of 
+            * their root HTML element's offsetWidth before they are made 
+            * visible.  The calculated width is then removed when the Panel is   
+            * hidden. <em>This fix is only applied to draggable Panels in IE 6 
+            * (Strict Mode and Quirks Mode) and IE 7 (Quirks Mode)</em>. For 
+            * more information on this issue see:
+            * SourceForge bugs #1726972 and #1589210.
+            * @config draggable
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.DRAGGABLE.key, { 
+                handler: this.configDraggable, 
+                value: DEFAULT_CONFIG.DRAGGABLE.value, 
+                validator: DEFAULT_CONFIG.DRAGGABLE.validator, 
+                supercedes: DEFAULT_CONFIG.DRAGGABLE.supercedes 
+            });
+        
+            /**
+            * Sets the type of underlay to display for the Panel. Valid values 
+            * are "shadow," "matte," and "none".  <strong>PLEASE NOTE:</strong> 
+            * The creation of the underlay element is deferred until the Panel 
+            * is initially made visible.  For Gecko-based browsers on Mac
+            * OS X the underlay elment is always created as it is used as a 
+            * shim to prevent Aqua scrollbars below a Panel instance from poking 
+            * through it (See SourceForge bug #836476).
+            * @config underlay
+            * @type String
+            * @default shadow
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.UNDERLAY.key, { 
+                handler: this.configUnderlay, 
+                value: DEFAULT_CONFIG.UNDERLAY.value, 
+                supercedes: DEFAULT_CONFIG.UNDERLAY.supercedes 
+            });
+        
+            /**
+            * 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.
+            * @config modal
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.MODAL.key, { 
+                handler: this.configModal, 
+                value: DEFAULT_CONFIG.MODAL.value,
+                validator: DEFAULT_CONFIG.MODAL.validator, 
+                supercedes: DEFAULT_CONFIG.MODAL.supercedes 
+            });
+        
+            /**
+            * A KeyListener (or array of KeyListeners) that will be enabled 
+            * when the Panel is shown, and disabled when the Panel is hidden.
+            * @config keylisteners
+            * @type YAHOO.util.KeyListener[]
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.KEY_LISTENERS.key, { 
+                handler: this.configKeyListeners, 
+                suppressEvent: DEFAULT_CONFIG.KEY_LISTENERS.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.KEY_LISTENERS.supercedes 
+            });
+        
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * 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.
+        * @method configClose
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configClose: function (type, args, obj) {
+
+            var val = args[0],
+                oClose = this.close;
+        
+            function doHide(e, obj) {
+
+                obj.hide();
+
+            }
+        
+            if (val) {
+
+                if (!oClose) {
+
+                    if (!m_oCloseIconTemplate) {
+
+                        m_oCloseIconTemplate = document.createElement("span");
+                        m_oCloseIconTemplate.innerHTML = "&#160;";
+                        m_oCloseIconTemplate.className = "container-close";
+
+                    }
+
+                    oClose = m_oCloseIconTemplate.cloneNode(true);
+
+                    this.innerElement.appendChild(oClose);
+
+                    Event.on(oClose, "click", doHide, this);
+                    
+                    this.close = oClose;
+                    
+
+                } else {
+
+                    oClose.style.display = "block";
+
+                }
+
+            } else {
+
+                if (oClose) {
+
+                    oClose.style.display = "none";
+
+                }
+
+            }
+
+        },
+
+
+
+        /**
+        * The default event handler fired when the "draggable" property 
+        * is changed.
+        * @method configDraggable
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configDraggable: function (type, args, obj) {
+        
+            var val = args[0];
+
+            if (val) {
+        
+                if (!DD) {
+            
+                    YAHOO.log("DD dependency not met.", "error");
+        
+                    this.cfg.setProperty("draggable", false);
+            
+                    return;
+                
+                }
+        
+                if (this.header) {
+
+                    Dom.setStyle(this.header, "cursor", "move");
+
+                    this.registerDragDrop();
+
+                }
+
+                this.subscribe("beforeRender", createHeader);
+                this.subscribe("beforeShow", setWidthToOffsetWidth);
+
+            } else {
+
+                if (this.dd) {
+
+                    this.dd.unreg();
+
+                }
+
+                if (this.header) {
+
+                    Dom.setStyle(this.header,"cursor","auto");
+
+                }
+
+                this.unsubscribe("beforeRender", createHeader);
+                this.unsubscribe("beforeShow", setWidthToOffsetWidth);
+
+            }
+
+        },
+      
+
+        /**
+        * The default event handler fired when the "underlay" property 
+        * is changed.
+        * @method configUnderlay
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configUnderlay: function (type, args, obj) {
+    
+            var UA = YAHOO.env.ua,
+                bMacGecko = (this.platform == "mac" && UA.gecko),
+                sUnderlay = args[0].toLowerCase(),
+                oUnderlay = this.underlay,
+                oElement = this.element;
+
+
+            function createUnderlay() {
+
+                var nIE;
+
+                if (!oUnderlay) { // create if not already in DOM
+
+                    if (!m_oUnderlayTemplate) {
+
+                        m_oUnderlayTemplate = document.createElement("div");
+                        m_oUnderlayTemplate.className = "underlay";
+                    
+                    }
+
+                    oUnderlay = m_oUnderlayTemplate.cloneNode(false);
+                    this.element.appendChild(oUnderlay);
+                    
+                    this.underlay = oUnderlay;
+
+                    nIE = UA.ie;
+
+                    if (nIE == 6 || 
+                        (nIE == 7 && document.compatMode == "BackCompat")) {
+                            
+                        this.sizeUnderlay();
+
+                        this.cfg.subscribeToConfigEvent("width", 
+                            this.sizeUnderlay);
+
+                        this.cfg.subscribeToConfigEvent("height", 
+                            this.sizeUnderlay);
+
+                        this.changeContentEvent.subscribe(this.sizeUnderlay);
+
+                        YAHOO.widget.Module.textResizeEvent.subscribe(
+                            this.sizeUnderlay, this, true);
+                    
+                    }
+
+                }
+
+            }
+
+
+            function onBeforeShow() {
+            
+                createUnderlay.call(this);
+    
+                this._underlayDeferred = false;
+    
+                this.beforeShowEvent.unsubscribe(onBeforeShow);
+            
+            }
+
+            
+            function destroyUnderlay() {
+
+                if (this._underlayDeferred) {
+
+                    this.beforeShowEvent.unsubscribe(onBeforeShow);
+                
+                    this._underlayDeferred = false;
+
+                }
+            
+                if (oUnderlay) {
+            
+                    this.cfg.unsubscribeFromConfigEvent("width", 
+                        this.sizeUnderlay);
+    
+                    this.cfg.unsubscribeFromConfigEvent("height", 
+                        this.sizeUnderlay);
+    
+                    this.changeContentEvent.unsubscribe(this.sizeUnderlay);
+    
+                    YAHOO.widget.Module.textResizeEvent.unsubscribe(
+                        this.sizeUnderlay, this, true);
+    
+                    this.element.removeChild(oUnderlay);
+                    
+                    this.underlay = null;
+
+                }
+                    
+            }
+        
+
+            switch (sUnderlay) {
+    
+            case "shadow":
+
+                Dom.removeClass(oElement, "matte");
+                Dom.addClass(oElement, "shadow");
+
+                break;
+
+            case "matte":
+
+                if (!bMacGecko) {
+
+                    destroyUnderlay.call(this);
+
+                }
+            
+                Dom.removeClass(oElement, "shadow");
+                Dom.addClass(oElement, "matte");
+
+                break;
+
+            default:
+
+                if (!bMacGecko) {
+
+                    destroyUnderlay.call(this);
+
+                }
+            
+                Dom.removeClass(oElement, "shadow");
+                Dom.removeClass(oElement, "matte");
+
+                break;
+
+            }
+
+
+            if ((sUnderlay == "shadow") || (bMacGecko && !oUnderlay)) {
+                
+                if (this.cfg.getProperty("visible")) {
+                
+                    createUnderlay.call(this);
+                
+                }
+                else {
+
+                    if (!this._underlayDeferred) {
+
+                        this.beforeShowEvent.subscribe(onBeforeShow);
+                    
+                        this._underlayDeferred = true;
+
+                    }
+                
+                }
+
+            }
+    
+        },
+        
+        /**
+        * 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.
+        * @method configModal
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configModal: function (type, args, obj) {
+
+            var modal = args[0];
+
+            if (modal) {
+
+                if (!this._hasModalityEventListeners) {
+
+                    this.subscribe("beforeShow", this.buildMask);
+                    this.subscribe("beforeShow", this.bringToTop);
+                    this.subscribe("beforeShow", this.showMask);
+                    this.subscribe("hide", this.hideMask);
+
+                    Overlay.windowResizeEvent.subscribe(this.sizeMask, 
+                        this, true);
+
+                    this._hasModalityEventListeners = true;
+
+                }
+
+            } else {
+
+                if (this._hasModalityEventListeners) {
+
+                    if (this.cfg.getProperty("visible")) {
+                    
+                        this.hideMask();
+                        this.removeMask();
+                    
+                    }
+
+                    this.unsubscribe("beforeShow", this.buildMask);
+                    this.unsubscribe("beforeShow", this.bringToTop);
+                    this.unsubscribe("beforeShow", this.showMask);
+                    this.unsubscribe("hide", this.hideMask);
+
+                    Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);
+                    
+                    this._hasModalityEventListeners = false;
+                
+                }
+
+            }
+
+        },
+        
+        /**
+        * Removes the modality mask.
+        * @method removeMask
+        */
+        removeMask: function () {
+        
+            var oMask = this.mask,
+                oParentNode;
+        
+            if (oMask) {
+            
+                /*
+                    Hide the mask before destroying it to ensure that DOM
+                    event handlers on focusable elements get removed.
+                */
+        
+                this.hideMask();
+            
+                oParentNode = oMask.parentNode;
+        
+                if (oParentNode) {
+        
+                    oParentNode.removeChild(oMask);
+        
+                }
+        
+                this.mask = null;
+            }
+            
+        },
+        
+        /**
+        * The default event handler fired when the "keylisteners" property 
+        * is changed.
+        * @method configKeyListeners
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configKeyListeners: function (type, args, obj) {
+
+            var listeners = args[0],
+                listener,
+                nListeners,
+                i;
+        
+            if (listeners) {
+
+                if (listeners instanceof Array) {
+
+                    nListeners = listeners.length;
+
+                    for (i = 0; i < nListeners; i++) {
+
+                        listener = listeners[i];
+        
+                        if (!Config.alreadySubscribed(this.showEvent, 
+                            listener.enable, listener)) {
+
+                            this.showEvent.subscribe(listener.enable, 
+                                listener, true);
+
+                        }
+
+                        if (!Config.alreadySubscribed(this.hideEvent, 
+                            listener.disable, listener)) {
+
+                            this.hideEvent.subscribe(listener.disable, 
+                                listener, true);
+
+                            this.destroyEvent.subscribe(listener.disable, 
+                                listener, true);
+                        }
+
+                    }
+
+                } else {
+
+                    if (!Config.alreadySubscribed(this.showEvent, 
+                        listeners.enable, listeners)) {
+
+                        this.showEvent.subscribe(listeners.enable, 
+                            listeners, true);
+                    }
+
+                    if (!Config.alreadySubscribed(this.hideEvent, 
+                        listeners.disable, listeners)) {
+
+                        this.hideEvent.subscribe(listeners.disable, 
+                            listeners, true);
+
+                        this.destroyEvent.subscribe(listeners.disable, 
+                            listeners, true);
+
+                    }
+
+                }
+
+            }
+
+        },
+        
+        /**
+        * The default event handler fired when the "height" property is changed.
+        * @method configHeight
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configHeight: function (type, args, obj) {
+    
+            var height = args[0],
+                el = this.innerElement;
+    
+            Dom.setStyle(el, "height", height);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "width" property is changed.
+        * @method configWidth
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configWidth: function (type, args, obj) {
+    
+            var width = args[0],
+                el = this.innerElement;
+    
+            Dom.setStyle(el, "width", width);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "zIndex" property is changed.
+        * @method configzIndex
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configzIndex: function (type, args, obj) {
+    
+            Panel.superclass.configzIndex.call(this, type, args, obj);
+        
+            var maskZ = 0,
+                currentZ = Dom.getStyle(this.element, "zIndex");
+        
+            if (this.mask) {
+
+                if (!currentZ || isNaN(currentZ)) {
+                    currentZ = 0;
+                }
+        
+                if (currentZ === 0) {
+
+                    this.cfg.setProperty("zIndex", 1);
+
+                } else {
+
+                    maskZ = currentZ - 1;
+                    Dom.setStyle(this.mask, "zIndex", maskZ);
+
+                }
+        
+            }
+        },
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        
+        /**
+        * Builds the wrapping container around the Panel that is used for 
+        * positioning the shadow and matte underlays. The container element is 
+        * assigned to a  local instance variable called container, and the 
+        * element is reinserted inside of it.
+        * @method buildWrapper
+        */
+        buildWrapper: function () {
+    
+            var elementParent = this.element.parentNode,
+                originalElement = this.element,
+                wrapper = document.createElement("div");
+    
+            wrapper.className = Panel.CSS_PANEL_CONTAINER;
+            wrapper.id = originalElement.id + "_c";
+        
+            if (elementParent) {
+                elementParent.insertBefore(wrapper, originalElement);
+            }
+        
+            wrapper.appendChild(originalElement);
+        
+            this.element = wrapper;
+            this.innerElement = originalElement;
+        
+            Dom.setStyle(this.innerElement, "visibility", "inherit");
+        },
+        
+        /**
+        * Adjusts the size of the shadow based on the size of the element.
+        * @method sizeUnderlay
+        */
+        sizeUnderlay: function () {
+
+            var oUnderlay = this.underlay,
+                oElement;
+
+            if (oUnderlay) {
+
+                oElement = this.element;
+
+                oUnderlay.style.width = oElement.offsetWidth + "px";
+                oUnderlay.style.height = oElement.offsetHeight + "px";
+
+            }
+
+        },
+
+        
+        /**
+        * Registers the Panel's header for drag & drop capability.
+        * @method registerDragDrop
+        */
+        registerDragDrop: function () {
+    
+            var me = this;
+    
+            if (this.header) {
+        
+                if (!DD) {
+        
+                    YAHOO.log("DD dependency not met.", "error");
+        
+                    return;
+                
+                }
+        
+                this.dd = new DD(this.element.id, this.id);
+        
+                if (!this.header.id) {
+                    this.header.id = this.id + "_h";
+                }
+        
+    
+                this.dd.startDrag = function () {
+        
+                    var offsetHeight,
+                        offsetWidth,
+                        viewPortWidth,
+                        viewPortHeight,
+                        scrollX,
+                        scrollY,
+                        topConstraint,
+                        leftConstraint,
+                        bottomConstraint,
+                        rightConstraint;
+    
+                    if (YAHOO.env.ua.ie == 6) {
+                        Dom.addClass(me.element,"drag");
+                    }
+        
+                    if (me.cfg.getProperty("constraintoviewport")) {
+    
+                        offsetHeight = me.element.offsetHeight;
+                        offsetWidth = me.element.offsetWidth;
+                        
+                        viewPortWidth = Dom.getViewportWidth();
+                        viewPortHeight = Dom.getViewportHeight();
+                        
+                        scrollX = Dom.getDocumentScrollLeft();
+                        scrollY = Dom.getDocumentScrollTop();
+                        
+                        topConstraint = scrollY + 10;
+                        leftConstraint = scrollX + 10;
+
+                        bottomConstraint = 
+                            scrollY + viewPortHeight - offsetHeight - 10;
+
+                        rightConstraint = 
+                            scrollX + viewPortWidth - offsetWidth - 10;
+        
+                        this.minX = leftConstraint;
+                        this.maxX = rightConstraint;
+                        this.constrainX = true;
+        
+                        this.minY = topConstraint;
+                        this.maxY = bottomConstraint;
+                        this.constrainY = true;
+    
+                    } else {
+    
+                        this.constrainX = false;
+                        this.constrainY = false;
+    
+                    }
+        
+                    me.dragEvent.fire("startDrag", arguments);
+                };
+        
+                this.dd.onDrag = function () {
+                    me.syncPosition();
+                    me.cfg.refireEvent("iframe");
+                    if (this.platform == "mac" && YAHOO.env.ua.gecko) {
+                        this.showMacGeckoScrollbars();
+                    }
+        
+                    me.dragEvent.fire("onDrag", arguments);
+                };
+        
+                this.dd.endDrag = function () {
+
+                    if (YAHOO.env.ua.ie == 6) {
+                        Dom.removeClass(me.element,"drag");
+                    }
+        
+                    me.dragEvent.fire("endDrag", arguments);
+                    me.moveEvent.fire(me.cfg.getProperty("xy"));
+                    
+                };
+        
+                this.dd.setHandleElId(this.header.id);
+                this.dd.addInvalidHandleType("INPUT");
+                this.dd.addInvalidHandleType("SELECT");
+                this.dd.addInvalidHandleType("TEXTAREA");
+            }
+        },
+        
+        /**
+        * Builds the mask that is laid over the document when the Panel is 
+        * configured to be modal.
+        * @method buildMask
+        */
+        buildMask: function () {
+    
+            var oMask = this.mask;
+    
+            if (!oMask) {
+
+                if (!m_oMaskTemplate) {
+                
+                    m_oMaskTemplate = document.createElement("div");
+                    m_oMaskTemplate.className = "mask";
+                    m_oMaskTemplate.innerHTML = "&#160;";
+                
+                }
+
+                oMask = m_oMaskTemplate.cloneNode(true);
+                oMask.id = this.id + "_mask";
+
+                document.body.insertBefore(oMask, document.body.firstChild);
+                
+                this.mask = oMask;
+
+            }
+
+        },
+        
+        /**
+        * Hides the modality mask.
+        * @method hideMask
+        */
+        hideMask: function () {
+            if (this.cfg.getProperty("modal") && this.mask) {
+                this.mask.style.display = "none";
+                this.hideMaskEvent.fire();
+                Dom.removeClass(document.body, "masked");
+            }
+        },
+        
+        /**
+        * Shows the modality mask.
+        * @method showMask
+        */
+        showMask: function () {
+            if (this.cfg.getProperty("modal") && this.mask) {
+                Dom.addClass(document.body, "masked");
+                this.sizeMask();
+                this.mask.style.display = "block";
+                this.showMaskEvent.fire();
+            }
+        },
+        
+        /**
+        * Sets the size of the modality mask to cover the entire scrollable 
+        * area of the document
+        * @method sizeMask
+        */
+        sizeMask: function () {
+
+            if (this.mask) {
+
+                this.mask.style.height = Dom.getDocumentHeight() + "px";
+                this.mask.style.width = Dom.getDocumentWidth() + "px";
+
+            }
+
+        },
+
+        
+        /**
+        * 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.
+        * @method render
+        * @param {String} appendToNode The element id to which the Module 
+        * should be appended to prior to rendering <em>OR</em>
+        * @param {HTMLElement} appendToNode The element to which the Module 
+        * should be appended to prior to rendering
+        * @return {boolean} Success or failure of the render
+        */
+        render: function (appendToNode) {
+
+            return Panel.superclass.render.call(this, 
+                appendToNode, this.innerElement);
+
+        },
+        
+        /**
+        * Removes the Panel element from the DOM and sets all child elements
+        * to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);
+            
+            this.removeMask();
+        
+            if (this.close) {
+            
+                Event.purgeElement(this.close);
+        
+            }
+        
+            Panel.superclass.destroy.call(this);  
+        
+        },
+        
+        /**
+        * Returns a String representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Panel.
+        */
+        toString: function () {
+            return "Panel " + this.id;
+        }
+    
+    });
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Dialog
+    * @extends YAHOO.widget.Panel
+    * @constructor
+    * @param {String} el The element ID representing the Dialog <em>OR</em>
+    * @param {HTMLElement} el The element representing the Dialog
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Dialog. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Dialog = function (el, userConfig) {
+    
+        YAHOO.widget.Dialog.superclass.constructor.call(this, el, userConfig);
+    
+    };
+
+
+    var Event = YAHOO.util.Event,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Dom = YAHOO.util.Dom,
+        KeyListener = YAHOO.util.KeyListener,
+        Connect = YAHOO.util.Connect,
+        Dialog = YAHOO.widget.Dialog,
+        Lang = YAHOO.lang,
+
+        /**
+        * Constant representing the name of the Dialog's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_SUBMIT": "beforeSubmit",
+            "SUBMIT": "submit",
+            "MANUAL_SUBMIT": "manualSubmit",
+            "ASYNC_SUBMIT": "asyncSubmit",
+            "FORM_SUBMIT": "formSubmit",
+            "CANCEL": "cancel"
+        
+        },
+        
+        /**
+        * Constant representing the Dialog's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "POST_METHOD": { 
+                key: "postmethod", 
+                value: "async" 
+            },
+            
+            "BUTTONS": { 
+                key: "buttons", 
+                value: "none" 
+            }
+        
+        };    
+
+
+    /**
+    * Constant representing the default CSS class used for a Dialog
+    * @property YAHOO.widget.Dialog.CSS_DIALOG
+    * @static
+    * @final
+    * @type String
+    */
+    Dialog.CSS_DIALOG = "yui-dialog";
+
+
+    function removeButtonEventHandlers() {
+
+        var aButtons = this._aButtons,
+            nButtons,
+            oButton,
+            i;
+
+        if (Lang.isArray(aButtons)) {
+
+            nButtons = aButtons.length;
+
+            if (nButtons > 0) {
+
+                i = nButtons - 1;
+
+                do {
+
+                    oButton = aButtons[i];
+                    
+                    if (oButton instanceof YAHOO.widget.Button) {
+                        
+                        oButton.destroy();
+                        
+                    }
+                    else if (oButton.tagName.toUpperCase() == "BUTTON") {
+
+                        Event.purgeElement(oButton);
+                        Event.purgeElement(oButton, false);
+
+                    }
+
+                }
+                while (i--);
+            
+            }
+        
+        }
+
+    }
+    
+    
+    YAHOO.extend(Dialog, YAHOO.widget.Panel, { 
+
+        
+        /**
+        * @property form
+        * @description Object reference to the Dialog's 
+        * <code>&#60;form&#62;</code> element.
+        * @default null 
+        * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-40002357">HTMLFormElement</a>
+        */
+        form: null,
+    
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the Dialog's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+            Dialog.superclass.initDefaultConfig.call(this);
+        
+            /**
+            * The internally maintained callback object for use with the 
+            * Connection utility
+            * @property callback
+            * @type Object
+            */
+            this.callback = {
+    
+                /**
+                * The function to execute upon success of the 
+                * Connection submission
+                * @property callback.success
+                * @type Function
+                */
+                success: null,
+    
+                /**
+                * The function to execute upon failure of the 
+                * Connection submission
+                * @property callback.failure
+                * @type Function
+                */
+                failure: null,
+    
+                /**
+                * The arbitraty argument or arguments to pass to the Connection 
+                * callback functions
+                * @property callback.argument
+                * @type Object
+                */
+                argument: null
+    
+            };
+        
+
+            // Add form dialog config properties //
+            
+            /**
+            * The method to use for posting the Dialog's form. Possible values 
+            * are "async", "form", and "manual".
+            * @config postmethod
+            * @type String
+            * @default async
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.POST_METHOD.key, {
+                handler: this.configPostMethod, 
+                value: DEFAULT_CONFIG.POST_METHOD.value, 
+                validator: function (val) {
+                    if (val != "form" && val != "async" && val != "none" && 
+                        val != "manual") {
+                        return false;
+                    } else {
+                        return true;
+                    }
+                }
+            });
+            
+            /**
+            * Array of object literals, each containing a set of properties 
+            * defining a button to be appended into the Dialog's footer.
+            * Each button object in the buttons array can have three properties:
+            * <dt>text:</dt>
+            * <dd>The text that will display on the face of the button.  <em>
+            * Please note:</em> As of version 2.3, the text can include 
+            * HTML.</dd>
+            * <dt>handler:</dt>
+            * <dd>Can be either:
+            *     <ol>
+            *         <li>A reference to a function that should fire when the 
+            * button is clicked.  (In this case scope of this function is 
+            * always its Dialog instance.)</li>
+            *         <li>An object literal representing the code to be 
+            * executed when the button is clicked.  Format:<br> <code> {<br>  
+            * <strong>fn:</strong> Function,   &#47;&#47; The handler to call 
+            * when  the event fires.<br> <strong>obj:</strong> Object, 
+            * &#47;&#47; An  object to pass back to the handler.<br> <strong>
+            * scope:</strong>  Object &#47;&#47; The object to use for the 
+            * scope of the handler. <br> } </code> <br><em>Please note: this 
+            * functionality was added in version 2.3.</em></li>
+            *     </ol>
+            * </dd>
+            * <dt>isDefault:</dt>
+            * <dd>An optional boolean value that specifies that a button 
+            * should be highlighted and focused by default.</dd>
+            * @config buttons
+            * @type {Array|String}
+            * @default "none"
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.BUTTONS.key, {
+                handler: this.configButtons,
+                value: DEFAULT_CONFIG.BUTTONS.value
+            }); 
+            
+        },
+        
+        /**
+        * Initializes the custom events for Dialog which are fired 
+        * automatically at appropriate times by the Dialog class.
+        * @method initEvents
+        */
+        initEvents: function () {
+            Dialog.superclass.initEvents.call(this);
+        
+            var SIGNATURE = CustomEvent.LIST;
+        
+            /**
+            * CustomEvent fired prior to submission
+            * @event beforeSubmitEvent
+            */ 
+            this.beforeSubmitEvent = 
+                this.createEvent(EVENT_TYPES.BEFORE_SUBMIT);
+            this.beforeSubmitEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired after submission
+            * @event submitEvent
+            */
+            this.submitEvent = this.createEvent(EVENT_TYPES.SUBMIT);
+            this.submitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired prior to manual submission
+            * @event manualSubmitEvent
+            */
+            this.manualSubmitEvent = 
+                this.createEvent(EVENT_TYPES.MANUAL_SUBMIT);
+            this.manualSubmitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired prior to asynchronous submission
+            * @event asyncSubmitEvent
+            */ 
+            this.asyncSubmitEvent = this.createEvent(EVENT_TYPES.ASYNC_SUBMIT);
+            this.asyncSubmitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired prior to form-based submission
+            * @event formSubmitEvent
+            */
+            this.formSubmitEvent = this.createEvent(EVENT_TYPES.FORM_SUBMIT);
+            this.formSubmitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after cancel
+            * @event cancelEvent
+            */
+            this.cancelEvent = this.createEvent(EVENT_TYPES.CANCEL);
+            this.cancelEvent.signature = SIGNATURE;
+        
+        },
+        
+        /**
+        * 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.
+        * @method init
+        * @param {String} el The element ID representing the Dialog <em>OR</em>
+        * @param {HTMLElement} el The element representing the Dialog
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Dialog. 
+        * See configuration documentation for more details.
+        */
+        init: function (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
+            */
+
+            Dialog.superclass.init.call(this, el/*, userConfig*/); 
+        
+            this.beforeInitEvent.fire(Dialog);
+        
+            Dom.addClass(this.element, Dialog.CSS_DIALOG);
+        
+            this.cfg.setProperty("visible", false);
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+        
+            this.showEvent.subscribe(this.focusFirst, this, true);
+            this.beforeHideEvent.subscribe(this.blurButtons, this, true);
+
+            this.subscribe("changeBody", this.registerForm);
+        
+            this.initEvent.fire(Dialog);
+        },
+        
+        /**
+        * Submits the Dialog's form depending on the value of the 
+        * "postmethod" configuration property.  <strong>Please note:
+        * </strong> As of version 2.3 this method will automatically handle 
+        * asyncronous file uploads should the Dialog instance's form contain 
+        * <code>&#60;input type="file"&#62;</code> elements.  If a Dialog 
+        * instance will be handling asyncronous file uploads, its 
+        * <code>callback</code> property will need to be setup with a 
+        * <code>upload</code> handler rather than the standard 
+        * <code>success</code> and, or <code>failure</code> handlers.  For more 
+        * information, see the <a href="http://developer.yahoo.com/yui/
+        * connection/#file">Connection Manager documenation on file uploads</a>.
+        * @method doSubmit
+        */
+        doSubmit: function () {
+    
+            var oForm = this.form,
+                bUseFileUpload = false,
+                bUseSecureFileUpload = false,
+                aElements,
+                nElements,
+                i,
+                sMethod;
+
+
+            switch (this.cfg.getProperty("postmethod")) {
+    
+            case "async":
+
+                aElements = oForm.elements;
+                nElements = aElements.length;
+
+                if (nElements > 0) {
+                
+                    i = nElements - 1;
+                
+                    do {
+                    
+                        if (aElements[i].type == "file") {
+                        
+                            bUseFileUpload = true;
+                            break;
+                        
+                        }
+                    
+                    }
+                    while(i--);
+                
+                }
+
+                if (bUseFileUpload && YAHOO.env.ua.ie && this.isSecure) {
+
+                    bUseSecureFileUpload = true;
+                
+                }
+
+                sMethod = 
+                    (oForm.getAttribute("method") || "POST").toUpperCase();
+
+                Connect.setForm(oForm, bUseFileUpload, bUseSecureFileUpload);
+
+                Connect.asyncRequest(sMethod, oForm.getAttribute("action"), 
+                    this.callback);
+
+                this.asyncSubmitEvent.fire();
+
+                break;
+
+            case "form":
+
+                oForm.submit();
+                this.formSubmitEvent.fire();
+
+                break;
+
+            case "none":
+            case "manual":
+
+                this.manualSubmitEvent.fire();
+
+                break;
+    
+            }
+    
+        },
+        
+        
+        /**
+        * Prepares the Dialog's internal FORM object, creating one if one is
+        * not currently present.
+        * @method registerForm
+        */
+        registerForm: function () {
+    
+            var form = this.element.getElementsByTagName("form")[0],
+                me = this,
+                firstElement,
+                lastElement;
+
+
+            if (this.form) {
+
+                if (this.form == form && 
+                    Dom.isAncestor(this.element, this.form)) {
+    
+                    return;
+    
+                }
+                else {
+
+                    Event.purgeElement(this.form);
+                    
+                    this.form = null;                
+                
+                }
+            
+            }
+        
+
+            if (!form) {
+
+                form = document.createElement("form");
+                form.name = "frm_" + this.id;
+
+                this.body.appendChild(form);
+
+            }
+
+
+            if (form) {
+
+                this.form = form;
+
+                Event.on(form, "submit", function (e) {
+
+                    Event.stopEvent(e);
+
+                    this.submit();
+                    this.form.blur();
+        
+                });
+
+
+                this.firstFormElement = function () {
+        
+                    var f, el, nElements = form.elements.length;
+        
+                    for (f = 0; f < nElements; f++) {
+    
+                        el = form.elements[f];
+    
+                        if (el.focus && !el.disabled && el.type != "hidden") {
+    
+                            return el;
+    
+                        }
+    
+                    }
+    
+                    return null;
+                    
+                }();
+            
+                this.lastFormElement = function () {
+        
+                    var f, el, nElements = form.elements.length;
+        
+                    for (f = nElements - 1; f >= 0; f--) {
+    
+                        el = form.elements[f];
+    
+                        if (el.focus && !el.disabled && el.type != "hidden") {
+    
+                            return el;
+    
+                        }
+    
+                    }
+    
+                    return null;
+    
+                }();
+            
+                if (this.cfg.getProperty("modal")) {
+            
+                    firstElement = this.firstFormElement || this.firstButton;
+        
+                    if (firstElement) {
+    
+                        this.preventBackTab = new KeyListener(firstElement, 
+                            { shift: true, keys: 9 }, 
+                            { fn: me.focusLast, scope: me, 
+                            correctScope: true });
+    
+                        this.showEvent.subscribe(this.preventBackTab.enable, 
+                            this.preventBackTab, true);
+    
+                        this.hideEvent.subscribe(this.preventBackTab.disable, 
+                            this.preventBackTab, true);
+                    }
+            
+                    lastElement = this.lastButton || this.lastFormElement;
+    
+                    if (lastElement) {
+    
+                        this.preventTabOut = new KeyListener(lastElement, 
+                            { shift: false, keys: 9 }, 
+                            { fn: me.focusFirst, scope: me, 
+                            correctScope: true });
+    
+                        this.showEvent.subscribe(this.preventTabOut.enable, 
+                            this.preventTabOut, true);
+    
+                        this.hideEvent.subscribe(this.preventTabOut.disable, 
+                            this.preventTabOut, true);
+    
+                    }
+                }
+            
+            }
+
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * 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 Dialog.
+        * @method configClose
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For 
+        * configuration handlers, args[0] will equal the newly applied value 
+        * for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configClose: function (type, args, obj) {
+            var val = args[0];
+        
+            function doCancel(e, obj) {
+                obj.cancel();
+            }
+        
+            if (val) {
+                if (! this.close) {
+                    this.close = document.createElement("div");
+                    Dom.addClass(this.close, "container-close");
+        
+                    this.close.innerHTML = "&#160;";
+                    this.innerElement.appendChild(this.close);
+                    Event.on(this.close, "click", doCancel, this);
+                } else {
+                    this.close.style.display = "block";
+                }
+            } else {
+                if (this.close) {
+                    this.close.style.display = "none";
+                }
+            }
+        },
+        
+        /**
+        * The default event handler for the "buttons" configuration property
+        * @method configButtons
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configButtons: function (type, args, obj) {
+    
+            var Button = YAHOO.widget.Button,
+                aButtons = args[0],
+                oInnerElement = this.innerElement,
+                oButton,
+                oButtonEl,
+                oYUIButton,
+                nButtons,
+                oSpan,
+                oFooter,
+                i;
+
+            removeButtonEventHandlers.call(this);
+            
+            this._aButtons = null;
+
+            if (Lang.isArray(aButtons)) {
+
+                oSpan = document.createElement("span");
+                oSpan.className = "button-group";
+
+                nButtons = aButtons.length;
+
+                this._aButtons = [];
+        
+                for (i = 0; i < nButtons; i++) {
+
+                    oButton = aButtons[i];
+
+                    if (Button) {
+
+                        oYUIButton = new Button({ label: oButton.text, 
+                                            container: oSpan });
+
+                        oButtonEl = oYUIButton.get("element");
+
+                        if (oButton.isDefault) {
+
+                            oYUIButton.addClass("default");
+
+                            this.defaultHtmlButton = oButtonEl;
+
+                        }
+    
+                        if (Lang.isFunction(oButton.handler)) {
+    
+                            oYUIButton.set("onclick", { fn: oButton.handler, 
+                                obj: this, scope: this });
+            
+                        }
+                        else if (Lang.isObject(oButton.handler) && 
+                            Lang.isFunction(oButton.handler.fn)) {
+
+                            oYUIButton.set("onclick", { fn: oButton.handler.fn, 
+                                obj: ((!Lang.isUndefined(oButton.handler.obj)) ? 
+                                oButton.handler.obj : this), 
+                                scope: (oButton.handler.scope || this) });
+    
+                        }
+
+                        this._aButtons[this._aButtons.length] = oYUIButton;
+
+                    }
+                    else {
+        
+                        oButtonEl = document.createElement("button");
+                        oButtonEl.setAttribute("type", "button");
+            
+                        if (oButton.isDefault) {
+                            oButtonEl.className = "default";
+                            this.defaultHtmlButton = oButtonEl;
+                        }
+    
+                        oButtonEl.innerHTML = oButton.text;
+    
+                        if (Lang.isFunction(oButton.handler)) {
+    
+                            Event.on(oButtonEl, "click", oButton.handler, 
+                                this, true);
+            
+                        }
+                        else if (Lang.isObject(oButton.handler) && 
+                            Lang.isFunction(oButton.handler.fn)) {
+    
+                            Event.on(oButtonEl, "click", oButton.handler.fn, 
+                                ((!Lang.isUndefined(oButton.handler.obj)) ? 
+                                oButton.handler.obj : this), 
+                                (oButton.handler.scope || this));
+    
+                        }
+            
+                        oSpan.appendChild(oButtonEl);
+                        
+                        this._aButtons[this._aButtons.length] = oButtonEl;
+                        
+                    }
+
+                    oButton.htmlButton = oButtonEl;
+        
+                    if (i === 0) {
+                        this.firstButton = oButtonEl;
+                    }
+        
+                    if (i == (nButtons - 1)) {
+                        this.lastButton = oButtonEl;
+                    }
+        
+                }
+        
+                this.setFooter(oSpan);
+
+                oFooter = this.footer;
+                
+                if (Dom.inDocument(this.element) && 
+                    !Dom.isAncestor(oInnerElement, oFooter)) {
+    
+                    oInnerElement.appendChild(oFooter);
+                
+                }
+
+                this.buttonSpan = oSpan;
+
+            } else { // Do cleanup
+
+                oSpan = this.buttonSpan;
+                oFooter = this.footer;
+
+                if (oSpan && oFooter) {
+
+                    oFooter.removeChild(oSpan);
+
+                    this.buttonSpan = null;
+                    this.firstButton = null;
+                    this.lastButton = null;
+                    this.defaultHtmlButton = null;
+
+                }
+
+            }
+
+            this.cfg.refireEvent("iframe");
+            this.cfg.refireEvent("underlay");
+
+        },
+
+
+        /**
+        * @method getButtons
+        * @description Returns an array containing each of the Dialog's 
+        * buttons, by default an array of HTML <code>&#60;BUTTON&#60;</code> 
+        * elements.  If the Dialog's buttons were created using the 
+        * YAHOO.widget.Button class (via the inclusion of the optional Button 
+        * dependancy on the page), an array of YAHOO.widget.Button instances 
+        * is returned.
+        * @return {Array}
+        */
+        getButtons: function () {
+        
+            var aButtons = this._aButtons;
+            
+            if (aButtons) {
+            
+                return aButtons;
+            
+            }
+        
+        },
+
+        
+        /**
+        * Sets focus to the first element in the Dialog's form or the first 
+        * button defined via the "buttons" configuration property. Called 
+        * when the Dialog is made visible.
+        * @method focusFirst
+        */
+        focusFirst: function (type, args, obj) {
+    
+            var oElement = this.firstFormElement,
+                oEvent;
+
+            if (args) {
+
+                oEvent = args[1];
+
+                if (oEvent) {
+
+                    Event.stopEvent(oEvent);
+
+                }
+
+            }
+        
+
+            if (oElement) {
+
+                /*
+                    Place the call to the "focus" method inside a try/catch
+                    block to prevent IE from throwing JavaScript errors if
+                    the element is disabled or hidden.
+                */
+
+                try {
+
+                    oElement.focus();
+
+                }
+                catch(oException) {
+
+                }
+
+            } else {
+
+                this.focusDefaultButton();
+
+            }
+
+        },
+        
+        /**
+        * Sets focus to the last element in the Dialog's form or the last 
+        * button defined via the "buttons" configuration property.
+        * @method focusLast
+        */
+        focusLast: function (type, args, obj) {
+    
+            var aButtons = this.cfg.getProperty("buttons"),
+                oElement = this.lastFormElement,
+                oEvent;
+    
+            if (args) {
+
+                oEvent = args[1];
+
+                if (oEvent) {
+
+                    Event.stopEvent(oEvent);
+
+                }
+
+            }
+            
+            if (aButtons && Lang.isArray(aButtons)) {
+
+                this.focusLastButton();
+
+            } else {
+
+                if (oElement) {
+
+                    /*
+                        Place the call to the "focus" method inside a try/catch
+                        block to prevent IE from throwing JavaScript errors if
+                        the element is disabled or hidden.
+                    */
+    
+                    try {
+    
+                        oElement.focus();
+    
+                    }
+                    catch(oException) {
+    
+                    }
+
+                }
+
+            }
+
+        },
+        
+        /**
+        * Sets the focus to the button that is designated as the default via 
+        * the "buttons" configuration property. By default, this method is 
+        * called when the Dialog is made visible.
+        * @method focusDefaultButton
+        */
+        focusDefaultButton: function () {
+        
+            var oElement = this.defaultHtmlButton;
+        
+            if (oElement) {
+
+                /*
+                    Place the call to the "focus" method inside a try/catch
+                    block to prevent IE from throwing JavaScript errors if
+                    the element is disabled or hidden.
+                */
+
+                try {
+
+                    oElement.focus();
+                
+                }
+                catch(oException) {
+                
+                }
+
+            }
+        },
+        
+        /**
+        * Blurs all the buttons defined via the "buttons" 
+        * configuration property.
+        * @method blurButtons
+        */
+        blurButtons: function () {
+            
+            var aButtons = this.cfg.getProperty("buttons"),
+                nButtons,
+                oButton,
+                oElement,
+                i;
+
+            if (aButtons && Lang.isArray(aButtons)) {
+            
+                nButtons = aButtons.length;
+                
+                if (nButtons > 0) {
+                
+                    i = (nButtons - 1);
+                    
+                    do {
+                    
+                        oButton = aButtons[i];
+                        
+                        if (oButton) {
+
+                            oElement = oButton.htmlButton;
+
+                            if (oElement) {
+
+                                /*
+                                    Place the call to the "blur" method inside  
+                                    a try/catch block to prevent IE from  
+                                    throwing JavaScript errors if the element 
+                                    is disabled or hidden.
+                                */
+    
+                                try {
+            
+                                    oElement.blur();
+                                
+                                }
+                                catch(oException) {
+                                
+                                
+                                }
+                            
+                            }
+
+                        }
+                    
+                    }
+                    while(i--);
+                
+                }
+            
+            }
+
+        },
+        
+        /**
+        * Sets the focus to the first button created via the "buttons"
+        * configuration property.
+        * @method focusFirstButton
+        */
+        focusFirstButton: function () {
+    
+            var aButtons = this.cfg.getProperty("buttons"),
+                oButton,
+                oElement;
+
+            if (aButtons && Lang.isArray(aButtons)) {
+
+                oButton = aButtons[0];
+
+                if (oButton) {
+
+                    oElement = oButton.htmlButton;
+                    
+                    if (oElement) {
+
+                        /*
+                            Place the call to the "focus" method inside a 
+                            try/catch block to prevent IE from throwing 
+                            JavaScript errors if the element is disabled 
+                            or hidden.
+                        */
+    
+                        try {
+    
+                            oElement.focus();
+                        
+                        }
+                        catch(oException) {
+                        
+                        
+                        }
+                    
+                    }
+
+                }
+
+            }
+        },
+        
+        /**
+        * Sets the focus to the last button created via the "buttons" 
+        * configuration property.
+        * @method focusLastButton
+        */
+        focusLastButton: function () {
+    
+            var aButtons = this.cfg.getProperty("buttons"),
+                nButtons,
+                oButton,
+                oElement;
+
+            if (aButtons && Lang.isArray(aButtons)) {
+
+                nButtons = aButtons.length;
+                
+                if (nButtons > 0) {
+
+                    oButton = aButtons[(nButtons - 1)];
+                    
+                    if (oButton) {
+                    
+                        oElement = oButton.htmlButton;
+
+                        if (oElement) {
+
+                            /*
+                                Place the call to the "focus" method inside a 
+                                try/catch block to prevent IE from throwing 
+                                JavaScript errors if the element is disabled
+                                or hidden.
+                            */
+        
+                            try {
+        
+                                oElement.focus();
+                            
+                            }
+                            catch(oException) {
+                            
+                            
+                            }
+                        
+                        }
+                    
+                    }
+                
+                }
+            
+            }
+
+        },
+        
+        /**
+        * The default event handler for the "postmethod" configuration property
+        * @method configPostMethod
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For 
+        * configuration handlers, args[0] will equal the newly applied value 
+        * for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configPostMethod: function (type, args, obj) {
+    
+            var postmethod = args[0];
+        
+            this.registerForm();
+    
+        },
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * 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.
+        * @method validate
+        */
+        validate: function () {
+            return true;
+        },
+        
+        /**
+        * Executes a submit of the Dialog followed by a hide, if validation 
+        * is successful.
+        * @method submit
+        */
+        submit: function () {
+            if (this.validate()) {
+                this.beforeSubmitEvent.fire();
+                this.doSubmit();
+                this.submitEvent.fire();
+                this.hide();
+                return true;
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Executes the cancel of the Dialog followed by a hide.
+        * @method cancel
+        */
+        cancel: function () {
+            this.cancelEvent.fire();
+            this.hide();
+        },
+        
+        /**
+        * Returns a JSON-compatible data structure representing the data 
+        * currently contained in the form.
+        * @method getData
+        * @return {Object} A JSON object reprsenting the data of the 
+        * current form.
+        */
+        getData: function () {
+        
+            var oForm = this.form,
+                aElements,
+                nTotalElements,
+                oData,
+                sName,
+                oElement,
+                nElements,
+                sType,
+                sTagName,
+                aOptions,
+                nOptions,
+                aValues,
+                oOption,
+                sValue,
+                oRadio,
+                oCheckbox,
+                i,
+                n;    
+    
+            function isFormElement(p_oElement) {
+            
+                var sTag = p_oElement.tagName.toUpperCase();
+                
+                return ((sTag == "INPUT" || sTag == "TEXTAREA" || 
+                        sTag == "SELECT") && p_oElement.name == sName);
+    
+            }
+    
+    
+            if (oForm) {
+        
+                aElements = oForm.elements;
+                nTotalElements = aElements.length;
+                oData = {};
+    
+        
+                for (i = 0; i < nTotalElements; i++) {
+        
+                    sName = aElements[i].name;
+        
+                    /*
+                        Using "Dom.getElementsBy" to safeguard user from JS 
+                        errors that result from giving a form field (or set of 
+                        fields) the same name as a native method of a form 
+                        (like "submit") or a DOM collection (such as the "item"
+                        method). Originally tried accessing fields via the 
+                        "namedItem" method of the "element" collection, but 
+                        discovered that it won't return a collection of fields 
+                        in Gecko.
+                    */
+        
+                    oElement = Dom.getElementsBy(isFormElement, "*", oForm);
+                    nElements = oElement.length;
+        
+                    if (nElements > 0) {
+        
+                        if (nElements == 1) {
+        
+                            oElement = oElement[0];
+        
+                            sType = oElement.type;
+                            sTagName = oElement.tagName.toUpperCase();
+        
+                            switch (sTagName) {
+        
+                            case "INPUT":
+    
+                                if (sType == "checkbox") {
+    
+                                    oData[sName] = oElement.checked;
+    
+                                }
+                                else if (sType != "radio") {
+    
+                                    oData[sName] = oElement.value;
+    
+                                }
+    
+                                break;
+    
+                            case "TEXTAREA":
+    
+                                oData[sName] = oElement.value;
+    
+                                break;
+    
+                            case "SELECT":
+    
+                                aOptions = oElement.options;
+                                nOptions = aOptions.length;
+                                aValues = [];
+    
+                                for (n = 0; n < nOptions; n++) {
+    
+                                    oOption = aOptions[n];
+    
+                                    if (oOption.selected) {
+    
+                                        sValue = oOption.value;
+    
+                                        if (!sValue || sValue === "") {
+    
+                                            sValue = oOption.text;
+    
+                                        }
+    
+                                        aValues[aValues.length] = sValue;
+    
+                                    }
+    
+                                }
+    
+                                oData[sName] = aValues;
+    
+                                break;
+        
+                            }
+        
+        
+                        }
+                        else {
+        
+                            sType = oElement[0].type;
+        
+                            switch (sType) {
+        
+                            case "radio":
+    
+                                for (n = 0; n < nElements; n++) {
+    
+                                    oRadio = oElement[n];
+    
+                                    if (oRadio.checked) {
+    
+                                        oData[sName] = oRadio.value;
+                                        break;
+    
+                                    }
+    
+                                }
+    
+                                break;
+    
+                            case "checkbox":
+    
+                                aValues = [];
+    
+                                for (n = 0; n < nElements; n++) {
+    
+                                    oCheckbox = oElement[n];
+    
+                                    if (oCheckbox.checked) {
+    
+                                        aValues[aValues.length] = 
+                                            oCheckbox.value;
+    
+                                    }
+    
+                                }
+    
+                                oData[sName] = aValues;
+    
+                                break;
+        
+                            }
+        
+                        }
+        
+                    }
+        
+                }
+        
+            }
+        
+        
+            return oData;
+        
+        },
+        
+        /**
+        * Removes the Panel element from the DOM and sets all child elements 
+        * to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            removeButtonEventHandlers.call(this);
+            
+            this._aButtons = null;
+
+            var aForms = this.element.getElementsByTagName("form"),
+                oForm;
+            
+            if (aForms.length > 0) {
+
+                oForm = aForms[0];
+
+                if (oForm) {
+                   
+                    Event.purgeElement(oForm);
+            
+                    this.body.removeChild(oForm);
+                    
+                    this.form = null;
+            
+                }
+            
+            }
+        
+            Dialog.superclass.destroy.call(this);  
+        
+        },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Dialog
+        */
+        toString: function () {
+            return "Dialog " + this.id;
+        }
+    
+    });
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class SimpleDialog
+    * @extends YAHOO.widget.Dialog
+    * @constructor
+    * @param {String} el The element ID representing the SimpleDialog 
+    * <em>OR</em>
+    * @param {HTMLElement} el The element representing the SimpleDialog
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this SimpleDialog. See 
+    * configuration documentation for more details.
+    */
+    YAHOO.widget.SimpleDialog = function (el, userConfig) {
+    
+        YAHOO.widget.SimpleDialog.superclass.constructor.call(this, 
+            el, userConfig);
+    
+    };
+
+    var Dom = YAHOO.util.Dom,
+        SimpleDialog = YAHOO.widget.SimpleDialog,
+    
+        /**
+        * Constant representing the SimpleDialog's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "ICON": { 
+                key: "icon", 
+                value: "none", 
+                suppressEvent: true  
+            },
+        
+            "TEXT": { 
+                key: "text", 
+                value: "", 
+                suppressEvent: true, 
+                supercedes: ["icon"] 
+            }
+        
+        };
+
+    /**
+    * Constant for the standard network icon for a blocking action
+    * @property YAHOO.widget.SimpleDialog.ICON_BLOCK
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_BLOCK = "blckicon";
+    
+    /**
+    * Constant for the standard network icon for alarm
+    * @property YAHOO.widget.SimpleDialog.ICON_ALARM
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_ALARM = "alrticon";
+    
+    /**
+    * Constant for the standard network icon for help
+    * @property YAHOO.widget.SimpleDialog.ICON_HELP
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_HELP  = "hlpicon";
+    
+    /**
+    * Constant for the standard network icon for info
+    * @property YAHOO.widget.SimpleDialog.ICON_INFO
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_INFO  = "infoicon";
+    
+    /**
+    * Constant for the standard network icon for warn
+    * @property YAHOO.widget.SimpleDialog.ICON_WARN
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_WARN  = "warnicon";
+    
+    /**
+    * Constant for the standard network icon for a tip
+    * @property YAHOO.widget.SimpleDialog.ICON_TIP
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_TIP   = "tipicon";
+
+    /**
+    * Constant representing the name of the CSS class applied to the element 
+    * created by the "icon" configuration property.
+    * @property YAHOO.widget.SimpleDialog.ICON_CSS_CLASSNAME
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_CSS_CLASSNAME = "yui-icon";
+    
+    /**
+    * Constant representing the default CSS class used for a SimpleDialog
+    * @property YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.CSS_SIMPLEDIALOG = "yui-simple-dialog";
 
-       YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Dialog.CSS_DIALOG);
+    
+    YAHOO.extend(SimpleDialog, YAHOO.widget.Dialog, {
+    
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the SimpleDialog's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+        
+            SimpleDialog.superclass.initDefaultConfig.call(this);
+        
+            // Add dialog config properties //
+        
+            /**
+            * Sets the informational icon for the SimpleDialog
+            * @config icon
+            * @type String
+            * @default "none"
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.ICON.key, {
+                handler: this.configIcon,
+                value: DEFAULT_CONFIG.ICON.value,
+                suppressEvent: DEFAULT_CONFIG.ICON.suppressEvent
+            });
+        
+            /**
+            * Sets the text for the SimpleDialog
+            * @config text
+            * @type String
+            * @default ""
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key, { 
+                handler: this.configText, 
+                value: DEFAULT_CONFIG.TEXT.value, 
+                suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.TEXT.supercedes 
+            });
+        
+        },
+        
+        
+        /**
+        * 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.
+        * @method init
+        * @param {String} el The element ID representing the SimpleDialog 
+        * <em>OR</em>
+        * @param {HTMLElement} el The element representing the SimpleDialog
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this 
+        * SimpleDialog. See configuration documentation for more details.
+        */
+        init: function (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
+            */
+
+            SimpleDialog.superclass.init.call(this, el/*, userConfig*/);
+        
+            this.beforeInitEvent.fire(SimpleDialog);
+        
+            Dom.addClass(this.element, SimpleDialog.CSS_SIMPLEDIALOG);
+        
+            this.cfg.queueProperty("postmethod", "manual");
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+        
+            this.beforeRenderEvent.subscribe(function () {
+                if (! this.body) {
+                    this.setBody("");
+                }
+            }, this, true);
+        
+            this.initEvent.fire(SimpleDialog);
+        
+        },
+        
+        /**
+        * Prepares the SimpleDialog's internal FORM object, creating one if one 
+        * is not currently present, and adding the value hidden field.
+        * @method registerForm
+        */
+        registerForm: function () {
 
-       this.cfg.setProperty("visible", false);
+            SimpleDialog.superclass.registerForm.call(this);
 
-       if (userConfig) {
-               this.cfg.applyConfig(userConfig, true);
-       }
+            this.form.innerHTML += "<input type=\"hidden\" name=\"" + 
+                this.id + "\" value=\"\"/>";
 
-       this.showEvent.subscribe(this.focusFirst, this, true);
-       this.beforeHideEvent.subscribe(this.blurButtons, this, true);
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * Fired when the "icon" property is set.
+        * @method configIcon
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configIcon: function (type,args,obj) {
+        
+            var sIcon = args[0],
+                oBody = this.body,
+                sCSSClass = SimpleDialog.ICON_CSS_CLASSNAME,
+                oIcon,
+                oIconParent;
+        
+            if (sIcon && sIcon != "none") {
 
-       this.beforeRenderEvent.subscribe(function() {
-               var buttonCfg = this.cfg.getProperty("buttons");
-               if (buttonCfg && buttonCfg != "none") {
-                       if (! this.footer) {
-                               this.setFooter("");
-                       }
-               }
-       }, this, true);
+                oIcon = Dom.getElementsByClassName(sCSSClass, "*" , oBody);
 
-       this.initEvent.fire(YAHOO.widget.Dialog);
-};
+                if (oIcon) {
 
-/**
-* Performs the submission of the Dialog form depending on the value of "postmethod" property.
-* @method doSubmit
-*/
-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;
-       }
-};
-
-/**
-* Prepares the Dialog's internal FORM object, creating one if one is not currently present.
-* @method registerForm
-*/
-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];
-       }
-
-       this.firstFormElement = function() {
-               for (var f=0;f<form.elements.length;f++ ) {
-                       var el = form.elements[f];
-                       if (el.focus && ! el.disabled) {
-                               if (el.type && el.type != "hidden") {
-                                       return el;
-                               }
-                       }
-               }
-               return null;
-       }();
-
-       this.lastFormElement = function() {
-               for (var f=form.elements.length-1;f>=0;f-- ) {
-                       var el = form.elements[f];
-                       if (el.focus && ! el.disabled) {
-                               if (el.type && el.type != "hidden") {
-                                       return el;
-                               }
-                       }
-               }
-               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);
-               }
-
-               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);
-               }
-       }
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* 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 Dialog.
-* @method configClose
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Dialog.prototype.configClose = function(type, args, obj) {
-       var val = args[0];
-
-       var doCancel = function(e, obj) {
-               obj.cancel();
-       };
-
-       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");
-                       }
-
-                       this.close.innerHTML = "&#160;";
-                       this.innerElement.appendChild(this.close);
-                       YAHOO.util.Event.addListener(this.close, "click", doCancel, this);      
-               } else {
-                       this.close.style.display = "block";
-               }
-       } else {
-               if (this.close) {
-                       this.close.style.display = "none";
-               }
-       }
-};
-
-/**
-* The default event handler for the "buttons" configuration property
-* @method configButtons
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-                       }
-
-                       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;
-                       }
-
-                       if (b == (buttons.length-1)) {
-                               this.lastButton = button.htmlButton;
-                       }
-
-               }
-
-               this.setFooter(this.buttonSpan);
-
-               this.cfg.refireEvent("iframe");
-               this.cfg.refireEvent("underlay");
-       } else { // Do cleanup
-               if (this.buttonSpan) {
-                       if (this.buttonSpan.parentNode) {
-                               this.buttonSpan.parentNode.removeChild(this.buttonSpan);
-                       }
-
-                       this.buttonSpan = null;
-                       this.firstButton = null;
-                       this.lastButton = null;
-                       this.defaultHtmlButton = null;
-               }
-       }
-};
-
-
-/**
-* The default event handler used to focus the first field of the form when the Dialog is shown.
-* @method focusFirst
-*/
-YAHOO.widget.Dialog.prototype.focusFirst = function(type,args,obj) {
-       if (args) {
-               var e = args[1];
-               if (e) {
-                       YAHOO.util.Event.stopEvent(e);
-               }
-       }
-
-       if (this.firstFormElement) {
-               this.firstFormElement.focus();
-       } else {
-               this.focusDefaultButton();
-       }
-};
-
-/**
-* Sets the focus to the last button in the button or form element in the Dialog
-* @method focusLast
-*/
-YAHOO.widget.Dialog.prototype.focusLast = function(type,args,obj) {
-       if (args) {
-               var e = args[1];
-               if (e) {
-                       YAHOO.util.Event.stopEvent(e);
-               }
-       }
-
-       var buttons = this.cfg.getProperty("buttons");
-       if (buttons && buttons instanceof Array) {
-               this.focusLastButton();
-       } else {
-               if (this.lastFormElement) {
-                       this.lastFormElement.focus();
-               }
-       }
-};
-
-/**
-* Sets the focus to the button that is designated as the default. By default, his handler is executed when the show event is fired.
-* @method focusDefaultButton
-*/
-YAHOO.widget.Dialog.prototype.focusDefaultButton = function() {
-       if (this.defaultHtmlButton) {
-               this.defaultHtmlButton.focus();
-       }
-};
-
-/**
-* Blurs all the html buttons
-* @method blurButtons
-*/
-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();
-               }
-       }
-};
-
-/**
-* Sets the focus to the first button in the button list
-* @method focusFirstButton
-*/
-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();
-               }
-       }
-};
-
-/**
-* Sets the focus to the first button in the button list
-* @method focusLastButton
-*/
-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();
-               }
-       }
-};
-
-/**
-* The default event handler for the "postmethod" configuration property
-* @method configPostMethod
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Dialog.prototype.configPostMethod = function(type, args, obj) {
-       var postmethod = args[0];
-
-       this.registerForm();
-       YAHOO.util.Event.addListener(this.form, "submit", function(e) {
-                                                                                                               YAHOO.util.Event.stopEvent(e);
-                                                                                                               this.submit();
-                                                                                                               this.form.blur();
-                                                                                                         }, this, true); 
-};
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* 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.
-* @method validate
-*/
-YAHOO.widget.Dialog.prototype.validate = function() {
-       return true;
-};
+                    oIconParent = oIcon.parentNode;
+                    
+                    if (oIconParent) {
+                    
+                        oIconParent.removeChild(oIcon);
+                        
+                        oIcon = null;
+                    
+                    }
 
-/**
-* Executes a submit of the Dialog followed by a hide, if validation is successful.
-* @method submit
-*/
-YAHOO.widget.Dialog.prototype.submit = function() {
-       if (this.validate()) {
-               this.beforeSubmitEvent.fire();
-               this.doSubmit();
-               this.submitEvent.fire();
-               this.hide();
-               return true;
-       } else {
-               return false;
-       }
-};
-
-/**
-* Executes the cancel of the Dialog followed by a hide.
-* @method cancel
-*/
-YAHOO.widget.Dialog.prototype.cancel = function() {
-       this.cancelEvent.fire();
-       this.hide();    
-};
-
-/**
-* Returns a JSON-compatible data structure representing the data currently contained in the form.
-* @method getData
-* @return {Object} A JSON object reprsenting the data of the current form.
-*/
-YAHOO.widget.Dialog.prototype.getData = function() {
-       var form = this.form;
-       var data = {};
-
-       if (form) {
-               for (var i=0;i<form.elements.length;i++) {
-                       var formItem = form.elements[i];
-                       if (formItem) {
-                               if (formItem.tagName) { // Got a single form item
-                                       switch (formItem.tagName) {
-                                               case "INPUT":
-                                                       switch (formItem.type) {
-                                                               case "checkbox": 
-                                                                       data[formItem.name] = formItem.checked;
-                                                                       break;
-                                                               case "textbox":
-                                                               case "text":
-                                                               case "hidden":
-                                                                       data[formItem.name] = formItem.value;
-                                                                       break;
-                                                       }
-                                                       break;
-                                               case "TEXTAREA":
-                                                       data[formItem.name] = 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;
-                                                                       }
-                                                                       val[val.length] = selval;
-                                                               }
-                                                       }
-                                                       data[formItem.name] = val;
-                                                       break;
-                                       }
-                               } else if (formItem[0] && formItem[0].tagName) { // this is an array of form items
-                                       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;
-                                                                       }
-                                                               }
-                                                               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;
-                                                                       }
-                                                               }
-                                                               data[formItem[0].name] = cbArray;
-                                                               break;
-                                               }
-                                       }
-                               }
-                       }
-               }       
-       }
-       return data;
-};
-
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     The string representation of the Dialog
-*/ 
-YAHOO.widget.Dialog.prototype.toString = function() {
-       return "Dialog " + this.id;
-};
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class SimpleDialog
-* @extends YAHOO.widget.Dialog
-* @constructor
-* @param {String}      el      The element ID representing the SimpleDialog <em>OR</em>
-* @param {HTMLElement} el      The element representing the SimpleDialog
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.
-*/
-YAHOO.widget.SimpleDialog = function(el, userConfig) {
-       YAHOO.widget.SimpleDialog.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.SimpleDialog, YAHOO.widget.Dialog);
-
-/**
-* Constant for the standard network icon for a blocking action
-* @property YAHOO.widget.SimpleDialog.ICON_BLOCK
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_BLOCK = "nt/ic/ut/bsc/blck16_1.gif";
-
-/**
-* Constant for the standard network icon for alarm
-* @property YAHOO.widget.SimpleDialog.ICON_ALARM
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_ALARM = "nt/ic/ut/bsc/alrt16_1.gif";
-
-/**
-* Constant for the standard network icon for help
-* @property YAHOO.widget.SimpleDialog.ICON_HELP
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_HELP  = "nt/ic/ut/bsc/hlp16_1.gif";
-
-/**
-* Constant for the standard network icon for info
-* @property YAHOO.widget.SimpleDialog.ICON_INFO
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_INFO  = "nt/ic/ut/bsc/info16_1.gif";
-
-/**
-* Constant for the standard network icon for warn
-* @property YAHOO.widget.SimpleDialog.ICON_WARN
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_WARN  = "nt/ic/ut/bsc/warn16_1.gif";
-
-/**
-* Constant for the standard network icon for a tip
-* @property YAHOO.widget.SimpleDialog.ICON_TIP
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_TIP   = "nt/ic/ut/bsc/tip16_1.gif";
-
-/**
-* Constant representing the default CSS class used for a SimpleDialog
-* @property YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG = "simple-dialog";
+                }
 
-/**
-* Initializes the class's configurable properties which can be changed using the SimpleDialog's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.SimpleDialog.prototype.initDefaultConfig = function() {
-       YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);
-
-       // Add dialog config properties //
-
-       /**
-       * Sets the informational icon for the SimpleDialog
-       * @config icon
-       * @type String
-       * @default "none"
-       */
-       this.cfg.addProperty("icon",    { value:"none", handler:this.configIcon, suppressEvent:true } );
-       
-       /**
-       * Sets the text for the SimpleDialog
-       * @config text
-       * @type String
-       * @default ""
-       */
-       this.cfg.addProperty("text",    { value:"", handler:this.configText, suppressEvent:true, supercedes:["icon"] } );
-};
-
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the SimpleDialog <em>OR</em>
-* @param {HTMLElement} el      The element representing the SimpleDialog
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.
-*/
-YAHOO.widget.SimpleDialog.prototype.init = function(el, userConfig) {
-       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
 
-       this.beforeInitEvent.fire(YAHOO.widget.SimpleDialog);
+                if (sIcon.indexOf(".") == -1) {
 
-       YAHOO.util.Dom.addClass(this.element, YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG);
+                    oIcon = document.createElement("span");
+                    oIcon.className = (sCSSClass + " " + sIcon);
+                    oIcon.innerHTML = "&#160;";
 
-       this.cfg.queueProperty("postmethod", "manual");
+                } else {
 
-       if (userConfig) {
-               this.cfg.applyConfig(userConfig, true);
-       }
+                    oIcon = document.createElement("img");
+                    oIcon.src = (this.imageRoot + sIcon);
+                    oIcon.className = sCSSClass;
 
-       this.beforeRenderEvent.subscribe(function() {
-               if (! this.body) {
-                       this.setBody("");
-               }
-       }, this, true);
+                }
+                
 
-       this.initEvent.fire(YAHOO.widget.SimpleDialog);
+                if (oIcon) {
+                
+                    oBody.insertBefore(oIcon, oBody.firstChild);
+                
+                }
 
-};
-/**
-* Prepares the SimpleDialog's internal FORM object, creating one if one is not currently present, and adding the value hidden field.
-* @method registerForm
-*/
-YAHOO.widget.SimpleDialog.prototype.registerForm = function() {
-       YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);
-       this.form.innerHTML += "<input type=\"hidden\" name=\"" + this.id + "\" value=\"\"/>";
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Fired when the "icon" property is set.
-* @method configIcon
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-       }
-};
-
-/**
-* Fired when the "text" property is set.
-* @method configText
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.SimpleDialog.prototype.configText = function(type,args,obj) {
-       var text = args[0];
-       if (text) {
-               this.setBody(text);
-               this.cfg.refireEvent("icon");
-       }
-};
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     The string representation of the SimpleDialog
-*/ 
-YAHOO.widget.SimpleDialog.prototype.toString = function() {
-       return "SimpleDialog " + this.id;
-};
-
-/**
-* ContainerEffect encapsulates animation transitions that are executed when an Overlay is shown or hidden.
-* @namespace YAHOO.widget
-* @class ContainerEffect
-* @constructor
-* @param {YAHOO.widget.Overlay}        overlay         The Overlay that the animation should be associated with
-* @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).
-* @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).
-* @param {HTMLElement} targetElement   Optional. The target element that should be animated during the transition. Defaults to overlay.element.
-* @param {class}       Optional. The animation class to instantiate. Defaults to YAHOO.util.Anim. Other options include YAHOO.util.Motion.
-*/
-YAHOO.widget.ContainerEffect = function(overlay, attrIn, attrOut, targetElement, animClass) {
-       if (! animClass) {
-               animClass = YAHOO.util.Anim;
-       }
-
-       /**
-       * The overlay to animate
-       * @property overlay
-       * @type YAHOO.widget.Overlay
-       */
-       this.overlay = overlay;
-       /**
-       * The animation attributes to use when transitioning into view
-       * @property attrIn
-       * @type Object
-       */
-       this.attrIn = attrIn;
-       /**
-       * The animation attributes to use when transitioning out of view
-       * @property attrOut
-       * @type Object
-       */
-       this.attrOut = attrOut;
-       /**
-       * The target element to be animated
-       * @property targetElement
-       * @type HTMLElement
-       */
-       this.targetElement = targetElement || overlay.element;
-       /**
-       * The animation class to use for animating the overlay
-       * @property animClass
-       * @type class
-       */
-       this.animClass = animClass;
-};
-
-/**
-* Initializes the animation classes and events.
-* @method init
-*/
-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);
-};
-
-/**
-* Triggers the in-animation.
-* @method animateIn
-*/
-YAHOO.widget.ContainerEffect.prototype.animateIn = function() {
-       this.beforeAnimateInEvent.fire();
-       this.animIn.animate();
-};
-
-/**
-* Triggers the out-animation.
-* @method animateOut
-*/
-YAHOO.widget.ContainerEffect.prototype.animateOut = function() {
-       this.beforeAnimateOutEvent.fire();
-       this.animOut.animate();
-};
-
-/**
-* The default onStart handler for the in-animation.
-* @method handleStartAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn = function(type, args, obj) { };
-/**
-* The default onTween handler for the in-animation.
-* @method handleTweenAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn = function(type, args, obj) { };
-/**
-* The default onComplete handler for the in-animation.
-* @method handleCompleteAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn = function(type, args, obj) { };
-
-/**
-* The default onStart handler for the out-animation.
-* @method handleStartAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut = function(type, args, obj) { };
-/**
-* The default onTween handler for the out-animation.
-* @method handleTweenAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut = function(type, args, obj) { };
-/**
-* The default onComplete handler for the out-animation.
-* @method handleCompleteAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut = function(type, args, obj) { };
-
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     The string representation of the ContainerEffect
-*/ 
-YAHOO.widget.ContainerEffect.prototype.toString = function() {
-       var output = "ContainerEffect";
-       if (this.overlay) {
-               output += " [" + this.overlay.toString() + "]";
-       }
-       return output;
-};
-
-/**
-* A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.
-* @method FADE
-* @static
-* @param {Overlay}     overlay The Overlay object to animate
-* @param {Number}      dur     The duration of the animation
-* @return {ContainerEffect}    The configured ContainerEffect object
-*/
-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");
-               }
-
-               if (obj.overlay.underlay) {
-                       obj.initialUnderlayOpacity = YAHOO.util.Dom.getStyle(obj.overlay.underlay, "opacity");
-                       obj.overlay.underlay.style.filter = null;
-               }
-
-               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;
-               }                       
-               
-               if (obj.overlay.underlay) {
-                       YAHOO.util.Dom.setStyle(obj.overlay.underlay, "opacity", obj.initialUnderlayOpacity);
-               }
-
-               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;
-               }                               
-               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;
-};
-
-
-/**
-* A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.
-* @method SLIDE
-* @static
-* @param {Overlay}     overlay The Overlay object to animate
-* @param {Number}      dur     The duration of the animation
-* @return {ContainerEffect}    The configured ContainerEffect object
-*/
-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");
-               }
-
-               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
+            }
+
+        },
+        
+        /**
+        * Fired when the "text" property is set.
+        * @method configText
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configText: function (type,args,obj) {
+            var text = args[0];
+            if (text) {
+                this.setBody(text);
+                this.cfg.refireEvent("icon");
+            }
+        },
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the SimpleDialog
+        */
+        toString: function () {
+            return "SimpleDialog " + this.id;
+        }
+    
+    });
+
+}());
+(function () {
+
+    /**
+    * ContainerEffect encapsulates animation transitions that are executed when 
+    * an Overlay is shown or hidden.
+    * @namespace YAHOO.widget
+    * @class ContainerEffect
+    * @constructor
+    * @param {YAHOO.widget.Overlay} overlay The Overlay that the animation 
+    * should be associated with
+    * @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. Easing.easeIn).
+    * @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. Easing.easeIn).
+    * @param {HTMLElement} targetElement Optional. The target element that  
+    * should be animated during the transition. Defaults to overlay.element.
+    * @param {class} Optional. The animation class to instantiate. Defaults to 
+    * YAHOO.util.Anim. Other options include YAHOO.util.Motion.
+    */
+    YAHOO.widget.ContainerEffect = 
+    
+        function (overlay, attrIn, attrOut, targetElement, animClass) {
+    
+        if (!animClass) {
+            animClass = YAHOO.util.Anim;
+        }
+        
+        /**
+        * The overlay to animate
+        * @property overlay
+        * @type YAHOO.widget.Overlay
+        */
+        this.overlay = overlay;
+    
+        /**
+        * The animation attributes to use when transitioning into view
+        * @property attrIn
+        * @type Object
+        */
+        this.attrIn = attrIn;
+    
+        /**
+        * The animation attributes to use when transitioning out of view
+        * @property attrOut
+        * @type Object
+        */
+        this.attrOut = attrOut;
+    
+        /**
+        * The target element to be animated
+        * @property targetElement
+        * @type HTMLElement
+        */
+        this.targetElement = targetElement || overlay.element;
+    
+        /**
+        * The animation class to use for animating the overlay
+        * @property animClass
+        * @type class
+        */
+        this.animClass = animClass;
+    
+    };
+
+
+    var Dom = YAHOO.util.Dom,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Easing = YAHOO.util.Easing,
+        ContainerEffect = YAHOO.widget.ContainerEffect;
+
+
+    /**
+    * A pre-configured ContainerEffect instance that can be used for fading 
+    * an overlay in and out.
+    * @method FADE
+    * @static
+    * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate
+    * @param {Number} dur The duration of the animation
+    * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
+    */
+    ContainerEffect.FADE = function (overlay, dur) {
+    
+        var fade = new ContainerEffect(overlay, 
+        
+            { attributes: { opacity: { from: 0, to: 1 } }, 
+                duration: dur, 
+                method: Easing.easeIn }, 
+            
+            { attributes: { opacity: { to: 0 } },
+                duration: dur, 
+                method: Easing.easeOut }, 
+            
+            overlay.element);
+        
+    
+        fade.handleStartAnimateIn = function (type,args,obj) {
+            Dom.addClass(obj.overlay.element, "hide-select");
+        
+            if (! obj.overlay.underlay) {
+                obj.overlay.cfg.refireEvent("underlay");
+            }
+        
+            if (obj.overlay.underlay) {
+    
+                obj.initialUnderlayOpacity = 
+                    Dom.getStyle(obj.overlay.underlay, "opacity");
+    
+                obj.overlay.underlay.style.filter = null;
+    
+            }
+        
+            Dom.setStyle(obj.overlay.element, "visibility", "visible");
+            Dom.setStyle(obj.overlay.element, "opacity", 0);
+        };
+        
+    
+        fade.handleCompleteAnimateIn = function (type,args,obj) {
+            Dom.removeClass(obj.overlay.element, "hide-select");
+        
+            if (obj.overlay.element.style.filter) {
+                obj.overlay.element.style.filter = null;
+            }
+        
+            if (obj.overlay.underlay) {
+                Dom.setStyle(obj.overlay.underlay, "opacity", 
+                    obj.initialUnderlayOpacity);
+            }
+        
+            obj.overlay.cfg.refireEvent("iframe");
+            obj.animateInCompleteEvent.fire();
+        };
+        
+    
+        fade.handleStartAnimateOut = function (type, args, obj) {
+            Dom.addClass(obj.overlay.element, "hide-select");
+        
+            if (obj.overlay.underlay) {
+                obj.overlay.underlay.style.filter = null;
+            }
+        };
+        
+    
+        fade.handleCompleteAnimateOut =  function (type, args, obj) {
+            Dom.removeClass(obj.overlay.element, "hide-select");
+            if (obj.overlay.element.style.filter) {
+                obj.overlay.element.style.filter = null;
+            }
+            Dom.setStyle(obj.overlay.element, "visibility", "hidden");
+            Dom.setStyle(obj.overlay.element, "opacity", 1);
+        
+            obj.overlay.cfg.refireEvent("iframe");
+        
+            obj.animateOutCompleteEvent.fire();
+        };
+        
+        fade.init();
+        return fade;
+    };
+    
+    
+    /**
+    * A pre-configured ContainerEffect instance that can be used for sliding an 
+    * overlay in and out.
+    * @method SLIDE
+    * @static
+    * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate
+    * @param {Number} dur The duration of the animation
+    * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
+    */
+    ContainerEffect.SLIDE = function (overlay, dur) {
+    
+        var x = overlay.cfg.getProperty("x") || Dom.getX(overlay.element),
+    
+            y = overlay.cfg.getProperty("y") || Dom.getY(overlay.element),
+    
+            clientWidth = Dom.getClientWidth(),
+    
+            offsetWidth = overlay.element.offsetWidth,
+    
+            slide = new ContainerEffect(overlay, 
+            
+            { attributes: { points: { to: [x, y] } },
+                duration: dur,
+                method: Easing.easeIn },
+    
+            { attributes: { points: { to: [(clientWidth + 25), y] } },
+                duration: dur,
+                method: Easing.easeOut },
+    
+            overlay.element, YAHOO.util.Motion);
+        
+        
+        slide.handleStartAnimateIn = function (type,args,obj) {
+            obj.overlay.element.style.left = ((-25) - offsetWidth) + "px";
+            obj.overlay.element.style.top  = y + "px";
+        };
+        
+        slide.handleTweenAnimateIn = function (type, args, obj) {
+        
+            var pos = Dom.getXY(obj.overlay.element),
+                currentX = pos[0],
+                currentY = pos[1];
+        
+            if (Dom.getStyle(obj.overlay.element, "visibility") == 
+                "hidden" && currentX < x) {
+
+                Dom.setStyle(obj.overlay.element, "visibility", "visible");
+
+            }
+        
+            obj.overlay.cfg.setProperty("xy", [currentX, currentY], true);
+            obj.overlay.cfg.refireEvent("iframe");
+        };
+        
+        slide.handleCompleteAnimateIn = function (type, args, obj) {
+            obj.overlay.cfg.setProperty("xy", [x, y], true);
+            obj.startX = x;
+            obj.startY = y;
+            obj.overlay.cfg.refireEvent("iframe");
+            obj.animateInCompleteEvent.fire();
+        };
+        
+        slide.handleStartAnimateOut = function (type, args, obj) {
+    
+            var vw = Dom.getViewportWidth(),
+                pos = Dom.getXY(obj.overlay.element),
+                yso = pos[1],
+                currentTo = obj.animOut.attributes.points.to;
+    
+            obj.animOut.attributes.points.to = [(vw + 25), yso];
+    
+        };
+        
+        slide.handleTweenAnimateOut = function (type, args, obj) {
+    
+            var pos = Dom.getXY(obj.overlay.element),
+                xto = pos[0],
+                yto = pos[1];
+        
+            obj.overlay.cfg.setProperty("xy", [xto, yto], true);
+            obj.overlay.cfg.refireEvent("iframe");
+        };
+        
+        slide.handleCompleteAnimateOut = function (type, args, obj) {
+            Dom.setStyle(obj.overlay.element, "visibility", "hidden");
+        
+            obj.overlay.cfg.setProperty("xy", [x, y]);
+            obj.animateOutCompleteEvent.fire();
+        };
+        
+        slide.init();
+        return slide;
+    };
+    
+    ContainerEffect.prototype = {
+    
+        /**
+        * Initializes the animation classes and events.
+        * @method init
+        */
+        init: function () {
+
+            this.beforeAnimateInEvent = this.createEvent("beforeAnimateIn");
+            this.beforeAnimateInEvent.signature = CustomEvent.LIST;
+            
+            this.beforeAnimateOutEvent = this.createEvent("beforeAnimateOut");
+            this.beforeAnimateOutEvent.signature = CustomEvent.LIST;
+        
+            this.animateInCompleteEvent = this.createEvent("animateInComplete");
+            this.animateInCompleteEvent.signature = CustomEvent.LIST;
+        
+            this.animateOutCompleteEvent = 
+                this.createEvent("animateOutComplete");
+            this.animateOutCompleteEvent.signature = CustomEvent.LIST;
+        
+            this.animIn = new this.animClass(this.targetElement, 
+                this.attrIn.attributes, this.attrIn.duration, 
+                this.attrIn.method);
+
+            this.animIn.onStart.subscribe(this.handleStartAnimateIn, this);
+            this.animIn.onTween.subscribe(this.handleTweenAnimateIn, this);
+
+            this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn, 
+                this);
+        
+            this.animOut = new this.animClass(this.targetElement, 
+                this.attrOut.attributes, this.attrOut.duration, 
+                this.attrOut.method);
+
+            this.animOut.onStart.subscribe(this.handleStartAnimateOut, this);
+            this.animOut.onTween.subscribe(this.handleTweenAnimateOut, this);
+            this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut, 
+                this);
+
+        },
+        
+        /**
+        * Triggers the in-animation.
+        * @method animateIn
+        */
+        animateIn: function () {
+            this.beforeAnimateInEvent.fire();
+            this.animIn.animate();
+        },
+        
+        /**
+        * Triggers the out-animation.
+        * @method animateOut
+        */
+        animateOut: function () {
+            this.beforeAnimateOutEvent.fire();
+            this.animOut.animate();
+        },
+        
+        /**
+        * The default onStart handler for the in-animation.
+        * @method handleStartAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleStartAnimateIn: function (type, args, obj) { },
+    
+        /**
+        * The default onTween handler for the in-animation.
+        * @method handleTweenAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleTweenAnimateIn: function (type, args, obj) { },
+    
+        /**
+        * The default onComplete handler for the in-animation.
+        * @method handleCompleteAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleCompleteAnimateIn: function (type, args, obj) { },
+        
+        /**
+        * The default onStart handler for the out-animation.
+        * @method handleStartAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleStartAnimateOut: function (type, args, obj) { },
+    
+        /**
+        * The default onTween handler for the out-animation.
+        * @method handleTweenAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleTweenAnimateOut: function (type, args, obj) { },
+    
+        /**
+        * The default onComplete handler for the out-animation.
+        * @method handleCompleteAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleCompleteAnimateOut: function (type, args, obj) { },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the ContainerEffect
+        */
+        toString: function () {
+            var output = "ContainerEffect";
+            if (this.overlay) {
+                output += " [" + this.overlay.toString() + "]";
+            }
+            return output;
+        }
+    
+    };
+
+    YAHOO.lang.augmentProto(ContainerEffect, YAHOO.util.EventProvider);
+
+})();
+YAHOO.register("container", YAHOO.widget.Module, {version: "2.3.0", build: "442"});
index bcdd71221653009bca784464978aa0823a08cffe..d39a82b219709acfe8a427d23d45a8d6fc352393 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 
-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);}
-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;}}
-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]);}
-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]);}
-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;}
-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;}}}
-if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}
-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;}}}}}
-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;}
-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);}}
-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);}
-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()+"]";}
-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]+", ";}}
-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;}}
-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.textResizeEvent=new YAHOO.util.CustomEvent("textResize");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;}
-if(typeof el=="string"){var elId=el;el=document.getElementById(el);if(!el){el=document.createElement("DIV");el.id=elId;}}
+(function(){YAHOO.util.Config=function(owner){if(owner){this.init(owner);}
+if(!owner){}};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config;Config.CONFIG_CHANGED_EVENT="configChanged";Config.BOOLEAN_TYPE="boolean";Config.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(owner){this.owner=owner;this.configChangedEvent=this.createEvent(Config.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=CustomEvent.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(val){return(typeof val==Config.BOOLEAN_TYPE);},checkNumber:function(val){return(!isNaN(val));},fireEvent:function(key,value){var property=this.config[key];if(property&&property.event){property.event.fire(value);}},addProperty:function(key,propertyObject){key=key.toLowerCase();this.config[key]=propertyObject;propertyObject.event=this.createEvent(key,{scope:this.owner});propertyObject.event.signature=CustomEvent.LIST;propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner);}
+this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}},getConfig:function(){var cfg={},prop,property;for(prop in this.config){property=this.config[prop];if(property&&property.event){cfg[prop]=property.value;}}
+return cfg;},getProperty:function(key){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.value;}else{return undefined;}},resetProperty:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event){if(this.initialConfig[key]&&!Lang.isUndefined(this.initialConfig[key])){this.setProperty(key,this.initialConfig[key]);return true;}}else{return false;}},setProperty:function(key,value,silent){var property;key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{property=this.config[key];if(property&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){this.fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
+return true;}}else{return false;}}},queueProperty:function(key,value){key=key.toLowerCase();var property=this.config[key],foundDuplicate=false,iLen,queueItem,queueItemKey,queueItemValue,sLen,supercedesCheck,qLen,queueItemCheck,queueItemCheckKey,queueItemCheckValue,i,s,q;if(property&&property.event){if(!Lang.isUndefined(value)&&property.validator&&!property.validator(value)){return false;}else{if(!Lang.isUndefined(value)){property.value=value;}else{value=property.value;}
+foundDuplicate=false;iLen=this.eventQueue.length;for(i=0;i<iLen;i++){queueItem=this.eventQueue[i];if(queueItem){queueItemKey=queueItem[0];queueItemValue=queueItem[1];if(queueItemKey==key){this.eventQueue[i]=null;this.eventQueue.push([key,(!Lang.isUndefined(value)?value:queueItemValue)]);foundDuplicate=true;break;}}}
+if(!foundDuplicate&&!Lang.isUndefined(value)){this.eventQueue.push([key,value]);}}
+if(property.supercedes){sLen=property.supercedes.length;for(s=0;s<sLen;s++){supercedesCheck=property.supercedes[s];qLen=this.eventQueue.length;for(q=0;q<qLen;q++){queueItemCheck=this.eventQueue[q];if(queueItemCheck){queueItemCheckKey=queueItemCheck[0];queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey==supercedesCheck.toLowerCase()){this.eventQueue.push([queueItemCheckKey,queueItemCheckValue]);this.eventQueue[q]=null;break;}}}}}
+return true;}else{return false;}},refireEvent:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event&&!Lang.isUndefined(property.value)){if(this.queueInProgress){this.queueProperty(key);}else{this.fireEvent(key,property.value);}}},applyConfig:function(userConfig,init){var sKey,oValue,oConfig;if(init){oConfig={};for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){oConfig[sKey.toLowerCase()]=userConfig[sKey];}}
+this.initialConfig=oConfig;}
+for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){this.queueProperty(sKey,userConfig[sKey]);}}},refresh:function(){var prop;for(prop in this.config){this.refireEvent(prop);}},fireQueue:function(){var i,queueItem,key,value,property;this.queueInProgress=true;for(i=0;i<this.eventQueue.length;i++){queueItem=this.eventQueue[i];if(queueItem){key=queueItem[0];value=queueItem[1];property=this.config[key];property.value=value;this.fireEvent(key,value);}}
+this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(key,handler,obj,override){var property=this.config[key.toLowerCase()];if(property&&property.event){if(!Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
+return true;}else{return false;}},unsubscribeFromConfigEvent:function(key,handler,obj){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}},toString:function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
+return output;},outputEventQueue:function(){var output="",queueItem,q,nQueue=this.eventQueue.length;for(q=0;q<nQueue;q++){queueItem=this.eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
+return output;},destroy:function(){var oConfig=this.config,sProperty,oProperty;for(sProperty in oConfig){if(Lang.hasOwnProperty(oConfig,sProperty)){oProperty=oConfig[sProperty];oProperty.event.unsubscribeAll();oProperty.event=null;}}
+this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};Config.alreadySubscribed=function(evt,fn,obj){var nSubscribers=evt.subscribers.length,subsc,i;if(nSubscribers>0){i=nSubscribers-1;do{subsc=evt.subscribers[i];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
+while(i--);}
+return false;};YAHOO.lang.augmentProto(Config,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}else{}};var Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,m_oModuleTemplate,m_oHeaderTemplate,m_oBodyTemplate,m_oFooterTemplate,EVENT_TYPES={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},DEFAULT_CONFIG={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true}};Module.IMG_ROOT=null;Module.IMG_ROOT_SSL=null;Module.CSS_MODULE="yui-module";Module.CSS_HEADER="hd";Module.CSS_BODY="bd";Module.CSS_FOOTER="ft";Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";Module.textResizeEvent=new CustomEvent("textResize");function createModuleTemplate(){if(!m_oModuleTemplate){m_oModuleTemplate=document.createElement("div");m_oModuleTemplate.innerHTML=("<div class=\""+
+Module.CSS_HEADER+"\"></div>"+"<div class=\""+
+Module.CSS_BODY+"\"></div><div class=\""+
+Module.CSS_FOOTER+"\"></div>");m_oHeaderTemplate=m_oModuleTemplate.firstChild;m_oBodyTemplate=m_oHeaderTemplate.nextSibling;m_oFooterTemplate=m_oBodyTemplate.nextSibling;}
+return m_oModuleTemplate;}
+function createHeader(){if(!m_oHeaderTemplate){createModuleTemplate();}
+return(m_oHeaderTemplate.cloneNode(false));}
+function createBody(){if(!m_oBodyTemplate){createModuleTemplate();}
+return(m_oBodyTemplate.cloneNode(false));}
+function createFooter(){if(!m_oFooterTemplate){createModuleTemplate();}
+return(m_oFooterTemplate.cloneNode(false));}
+Module.prototype={constructor:Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:Module.IMG_ROOT,initEvents:function(){var SIGNATURE=CustomEvent.LIST;this.beforeInitEvent=this.createEvent(EVENT_TYPES.BEFORE_INIT);this.beforeInitEvent.signature=SIGNATURE;this.initEvent=this.createEvent(EVENT_TYPES.INIT);this.initEvent.signature=SIGNATURE;this.appendEvent=this.createEvent(EVENT_TYPES.APPEND);this.appendEvent.signature=SIGNATURE;this.beforeRenderEvent=this.createEvent(EVENT_TYPES.BEFORE_RENDER);this.beforeRenderEvent.signature=SIGNATURE;this.renderEvent=this.createEvent(EVENT_TYPES.RENDER);this.renderEvent.signature=SIGNATURE;this.changeHeaderEvent=this.createEvent(EVENT_TYPES.CHANGE_HEADER);this.changeHeaderEvent.signature=SIGNATURE;this.changeBodyEvent=this.createEvent(EVENT_TYPES.CHANGE_BODY);this.changeBodyEvent.signature=SIGNATURE;this.changeFooterEvent=this.createEvent(EVENT_TYPES.CHANGE_FOOTER);this.changeFooterEvent.signature=SIGNATURE;this.changeContentEvent=this.createEvent(EVENT_TYPES.CHANGE_CONTENT);this.changeContentEvent.signature=SIGNATURE;this.destroyEvent=this.createEvent(EVENT_TYPES.DESTORY);this.destroyEvent.signature=SIGNATURE;this.beforeShowEvent=this.createEvent(EVENT_TYPES.BEFORE_SHOW);this.beforeShowEvent.signature=SIGNATURE;this.showEvent=this.createEvent(EVENT_TYPES.SHOW);this.showEvent.signature=SIGNATURE;this.beforeHideEvent=this.createEvent(EVENT_TYPES.BEFORE_HIDE);this.beforeHideEvent.signature=SIGNATURE;this.hideEvent=this.createEvent(EVENT_TYPES.HIDE);this.hideEvent.signature=SIGNATURE;},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(DEFAULT_CONFIG.VISIBLE.key,{handler:this.configVisible,value:DEFAULT_CONFIG.VISIBLE.value,validator:DEFAULT_CONFIG.VISIBLE.validator});this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key,{suppressEvent:DEFAULT_CONFIG.EFFECT.suppressEvent,supercedes:DEFAULT_CONFIG.EFFECT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:DEFAULT_CONFIG.MONITOR_RESIZE.value});},init:function(el,userConfig){var elId,i,child;this.initEvents();this.beforeInitEvent.fire(Module);this.cfg=new Config(this);if(this.isSecure){this.imageRoot=Module.IMG_ROOT_SSL;}
+if(typeof el=="string"){elId=el;el=document.getElementById(el);if(!el){el=(createModuleTemplate()).cloneNode(false);el.id=elId;}}
 this.element=el;if(el.id){this.id=el.id;}
-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;}}}
-this.initDefaultConfig();YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
-if(!YAHOO.util.Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
-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;}
-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();}}
-var fireTextResize=function(){YAHOO.widget.Module.textResizeEvent.fire();};if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize,this,true);if(!YAHOO.widget.Module.textResizeInitialized){if(!YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",fireTextResize)){YAHOO.util.Event.addListener(this.resizeMonitor,"resize",fireTextResize);}
-YAHOO.widget.Module.textResizeInitialized=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;}
-if(typeof headerContent=="string"){this.header.innerHTML=headerContent;}else{this.header.innerHTML="";this.header.appendChild(headerContent);}
-this.changeHeaderEvent.fire(headerContent);this.changeContentEvent.fire();},appendToHeader:function(element){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}
-this.header.appendChild(element);this.changeHeaderEvent.fire(element);this.changeContentEvent.fire();},setBody:function(bodyContent){if(!this.body){this.body=document.createElement("DIV");this.body.className=YAHOO.widget.Module.CSS_BODY;}
-if(typeof bodyContent=="string")
-{this.body.innerHTML=bodyContent;}else{this.body.innerHTML="";this.body.appendChild(bodyContent);}
-this.changeBodyEvent.fire(bodyContent);this.changeContentEvent.fire();},appendToBody:function(element){if(!this.body){this.body=document.createElement("DIV");this.body.className=YAHOO.widget.Module.CSS_BODY;}
-this.body.appendChild(element);this.changeBodyEvent.fire(element);this.changeContentEvent.fire();},setFooter:function(footerContent){if(!this.footer){this.footer=document.createElement("DIV");this.footer.className=YAHOO.widget.Module.CSS_FOOTER;}
-if(typeof footerContent=="string"){this.footer.innerHTML=footerContent;}else{this.footer.innerHTML="";this.footer.appendChild(footerContent);}
-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;}
-this.footer.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
-var me=this;var appendTo=function(element){if(typeof element=="string"){element=document.getElementById(element);}
-if(element){element.appendChild(me.element);me.appendEvent.fire();}};if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}
-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);}}
-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);}}
-if(this.footer&&!YAHOO.util.Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
-this.renderEvent.fire();return true;},destroy:function(){var parent;if(this.element){YAHOO.util.Event.purgeElement(this.element,true);parent=this.element.parentNode;}
+child=this.element.firstChild;if(child){do{switch(child.className){case Module.CSS_HEADER:this.header=child;break;case Module.CSS_BODY:this.body=child;break;case Module.CSS_FOOTER:this.footer=child;break;}}while((child=child.nextSibling));}
+this.initDefaultConfig();Dom.addClass(this.element,Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
+if(!Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
+this.initEvent.fire(Module);},initResizeMonitor:function(){var oDoc,oIFrame,sHTML;function fireTextResize(){Module.textResizeEvent.fire();}
+if(!YAHOO.env.ua.opera){oIFrame=Dom.get("_yuiResizeMonitor");if(!oIFrame){oIFrame=document.createElement("iframe");if(this.isSecure&&Module.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){oIFrame.src=Module.RESIZE_MONITOR_SECURE_URL;}
+if(YAHOO.env.ua.gecko){sHTML="<html><head><script "+"type=\"text/javascript\">"+"window.onresize=function(){window.parent."+"YAHOO.widget.Module.textResizeEvent."+"fire();};window.parent.YAHOO.widget.Module."+"textResizeEvent.fire();</script></head>"+"<body></body></html>";oIFrame.src="data:text/html;charset=utf-8,"+
+encodeURIComponent(sHTML);}
+oIFrame.id="_yuiResizeMonitor";oIFrame.style.position="absolute";oIFrame.style.visibility="hidden";document.body.appendChild(oIFrame);oIFrame.style.width="10em";oIFrame.style.height="10em";oIFrame.style.top=(-1*oIFrame.offsetHeight)+"px";oIFrame.style.left=(-1*oIFrame.offsetWidth)+"px";oIFrame.style.borderWidth="0";oIFrame.style.visibility="visible";if(YAHOO.env.ua.webkit){oDoc=oIFrame.contentWindow.document;oDoc.open();oDoc.close();}}
+if(oIFrame&&oIFrame.contentWindow){Module.textResizeEvent.subscribe(this.onDomResize,this,true);if(!Module.textResizeInitialized){if(!Event.on(oIFrame.contentWindow,"resize",fireTextResize)){Event.on(oIFrame,"resize",fireTextResize);}
+Module.textResizeInitialized=true;}
+this.resizeMonitor=oIFrame;}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){var oHeader=this.header||(this.header=createHeader());if(typeof headerContent=="string"){oHeader.innerHTML=headerContent;}else{oHeader.innerHTML="";oHeader.appendChild(headerContent);}
+this.changeHeaderEvent.fire(headerContent);this.changeContentEvent.fire();},appendToHeader:function(element){var oHeader=this.header||(this.header=createHeader());oHeader.appendChild(element);this.changeHeaderEvent.fire(element);this.changeContentEvent.fire();},setBody:function(bodyContent){var oBody=this.body||(this.body=createBody());if(typeof bodyContent=="string"){oBody.innerHTML=bodyContent;}else{oBody.innerHTML="";oBody.appendChild(bodyContent);}
+this.changeBodyEvent.fire(bodyContent);this.changeContentEvent.fire();},appendToBody:function(element){var oBody=this.body||(this.body=createBody());oBody.appendChild(element);this.changeBodyEvent.fire(element);this.changeContentEvent.fire();},setFooter:function(footerContent){var oFooter=this.footer||(this.footer=createFooter());if(typeof footerContent=="string"){oFooter.innerHTML=footerContent;}else{oFooter.innerHTML="";oFooter.appendChild(footerContent);}
+this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){var oFooter=this.footer||(this.footer=createFooter());oFooter.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){var me=this,firstChild;function appendTo(element){if(typeof element=="string"){element=document.getElementById(element);}
+if(element){element.appendChild(me.element);me.appendEvent.fire();}}
+this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
+if(appendToNode){appendTo(appendToNode);}else{if(!Dom.inDocument(this.element)){return false;}}
+if(this.header&&!Dom.inDocument(this.header)){firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}
+if(this.body&&!Dom.inDocument(this.body)){if(this.footer&&Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}
+if(this.footer&&!Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
+this.renderEvent.fire();return true;},destroy:function(){var parent,e;if(this.element){Event.purgeElement(this.element,true);parent=this.element.parentNode;}
 if(parent){parent.removeChild(this.element);}
-this.element=null;this.header=null;this.body=null;this.footer=null;for(var e in this){if(e instanceof YAHOO.util.CustomEvent){e.unsubscribeAll();}}
-YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize,this);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.widget.Module.textResizeEvent.unsubscribe(this.onDomResize,this,true);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;";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);}
-if(this.platform=="mac"&&this.browser=="gecko"){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
-if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
-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;}
+this.element=null;this.header=null;this.body=null;this.footer=null;Module.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();for(e in this){if(e instanceof CustomEvent){e.unsubscribeAll();}}},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{Module.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(Module,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,Overlay=YAHOO.widget.Overlay,m_oIFrameTemplate,EVENT_TYPES={"BEFORE_MOVE":"beforeMove","MOVE":"move"},DEFAULT_CONFIG={"X":{key:"x",validator:Lang.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:Lang.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:Lang.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:Lang.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(YAHOO.env.ua.ie==6?true:false),validator:Lang.isBoolean,supercedes:["zindex"]}};Overlay.IFRAME_SRC="javascript:false;";Overlay.IFRAME_OFFSET=3;Overlay.TOP_LEFT="tl";Overlay.TOP_RIGHT="tr";Overlay.BOTTOM_LEFT="bl";Overlay.BOTTOM_RIGHT="br";Overlay.CSS_OVERLAY="yui-overlay";Overlay.windowScrollEvent=new CustomEvent("windowScroll");Overlay.windowResizeEvent=new CustomEvent("windowResize");Overlay.windowScrollHandler=function(e){if(YAHOO.env.ua.ie){if(!window.scrollEnd){window.scrollEnd=-1;}
+clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){Overlay.windowScrollEvent.fire();},1);}else{Overlay.windowScrollEvent.fire();}};Overlay.windowResizeHandler=function(e){if(YAHOO.env.ua.ie){if(!window.resizeEnd){window.resizeEnd=-1;}
+clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){Overlay.windowResizeEvent.fire();},100);}else{Overlay.windowResizeEvent.fire();}};Overlay._initialized=null;if(Overlay._initialized===null){Event.on(window,"scroll",Overlay.windowScrollHandler);Event.on(window,"resize",Overlay.windowResizeHandler);Overlay._initialized=true;}
+YAHOO.extend(Overlay,Module,{init:function(el,userConfig){Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(Overlay);Dom.addClass(this.element,Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
+if(this.platform=="mac"&&YAHOO.env.ua.gecko){if(!Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
+if(!Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
+this.initEvent.fire(Overlay);},initEvents:function(){Overlay.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.beforeMoveEvent=this.createEvent(EVENT_TYPES.BEFORE_MOVE);this.beforeMoveEvent.signature=SIGNATURE;this.moveEvent=this.createEvent(EVENT_TYPES.MOVE);this.moveEvent.signature=SIGNATURE;},initDefaultConfig:function(){Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.X.key,{handler:this.configX,validator:DEFAULT_CONFIG.X.validator,suppressEvent:DEFAULT_CONFIG.X.suppressEvent,supercedes:DEFAULT_CONFIG.X.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.Y.key,{handler:this.configY,validator:DEFAULT_CONFIG.Y.validator,suppressEvent:DEFAULT_CONFIG.Y.suppressEvent,supercedes:DEFAULT_CONFIG.Y.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.XY.key,{handler:this.configXY,suppressEvent:DEFAULT_CONFIG.XY.suppressEvent,supercedes:DEFAULT_CONFIG.XY.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key,{handler:this.configContext,suppressEvent:DEFAULT_CONFIG.CONTEXT.suppressEvent,supercedes:DEFAULT_CONFIG.CONTEXT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key,{handler:this.configFixedCenter,value:DEFAULT_CONFIG.FIXED_CENTER.value,validator:DEFAULT_CONFIG.FIXED_CENTER.validator,supercedes:DEFAULT_CONFIG.FIXED_CENTER.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key,{handler:this.configWidth,suppressEvent:DEFAULT_CONFIG.WIDTH.suppressEvent,supercedes:DEFAULT_CONFIG.WIDTH.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key,{handler:this.configHeight,suppressEvent:DEFAULT_CONFIG.HEIGHT.suppressEvent,supercedes:DEFAULT_CONFIG.HEIGHT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key,{handler:this.configzIndex,value:DEFAULT_CONFIG.ZINDEX.value});this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value,validator:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator,supercedes:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key,{handler:this.configIframe,value:DEFAULT_CONFIG.IFRAME.value,validator:DEFAULT_CONFIG.IFRAME.validator,supercedes:DEFAULT_CONFIG.IFRAME.supercedes});},moveTo:function(x,y){this.cfg.setProperty("xy",[x,y]);},hideMacGeckoScrollbars:function(){Dom.removeClass(this.element,"show-scrollbars");Dom.addClass(this.element,"hide-scrollbars");},showMacGeckoScrollbars:function(){Dom.removeClass(this.element,"hide-scrollbars");Dom.addClass(this.element,"show-scrollbars");},configVisible:function(type,args,obj){var visible=args[0],currentVis=Dom.getStyle(this.element,"visibility"),effect=this.cfg.getProperty("effect"),effectInstances=[],isMacGecko=(this.platform=="mac"&&YAHOO.env.ua.gecko),alreadySubscribed=Config.alreadySubscribed,eff,ei,e,i,j,k,h,nEffects,nEffectInstances;if(currentVis=="inherit"){e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}
 e=e.parentNode;}
 if(currentVis=="inherit"){currentVis="visible";}}
-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);}}
-var isMacGecko=(this.platform=="mac"&&this.browser=="gecko");if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
-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);}
-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();}
-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);}
-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);}
-if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
-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;}}
+if(effect){if(effect instanceof Array){nEffects=effect.length;for(i=0;i<nEffects;i++){eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
+if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
+if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();nEffectInstances=effectInstances.length;for(j=0;j<nEffectInstances;j++){ei=effectInstances[j];if(j===0&&!alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
+ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
+if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();nEffectInstances=effectInstances.length;for(k=0;k<nEffectInstances;k++){h=effectInstances[k];if(k===0&&!alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
+h.animateOut();}}else if(currentVis===""){Dom.setStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();Dom.setStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(type,args,obj){var val=args[0],alreadySubscribed=Config.alreadySubscribed,windowResizeEvent=Overlay.windowResizeEvent,windowScrollEvent=Overlay.windowScrollEvent;if(val){this.center();if(!alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}
+if(!alreadySubscribed(windowResizeEvent,this.doCenterOnDOMEvent,this)){windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
+if(!alreadySubscribed(windowScrollEvent,this.doCenterOnDOMEvent,this)){windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(type,args,obj){var height=args[0],el=this.element;Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");},configWidth:function(type,args,obj){var width=args[0],el=this.element;Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");},configzIndex:function(type,args,obj){var zIndex=args[0],el=this.element;if(!zIndex){zIndex=Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
 if(this.iframe){if(zIndex<=0){zIndex=1;}
-YAHOO.util.Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}
-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);}
-if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideIframe,this)){this.hideEvent.subscribe(this.hideIframe,this,true);}
-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");}
-if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=YAHOO.widget.Overlay.IFRAME_SRC;}
-var parent=this.element.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}
-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();}}
-var iframeDisplay=YAHOO.util.Dom.getStyle(this.iframe,"display");if(iframeDisplay=="none"){this.iframe.style.display="block";}
-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";}
-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);}
-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];}
+Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}
+Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);},configXY:function(type,args,obj){var pos=args[0],x=pos[0],y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configX:function(type,args,obj){var x=args[0],y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configY:function(type,args,obj){var x=this.cfg.getProperty("x"),y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},showIframe:function(){var oIFrame=this.iframe,oParentNode;if(oIFrame){oParentNode=this.element.parentNode;if(oParentNode!=oIFrame.parentNode){oParentNode.appendChild(oIFrame);}
+oIFrame.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var oIFrame=this.iframe,oElement=this.element,nOffset=Overlay.IFRAME_OFFSET,nDimensionOffset=(nOffset*2),aXY;if(oIFrame){oIFrame.style.width=(oElement.offsetWidth+nDimensionOffset+"px");oIFrame.style.height=(oElement.offsetHeight+nDimensionOffset+"px");aXY=this.cfg.getProperty("xy");if(!Lang.isArray(aXY)||(isNaN(aXY[0])||isNaN(aXY[1]))){this.syncPosition();aXY=this.cfg.getProperty("xy");}
+Dom.setXY(oIFrame,[(aXY[0]-nOffset),(aXY[1]-nOffset)]);}},configIframe:function(type,args,obj){var bIFrame=args[0];function createIFrame(){var oIFrame=this.iframe,oElement=this.element,oParent,aXY;if(!oIFrame){if(!m_oIFrameTemplate){m_oIFrameTemplate=document.createElement("iframe");if(this.isSecure){m_oIFrameTemplate.src=Overlay.IFRAME_SRC;}
+if(YAHOO.env.ua.ie){m_oIFrameTemplate.style.filter="alpha(opacity=0)";m_oIFrameTemplate.frameBorder=0;}
+else{m_oIFrameTemplate.style.opacity="0";}
+m_oIFrameTemplate.style.position="absolute";m_oIFrameTemplate.style.border="none";m_oIFrameTemplate.style.margin="0";m_oIFrameTemplate.style.padding="0";m_oIFrameTemplate.style.display="none";}
+oIFrame=m_oIFrameTemplate.cloneNode(false);oParent=oElement.parentNode;if(oParent){oParent.appendChild(oIFrame);}else{document.body.appendChild(oIFrame);}
+this.iframe=oIFrame;}
+this.showIframe();this.syncIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}
+function onBeforeShow(){createIFrame.call(this);this.beforeShowEvent.unsubscribe(onBeforeShow);this._iframeDeferred=false;}
+if(bIFrame){if(this.cfg.getProperty("visible")){createIFrame.call(this);}
+else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(onBeforeShow);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},configConstrainToViewport:function(type,args,obj){var val=args[0];if(val){if(!Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(type,args,obj){var contextArgs=args[0],contextEl,elementMagnetCorner,contextMagnetCorner;if(contextArgs){contextEl=contextArgs[0];elementMagnetCorner=contextArgs[1];contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
+if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}},align:function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context"),me=this,context,element,contextRegion;function doAlign(v,h){switch(elementAlign){case Overlay.TOP_LEFT:me.moveTo(h,v);break;case Overlay.TOP_RIGHT:me.moveTo((h-element.offsetWidth),v);break;case Overlay.BOTTOM_LEFT:me.moveTo(h,(v-element.offsetHeight));break;case Overlay.BOTTOM_RIGHT:me.moveTo((h-element.offsetWidth),(v-element.offsetHeight));break;}}
+if(contextArgs){context=contextArgs[0];element=this.element;me=this;if(!elementAlign){elementAlign=contextArgs[1];}
 if(!contextAlign){contextAlign=contextArgs[2];}
-if(element&&context){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;}
+if(element&&context){contextRegion=Dom.getRegion(context);switch(contextAlign){case Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}},enforceConstraints:function(type,args,obj){var pos=args[0],x=pos[0],y=pos[1],offsetHeight=this.element.offsetHeight,offsetWidth=this.element.offsetWidth,viewPortWidth=Dom.getViewportWidth(),viewPortHeight=Dom.getViewportHeight(),scrollX=Dom.getDocumentScrollLeft(),scrollY=Dom.getDocumentScrollTop(),topConstraint=scrollY+10,leftConstraint=scrollX+10,bottomConstraint=scrollY+viewPortHeight-offsetHeight-10,rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
 if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}
-this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);};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);}
-this.iframe=null;YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);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;}
-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;}
-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;}
-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);}
-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));}
-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=[];}
-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);}
-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++;}}
-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];}}}
-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;}
-var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
-if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
-function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
-if(!keyData.alt){keyData.alt=false;}
-if(!keyData.ctrl){keyData.ctrl=false;}
-if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
-this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
-this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
-this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.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);}
-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);}
+this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);},center:function(){var scrollX=Dom.getDocumentScrollLeft(),scrollY=Dom.getDocumentScrollTop(),viewPortWidth=Dom.getClientWidth(),viewPortHeight=Dom.getClientHeight(),elementWidth=this.element.offsetWidth,elementHeight=this.element.offsetHeight,x=(viewPortWidth/2)-(elementWidth/2)+scrollX,y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var pos=Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);},onDomResize:function(e,obj){var me=this;Overlay.superclass.onDomResize.call(this,e,obj);setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);},bringToTop:function(){var aOverlays=[],oElement=this.element;function compareZIndexDesc(p_oOverlay1,p_oOverlay2){var sZIndex1=Dom.getStyle(p_oOverlay1,"zIndex"),sZIndex2=Dom.getStyle(p_oOverlay2,"zIndex"),nZIndex1=(!sZIndex1||isNaN(sZIndex1))?0:parseInt(sZIndex1,10),nZIndex2=(!sZIndex2||isNaN(sZIndex2))?0:parseInt(sZIndex2,10);if(nZIndex1>nZIndex2){return-1;}else if(nZIndex1<nZIndex2){return 1;}else{return 0;}}
+function isOverlayElement(p_oElement){var oOverlay=Dom.hasClass(p_oElement,Overlay.CSS_OVERLAY),Panel=YAHOO.widget.Panel;if(oOverlay&&!Dom.isAncestor(oElement,oOverlay)){if(Panel&&Dom.hasClass(p_oElement,Panel.CSS_PANEL)){aOverlays[aOverlays.length]=p_oElement.parentNode;}
+else{aOverlays[aOverlays.length]=p_oElement;}}}
+Dom.getElementsBy(isOverlayElement,"DIV",document.body);aOverlays.sort(compareZIndexDesc);var oTopOverlay=aOverlays[0],nTopZIndex;if(oTopOverlay){nTopZIndex=Dom.getStyle(oTopOverlay,"zIndex");if(!isNaN(nTopZIndex)&&oTopOverlay!=oElement){this.cfg.setProperty("zindex",(parseInt(nTopZIndex,10)+2));}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
+this.iframe=null;Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);Overlay.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};var Overlay=YAHOO.widget.Overlay,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,CustomEvent=YAHOO.util.CustomEvent,OverlayManager=YAHOO.widget.OverlayManager;OverlayManager.CSS_FOCUSED="focused";OverlayManager.prototype={constructor:OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
+this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){if(activeOverlay!=o){if(activeOverlay){activeOverlay.blur();}
+this.bringToTop(o);activeOverlay=o;Dom.addClass(activeOverlay.element,OverlayManager.CSS_FOCUSED);o.focusEvent.fire();}}};this.remove=function(overlay){var o=this.find(overlay),originalZ;if(o){if(activeOverlay==o){activeOverlay=null;}
+originalZ=Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));o.hideEvent.unsubscribe(o.blur);o.destroyEvent.unsubscribe(this._onOverlayDestroy,o);if(o.element){Event.removeListener(o.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);}
+o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent.unsubscribeAll();o.blurEvent.unsubscribeAll();o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){var nOverlays=this.overlays.length,i;if(nOverlays>0){i=nOverlays-1;do{this.overlays[i].blur();}
+while(i--);}};this._onOverlayBlur=function(p_sType,p_aArgs){activeOverlay=null;};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}
+if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oClose=this.close;if(oClose&&(oTarget==oClose||Dom.isAncestor(oClose,oTarget))){this.blur();}
+else{this.focus();}},_onOverlayDestroy:function(p_sType,p_aArgs,p_oOverlay){this.remove(p_oOverlay);},register:function(overlay){var mgr=this,zIndex,regcount,i,nOverlays;if(overlay instanceof Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=overlay.createEvent("focus");overlay.focusEvent.signature=CustomEvent.LIST;overlay.blurEvent=overlay.createEvent("blur");overlay.blurEvent.signature=CustomEvent.LIST;overlay.focus=function(){mgr.focus(this);};overlay.blur=function(){if(mgr.getActive()==this){Dom.removeClass(this.element,OverlayManager.CSS_FOCUSED);this.blurEvent.fire();}};overlay.blurEvent.subscribe(mgr._onOverlayBlur);overlay.hideEvent.subscribe(overlay.blur);overlay.destroyEvent.subscribe(this._onOverlayDestroy,overlay,this);Event.on(overlay.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus,null,overlay);zIndex=Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}
+this.overlays.push(overlay);this.bringToTop(overlay);return true;}else if(overlay instanceof Array){regcount=0;nOverlays=overlay.length;for(i=0;i<nOverlays;i++){if(this.register(overlay[i])){regcount++;}}
+if(regcount>0){return true;}}else{return false;}},bringToTop:function(p_oOverlay){var oOverlay=this.find(p_oOverlay),nTopZIndex,oTopOverlay,aOverlays;if(oOverlay){aOverlays=this.overlays;aOverlays.sort(this.compareZIndexDesc);oTopOverlay=aOverlays[0];if(oTopOverlay){nTopZIndex=Dom.getStyle(oTopOverlay.element,"zIndex");if(!isNaN(nTopZIndex)&&oTopOverlay!=oOverlay){oOverlay.cfg.setProperty("zIndex",(parseInt(nTopZIndex,10)+2));}
+aOverlays.sort(this.compareZIndexDesc);}}},find:function(overlay){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;if(overlay instanceof Overlay){do{if(aOverlays[i]==overlay){return aOverlays[i];}}
+while(i--);}else if(typeof overlay=="string"){do{if(aOverlays[i].id==overlay){return aOverlays[i];}}
+while(i--);}
+return null;}},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex"),zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;do{aOverlays[i].show();}
+while(i--);}},hideAll:function(){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;do{aOverlays[i].hide();}
+while(i--);}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(el,userConfig){YAHOO.widget.Tooltip.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Tooltip=YAHOO.widget.Tooltip,m_oShadowTemplate,DEFAULT_CONFIG={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:Lang.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:Lang.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:Lang.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:Lang.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"}};Tooltip.CSS_TOOLTIP="yui-tt";function restoreOriginalWidth(p_sType,p_aArgs,p_oObject){var sOriginalWidth=p_oObject[0],sNewWidth=p_oObject[1],oConfig=this.cfg,sCurrentWidth=oConfig.getProperty("width");if(sCurrentWidth==sNewWidth){oConfig.setProperty("width",sOriginalWidth);}
+this.unsubscribe("hide",this._onHide,p_oObject);}
+function setWidthToOffsetWidth(p_sType,p_aArgs){var oBody=document.body,oConfig=this.cfg,sOriginalWidth=oConfig.getProperty("width"),sNewWidth,oClone;if((!sOriginalWidth||sOriginalWidth=="auto")&&(oConfig.getProperty("container")!=oBody||oConfig.getProperty("x")>=Dom.getViewportWidth()||oConfig.getProperty("y")>=Dom.getViewportHeight())){oClone=this.element.cloneNode(true);oClone.style.visibility="hidden";oClone.style.top="0px";oClone.style.left="0px";oBody.appendChild(oClone);sNewWidth=(oClone.offsetWidth+"px");oBody.removeChild(oClone);oClone=null;oConfig.setProperty("width",sNewWidth);oConfig.refireEvent("xy");this.subscribe("hide",restoreOriginalWidth,[(sOriginalWidth||""),sNewWidth]);}}
+function onDOMReady(p_sType,p_aArgs,p_oObject){this.render(p_oObject);}
+function onInit(){Event.onDOMReady(onDOMReady,this.cfg.getProperty("container"),this);}
+YAHOO.extend(Tooltip,YAHOO.widget.Overlay,{init:function(el,userConfig){Tooltip.superclass.init.call(this,el);this.beforeInitEvent.fire(Tooltip);Dom.addClass(this.element,Tooltip.CSS_TOOLTIP);if(userConfig){this.cfg.applyConfig(userConfig,true);}
+this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("beforeShow",setWidthToOffsetWidth);this.subscribe("init",onInit);this.subscribe("render",this.onRender);this.initEvent.fire(Tooltip);},initDefaultConfig:function(){Tooltip.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.PREVENT_OVERLAP.key,{value:DEFAULT_CONFIG.PREVENT_OVERLAP.value,validator:DEFAULT_CONFIG.PREVENT_OVERLAP.validator,supercedes:DEFAULT_CONFIG.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:DEFAULT_CONFIG.SHOW_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:DEFAULT_CONFIG.AUTO_DISMISS_DELAY.value,validator:DEFAULT_CONFIG.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.HIDE_DELAY.key,{handler:this.configHideDelay,value:DEFAULT_CONFIG.HIDE_DELAY.value,validator:DEFAULT_CONFIG.HIDE_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key,{handler:this.configText,suppressEvent:DEFAULT_CONFIG.TEXT.suppressEvent});this.cfg.addProperty(DEFAULT_CONFIG.CONTAINER.key,{handler:this.configContainer,value:document.body});},configText:function(type,args,obj){var text=args[0];if(text){this.setBody(text);}},configContainer:function(type,args,obj){var container=args[0];if(typeof container=='string'){this.cfg.setProperty("container",document.getElementById(container),true);}},_removeEventListeners:function(){var aElements=this._context,nElements,oElement,i;if(aElements){nElements=aElements.length;if(nElements>0){i=nElements-1;do{oElement=aElements[i];Event.removeListener(oElement,"mouseover",this.onContextMouseOver);Event.removeListener(oElement,"mousemove",this.onContextMouseMove);Event.removeListener(oElement,"mouseout",this.onContextMouseOut);}
+while(i--);}}},configContext:function(type,args,obj){var context=args[0],aElements,nElements,oElement,i;if(context){if(!(context instanceof Array)){if(typeof context=="string"){this.cfg.setProperty("context",[document.getElementById(context)],true);}else{this.cfg.setProperty("context",[context],true);}
 context=this.cfg.getProperty("context");}
-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);}}
-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;}
-var context=this;YAHOO.util.Event.addListener(context,"mousemove",obj.onContextMouseMove,obj);if(context.title){obj._tempTitle=context.title;context.title="";}
-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;}
+this._removeEventListeners();this._context=context;aElements=this._context;if(aElements){nElements=aElements.length;if(nElements>0){i=nElements-1;do{oElement=aElements[i];Event.on(oElement,"mouseover",this.onContextMouseOver,this);Event.on(oElement,"mousemove",this.onContextMouseMove,this);Event.on(oElement,"mouseout",this.onContextMouseOut,this);}
+while(i--);}}}},onContextMouseMove:function(e,obj){obj.pageX=Event.getPageX(e);obj.pageY=Event.getPageY(e);},onContextMouseOver:function(e,obj){var context=this;if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
+Event.on(context,"mousemove",obj.onContextMouseMove,obj);if(context.title){obj._tempTitle=context.title;context.title="";}
+obj.showProcId=obj.doShow(e,context);},onContextMouseOut:function(e,obj){var el=this;if(obj._tempTitle){el.title=obj._tempTitle;obj._tempTitle=null;}
 if(obj.showProcId){clearTimeout(obj.showProcId);obj.showProcId=null;}
 if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
-obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));};YAHOO.widget.Tooltip.prototype.doShow=function(e,context){var yOffset=25;if(this.browser=="opera"&&context.tagName=="A"){yOffset+=12;}
-var me=this;return setTimeout(function(){if(me._tempTitle){me.setBody(me._tempTitle);}else{me.cfg.refireEvent("text");}
+obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));},doShow:function(e,context){var yOffset=25,me=this;if(YAHOO.env.ua.opera&&context.tagName&&context.tagName.toUpperCase()=="A"){yOffset+=12;}
+return setTimeout(function(){if(me._tempTitle){me.setBody(me._tempTitle);}else{me.cfg.refireEvent("text");}
 me.moveTo(me.pageX,me.pageY+yOffset);if(me.cfg.getProperty("preventoverlap")){me.preventOverlap(me.pageX,me.pageY);}
-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);}
-this.beforeRenderEvent.subscribe(function(){var draggable=this.cfg.getProperty("draggable");if(draggable){if(!this.header){this.setHeader("&#160;");}}},this,true);var me=this;var doBlur=function(){this.blur();};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.type!="hidden"){if(!YAHOO.util.Dom.isAncestor(me.element,el)){YAHOO.util.Event.addListener(el,"focus",doBlur,el,true);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",doBlur);}},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");}
-this.close.innerHTML="&#160;";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();}
-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="&#160;";this.element.appendChild(this.underlay);}
-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);}
-if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMask,this)){this.hideEvent.subscribe(this.hideMask,this,true);}
-if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.sizeMask,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask,this,true);}
-if(!YAHOO.util.Config.alreadySubscribed(this.destroyEvent,this.removeMask,this)){this.destroyEvent.subscribe(this.removeMask,this,true);}
-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);}
-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);}
-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);}
-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;}
-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);}
-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";}
-var me=this;this.dd.startDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.addClass(me.element,"drag");}
-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;}
-me.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&this.browser=="gecko"){this.showMacGeckoScrollbars();}
-me.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.removeClass(me.element,"drag");}
-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="&#160;";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",handler:this.configPostMethod,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);}
-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];}
-this.firstFormElement=function(){for(var f=0;f<form.elements.length;f++){var el=form.elements[f];if(el.focus&&!el.disabled){if(el.type&&el.type!="hidden"){return el;}}}
-return null;}();this.lastFormElement=function(){for(var f=form.elements.length-1;f>=0;f--){var el=form.elements[f];if(el.focus&&!el.disabled){if(el.type&&el.type!="hidden"){return el;}}}
-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);}
-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.configClose=function(type,args,obj){var val=args[0];var doCancel=function(e,obj){obj.cancel();};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");}
-this.close.innerHTML="&#160;";this.innerElement.appendChild(this.close);YAHOO.util.Event.addListener(this.close,"click",doCancel,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}};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;}
-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;}
-if(b==(buttons.length-1)){this.lastButton=button.htmlButton;}}
-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);}
-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);}}
-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);}}
-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.configPostMethod=function(type,args,obj){var postmethod=args[0];this.registerForm();YAHOO.util.Event.addListener(this.form,"submit",function(e){YAHOO.util.Event.stopEvent(e);this.submit();this.form.blur();},this,true);};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=0;i<form.elements.length;i++){var formItem=form.elements[i];if(formItem){if(formItem.tagName){switch(formItem.tagName){case"INPUT":switch(formItem.type){case"checkbox":data[formItem.name]=formItem.checked;break;case"textbox":case"text":case"hidden":data[formItem.name]=formItem.value;break;}
-break;case"TEXTAREA":data[formItem.name]=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;}
-val[val.length]=selval;}}
-data[formItem.name]=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;}}
-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;}}
-data[formItem[0].name]=cbArray;break;}}}}}}
-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);}
-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;}
-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()+"]";}
-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");}
-if(obj.overlay.underlay){obj.initialUnderlayOpacity=YAHOO.util.Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}
-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;}
-if(obj.overlay.underlay){YAHOO.util.Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
-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;}
-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");}
-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
+Event.removeListener(context,"mousemove",me.onContextMouseMove);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(pageX,pageY){var height=this.element.offsetHeight,mousePoint=new YAHOO.util.Point(pageX,pageY),elementRegion=Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;if(elementRegion.contains(mousePoint)){this.cfg.setProperty("y",(pageY-height-5));}},onRender:function(p_sType,p_aArgs){function sizeShadow(){var oElement=this.element,oShadow=this._shadow;if(oShadow){oShadow.style.width=(oElement.offsetWidth+6)+"px";oShadow.style.height=(oElement.offsetHeight+1)+"px";}}
+function addShadowVisibleClass(){Dom.addClass(this._shadow,"yui-tt-shadow-visible");}
+function removeShadowVisibleClass(){Dom.removeClass(this._shadow,"yui-tt-shadow-visible");}
+function createShadow(){var oShadow=this._shadow,oElement,Module,nIE,me;if(!oShadow){oElement=this.element;Module=YAHOO.widget.Module;nIE=YAHOO.env.ua.ie;me=this;if(!m_oShadowTemplate){m_oShadowTemplate=document.createElement("div");m_oShadowTemplate.className="yui-tt-shadow";}
+oShadow=m_oShadowTemplate.cloneNode(false);oElement.appendChild(oShadow);this._shadow=oShadow;addShadowVisibleClass.call(this);this.subscribe("beforeShow",addShadowVisibleClass);this.subscribe("beforeHide",removeShadowVisibleClass);if(nIE==6||(nIE==7&&document.compatMode=="BackCompat")){window.setTimeout(function(){sizeShadow.call(me);},0);this.cfg.subscribeToConfigEvent("width",sizeShadow);this.cfg.subscribeToConfigEvent("height",sizeShadow);this.subscribe("changeContent",sizeShadow);Module.textResizeEvent.subscribe(sizeShadow,this,true);this.subscribe("destroy",function(){Module.textResizeEvent.unsubscribe(sizeShadow,this);});}}}
+function onBeforeShow(){createShadow.call(this);this.unsubscribe("beforeShow",onBeforeShow);}
+if(this.cfg.getProperty("visible")){createShadow.call(this);}
+else{this.subscribe("beforeShow",onBeforeShow);}},destroy:function(){this._removeEventListeners();Tooltip.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,DD=YAHOO.util.DD,Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Overlay=YAHOO.widget.Overlay,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config,Panel=YAHOO.widget.Panel,m_oMaskTemplate,m_oUnderlayTemplate,m_oCloseIconTemplate,EVENT_TYPES={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},DEFAULT_CONFIG={"CLOSE":{key:"close",value:true,validator:Lang.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(DD?true:false),validator:Lang.isBoolean,supercedes:["visible"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:Lang.isBoolean,supercedes:["visible"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]}};Panel.CSS_PANEL="yui-panel";Panel.CSS_PANEL_CONTAINER="yui-panel-container";function createHeader(p_sType,p_aArgs){if(!this.header){this.setHeader("&#160;");}}
+function restoreOriginalWidth(p_sType,p_aArgs,p_oObject){var sOriginalWidth=p_oObject[0],sNewWidth=p_oObject[1],oConfig=this.cfg,sCurrentWidth=oConfig.getProperty("width");if(sCurrentWidth==sNewWidth){oConfig.setProperty("width",sOriginalWidth);}
+this.unsubscribe("hide",restoreOriginalWidth,p_oObject);}
+function setWidthToOffsetWidth(p_sType,p_aArgs){var nIE=YAHOO.env.ua.ie,oConfig,sOriginalWidth,sNewWidth;if(nIE==6||(nIE==7&&document.compatMode=="BackCompat")){oConfig=this.cfg;sOriginalWidth=oConfig.getProperty("width");if(!sOriginalWidth||sOriginalWidth=="auto"){sNewWidth=(this.element.offsetWidth+"px");oConfig.setProperty("width",sNewWidth);this.subscribe("hide",restoreOriginalWidth,[(sOriginalWidth||""),sNewWidth]);}}}
+function onElementFocus(){this.blur();}
+function addFocusEventHandlers(p_sType,p_aArgs){var me=this;function isFocusable(el){var sTagName=el.tagName.toUpperCase(),bFocusable=false;switch(sTagName){case"A":case"BUTTON":case"SELECT":case"TEXTAREA":if(!Dom.isAncestor(me.element,el)){Event.on(el,"focus",onElementFocus,el,true);bFocusable=true;}
+break;case"INPUT":if(el.type!="hidden"&&!Dom.isAncestor(me.element,el)){Event.on(el,"focus",onElementFocus,el,true);bFocusable=true;}
+break;}
+return bFocusable;}
+this.focusableElements=Dom.getElementsBy(isFocusable);}
+function removeFocusEventHandlers(p_sType,p_aArgs){var aElements=this.focusableElements,nElements=aElements.length,el2,i;for(i=0;i<nElements;i++){el2=aElements[i];Event.removeListener(el2,"focus",onElementFocus);}}
+YAHOO.extend(Panel,Overlay,{init:function(el,userConfig){Panel.superclass.init.call(this,el);this.beforeInitEvent.fire(Panel);Dom.addClass(this.element,Panel.CSS_PANEL);this.buildWrapper();if(userConfig){this.cfg.applyConfig(userConfig,true);}
+this.subscribe("showMask",addFocusEventHandlers);this.subscribe("hideMask",removeFocusEventHandlers);this.initEvent.fire(Panel);},initEvents:function(){Panel.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.showMaskEvent=this.createEvent(EVENT_TYPES.SHOW_MASK);this.showMaskEvent.signature=SIGNATURE;this.hideMaskEvent=this.createEvent(EVENT_TYPES.HIDE_MASK);this.hideMaskEvent.signature=SIGNATURE;this.dragEvent=this.createEvent(EVENT_TYPES.DRAG);this.dragEvent.signature=SIGNATURE;},initDefaultConfig:function(){Panel.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.CLOSE.key,{handler:this.configClose,value:DEFAULT_CONFIG.CLOSE.value,validator:DEFAULT_CONFIG.CLOSE.validator,supercedes:DEFAULT_CONFIG.CLOSE.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.DRAGGABLE.key,{handler:this.configDraggable,value:DEFAULT_CONFIG.DRAGGABLE.value,validator:DEFAULT_CONFIG.DRAGGABLE.validator,supercedes:DEFAULT_CONFIG.DRAGGABLE.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.UNDERLAY.key,{handler:this.configUnderlay,value:DEFAULT_CONFIG.UNDERLAY.value,supercedes:DEFAULT_CONFIG.UNDERLAY.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.MODAL.key,{handler:this.configModal,value:DEFAULT_CONFIG.MODAL.value,validator:DEFAULT_CONFIG.MODAL.validator,supercedes:DEFAULT_CONFIG.MODAL.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:DEFAULT_CONFIG.KEY_LISTENERS.suppressEvent,supercedes:DEFAULT_CONFIG.KEY_LISTENERS.supercedes});},configClose:function(type,args,obj){var val=args[0],oClose=this.close;function doHide(e,obj){obj.hide();}
+if(val){if(!oClose){if(!m_oCloseIconTemplate){m_oCloseIconTemplate=document.createElement("span");m_oCloseIconTemplate.innerHTML="&#160;";m_oCloseIconTemplate.className="container-close";}
+oClose=m_oCloseIconTemplate.cloneNode(true);this.innerElement.appendChild(oClose);Event.on(oClose,"click",doHide,this);this.close=oClose;}else{oClose.style.display="block";}}else{if(oClose){oClose.style.display="none";}}},configDraggable:function(type,args,obj){var val=args[0];if(val){if(!DD){this.cfg.setProperty("draggable",false);return;}
+if(this.header){Dom.setStyle(this.header,"cursor","move");this.registerDragDrop();}
+this.subscribe("beforeRender",createHeader);this.subscribe("beforeShow",setWidthToOffsetWidth);}else{if(this.dd){this.dd.unreg();}
+if(this.header){Dom.setStyle(this.header,"cursor","auto");}
+this.unsubscribe("beforeRender",createHeader);this.unsubscribe("beforeShow",setWidthToOffsetWidth);}},configUnderlay:function(type,args,obj){var UA=YAHOO.env.ua,bMacGecko=(this.platform=="mac"&&UA.gecko),sUnderlay=args[0].toLowerCase(),oUnderlay=this.underlay,oElement=this.element;function createUnderlay(){var nIE;if(!oUnderlay){if(!m_oUnderlayTemplate){m_oUnderlayTemplate=document.createElement("div");m_oUnderlayTemplate.className="underlay";}
+oUnderlay=m_oUnderlayTemplate.cloneNode(false);this.element.appendChild(oUnderlay);this.underlay=oUnderlay;nIE=UA.ie;if(nIE==6||(nIE==7&&document.compatMode=="BackCompat")){this.sizeUnderlay();this.cfg.subscribeToConfigEvent("width",this.sizeUnderlay);this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.subscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay,this,true);}}}
+function onBeforeShow(){createUnderlay.call(this);this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(onBeforeShow);}
+function destroyUnderlay(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(onBeforeShow);this._underlayDeferred=false;}
+if(oUnderlay){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(oUnderlay);this.underlay=null;}}
+switch(sUnderlay){case"shadow":Dom.removeClass(oElement,"matte");Dom.addClass(oElement,"shadow");break;case"matte":if(!bMacGecko){destroyUnderlay.call(this);}
+Dom.removeClass(oElement,"shadow");Dom.addClass(oElement,"matte");break;default:if(!bMacGecko){destroyUnderlay.call(this);}
+Dom.removeClass(oElement,"shadow");Dom.removeClass(oElement,"matte");break;}
+if((sUnderlay=="shadow")||(bMacGecko&&!oUnderlay)){if(this.cfg.getProperty("visible")){createUnderlay.call(this);}
+else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(onBeforeShow);this._underlayDeferred=true;}}}},configModal:function(type,args,obj){var modal=args[0];if(modal){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);Overlay.windowResizeEvent.subscribe(this.sizeMask,this,true);this._hasModalityEventListeners=true;}}else{if(this._hasModalityEventListeners){if(this.cfg.getProperty("visible")){this.hideMask();this.removeMask();}
+this.unsubscribe("beforeShow",this.buildMask);this.unsubscribe("beforeShow",this.bringToTop);this.unsubscribe("beforeShow",this.showMask);this.unsubscribe("hide",this.hideMask);Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var oMask=this.mask,oParentNode;if(oMask){this.hideMask();oParentNode=oMask.parentNode;if(oParentNode){oParentNode.removeChild(oMask);}
+this.mask=null;}},configKeyListeners:function(type,args,obj){var listeners=args[0],listener,nListeners,i;if(listeners){if(listeners instanceof Array){nListeners=listeners.length;for(i=0;i<nListeners;i++){listener=listeners[i];if(!Config.alreadySubscribed(this.showEvent,listener.enable,listener)){this.showEvent.subscribe(listener.enable,listener,true);}
+if(!Config.alreadySubscribed(this.hideEvent,listener.disable,listener)){this.hideEvent.subscribe(listener.disable,listener,true);this.destroyEvent.subscribe(listener.disable,listener,true);}}}else{if(!Config.alreadySubscribed(this.showEvent,listeners.enable,listeners)){this.showEvent.subscribe(listeners.enable,listeners,true);}
+if(!Config.alreadySubscribed(this.hideEvent,listeners.disable,listeners)){this.hideEvent.subscribe(listeners.disable,listeners,true);this.destroyEvent.subscribe(listeners.disable,listeners,true);}}}},configHeight:function(type,args,obj){var height=args[0],el=this.innerElement;Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");},configWidth:function(type,args,obj){var width=args[0],el=this.innerElement;Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");},configzIndex:function(type,args,obj){Panel.superclass.configzIndex.call(this,type,args,obj);var maskZ=0,currentZ=Dom.getStyle(this.element,"zIndex");if(this.mask){if(!currentZ||isNaN(currentZ)){currentZ=0;}
+if(currentZ===0){this.cfg.setProperty("zIndex",1);}else{maskZ=currentZ-1;Dom.setStyle(this.mask,"zIndex",maskZ);}}},buildWrapper:function(){var elementParent=this.element.parentNode,originalElement=this.element,wrapper=document.createElement("div");wrapper.className=Panel.CSS_PANEL_CONTAINER;wrapper.id=originalElement.id+"_c";if(elementParent){elementParent.insertBefore(wrapper,originalElement);}
+wrapper.appendChild(originalElement);this.element=wrapper;this.innerElement=originalElement;Dom.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var oUnderlay=this.underlay,oElement;if(oUnderlay){oElement=this.element;oUnderlay.style.width=oElement.offsetWidth+"px";oUnderlay.style.height=oElement.offsetHeight+"px";}},registerDragDrop:function(){var me=this;if(this.header){if(!DD){return;}
+this.dd=new DD(this.element.id,this.id);if(!this.header.id){this.header.id=this.id+"_h";}
+this.dd.startDrag=function(){var offsetHeight,offsetWidth,viewPortWidth,viewPortHeight,scrollX,scrollY,topConstraint,leftConstraint,bottomConstraint,rightConstraint;if(YAHOO.env.ua.ie==6){Dom.addClass(me.element,"drag");}
+if(me.cfg.getProperty("constraintoviewport")){offsetHeight=me.element.offsetHeight;offsetWidth=me.element.offsetWidth;viewPortWidth=Dom.getViewportWidth();viewPortHeight=Dom.getViewportHeight();scrollX=Dom.getDocumentScrollLeft();scrollY=Dom.getDocumentScrollTop();topConstraint=scrollY+10;leftConstraint=scrollX+10;bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;rightConstraint=scrollX+viewPortWidth-offsetWidth-10;this.minX=leftConstraint;this.maxX=rightConstraint;this.constrainX=true;this.minY=topConstraint;this.maxY=bottomConstraint;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}
+me.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}
+me.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){Dom.removeClass(me.element,"drag");}
+me.dragEvent.fire("endDrag",arguments);me.moveEvent.fire(me.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var oMask=this.mask;if(!oMask){if(!m_oMaskTemplate){m_oMaskTemplate=document.createElement("div");m_oMaskTemplate.className="mask";m_oMaskTemplate.innerHTML="&#160;";}
+oMask=m_oMaskTemplate.cloneNode(true);oMask.id=this.id+"_mask";document.body.insertBefore(oMask,document.body.firstChild);this.mask=oMask;}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();Dom.removeClass(document.body,"masked");}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){Dom.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){this.mask.style.height=Dom.getDocumentHeight()+"px";this.mask.style.width=Dom.getDocumentWidth()+"px";}},render:function(appendToNode){return Panel.superclass.render.call(this,appendToNode,this.innerElement);},destroy:function(){Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){Event.purgeElement(this.close);}
+Panel.superclass.destroy.call(this);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);};var Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Dom=YAHOO.util.Dom,KeyListener=YAHOO.util.KeyListener,Connect=YAHOO.util.Connect,Dialog=YAHOO.widget.Dialog,Lang=YAHOO.lang,EVENT_TYPES={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},DEFAULT_CONFIG={"POST_METHOD":{key:"postmethod",value:"async"},"BUTTONS":{key:"buttons",value:"none"}};Dialog.CSS_DIALOG="yui-dialog";function removeButtonEventHandlers(){var aButtons=this._aButtons,nButtons,oButton,i;if(Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){i=nButtons-1;do{oButton=aButtons[i];if(oButton instanceof YAHOO.widget.Button){oButton.destroy();}
+else if(oButton.tagName.toUpperCase()=="BUTTON"){Event.purgeElement(oButton);Event.purgeElement(oButton,false);}}
+while(i--);}}}
+YAHOO.extend(Dialog,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(DEFAULT_CONFIG.POST_METHOD.key,{handler:this.configPostMethod,value:DEFAULT_CONFIG.POST_METHOD.value,validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty(DEFAULT_CONFIG.BUTTONS.key,{handler:this.configButtons,value:DEFAULT_CONFIG.BUTTONS.value});},initEvents:function(){Dialog.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.beforeSubmitEvent=this.createEvent(EVENT_TYPES.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=SIGNATURE;this.submitEvent=this.createEvent(EVENT_TYPES.SUBMIT);this.submitEvent.signature=SIGNATURE;this.manualSubmitEvent=this.createEvent(EVENT_TYPES.MANUAL_SUBMIT);this.manualSubmitEvent.signature=SIGNATURE;this.asyncSubmitEvent=this.createEvent(EVENT_TYPES.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=SIGNATURE;this.formSubmitEvent=this.createEvent(EVENT_TYPES.FORM_SUBMIT);this.formSubmitEvent.signature=SIGNATURE;this.cancelEvent=this.createEvent(EVENT_TYPES.CANCEL);this.cancelEvent.signature=SIGNATURE;},init:function(el,userConfig){Dialog.superclass.init.call(this,el);this.beforeInitEvent.fire(Dialog);Dom.addClass(this.element,Dialog.CSS_DIALOG);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}
+this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(Dialog);},doSubmit:function(){var oForm=this.form,bUseFileUpload=false,bUseSecureFileUpload=false,aElements,nElements,i,sMethod;switch(this.cfg.getProperty("postmethod")){case"async":aElements=oForm.elements;nElements=aElements.length;if(nElements>0){i=nElements-1;do{if(aElements[i].type=="file"){bUseFileUpload=true;break;}}
+while(i--);}
+if(bUseFileUpload&&YAHOO.env.ua.ie&&this.isSecure){bUseSecureFileUpload=true;}
+sMethod=(oForm.getAttribute("method")||"POST").toUpperCase();Connect.setForm(oForm,bUseFileUpload,bUseSecureFileUpload);Connect.asyncRequest(sMethod,oForm.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":oForm.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},registerForm:function(){var form=this.element.getElementsByTagName("form")[0],me=this,firstElement,lastElement;if(this.form){if(this.form==form&&Dom.isAncestor(this.element,this.form)){return;}
+else{Event.purgeElement(this.form);this.form=null;}}
+if(!form){form=document.createElement("form");form.name="frm_"+this.id;this.body.appendChild(form);}
+if(form){this.form=form;Event.on(form,"submit",function(e){Event.stopEvent(e);this.submit();this.form.blur();});this.firstFormElement=function(){var f,el,nElements=form.elements.length;for(f=0;f<nElements;f++){el=form.elements[f];if(el.focus&&!el.disabled&&el.type!="hidden"){return el;}}
+return null;}();this.lastFormElement=function(){var f,el,nElements=form.elements.length;for(f=nElements-1;f>=0;f--){el=form.elements[f];if(el.focus&&!el.disabled&&el.type!="hidden"){return el;}}
+return null;}();if(this.cfg.getProperty("modal")){firstElement=this.firstFormElement||this.firstButton;if(firstElement){this.preventBackTab=new KeyListener(firstElement,{shift:true,keys:9},{fn:me.focusLast,scope:me,correctScope:true});this.showEvent.subscribe(this.preventBackTab.enable,this.preventBackTab,true);this.hideEvent.subscribe(this.preventBackTab.disable,this.preventBackTab,true);}
+lastElement=this.lastButton||this.lastFormElement;if(lastElement){this.preventTabOut=new KeyListener(lastElement,{shift:false,keys:9},{fn:me.focusFirst,scope:me,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}}},configClose:function(type,args,obj){var val=args[0];function doCancel(e,obj){obj.cancel();}
+if(val){if(!this.close){this.close=document.createElement("div");Dom.addClass(this.close,"container-close");this.close.innerHTML="&#160;";this.innerElement.appendChild(this.close);Event.on(this.close,"click",doCancel,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}},configButtons:function(type,args,obj){var Button=YAHOO.widget.Button,aButtons=args[0],oInnerElement=this.innerElement,oButton,oButtonEl,oYUIButton,nButtons,oSpan,oFooter,i;removeButtonEventHandlers.call(this);this._aButtons=null;if(Lang.isArray(aButtons)){oSpan=document.createElement("span");oSpan.className="button-group";nButtons=aButtons.length;this._aButtons=[];for(i=0;i<nButtons;i++){oButton=aButtons[i];if(Button){oYUIButton=new Button({label:oButton.text,container:oSpan});oButtonEl=oYUIButton.get("element");if(oButton.isDefault){oYUIButton.addClass("default");this.defaultHtmlButton=oButtonEl;}
+if(Lang.isFunction(oButton.handler)){oYUIButton.set("onclick",{fn:oButton.handler,obj:this,scope:this});}
+else if(Lang.isObject(oButton.handler)&&Lang.isFunction(oButton.handler.fn)){oYUIButton.set("onclick",{fn:oButton.handler.fn,obj:((!Lang.isUndefined(oButton.handler.obj))?oButton.handler.obj:this),scope:(oButton.handler.scope||this)});}
+this._aButtons[this._aButtons.length]=oYUIButton;}
+else{oButtonEl=document.createElement("button");oButtonEl.setAttribute("type","button");if(oButton.isDefault){oButtonEl.className="default";this.defaultHtmlButton=oButtonEl;}
+oButtonEl.innerHTML=oButton.text;if(Lang.isFunction(oButton.handler)){Event.on(oButtonEl,"click",oButton.handler,this,true);}
+else if(Lang.isObject(oButton.handler)&&Lang.isFunction(oButton.handler.fn)){Event.on(oButtonEl,"click",oButton.handler.fn,((!Lang.isUndefined(oButton.handler.obj))?oButton.handler.obj:this),(oButton.handler.scope||this));}
+oSpan.appendChild(oButtonEl);this._aButtons[this._aButtons.length]=oButtonEl;}
+oButton.htmlButton=oButtonEl;if(i===0){this.firstButton=oButtonEl;}
+if(i==(nButtons-1)){this.lastButton=oButtonEl;}}
+this.setFooter(oSpan);oFooter=this.footer;if(Dom.inDocument(this.element)&&!Dom.isAncestor(oInnerElement,oFooter)){oInnerElement.appendChild(oFooter);}
+this.buttonSpan=oSpan;}else{oSpan=this.buttonSpan;oFooter=this.footer;if(oSpan&&oFooter){oFooter.removeChild(oSpan);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}
+this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");},getButtons:function(){var aButtons=this._aButtons;if(aButtons){return aButtons;}},focusFirst:function(type,args,obj){var oElement=this.firstFormElement,oEvent;if(args){oEvent=args[1];if(oEvent){Event.stopEvent(oEvent);}}
+if(oElement){try{oElement.focus();}
+catch(oException){}}else{this.focusDefaultButton();}},focusLast:function(type,args,obj){var aButtons=this.cfg.getProperty("buttons"),oElement=this.lastFormElement,oEvent;if(args){oEvent=args[1];if(oEvent){Event.stopEvent(oEvent);}}
+if(aButtons&&Lang.isArray(aButtons)){this.focusLastButton();}else{if(oElement){try{oElement.focus();}
+catch(oException){}}}},focusDefaultButton:function(){var oElement=this.defaultHtmlButton;if(oElement){try{oElement.focus();}
+catch(oException){}}},blurButtons:function(){var aButtons=this.cfg.getProperty("buttons"),nButtons,oButton,oElement,i;if(aButtons&&Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){i=(nButtons-1);do{oButton=aButtons[i];if(oButton){oElement=oButton.htmlButton;if(oElement){try{oElement.blur();}
+catch(oException){}}}}
+while(i--);}}},focusFirstButton:function(){var aButtons=this.cfg.getProperty("buttons"),oButton,oElement;if(aButtons&&Lang.isArray(aButtons)){oButton=aButtons[0];if(oButton){oElement=oButton.htmlButton;if(oElement){try{oElement.focus();}
+catch(oException){}}}}},focusLastButton:function(){var aButtons=this.cfg.getProperty("buttons"),nButtons,oButton,oElement;if(aButtons&&Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){oButton=aButtons[(nButtons-1)];if(oButton){oElement=oButton.htmlButton;if(oElement){try{oElement.focus();}
+catch(oException){}}}}}},configPostMethod:function(type,args,obj){var postmethod=args[0];this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var oForm=this.form,aElements,nTotalElements,oData,sName,oElement,nElements,sType,sTagName,aOptions,nOptions,aValues,oOption,sValue,oRadio,oCheckbox,i,n;function isFormElement(p_oElement){var sTag=p_oElement.tagName.toUpperCase();return((sTag=="INPUT"||sTag=="TEXTAREA"||sTag=="SELECT")&&p_oElement.name==sName);}
+if(oForm){aElements=oForm.elements;nTotalElements=aElements.length;oData={};for(i=0;i<nTotalElements;i++){sName=aElements[i].name;oElement=Dom.getElementsBy(isFormElement,"*",oForm);nElements=oElement.length;if(nElements>0){if(nElements==1){oElement=oElement[0];sType=oElement.type;sTagName=oElement.tagName.toUpperCase();switch(sTagName){case"INPUT":if(sType=="checkbox"){oData[sName]=oElement.checked;}
+else if(sType!="radio"){oData[sName]=oElement.value;}
+break;case"TEXTAREA":oData[sName]=oElement.value;break;case"SELECT":aOptions=oElement.options;nOptions=aOptions.length;aValues=[];for(n=0;n<nOptions;n++){oOption=aOptions[n];if(oOption.selected){sValue=oOption.value;if(!sValue||sValue===""){sValue=oOption.text;}
+aValues[aValues.length]=sValue;}}
+oData[sName]=aValues;break;}}
+else{sType=oElement[0].type;switch(sType){case"radio":for(n=0;n<nElements;n++){oRadio=oElement[n];if(oRadio.checked){oData[sName]=oRadio.value;break;}}
+break;case"checkbox":aValues=[];for(n=0;n<nElements;n++){oCheckbox=oElement[n];if(oCheckbox.checked){aValues[aValues.length]=oCheckbox.value;}}
+oData[sName]=aValues;break;}}}}}
+return oData;},destroy:function(){removeButtonEventHandlers.call(this);this._aButtons=null;var aForms=this.element.getElementsByTagName("form"),oForm;if(aForms.length>0){oForm=aForms[0];if(oForm){Event.purgeElement(oForm);this.body.removeChild(oForm);this.form=null;}}
+Dialog.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);};var Dom=YAHOO.util.Dom,SimpleDialog=YAHOO.widget.SimpleDialog,DEFAULT_CONFIG={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};SimpleDialog.ICON_BLOCK="blckicon";SimpleDialog.ICON_ALARM="alrticon";SimpleDialog.ICON_HELP="hlpicon";SimpleDialog.ICON_INFO="infoicon";SimpleDialog.ICON_WARN="warnicon";SimpleDialog.ICON_TIP="tipicon";SimpleDialog.ICON_CSS_CLASSNAME="yui-icon";SimpleDialog.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(SimpleDialog,YAHOO.widget.Dialog,{initDefaultConfig:function(){SimpleDialog.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.ICON.key,{handler:this.configIcon,value:DEFAULT_CONFIG.ICON.value,suppressEvent:DEFAULT_CONFIG.ICON.suppressEvent});this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key,{handler:this.configText,value:DEFAULT_CONFIG.TEXT.value,suppressEvent:DEFAULT_CONFIG.TEXT.suppressEvent,supercedes:DEFAULT_CONFIG.TEXT.supercedes});},init:function(el,userConfig){SimpleDialog.superclass.init.call(this,el);this.beforeInitEvent.fire(SimpleDialog);Dom.addClass(this.element,SimpleDialog.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(userConfig){this.cfg.applyConfig(userConfig,true);}
+this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(SimpleDialog);},registerForm:function(){SimpleDialog.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+
+this.id+"\" value=\"\"/>";},configIcon:function(type,args,obj){var sIcon=args[0],oBody=this.body,sCSSClass=SimpleDialog.ICON_CSS_CLASSNAME,oIcon,oIconParent;if(sIcon&&sIcon!="none"){oIcon=Dom.getElementsByClassName(sCSSClass,"*",oBody);if(oIcon){oIconParent=oIcon.parentNode;if(oIconParent){oIconParent.removeChild(oIcon);oIcon=null;}}
+if(sIcon.indexOf(".")==-1){oIcon=document.createElement("span");oIcon.className=(sCSSClass+" "+sIcon);oIcon.innerHTML="&#160;";}else{oIcon=document.createElement("img");oIcon.src=(this.imageRoot+sIcon);oIcon.className=sCSSClass;}
+if(oIcon){oBody.insertBefore(oIcon,oBody.firstChild);}}},configText:function(type,args,obj){var text=args[0];if(text){this.setBody(text);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
+this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};var Dom=YAHOO.util.Dom,CustomEvent=YAHOO.util.CustomEvent,Easing=YAHOO.util.Easing,ContainerEffect=YAHOO.widget.ContainerEffect;ContainerEffect.FADE=function(overlay,dur){var fade=new ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
+if(obj.overlay.underlay){obj.initialUnderlayOpacity=Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}
+Dom.setStyle(obj.overlay.element,"visibility","visible");Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
+if(obj.overlay.underlay){Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
+obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}};fade.handleCompleteAnimateOut=function(type,args,obj){Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
+Dom.setStyle(obj.overlay.element,"visibility","hidden");Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||Dom.getX(overlay.element),y=overlay.cfg.getProperty("y")||Dom.getY(overlay.element),clientWidth=Dom.getClientWidth(),offsetWidth=overlay.element.offsetWidth,slide=new ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=((-25)-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";};slide.handleTweenAnimateIn=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),currentX=pos[0],currentY=pos[1];if(Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){Dom.setStyle(obj.overlay.element,"visibility","visible");}
+obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};slide.handleStartAnimateOut=function(type,args,obj){var vw=Dom.getViewportWidth(),pos=Dom.getXY(obj.overlay.element),yso=pos[1],currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),xto=pos[0],yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){Dom.setStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};ContainerEffect.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=CustomEvent.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=CustomEvent.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=CustomEvent.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=CustomEvent.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(type,args,obj){},handleTweenAnimateIn:function(type,args,obj){},handleCompleteAnimateIn:function(type,args,obj){},handleStartAnimateOut:function(type,args,obj){},handleTweenAnimateOut:function(type,args,obj){},handleCompleteAnimateOut:function(type,args,obj){},toString:function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
+return output;}};YAHOO.lang.augmentProto(ContainerEffect,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.3.0",build:"442"});
\ No newline at end of file
index fde8bab87505c2d4f1a6bac8dfd7aa14a7df749b..10b1a692de4eab146d265a8d5e54e164eb96edc0 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
-*/
-/**
-* 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.
-* @namespace YAHOO.util
-* @class Config
-* @constructor
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config = function(owner) {
-       if (owner) {
-               this.init(owner);
-       }
-};
-
-YAHOO.util.Config.prototype = {
-       
-       /**
-       * Object reference to the owner of this Config Object
-       * @property owner
-       * @type Object
-       */
-       owner : null,
-
-       /**
-       * Boolean flag that specifies whether a queue is currently being executed
-       * @property queueInProgress
-       * @type Boolean
-       */
-       queueInProgress : false,
-
-
-       /**
-       * Validates that the value passed in is a Boolean.
-       * @method checkBoolean
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */      
-       checkBoolean: function(val) {
-               if (typeof val == 'boolean') {
-                       return true;
-               } else {
-                       return false;
-               }
-       },
-
-       /**
-       * Validates that the value passed in is a number.
-       * @method checkNumber
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */
-       checkNumber: function(val) {
-               if (isNaN(val)) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-};
-
-
-/**
-* Initializes the configuration Object and all of its local members.
-* @method init
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config.prototype.init = function(owner) {
-
-       this.owner = owner;
-
-       /**
-       * Object reference to the owner of this Config Object
-       * @event configChangedEvent
-       */
-       this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");
-
-       this.queueInProgress = false;
-
-       /* Private Members */
-
-       /**
-       * Maintains the local collection of configuration property objects and their specified values
-       * @property config
-       * @private
-       * @type Object
-       */ 
-       var config = {};
-
-       /**
-       * Maintains the local collection of configuration property objects as they were initially applied.
-       * This object is used when resetting a property.
-       * @property initialConfig
-       * @private
-       * @type Object
-       */ 
-       var initialConfig = {};
-
-       /**
-       * Maintains the local, normalized CustomEvent queue
-       * @property eventQueue
-       * @private
-       * @type Object
-       */ 
-       var eventQueue = [];
-
-       /**
-       * Fires a configuration property event using the specified value. 
-       * @method fireEvent
-       * @private
-       * @param {String}       key                     The configuration property's name
-       * @param {value}        Object          The value of the correct type for the property
-       */ 
-       var fireEvent = function( key, value ) {
-               key = key.toLowerCase();
-
-               var property = config[key];
-
-               if (typeof property != 'undefined' && property.event) {
-                       property.event.fire(value);
-               }       
-       };
-       /* End Private Members */
-
-       /**
-       * Adds a property to the Config Object's private config hash.
-       * @method addProperty
-       * @param {String}       key     The configuration property's name
-       * @param {Object}       propertyObject  The Object containing all of this property's arguments
-       */
-       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);
-               }
-
-               this.setProperty(key, propertyObject.value, true);
-               
-               if (! propertyObject.suppressEvent) {
-                       this.queueProperty(key, propertyObject.value);
-               }
-       };
-
-       /**
-       * Returns a key-value configuration map of the values currently set in the Config Object.
-       * @method getConfig
-       * @return {Object} The current config, represented in a key-value map
-       */
-       this.getConfig = function() {
-               var cfg = {};
-                       
-               for (var prop in config) {
-                       var property = config[prop];
-                       if (typeof property != 'undefined' && property.event) {
-                               cfg[prop] = property.value;
-                       }
-               }
-               
-               return cfg;
-       };
-
-       /**
-       * Returns the value of specified property.
-       * @method getProperty
-       * @param {String} key   The name of the property
-       * @return {Object}              The value of the specified property
-       */
-       this.getProperty = function(key) {
-               key = key.toLowerCase();
-
-               var property = config[key];
-               if (typeof property != 'undefined' && property.event) {
-                       return property.value;
-               } else {
-                       return undefined;
-               }
-       };
-
-       /**
-       * Resets the specified property's value to its initial value.
-       * @method resetProperty
-       * @param {String} key   The name of the property
-       * @return {Boolean} True is the property was reset, false if not
-       */
-       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]);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.
-       * @method setProperty
-       * @param {String} key           The name of the property
-       * @param {String} value         The value to set the property to
-       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.
-       * @return {Boolean}                     True, if the set was successful, false if it failed.
-       */
-       this.setProperty = function(key, value, silent) {
-               key = key.toLowerCase();
-
-               if (this.queueInProgress && ! silent) {
-                       this.queueProperty(key,value); // Currently running through a queue... 
-                       return true;
-               } else {
-                       var property = config[key];
-                       if (typeof property != 'undefined' && property.event) {
-                               if (property.validator && ! property.validator(value)) { // validator
-                                       return false;
-                               } else {
-                                       property.value = value;
-                                       if (! silent) {
-                                               fireEvent(key, value);
-                                               this.configChangedEvent.fire([key, value]);
-                                       }
-                                       return true;
-                               }
-                       } else {
-                               return false;
-                       }
-               }
-       };
-
-       /**
-       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is
-       * moved from its current position to the end of the queue.
-       * @method queueProperty
-       * @param {String} key   The name of the property
-       * @param {String} value The value to set the property to
-       * @return {Boolean}             true, if the set was successful, false if it failed.
-       */      
-       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)) { // validator
-                               return false;
-                       } else {
-
-                               if (typeof value != 'undefined') {
-                                       property.value = value;
-                               } else {
-                                       value = property.value;
-                               }
-
-                               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) {
-                                                       // found a dupe... push to end of queue, null current item, and break
-                                                       eventQueue[i] = null;
-                                                       eventQueue.push([key, (typeof value != 'undefined' ? value : queueItemValue)]);
-                                                       foundDuplicate = true;
-                                                       break;
-                                               }
-                                       }
-                               }
-                               
-                               if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue
-                                       eventQueue.push([key, value]);
-                               }
-                       }
-
-                       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;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Fires the event for a property using the property's current value.
-       * @method refireEvent
-       * @param {String} key   The name of the property
-       */
-       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);
-                       }
-               }
-       };
-
-       /**
-       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.
-       * Although the values will be set, fireQueue() must be called for their associated events to execute.
-       * @method applyConfig
-       * @param {Object}       userConfig      The configuration Object literal
-       * @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.
-       */
-       this.applyConfig = function(userConfig, init) {
-               if (init) {
-                       initialConfig = userConfig;
-               }
-               for (var prop in userConfig) {
-                       this.queueProperty(prop, userConfig[prop]);
-               }
-       };
-
-       /**
-       * Refires the events for all configuration properties using their current values.
-       * @method refresh
-       */
-       this.refresh = function() {
-               for (var prop in config) {
-                       this.refireEvent(prop);
-               }
-       };
-
-       /**
-       * Fires the normalized list of queued property change events
-       * @method fireQueue
-       */
-       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);
-                       }
-               }
-               
-               this.queueInProgress = false;
-               eventQueue = [];
-       };
-
-       /**
-       * Subscribes an external handler to the change event for any given property. 
-       * @method subscribeToConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.
-       * @return {Boolean}                             True, if the subscription was successful, otherwise false.
-       */      
-       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);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Unsubscribes an external handler from the change event for any given property. 
-       * @method unsubscribeFromConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @return {Boolean}                             True, if the unsubscription was successful, otherwise 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;
-               }
-       };
-
-       /**
-       * Returns a string representation of the Config object
-       * @method toString
-       * @return {String}      The Config object in string format.
-       */
-       this.toString = function() {
-               var output = "Config";
-               if (this.owner) {
-                       output += " [" + this.owner.toString() + "]";
-               }
-               return output;
-       };
-
-       /**
-       * Returns a string representation of the Config object's current CustomEvent queue
-       * @method outputEventQueue
-       * @return {String}      The string list of CustomEvents currently queued for execution
-       */
-       this.outputEventQueue = function() {
-               var output = "";
-               for (var q=0;q<eventQueue.length;q++) {
-                       var queueItem = eventQueue[q];
-                       if (queueItem) {
-                               output += queueItem[0] + "=" + queueItem[1] + ", ";
-                       }
-               }
-               return output;
-       };
-};
-
-/**
-* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent
-* @method YAHOO.util.Config.alreadySubscribed
-* @static
-* @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions
-* @param {Function}    fn      The function to look for in the subscribers list
-* @param {Object}      obj     The execution scope Object for the subscription
-* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in
-*/
-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;
-               }
-       }
-       return false;
-};
-
-/**
-*  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.
-* @module container
-* @title Container
-* @requires yahoo,dom,event,dragdrop,animation
-*/
+version: 2.3.0
+*/
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.util
+    * @class Config
+    * @constructor
+    * @param {Object} owner The owner Object to which this Config Object belongs
+    */
+    YAHOO.util.Config = function (owner) {
+    
+        if (owner) {
+    
+            this.init(owner);
+    
+        }
+    
+        if (!owner) { 
+        
+    
+        }
+    
+    };
 
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Module
-* @constructor
-* @param {String} el                   The element ID representing the Module <em>OR</em>
-* @param {HTMLElement} el              The element representing the Module
-* @param {Object} userConfig   The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
-*/
-YAHOO.widget.Module = function(el, userConfig) {
-       if (el) { 
-               this.init(el, userConfig); 
-       }
-};
-
-/**
-* Constant representing the prefix path to use for non-secure images
-* @property YAHOO.widget.Module.IMG_ROOT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.IMG_ROOT = "http://us.i1.yimg.com/us.yimg.com/i/";
-
-/**
-* Constant representing the prefix path to use for securely served images
-* @property YAHOO.widget.Module.IMG_ROOT_SSL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.IMG_ROOT_SSL = "https://a248.e.akamai.net/sec.yimg.com/i/";
-
-/**
-* Constant for the default CSS class name that represents a Module
-* @property YAHOO.widget.Module.CSS_MODULE
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_MODULE = "module";
-
-/**
-* Constant representing the module header
-* @property YAHOO.widget.Module.CSS_HEADER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_HEADER = "hd";
-
-/**
-* Constant representing the module body
-* @property YAHOO.widget.Module.CSS_BODY
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_BODY = "bd";
-
-/**
-* Constant representing the module footer
-* @property YAHOO.widget.Module.CSS_FOOTER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_FOOTER = "ft";
-
-/**
-* Constant representing the url for the "src" attribute of the iframe used to monitor changes to the browser's base font size
-* @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";
-
-/**
-* Singleton CustomEvent fired when the font size is changed in the browser.
-* Opera's "zoom" functionality currently does not support text size detection.
-* @event YAHOO.widget.Module.textResizeEvent
-*/     
-YAHOO.widget.Module.textResizeEvent = new YAHOO.util.CustomEvent("textResize");
-
-YAHOO.widget.Module.prototype = {
-       /**
-       * The class's constructor function
-       * @property contructor
-       * @type Function
-       */
-       constructor : YAHOO.widget.Module,
-
-       /**
-       * The main module element that contains the header, body, and footer
-       * @property element
-       * @type HTMLElement
-       */
-       element : null, 
-
-       /**
-       * The header element, denoted with CSS class "hd"
-       * @property header
-       * @type HTMLElement
-       */
-       header : null,
-
-       /**
-       * The body element, denoted with CSS class "bd"
-       * @property body
-       * @type HTMLElement
-       */
-       body : null,
-
-       /**
-       * The footer element, denoted with CSS class "ft"
-       * @property footer
-       * @type HTMLElement
-       */
-       footer : null,
-
-       /**
-       * The id of the element
-       * @property id
-       * @type String
-       */
-       id : null,
-
-       /**
-       * The String representing the image root
-       * @property imageRoot
-       * @type String
-       */
-       imageRoot : YAHOO.widget.Module.IMG_ROOT,
-               
-       /**
-       * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-       * @method initEvents
-       */
-       initEvents : function() {
-
-               /**
-               * CustomEvent fired prior to class initalization.
-               * @event beforeInitEvent
-               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
-               */
-               this.beforeInitEvent = new YAHOO.util.CustomEvent("beforeInit");
-
-               /**
-               * CustomEvent fired after class initalization.
-               * @event initEvent
-               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
-               */              
-               this.initEvent = new YAHOO.util.CustomEvent("init");
-
-               /**
-               * CustomEvent fired when the Module is appended to the DOM
-               * @event appendEvent
-               */
-               this.appendEvent = new YAHOO.util.CustomEvent("append");
-
-               /**
-               * CustomEvent fired before the Module is rendered
-               * @event beforeRenderEvent
-               */
-               this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");
-
-               /**
-               * CustomEvent fired after the Module is rendered
-               * @event renderEvent
-               */
-               this.renderEvent = new YAHOO.util.CustomEvent("render");
-       
-               /**
-               * CustomEvent fired when the header content of the Module is modified
-               * @event changeHeaderEvent
-               * @param {String/HTMLElement} content   String/element representing the new header content
-               */
-               this.changeHeaderEvent = new YAHOO.util.CustomEvent("changeHeader");
-               
-               /**
-               * CustomEvent fired when the body content of the Module is modified
-               * @event changeBodyEvent
-               * @param {String/HTMLElement} content   String/element representing the new body content
-               */              
-               this.changeBodyEvent = new YAHOO.util.CustomEvent("changeBody");
-               
-               /**
-               * CustomEvent fired when the footer content of the Module is modified
-               * @event changeFooterEvent
-               * @param {String/HTMLElement} content   String/element representing the new footer content
-               */
-               this.changeFooterEvent = new YAHOO.util.CustomEvent("changeFooter");
-
-               /**
-               * CustomEvent fired when the content of the Module is modified
-               * @event changeContentEvent
-               */
-               this.changeContentEvent = new YAHOO.util.CustomEvent("changeContent");
-
-               /**
-               * CustomEvent fired when the Module is destroyed
-               * @event destroyEvent
-               */
-               this.destroyEvent = new YAHOO.util.CustomEvent("destroy");
-               
-               /**
-               * CustomEvent fired before the Module is shown
-               * @event beforeShowEvent
-               */
-               this.beforeShowEvent = new YAHOO.util.CustomEvent("beforeShow");
-
-               /**
-               * CustomEvent fired after the Module is shown
-               * @event showEvent
-               */
-               this.showEvent = new YAHOO.util.CustomEvent("show");
-
-               /**
-               * CustomEvent fired before the Module is hidden
-               * @event beforeHideEvent
-               */
-               this.beforeHideEvent = new YAHOO.util.CustomEvent("beforeHide");
-
-               /**
-               * CustomEvent fired after the Module is hidden
-               * @event hideEvent
-               */
-               this.hideEvent = new YAHOO.util.CustomEvent("hide");
-       }, 
-
-       /**
-       * String representing the current user-agent platform
-       * @property platform
-       * @type String
-       */
-       platform : function() {
-                                       var ua = navigator.userAgent.toLowerCase();
-                                       if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
-                                               return "windows";
-                                       } else if (ua.indexOf("macintosh") != -1) {
-                                               return "mac";
-                                       } else {
-                                               return false;
-                                       }
-                               }(),
-
-       /**
-       * String representing the current user-agent browser
-       * @property browser
-       * @type String
-       */
-       browser : function() {
-                       var ua = navigator.userAgent.toLowerCase();
-                                 if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
-                                        return 'opera';
-                                 } else if (ua.indexOf('msie 7')!=-1) { // IE7
-                                        return 'ie7';
-                                 } else if (ua.indexOf('msie') !=-1) { // IE
-                                        return 'ie';
-                                 } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
-                                        return 'safari';
-                                 } else if (ua.indexOf('gecko') != -1) { // Gecko
-                                        return 'gecko';
-                                 } else {
-                                        return false;
-                                 }
-                       }(),
-
-       /**
-       * Boolean representing whether or not the current browsing context is secure (https)
-       * @property isSecure
-       * @type Boolean
-       */
-       isSecure : function() {
-               if (window.location.href.toLowerCase().indexOf("https") === 0) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }(),
-
-       /**
-       * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-       */
-       initDefaultConfig : function() {
-               // Add properties //
-               
-               /**
-               * Specifies whether the Module is visible on the page.
-               * @config visible
-               * @type Boolean
-               * @default true
-               */
-               this.cfg.addProperty("visible", { value:true, handler:this.configVisible, validator:this.cfg.checkBoolean } );
-               
-               /**
-               * Object or array of objects representing the ContainerEffect classes that are active for animating the container.
-               * @config effect
-               * @type Object
-               * @default null
-               */
-               this.cfg.addProperty("effect", { suppressEvent:true, supercedes:["visible"] } );
-               
-               /**
-               * Specifies whether to create a special proxy iframe to monitor for user font resizing in the document
-               * @config monitorresize
-               * @type Boolean
-               * @default true
-               */
-               this.cfg.addProperty("monitorresize", { value:true, handler:this.configMonitorResize } );
-       },
-
-       /**
-       * 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.
-       * @method init
-       * @param {String}       el      The element ID representing the Module <em>OR</em>
-       * @param {HTMLElement}  el      The element representing the Module
-       * @param {Object}       userConfig      The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
-       */
-       init : function(el, userConfig) {
-
-               this.initEvents();
-
-               this.beforeInitEvent.fire(YAHOO.widget.Module);
-
-               /**
-               * The Module's Config object used for monitoring configuration properties.
-               * @property cfg
-               * @type YAHOO.util.Config
-               */
-               this.cfg = new YAHOO.util.Config(this);
-               
-               if (this.isSecure) {
-                       this.imageRoot = YAHOO.widget.Module.IMG_ROOT_SSL;
-               }
-
-               if (typeof el == "string") {
-                       var elId = el;
-
-                       el = document.getElementById(el);
-                       if (! el) {
-                               el = document.createElement("DIV");
-                               el.id = elId;
-                       }
-               }
-
-               this.element = el;
-               
-               if (el.id) {
-                       this.id = el.id;
-               } 
-
-               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;
-                               }
-                       }
-               }
-
-               this.initDefaultConfig();
-
-               YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Module.CSS_MODULE);
-
-               if (userConfig) {
-                       this.cfg.applyConfig(userConfig, true);
-               }
-
-               // Subscribe to the fireQueue() method of Config so that any queued configuration changes are
-               // excecuted upon render of the Module
-               if (! YAHOO.util.Config.alreadySubscribed(this.renderEvent, this.cfg.fireQueue, this.cfg)) {
-                       this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
-               }
-
-               this.initEvent.fire(YAHOO.widget.Module);
-       },
-
-       /**
-       * Initialized an empty IFRAME that is placed out of the visible area that can be used to detect text resize.
-       * @method initResizeMonitor
-       */
-       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;
-    
-                }                
-
-                resizeMonitor.id = "_yuiResizeMonitor";
-                resizeMonitor.style.visibility = "hidden";
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,        
+        Config = YAHOO.util.Config;
+    
+
+    /**
+     * Constant representing the CustomEvent type for the config changed event.
+     * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT
+     * @private
+     * @static
+     * @final
+     */
+    Config.CONFIG_CHANGED_EVENT = "configChanged";
+    
+    /**
+     * Constant representing the boolean type string
+     * @property YAHOO.util.Config.BOOLEAN_TYPE
+     * @private
+     * @static
+     * @final
+     */
+    Config.BOOLEAN_TYPE = "boolean";
+    
+    Config.prototype = {
+     
+        /**
+        * Object reference to the owner of this Config Object
+        * @property owner
+        * @type Object
+        */
+        owner: null,
+        
+        /**
+        * Boolean flag that specifies whether a queue is currently 
+        * being executed
+        * @property queueInProgress
+        * @type Boolean
+        */
+        queueInProgress: false,
+        
+        /**
+        * Maintains the local collection of configuration property objects and 
+        * their specified values
+        * @property config
+        * @private
+        * @type Object
+        */ 
+        config: null,
+        
+        /**
+        * Maintains the local collection of configuration property objects as 
+        * they were initially applied.
+        * This object is used when resetting a property.
+        * @property initialConfig
+        * @private
+        * @type Object
+        */ 
+        initialConfig: null,
+        
+        /**
+        * Maintains the local, normalized CustomEvent queue
+        * @property eventQueue
+        * @private
+        * @type Object
+        */ 
+        eventQueue: null,
+        
+        /**
+        * Custom Event, notifying subscribers when Config properties are set 
+        * (setProperty is called without the silent flag
+        * @event configChangedEvent
+        */
+        configChangedEvent: null,
+    
+        /**
+        * Initializes the configuration Object and all of its local members.
+        * @method init
+        * @param {Object} owner The owner Object to which this Config 
+        * Object belongs
+        */
+        init: function (owner) {
+    
+            this.owner = owner;
+    
+            this.configChangedEvent = 
+                this.createEvent(Config.CONFIG_CHANGED_EVENT);
+    
+            this.configChangedEvent.signature = CustomEvent.LIST;
+            this.queueInProgress = false;
+            this.config = {};
+            this.initialConfig = {};
+            this.eventQueue = [];
+        
+        },
+        
+        /**
+        * Validates that the value passed in is a Boolean.
+        * @method checkBoolean
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */ 
+        checkBoolean: function (val) {
+            return (typeof val == Config.BOOLEAN_TYPE);
+        },
+        
+        /**
+        * Validates that the value passed in is a number.
+        * @method checkNumber
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */
+        checkNumber: function (val) {
+            return (!isNaN(val));
+        },
+        
+        /**
+        * Fires a configuration property event using the specified value. 
+        * @method fireEvent
+        * @private
+        * @param {String} key The configuration property's name
+        * @param {value} Object The value of the correct type for the property
+        */ 
+        fireEvent: function ( key, value ) {
+            var property = this.config[key];
+        
+            if (property && property.event) {
+                property.event.fire(value);
+            } 
+        },
+        
+        /**
+        * Adds a property to the Config Object's private config hash.
+        * @method addProperty
+        * @param {String} key The configuration property's name
+        * @param {Object} propertyObject The Object containing all of this 
+        * property's arguments
+        */
+        addProperty: function ( key, propertyObject ) {
+            key = key.toLowerCase();
+        
+            this.config[key] = propertyObject;
+        
+            propertyObject.event = this.createEvent(key, { scope: this.owner });
+            propertyObject.event.signature = CustomEvent.LIST;
+            
+            
+            propertyObject.key = key;
+        
+            if (propertyObject.handler) {
+                propertyObject.event.subscribe(propertyObject.handler, 
+                    this.owner);
+            }
+        
+            this.setProperty(key, propertyObject.value, true);
+            
+            if (! propertyObject.suppressEvent) {
+                this.queueProperty(key, propertyObject.value);
+            }
+            
+        },
+        
+        /**
+        * Returns a key-value configuration map of the values currently set in  
+        * the Config Object.
+        * @method getConfig
+        * @return {Object} The current config, represented in a key-value map
+        */
+        getConfig: function () {
+        
+            var cfg = {},
+                prop,
+                property;
                 
-                document.body.appendChild(resizeMonitor);
+            for (prop in this.config) {
+                property = this.config[prop];
+                if (property && property.event) {
+                    cfg[prop] = property.value;
+                }
+            }
+            
+            return cfg;
+        },
+        
+        /**
+        * Returns the value of specified property.
+        * @method getProperty
+        * @param {String} key The name of the property
+        * @return {Object}  The value of the specified property
+        */
+        getProperty: function (key) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.value;
+            } else {
+                return undefined;
+            }
+        },
+        
+        /**
+        * Resets the specified property's value to its initial value.
+        * @method resetProperty
+        * @param {String} key The name of the property
+        * @return {Boolean} True is the property was reset, false if not
+        */
+        resetProperty: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event) {
+    
+                if (this.initialConfig[key] && 
+                    !Lang.isUndefined(this.initialConfig[key])) {
+    
+                    this.setProperty(key, this.initialConfig[key]);
+
+                    return true;
+    
+                }
+    
+            } else {
     
-                resizeMonitor.style.width = "10em";
-                resizeMonitor.style.height = "10em";
-                resizeMonitor.style.position = "absolute";
+                return false;
+            }
+    
+        },
+        
+        /**
+        * Sets the value of a property. If the silent property is passed as 
+        * true, the property's event will not be fired.
+        * @method setProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @param {Boolean} silent Whether the value should be set silently, 
+        * without firing the property event.
+        * @return {Boolean} True, if the set was successful, false if it failed.
+        */
+        setProperty: function (key, value, silent) {
+        
+            var property;
+        
+            key = key.toLowerCase();
+        
+            if (this.queueInProgress && ! silent) {
+                // Currently running through a queue... 
+                this.queueProperty(key,value);
+                return true;
+    
+            } else {
+                property = this.config[key];
+                if (property && property.event) {
+                    if (property.validator && !property.validator(value)) {
+                        return false;
+                    } else {
+                        property.value = value;
+                        if (! silent) {
+                            this.fireEvent(key, value);
+                            this.configChangedEvent.fire([key, value]);
+                        }
+                        return true;
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        
+        /**
+        * Sets the value of a property and queues its event to execute. If the 
+        * event is already scheduled to execute, it is
+        * moved from its current position to the end of the queue.
+        * @method queueProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @return {Boolean}  true, if the set was successful, false if 
+        * it failed.
+        */ 
+        queueProperty: function (key, value) {
+        
+            key = key.toLowerCase();
+        
+            var property = this.config[key],
+                foundDuplicate = false,
+                iLen,
+                queueItem,
+                queueItemKey,
+                queueItemValue,
+                sLen,
+                supercedesCheck,
+                qLen,
+                queueItemCheck,
+                queueItemCheckKey,
+                queueItemCheckValue,
+                i,
+                s,
+                q;
+                                
+            if (property && property.event) {
+    
+                if (!Lang.isUndefined(value) && property.validator && 
+                    !property.validator(value)) { // validator
+                    return false;
+                } else {
+        
+                    if (!Lang.isUndefined(value)) {
+                        property.value = value;
+                    } else {
+                        value = property.value;
+                    }
+        
+                    foundDuplicate = false;
+                    iLen = this.eventQueue.length;
+        
+                    for (i = 0; i < iLen; i++) {
+                        queueItem = this.eventQueue[i];
+        
+                        if (queueItem) {
+                            queueItemKey = queueItem[0];
+                            queueItemValue = queueItem[1];
+                            
+                            if (queueItemKey == key) {
+    
+                                /*
+                                    found a dupe... push to end of queue, null 
+                                    current item, and break
+                                */
+    
+                                this.eventQueue[i] = null;
+    
+                                this.eventQueue.push(
+                                    [key, (!Lang.isUndefined(value) ? 
+                                    value : queueItemValue)]);
+    
+                                foundDuplicate = true;
+                                break;
+                            }
+                        }
+                    }
+                    
+                    // this is a refire, or a new property in the queue
+    
+                    if (! foundDuplicate && !Lang.isUndefined(value)) { 
+                        this.eventQueue.push([key, value]);
+                    }
+                }
+        
+                if (property.supercedes) {
+        
+                    sLen = property.supercedes.length;
+        
+                    for (s = 0; s < sLen; s++) {
+        
+                        supercedesCheck = property.supercedes[s];
+                        qLen = this.eventQueue.length;
+        
+                        for (q = 0; q < qLen; q++) {
+                            queueItemCheck = this.eventQueue[q];
+        
+                            if (queueItemCheck) {
+                                queueItemCheckKey = queueItemCheck[0];
+                                queueItemCheckValue = queueItemCheck[1];
+                                
+                                if (queueItemCheckKey == 
+                                    supercedesCheck.toLowerCase() ) {
+    
+                                    this.eventQueue.push([queueItemCheckKey, 
+                                        queueItemCheckValue]);
+    
+                                    this.eventQueue[q] = null;
+                                    break;
+    
+                                }
+                            }
+                        }
+                    }
+                }
+
+        
+                return true;
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Fires the event for a property using the property's current value.
+        * @method refireEvent
+        * @param {String} key The name of the property
+        */
+        refireEvent: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event && 
+    
+                !Lang.isUndefined(property.value)) {
+    
+                if (this.queueInProgress) {
+    
+                    this.queueProperty(key);
+    
+                } else {
+    
+                    this.fireEvent(key, property.value);
+    
+                }
+    
+            }
+        },
+        
+        /**
+        * Applies a key-value Object literal to the configuration, replacing  
+        * any existing values, and queueing the property events.
+        * Although the values will be set, fireQueue() must be called for their 
+        * associated events to execute.
+        * @method applyConfig
+        * @param {Object} userConfig The configuration Object literal
+        * @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.
+        */
+        applyConfig: function (userConfig, init) {
+        
+            var sKey,
+                oValue,
+                oConfig;
+
+            if (init) {
+
+                oConfig = {};
+
+                for (sKey in userConfig) {
+                
+                    if (Lang.hasOwnProperty(userConfig, sKey)) {
+
+                        oConfig[sKey.toLowerCase()] = userConfig[sKey];
+
+                    }
                 
-                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");
+                }
+
+                this.initialConfig = oConfig;
+
+            }
+
+            for (sKey in userConfig) {
+            
+                if (Lang.hasOwnProperty(userConfig, sKey)) {
+            
+                    this.queueProperty(sKey, userConfig[sKey]);
                 
-                resizeMonitor.style.visibility = "visible";
+                }
+
+            }
+
+        },
+        
+        /**
+        * Refires the events for all configuration properties using their 
+        * current values.
+        * @method refresh
+        */
+        refresh: function () {
+        
+            var prop;
+        
+            for (prop in this.config) {
+                this.refireEvent(prop);
+            }
+        },
+        
+        /**
+        * Fires the normalized list of queued property change events
+        * @method fireQueue
+        */
+        fireQueue: function () {
+        
+            var i, 
+                queueItem,
+                key,
+                value,
+                property;
+        
+            this.queueInProgress = true;
+            for (i = 0;i < this.eventQueue.length; i++) {
+                queueItem = this.eventQueue[i];
+                if (queueItem) {
+        
+                    key = queueItem[0];
+                    value = queueItem[1];
+                    property = this.config[key];
+        
+                    property.value = value;
+        
+                    this.fireEvent(key,value);
+                }
+            }
+            
+            this.queueInProgress = false;
+            this.eventQueue = [];
+        },
+        
+        /**
+        * Subscribes an external handler to the change event for any 
+        * given property. 
+        * @method subscribeToConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event handler 
+        * (see CustomEvent documentation)
+        * @param {Boolean} override Optional. If true, will override "this"  
+        * within the handler to map to the scope Object passed into the method.
+        * @return {Boolean} True, if the subscription was successful, 
+        * otherwise false.
+        */ 
+        subscribeToConfigEvent: function (key, handler, obj, override) {
     
-                if(!bIE) {
+            var property = this.config[key.toLowerCase()];
     
-                    var doc = resizeMonitor.contentWindow.document;
+            if (property && property.event) {
+    
+                if (!Config.alreadySubscribed(property.event, handler, obj)) {
+    
+                    property.event.subscribe(handler, obj, override);
     
-                    doc.open();
-                    doc.close();
-                
                 }
+    
+                return true;
+    
+            } else {
+    
+                return false;
+    
             }
     
-                       var fireTextResize = function() {
-                               YAHOO.widget.Module.textResizeEvent.fire();
-                       };
-
-            if(resizeMonitor && resizeMonitor.contentWindow) {
-                this.resizeMonitor = resizeMonitor;
-                               
-                               YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize, this, true);
-                               
-                               if (! YAHOO.widget.Module.textResizeInitialized) {
-                                       if (! YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", fireTextResize)) {
-                                               // This will fail in IE if document.domain has changed, so we must change the listener to
-                                               // use the resizeMonitor element instead
-                                               YAHOO.util.Event.addListener(this.resizeMonitor, "resize", fireTextResize);
-                                       }
-                                       YAHOO.widget.Module.textResizeInitialized = true;
-                               }
+        },
+        
+        /**
+        * Unsubscribes an external handler from the change event for any 
+        * given property. 
+        * @method unsubscribeFromConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event 
+        * handler (see CustomEvent documentation)
+        * @return {Boolean} True, if the unsubscription was successful, 
+        * otherwise false.
+        */
+        unsubscribeFromConfigEvent: function (key, handler, obj) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.event.unsubscribe(handler, obj);
+            } else {
+                return false;
             }
+        },
         
-        }
+        /**
+        * Returns a string representation of the Config object
+        * @method toString
+        * @return {String} The Config object in string format.
+        */
+        toString: function () {
+            var output = "Config";
+            if (this.owner) {
+                output += " [" + this.owner.toString() + "]";
+            }
+            return output;
+        },
+        
+        /**
+        * Returns a string representation of the Config object's current 
+        * CustomEvent queue
+        * @method outputEventQueue
+        * @return {String} The string list of CustomEvents currently queued 
+        * for execution
+        */
+        outputEventQueue: function () {
+
+            var output = "",
+                queueItem,
+                q,
+                nQueue = this.eventQueue.length;
+              
+            for (q = 0; q < nQueue; q++) {
+                queueItem = this.eventQueue[q];
+                if (queueItem) {
+                    output += queueItem[0] + "=" + queueItem[1] + ", ";
+                }
+            }
+            return output;
+        },
 
-       },
-
-       /**
-       * Event handler fired when the resize monitor element is resized.
-       * @method onDomResize
-       * @param {DOMEvent} e   The DOM resize event
-       * @param {Object} obj   The scope object passed to the handler
-       */
-       onDomResize : function(e, obj) { 
-        var nLeft = -1 * this.resizeMonitor.offsetWidth,
-            nTop = -1 * this.resizeMonitor.offsetHeight;
-        
-        this.resizeMonitor.style.top = nTop + "px";
-        this.resizeMonitor.style.left =  nLeft + "px";
-       
-       },
-
-       /**
-       * Sets the Module's header content to the HTML specified, or appends the passed element to the header. If no header is present, one will be automatically created.
-       * @method setHeader
-       * @param {String}       headerContent   The HTML used to set the header <em>OR</em>
-       * @param {HTMLElement}  headerContent   The HTMLElement to append to the header
-       */      
-       setHeader : function(headerContent) {
-               if (! this.header) {
-                       this.header = document.createElement("DIV");
-                       this.header.className = YAHOO.widget.Module.CSS_HEADER;
-               }
-               
-               if (typeof headerContent == "string") {
-                       this.header.innerHTML = headerContent;
-               } else {
-                       this.header.innerHTML = "";
-                       this.header.appendChild(headerContent);
-               }
-
-               this.changeHeaderEvent.fire(headerContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the header. If no header is present, one will be automatically created.
-       * @method appendToHeader
-       * @param {HTMLElement}  element The element to append to the header
-       */      
-       appendToHeader : function(element) {
-               if (! this.header) {
-                       this.header = document.createElement("DIV");
-                       this.header.className = YAHOO.widget.Module.CSS_HEADER;
-               }
-               
-               this.header.appendChild(element);
-               this.changeHeaderEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Sets the Module's body content to the HTML specified, or appends the passed element to the body. If no body is present, one will be automatically created.
-       * @method setBody
-       * @param {String}       bodyContent     The HTML used to set the body <em>OR</em>
-       * @param {HTMLElement}  bodyContent     The HTMLElement to append to the body
-       */              
-       setBody : function(bodyContent) {
-               if (! this.body) {
-                       this.body = document.createElement("DIV");
-                       this.body.className = YAHOO.widget.Module.CSS_BODY;
-               }
-
-               if (typeof bodyContent == "string")
-               {
-                       this.body.innerHTML = bodyContent;
-               } else {
-                       this.body.innerHTML = "";
-                       this.body.appendChild(bodyContent);
-               }
-
-               this.changeBodyEvent.fire(bodyContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the body. If no body is present, one will be automatically created.
-       * @method appendToBody
-       * @param {HTMLElement}  element The element to append to the body
-       */
-       appendToBody : function(element) {
-               if (! this.body) {
-                       this.body = document.createElement("DIV");
-                       this.body.className = YAHOO.widget.Module.CSS_BODY;
-               }
-
-               this.body.appendChild(element);
-               this.changeBodyEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method setFooter
-       * @param {String}       footerContent   The HTML used to set the footer <em>OR</em>
-       * @param {HTMLElement}  footerContent   The HTMLElement to append to the footer
-       */      
-       setFooter : function(footerContent) {
-               if (! this.footer) {
-                       this.footer = document.createElement("DIV");
-                       this.footer.className = YAHOO.widget.Module.CSS_FOOTER;
-               }
-
-               if (typeof footerContent == "string") {
-                       this.footer.innerHTML = footerContent;
-               } else {
-                       this.footer.innerHTML = "";
-                       this.footer.appendChild(footerContent);
-               }
-
-               this.changeFooterEvent.fire(footerContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the footer. If no footer is present, one will be automatically created.
-       * @method appendToFooter
-       * @param {HTMLElement}  element The element to append to the footer
-       */
-       appendToFooter : function(element) {
-               if (! this.footer) {
-                       this.footer = document.createElement("DIV");
-                       this.footer.className = YAHOO.widget.Module.CSS_FOOTER;
-               }
-
-               this.footer.appendChild(element);
-               this.changeFooterEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method render
-       * @param {String}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>
-       * @param {HTMLElement}  appendToNode    The element to which the Module should be appended to prior to rendering        
-       * @param {HTMLElement}  moduleElement   OPTIONAL. The element that represents the actual Standard Module container. 
-       * @return {Boolean} Success or failure of the render
-       */
-       render : function(appendToNode, moduleElement) {
-               this.beforeRenderEvent.fire();
-
-               if (! moduleElement) {
-                       moduleElement = this.element;
-               }
-
-               var me = this;
-               var appendTo = function(element) {
-                       if (typeof element == "string") {
-                               element = document.getElementById(element);
-                       }
-                       
-                       if (element) {
-                               element.appendChild(me.element);
-                               me.appendEvent.fire();
-                       }
-               };
-
-               if (appendToNode) {
-                       appendTo(appendToNode);
-               } else { // No node was passed in. If the element is not pre-marked up, this fails
-                       if (! YAHOO.util.Dom.inDocument(this.element)) {
-                               return false;
-                       }
-               }
-
-               // Need to get everything into the DOM if it isn't already
-               
-               if (this.header && ! YAHOO.util.Dom.inDocument(this.header)) {
-                       // There is a header, but it's not in the DOM yet... need to add it
-                       var firstChild = moduleElement.firstChild;
-                       if (firstChild) { // Insert before first child if exists
-                               moduleElement.insertBefore(this.header, firstChild);
-                       } else { // Append to empty body because there are no children
-                               moduleElement.appendChild(this.header);
-                       }
-               }
-
-               if (this.body && ! YAHOO.util.Dom.inDocument(this.body)) {
-                       // There is a body, but it's not in the DOM yet... need to add it
-                       if (this.footer && YAHOO.util.Dom.isAncestor(this.moduleElement, this.footer)) { // Insert before footer if exists in DOM
-                               moduleElement.insertBefore(this.body, this.footer);
-                       } else { // Append to element because there is no footer
-                               moduleElement.appendChild(this.body);
-                       }
-               }
-
-               if (this.footer && ! YAHOO.util.Dom.inDocument(this.footer)) {
-                       // There is a footer, but it's not in the DOM yet... need to add it
-                       moduleElement.appendChild(this.footer);
-               }
-
-               this.renderEvent.fire();
-               return true;
-       },
-
-       /**
-       * Removes the Module element from the DOM and sets all child elements to null.
-       * @method destroy
-       */
-       destroy : function() {
-               var parent;
-
-               if (this.element) {
-                       YAHOO.util.Event.purgeElement(this.element, true);
-                       parent = this.element.parentNode;
-               }
-               if (parent) {
-                       parent.removeChild(this.element);
-               }
-
-               this.element = null;
-               this.header = null;
-               this.body = null;
-               this.footer = null;
-
-               for (var e in this) {
-                       if (e instanceof YAHOO.util.CustomEvent) {
-                               e.unsubscribeAll();
-                       }
-               }
-
-               YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this);
-
-               this.destroyEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method show
-       */
-       show : function() {
-               this.cfg.setProperty("visible", true);
-       },
-
-       /**
-       * 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.
-       * @method hide
-       */
-       hide : function() {
-               this.cfg.setProperty("visible", false);
-       },
-
-       // BUILT-IN EVENT HANDLERS FOR MODULE //
-
-       /**
-       * Default event handler for changing the visibility property of a Module. By default, this is achieved by switching the "display" style between "block" and "none".
-       * This method is responsible for firing showEvent and hideEvent.
-       * @param {String} type  The CustomEvent type (usually the property name)
-       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
-       * @method configVisible
-       */
-       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();
-               }
-       },
-
-       /**
-       * Default event handler for the "monitorresize" configuration property
-       * @param {String} type  The CustomEvent type (usually the property name)
-       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
-       * @method configMonitorResize
-       */
-       configMonitorResize : function(type, args, obj) {
-               var monitor = args[0];
-               if (monitor) {
-                       this.initResizeMonitor();
-               } else {
-                       YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this, true);
-                       this.resizeMonitor = null;
-               }
-       }
-};
-
-/**
-* Returns a String representation of the Object.
-* @method toString
-* @return {String}     The string representation of the Module
-*/ 
-YAHOO.widget.Module.prototype.toString = function() {
-       return "Module " + this.id;
-};
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Overlay
-* @extends YAHOO.widget.Module
-* @param {String}      el      The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement} el      The element representing the Overlay
-* @param {Object}      userConfig      The configuration object literal containing 10/23/2006the configuration that should be set for this Overlay. See configuration documentation for more details.
-* @constructor
-*/
-YAHOO.widget.Overlay = function(el, userConfig) {
-       YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Overlay, YAHOO.widget.Module);
-
-/**
-* The URL that will be placed in the iframe
-* @property YAHOO.widget.Overlay.IFRAME_SRC
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;";
-
-/**
-* Constant representing the top left corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.TOP_LEFT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.TOP_LEFT = "tl";
-
-/**
-* Constant representing the top right corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.TOP_RIGHT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.TOP_RIGHT = "tr";
-
-/**
-* Constant representing the top bottom left corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.BOTTOM_LEFT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.BOTTOM_LEFT = "bl";
-
-/**
-* Constant representing the bottom right corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.BOTTOM_RIGHT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.BOTTOM_RIGHT = "br";
-
-/**
-* Constant representing the default CSS class used for an Overlay
-* @property YAHOO.widget.Overlay.CSS_OVERLAY
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.CSS_OVERLAY = "overlay";
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement} el      The element representing the Overlay
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.
-*/
-YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {
-       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
-       
-       this.beforeInitEvent.fire(YAHOO.widget.Overlay);
-
-       YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Overlay.CSS_OVERLAY);
-
-       if (userConfig) {
-               this.cfg.applyConfig(userConfig, true);
-       }
-
-       if (this.platform == "mac" && this.browser == "gecko") {
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)) {
-                       this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)) {
-                       this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);
-               }
-       }
-
-       this.initEvent.fire(YAHOO.widget.Overlay);
-};
-
-/**
-* Initializes the custom events for Overlay which are fired automatically at appropriate times by the Overlay class.
-* @method initEvents
-*/
-YAHOO.widget.Overlay.prototype.initEvents = function() {
-       YAHOO.widget.Overlay.superclass.initEvents.call(this);
-
-       /**
-       * CustomEvent fired before the Overlay is moved.
-       * @event beforeMoveEvent
-       * @param {Number} x     x coordinate
-       * @param {Number} y     y coordinate
-       */
-       this.beforeMoveEvent = new YAHOO.util.CustomEvent("beforeMove", this);
-
-       /**
-       * CustomEvent fired after the Overlay is moved.
-       * @event moveEvent
-       * @param {Number} x     x coordinate
-       * @param {Number} y     y coordinate
-       */
-       this.moveEvent = new YAHOO.util.CustomEvent("move", this);
-};
-
-/**
-* Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Overlay.prototype.initDefaultConfig = function() {
-       YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);
-
-       // Add overlay config properties //
-
-       /**
-       * The absolute x-coordinate position of the Overlay
-       * @config x
-       * @type Number
-       * @default null
-       */      
-       this.cfg.addProperty("x", { handler:this.configX, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * The absolute y-coordinate position of the Overlay
-       * @config y
-       * @type Number
-       * @default null
-       */      
-       this.cfg.addProperty("y", { handler:this.configY, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * An array with the absolute x and y positions of the Overlay
-       * @config xy
-       * @type Number[]
-       * @default null
-       */      
-       this.cfg.addProperty("xy",{ handler:this.configXY, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * 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.
-       * @config context
-       * @type Array
-       * @default null
-       */      
-       this.cfg.addProperty("context", { handler:this.configContext, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * True if the Overlay should be anchored to the center of the viewport.
-       * @config fixedcenter
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty("fixedcenter", { value:false, handler:this.configFixedCenter, validator:this.cfg.checkBoolean, supercedes:["iframe","visible"] } );
-
-       /**
-       * CSS width of the Overlay.
-       * @config width
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty("width", { handler:this.configWidth, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * CSS height of the Overlay.
-       * @config height
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty("height", { handler:this.configHeight, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * CSS z-index of the Overlay.
-       * @config zIndex
-       * @type Number
-       * @default null
-       */
-       this.cfg.addProperty("zIndex", { value:null, handler:this.configzIndex } );
-
-       /**
-       * True if the Overlay should be prevented from being positioned out of the viewport.
-       * @config constraintoviewport
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty("constraintoviewport", { value:false, handler:this.configConstrainToViewport, validator:this.cfg.checkBoolean, supercedes:["iframe","x","y","xy"] } );
-
-       /**
-       * True if the Overlay should have an IFRAME shim (for correcting the select z-index bug in IE6 and below).
-       * @config iframe
-       * @type Boolean
-       * @default true for IE6 and below, false for all others
-       */
-       this.cfg.addProperty("iframe", { value:(this.browser == "ie" ? true : false), handler:this.configIframe, validator:this.cfg.checkBoolean, supercedes:["zIndex"] } );
-};
-
-/**
-* Moves the Overlay to the specified position. This function is identical to calling this.cfg.setProperty("xy", [x,y]);
-* @method moveTo
-* @param {Number}      x       The Overlay's new x position
-* @param {Number}      y       The Overlay's new y position
-*/
-YAHOO.widget.Overlay.prototype.moveTo = function(x, y) {
-       this.cfg.setProperty("xy",[x,y]);
-};
-
-/**
-* Adds a special CSS class to the Overlay when Mac/Gecko is in use, to work around a Gecko bug where
-* scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
-* @method hideMacGeckoScrollbars
-*/
-YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars = function() {
-       YAHOO.util.Dom.removeClass(this.element, "show-scrollbars");
-       YAHOO.util.Dom.addClass(this.element, "hide-scrollbars");
-};
-
-/**
-* Removes a special CSS class from the Overlay when Mac/Gecko is in use, to work around a Gecko bug where
-* scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
-* @method showMacGeckoScrollbars
-*/
-YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars = function() {
-       YAHOO.util.Dom.removeClass(this.element, "hide-scrollbars");
-       YAHOO.util.Dom.addClass(this.element, "show-scrollbars");
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* The default event handler fired when the "visible" property is changed. This method is responsible for firing showEvent and hideEvent.
-* @method configVisible
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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; }
-                       e = e.parentNode;
-               }
-               if (currentVis == "inherit") { 
-                       currentVis = "visible";
-               }
-       }
-       
-       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);
-               }
-       }
-
-       var isMacGecko = (this.platform == "mac" && this.browser == "gecko");
-
-       if (visible) { // Show
-               if (isMacGecko) {
-                       this.showMacGeckoScrollbars();
-               }       
-
-               if (effect) { // Animate in
-                       if (visible) { // Animate in if not showing
-                               if (currentVis != "visible" || currentVis === "") {
-                                       this.beforeShowEvent.fire();
-                                       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); // Delegate showEvent until end of animateInComplete
-                                               }
-                                               ei.animateIn();
-                                       }
-                               }
-                       }
-               } else { // Show
-                       if (currentVis != "visible" || currentVis === "") {
-                               this.beforeShowEvent.fire();
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "visible");
-                               this.cfg.refireEvent("iframe");
-                               this.showEvent.fire();
-                       }
-               }
-
-       } else { // Hide
-               if (isMacGecko) {
-                       this.hideMacGeckoScrollbars();
-               }       
-
-               if (effect) { // Animate out if showing
-                       if (currentVis == "visible") {
-                               this.beforeHideEvent.fire();
-                               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); // Delegate hideEvent until end of animateOutComplete
-                                       }
-                                       h.animateOut();
-                               }
-                       } else if (currentVis === "") {
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");
-                       }
-               } else { // Simple hide
-                       if (currentVis == "visible" || currentVis === "") {
-                               this.beforeHideEvent.fire();
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");
-                               this.cfg.refireEvent("iframe");
-                               this.hideEvent.fire();
-                       }
-               }       
-       }
-};
-
-/**
-* Center event handler used for centering on scroll/resize, but only if the Overlay is visible
-* @method doCenterOnDOMEvent
-*/
-YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent = function() {
-       if (this.cfg.getProperty("visible")) {
-               this.center();
-       }
-};
-
-/**
-* The default event handler fired when the "fixedcenter" property is changed.
-* @method configFixedCenter
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-               }
-               
-               if (! YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent, this.doCenterOnDOMEvent, this)) {
-                       YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);
-               }
-
-               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);
-       }
-};
-
-/**
-* The default event handler fired when the "height" property is changed.
-* @method configHeight
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "width" property is changed.
-* @method configWidth
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "zIndex" property is changed.
-* @method configzIndex
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-               }
-       }
-
-       if (this.iframe) {
-               if (zIndex <= 0) {
-                       zIndex = 1;
-               }
-               YAHOO.util.Dom.setStyle(this.iframe, "zIndex", (zIndex-1));
-       }
-
-       YAHOO.util.Dom.setStyle(el, "zIndex", zIndex);
-       this.cfg.setProperty("zIndex", zIndex, true);
-};
-
-/**
-* The default event handler fired when the "xy" property is changed.
-* @method configXY
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {
-       var pos = args[0];
-       var x = pos[0];
-       var y = pos[1];
+        /**
+        * Sets all properties to null, unsubscribes all listeners from each 
+        * property's change event and all listeners from the configChangedEvent.
+        * @method destroy
+        */
+        destroy: function () {
 
-       this.cfg.setProperty("x", x);
-       this.cfg.setProperty("y", y);
+            var oConfig = this.config,
+                sProperty,
+                oProperty;
 
-       this.beforeMoveEvent.fire([x,y]);
 
-       x = this.cfg.getProperty("x");
-       y = this.cfg.getProperty("y");
+            for (sProperty in oConfig) {
+            
+                if (Lang.hasOwnProperty(oConfig, sProperty)) {
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x,y]);
-};
+                    oProperty = oConfig[sProperty];
 
-/**
-* The default event handler fired when the "x" property is changed.
-* @method configX
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configX = function(type, args, obj) {
-       var x = args[0];
-       var y = this.cfg.getProperty("y");
+                    oProperty.event.unsubscribeAll();
+                    oProperty.event = null;
 
-       this.cfg.setProperty("x", x, true);
-       this.cfg.setProperty("y", y, true);
+                }
+            
+            }
+            
+            this.configChangedEvent.unsubscribeAll();
+            
+            this.configChangedEvent = null;
+            this.owner = null;
+            this.config = null;
+            this.initialConfig = null;
+            this.eventQueue = null;
+        
+        }
 
-       this.beforeMoveEvent.fire([x,y]);
+    };
+    
+    
+    
+    /**
+    * Checks to determine if a particular function/Object pair are already 
+    * subscribed to the specified CustomEvent
+    * @method YAHOO.util.Config.alreadySubscribed
+    * @static
+    * @param {YAHOO.util.CustomEvent} evt The CustomEvent for which to check 
+    * the subscriptions
+    * @param {Function} fn The function to look for in the subscribers list
+    * @param {Object} obj The execution scope Object for the subscription
+    * @return {Boolean} true, if the function/Object pair is already subscribed 
+    * to the CustomEvent passed in
+    */
+    Config.alreadySubscribed = function (evt, fn, obj) {
+    
+        var nSubscribers = evt.subscribers.length,
+            subsc,
+            i;
 
-       x = this.cfg.getProperty("x");
-       y = this.cfg.getProperty("y");
+        if (nSubscribers > 0) {
 
-       YAHOO.util.Dom.setX(this.element, x, true);
-       
-       this.cfg.setProperty("xy", [x, y], true);
+            i = nSubscribers - 1;
+        
+            do {
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x, y]);
-};
+                subsc = evt.subscribers[i];
 
-/**
-* The default event handler fired when the "y" property is changed.
-* @method configY
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {
-       var x = this.cfg.getProperty("x");
-       var y = args[0];
+                if (subsc && subsc.obj == obj && subsc.fn == fn) {
+        
+                    return true;
+        
+                }    
+            
+            }
+            while (i--);
+        
+        }
+    
+        return false;
+    
+    };
+    
+    YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @module container
+    * @title Container
+    * @requires yahoo, dom, event 
+    * @optional dragdrop, animation, button
+    */
+    
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Module
+    * @constructor
+    * @param {String} el The element ID representing the Module <em>OR</em>
+    * @param {HTMLElement} el The element representing the Module
+    * @param {Object} userConfig The configuration Object literal containing 
+    * the configuration that should be set for this module. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Module = function (el, userConfig) {
+    
+        if (el) {
+    
+            this.init(el, userConfig);
+    
+        } else {
+    
+    
+        }
+    
+    };
 
-       this.cfg.setProperty("x", x, true);
-       this.cfg.setProperty("y", y, true);
 
-       this.beforeMoveEvent.fire([x,y]);
+    var Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        Event = YAHOO.util.Event,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Module = YAHOO.widget.Module,
+        
+        m_oModuleTemplate,
+        m_oHeaderTemplate,
+        m_oBodyTemplate,
+        m_oFooterTemplate,
+
+        /**
+        * Constant representing the name of the Module's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_INIT": "beforeInit",
+            "INIT": "init",
+            "APPEND": "append",
+            "BEFORE_RENDER": "beforeRender",
+            "RENDER": "render",
+            "CHANGE_HEADER": "changeHeader",
+            "CHANGE_BODY": "changeBody",
+            "CHANGE_FOOTER": "changeFooter",
+            "CHANGE_CONTENT": "changeContent",
+            "DESTORY": "destroy",
+            "BEFORE_SHOW": "beforeShow",
+            "SHOW": "show",
+            "BEFORE_HIDE": "beforeHide",
+            "HIDE": "hide"
+        
+        },
+            
+        /**
+        * Constant representing the Module's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "VISIBLE": { 
+                key: "visible", 
+                value: true, 
+                validator: YAHOO.lang.isBoolean 
+            },
+        
+            "EFFECT": { 
+                key: "effect", 
+                suppressEvent: true, 
+                supercedes: ["visible"] 
+            },
+        
+            "MONITOR_RESIZE": { 
+                key: "monitorresize", 
+                value: true  
+            }
+        
+        };
 
-       x = this.cfg.getProperty("x");
-       y = this.cfg.getProperty("y");
+    
+    /**
+    * Constant representing the prefix path to use for non-secure images
+    * @property YAHOO.widget.Module.IMG_ROOT
+    * @static
+    * @final
+    * @type String
+    */
+    Module.IMG_ROOT = null;
+    
+    /**
+    * Constant representing the prefix path to use for securely served images
+    * @property YAHOO.widget.Module.IMG_ROOT_SSL
+    * @static
+    * @final
+    * @type String
+    */
+    Module.IMG_ROOT_SSL = null;
+    
+    /**
+    * Constant for the default CSS class name that represents a Module
+    * @property YAHOO.widget.Module.CSS_MODULE
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_MODULE = "yui-module";
+    
+    /**
+    * Constant representing the module header
+    * @property YAHOO.widget.Module.CSS_HEADER
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_HEADER = "hd";
+    
+    /**
+    * Constant representing the module body
+    * @property YAHOO.widget.Module.CSS_BODY
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_BODY = "bd";
+    
+    /**
+    * Constant representing the module footer
+    * @property YAHOO.widget.Module.CSS_FOOTER
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_FOOTER = "ft";
+    
+    /**
+    * Constant representing the url for the "src" attribute of the iframe 
+    * used to monitor changes to the browser's base font size
+    * @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL
+    * @static
+    * @final
+    * @type String
+    */
+    Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";
+    
+    /**
+    * Singleton CustomEvent fired when the font size is changed in the browser.
+    * Opera's "zoom" functionality currently does not support text 
+    * size detection.
+    * @event YAHOO.widget.Module.textResizeEvent
+    */
+    Module.textResizeEvent = new CustomEvent("textResize");
 
-       YAHOO.util.Dom.setY(this.element, y, true);
 
-       this.cfg.setProperty("xy", [x, y], true);
+    function createModuleTemplate() {
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x, y]);
-};
+        if (!m_oModuleTemplate) {
 
-/**
-* Shows the iframe shim, if it has been enabled
-* @method showIframe
-*/
-YAHOO.widget.Overlay.prototype.showIframe = function() {
-       if (this.iframe) {
-               this.iframe.style.display = "block";
-       }
-};
-
-/**
-* Hides the iframe shim, if it has been enabled
-* @method hideIframe
-*/
-YAHOO.widget.Overlay.prototype.hideIframe = function() {
-       if (this.iframe) {
-               this.iframe.style.display = "none";
-       }
-};
-
-/**
-* The default event handler fired when the "iframe" property is changed.
-* @method configIframe
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
-
-       var val = args[0];
-
-       if (val) { // IFRAME shim is enabled
-
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, this.showIframe, this)) {
-                       this.showEvent.subscribe(this.showIframe, this, true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, this.hideIframe, this)) {
-                       this.hideEvent.subscribe(this.hideIframe, this, true);
-               }
-
-               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");
-               }
-
-               if (! isNaN(x) && ! isNaN(y)) {
-                       if (! this.iframe) {
-                               this.iframe = document.createElement("iframe");
-                               if (this.isSecure) {
-                                       this.iframe.src = YAHOO.widget.Overlay.IFRAME_SRC;
-                               }
-                               
-                               var parent = this.element.parentNode;
-                               if (parent) {
-                                       parent.appendChild(this.iframe);
-                               } else {
-                                       document.body.appendChild(this.iframe);
-                               }
-
-                               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();
-                               }
-                       }
-                       
-                       var iframeDisplay = YAHOO.util.Dom.getStyle(this.iframe, "display");
-
-                       if (iframeDisplay == "none") {
-                               this.iframe.style.display = "block";
-                       }
-
-                       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";
-               }
-               this.showEvent.unsubscribe(this.showIframe, this);
-               this.hideEvent.unsubscribe(this.hideIframe, this);
-       }
-};
-
-
-/**
-* The default event handler fired when the "constraintoviewport" property is changed.
-* @method configConstrainToViewport
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-       }
-};
-
-/**
-* The default event handler fired when the "context" property is changed.
-* @method configContext
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-                       }
-                       
-                       if (elementMagnetCorner && contextMagnetCorner) {
-                               this.align(elementMagnetCorner, contextMagnetCorner);
-                       }
-               }       
-       }
-};
-
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Aligns the Overlay to its context element using the specified corner points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, and BOTTOM_RIGHT.
-* @method align
-* @param {String} elementAlign         The String representing the corner of the Overlay that should be aligned to the context element
-* @param {String} contextAlign         The corner of the context element that the elementAlign corner should stick to.
-*/
-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];
-               }
-
-               if (! contextAlign) {
-                       contextAlign = contextArgs[2];
-               }
-
-               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;
-                       }
-               }
-       }
-};
-
-/**
-* The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true.
-* @method enforceConstraints
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-       }
-
-       if (y < topConstraint) {
-               y = topConstraint;
-       } else if (y > bottomConstraint) {
-               y = bottomConstraint;
-       }
-
-       this.cfg.setProperty("x", x, true);
-       this.cfg.setProperty("y", y, true);
-       this.cfg.setProperty("xy", [x,y], true);
-};
-
-/**
-* Centers the container in the viewport.
-* @method center
-*/
-YAHOO.widget.Overlay.prototype.center = function() {
-       var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
-       var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+            m_oModuleTemplate = document.createElement("div");
+            
+            m_oModuleTemplate.innerHTML = ("<div class=\"" + 
+                Module.CSS_HEADER + "\"></div>" + "<div class=\"" + 
+                Module.CSS_BODY + "\"></div><div class=\"" + 
+                Module.CSS_FOOTER + "\"></div>");
 
-       var viewPortWidth = YAHOO.util.Dom.getClientWidth();
-       var viewPortHeight = YAHOO.util.Dom.getClientHeight();
+            m_oHeaderTemplate = m_oModuleTemplate.firstChild;
+            m_oBodyTemplate = m_oHeaderTemplate.nextSibling;
+            m_oFooterTemplate = m_oBodyTemplate.nextSibling;
 
-       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)]);
+        return m_oModuleTemplate;
 
-       this.cfg.refireEvent("iframe");
-};
+    }
 
-/**
-* Synchronizes the Panel's "xy", "x", and "y" properties with the Panel's position in the DOM. This is primarily used to update position information during drag & drop.
-* @method syncPosition
-*/
-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);
-};
-
-/**
-* Event handler fired when the resize monitor element is resized.
-* @method onDomResize
-* @param {DOMEvent} e  The resize DOM event
-* @param {Object} obj  The scope object
-*/
-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);
-};
-
-/**
-* Removes the Overlay element from the DOM and sets all child elements to null.
-* @method destroy
-*/
-YAHOO.widget.Overlay.prototype.destroy = function() {
-       if (this.iframe) {
-               this.iframe.parentNode.removeChild(this.iframe);
-       }
-       
-       this.iframe = null;
-
-       YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-       YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-
-       YAHOO.widget.Overlay.superclass.destroy.call(this);  
-};
-
-/**
-* Returns a String representation of the object.
-* @method toString
-* @return {String} The string representation of the Overlay.
-*/ 
-YAHOO.widget.Overlay.prototype.toString = function() {
-       return "Overlay " + this.id;
-};
-
-/**
-* A singleton CustomEvent used for reacting to the DOM event for window scroll
-* @event YAHOO.widget.Overlay.windowScrollEvent
-*/
-YAHOO.widget.Overlay.windowScrollEvent = new YAHOO.util.CustomEvent("windowScroll");
 
-/**
-* A singleton CustomEvent used for reacting to the DOM event for window resize
-* @event YAHOO.widget.Overlay.windowResizeEvent
-*/
-YAHOO.widget.Overlay.windowResizeEvent = new YAHOO.util.CustomEvent("windowResize");
+    function createHeader() {
 
-/**
-* The DOM event handler used to fire the CustomEvent for window scroll
-* @method YAHOO.widget.Overlay.windowScrollHandler
-* @static
-* @param {DOMEvent} e The DOM scroll event
-*/
-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;
-               }
-               clearTimeout(window.scrollEnd);
-               window.scrollEnd = setTimeout(function() { YAHOO.widget.Overlay.windowScrollEvent.fire(); }, 1);
-       } else {
-               YAHOO.widget.Overlay.windowScrollEvent.fire();
-       }
-};
-
-/**
-* The DOM event handler used to fire the CustomEvent for window resize
-* @method YAHOO.widget.Overlay.windowResizeHandler
-* @static
-* @param {DOMEvent} e The DOM resize event
-*/
-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;
-               }
-               clearTimeout(window.resizeEnd);
-               window.resizeEnd = setTimeout(function() { YAHOO.widget.Overlay.windowResizeEvent.fire(); }, 100);
-       } else {
-               YAHOO.widget.Overlay.windowResizeEvent.fire();
-       }
-};
-
-/**
-* A boolean that indicated whether the window resize and scroll events have already been subscribed to.
-* @property YAHOO.widget.Overlay._initialized
-* @private
-* @type Boolean
-*/
-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;
-}
-
-/**
-* OverlayManager is used for maintaining the focus status of multiple Overlays.* @namespace YAHOO.widget
-* @namespace YAHOO.widget
-* @class OverlayManager
-* @constructor
-* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.
-* @param {Object}      userConfig              The object literal representing the user configuration of the OverlayManager
-*/
-YAHOO.widget.OverlayManager = function(userConfig) {
-       this.init(userConfig);
-};
-
-/**
-* The CSS class representing a focused Overlay
-* @property YAHOO.widget.OverlayManager.CSS_FOCUSED
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.OverlayManager.CSS_FOCUSED = "focused";
-
-YAHOO.widget.OverlayManager.prototype = {
-       /**
-       * The class's constructor function
-       * @property contructor
-       * @type Function
-       */
-       constructor : YAHOO.widget.OverlayManager,
-
-       /**
-       * The array of Overlays that are currently registered
-       * @property overlays
-       * @type YAHOO.widget.Overlay[]
-       */
-       overlays : null,
-
-       /**
-       * Initializes the default configuration of the OverlayManager
-       * @method initDefaultConfig
-       */      
-       initDefaultConfig : function() {
-               /**
-               * The collection of registered Overlays in use by the OverlayManager
-               * @config overlays
-               * @type YAHOO.widget.Overlay[]
-               * @default null
-               */
-               this.cfg.addProperty("overlays", { suppressEvent:true } );
-
-               /**
-               * The default DOM event that should be used to focus an Overlay
-               * @config focusevent
-               * @type String
-               * @default "mousedown"
-               */
-               this.cfg.addProperty("focusevent", { value:"mousedown" } );
-       }, 
-
-       /**
-       * Initializes the OverlayManager
-       * @method init
-       * @param {YAHOO.widget.Overlay[]}       overlays        Optional. A collection of Overlays to register with the manager.
-       * @param {Object}       userConfig              The object literal representing the user configuration of the OverlayManager
-       */
-       init : function(userConfig) {
-               /**
-               * The OverlayManager's Config object used for monitoring configuration properties.
-               * @property cfg
-               * @type YAHOO.util.Config
-               */
-               this.cfg = new YAHOO.util.Config(this);
-
-               this.initDefaultConfig();
-
-               if (userConfig) {
-                       this.cfg.applyConfig(userConfig, true);
-               }
-               this.cfg.fireQueue();
-
-               /**
-               * The currently activated Overlay
-               * @property activeOverlay
-               * @private
-               * @type YAHOO.widget.Overlay
-               */
-               var activeOverlay = null;
-
-               /**
-               * Returns the currently focused Overlay
-               * @method getActive
-               * @return {YAHOO.widget.Overlay}        The currently focused Overlay
-               */
-               this.getActive = function() {
-                       return activeOverlay;
-               };
-
-               /**
-               * Focuses the specified Overlay
-               * @method focus
-               * @param {YAHOO.widget.Overlay} overlay The Overlay to focus
-               * @param {String} overlay       The id of the Overlay to focus
-               */
-               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));
-                               }
-                               this.overlays.sort(this.compareZIndexDesc);
-                       }
-               };
-
-               /**
-               * Removes the specified Overlay from the manager
-               * @method remove
-               * @param {YAHOO.widget.Overlay} overlay The Overlay to remove
-               * @param {String} overlay       The id of the Overlay to remove
-               */
-               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;
-                       }
-               };
-
-               /**
-               * Removes focus from all registered Overlays in the manager
-               * @method blurAll
-               */
-               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 = [];
-               }
-
-               if (overlays) {
-                       this.register(overlays);
-                       this.overlays.sort(this.compareZIndexDesc);
-               }
-       },
-
-       /**
-       * 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.
-       * @method register
-       * @param {YAHOO.widget.Overlay} overlay         An Overlay to register with the manager.
-       * @param {YAHOO.widget.Overlay[]}       overlay         An array of Overlays to register with the manager.
-       * @return       {Boolean}       True if any Overlays are registered.
-       */
-       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);
-                       }
-                       
-                       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++;
-                               }
-                       }
-                       if (regcount > 0) {
-                               return true;
-                       }
-               } else {
-                       return false;
-               }
-       },
-
-       /**
-       * Attempts to locate an Overlay by instance or ID.
-       * @method find
-       * @param {YAHOO.widget.Overlay} overlay         An Overlay to locate within the manager
-       * @param {String}       overlay         An Overlay id to locate within the manager
-       * @return       {YAHOO.widget.Overlay}  The requested Overlay, if found, or null if it cannot be located.
-       */
-       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];
-                               }
-                       }                       
-               }
-               return null;
-       },
-
-       /**
-       * Used for sorting the manager's Overlays by z-index.
-       * @method compareZIndexDesc
-       * @private
-       * @return {Number}      0, 1, or -1, depending on where the Overlay should fall in the stacking order.
-       */
-       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;
-               }
-       },
-
-       /**
-       * Shows all Overlays in the manager.
-       * @method showAll
-       */
-       showAll : function() {
-               for (var o=0;o<this.overlays.length;o++) {
-                       this.overlays[o].show();
-               }
-       },
-
-       /**
-       * Hides all Overlays in the manager.
-       * @method hideAll
-       */
-       hideAll : function() {
-               for (var o=0;o<this.overlays.length;o++) {
-                       this.overlays[o].hide();
-               }
-       },
-
-
-       /**
-       * Returns a string representation of the object.
-       * @method toString
-       * @return {String}      The string representation of the OverlayManager
-       */ 
-       toString : function() {
-               return "OverlayManager";
-       }
-
-};
-
-/**
-* KeyListener is a utility that provides an easy interface for listening for keydown/keyup events fired against DOM elements.
-* @namespace YAHOO.util
-* @class KeyListener
-* @constructor
-* @param {HTMLElement} attachTo        The element or element ID to which the key event should be attached
-* @param {String}      attachTo        The element or element ID to which the key event should be attached
-* @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).
-* @param {Function}    handler         The CustomEvent handler to fire when the key event is detected
-* @param {Object}      handler         An object literal representing the handler. 
-* @param {String}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.
-*/
-YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
-       if (! event) {
-               event = YAHOO.util.KeyListener.KEYDOWN;
-       }
-
-       /**
-       * The CustomEvent fired internally when a key is pressed
-       * @event keyEvent
-       * @private
-       * @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).
-       */
-       var keyEvent = new YAHOO.util.CustomEvent("keyPressed");
-       
-       /**
-       * The CustomEvent fired when the KeyListener is enabled via the enable() function
-       * @event enabledEvent
-       * @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).
-       */
-       this.enabledEvent = new YAHOO.util.CustomEvent("enabled");
-
-       /**
-       * The CustomEvent fired when the KeyListener is disabled via the disable() function
-       * @event disabledEvent
-       * @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).
-       */
-       this.disabledEvent = new YAHOO.util.CustomEvent("disabled");
-
-       if (typeof attachTo == 'string') {
-               attachTo = document.getElementById(attachTo);
-       }
-
-       if (typeof handler == 'function') {
-               keyEvent.subscribe(handler);
-       } else {
-               keyEvent.subscribe(handler.fn, handler.scope, handler.correctScope);
-       }
-
-       /**
-       * Handles the key event when a key is pressed.
-       * @method handleKeyPress
-       * @param {DOMEvent} e   The keypress DOM event
-       * @param {Object}       obj     The DOM event scope object
-       * @private
-       */
-       function handleKeyPress(e, obj) {
-               if (! keyData.shift) {  
-                       keyData.shift = false; 
-               }
-               if (! keyData.alt) {    
-                       keyData.alt = false;
-               }
-               if (! keyData.ctrl) {
-                       keyData.ctrl = false;
-               }
-
-               // check held down modifying keys first
-               if (e.shiftKey == keyData.shift && 
-                       e.altKey   == keyData.alt &&
-                       e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
-                       
-                       var dataItem;
-                       var keyPressed;
-
-                       if (keyData.keys instanceof Array) {
-                               for (var i=0;i<keyData.keys.length;i++) {
-                                       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);
-                               }
-                       }
-               }
-       }
-
-       /**
-       * Enables the KeyListener by attaching the DOM event listeners to the target DOM element
-       * @method enable
-       */
-       this.enable = function() {
-               if (! this.enabled) {
-                       YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);
-                       this.enabledEvent.fire(keyData);
-               }
-               /**
-               * Boolean indicating the enabled/disabled state of the Tooltip
-               * @property enabled
-               * @type Boolean
-               */
-               this.enabled = true;
-       };
-
-       /**
-       * Disables the KeyListener by removing the DOM event listeners from the target DOM element
-       * @method disable
-       */
-       this.disable = function() {
-               if (this.enabled) {
-                       YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);
-                       this.disabledEvent.fire(keyData);
-               }
-               this.enabled = false;
-       };
-
-       /**
-       * Returns a String representation of the object.
-       * @method toString
-       * @return {String}      The string representation of the KeyListener
-       */ 
-       this.toString = function() {
-               return "KeyListener [" + keyData.keys + "] " + attachTo.tagName + (attachTo.id ? "[" + attachTo.id + "]" : "");
-       };
-
-};
-
-/**
-* Constant representing the DOM "keydown" event.
-* @property YAHOO.util.KeyListener.KEYDOWN
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYDOWN = "keydown";
-
-/**
-* Constant representing the DOM "keyup" event.
-* @property YAHOO.util.KeyListener.KEYUP
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYUP = "keyup";
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Tooltip
-* @extends YAHOO.widget.Overlay
-* @constructor
-* @param {String}      el      The element ID representing the Tooltip <em>OR</em>
-* @param {HTMLElement} el      The element representing the Tooltip
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.
-*/
-YAHOO.widget.Tooltip = function(el, userConfig) {
-       YAHOO.widget.Tooltip.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Tooltip, YAHOO.widget.Overlay);
-
-/**
-* Constant representing the Tooltip CSS class
-* @property YAHOO.widget.Tooltip.CSS_TOOLTIP
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Tooltip.CSS_TOOLTIP = "tt";
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the Tooltip <em>OR</em>
-* @param {HTMLElement} el      The element representing the Tooltip
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Tooltip. See configuration documentation for more details.
-*/
-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);
-               }
-               
-               this.cfg.queueProperty("visible",false);
-               this.cfg.queueProperty("constraintoviewport",true);
-
-               this.setBody("");
-               this.render(this.cfg.getProperty("container"));
-
-               this.initEvent.fire(YAHOO.widget.Tooltip);
-       }
-};
-
-/**
-* Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Tooltip.prototype.initDefaultConfig = function() {
-       YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);
-
-       /**
-       * Specifies whether the Tooltip should be kept from overlapping its context element.
-       * @config preventoverlap
-       * @type Boolean
-       * @default true
-       */
-       this.cfg.addProperty("preventoverlap",          { value:true, validator:this.cfg.checkBoolean, supercedes:["x","y","xy"] } );
-
-       /**
-       * The number of milliseconds to wait before showing a Tooltip on mouseover.
-       * @config showdelay
-       * @type Number
-       * @default 200
-       */
-       this.cfg.addProperty("showdelay",                       { value:200, handler:this.configShowDelay, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The number of milliseconds to wait before automatically dismissing a Tooltip after the mouse has been resting on the context element.
-       * @config autodismissdelay
-       * @type Number
-       * @default 5000
-       */
-       this.cfg.addProperty("autodismissdelay",        { value:5000, handler:this.configAutoDismissDelay, validator:this.cfg.checkNumber } );
-       
-       /**
-       * The number of milliseconds to wait before hiding a Tooltip on mouseover.
-       * @config hidedelay
-       * @type Number
-       * @default 250
-       */
-       this.cfg.addProperty("hidedelay",                       { value:250, handler:this.configHideDelay, validator:this.cfg.checkNumber } );
-
-       /**
-       * Specifies the Tooltip's text.
-       * @config text
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty("text",                            { handler:this.configText, suppressEvent:true } );
-       
-       /**
-       * Specifies the container element that the Tooltip's markup should be rendered into.
-       * @config container
-       * @type HTMLElement/String
-       * @default document.body
-       */
-       this.cfg.addProperty("container",                       { value:document.body, handler:this.configContainer } );
-
-       /**
-       * Specifies the element or elements that the Tooltip should be anchored to on mouseover.
-       * @config context
-       * @type HTMLElement[]/String[]
-       * @default null
-       */
-
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* The default event handler fired when the "text" property is changed.
-* @method configText
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Tooltip.prototype.configText = function(type, args, obj) {
-       var text = args[0];
-       if (text) {
-               this.setBody(text);
-       }
-};
-
-/**
-* The default event handler fired when the "container" property is changed.
-* @method configContainer
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Tooltip.prototype.configContainer = function(type, args, obj) {
-       var container = args[0];
-       if (typeof container == 'string') {
-               this.cfg.setProperty("container", document.getElementById(container), true);
-       }
-};
-
-/**
-* The default event handler fired when the "context" property is changed.
-* @method configContext
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Tooltip.prototype.configContext = function(type, args, obj) {
-       var context = args[0];
-       if (context) {
-               
-               // Normalize parameter into an array
-               if (! (context instanceof Array)) {
-                       if (typeof context == "string") {
-                               this.cfg.setProperty("context", [document.getElementById(context)], true);
-                       } else { // Assuming this is an element
-                               this.cfg.setProperty("context", [context], true);
-                       }
-                       context = this.cfg.getProperty("context");
-               }
-
-
-               // Remove any existing mouseover/mouseout listeners
-               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);
-                       }
-               }
-
-               // Add mouseover/mouseout listeners to context elements
-               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);
-               }
-       }
-};
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-// BEGIN BUILT-IN DOM EVENT HANDLERS //
-
-/**
-* The default event handler fired when the user moves the mouse while over the context element.
-* @method onContextMouseMove
-* @param {DOMEvent} e  The current DOM event
-* @param {Object}      obj     The object argument
-*/
-YAHOO.widget.Tooltip.prototype.onContextMouseMove = function(e, obj) {
-       obj.pageX = YAHOO.util.Event.getPageX(e);
-       obj.pageY = YAHOO.util.Event.getPageY(e);
+        if (!m_oHeaderTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oHeaderTemplate.cloneNode(false));
 
-};
+    }
+    
 
-/**
-* The default event handler fired when the user mouses over the context element.
-* @method onContextMouseOver
-* @param {DOMEvent} e  The current DOM event
-* @param {Object}      obj     The object argument
-*/
-YAHOO.widget.Tooltip.prototype.onContextMouseOver = function(e, obj) {
-
-       if (obj.hideProcId) {
-               clearTimeout(obj.hideProcId);
-               obj.hideProcId = null;
-       }
-       
-       var context = this;
-       YAHOO.util.Event.addListener(context, "mousemove", obj.onContextMouseMove, obj);
-
-       if (context.title) {
-               obj._tempTitle = context.title;
-               context.title = "";
-       }
-
-       /**
-       * The unique process ID associated with the thread responsible for showing the Tooltip.
-       * @type int
-       */
-       obj.showProcId = obj.doShow(e, context);
-};
-
-/**
-* The default event handler fired when the user mouses out of the context element.
-* @method onContextMouseOut
-* @param {DOMEvent} e  The current DOM event
-* @param {Object}      obj     The object argument
-*/
-YAHOO.widget.Tooltip.prototype.onContextMouseOut = function(e, obj) {
-       var el = this;
-
-       if (obj._tempTitle) {
-               el.title = obj._tempTitle;
-               obj._tempTitle = null;
-       }
-       
-       if (obj.showProcId) {
-               clearTimeout(obj.showProcId);
-               obj.showProcId = null;
-       }
-
-       if (obj.hideProcId) {
-               clearTimeout(obj.hideProcId);
-               obj.hideProcId = null;
-       }
-
-
-       obj.hideProcId = setTimeout(function() {
-                               obj.hide();
-                               }, obj.cfg.getProperty("hidedelay"));
-};
-
-// END BUILT-IN DOM EVENT HANDLERS //
-
-/**
-* Processes the showing of the Tooltip by setting the timeout delay and offset of the Tooltip.
-* @method doShow
-* @param {DOMEvent} e  The current DOM event
-* @return {Number}     The process ID of the timeout function associated with doShow
-*/
-YAHOO.widget.Tooltip.prototype.doShow = function(e, context) {
-       
-       var yOffset = 25;
-       if (this.browser == "opera" && context.tagName == "A") {
-               yOffset += 12;
-       }
-
-       var me = this;
-       return setTimeout(
-               function() {
-                       if (me._tempTitle) {
-                               me.setBody(me._tempTitle);
-                       } else {
-                               me.cfg.refireEvent("text");
-                       }
-
-                       me.moveTo(me.pageX, me.pageY + yOffset);
-                       if (me.cfg.getProperty("preventoverlap")) {
-                               me.preventOverlap(me.pageX, me.pageY);
-                       }
-                       
-                       YAHOO.util.Event.removeListener(context, "mousemove", me.onContextMouseMove);
-
-                       me.show();
-                       me.hideProcId = me.doHide();
-               },
-       this.cfg.getProperty("showdelay"));
-};
-
-/**
-* Sets the timeout for the auto-dismiss delay, which by default is 5 seconds, meaning that a tooltip will automatically dismiss itself after 5 seconds of being displayed.
-* @method doHide
-*/
-YAHOO.widget.Tooltip.prototype.doHide = function() {
-       var me = this;
-       return setTimeout(
-               function() {
-                       me.hide();
-               },
-               this.cfg.getProperty("autodismissdelay"));
-};
-
-/**
-* Fired when the Tooltip is moved, this event handler is used to prevent the Tooltip from overlapping with its context element.
-* @method preventOverlay
-* @param {Number} pageX        The x coordinate position of the mouse pointer
-* @param {Number} pageY        The y coordinate position of the mouse pointer
-*/
-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));
-       }
-};
-
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     The string representation of the Tooltip
-*/ 
-YAHOO.widget.Tooltip.prototype.toString = function() {
-       return "Tooltip " + this.id;
-};
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Panel
-* @extends YAHOO.widget.Overlay
-* @constructor
-* @param {String}      el      The element ID representing the Panel <em>OR</em>
-* @param {HTMLElement} el      The element representing the Panel
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Panel. See configuration documentation for more details.
-*/
-YAHOO.widget.Panel = function(el, userConfig) {
-       YAHOO.widget.Panel.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Panel, YAHOO.widget.Overlay);
-
-/**
-* Constant representing the default CSS class used for a Panel
-* @property YAHOO.widget.Panel.CSS_PANEL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Panel.CSS_PANEL = "panel";
-
-/**
-* Constant representing the default CSS class used for a Panel's wrapping container
-* @property YAHOO.widget.Panel.CSS_PANEL_CONTAINER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Panel.CSS_PANEL_CONTAINER = "panel-container";
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement} el      The element representing the Overlay
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.
-*/
-YAHOO.widget.Panel.prototype.init = function(el, userConfig) {
-       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
-       
-       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);
-       }
-
-       this.beforeRenderEvent.subscribe(function() {
-               var draggable = this.cfg.getProperty("draggable");
-               if (draggable) {
-                       if (! this.header) {
-                               this.setHeader("&#160;");
-                       }
-               }
-       }, this, true);
-
-       var me = this;
-
-       var doBlur = function() {
-               this.blur();
-       };
-
-       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.type != "hidden") {
-                               if (! YAHOO.util.Dom.isAncestor(me.element, el)) {
-                                       YAHOO.util.Event.addListener(el, "focus", doBlur, el, true);
-                                       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", doBlur);
-               }
-       }, this, true);
-
-       this.beforeShowEvent.subscribe(function() {
-               this.cfg.refireEvent("underlay");
-       }, this, true);
-
-       this.initEvent.fire(YAHOO.widget.Panel);
-};
-
-/**
-* Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-*/
-YAHOO.widget.Panel.prototype.initEvents = function() {
-       YAHOO.widget.Panel.superclass.initEvents.call(this);
-
-       /**
-       * CustomEvent fired after the modality mask is shown
-       * @event showMaskEvent
-       */
-       this.showMaskEvent = new YAHOO.util.CustomEvent("showMask");
-
-       /**
-       * CustomEvent fired after the modality mask is hidden
-       * @event hideMaskEvent
-       */
-       this.hideMaskEvent = new YAHOO.util.CustomEvent("hideMask");
-
-       /**
-       * CustomEvent when the Panel is dragged
-       * @event dragEvent
-       */
-       this.dragEvent = new YAHOO.util.CustomEvent("drag");
-};
-
-/**
-* Initializes the class's configurable properties which can be changed using the Panel's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Panel.prototype.initDefaultConfig = function() {
-       YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);
-
-       // Add panel config properties //
-
-       /**
-       * True if the Panel should display a "close" button
-       * @config close
-       * @type Boolean
-       * @default true
-       */      
-       this.cfg.addProperty("close", { value:true, handler:this.configClose, validator:this.cfg.checkBoolean, supercedes:["visible"] } );
-
-       /**
-       * True if the Panel should be draggable
-       * @config draggable
-       * @type Boolean
-       * @default true
-       */      
-       this.cfg.addProperty("draggable", { value:true, handler:this.configDraggable, validator:this.cfg.checkBoolean, supercedes:["visible"] } );
-
-       /**
-       * Sets the type of underlay to display for the Panel. Valid values are "shadow", "matte", and "none".
-       * @config underlay
-       * @type String
-       * @default shadow
-       */
-       this.cfg.addProperty("underlay", { value:"shadow", handler:this.configUnderlay, supercedes:["visible"] } );
-
-       /**
-       * 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.
-       * @config modal
-       * @type Boolean
-       * @default false
-       */      
-       this.cfg.addProperty("modal",   { value:false, handler:this.configModal, validator:this.cfg.checkBoolean, supercedes:["visible"] } );
-
-       /**
-       * A KeyListener (or array of KeyListeners) that will be enabled when the Panel is shown, and disabled when the Panel is hidden.
-       * @config keylisteners
-       * @type YAHOO.util.KeyListener[]
-       * @default null
-       */      
-       this.cfg.addProperty("keylisteners", { handler:this.configKeyListeners, suppressEvent:true, supercedes:["visible"] } );
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* 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.
-* @method configClose
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-                       }
-
-                       this.close.innerHTML = "&#160;";
-                       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";
-               }
-       }
-};
-
-/**
-* The default event handler fired when the "draggable" property is changed.
-* @method configDraggable
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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();
-               }
-               if (this.header) {
-                       YAHOO.util.Dom.setStyle(this.header,"cursor","auto");
-               }
-       }
-};
-
-/**
-* The default event handler fired when the "underlay" property is changed.
-* @method configUnderlay
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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) { // create if not already in DOM
-                               this.underlay = document.createElement("DIV");
-                               this.underlay.className = "underlay";
-                               this.underlay.innerHTML = "&#160;";
-                               this.element.appendChild(this.underlay);
-                       } 
-
-                       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;
-       }
-};
-
-/**
-* 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.
-* @method configModal
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed( this.hideEvent, this.hideMask, this) ) {
-                       this.hideEvent.subscribe(this.hideMask, this, true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed( YAHOO.widget.Overlay.windowResizeEvent, this.sizeMask, this ) ) {
-                       YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask, this, true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed( this.destroyEvent, this.removeMask, this) ) {
-                       this.destroyEvent.subscribe(this.removeMask, this, true);
-               }
-
-               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);
-       }
-};
-
-/**
-* Removes the modality mask.
-* @method removeMask
-*/
-YAHOO.widget.Panel.prototype.removeMask = function() {
-       if (this.mask) {
-               if (this.mask.parentNode) {
-                       this.mask.parentNode.removeChild(this.mask);
-               }
-               this.mask = null;
-       }
-};
-
-/**
-* The default event handler fired when the "keylisteners" property is changed.
-* @method configKeyListeners
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-                               }
-                               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);
-                       }
-                       if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, listeners.disable, listeners)) {
-                               this.hideEvent.subscribe(listeners.disable, listeners, true);
-                               this.destroyEvent.subscribe(listeners.disable, listeners, true); 
-                       }
-               }
-       } 
-};
-
-/**
-* The default event handler fired when the "height" property is changed.
-* @method configHeight
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "width" property is changed.
-* @method configWidth
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "zIndex" property is changed.
-* @method configzIndex
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-               }
-
-               if (currentZ === 0) {
-                       this.cfg.setProperty("zIndex", 1);
-               } else {
-                       maskZ = currentZ - 1;
-                       YAHOO.util.Dom.setStyle(this.mask, "zIndex", maskZ);
-               }
-
-       }
-};
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Builds the wrapping container around the Panel that is used for positioning the shadow and matte underlays. The container element is assigned to a  local instance variable called container, and the element is reinserted inside of it.
-* @method buildWrapper
-*/
-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);
-       }
-
-       wrapper.appendChild(originalElement);
-
-       this.element = wrapper;
-       this.innerElement = originalElement;
-
-       YAHOO.util.Dom.setStyle(this.innerElement, "visibility", "inherit");
-};
-
-/**
-* Adjusts the size of the shadow based on the size of the element.
-* @method sizeUnderlay
-*/
-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";
-       }
-};
-
-/**
-* Event handler fired when the resize monitor element is resized.
-* @method onDomResize
-* @param {DOMEvent} e  The resize DOM event
-* @param {Object} obj  The scope object
-*/
-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);
-};
-
-/**
-* Registers the Panel's header for drag & drop capability.
-* @method registerDragDrop
-*/
-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";
-               }
-               
-               var me = this;
-
-               this.dd.startDrag = function() {
-
-                       if (me.browser == "ie") {
-                               YAHOO.util.Dom.addClass(me.element,"drag");
-                       }
-
-                       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;
-                       }
-
-                       me.dragEvent.fire("startDrag", arguments);
-               };
-               
-               this.dd.onDrag = function() {
-                       me.syncPosition();
-                       me.cfg.refireEvent("iframe");
-                       if (this.platform == "mac" && this.browser == "gecko") {
-                               this.showMacGeckoScrollbars();
-                       }
-
-                       me.dragEvent.fire("onDrag", arguments);
-               };
-
-               this.dd.endDrag = function() {
-                       if (me.browser == "ie") {
-                               YAHOO.util.Dom.removeClass(me.element,"drag");
-                       }
-
-                       me.dragEvent.fire("endDrag", arguments);
-               };
-
-               this.dd.setHandleElId(this.header.id);
-               this.dd.addInvalidHandleType("INPUT");
-               this.dd.addInvalidHandleType("SELECT");
-               this.dd.addInvalidHandleType("TEXTAREA");
-       }
-};
-
-/**
-* Builds the mask that is laid over the document when the Panel is configured to be modal.
-* @method buildMask
-*/
-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 = "&#160;";
-
-               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);
-               }
-       }
-};
-
-/**
-* Hides the modality mask.
-* @method hideMask
-*/
-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");
-       }
-};
-
-/**
-* Shows the modality mask.
-* @method showMask
-*/
-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();
-       }
-};
-
-/**
-* Sets the size of the modality mask to cover the entire scrollable area of the document
-* @method sizeMask
-*/
-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";
-       }
-};
-
-/**
-* 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.
-* @method render
-* @param {String}      appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>
-* @param {HTMLElement} appendToNode    The element to which the Module should be appended to prior to rendering        
-* @return {boolean} Success or failure of the render
-*/
-YAHOO.widget.Panel.prototype.render = function(appendToNode) {
-       return YAHOO.widget.Panel.superclass.render.call(this, appendToNode, this.innerElement);
-};
-
-/**
-* Returns a String representation of the object.
-* @method toString
-* @return {String} The string representation of the Panel.
-*/ 
-YAHOO.widget.Panel.prototype.toString = function() {
-       return "Panel " + this.id;
-};
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Dialog
-* @extends YAHOO.widget.Panel
-* @constructor
-* @param {String}      el      The element ID representing the Dialog <em>OR</em>
-* @param {HTMLElement} el      The element representing the Dialog
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.
-*/
-YAHOO.widget.Dialog = function(el, userConfig) {
-       YAHOO.widget.Dialog.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Dialog, YAHOO.widget.Panel);
-
-/**
-* Constant representing the default CSS class used for a Dialog
-* @property YAHOO.widget.Dialog.CSS_DIALOG
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Dialog.CSS_DIALOG = "dialog";
+    function createBody() {
+
+        if (!m_oBodyTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oBodyTemplate.cloneNode(false));
+    
+    }
+    
+
+    function createFooter() {
+
+        if (!m_oFooterTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oFooterTemplate.cloneNode(false));
+
+    }
+    
+
+    Module.prototype = {
+    
+        /**
+        * The class's constructor function
+        * @property contructor
+        * @type Function
+        */
+        constructor: Module,
+        
+        /**
+        * The main module element that contains the header, body, and footer
+        * @property element
+        * @type HTMLElement
+        */
+        element: null,
+        
+        /**
+        * The header element, denoted with CSS class "hd"
+        * @property header
+        * @type HTMLElement
+        */
+        header: null,
+        
+        /**
+        * The body element, denoted with CSS class "bd"
+        * @property body
+        * @type HTMLElement
+        */
+        body: null,
+        
+        /**
+        * The footer element, denoted with CSS class "ft"
+        * @property footer
+        * @type HTMLElement
+        */
+        footer: null,
+        
+        /**
+        * The id of the element
+        * @property id
+        * @type String
+        */
+        id: null,
+        
+        /**
+        * A string representing the root path for all images created by
+        * a Module instance.
+        * @deprecated It is recommend that any images for a Module be applied
+        * via CSS using the "background-image" property.
+        * @property imageRoot
+        * @type String
+        */
+        imageRoot: Module.IMG_ROOT,
+    
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        * @method initEvents
+        */
+        initEvents: function () {
+        
+            var SIGNATURE = CustomEvent.LIST;
+        
+            /**
+            * CustomEvent fired prior to class initalization.
+            * @event beforeInitEvent
+            * @param {class} classRef class reference of the initializing 
+            * class, such as this.beforeInitEvent.fire(Module)
+            */
+            this.beforeInitEvent = this.createEvent(EVENT_TYPES.BEFORE_INIT);
+            this.beforeInitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after class initalization.
+            * @event initEvent
+            * @param {class} classRef class reference of the initializing 
+            * class, such as this.beforeInitEvent.fire(Module)
+            */  
+            this.initEvent = this.createEvent(EVENT_TYPES.INIT);
+            this.initEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the Module is appended to the DOM
+            * @event appendEvent
+            */
+            this.appendEvent = this.createEvent(EVENT_TYPES.APPEND);
+            this.appendEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired before the Module is rendered
+            * @event beforeRenderEvent
+            */
+            this.beforeRenderEvent = 
+                this.createEvent(EVENT_TYPES.BEFORE_RENDER);
+            this.beforeRenderEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is rendered
+            * @event renderEvent
+            */
+            this.renderEvent = this.createEvent(EVENT_TYPES.RENDER);
+            this.renderEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the header content of the Module 
+            * is modified
+            * @event changeHeaderEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new header content
+            */
+            this.changeHeaderEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_HEADER);
+            this.changeHeaderEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired when the body content of the Module is modified
+            * @event changeBodyEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new body content
+            */  
+            this.changeBodyEvent = this.createEvent(EVENT_TYPES.CHANGE_BODY);
+            this.changeBodyEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired when the footer content of the Module 
+            * is modified
+            * @event changeFooterEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new footer content
+            */
+            this.changeFooterEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
+            this.changeFooterEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the content of the Module is modified
+            * @event changeContentEvent
+            */
+            this.changeContentEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
+            this.changeContentEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the Module is destroyed
+            * @event destroyEvent
+            */
+            this.destroyEvent = this.createEvent(EVENT_TYPES.DESTORY);
+            this.destroyEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired before the Module is shown
+            * @event beforeShowEvent
+            */
+            this.beforeShowEvent = this.createEvent(EVENT_TYPES.BEFORE_SHOW);
+            this.beforeShowEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is shown
+            * @event showEvent
+            */
+            this.showEvent = this.createEvent(EVENT_TYPES.SHOW);
+            this.showEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired before the Module is hidden
+            * @event beforeHideEvent
+            */
+            this.beforeHideEvent = this.createEvent(EVENT_TYPES.BEFORE_HIDE);
+            this.beforeHideEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is hidden
+            * @event hideEvent
+            */
+            this.hideEvent = this.createEvent(EVENT_TYPES.HIDE);
+            this.hideEvent.signature = SIGNATURE;
+        }, 
+        
+        /**
+        * String representing the current user-agent platform
+        * @property platform
+        * @type String
+        */
+        platform: function () {
+        
+            var ua = navigator.userAgent.toLowerCase();
+        
+            if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
+        
+                return "windows";
+        
+            } else if (ua.indexOf("macintosh") != -1) {
+        
+                return "mac";
+        
+            } else {
+        
+                return false;
+        
+            }
+        
+        }(),
+        
+        /**
+        * String representing the user-agent of the browser
+        * @deprecated Use YAHOO.env.ua
+        * @property browser
+        * @type String
+        */
+        browser: function () {
+        
+            var ua = navigator.userAgent.toLowerCase();
+            
+            /*
+                 Check Opera first in case of spoof and check Safari before
+                 Gecko since Safari's user agent string includes "like Gecko"
+            */
+
+            if (ua.indexOf('opera') != -1) { 
+            
+                return 'opera';
+            
+            } else if (ua.indexOf('msie 7') != -1) {
+            
+                return 'ie7';
+            
+            } else if (ua.indexOf('msie') != -1) {
+            
+                return 'ie';
+            
+            } else if (ua.indexOf('safari') != -1) { 
+            
+                return 'safari';
+            
+            } else if (ua.indexOf('gecko') != -1) {
+            
+                return 'gecko';
+            
+            } else {
+            
+                return false;
+            
+            }
+        
+        }(),
+        
+        /**
+        * Boolean representing whether or not the current browsing context is 
+        * secure (https)
+        * @property isSecure
+        * @type Boolean
+        */
+        isSecure: function () {
+        
+            if (window.location.href.toLowerCase().indexOf("https") === 0) {
+        
+                return true;
+        
+            } else {
+        
+                return false;
+        
+            }
+        
+        }(),
+        
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        */
+        initDefaultConfig: function () {
+    
+            // Add properties //
+        
+            /**
+            * Specifies whether the Module is visible on the page.
+            * @config visible
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.VISIBLE.key, {
+                handler: this.configVisible, 
+                value: DEFAULT_CONFIG.VISIBLE.value, 
+                validator: DEFAULT_CONFIG.VISIBLE.validator
+            });
+            
+            /**
+            * Object or array of objects representing the ContainerEffect 
+            * classes that are active for animating the container.
+            * @config effect
+            * @type Object
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key, {
+                suppressEvent: DEFAULT_CONFIG.EFFECT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.EFFECT.supercedes
+            });
+            
+            /**
+            * Specifies whether to create a special proxy iframe to monitor 
+            * for user font resizing in the document
+            * @config monitorresize
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key, {
+                handler: this.configMonitorResize,
+                value: DEFAULT_CONFIG.MONITOR_RESIZE.value
+            });
+            
+        },
+        
+        /**
+        * 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.
+        * @method init
+        * @param {String} el The element ID representing the Module <em>OR</em>
+        * @param {HTMLElement} el The element representing the Module
+        * @param {Object} userConfig The configuration Object literal 
+        * containing the configuration that should be set for this module. 
+        * See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
+        
+            var elId, i, child;
+        
+            this.initEvents();
+        
+            this.beforeInitEvent.fire(Module);
+        
+            /**
+            * The Module's Config object used for monitoring 
+            * configuration properties.
+            * @property cfg
+            * @type YAHOO.util.Config
+            */
+            this.cfg = new Config(this);
+        
+            if (this.isSecure) {
+                this.imageRoot = Module.IMG_ROOT_SSL;
+            }
+        
+            if (typeof el == "string") {
+
+                elId = el;
+        
+                el = document.getElementById(el);
+
+                if (! el) {
+
+                    el = (createModuleTemplate()).cloneNode(false);
+
+                    el.id = elId;
+
+                }
+
+            }
+        
+            this.element = el;
+        
+            if (el.id) {
+                this.id = el.id;
+            }
+        
+            child = this.element.firstChild;
+            
+            if (child) {
+
+                do {
+
+                    switch (child.className) {
+    
+                    case Module.CSS_HEADER:
+    
+                        this.header = child;
+    
+                        break;
+    
+                    case Module.CSS_BODY:
+    
+                        this.body = child;
+    
+                        break;
+    
+                    case Module.CSS_FOOTER:
+    
+                        this.footer = child;
+    
+                        break;
+    
+                    }
+                    
+                } while ((child = child.nextSibling));
+            
+            }
+
+        
+            this.initDefaultConfig();
+        
+            Dom.addClass(this.element, Module.CSS_MODULE);
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+        
+            /*
+                Subscribe to the fireQueue() method of Config so that any 
+                queued configuration changes are excecuted upon render of 
+                the Module
+            */ 
+            
+            if (!Config.alreadySubscribed(this.renderEvent, 
+                this.cfg.fireQueue, this.cfg)) {
+
+                this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
+
+            }
+        
+            this.initEvent.fire(Module);
+        },
+        
+        /**
+        * Initialized an empty IFRAME that is placed out of the visible area 
+        * that can be used to detect text resize.
+        * @method initResizeMonitor
+        */
+        initResizeMonitor: function () {
+        
+            var oDoc, 
+                oIFrame, 
+                sHTML;
+        
+            function fireTextResize() {
+        
+                Module.textResizeEvent.fire();
+        
+            }
+        
+            if (!YAHOO.env.ua.opera) {
+        
+                oIFrame = Dom.get("_yuiResizeMonitor");
+        
+                if (!oIFrame) {
+        
+                    oIFrame = document.createElement("iframe");
+        
+                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && 
+                        YAHOO.env.ua.ie) {
+    
+                        oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL;
+    
+                    }
+
+
+                    /*
+                        Need to set "src" attribute of the iframe to 
+                        prevent the browser from reporting duplicate 
+                        cookies. (See SourceForge bug #1721755)
+                    */
+        
+                    if (YAHOO.env.ua.gecko) {
+
+                        sHTML = "<html><head><script " +
+                                "type=\"text/javascript\">" + 
+                                "window.onresize=function(){window.parent." +
+                                "YAHOO.widget.Module.textResizeEvent." +
+                                "fire();};window.parent.YAHOO.widget.Module." +
+                                "textResizeEvent.fire();</script></head>" + 
+                                "<body></body></html>";
+
+                        oIFrame.src = "data:text/html;charset=utf-8," + 
+                            encodeURIComponent(sHTML);
+
+                    }
+
+                    oIFrame.id = "_yuiResizeMonitor";
+                    
+                    /*
+                        Need to set "position" property before inserting the 
+                        iframe into the document or Safari's status bar will 
+                        forever indicate the iframe is loading 
+                        (See SourceForge bug #1723064)
+                    */
+                    
+                    oIFrame.style.position = "absolute";
+                    oIFrame.style.visibility = "hidden";
+        
+                    document.body.appendChild(oIFrame);
+        
+                    oIFrame.style.width = "10em";
+                    oIFrame.style.height = "10em";
+                    oIFrame.style.top = (-1 * oIFrame.offsetHeight) + "px";
+                    oIFrame.style.left = (-1 * oIFrame.offsetWidth) + "px";
+                    oIFrame.style.borderWidth = "0";
+                    oIFrame.style.visibility = "visible";
+        
+                    if (YAHOO.env.ua.webkit) {
+        
+                        oDoc = oIFrame.contentWindow.document;
+        
+                        oDoc.open();
+                        oDoc.close();
+        
+                    }
+
+                }
+        
+                if (oIFrame && oIFrame.contentWindow) {
+
+                    Module.textResizeEvent.subscribe(this.onDomResize, 
+                        this, true);
+        
+                    if (!Module.textResizeInitialized) {
+
+                        if (!Event.on(oIFrame.contentWindow, "resize", 
+                            fireTextResize)) {
+
+                            /*
+                                 This will fail in IE if document.domain has 
+                                 changed, so we must change the listener to 
+                                 use the oIFrame element instead
+                            */
+
+                            Event.on(oIFrame, "resize", fireTextResize);
+
+                        }
+
+                        Module.textResizeInitialized = true;
+
+                    }
+
+                    this.resizeMonitor = oIFrame;
+
+                }
+        
+            }
+        
+        },
+        
+        /**
+        * Event handler fired when the resize monitor element is resized.
+        * @method onDomResize
+        * @param {DOMEvent} e The DOM resize event
+        * @param {Object} obj The scope object passed to the handler
+        */
+        onDomResize: function (e, obj) {
+        
+            var nLeft = -1 * this.resizeMonitor.offsetWidth,
+                nTop = -1 * this.resizeMonitor.offsetHeight;
+        
+            this.resizeMonitor.style.top = nTop + "px";
+            this.resizeMonitor.style.left =  nLeft + "px";
+        
+        },
+        
+        /**
+        * Sets the Module's header content to the HTML specified, or appends 
+        * the passed element to the header. If no header is present, one will 
+        * be automatically created.
+        * @method setHeader
+        * @param {String} headerContent The HTML used to set the header 
+        * <em>OR</em>
+        * @param {HTMLElement} headerContent The HTMLElement to append to 
+        * the header
+        */
+        setHeader: function (headerContent) {
+
+            var oHeader = this.header || (this.header = createHeader());
+        
+            if (typeof headerContent == "string") {
+
+                oHeader.innerHTML = headerContent;
+
+            } else {
+
+                oHeader.innerHTML = "";
+                oHeader.appendChild(headerContent);
+
+            }
+        
+            this.changeHeaderEvent.fire(headerContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the header. If no header is present, 
+        * one will be automatically created.
+        * @method appendToHeader
+        * @param {HTMLElement} element The element to append to the header
+        */
+        appendToHeader: function (element) {
+
+            var oHeader = this.header || (this.header = createHeader());
+        
+            oHeader.appendChild(element);
+
+            this.changeHeaderEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Sets the Module's body content to the HTML specified, or appends the
+        * passed element to the body. If no body is present, one will be 
+        * automatically created.
+        * @method setBody
+        * @param {String} bodyContent The HTML used to set the body <em>OR</em>
+        * @param {HTMLElement} bodyContent The HTMLElement to append to the body
+        */
+        setBody: function (bodyContent) {
+
+            var oBody = this.body || (this.body = createBody());
+        
+            if (typeof bodyContent == "string") {
+
+                oBody.innerHTML = bodyContent;
+
+            } else {
+
+                oBody.innerHTML = "";
+                oBody.appendChild(bodyContent);
+
+            }
+        
+            this.changeBodyEvent.fire(bodyContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the body. If no body is present, one 
+        * will be automatically created.
+        * @method appendToBody
+        * @param {HTMLElement} element The element to append to the body
+        */
+        appendToBody: function (element) {
+
+            var oBody = this.body || (this.body = createBody());
+        
+            oBody.appendChild(element);
+
+            this.changeBodyEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * 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.
+        * @method setFooter
+        * @param {String} footerContent The HTML used to set the footer 
+        * <em>OR</em>
+        * @param {HTMLElement} footerContent The HTMLElement to append to 
+        * the footer
+        */
+        setFooter: function (footerContent) {
+
+            var oFooter = this.footer || (this.footer = createFooter());
+        
+            if (typeof footerContent == "string") {
+
+                oFooter.innerHTML = footerContent;
+
+            } else {
+
+                oFooter.innerHTML = "";
+                oFooter.appendChild(footerContent);
+
+            }
+        
+            this.changeFooterEvent.fire(footerContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the footer. If no footer is present, 
+        * one will be automatically created.
+        * @method appendToFooter
+        * @param {HTMLElement} element The element to append to the footer
+        */
+        appendToFooter: function (element) {
+
+            var oFooter = this.footer || (this.footer = createFooter());
+        
+            oFooter.appendChild(element);
+
+            this.changeFooterEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * 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.
+        * @method render
+        * @param {String} appendToNode The element id to which the Module 
+        * should be appended to prior to rendering <em>OR</em>
+        * @param {HTMLElement} appendToNode The element to which the Module 
+        * should be appended to prior to rendering
+        * @param {HTMLElement} moduleElement OPTIONAL. The element that 
+        * represents the actual Standard Module container.
+        * @return {Boolean} Success or failure of the render
+        */
+        render: function (appendToNode, moduleElement) {
+        
+            var me = this,
+                firstChild;
+        
+            function appendTo(element) {
+                if (typeof element == "string") {
+                    element = document.getElementById(element);
+                }
+        
+                if (element) {
+                    element.appendChild(me.element);
+                    me.appendEvent.fire();
+                }
+            }
+        
+            this.beforeRenderEvent.fire();
+        
+            if (! moduleElement) {
+                moduleElement = this.element;
+            }
+        
+            if (appendToNode) {
+
+                appendTo(appendToNode);
+
+            } else { 
+
+                /*
+                     No node was passed in. If the element is not already in 
+                     the Dom, this fails
+                */
+
+                if (! Dom.inDocument(this.element)) {
+
+
+                    return false;
+
+                }
+
+            }
+        
+            // Need to get everything into the DOM if it isn't already
+        
+            if (this.header && ! Dom.inDocument(this.header)) {
+
+                /*
+                    There is a header, but it's not in the DOM yet... 
+                    need to add it
+                */
+
+                firstChild = moduleElement.firstChild;
+
+                if (firstChild) { // Insert before first child if exists
+
+                    moduleElement.insertBefore(this.header, firstChild);
+
+                } else { // Append to empty body because there are no children
+
+                    moduleElement.appendChild(this.header);
+
+                }
+
+            }
+        
+            if (this.body && ! Dom.inDocument(this.body)) {
+
+                /*
+                     There is a body, but it's not in the DOM yet... 
+                     need to add it
+                */
+
+
+                // Insert before footer if exists in DOM
+
+                if (this.footer && Dom.isAncestor(
+                    this.moduleElement, this.footer)) { 
+
+                    moduleElement.insertBefore(this.body, this.footer);
+
+                } else { // Append to element because there is no footer
+
+                    moduleElement.appendChild(this.body);
+
+                }
+
+            }
+        
+            if (this.footer && ! Dom.inDocument(this.footer)) {
+
+                /*
+                     There is a footer, but it's not in the DOM yet... 
+                     need to add it
+                */
+
+                moduleElement.appendChild(this.footer);
+
+            }
+        
+            this.renderEvent.fire();
+            return true;
+        },
+        
+        /**
+        * Removes the Module element from the DOM and sets all child elements 
+        * to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            var parent,
+                e;
+        
+            if (this.element) {
+                Event.purgeElement(this.element, true);
+                parent = this.element.parentNode;
+            }
+
+            if (parent) {
+                parent.removeChild(this.element);
+            }
+        
+            this.element = null;
+            this.header = null;
+            this.body = null;
+            this.footer = null;
+
+            Module.textResizeEvent.unsubscribe(this.onDomResize, this);
+
+            this.cfg.destroy();
+            this.cfg = null;
+
+            this.destroyEvent.fire();
+        
+            for (e in this) {
+                if (e instanceof CustomEvent) {
+                    e.unsubscribeAll();
+                }
+            }
+
+        },
+        
+        /**
+        * 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.
+        * @method show
+        */
+        show: function () {
+            this.cfg.setProperty("visible", true);
+        },
+        
+        /**
+        * 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.
+        * @method hide
+        */
+        hide: function () {
+            this.cfg.setProperty("visible", false);
+        },
+        
+        // BUILT-IN EVENT HANDLERS FOR MODULE //
+        
+        /**
+        * Default event handler for changing the visibility property of a 
+        * Module. By default, this is achieved by switching the "display" style 
+        * between "block" and "none".
+        * This method is responsible for firing showEvent and hideEvent.
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        * @method configVisible
+        */
+        configVisible: function (type, args, obj) {
+            var visible = args[0];
+            if (visible) {
+                this.beforeShowEvent.fire();
+                Dom.setStyle(this.element, "display", "block");
+                this.showEvent.fire();
+            } else {
+                this.beforeHideEvent.fire();
+                Dom.setStyle(this.element, "display", "none");
+                this.hideEvent.fire();
+            }
+        },
+        
+        /**
+        * Default event handler for the "monitorresize" configuration property
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        * @method configMonitorResize
+        */
+        configMonitorResize: function (type, args, obj) {
+
+            var monitor = args[0];
+
+            if (monitor) {
+
+                this.initResizeMonitor();
+
+            } else {
+
+                Module.textResizeEvent.unsubscribe(
+                    this.onDomResize, this, true);
+
+                this.resizeMonitor = null;
+            }
+
+        },
+        
+        /**
+        * Returns a String representation of the Object.
+        * @method toString
+        * @return {String} The string representation of the Module
+        */
+        toString: function () {
+            return "Module " + this.id;
+        }
+        
+    };
+    
+    YAHOO.lang.augmentProto(Module, YAHOO.util.EventProvider);
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Overlay
+    * @extends Module
+    * @param {String} el The element ID representing the Overlay <em>OR</em>
+    * @param {HTMLElement} el The element representing the Overlay
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Overlay. See configuration 
+    * documentation for more details.
+    * @constructor
+    */
+    YAHOO.widget.Overlay = function (el, userConfig) {
+    
+        YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
+    
+    };
+
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Module = YAHOO.widget.Module,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        Overlay = YAHOO.widget.Overlay,
+        
+        m_oIFrameTemplate,
+
+        /**
+        * Constant representing the name of the Overlay's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_MOVE": "beforeMove",
+            "MOVE": "move"
+        
+        },
+        
+        /**
+        * Constant representing the Overlay's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "X": { 
+                key: "x", 
+                validator: Lang.isNumber, 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "Y": { 
+                key: "y", 
+                validator: Lang.isNumber, 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "XY": { 
+                key: "xy", 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "CONTEXT": { 
+                key: "context", 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "FIXED_CENTER": { 
+                key: "fixedcenter", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["iframe", "visible"] 
+            },
+        
+            "WIDTH": { 
+                key: "width", 
+                suppressEvent: true, 
+                supercedes: ["context", "fixedcenter", "iframe"] 
+            }, 
+        
+            "HEIGHT": { 
+                key: "height", 
+                suppressEvent: true, 
+                supercedes: ["context", "fixedcenter", "iframe"] 
+            }, 
+        
+            "ZINDEX": { 
+                key: "zindex", 
+                value: null 
+            }, 
+        
+            "CONSTRAIN_TO_VIEWPORT": { 
+                key: "constraintoviewport", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["iframe", "x", "y", "xy"] 
+            }, 
+        
+            "IFRAME": { 
+                key: "iframe", 
+                value: (YAHOO.env.ua.ie == 6 ? true : false), 
+                validator: Lang.isBoolean, 
+                supercedes: ["zindex"] 
+            }
+        
+        };
+
+
+    /**
+    * The URL that will be placed in the iframe
+    * @property YAHOO.widget.Overlay.IFRAME_SRC
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.IFRAME_SRC = "javascript:false;";
+
+    /**
+    * Number representing how much the iframe shim should be offset from each 
+    * side of an Overlay instance.
+    * @property YAHOO.widget.Overlay.IFRAME_SRC
+    * @default 3
+    * @static
+    * @final
+    * @type Number
+    */
+    Overlay.IFRAME_OFFSET = 3;
+    
+    /**
+    * Constant representing the top left corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.TOP_LEFT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.TOP_LEFT = "tl";
+    
+    /**
+    * Constant representing the top right corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.TOP_RIGHT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.TOP_RIGHT = "tr";
+    
+    /**
+    * Constant representing the top bottom left corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.BOTTOM_LEFT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.BOTTOM_LEFT = "bl";
+    
+    /**
+    * Constant representing the bottom right corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.BOTTOM_RIGHT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.BOTTOM_RIGHT = "br";
+    
+    /**
+    * Constant representing the default CSS class used for an Overlay
+    * @property YAHOO.widget.Overlay.CSS_OVERLAY
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.CSS_OVERLAY = "yui-overlay";
+    
+    
+    /**
+    * A singleton CustomEvent used for reacting to the DOM event for 
+    * window scroll
+    * @event YAHOO.widget.Overlay.windowScrollEvent
+    */
+    Overlay.windowScrollEvent = new CustomEvent("windowScroll");
+    
+    /**
+    * A singleton CustomEvent used for reacting to the DOM event for
+    * window resize
+    * @event YAHOO.widget.Overlay.windowResizeEvent
+    */
+    Overlay.windowResizeEvent = new CustomEvent("windowResize");
+    
+    /**
+    * The DOM event handler used to fire the CustomEvent for window scroll
+    * @method YAHOO.widget.Overlay.windowScrollHandler
+    * @static
+    * @param {DOMEvent} e The DOM scroll event
+    */
+    Overlay.windowScrollHandler = function (e) {
+    
+        if (YAHOO.env.ua.ie) {
+    
+            if (! window.scrollEnd) {
+    
+                window.scrollEnd = -1;
+    
+            }
+    
+            clearTimeout(window.scrollEnd);
+    
+            window.scrollEnd = setTimeout(function () { 
+            
+                Overlay.windowScrollEvent.fire(); 
+    
+            }, 1);
+    
+        } else {
+    
+            Overlay.windowScrollEvent.fire();
+    
+        }
+    
+    };
+    
+    /**
+    * The DOM event handler used to fire the CustomEvent for window resize
+    * @method YAHOO.widget.Overlay.windowResizeHandler
+    * @static
+    * @param {DOMEvent} e The DOM resize event
+    */
+    Overlay.windowResizeHandler = function (e) {
+    
+        if (YAHOO.env.ua.ie) {
+    
+            if (! window.resizeEnd) {
+                window.resizeEnd = -1;
+            }
+    
+            clearTimeout(window.resizeEnd);
+    
+            window.resizeEnd = setTimeout(function () {
+    
+                Overlay.windowResizeEvent.fire(); 
+    
+            }, 100);
+    
+        } else {
+    
+            Overlay.windowResizeEvent.fire();
+    
+        }
+    
+    };
+    
+    /**
+    * A boolean that indicated whether the window resize and scroll events have 
+    * already been subscribed to.
+    * @property YAHOO.widget.Overlay._initialized
+    * @private
+    * @type Boolean
+    */
+    Overlay._initialized = null;
+    
+    if (Overlay._initialized === null) {
+    
+        Event.on(window, "scroll", Overlay.windowScrollHandler);
+        Event.on(window, "resize", Overlay.windowResizeHandler);
+    
+        Overlay._initialized = true;
+    
+    }
+    
+    YAHOO.extend(Overlay, Module, {
+    
+        /**
+        * The Overlay initialization method, which is executed for Overlay and  
+        * all of its subclasses. This method is automatically called by the 
+        * constructor, and  sets up all DOM references for pre-existing markup, 
+        * and creates required markup if it is not already present.
+        * @method init
+        * @param {String} el The element ID representing the Overlay <em>OR</em>
+        * @param {HTMLElement} el The element representing the Overlay
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Overlay. 
+        * See configuration documentation for more details.
+        */
+        init: function (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
+            */
+    
+            Overlay.superclass.init.call(this, el/*, userConfig*/);  
+            
+            this.beforeInitEvent.fire(Overlay);
+            
+            Dom.addClass(this.element, Overlay.CSS_OVERLAY);
+            
+            if (userConfig) {
+    
+                this.cfg.applyConfig(userConfig, true);
+    
+            }
+            
+            if (this.platform == "mac" && YAHOO.env.ua.gecko) {
+    
+                if (! Config.alreadySubscribed(this.showEvent,
+                    this.showMacGeckoScrollbars, this)) {
+    
+                    this.showEvent.subscribe(this.showMacGeckoScrollbars, 
+                        this, true);
+    
+                }
+    
+                if (! Config.alreadySubscribed(this.hideEvent, 
+                    this.hideMacGeckoScrollbars, this)) {
+    
+                    this.hideEvent.subscribe(this.hideMacGeckoScrollbars, 
+                        this, true);
+    
+                }
+    
+            }
+            
+            this.initEvent.fire(Overlay);
+        
+        },
+        
+        /**
+        * Initializes the custom events for Overlay which are fired  
+        * automatically at appropriate times by the Overlay class.
+        * @method initEvents
+        */
+        initEvents: function () {
+    
+            Overlay.superclass.initEvents.call(this);
+            
+            var SIGNATURE = CustomEvent.LIST;
+            
+            /**
+            * CustomEvent fired before the Overlay is moved.
+            * @event beforeMoveEvent
+            * @param {Number} x x coordinate
+            * @param {Number} y y coordinate
+            */
+            this.beforeMoveEvent = this.createEvent(EVENT_TYPES.BEFORE_MOVE);
+            this.beforeMoveEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired after the Overlay is moved.
+            * @event moveEvent
+            * @param {Number} x x coordinate
+            * @param {Number} y y coordinate
+            */
+            this.moveEvent = this.createEvent(EVENT_TYPES.MOVE);
+            this.moveEvent.signature = SIGNATURE;
+        
+        },
+        
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the Overlay's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+    
+            Overlay.superclass.initDefaultConfig.call(this);
+            
+            
+            // Add overlay config properties //
+            
+            /**
+            * The absolute x-coordinate position of the Overlay
+            * @config x
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.X.key, { 
+    
+                handler: this.configX, 
+                validator: DEFAULT_CONFIG.X.validator, 
+                suppressEvent: DEFAULT_CONFIG.X.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.X.supercedes
+    
+            });
+        
+    
+            /**
+            * The absolute y-coordinate position of the Overlay
+            * @config y
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.Y.key, {
+    
+                handler: this.configY, 
+                validator: DEFAULT_CONFIG.Y.validator, 
+                suppressEvent: DEFAULT_CONFIG.Y.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.Y.supercedes
+    
+            });
+        
+    
+            /**
+            * An array with the absolute x and y positions of the Overlay
+            * @config xy
+            * @type Number[]
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.XY.key, {
+            
+                handler: this.configXY, 
+                suppressEvent: DEFAULT_CONFIG.XY.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.XY.supercedes
+            
+            });
+        
+    
+            /**
+            * 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.
+            * @config context
+            * @type Array
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key, {
+            
+                handler: this.configContext, 
+                suppressEvent: DEFAULT_CONFIG.CONTEXT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.CONTEXT.supercedes
+            
+            });
+        
+    
+            /**
+            * True if the Overlay should be anchored to the center of 
+            * the viewport.
+            * @config fixedcenter
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key, {
+            
+                handler: this.configFixedCenter,
+                value: DEFAULT_CONFIG.FIXED_CENTER.value, 
+                validator: DEFAULT_CONFIG.FIXED_CENTER.validator, 
+                supercedes: DEFAULT_CONFIG.FIXED_CENTER.supercedes
+            
+            });
+        
+    
+            /**
+            * CSS width of the Overlay.
+            * @config width
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key, {
+            
+                handler: this.configWidth, 
+                suppressEvent: DEFAULT_CONFIG.WIDTH.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.WIDTH.supercedes
+            
+            });
+            
+            /**
+            * CSS height of the Overlay.
+            * @config height
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key, {
+            
+                handler: this.configHeight, 
+                suppressEvent: DEFAULT_CONFIG.HEIGHT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.HEIGHT.supercedes
+            
+            });
+            
+            /**
+            * CSS z-index of the Overlay.
+            * @config zIndex
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key, {
+    
+                handler: this.configzIndex,
+                value: DEFAULT_CONFIG.ZINDEX.value
+    
+            });
+            
+            /**
+            * True if the Overlay should be prevented from being positioned 
+            * out of the viewport.
+            * @config constraintoviewport
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, {
+            
+                handler: this.configConstrainToViewport, 
+                value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
+                validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
+                supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes
+            
+            });
+            
+            /**
+            * @config iframe
+            * @description Boolean indicating whether or not the Overlay should 
+            * have an IFRAME shim; used to prevent <SELECT> elements from 
+            * poking through an Overlay instance in IE6.  When set to "true", 
+            * the iframe shim is created when the Overlay instance is intially
+            * made visible.
+            * @type Boolean
+            * @default true for IE6 and below, false for all other browsers.
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key, {
+            
+                handler: this.configIframe, 
+                value: DEFAULT_CONFIG.IFRAME.value, 
+                validator: DEFAULT_CONFIG.IFRAME.validator, 
+                supercedes: DEFAULT_CONFIG.IFRAME.supercedes
+            
+            });
+        
+        },
+        
+        /**
+        * Moves the Overlay to the specified position. This function is  
+        * identical to calling this.cfg.setProperty("xy", [x,y]);
+        * @method moveTo
+        * @param {Number} x The Overlay's new x position
+        * @param {Number} y The Overlay's new y position
+        */
+        moveTo: function (x, y) {
+    
+            this.cfg.setProperty("xy", [x, y]);
+    
+        },
+        
+        /**
+        * Adds a CSS class ("hide-scrollbars") and removes a CSS class 
+        * ("show-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
+        * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435)
+        * @method hideMacGeckoScrollbars
+        */
+        hideMacGeckoScrollbars: function () {
+    
+            Dom.removeClass(this.element, "show-scrollbars");
+            Dom.addClass(this.element, "hide-scrollbars");
+    
+        },
+        
+        /**
+        * Adds a CSS class ("show-scrollbars") and removes a CSS class 
+        * ("hide-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
+        * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435)
+        * @method showMacGeckoScrollbars
+        */
+        showMacGeckoScrollbars: function () {
+    
+            Dom.removeClass(this.element, "hide-scrollbars");
+            Dom.addClass(this.element, "show-scrollbars");
+    
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the "visible" property is 
+        * changed.  This method is responsible for firing showEvent
+        * and hideEvent.
+        * @method configVisible
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configVisible: function (type, args, obj) {
+    
+            var visible = args[0],
+                currentVis = Dom.getStyle(this.element, "visibility"),
+                effect = this.cfg.getProperty("effect"),
+                effectInstances = [],
+                isMacGecko = (this.platform == "mac" && YAHOO.env.ua.gecko),
+                alreadySubscribed = Config.alreadySubscribed,
+                eff, ei, e, i, j, k, h,
+                nEffects,
+                nEffectInstances;
+    
+    
+            if (currentVis == "inherit") {
+    
+                e = this.element.parentNode;
+    
+                while (e.nodeType != 9 && e.nodeType != 11) {
+    
+                    currentVis = Dom.getStyle(e, "visibility");
+    
+                    if (currentVis != "inherit") { 
+    
+                        break; 
+    
+                    }
+    
+                    e = e.parentNode;
+    
+                }
+    
+                if (currentVis == "inherit") {
+    
+                    currentVis = "visible";
+                
+                }
+    
+            }
+        
+    
+            if (effect) {
+    
+                if (effect instanceof Array) {
+
+                    nEffects = effect.length;
+    
+                    for (i = 0; i < nEffects; i++) {
+    
+                        eff = effect[i];
+    
+                        effectInstances[effectInstances.length] = 
+                            eff.effect(this, eff.duration);
+    
+                    }
+    
+                } else {
+    
+                    effectInstances[effectInstances.length] = 
+                        effect.effect(this, effect.duration);
+    
+                }
+    
+            }
+    
+        
+            if (visible) { // Show
+    
+                if (isMacGecko) {
+    
+                    this.showMacGeckoScrollbars();
+    
+                }
+                
+    
+                if (effect) { // Animate in
+    
+    
+                    if (visible) { // Animate in if not showing
+    
+    
+                        if (currentVis != "visible" || currentVis === "") {
+    
+                            this.beforeShowEvent.fire();
+
+                            nEffectInstances = effectInstances.length;
+    
+                            for (j = 0; j < nEffectInstances; j++) {
+    
+                                ei = effectInstances[j];
+    
+                                if (j === 0 && !alreadySubscribed(
+                                        ei.animateInCompleteEvent, 
+                                        this.showEvent.fire, this.showEvent)) {
+    
+                                    /*
+                                         Delegate showEvent until end 
+                                         of animateInComplete
+                                    */
+    
+                                    ei.animateInCompleteEvent.subscribe(
+                                     this.showEvent.fire, this.showEvent, true);
+    
+                                }
+    
+                                ei.animateIn();
+    
+                            }
+    
+                        }
+    
+                    }
+    
+                } else { // Show
+    
+                    if (currentVis != "visible" || currentVis === "") {
+    
+                        this.beforeShowEvent.fire();
+    
+                        Dom.setStyle(this.element, "visibility", "visible");
+    
+                        this.cfg.refireEvent("iframe");
+                        this.showEvent.fire();
+    
+                    }
+        
+                }
+        
+            } else { // Hide
+    
+                if (isMacGecko) {
+    
+                    this.hideMacGeckoScrollbars();
+    
+                }
+                    
+                if (effect) { // Animate out if showing
+    
+                    if (currentVis == "visible") {
+    
+                        this.beforeHideEvent.fire();
+
+                        nEffectInstances = effectInstances.length;
+    
+                        for (k = 0; k < nEffectInstances; k++) {
+    
+                            h = effectInstances[k];
+    
+                            if (k === 0 && !alreadySubscribed(
+                                h.animateOutCompleteEvent, this.hideEvent.fire, 
+                                this.hideEvent)) {
+    
+                                /*
+                                     Delegate hideEvent until end 
+                                     of animateOutComplete
+                                */
+    
+                                h.animateOutCompleteEvent.subscribe(
+                                    this.hideEvent.fire, this.hideEvent, true);
+    
+                            }
+    
+                            h.animateOut();
+    
+                        }
+    
+                    } else if (currentVis === "") {
+    
+                        Dom.setStyle(this.element, "visibility", "hidden");
+    
+                    }
+    
+                } else { // Simple hide
+    
+                    if (currentVis == "visible" || currentVis === "") {
+    
+                        this.beforeHideEvent.fire();
+    
+                        Dom.setStyle(this.element, "visibility", "hidden");
+
+                        this.hideEvent.fire();
+    
+                    }
+    
+                }
+    
+            }
+    
+        },
+        
+        /**
+        * Center event handler used for centering on scroll/resize, but only if 
+        * the Overlay is visible
+        * @method doCenterOnDOMEvent
+        */
+        doCenterOnDOMEvent: function () {
+    
+            if (this.cfg.getProperty("visible")) {
+    
+                this.center();
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "fixedcenter" property 
+        * is changed.
+        * @method configFixedCenter
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configFixedCenter: function (type, args, obj) {
+    
+            var val = args[0],
+                alreadySubscribed = Config.alreadySubscribed,
+                windowResizeEvent = Overlay.windowResizeEvent,
+                windowScrollEvent = Overlay.windowScrollEvent;
+            
+            if (val) {
+    
+                this.center();
+            
+                if (!alreadySubscribed(this.beforeShowEvent, 
+                    this.center, this)) {
+    
+                    this.beforeShowEvent.subscribe(this.center);
+    
+                }
+            
+                if (!alreadySubscribed(windowResizeEvent, 
+                    this.doCenterOnDOMEvent, this)) {
+    
+                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, 
+                        this, true);
+    
+                }
+            
+                if (!alreadySubscribed(windowScrollEvent, 
+                    this.doCenterOnDOMEvent, this)) {
+        
+                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, 
+                        this, true);
+    
+                }
+    
+            } else {
+    
+                this.beforeShowEvent.unsubscribe(this.center);
+    
+                windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
+                windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "height" property is changed.
+        * @method configHeight
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configHeight: function (type, args, obj) {
+    
+            var height = args[0],
+                el = this.element;
+    
+            Dom.setStyle(el, "height", height);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "width" property is changed.
+        * @method configWidth
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configWidth: function (type, args, obj) {
+    
+            var width = args[0],
+                el = this.element;
+    
+            Dom.setStyle(el, "width", width);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "zIndex" property is changed.
+        * @method configzIndex
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configzIndex: function (type, args, obj) {
+    
+            var zIndex = args[0],
+                el = this.element;
+        
+            if (! zIndex) {
+    
+                zIndex = Dom.getStyle(el, "zIndex");
+        
+                if (! zIndex || isNaN(zIndex)) {
+    
+                    zIndex = 0;
+    
+                }
+    
+            }
+            
+            if (this.iframe) {
+    
+                if (zIndex <= 0) {
+    
+                    zIndex = 1;
+    
+                }
+    
+                Dom.setStyle(this.iframe, "zIndex", (zIndex - 1));
+            }
+            
+            Dom.setStyle(el, "zIndex", zIndex);
+            this.cfg.setProperty("zIndex", zIndex, true);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "xy" property is changed.
+        * @method configXY
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configXY: function (type, args, obj) {
+    
+            var pos = args[0],
+                x = pos[0],
+                y = pos[1];
+            
+            this.cfg.setProperty("x", x);
+            this.cfg.setProperty("y", y);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "x" property is changed.
+        * @method configX
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configX: function (type, args, obj) {
+    
+            var x = args[0],
+                y = this.cfg.getProperty("y");
+            
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            Dom.setX(this.element, x, true);
+            
+            this.cfg.setProperty("xy", [x, y], true);
+           
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "y" property is changed.
+        * @method configY
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configY: function (type, args, obj) {
+    
+            var x = this.cfg.getProperty("x"),
+                y = args[0];
+        
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            Dom.setY(this.element, y, true);
+            
+            this.cfg.setProperty("xy", [x, y], true);
+            
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * Shows the iframe shim, if it has been enabled.
+        * @method showIframe
+        */
+        showIframe: function () {
+
+            var oIFrame = this.iframe,
+                oParentNode;
+
+            if (oIFrame) {
+    
+                oParentNode = this.element.parentNode;
+
+                if (oParentNode != oIFrame.parentNode) {
+
+                    oParentNode.appendChild(oIFrame);
+                
+                }
+
+                oIFrame.style.display = "block";
+    
+            }
+    
+        },
+        
+        /**
+        * Hides the iframe shim, if it has been enabled.
+        * @method hideIframe
+        */
+        hideIframe: function () {
+    
+            if (this.iframe) {
+    
+                this.iframe.style.display = "none";
+    
+            }
+    
+        },
+
+        /**
+        * Syncronizes the size and position of iframe shim to that of its 
+        * corresponding Overlay instance.
+        * @method syncIframe
+        */
+        syncIframe: function () {
+
+            var oIFrame = this.iframe,
+                oElement = this.element,
+                nOffset = Overlay.IFRAME_OFFSET,
+                nDimensionOffset = (nOffset * 2),
+                aXY;
+
+
+            if (oIFrame) {
+
+                // Size <iframe>
+
+                oIFrame.style.width = 
+                    (oElement.offsetWidth + nDimensionOffset + "px");
+
+                oIFrame.style.height = 
+                    (oElement.offsetHeight + nDimensionOffset + "px");
+
+
+                // Position <iframe>
+
+                aXY = this.cfg.getProperty("xy");
+
+                if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) {
+
+                    this.syncPosition();
+
+                    aXY = this.cfg.getProperty("xy");
+
+                }
+
+                Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]);
+
+            }
+        
+        },
+
+        
+        /**
+        * The default event handler fired when the "iframe" property is changed.
+        * @method configIframe
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configIframe: function (type, args, obj) {
+
+            var bIFrame = args[0];
+
+            function createIFrame() {
+
+                var oIFrame = this.iframe,
+                    oElement = this.element,
+                    oParent,
+                    aXY;
+
+
+                if (!oIFrame) {
+
+                    if (!m_oIFrameTemplate) {
+    
+                        m_oIFrameTemplate = document.createElement("iframe");
+
+                        if (this.isSecure) {
+        
+                            m_oIFrameTemplate.src = Overlay.IFRAME_SRC;
+        
+                        }
+
+                        /*
+                            Set the opacity of the <iframe> to 0 so that it 
+                            doesn't modify the opacity of any transparent 
+                            elements that may be on top of it (like a shadow).
+                        */
+        
+                        if (YAHOO.env.ua.ie) {
+        
+                            m_oIFrameTemplate.style.filter = "alpha(opacity=0)";
+        
+                            /*
+                                 Need to set the "frameBorder" property to 0 
+                                 supress the default <iframe> border in IE.  
+                                 Setting the CSS "border" property alone 
+                                 doesn't supress it.
+                            */
+        
+                            m_oIFrameTemplate.frameBorder = 0;
+        
+                        }
+                        else {
+        
+                            m_oIFrameTemplate.style.opacity = "0";
+                        
+                        }
+
+                        m_oIFrameTemplate.style.position = "absolute";
+                        m_oIFrameTemplate.style.border = "none";
+                        m_oIFrameTemplate.style.margin = "0";
+                        m_oIFrameTemplate.style.padding = "0";
+                        m_oIFrameTemplate.style.display = "none";
+    
+                    }
+
+                    oIFrame = m_oIFrameTemplate.cloneNode(false);
+
+                    oParent = oElement.parentNode;
+
+                    if (oParent) {
+
+                        oParent.appendChild(oIFrame);
+
+                    } else {
+
+                        document.body.appendChild(oIFrame);
+
+                    }
+                    
+                    this.iframe = oIFrame;
+
+                }
+
+
+                /*
+                     Show the <iframe> before positioning it since the "setXY" 
+                     method of DOM requires the element be in the document 
+                     and visible.
+                */
+
+                this.showIframe();
+
+
+                /*
+                     Syncronize the size and position of the <iframe> to that 
+                     of the Overlay.
+                */
+                
+                this.syncIframe();
+
+
+                // Add event listeners to update the <iframe> when necessary
+
+                if (!this._hasIframeEventListeners) {
+
+                    this.showEvent.subscribe(this.showIframe);
+                    this.hideEvent.subscribe(this.hideIframe);
+                    this.changeContentEvent.subscribe(this.syncIframe);
+
+                    this._hasIframeEventListeners = true;
+                    
+                }
+                
+            }
+
+
+            function onBeforeShow() {
+            
+                createIFrame.call(this);
+        
+                this.beforeShowEvent.unsubscribe(onBeforeShow);
+                
+                this._iframeDeferred = false;
+            
+            }
+            
+
+            if (bIFrame) { // <iframe> shim is enabled
+                
+                if (this.cfg.getProperty("visible")) {
+
+                    createIFrame.call(this);
+                
+                }
+                else {
+
+                    if (!this._iframeDeferred) {
+
+                        this.beforeShowEvent.subscribe(onBeforeShow);
+
+                        this._iframeDeferred = true;
+                    
+                    }
+                
+                }
+    
+            } else {    // <iframe> shim is disabled
+    
+                this.hideIframe();
+
+                if (this._hasIframeEventListeners) {
+
+                    this.showEvent.unsubscribe(this.showIframe);
+                    this.hideEvent.unsubscribe(this.hideIframe);
+                    this.changeContentEvent.unsubscribe(this.syncIframe);
+
+                    this._hasIframeEventListeners = false;
+
+                }
+                
+            }
+    
+        },
+        
+        
+        /**
+        * The default event handler fired when the "constraintoviewport" 
+        * property is changed.
+        * @method configConstrainToViewport
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for 
+        * the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configConstrainToViewport: function (type, args, obj) {
+    
+            var val = args[0];
+    
+            if (val) {
+    
+                if (! Config.alreadySubscribed(this.beforeMoveEvent, 
+                    this.enforceConstraints, this)) {
+    
+                    this.beforeMoveEvent.subscribe(this.enforceConstraints, 
+                        this, true);
+    
+                }
+    
+            } else {
+    
+                this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "context" property 
+        * is changed.
+        * @method configContext
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configContext: function (type, args, obj) {
+    
+            var contextArgs = args[0],
+                contextEl,
+                elementMagnetCorner,
+                contextMagnetCorner;
+            
+            if (contextArgs) {
+            
+                contextEl = contextArgs[0];
+                elementMagnetCorner = contextArgs[1];
+                contextMagnetCorner = contextArgs[2];
+                
+                if (contextEl) {
+    
+                    if (typeof contextEl == "string") {
+    
+                        this.cfg.setProperty("context", 
+                            [document.getElementById(contextEl), 
+                                elementMagnetCorner, contextMagnetCorner], 
+                                true);
+    
+                    }
+                    
+                    if (elementMagnetCorner && contextMagnetCorner) {
+    
+                        this.align(elementMagnetCorner, contextMagnetCorner);
+    
+                    }
+    
+                }
+    
+            }
+    
+        },
+        
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * Aligns the Overlay to its context element using the specified corner 
+        * points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, 
+        * and BOTTOM_RIGHT.
+        * @method align
+        * @param {String} elementAlign  The String representing the corner of 
+        * the Overlay that should be aligned to the context element
+        * @param {String} contextAlign  The corner of the context element 
+        * that the elementAlign corner should stick to.
+        */
+        align: function (elementAlign, contextAlign) {
+    
+            var contextArgs = this.cfg.getProperty("context"),
+                me = this,
+                context,
+                element,
+                contextRegion;
+    
+    
+            function doAlign(v, h) {
+    
+                switch (elementAlign) {
+    
+                case Overlay.TOP_LEFT:
+    
+                    me.moveTo(h, v);
+    
+                    break;
+    
+                case Overlay.TOP_RIGHT:
+    
+                    me.moveTo((h - element.offsetWidth), v);
+    
+                    break;
+    
+                case Overlay.BOTTOM_LEFT:
+    
+                    me.moveTo(h, (v - element.offsetHeight));
+    
+                    break;
+    
+                case Overlay.BOTTOM_RIGHT:
+    
+                    me.moveTo((h - element.offsetWidth), 
+                        (v - element.offsetHeight));
+    
+                    break;
+    
+                }
+    
+            }
+    
+    
+            if (contextArgs) {
+            
+                context = contextArgs[0];
+                element = this.element;
+                me = this;
+                
+                if (! elementAlign) {
+    
+                    elementAlign = contextArgs[1];
+    
+                }
+                
+                if (! contextAlign) {
+    
+                    contextAlign = contextArgs[2];
+    
+                }
+                
+                if (element && context) {
+    
+                    contextRegion = Dom.getRegion(context);
+                    
+                    switch (contextAlign) {
+    
+                    case Overlay.TOP_LEFT:
+    
+                        doAlign(contextRegion.top, contextRegion.left);
+    
+                        break;
+    
+                    case Overlay.TOP_RIGHT:
+    
+                        doAlign(contextRegion.top, contextRegion.right);
+    
+                        break;
+    
+                    case Overlay.BOTTOM_LEFT:
+    
+                        doAlign(contextRegion.bottom, contextRegion.left);
+    
+                        break;
+    
+                    case Overlay.BOTTOM_RIGHT:
+    
+                        doAlign(contextRegion.bottom, contextRegion.right);
+    
+                        break;
+    
+                    }
+    
+                }
+    
+            }
+            
+        },
+        
+        /**
+        * The default event handler executed when the moveEvent is fired, if the 
+        * "constraintoviewport" is set to true.
+        * @method enforceConstraints
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        enforceConstraints: function (type, args, obj) {
+    
+            var pos = args[0],
+                x = pos[0],
+                y = pos[1],
+                offsetHeight = this.element.offsetHeight,
+                offsetWidth = this.element.offsetWidth,
+                viewPortWidth = Dom.getViewportWidth(),
+                viewPortHeight = Dom.getViewportHeight(),
+                scrollX = Dom.getDocumentScrollLeft(),
+                scrollY = Dom.getDocumentScrollTop(),
+                topConstraint = scrollY + 10,
+                leftConstraint = scrollX + 10,
+                bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,
+                rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;
+        
+    
+            if (x < leftConstraint) {
+    
+                x = leftConstraint;
+    
+            } else if (x > rightConstraint) {
+    
+                x = rightConstraint;
+    
+            }
+            
+            if (y < topConstraint) {
+    
+                y = topConstraint;
+    
+            } else if (y > bottomConstraint) {
+    
+                y = bottomConstraint;
+    
+            }
+            
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            this.cfg.setProperty("xy", [x, y], true);
+    
+        },
+        
+        /**
+        * Centers the container in the viewport.
+        * @method center
+        */
+        center: function () {
+    
+            var scrollX = Dom.getDocumentScrollLeft(),
+                scrollY = Dom.getDocumentScrollTop(),
+    
+                viewPortWidth = Dom.getClientWidth(),
+                viewPortHeight = Dom.getClientHeight(),
+                elementWidth = this.element.offsetWidth,
+                elementHeight = this.element.offsetHeight,
+                x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX,
+                y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
+            
+            this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
+            
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * 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.
+        * @method syncPosition
+        */
+        syncPosition: function () {
+    
+            var pos = Dom.getXY(this.element);
+    
+            this.cfg.setProperty("x", pos[0], true);
+            this.cfg.setProperty("y", pos[1], true);
+            this.cfg.setProperty("xy", pos, true);
+    
+        },
+        
+        /**
+        * Event handler fired when the resize monitor element is resized.
+        * @method onDomResize
+        * @param {DOMEvent} e The resize DOM event
+        * @param {Object} obj The scope object
+        */
+        onDomResize: function (e, obj) {
+    
+            var me = this;
+    
+            Overlay.superclass.onDomResize.call(this, e, obj);
+    
+            setTimeout(function () {
+                me.syncPosition();
+                me.cfg.refireEvent("iframe");
+                me.cfg.refireEvent("context");
+            }, 0);
+    
+        },
+
+        /**
+        * Places the Overlay on top of all other instances of 
+        * YAHOO.widget.Overlay.
+        * @method bringToTop
+        */
+        bringToTop: function() {
+    
+            var aOverlays = [],
+                oElement = this.element;
+    
+            function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {
+        
+                var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
+        
+                    sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),
+        
+                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 
+                        0 : parseInt(sZIndex1, 10),
+        
+                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 
+                        0 : parseInt(sZIndex2, 10);
+        
+                if (nZIndex1 > nZIndex2) {
+        
+                    return -1;
+        
+                } else if (nZIndex1 < nZIndex2) {
+        
+                    return 1;
+        
+                } else {
+        
+                    return 0;
+        
+                }
+        
+            }
+        
+            function isOverlayElement(p_oElement) {
+        
+                var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
+                    Panel = YAHOO.widget.Panel;
+            
+                if (oOverlay && !Dom.isAncestor(oElement, oOverlay)) {
+                
+                    if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
+        
+                        aOverlays[aOverlays.length] = p_oElement.parentNode;
+                    
+                    }
+                    else {
+        
+                        aOverlays[aOverlays.length] = p_oElement;
+        
+                    }
+                
+                }
+            
+            }
+            
+            Dom.getElementsBy(isOverlayElement, "DIV", document.body);
+    
+            aOverlays.sort(compareZIndexDesc);
+            
+            var oTopOverlay = aOverlays[0],
+                nTopZIndex;
+            
+            if (oTopOverlay) {
+    
+                nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");
+    
+                if (!isNaN(nTopZIndex) && oTopOverlay != oElement) {
+    
+                    this.cfg.setProperty("zindex", 
+                        (parseInt(nTopZIndex, 10) + 2));
+    
+                }
+            
+            }
+        
+        },
+        
+        /**
+        * Removes the Overlay element from the DOM and sets all child 
+        * elements to null.
+        * @method destroy
+        */
+        destroy: function () {
+    
+            if (this.iframe) {
+    
+                this.iframe.parentNode.removeChild(this.iframe);
+    
+            }
+        
+            this.iframe = null;
+        
+            Overlay.windowResizeEvent.unsubscribe(
+                this.doCenterOnDOMEvent, this);
+    
+            Overlay.windowScrollEvent.unsubscribe(
+                this.doCenterOnDOMEvent, this);
+        
+            Overlay.superclass.destroy.call(this);
+        },
+        
+        /**
+        * Returns a String representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Overlay.
+        */
+        toString: function () {
+    
+            return "Overlay " + this.id;
+    
+        }
+    
+    });
+    
+}());
+(function () {
+    
+    /**
+    * OverlayManager is used for maintaining the focus status of 
+    * multiple Overlays.
+    * @namespace YAHOO.widget
+    * @namespace YAHOO.widget
+    * @class OverlayManager
+    * @constructor
+    * @param {Array} overlays Optional. A collection of Overlays to register 
+    * with the manager.
+    * @param {Object} userConfig  The object literal representing the user 
+    * configuration of the OverlayManager
+    */
+    YAHOO.widget.OverlayManager = function (userConfig) {
+    
+        this.init(userConfig);
+    
+    };
+
+
+    var Overlay = YAHOO.widget.Overlay,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        CustomEvent = YAHOO.util.CustomEvent,
+        OverlayManager = YAHOO.widget.OverlayManager;
+
+    
+    /**
+    * The CSS class representing a focused Overlay
+    * @property OverlayManager.CSS_FOCUSED
+    * @static
+    * @final
+    * @type String
+    */
+    OverlayManager.CSS_FOCUSED = "focused";
+    
+    OverlayManager.prototype = {
+    
+        /**
+        * The class's constructor function
+        * @property contructor
+        * @type Function
+        */
+        constructor: OverlayManager,
+        
+        /**
+        * The array of Overlays that are currently registered
+        * @property overlays
+        * @type YAHOO.widget.Overlay[]
+        */
+        overlays: null,
+        
+        /**
+        * Initializes the default configuration of the OverlayManager
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+        
+            /**
+            * The collection of registered Overlays in use by 
+            * the OverlayManager
+            * @config overlays
+            * @type YAHOO.widget.Overlay[]
+            * @default null
+            */
+            this.cfg.addProperty("overlays", { suppressEvent: true } );
+        
+            /**
+            * The default DOM event that should be used to focus an Overlay
+            * @config focusevent
+            * @type String
+            * @default "mousedown"
+            */
+            this.cfg.addProperty("focusevent", { value: "mousedown" } );
+        
+        },
+        
+        /**
+        * Initializes the OverlayManager
+        * @method init
+        * @param {Overlay[]} overlays Optional. A collection of Overlays to 
+        * register with the manager.
+        * @param {Object} userConfig  The object literal representing the user 
+        * configuration of the OverlayManager
+        */
+        init: function (userConfig) {
+
+            /**
+            * The OverlayManager's Config object used for monitoring 
+            * configuration properties.
+            * @property cfg
+            * @type Config
+            */
+            this.cfg = new Config(this);
+        
+            this.initDefaultConfig();
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+            this.cfg.fireQueue();
+        
+            /**
+            * The currently activated Overlay
+            * @property activeOverlay
+            * @private
+            * @type YAHOO.widget.Overlay
+            */
+            var activeOverlay = null;
+        
+            /**
+            * Returns the currently focused Overlay
+            * @method getActive
+            * @return {Overlay} The currently focused Overlay
+            */
+            this.getActive = function () {
+                return activeOverlay;
+            };
+        
+            /**
+            * Focuses the specified Overlay
+            * @method focus
+            * @param {Overlay} overlay The Overlay to focus
+            * @param {String} overlay The id of the Overlay to focus
+            */
+            this.focus = function (overlay) {
+        
+                var o = this.find(overlay);
+        
+                if (o) {
+        
+                    if (activeOverlay != o) {
+        
+                        if (activeOverlay) {
+        
+                            activeOverlay.blur();
+        
+                        }
+        
+                        this.bringToTop(o);
+                        
+                        activeOverlay = o;
+        
+                        Dom.addClass(activeOverlay.element, 
+                            OverlayManager.CSS_FOCUSED);
+
+                        o.focusEvent.fire();
+                        
+                    }
+        
+                }
+        
+            };
+        
+            /**
+            * Removes the specified Overlay from the manager
+            * @method remove
+            * @param {Overlay} overlay The Overlay to remove
+            * @param {String} overlay The id of the Overlay to remove
+            */
+            this.remove = function (overlay) {
+    
+                var o = this.find(overlay),
+                    originalZ;
+        
+                if (o) {
+
+                    if (activeOverlay == o) {
+                    
+                        activeOverlay = null;
+                    
+                    }
+
+                    originalZ = Dom.getStyle(o.element, "zIndex");
+
+                    o.cfg.setProperty("zIndex", -1000, true);
+
+                    this.overlays.sort(this.compareZIndexDesc);
+
+                    this.overlays = 
+                        this.overlays.slice(0, (this.overlays.length - 1));
+        
+                    o.hideEvent.unsubscribe(o.blur);
+                    o.destroyEvent.unsubscribe(this._onOverlayDestroy, o);
+        
+                    if (o.element) {
+        
+                        Event.removeListener(o.element, 
+                            this.cfg.getProperty("focusevent"), 
+                            this._onOverlayElementFocus);
+        
+                    }
+        
+                    o.cfg.setProperty("zIndex", originalZ, true);
+                    o.cfg.setProperty("manager", null);
+        
+                    o.focusEvent.unsubscribeAll();
+                    o.blurEvent.unsubscribeAll();
+        
+                    o.focusEvent = null;
+                    o.blurEvent = null;
+        
+                    o.focus = null;
+                    o.blur = null;
+                }
+
+            };
+        
+            /**
+            * Removes focus from all registered Overlays in the manager
+            * @method blurAll
+            */
+            this.blurAll = function () {
+    
+                var nOverlays = this.overlays.length,
+                    i;
+
+                if (nOverlays > 0) {
+
+                    i = nOverlays - 1;
+                    
+                    do {
+
+                        this.overlays[i].blur();                    
+                    
+                    }
+                    while(i--);
+                
+                }
+    
+            };
+        
+        
+            this._onOverlayBlur = function (p_sType, p_aArgs) {
+
+                activeOverlay = null;
+
+            };
+        
+        
+            var overlays = this.cfg.getProperty("overlays");
+        
+            if (! this.overlays) {
+                this.overlays = [];
+            }
+        
+            if (overlays) {
+                this.register(overlays);
+                this.overlays.sort(this.compareZIndexDesc);
+            }
+        },
+        
+        
+        /**
+        * @method _onOverlayElementFocus
+        * @description Event handler for the DOM event that is used to focus 
+        * the Overlay instance as specified by the "focusevent" 
+        * configuration property.
+        * @private
+        * @param {Event} p_oEvent Object representing the DOM event 
+        * object passed back by the event utility (Event).
+        */
+        _onOverlayElementFocus: function (p_oEvent) {
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                oClose = this.close;
+        
+            
+            if (oClose && (oTarget == oClose || 
+                    Dom.isAncestor(oClose, oTarget))) {
+            
+                this.blur();
+            
+            }
+            else {
+            
+                this.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOverlayDestroy
+        * @description "destroy" event handler for the Overlay.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {Overlay} p_oOverlay Object representing the menu that 
+        * fired the event.
+        */
+        _onOverlayDestroy: function (p_sType, p_aArgs, p_oOverlay) {
+        
+            this.remove(p_oOverlay);
+        
+        },
+        
+        /**
+        * 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.
+        * @method register
+        * @param {Overlay} overlay  An Overlay to register with the manager.
+        * @param {Overlay[]} overlay  An array of Overlays to register with 
+        * the manager.
+        * @return {Boolean} True if any Overlays are registered.
+        */
+        register: function (overlay) {
+        
+            var mgr = this,
+                zIndex,
+                regcount,
+                i,
+                nOverlays;
+        
+            if (overlay instanceof Overlay) {
+
+                overlay.cfg.addProperty("manager", { value: this } );
+        
+                overlay.focusEvent = overlay.createEvent("focus");
+                overlay.focusEvent.signature = CustomEvent.LIST;
+        
+                overlay.blurEvent = overlay.createEvent("blur");
+                overlay.blurEvent.signature = CustomEvent.LIST;
+        
+                overlay.focus = function () {
+                    mgr.focus(this);
+                };
+        
+                overlay.blur = function () {
+    
+                    if (mgr.getActive() == this) {
+
+                        Dom.removeClass(this.element, 
+                            OverlayManager.CSS_FOCUSED);
+
+                        this.blurEvent.fire();
+
+                    }
+
+                };
+        
+                overlay.blurEvent.subscribe(mgr._onOverlayBlur);
+        
+                overlay.hideEvent.subscribe(overlay.blur);
+                
+                overlay.destroyEvent.subscribe(this._onOverlayDestroy, 
+                    overlay, this);
+        
+                Event.on(overlay.element, this.cfg.getProperty("focusevent"), 
+                    this._onOverlayElementFocus, null, overlay);
+        
+                zIndex = Dom.getStyle(overlay.element, "zIndex");
+
+                if (!isNaN(zIndex)) {
+
+                    overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));
+
+                } else {
+
+                    overlay.cfg.setProperty("zIndex", 0);
+
+                }
+        
+
+                this.overlays.push(overlay);
+
+                this.bringToTop(overlay);
+
+                return true;
+
+            } else if (overlay instanceof Array) {
+
+                regcount = 0;
+                nOverlays = overlay.length;
+
+                for (i = 0; i < nOverlays; i++) {
+
+                    if (this.register(overlay[i])) {
+
+                        regcount++;
+
+                    }
+                }
+
+                if (regcount > 0) {
+
+                    return true;
+
+                }
+
+            } else {
+
+                return false;
+
+            }
+
+        },
+
+        /**
+        * Places the specified Overlay instance on top of all other 
+        * Overlay instances.
+        * @method bringToTop
+        * @param {YAHOO.widget.Overlay} p_oOverlay Object representing an 
+        * Overlay instance.
+        * @param {String} p_oOverlay String representing the id of an 
+        * Overlay instance.
+        */        
+        bringToTop: function (p_oOverlay) {
+
+            var oOverlay = this.find(p_oOverlay),
+                nTopZIndex,
+                oTopOverlay,
+                aOverlays;
+
+            if (oOverlay) {
+
+                aOverlays = this.overlays;
+
+                aOverlays.sort(this.compareZIndexDesc);
+                
+                oTopOverlay = aOverlays[0];
+                
+                if (oTopOverlay) {
+
+                    nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex");
+    
+                    if (!isNaN(nTopZIndex) && oTopOverlay != oOverlay) {
+    
+                        oOverlay.cfg.setProperty("zIndex", 
+                            (parseInt(nTopZIndex, 10) + 2));
+    
+                    }
+    
+                    aOverlays.sort(this.compareZIndexDesc);
+                
+                }
+
+            }
+        
+        },
+        
+        /**
+        * Attempts to locate an Overlay by instance or ID.
+        * @method find
+        * @param {Overlay} overlay  An Overlay to locate within the manager
+        * @param {String} overlay  An Overlay id to locate within the manager
+        * @return {Overlay} The requested Overlay, if found, or null if it 
+        * cannot be located.
+        */
+        find: function (overlay) {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+
+                i = nOverlays - 1;
+
+                if (overlay instanceof Overlay) {
+
+                    do {
+
+                        if (aOverlays[i] == overlay) {
+
+                            return aOverlays[i];
+
+                        }
+                    
+                    }
+                    while(i--);
+
+                } else if (typeof overlay == "string") {
+
+                    do {
+
+                        if (aOverlays[i].id == overlay) {
+
+                            return aOverlays[i];
+
+                        }
+
+                    }
+                    while(i--);
+
+                }
+
+                return null;
+            
+            }
+
+        },
+        
+        /**
+        * Used for sorting the manager's Overlays by z-index.
+        * @method compareZIndexDesc
+        * @private
+        * @return {Number} 0, 1, or -1, depending on where the Overlay should 
+        * fall in the stacking order.
+        */
+        compareZIndexDesc: function (o1, o2) {
+    
+            var zIndex1 = o1.cfg.getProperty("zIndex"),
+                zIndex2 = o2.cfg.getProperty("zIndex");
+        
+            if (zIndex1 > zIndex2) {
+                return -1;
+            } else if (zIndex1 < zIndex2) {
+                return 1;
+            } else {
+                return 0;
+            }
+        },
+        
+        /**
+        * Shows all Overlays in the manager.
+        * @method showAll
+        */
+        showAll: function () {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+            
+                i = nOverlays - 1;
+                
+                do {
+
+                    aOverlays[i].show();
+                
+                }
+                while(i--);
+            
+            }
+    
+        },
+        
+        /**
+        * Hides all Overlays in the manager.
+        * @method hideAll
+        */
+        hideAll: function () {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+            
+                i = nOverlays - 1;
+                
+                do {
+
+                    aOverlays[i].hide();
+                
+                }
+                while(i--);
+            
+            }
+    
+        },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the OverlayManager
+        */
+        toString: function () {
+            return "OverlayManager";
+        }
+    
+    };
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Tooltip
+    * @extends YAHOO.widget.Overlay
+    * @constructor
+    * @param {String} el The element ID representing the Tooltip <em>OR</em>
+    * @param {HTMLElement} el The element representing the Tooltip
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Overlay. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Tooltip = function (el, userConfig) {
+    
+        YAHOO.widget.Tooltip.superclass.constructor.call(this, el, userConfig);
+    
+    };
+
+
+    var Lang = YAHOO.lang,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Tooltip = YAHOO.widget.Tooltip,
+    
+        m_oShadowTemplate,
+        
+        /**
+        * Constant representing the Tooltip's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "PREVENT_OVERLAP": { 
+                key: "preventoverlap", 
+                value: true, 
+                validator: Lang.isBoolean, 
+                supercedes: ["x", "y", "xy"] 
+            },
+        
+            "SHOW_DELAY": { 
+                key: "showdelay", 
+                value: 200, 
+                validator: Lang.isNumber 
+            }, 
+        
+            "AUTO_DISMISS_DELAY": { 
+                key: "autodismissdelay", 
+                value: 5000, 
+                validator: Lang.isNumber 
+            }, 
+        
+            "HIDE_DELAY": { 
+                key: "hidedelay", 
+                value: 250, 
+                validator: Lang.isNumber 
+            }, 
+        
+            "TEXT": { 
+                key: "text", 
+                suppressEvent: true 
+            }, 
+        
+            "CONTAINER": { 
+                key: "container"
+            }
+        
+        };
+
+    
+    /**
+    * Constant representing the Tooltip CSS class
+    * @property YAHOO.widget.Tooltip.CSS_TOOLTIP
+    * @static
+    * @final
+    * @type String
+    */
+    Tooltip.CSS_TOOLTIP = "yui-tt";
+
+
+    /* 
+        "hide" event handler that sets a Tooltip instance's "width"
+        configuration property back to its original value before 
+        "setWidthToOffsetWidth" was called.
+    */
+    
+    function restoreOriginalWidth(p_sType, p_aArgs, p_oObject) {
+
+        var sOriginalWidth = p_oObject[0],
+            sNewWidth = p_oObject[1],
+            oConfig = this.cfg,
+            sCurrentWidth = oConfig.getProperty("width");
+
+        if (sCurrentWidth == sNewWidth) {
+            
+            oConfig.setProperty("width", sOriginalWidth);
+        
+        }
+
+        this.unsubscribe("hide", this._onHide, p_oObject);
+    
+    }
+
+    /* 
+        "beforeShow" event handler that sets a Tooltip instance's "width"
+        configuration property to the value of its root HTML 
+        elements's offsetWidth
+    */
+
+    function setWidthToOffsetWidth(p_sType, p_aArgs) {
+
+        var oBody = document.body,
+            oConfig = this.cfg,
+            sOriginalWidth = oConfig.getProperty("width"),
+            sNewWidth,
+            oClone;
+
+        
+        if ((!sOriginalWidth || sOriginalWidth == "auto") && 
+            (oConfig.getProperty("container") != oBody || 
+            oConfig.getProperty("x") >= Dom.getViewportWidth() || 
+            oConfig.getProperty("y") >= Dom.getViewportHeight())) {
+
+            oClone = this.element.cloneNode(true);
+            oClone.style.visibility = "hidden";
+            oClone.style.top = "0px";
+            oClone.style.left = "0px";
+            
+            oBody.appendChild(oClone);
+
+            sNewWidth = (oClone.offsetWidth + "px");
+            
+            oBody.removeChild(oClone);
+            
+            oClone = null;
+
+            oConfig.setProperty("width", sNewWidth);
+            
+            oConfig.refireEvent("xy");
+            
+            this.subscribe("hide", restoreOriginalWidth, 
+                [(sOriginalWidth || ""), sNewWidth]);
+        
+        }
+
+    }
+
+
+    // "onDOMReady" that renders the ToolTip
+
+    function onDOMReady(p_sType, p_aArgs, p_oObject) {
+    
+        this.render(p_oObject);
+    
+    }
+
+
+    //  "init" event handler that automatically renders the Tooltip
+
+    function onInit() {
+
+        Event.onDOMReady(onDOMReady, this.cfg.getProperty("container"), this);
+
+    }
+
+    
+    YAHOO.extend(Tooltip, YAHOO.widget.Overlay, { 
+    
+        /**
+        * The Tooltip initialization method. This method is automatically 
+        * called by the constructor. A Tooltip is automatically rendered by 
+        * the init method, and it also is set to be invisible by default, 
+        * and constrained to viewport by default as well.
+        * @method init
+        * @param {String} el The element ID representing the Tooltip <em>OR</em>
+        * @param {HTMLElement} el The element representing the Tooltip
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Tooltip. 
+        * See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
+    
+    
+            Tooltip.superclass.init.call(this, el);
+    
+            this.beforeInitEvent.fire(Tooltip);
+    
+            Dom.addClass(this.element, Tooltip.CSS_TOOLTIP);
+    
+            if (userConfig) {
+
+                this.cfg.applyConfig(userConfig, true);
+
+            }
+    
+            this.cfg.queueProperty("visible", false);
+            this.cfg.queueProperty("constraintoviewport", true);
+    
+            this.setBody("");
+
+            this.subscribe("beforeShow", setWidthToOffsetWidth);
+            this.subscribe("init", onInit);
+            this.subscribe("render", this.onRender);
+    
+            this.initEvent.fire(Tooltip);
+
+        },
+        
+        /**
+        * Initializes the class's configurable properties which can be 
+        * changed using the Overlay's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+
+            Tooltip.superclass.initDefaultConfig.call(this);
+        
+            /**
+            * Specifies whether the Tooltip should be kept from overlapping 
+            * its context element.
+            * @config preventoverlap
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.PREVENT_OVERLAP.key, {
+                value: DEFAULT_CONFIG.PREVENT_OVERLAP.value, 
+                validator: DEFAULT_CONFIG.PREVENT_OVERLAP.validator, 
+                supercedes: DEFAULT_CONFIG.PREVENT_OVERLAP.supercedes
+            });
+        
+            /**
+            * The number of milliseconds to wait before showing a Tooltip 
+            * on mouseover.
+            * @config showdelay
+            * @type Number
+            * @default 200
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.SHOW_DELAY.key, {
+                handler: this.configShowDelay,
+                value: 200, 
+                validator: DEFAULT_CONFIG.SHOW_DELAY.validator
+            });
+        
+            /**
+            * The number of milliseconds to wait before automatically 
+            * dismissing a Tooltip after the mouse has been resting on the 
+            * context element.
+            * @config autodismissdelay
+            * @type Number
+            * @default 5000
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.AUTO_DISMISS_DELAY.key, {
+                handler: this.configAutoDismissDelay,
+                value: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.value,
+                validator: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.validator
+            });
+        
+            /**
+            * The number of milliseconds to wait before hiding a Tooltip 
+            * on mouseover.
+            * @config hidedelay
+            * @type Number
+            * @default 250
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.HIDE_DELAY.key, {
+                handler: this.configHideDelay,
+                value: DEFAULT_CONFIG.HIDE_DELAY.value, 
+                validator: DEFAULT_CONFIG.HIDE_DELAY.validator
+            });
+        
+            /**
+            * Specifies the Tooltip's text.
+            * @config text
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key, {
+                handler: this.configText,
+                suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent
+            });
+
+            /**
+            * Specifies the container element that the Tooltip's markup 
+            * should be rendered into.
+            * @config container
+            * @type HTMLElement/String
+            * @default document.body
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONTAINER.key, {
+                handler: this.configContainer,
+                value: document.body
+            });
+        
+            /**
+            * Specifies the element or elements that the Tooltip should be 
+            * anchored to on mouseover.
+            * @config context
+            * @type HTMLElement[]/String[]
+            * @default null
+            */ 
+
+            /**
+            * String representing the width of the Tooltip.  <em>Please note:
+            * </em> As of version 2.3 if either no value or a value of "auto" 
+            * is specified, and the Toolip's "container" configuration property
+            * is set to something other than <code>document.body</code> or 
+            * its "context" element resides outside the immediately visible 
+            * portion of the document, the width of the Tooltip will be 
+            * calculated based on the offsetWidth of its root HTML and set just 
+            * before it is made visible.  The original value will be 
+            * restored when the Tooltip is hidden. This ensures the Tooltip is 
+            * rendered at a usable width.  For more information see 
+            * SourceForge bug #1685496 and SourceForge 
+            * bug #1735423.
+            * @config width
+            * @type String
+            * @default null
+            */
+        
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the "text" property is changed.
+        * @method configText
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configText: function (type, args, obj) {
+            var text = args[0];
+            if (text) {
+                this.setBody(text);
+            }
+        },
+        
+        /**
+        * The default event handler fired when the "container" property 
+        * is changed.
+        * @method configContainer
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For 
+        * configuration handlers, args[0] will equal the newly applied value 
+        * for the property.
+        * @param {Object} obj The scope object. For configuration handlers,
+        * this will usually equal the owner.
+        */
+        configContainer: function (type, args, obj) {
+
+            var container = args[0];
+
+            if (typeof container == 'string') {
+
+                this.cfg.setProperty("container", 
+                    document.getElementById(container), true);
+
+            }
+
+        },
+        
+        /**
+        * @method _removeEventListeners
+        * @description Removes all of the DOM event handlers from the HTML
+        *  element(s) that trigger the display of the tooltip.
+        * @protected
+        */
+        _removeEventListeners: function () {
+        
+            var aElements = this._context,
+                nElements,
+                oElement,
+                i;
+        
+            
+            if (aElements) {
+        
+                nElements = aElements.length;
+                
+                if (nElements > 0) {
+                
+                    i = nElements - 1;
+                    
+                    do {
+        
+                        oElement = aElements[i];
+        
+                        Event.removeListener(oElement, "mouseover", 
+                            this.onContextMouseOver);
+
+                        Event.removeListener(oElement, "mousemove", 
+                            this.onContextMouseMove);
+
+                        Event.removeListener(oElement, "mouseout", 
+                            this.onContextMouseOut);
+                    
+                    }
+                    while (i--);
+                
+                }
+        
+            }
+        
+        },
+        
+        /**
+        * The default event handler fired when the "context" property 
+        * is changed.
+        * @method configContext
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers,
+        * this will usually equal the owner.
+        */
+        configContext: function (type, args, obj) {
+        
+            var context = args[0],
+                aElements,
+                nElements,
+                oElement,
+                i;
+            
+        
+            if (context) {
+        
+                // Normalize parameter into an array
+                if (! (context instanceof Array)) {
+
+                    if (typeof context == "string") {
+
+                        this.cfg.setProperty("context", 
+                            [document.getElementById(context)], true);
+
+                    } else { // Assuming this is an element
+
+                        this.cfg.setProperty("context", [context], true);
+
+                    }
+
+                    context = this.cfg.getProperty("context");
+
+                }
+        
+        
+                // Remove any existing mouseover/mouseout listeners
+                this._removeEventListeners();
+        
+                // Add mouseover/mouseout listeners to context elements
+                this._context = context;
+        
+                aElements = this._context;
+                
+                if (aElements) {
+            
+                    nElements = aElements.length;
+                    
+                    if (nElements > 0) {
+                    
+                        i = nElements - 1;
+                        
+                        do {
+            
+                            oElement = aElements[i];
+            
+                            Event.on(oElement, "mouseover", 
+                                this.onContextMouseOver, this);
+
+                            Event.on(oElement, "mousemove", 
+                                this.onContextMouseMove, this);
+
+                            Event.on(oElement, "mouseout", 
+                                this.onContextMouseOut, this);
+                        
+                        }
+                        while (i--);
+                    
+                    }
+            
+                }
+        
+            }
+        },
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        // BEGIN BUILT-IN DOM EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the user moves the mouse while 
+        * over the context element.
+        * @method onContextMouseMove
+        * @param {DOMEvent} e The current DOM event
+        * @param {Object} obj The object argument
+        */
+        onContextMouseMove: function (e, obj) {
+            obj.pageX = Event.getPageX(e);
+            obj.pageY = Event.getPageY(e);
+        
+        },
+        
+        /**
+        * The default event handler fired when the user mouses over the 
+        * context element.
+        * @method onContextMouseOver
+        * @param {DOMEvent} e The current DOM event
+        * @param {Object} obj The object argument
+        */
+        onContextMouseOver: function (e, obj) {
+        
+            var context = this;
+        
+            if (obj.hideProcId) {
+
+                clearTimeout(obj.hideProcId);
+
+
+                obj.hideProcId = null;
+
+            }
+        
+            Event.on(context, "mousemove", obj.onContextMouseMove, obj);
+        
+            if (context.title) {
+                obj._tempTitle = context.title;
+                context.title = "";
+            }
+        
+            /**
+            * The unique process ID associated with the thread responsible 
+            * for showing the Tooltip.
+            * @type int
+            */
+            obj.showProcId = obj.doShow(e, context);
+
+        },
+        
+        /**
+        * The default event handler fired when the user mouses out of 
+        * the context element.
+        * @method onContextMouseOut
+        * @param {DOMEvent} e The current DOM event
+        * @param {Object} obj The object argument
+        */
+        onContextMouseOut: function (e, obj) {
+            var el = this;
+        
+            if (obj._tempTitle) {
+                el.title = obj._tempTitle;
+                obj._tempTitle = null;
+            }
+        
+            if (obj.showProcId) {
+                clearTimeout(obj.showProcId);
+                obj.showProcId = null;
+            }
+        
+            if (obj.hideProcId) {
+                clearTimeout(obj.hideProcId);
+                obj.hideProcId = null;
+            }
+        
+        
+            obj.hideProcId = setTimeout(function () {
+                obj.hide();
+    
+            }, obj.cfg.getProperty("hidedelay"));
+    
+        },
+        
+        // END BUILT-IN DOM EVENT HANDLERS //
+        
+        /**
+        * Processes the showing of the Tooltip by setting the timeout delay 
+        * and offset of the Tooltip.
+        * @method doShow
+        * @param {DOMEvent} e The current DOM event
+        * @return {Number} The process ID of the timeout function associated 
+        * with doShow
+        */
+        doShow: function (e, context) {
+        
+            var yOffset = 25,
+                me = this;
+        
+            if (YAHOO.env.ua.opera && context.tagName && 
+                context.tagName.toUpperCase() == "A") {
+
+                yOffset += 12;
+
+            }
+        
+            return setTimeout(function () {
+        
+                if (me._tempTitle) {
+                    me.setBody(me._tempTitle);
+                } else {
+                    me.cfg.refireEvent("text");
+                }
+        
+                me.moveTo(me.pageX, me.pageY + yOffset);
+
+                if (me.cfg.getProperty("preventoverlap")) {
+                    me.preventOverlap(me.pageX, me.pageY);
+                }
+        
+                Event.removeListener(context, "mousemove", 
+                    me.onContextMouseMove);
+        
+                me.show();
+                me.hideProcId = me.doHide();
+
+
+            }, this.cfg.getProperty("showdelay"));
+        
+        },
+        
+        /**
+        * 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.
+        * @method doHide
+        */
+        doHide: function () {
+        
+            var me = this;
+        
+        
+            return setTimeout(function () {
+        
+                me.hide();
+        
+            }, this.cfg.getProperty("autodismissdelay"));
+        
+        },
+        
+        /**
+        * Fired when the Tooltip is moved, this event handler is used to 
+        * prevent the Tooltip from overlapping with its context element.
+        * @method preventOverlay
+        * @param {Number} pageX The x coordinate position of the mouse pointer
+        * @param {Number} pageY The y coordinate position of the mouse pointer
+        */
+        preventOverlap: function (pageX, pageY) {
+        
+            var height = this.element.offsetHeight,
+                mousePoint = new YAHOO.util.Point(pageX, pageY),
+                elementRegion = Dom.getRegion(this.element);
+        
+            elementRegion.top -= 5;
+            elementRegion.left -= 5;
+            elementRegion.right += 5;
+            elementRegion.bottom += 5;
+        
+        
+            if (elementRegion.contains(mousePoint)) {
+                this.cfg.setProperty("y", (pageY - height - 5));
+            }
+        },
+
+
+        /**
+        * @method onRender
+        * @description "render" event handler for the Tooltip.
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        onRender: function (p_sType, p_aArgs) {
+    
+            function sizeShadow() {
+    
+                var oElement = this.element,
+                    oShadow = this._shadow;
+            
+                if (oShadow) {
+            
+                    oShadow.style.width = (oElement.offsetWidth + 6) + "px";
+                    oShadow.style.height = (oElement.offsetHeight + 1) + "px"; 
+            
+                }
+            
+            }
+
+
+            function addShadowVisibleClass() {
+            
+                Dom.addClass(this._shadow, "yui-tt-shadow-visible");
+            
+            }
+            
+
+            function removeShadowVisibleClass() {
+        
+                Dom.removeClass(this._shadow, "yui-tt-shadow-visible");
+            
+            }
+    
+    
+            function createShadow() {
+    
+                var oShadow = this._shadow,
+                    oElement,
+                    Module,
+                    nIE,
+                    me;
+    
+                if (!oShadow) {
+    
+                    oElement = this.element;
+                    Module = YAHOO.widget.Module;
+                    nIE = YAHOO.env.ua.ie;
+                    me = this;
+    
+                    if (!m_oShadowTemplate) {
+        
+                        m_oShadowTemplate = document.createElement("div");
+                        m_oShadowTemplate.className = "yui-tt-shadow";
+                    
+                    }
+        
+                    oShadow = m_oShadowTemplate.cloneNode(false);
+        
+                    oElement.appendChild(oShadow);
+                    
+                    this._shadow = oShadow;
+    
+                    addShadowVisibleClass.call(this);
+        
+                    this.subscribe("beforeShow", addShadowVisibleClass);
+                    this.subscribe("beforeHide", removeShadowVisibleClass);
+
+                    if (nIE == 6 || 
+                        (nIE == 7 && document.compatMode == "BackCompat")) {
+                
+                        window.setTimeout(function () { 
+        
+                            sizeShadow.call(me); 
+        
+                        }, 0);
+    
+                        this.cfg.subscribeToConfigEvent("width", sizeShadow);
+                        this.cfg.subscribeToConfigEvent("height", sizeShadow);
+                        this.subscribe("changeContent", sizeShadow);
+    
+                        Module.textResizeEvent.subscribe(sizeShadow, 
+                                                            this, true);
+                        
+                        this.subscribe("destroy", function () {
+                        
+                            Module.textResizeEvent.unsubscribe(sizeShadow, 
+                                                                    this);
+                        
+                        });
+                
+                    }
+                
+                }
+    
+            }
+    
+    
+            function onBeforeShow() {
+            
+                createShadow.call(this);
+    
+                this.unsubscribe("beforeShow", onBeforeShow);
+            
+            }
+    
+    
+            if (this.cfg.getProperty("visible")) {
+    
+                createShadow.call(this);
+            
+            }
+            else {
+    
+                this.subscribe("beforeShow", onBeforeShow);
+            
+            }
+        
+        },
+        
+        /**
+        * Removes the Tooltip element from the DOM and sets all child 
+        * elements to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            // Remove any existing mouseover/mouseout listeners
+            this._removeEventListeners();
+        
+            Tooltip.superclass.destroy.call(this);  
+        
+        },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Tooltip
+        */
+        toString: function () {
+            return "Tooltip " + this.id;
+        }
+    
+    });
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Panel
+    * @extends Overlay
+    * @constructor
+    * @param {String} el The element ID representing the Panel <em>OR</em>
+    * @param {HTMLElement} el The element representing the Panel
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Panel. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Panel = function (el, userConfig) {
+    
+        YAHOO.widget.Panel.superclass.constructor.call(this, el, userConfig);
+    
+    };
+
+
+    var Lang = YAHOO.lang,
+        DD = YAHOO.util.DD,
+        Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Overlay = YAHOO.widget.Overlay,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Config = YAHOO.util.Config,
+        Panel = YAHOO.widget.Panel,
+
+        m_oMaskTemplate,
+        m_oUnderlayTemplate,
+        m_oCloseIconTemplate,
+
+        /**
+        * Constant representing the name of the Panel's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "SHOW_MASK": "showMask",
+            "HIDE_MASK": "hideMask",
+            "DRAG": "drag"
+        
+        },
+        
+        /**
+        * Constant representing the Panel's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "CLOSE": { 
+                key: "close", 
+                value: true, 
+                validator: Lang.isBoolean, 
+                supercedes: ["visible"] 
+            },
+            
+            "DRAGGABLE": { 
+                key: "draggable", 
+                value: (DD ? true : false), 
+                validator: Lang.isBoolean, 
+                supercedes: ["visible"]  
+            },
+            
+            "UNDERLAY": { 
+                key: "underlay", 
+                value: "shadow", 
+                supercedes: ["visible"] 
+            },
+            
+            "MODAL": { 
+                key: "modal", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["visible"] 
+            },
+            
+            "KEY_LISTENERS": { 
+                key: "keylisteners", 
+                suppressEvent: true, 
+                supercedes: ["visible"] 
+            }
+        
+        };
+
+
+    /**
+    * Constant representing the default CSS class used for a Panel
+    * @property YAHOO.widget.Panel.CSS_PANEL
+    * @static
+    * @final
+    * @type String
+    */
+    Panel.CSS_PANEL = "yui-panel";
+    
+    /**
+    * Constant representing the default CSS class used for a Panel's 
+    * wrapping container
+    * @property YAHOO.widget.Panel.CSS_PANEL_CONTAINER
+    * @static
+    * @final
+    * @type String
+    */
+    Panel.CSS_PANEL_CONTAINER = "yui-panel-container";
+
+
+    // Private CustomEvent listeners
+
+    /* 
+        "beforeRender" event handler that creates an empty header for a Panel 
+        instance if its "draggable" configuration property is set to "true" 
+        and no header has been created.
+    */
+
+    function createHeader(p_sType, p_aArgs) {
+
+        if (!this.header) {
+
+            this.setHeader("&#160;");
+
+        }
+
+    }
+
+
+    /* 
+        "hide" event handler that sets a Panel instance's "width"
+        configuration property back to its original value before 
+        "setWidthToOffsetWidth" was called.
+    */
+    
+    function restoreOriginalWidth(p_sType, p_aArgs, p_oObject) {
+
+        var sOriginalWidth = p_oObject[0],
+            sNewWidth = p_oObject[1],
+            oConfig = this.cfg,
+            sCurrentWidth = oConfig.getProperty("width");
+
+        if (sCurrentWidth == sNewWidth) {
+            
+            oConfig.setProperty("width", sOriginalWidth);
+        
+        }
+
+        this.unsubscribe("hide", restoreOriginalWidth, p_oObject);
+    
+    }
+
+
+    /* 
+        "beforeShow" event handler that sets a Panel instance's "width"
+        configuration property to the value of its root HTML 
+        elements's offsetWidth
+    */
+
+    function setWidthToOffsetWidth(p_sType, p_aArgs) {
+
+        var nIE = YAHOO.env.ua.ie,
+            oConfig,
+            sOriginalWidth,
+            sNewWidth;
+
+        if (nIE == 6 || (nIE == 7 && document.compatMode == "BackCompat")) {
+
+            oConfig = this.cfg;
+            sOriginalWidth = oConfig.getProperty("width");
+            
+            if (!sOriginalWidth || sOriginalWidth == "auto") {
+    
+                sNewWidth = (this.element.offsetWidth + "px");
+    
+                oConfig.setProperty("width", sNewWidth);
+                
+                this.subscribe("hide", restoreOriginalWidth, 
+                    [(sOriginalWidth || ""), sNewWidth]);
+            
+            }
+        
+        }
+
+    }
+
+    /* 
+        "focus" event handler for a focuable element.  Used to automatically 
+        blur the element when it receives focus to ensure that a Panel 
+        instance's modality is not compromised.
+    */
+
+    function onElementFocus() {
+
+        this.blur();
+
+    }
+
+    /* 
+        "showMask" event handler that adds a "focus" event handler to all
+        focusable elements in the document to enforce a Panel instance's 
+        modality from being compromised.
+    */
+
+    function addFocusEventHandlers(p_sType, p_aArgs) {
+
+        var me = this;
+
+        function isFocusable(el) {
+
+            var sTagName = el.tagName.toUpperCase(),
+                bFocusable = false;
+            
+            switch (sTagName) {
+            
+            case "A":
+            case "BUTTON":
+            case "SELECT":
+            case "TEXTAREA":
+
+                if (!Dom.isAncestor(me.element, el)) {
+                    Event.on(el, "focus", onElementFocus, el, true);
+                    bFocusable = true;
+                }
+
+                break;
+
+            case "INPUT":
+
+                if (el.type != "hidden" && 
+                    !Dom.isAncestor(me.element, el)) {
+
+                    Event.on(el, "focus", onElementFocus, el, true);
+                    bFocusable = true;
+
+                }
+
+                break;
+            
+            }
+
+            return bFocusable;
+
+        }
+
+        this.focusableElements = Dom.getElementsBy(isFocusable);
+    
+    }
+
+    /* 
+        "hideMask" event handler that removes all "focus" event handlers added 
+        by the "addFocusEventHandlers" method.
+    */
+    
+    function removeFocusEventHandlers(p_sType, p_aArgs) {
+
+        var aElements = this.focusableElements,
+            nElements = aElements.length,
+            el2,
+            i;
+
+        for (i = 0; i < nElements; i++) {
+            el2 = aElements[i];
+            Event.removeListener(el2, "focus", onElementFocus);
+        }
+
+    }
+
+    
+    YAHOO.extend(Panel, Overlay, {
+    
+        /**
+        * 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.
+        * @method init
+        * @param {String} el The element ID representing the Overlay <em>OR</em>
+        * @param {HTMLElement} el The element representing the Overlay
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Overlay. 
+        * See configuration documentation for more details.
+        */
+        init: function (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
+            */
+
+            Panel.superclass.init.call(this, el/*, userConfig*/);  
+        
+            this.beforeInitEvent.fire(Panel);
+        
+            Dom.addClass(this.element, Panel.CSS_PANEL);
+        
+            this.buildWrapper();
+        
+            if (userConfig) {
+
+                this.cfg.applyConfig(userConfig, true);
+
+            }
+        
+            this.subscribe("showMask", addFocusEventHandlers);
+            this.subscribe("hideMask", removeFocusEventHandlers);
+
+            this.initEvent.fire(Panel);
+            
+        },
+        
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        */
+        initEvents: function () {
+            Panel.superclass.initEvents.call(this);
+        
+            var SIGNATURE = CustomEvent.LIST;
+        
+            /**
+            * CustomEvent fired after the modality mask is shown
+            * @event showMaskEvent
+            */
+            this.showMaskEvent = this.createEvent(EVENT_TYPES.SHOW_MASK);
+            this.showMaskEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the modality mask is hidden
+            * @event hideMaskEvent
+            */
+            this.hideMaskEvent = this.createEvent(EVENT_TYPES.HIDE_MASK);
+            this.hideMaskEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent when the Panel is dragged
+            * @event dragEvent
+            */
+            this.dragEvent = this.createEvent(EVENT_TYPES.DRAG);
+            this.dragEvent.signature = SIGNATURE;
+        
+        },
+        
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the Panel's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+            Panel.superclass.initDefaultConfig.call(this);
+        
+            // Add panel config properties //
+        
+            /**
+            * True if the Panel should display a "close" button
+            * @config close
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CLOSE.key, { 
+                handler: this.configClose, 
+                value: DEFAULT_CONFIG.CLOSE.value, 
+                validator: DEFAULT_CONFIG.CLOSE.validator, 
+                supercedes: DEFAULT_CONFIG.CLOSE.supercedes 
+            });
+        
+            /**
+            * Boolean specifying if the Panel should be draggable.  The default 
+            * value is "true" if the Drag and Drop utility is included, 
+            * otherwise it is "false." <strong>PLEASE NOTE:</strong> There is a 
+            * known issue in IE 6 (Strict Mode and Quirks Mode) and IE 7 
+            * (Quirks Mode) where Panels that either don't have a value set for 
+            * their "width" configuration property, or their "width" 
+            * configuration property is set to "auto" will only be draggable by
+            * placing the mouse on the text of the Panel's header element.
+            * To fix this bug, draggable Panels missing a value for their 
+            * "width" configuration property, or whose "width" configuration 
+            * property is set to "auto" will have it set to the value of 
+            * their root HTML element's offsetWidth before they are made 
+            * visible.  The calculated width is then removed when the Panel is   
+            * hidden. <em>This fix is only applied to draggable Panels in IE 6 
+            * (Strict Mode and Quirks Mode) and IE 7 (Quirks Mode)</em>. For 
+            * more information on this issue see:
+            * SourceForge bugs #1726972 and #1589210.
+            * @config draggable
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.DRAGGABLE.key, { 
+                handler: this.configDraggable, 
+                value: DEFAULT_CONFIG.DRAGGABLE.value, 
+                validator: DEFAULT_CONFIG.DRAGGABLE.validator, 
+                supercedes: DEFAULT_CONFIG.DRAGGABLE.supercedes 
+            });
+        
+            /**
+            * Sets the type of underlay to display for the Panel. Valid values 
+            * are "shadow," "matte," and "none".  <strong>PLEASE NOTE:</strong> 
+            * The creation of the underlay element is deferred until the Panel 
+            * is initially made visible.  For Gecko-based browsers on Mac
+            * OS X the underlay elment is always created as it is used as a 
+            * shim to prevent Aqua scrollbars below a Panel instance from poking 
+            * through it (See SourceForge bug #836476).
+            * @config underlay
+            * @type String
+            * @default shadow
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.UNDERLAY.key, { 
+                handler: this.configUnderlay, 
+                value: DEFAULT_CONFIG.UNDERLAY.value, 
+                supercedes: DEFAULT_CONFIG.UNDERLAY.supercedes 
+            });
+        
+            /**
+            * 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.
+            * @config modal
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.MODAL.key, { 
+                handler: this.configModal, 
+                value: DEFAULT_CONFIG.MODAL.value,
+                validator: DEFAULT_CONFIG.MODAL.validator, 
+                supercedes: DEFAULT_CONFIG.MODAL.supercedes 
+            });
+        
+            /**
+            * A KeyListener (or array of KeyListeners) that will be enabled 
+            * when the Panel is shown, and disabled when the Panel is hidden.
+            * @config keylisteners
+            * @type YAHOO.util.KeyListener[]
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.KEY_LISTENERS.key, { 
+                handler: this.configKeyListeners, 
+                suppressEvent: DEFAULT_CONFIG.KEY_LISTENERS.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.KEY_LISTENERS.supercedes 
+            });
+        
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * 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.
+        * @method configClose
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configClose: function (type, args, obj) {
+
+            var val = args[0],
+                oClose = this.close;
+        
+            function doHide(e, obj) {
+
+                obj.hide();
+
+            }
+        
+            if (val) {
+
+                if (!oClose) {
+
+                    if (!m_oCloseIconTemplate) {
+
+                        m_oCloseIconTemplate = document.createElement("span");
+                        m_oCloseIconTemplate.innerHTML = "&#160;";
+                        m_oCloseIconTemplate.className = "container-close";
+
+                    }
+
+                    oClose = m_oCloseIconTemplate.cloneNode(true);
+
+                    this.innerElement.appendChild(oClose);
+
+                    Event.on(oClose, "click", doHide, this);
+                    
+                    this.close = oClose;
+                    
+
+                } else {
+
+                    oClose.style.display = "block";
+
+                }
+
+            } else {
+
+                if (oClose) {
+
+                    oClose.style.display = "none";
+
+                }
+
+            }
+
+        },
+
+
+
+        /**
+        * The default event handler fired when the "draggable" property 
+        * is changed.
+        * @method configDraggable
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configDraggable: function (type, args, obj) {
+        
+            var val = args[0];
+
+            if (val) {
+        
+                if (!DD) {
+            
+        
+                    this.cfg.setProperty("draggable", false);
+            
+                    return;
+                
+                }
+        
+                if (this.header) {
+
+                    Dom.setStyle(this.header, "cursor", "move");
+
+                    this.registerDragDrop();
+
+                }
+
+                this.subscribe("beforeRender", createHeader);
+                this.subscribe("beforeShow", setWidthToOffsetWidth);
+
+            } else {
+
+                if (this.dd) {
+
+                    this.dd.unreg();
+
+                }
+
+                if (this.header) {
+
+                    Dom.setStyle(this.header,"cursor","auto");
+
+                }
+
+                this.unsubscribe("beforeRender", createHeader);
+                this.unsubscribe("beforeShow", setWidthToOffsetWidth);
+
+            }
+
+        },
+      
+
+        /**
+        * The default event handler fired when the "underlay" property 
+        * is changed.
+        * @method configUnderlay
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configUnderlay: function (type, args, obj) {
+    
+            var UA = YAHOO.env.ua,
+                bMacGecko = (this.platform == "mac" && UA.gecko),
+                sUnderlay = args[0].toLowerCase(),
+                oUnderlay = this.underlay,
+                oElement = this.element;
+
+
+            function createUnderlay() {
+
+                var nIE;
+
+                if (!oUnderlay) { // create if not already in DOM
+
+                    if (!m_oUnderlayTemplate) {
+
+                        m_oUnderlayTemplate = document.createElement("div");
+                        m_oUnderlayTemplate.className = "underlay";
+                    
+                    }
+
+                    oUnderlay = m_oUnderlayTemplate.cloneNode(false);
+                    this.element.appendChild(oUnderlay);
+                    
+                    this.underlay = oUnderlay;
+
+                    nIE = UA.ie;
+
+                    if (nIE == 6 || 
+                        (nIE == 7 && document.compatMode == "BackCompat")) {
+                            
+                        this.sizeUnderlay();
+
+                        this.cfg.subscribeToConfigEvent("width", 
+                            this.sizeUnderlay);
+
+                        this.cfg.subscribeToConfigEvent("height", 
+                            this.sizeUnderlay);
+
+                        this.changeContentEvent.subscribe(this.sizeUnderlay);
+
+                        YAHOO.widget.Module.textResizeEvent.subscribe(
+                            this.sizeUnderlay, this, true);
+                    
+                    }
+
+                }
+
+            }
+
+
+            function onBeforeShow() {
+            
+                createUnderlay.call(this);
+    
+                this._underlayDeferred = false;
+    
+                this.beforeShowEvent.unsubscribe(onBeforeShow);
+            
+            }
+
+            
+            function destroyUnderlay() {
+
+                if (this._underlayDeferred) {
+
+                    this.beforeShowEvent.unsubscribe(onBeforeShow);
+                
+                    this._underlayDeferred = false;
+
+                }
+            
+                if (oUnderlay) {
+            
+                    this.cfg.unsubscribeFromConfigEvent("width", 
+                        this.sizeUnderlay);
+    
+                    this.cfg.unsubscribeFromConfigEvent("height", 
+                        this.sizeUnderlay);
+    
+                    this.changeContentEvent.unsubscribe(this.sizeUnderlay);
+    
+                    YAHOO.widget.Module.textResizeEvent.unsubscribe(
+                        this.sizeUnderlay, this, true);
+    
+                    this.element.removeChild(oUnderlay);
+                    
+                    this.underlay = null;
+
+                }
+                    
+            }
+        
+
+            switch (sUnderlay) {
+    
+            case "shadow":
+
+                Dom.removeClass(oElement, "matte");
+                Dom.addClass(oElement, "shadow");
+
+                break;
+
+            case "matte":
+
+                if (!bMacGecko) {
+
+                    destroyUnderlay.call(this);
+
+                }
+            
+                Dom.removeClass(oElement, "shadow");
+                Dom.addClass(oElement, "matte");
+
+                break;
+
+            default:
+
+                if (!bMacGecko) {
+
+                    destroyUnderlay.call(this);
+
+                }
+            
+                Dom.removeClass(oElement, "shadow");
+                Dom.removeClass(oElement, "matte");
+
+                break;
+
+            }
+
+
+            if ((sUnderlay == "shadow") || (bMacGecko && !oUnderlay)) {
+                
+                if (this.cfg.getProperty("visible")) {
+                
+                    createUnderlay.call(this);
+                
+                }
+                else {
+
+                    if (!this._underlayDeferred) {
+
+                        this.beforeShowEvent.subscribe(onBeforeShow);
+                    
+                        this._underlayDeferred = true;
+
+                    }
+                
+                }
+
+            }
+    
+        },
+        
+        /**
+        * 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.
+        * @method configModal
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configModal: function (type, args, obj) {
+
+            var modal = args[0];
+
+            if (modal) {
+
+                if (!this._hasModalityEventListeners) {
+
+                    this.subscribe("beforeShow", this.buildMask);
+                    this.subscribe("beforeShow", this.bringToTop);
+                    this.subscribe("beforeShow", this.showMask);
+                    this.subscribe("hide", this.hideMask);
+
+                    Overlay.windowResizeEvent.subscribe(this.sizeMask, 
+                        this, true);
+
+                    this._hasModalityEventListeners = true;
+
+                }
+
+            } else {
+
+                if (this._hasModalityEventListeners) {
+
+                    if (this.cfg.getProperty("visible")) {
+                    
+                        this.hideMask();
+                        this.removeMask();
+                    
+                    }
+
+                    this.unsubscribe("beforeShow", this.buildMask);
+                    this.unsubscribe("beforeShow", this.bringToTop);
+                    this.unsubscribe("beforeShow", this.showMask);
+                    this.unsubscribe("hide", this.hideMask);
+
+                    Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);
+                    
+                    this._hasModalityEventListeners = false;
+                
+                }
+
+            }
+
+        },
+        
+        /**
+        * Removes the modality mask.
+        * @method removeMask
+        */
+        removeMask: function () {
+        
+            var oMask = this.mask,
+                oParentNode;
+        
+            if (oMask) {
+            
+                /*
+                    Hide the mask before destroying it to ensure that DOM
+                    event handlers on focusable elements get removed.
+                */
+        
+                this.hideMask();
+            
+                oParentNode = oMask.parentNode;
+        
+                if (oParentNode) {
+        
+                    oParentNode.removeChild(oMask);
+        
+                }
+        
+                this.mask = null;
+            }
+            
+        },
+        
+        /**
+        * The default event handler fired when the "keylisteners" property 
+        * is changed.
+        * @method configKeyListeners
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configKeyListeners: function (type, args, obj) {
+
+            var listeners = args[0],
+                listener,
+                nListeners,
+                i;
+        
+            if (listeners) {
+
+                if (listeners instanceof Array) {
+
+                    nListeners = listeners.length;
+
+                    for (i = 0; i < nListeners; i++) {
+
+                        listener = listeners[i];
+        
+                        if (!Config.alreadySubscribed(this.showEvent, 
+                            listener.enable, listener)) {
+
+                            this.showEvent.subscribe(listener.enable, 
+                                listener, true);
+
+                        }
+
+                        if (!Config.alreadySubscribed(this.hideEvent, 
+                            listener.disable, listener)) {
+
+                            this.hideEvent.subscribe(listener.disable, 
+                                listener, true);
+
+                            this.destroyEvent.subscribe(listener.disable, 
+                                listener, true);
+                        }
+
+                    }
+
+                } else {
+
+                    if (!Config.alreadySubscribed(this.showEvent, 
+                        listeners.enable, listeners)) {
+
+                        this.showEvent.subscribe(listeners.enable, 
+                            listeners, true);
+                    }
+
+                    if (!Config.alreadySubscribed(this.hideEvent, 
+                        listeners.disable, listeners)) {
+
+                        this.hideEvent.subscribe(listeners.disable, 
+                            listeners, true);
+
+                        this.destroyEvent.subscribe(listeners.disable, 
+                            listeners, true);
+
+                    }
+
+                }
+
+            }
+
+        },
+        
+        /**
+        * The default event handler fired when the "height" property is changed.
+        * @method configHeight
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configHeight: function (type, args, obj) {
+    
+            var height = args[0],
+                el = this.innerElement;
+    
+            Dom.setStyle(el, "height", height);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "width" property is changed.
+        * @method configWidth
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configWidth: function (type, args, obj) {
+    
+            var width = args[0],
+                el = this.innerElement;
+    
+            Dom.setStyle(el, "width", width);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "zIndex" property is changed.
+        * @method configzIndex
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configzIndex: function (type, args, obj) {
+    
+            Panel.superclass.configzIndex.call(this, type, args, obj);
+        
+            var maskZ = 0,
+                currentZ = Dom.getStyle(this.element, "zIndex");
+        
+            if (this.mask) {
+
+                if (!currentZ || isNaN(currentZ)) {
+                    currentZ = 0;
+                }
+        
+                if (currentZ === 0) {
+
+                    this.cfg.setProperty("zIndex", 1);
+
+                } else {
+
+                    maskZ = currentZ - 1;
+                    Dom.setStyle(this.mask, "zIndex", maskZ);
+
+                }
+        
+            }
+        },
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        
+        /**
+        * Builds the wrapping container around the Panel that is used for 
+        * positioning the shadow and matte underlays. The container element is 
+        * assigned to a  local instance variable called container, and the 
+        * element is reinserted inside of it.
+        * @method buildWrapper
+        */
+        buildWrapper: function () {
+    
+            var elementParent = this.element.parentNode,
+                originalElement = this.element,
+                wrapper = document.createElement("div");
+    
+            wrapper.className = Panel.CSS_PANEL_CONTAINER;
+            wrapper.id = originalElement.id + "_c";
+        
+            if (elementParent) {
+                elementParent.insertBefore(wrapper, originalElement);
+            }
+        
+            wrapper.appendChild(originalElement);
+        
+            this.element = wrapper;
+            this.innerElement = originalElement;
+        
+            Dom.setStyle(this.innerElement, "visibility", "inherit");
+        },
+        
+        /**
+        * Adjusts the size of the shadow based on the size of the element.
+        * @method sizeUnderlay
+        */
+        sizeUnderlay: function () {
+
+            var oUnderlay = this.underlay,
+                oElement;
+
+            if (oUnderlay) {
+
+                oElement = this.element;
+
+                oUnderlay.style.width = oElement.offsetWidth + "px";
+                oUnderlay.style.height = oElement.offsetHeight + "px";
+
+            }
+
+        },
+
+        
+        /**
+        * Registers the Panel's header for drag & drop capability.
+        * @method registerDragDrop
+        */
+        registerDragDrop: function () {
+    
+            var me = this;
+    
+            if (this.header) {
+        
+                if (!DD) {
+        
+        
+                    return;
+                
+                }
+        
+                this.dd = new DD(this.element.id, this.id);
+        
+                if (!this.header.id) {
+                    this.header.id = this.id + "_h";
+                }
+        
+    
+                this.dd.startDrag = function () {
+        
+                    var offsetHeight,
+                        offsetWidth,
+                        viewPortWidth,
+                        viewPortHeight,
+                        scrollX,
+                        scrollY,
+                        topConstraint,
+                        leftConstraint,
+                        bottomConstraint,
+                        rightConstraint;
+    
+                    if (YAHOO.env.ua.ie == 6) {
+                        Dom.addClass(me.element,"drag");
+                    }
+        
+                    if (me.cfg.getProperty("constraintoviewport")) {
+    
+                        offsetHeight = me.element.offsetHeight;
+                        offsetWidth = me.element.offsetWidth;
+                        
+                        viewPortWidth = Dom.getViewportWidth();
+                        viewPortHeight = Dom.getViewportHeight();
+                        
+                        scrollX = Dom.getDocumentScrollLeft();
+                        scrollY = Dom.getDocumentScrollTop();
+                        
+                        topConstraint = scrollY + 10;
+                        leftConstraint = scrollX + 10;
+
+                        bottomConstraint = 
+                            scrollY + viewPortHeight - offsetHeight - 10;
+
+                        rightConstraint = 
+                            scrollX + viewPortWidth - offsetWidth - 10;
+        
+                        this.minX = leftConstraint;
+                        this.maxX = rightConstraint;
+                        this.constrainX = true;
+        
+                        this.minY = topConstraint;
+                        this.maxY = bottomConstraint;
+                        this.constrainY = true;
+    
+                    } else {
+    
+                        this.constrainX = false;
+                        this.constrainY = false;
+    
+                    }
+        
+                    me.dragEvent.fire("startDrag", arguments);
+                };
+        
+                this.dd.onDrag = function () {
+                    me.syncPosition();
+                    me.cfg.refireEvent("iframe");
+                    if (this.platform == "mac" && YAHOO.env.ua.gecko) {
+                        this.showMacGeckoScrollbars();
+                    }
+        
+                    me.dragEvent.fire("onDrag", arguments);
+                };
+        
+                this.dd.endDrag = function () {
+
+                    if (YAHOO.env.ua.ie == 6) {
+                        Dom.removeClass(me.element,"drag");
+                    }
+        
+                    me.dragEvent.fire("endDrag", arguments);
+                    me.moveEvent.fire(me.cfg.getProperty("xy"));
+                    
+                };
+        
+                this.dd.setHandleElId(this.header.id);
+                this.dd.addInvalidHandleType("INPUT");
+                this.dd.addInvalidHandleType("SELECT");
+                this.dd.addInvalidHandleType("TEXTAREA");
+            }
+        },
+        
+        /**
+        * Builds the mask that is laid over the document when the Panel is 
+        * configured to be modal.
+        * @method buildMask
+        */
+        buildMask: function () {
+    
+            var oMask = this.mask;
+    
+            if (!oMask) {
+
+                if (!m_oMaskTemplate) {
+                
+                    m_oMaskTemplate = document.createElement("div");
+                    m_oMaskTemplate.className = "mask";
+                    m_oMaskTemplate.innerHTML = "&#160;";
+                
+                }
+
+                oMask = m_oMaskTemplate.cloneNode(true);
+                oMask.id = this.id + "_mask";
+
+                document.body.insertBefore(oMask, document.body.firstChild);
+                
+                this.mask = oMask;
+
+            }
+
+        },
+        
+        /**
+        * Hides the modality mask.
+        * @method hideMask
+        */
+        hideMask: function () {
+            if (this.cfg.getProperty("modal") && this.mask) {
+                this.mask.style.display = "none";
+                this.hideMaskEvent.fire();
+                Dom.removeClass(document.body, "masked");
+            }
+        },
+        
+        /**
+        * Shows the modality mask.
+        * @method showMask
+        */
+        showMask: function () {
+            if (this.cfg.getProperty("modal") && this.mask) {
+                Dom.addClass(document.body, "masked");
+                this.sizeMask();
+                this.mask.style.display = "block";
+                this.showMaskEvent.fire();
+            }
+        },
+        
+        /**
+        * Sets the size of the modality mask to cover the entire scrollable 
+        * area of the document
+        * @method sizeMask
+        */
+        sizeMask: function () {
+
+            if (this.mask) {
+
+                this.mask.style.height = Dom.getDocumentHeight() + "px";
+                this.mask.style.width = Dom.getDocumentWidth() + "px";
+
+            }
+
+        },
+
+        
+        /**
+        * 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.
+        * @method render
+        * @param {String} appendToNode The element id to which the Module 
+        * should be appended to prior to rendering <em>OR</em>
+        * @param {HTMLElement} appendToNode The element to which the Module 
+        * should be appended to prior to rendering
+        * @return {boolean} Success or failure of the render
+        */
+        render: function (appendToNode) {
+
+            return Panel.superclass.render.call(this, 
+                appendToNode, this.innerElement);
+
+        },
+        
+        /**
+        * Removes the Panel element from the DOM and sets all child elements
+        * to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);
+            
+            this.removeMask();
+        
+            if (this.close) {
+            
+                Event.purgeElement(this.close);
+        
+            }
+        
+            Panel.superclass.destroy.call(this);  
+        
+        },
+        
+        /**
+        * Returns a String representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Panel.
+        */
+        toString: function () {
+            return "Panel " + this.id;
+        }
+    
+    });
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Dialog
+    * @extends YAHOO.widget.Panel
+    * @constructor
+    * @param {String} el The element ID representing the Dialog <em>OR</em>
+    * @param {HTMLElement} el The element representing the Dialog
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Dialog. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Dialog = function (el, userConfig) {
+    
+        YAHOO.widget.Dialog.superclass.constructor.call(this, el, userConfig);
+    
+    };
+
+
+    var Event = YAHOO.util.Event,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Dom = YAHOO.util.Dom,
+        KeyListener = YAHOO.util.KeyListener,
+        Connect = YAHOO.util.Connect,
+        Dialog = YAHOO.widget.Dialog,
+        Lang = YAHOO.lang,
+
+        /**
+        * Constant representing the name of the Dialog's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_SUBMIT": "beforeSubmit",
+            "SUBMIT": "submit",
+            "MANUAL_SUBMIT": "manualSubmit",
+            "ASYNC_SUBMIT": "asyncSubmit",
+            "FORM_SUBMIT": "formSubmit",
+            "CANCEL": "cancel"
+        
+        },
+        
+        /**
+        * Constant representing the Dialog's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "POST_METHOD": { 
+                key: "postmethod", 
+                value: "async" 
+            },
+            
+            "BUTTONS": { 
+                key: "buttons", 
+                value: "none" 
+            }
+        
+        };    
+
+
+    /**
+    * Constant representing the default CSS class used for a Dialog
+    * @property YAHOO.widget.Dialog.CSS_DIALOG
+    * @static
+    * @final
+    * @type String
+    */
+    Dialog.CSS_DIALOG = "yui-dialog";
+
+
+    function removeButtonEventHandlers() {
+
+        var aButtons = this._aButtons,
+            nButtons,
+            oButton,
+            i;
+
+        if (Lang.isArray(aButtons)) {
+
+            nButtons = aButtons.length;
+
+            if (nButtons > 0) {
+
+                i = nButtons - 1;
+
+                do {
+
+                    oButton = aButtons[i];
+                    
+                    if (oButton instanceof YAHOO.widget.Button) {
+                        
+                        oButton.destroy();
+                        
+                    }
+                    else if (oButton.tagName.toUpperCase() == "BUTTON") {
+
+                        Event.purgeElement(oButton);
+                        Event.purgeElement(oButton, false);
+
+                    }
+
+                }
+                while (i--);
+            
+            }
+        
+        }
+
+    }
+    
+    
+    YAHOO.extend(Dialog, YAHOO.widget.Panel, { 
+
+        
+        /**
+        * @property form
+        * @description Object reference to the Dialog's 
+        * <code>&#60;form&#62;</code> element.
+        * @default null 
+        * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-40002357">HTMLFormElement</a>
+        */
+        form: null,
+    
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the Dialog's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+            Dialog.superclass.initDefaultConfig.call(this);
+        
+            /**
+            * The internally maintained callback object for use with the 
+            * Connection utility
+            * @property callback
+            * @type Object
+            */
+            this.callback = {
+    
+                /**
+                * The function to execute upon success of the 
+                * Connection submission
+                * @property callback.success
+                * @type Function
+                */
+                success: null,
+    
+                /**
+                * The function to execute upon failure of the 
+                * Connection submission
+                * @property callback.failure
+                * @type Function
+                */
+                failure: null,
+    
+                /**
+                * The arbitraty argument or arguments to pass to the Connection 
+                * callback functions
+                * @property callback.argument
+                * @type Object
+                */
+                argument: null
+    
+            };
+        
+
+            // Add form dialog config properties //
+            
+            /**
+            * The method to use for posting the Dialog's form. Possible values 
+            * are "async", "form", and "manual".
+            * @config postmethod
+            * @type String
+            * @default async
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.POST_METHOD.key, {
+                handler: this.configPostMethod, 
+                value: DEFAULT_CONFIG.POST_METHOD.value, 
+                validator: function (val) {
+                    if (val != "form" && val != "async" && val != "none" && 
+                        val != "manual") {
+                        return false;
+                    } else {
+                        return true;
+                    }
+                }
+            });
+            
+            /**
+            * Array of object literals, each containing a set of properties 
+            * defining a button to be appended into the Dialog's footer.
+            * Each button object in the buttons array can have three properties:
+            * <dt>text:</dt>
+            * <dd>The text that will display on the face of the button.  <em>
+            * Please note:</em> As of version 2.3, the text can include 
+            * HTML.</dd>
+            * <dt>handler:</dt>
+            * <dd>Can be either:
+            *     <ol>
+            *         <li>A reference to a function that should fire when the 
+            * button is clicked.  (In this case scope of this function is 
+            * always its Dialog instance.)</li>
+            *         <li>An object literal representing the code to be 
+            * executed when the button is clicked.  Format:<br> <code> {<br>  
+            * <strong>fn:</strong> Function,   &#47;&#47; The handler to call 
+            * when  the event fires.<br> <strong>obj:</strong> Object, 
+            * &#47;&#47; An  object to pass back to the handler.<br> <strong>
+            * scope:</strong>  Object &#47;&#47; The object to use for the 
+            * scope of the handler. <br> } </code> <br><em>Please note: this 
+            * functionality was added in version 2.3.</em></li>
+            *     </ol>
+            * </dd>
+            * <dt>isDefault:</dt>
+            * <dd>An optional boolean value that specifies that a button 
+            * should be highlighted and focused by default.</dd>
+            * @config buttons
+            * @type {Array|String}
+            * @default "none"
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.BUTTONS.key, {
+                handler: this.configButtons,
+                value: DEFAULT_CONFIG.BUTTONS.value
+            }); 
+            
+        },
+        
+        /**
+        * Initializes the custom events for Dialog which are fired 
+        * automatically at appropriate times by the Dialog class.
+        * @method initEvents
+        */
+        initEvents: function () {
+            Dialog.superclass.initEvents.call(this);
+        
+            var SIGNATURE = CustomEvent.LIST;
+        
+            /**
+            * CustomEvent fired prior to submission
+            * @event beforeSubmitEvent
+            */ 
+            this.beforeSubmitEvent = 
+                this.createEvent(EVENT_TYPES.BEFORE_SUBMIT);
+            this.beforeSubmitEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired after submission
+            * @event submitEvent
+            */
+            this.submitEvent = this.createEvent(EVENT_TYPES.SUBMIT);
+            this.submitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired prior to manual submission
+            * @event manualSubmitEvent
+            */
+            this.manualSubmitEvent = 
+                this.createEvent(EVENT_TYPES.MANUAL_SUBMIT);
+            this.manualSubmitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired prior to asynchronous submission
+            * @event asyncSubmitEvent
+            */ 
+            this.asyncSubmitEvent = this.createEvent(EVENT_TYPES.ASYNC_SUBMIT);
+            this.asyncSubmitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired prior to form-based submission
+            * @event formSubmitEvent
+            */
+            this.formSubmitEvent = this.createEvent(EVENT_TYPES.FORM_SUBMIT);
+            this.formSubmitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after cancel
+            * @event cancelEvent
+            */
+            this.cancelEvent = this.createEvent(EVENT_TYPES.CANCEL);
+            this.cancelEvent.signature = SIGNATURE;
+        
+        },
+        
+        /**
+        * 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.
+        * @method init
+        * @param {String} el The element ID representing the Dialog <em>OR</em>
+        * @param {HTMLElement} el The element representing the Dialog
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Dialog. 
+        * See configuration documentation for more details.
+        */
+        init: function (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
+            */
+
+            Dialog.superclass.init.call(this, el/*, userConfig*/); 
+        
+            this.beforeInitEvent.fire(Dialog);
+        
+            Dom.addClass(this.element, Dialog.CSS_DIALOG);
+        
+            this.cfg.setProperty("visible", false);
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+        
+            this.showEvent.subscribe(this.focusFirst, this, true);
+            this.beforeHideEvent.subscribe(this.blurButtons, this, true);
+
+            this.subscribe("changeBody", this.registerForm);
+        
+            this.initEvent.fire(Dialog);
+        },
+        
+        /**
+        * Submits the Dialog's form depending on the value of the 
+        * "postmethod" configuration property.  <strong>Please note:
+        * </strong> As of version 2.3 this method will automatically handle 
+        * asyncronous file uploads should the Dialog instance's form contain 
+        * <code>&#60;input type="file"&#62;</code> elements.  If a Dialog 
+        * instance will be handling asyncronous file uploads, its 
+        * <code>callback</code> property will need to be setup with a 
+        * <code>upload</code> handler rather than the standard 
+        * <code>success</code> and, or <code>failure</code> handlers.  For more 
+        * information, see the <a href="http://developer.yahoo.com/yui/
+        * connection/#file">Connection Manager documenation on file uploads</a>.
+        * @method doSubmit
+        */
+        doSubmit: function () {
+    
+            var oForm = this.form,
+                bUseFileUpload = false,
+                bUseSecureFileUpload = false,
+                aElements,
+                nElements,
+                i,
+                sMethod;
+
+
+            switch (this.cfg.getProperty("postmethod")) {
+    
+            case "async":
+
+                aElements = oForm.elements;
+                nElements = aElements.length;
+
+                if (nElements > 0) {
+                
+                    i = nElements - 1;
+                
+                    do {
+                    
+                        if (aElements[i].type == "file") {
+                        
+                            bUseFileUpload = true;
+                            break;
+                        
+                        }
+                    
+                    }
+                    while(i--);
+                
+                }
+
+                if (bUseFileUpload && YAHOO.env.ua.ie && this.isSecure) {
+
+                    bUseSecureFileUpload = true;
+                
+                }
+
+                sMethod = 
+                    (oForm.getAttribute("method") || "POST").toUpperCase();
+
+                Connect.setForm(oForm, bUseFileUpload, bUseSecureFileUpload);
+
+                Connect.asyncRequest(sMethod, oForm.getAttribute("action"), 
+                    this.callback);
+
+                this.asyncSubmitEvent.fire();
+
+                break;
+
+            case "form":
+
+                oForm.submit();
+                this.formSubmitEvent.fire();
+
+                break;
+
+            case "none":
+            case "manual":
+
+                this.manualSubmitEvent.fire();
+
+                break;
+    
+            }
+    
+        },
+        
+        
+        /**
+        * Prepares the Dialog's internal FORM object, creating one if one is
+        * not currently present.
+        * @method registerForm
+        */
+        registerForm: function () {
+    
+            var form = this.element.getElementsByTagName("form")[0],
+                me = this,
+                firstElement,
+                lastElement;
+
+
+            if (this.form) {
+
+                if (this.form == form && 
+                    Dom.isAncestor(this.element, this.form)) {
+    
+                    return;
+    
+                }
+                else {
+
+                    Event.purgeElement(this.form);
+                    
+                    this.form = null;                
+                
+                }
+            
+            }
+        
+
+            if (!form) {
+
+                form = document.createElement("form");
+                form.name = "frm_" + this.id;
+
+                this.body.appendChild(form);
+
+            }
+
+
+            if (form) {
+
+                this.form = form;
+
+                Event.on(form, "submit", function (e) {
+
+                    Event.stopEvent(e);
+
+                    this.submit();
+                    this.form.blur();
+        
+                });
+
+
+                this.firstFormElement = function () {
+        
+                    var f, el, nElements = form.elements.length;
+        
+                    for (f = 0; f < nElements; f++) {
+    
+                        el = form.elements[f];
+    
+                        if (el.focus && !el.disabled && el.type != "hidden") {
+    
+                            return el;
+    
+                        }
+    
+                    }
+    
+                    return null;
+                    
+                }();
+            
+                this.lastFormElement = function () {
+        
+                    var f, el, nElements = form.elements.length;
+        
+                    for (f = nElements - 1; f >= 0; f--) {
+    
+                        el = form.elements[f];
+    
+                        if (el.focus && !el.disabled && el.type != "hidden") {
+    
+                            return el;
+    
+                        }
+    
+                    }
+    
+                    return null;
+    
+                }();
+            
+                if (this.cfg.getProperty("modal")) {
+            
+                    firstElement = this.firstFormElement || this.firstButton;
+        
+                    if (firstElement) {
+    
+                        this.preventBackTab = new KeyListener(firstElement, 
+                            { shift: true, keys: 9 }, 
+                            { fn: me.focusLast, scope: me, 
+                            correctScope: true });
+    
+                        this.showEvent.subscribe(this.preventBackTab.enable, 
+                            this.preventBackTab, true);
+    
+                        this.hideEvent.subscribe(this.preventBackTab.disable, 
+                            this.preventBackTab, true);
+                    }
+            
+                    lastElement = this.lastButton || this.lastFormElement;
+    
+                    if (lastElement) {
+    
+                        this.preventTabOut = new KeyListener(lastElement, 
+                            { shift: false, keys: 9 }, 
+                            { fn: me.focusFirst, scope: me, 
+                            correctScope: true });
+    
+                        this.showEvent.subscribe(this.preventTabOut.enable, 
+                            this.preventTabOut, true);
+    
+                        this.hideEvent.subscribe(this.preventTabOut.disable, 
+                            this.preventTabOut, true);
+    
+                    }
+                }
+            
+            }
+
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * 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 Dialog.
+        * @method configClose
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For 
+        * configuration handlers, args[0] will equal the newly applied value 
+        * for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configClose: function (type, args, obj) {
+            var val = args[0];
+        
+            function doCancel(e, obj) {
+                obj.cancel();
+            }
+        
+            if (val) {
+                if (! this.close) {
+                    this.close = document.createElement("div");
+                    Dom.addClass(this.close, "container-close");
+        
+                    this.close.innerHTML = "&#160;";
+                    this.innerElement.appendChild(this.close);
+                    Event.on(this.close, "click", doCancel, this);
+                } else {
+                    this.close.style.display = "block";
+                }
+            } else {
+                if (this.close) {
+                    this.close.style.display = "none";
+                }
+            }
+        },
+        
+        /**
+        * The default event handler for the "buttons" configuration property
+        * @method configButtons
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configButtons: function (type, args, obj) {
+    
+            var Button = YAHOO.widget.Button,
+                aButtons = args[0],
+                oInnerElement = this.innerElement,
+                oButton,
+                oButtonEl,
+                oYUIButton,
+                nButtons,
+                oSpan,
+                oFooter,
+                i;
+
+            removeButtonEventHandlers.call(this);
+            
+            this._aButtons = null;
+
+            if (Lang.isArray(aButtons)) {
+
+                oSpan = document.createElement("span");
+                oSpan.className = "button-group";
+
+                nButtons = aButtons.length;
+
+                this._aButtons = [];
+        
+                for (i = 0; i < nButtons; i++) {
+
+                    oButton = aButtons[i];
+
+                    if (Button) {
+
+                        oYUIButton = new Button({ label: oButton.text, 
+                                            container: oSpan });
+
+                        oButtonEl = oYUIButton.get("element");
+
+                        if (oButton.isDefault) {
+
+                            oYUIButton.addClass("default");
+
+                            this.defaultHtmlButton = oButtonEl;
+
+                        }
+    
+                        if (Lang.isFunction(oButton.handler)) {
+    
+                            oYUIButton.set("onclick", { fn: oButton.handler, 
+                                obj: this, scope: this });
+            
+                        }
+                        else if (Lang.isObject(oButton.handler) && 
+                            Lang.isFunction(oButton.handler.fn)) {
+
+                            oYUIButton.set("onclick", { fn: oButton.handler.fn, 
+                                obj: ((!Lang.isUndefined(oButton.handler.obj)) ? 
+                                oButton.handler.obj : this), 
+                                scope: (oButton.handler.scope || this) });
+    
+                        }
+
+                        this._aButtons[this._aButtons.length] = oYUIButton;
+
+                    }
+                    else {
+        
+                        oButtonEl = document.createElement("button");
+                        oButtonEl.setAttribute("type", "button");
+            
+                        if (oButton.isDefault) {
+                            oButtonEl.className = "default";
+                            this.defaultHtmlButton = oButtonEl;
+                        }
+    
+                        oButtonEl.innerHTML = oButton.text;
+    
+                        if (Lang.isFunction(oButton.handler)) {
+    
+                            Event.on(oButtonEl, "click", oButton.handler, 
+                                this, true);
+            
+                        }
+                        else if (Lang.isObject(oButton.handler) && 
+                            Lang.isFunction(oButton.handler.fn)) {
+    
+                            Event.on(oButtonEl, "click", oButton.handler.fn, 
+                                ((!Lang.isUndefined(oButton.handler.obj)) ? 
+                                oButton.handler.obj : this), 
+                                (oButton.handler.scope || this));
+    
+                        }
+            
+                        oSpan.appendChild(oButtonEl);
+                        
+                        this._aButtons[this._aButtons.length] = oButtonEl;
+                        
+                    }
+
+                    oButton.htmlButton = oButtonEl;
+        
+                    if (i === 0) {
+                        this.firstButton = oButtonEl;
+                    }
+        
+                    if (i == (nButtons - 1)) {
+                        this.lastButton = oButtonEl;
+                    }
+        
+                }
+        
+                this.setFooter(oSpan);
+
+                oFooter = this.footer;
+                
+                if (Dom.inDocument(this.element) && 
+                    !Dom.isAncestor(oInnerElement, oFooter)) {
+    
+                    oInnerElement.appendChild(oFooter);
+                
+                }
+
+                this.buttonSpan = oSpan;
+
+            } else { // Do cleanup
+
+                oSpan = this.buttonSpan;
+                oFooter = this.footer;
+
+                if (oSpan && oFooter) {
+
+                    oFooter.removeChild(oSpan);
+
+                    this.buttonSpan = null;
+                    this.firstButton = null;
+                    this.lastButton = null;
+                    this.defaultHtmlButton = null;
+
+                }
+
+            }
+
+            this.cfg.refireEvent("iframe");
+            this.cfg.refireEvent("underlay");
+
+        },
+
+
+        /**
+        * @method getButtons
+        * @description Returns an array containing each of the Dialog's 
+        * buttons, by default an array of HTML <code>&#60;BUTTON&#60;</code> 
+        * elements.  If the Dialog's buttons were created using the 
+        * YAHOO.widget.Button class (via the inclusion of the optional Button 
+        * dependancy on the page), an array of YAHOO.widget.Button instances 
+        * is returned.
+        * @return {Array}
+        */
+        getButtons: function () {
+        
+            var aButtons = this._aButtons;
+            
+            if (aButtons) {
+            
+                return aButtons;
+            
+            }
+        
+        },
+
+        
+        /**
+        * Sets focus to the first element in the Dialog's form or the first 
+        * button defined via the "buttons" configuration property. Called 
+        * when the Dialog is made visible.
+        * @method focusFirst
+        */
+        focusFirst: function (type, args, obj) {
+    
+            var oElement = this.firstFormElement,
+                oEvent;
+
+            if (args) {
+
+                oEvent = args[1];
+
+                if (oEvent) {
+
+                    Event.stopEvent(oEvent);
+
+                }
+
+            }
+        
+
+            if (oElement) {
+
+                /*
+                    Place the call to the "focus" method inside a try/catch
+                    block to prevent IE from throwing JavaScript errors if
+                    the element is disabled or hidden.
+                */
+
+                try {
+
+                    oElement.focus();
+
+                }
+                catch(oException) {
+
+                }
+
+            } else {
+
+                this.focusDefaultButton();
+
+            }
+
+        },
+        
+        /**
+        * Sets focus to the last element in the Dialog's form or the last 
+        * button defined via the "buttons" configuration property.
+        * @method focusLast
+        */
+        focusLast: function (type, args, obj) {
+    
+            var aButtons = this.cfg.getProperty("buttons"),
+                oElement = this.lastFormElement,
+                oEvent;
+    
+            if (args) {
+
+                oEvent = args[1];
+
+                if (oEvent) {
+
+                    Event.stopEvent(oEvent);
+
+                }
+
+            }
+            
+            if (aButtons && Lang.isArray(aButtons)) {
+
+                this.focusLastButton();
+
+            } else {
+
+                if (oElement) {
+
+                    /*
+                        Place the call to the "focus" method inside a try/catch
+                        block to prevent IE from throwing JavaScript errors if
+                        the element is disabled or hidden.
+                    */
+    
+                    try {
+    
+                        oElement.focus();
+    
+                    }
+                    catch(oException) {
+    
+                    }
+
+                }
+
+            }
+
+        },
+        
+        /**
+        * Sets the focus to the button that is designated as the default via 
+        * the "buttons" configuration property. By default, this method is 
+        * called when the Dialog is made visible.
+        * @method focusDefaultButton
+        */
+        focusDefaultButton: function () {
+        
+            var oElement = this.defaultHtmlButton;
+        
+            if (oElement) {
+
+                /*
+                    Place the call to the "focus" method inside a try/catch
+                    block to prevent IE from throwing JavaScript errors if
+                    the element is disabled or hidden.
+                */
+
+                try {
+
+                    oElement.focus();
+                
+                }
+                catch(oException) {
+                
+                }
+
+            }
+        },
+        
+        /**
+        * Blurs all the buttons defined via the "buttons" 
+        * configuration property.
+        * @method blurButtons
+        */
+        blurButtons: function () {
+            
+            var aButtons = this.cfg.getProperty("buttons"),
+                nButtons,
+                oButton,
+                oElement,
+                i;
+
+            if (aButtons && Lang.isArray(aButtons)) {
+            
+                nButtons = aButtons.length;
+                
+                if (nButtons > 0) {
+                
+                    i = (nButtons - 1);
+                    
+                    do {
+                    
+                        oButton = aButtons[i];
+                        
+                        if (oButton) {
+
+                            oElement = oButton.htmlButton;
+
+                            if (oElement) {
+
+                                /*
+                                    Place the call to the "blur" method inside  
+                                    a try/catch block to prevent IE from  
+                                    throwing JavaScript errors if the element 
+                                    is disabled or hidden.
+                                */
+    
+                                try {
+            
+                                    oElement.blur();
+                                
+                                }
+                                catch(oException) {
+                                
+                                
+                                }
+                            
+                            }
+
+                        }
+                    
+                    }
+                    while(i--);
+                
+                }
+            
+            }
+
+        },
+        
+        /**
+        * Sets the focus to the first button created via the "buttons"
+        * configuration property.
+        * @method focusFirstButton
+        */
+        focusFirstButton: function () {
+    
+            var aButtons = this.cfg.getProperty("buttons"),
+                oButton,
+                oElement;
+
+            if (aButtons && Lang.isArray(aButtons)) {
+
+                oButton = aButtons[0];
+
+                if (oButton) {
+
+                    oElement = oButton.htmlButton;
+                    
+                    if (oElement) {
+
+                        /*
+                            Place the call to the "focus" method inside a 
+                            try/catch block to prevent IE from throwing 
+                            JavaScript errors if the element is disabled 
+                            or hidden.
+                        */
+    
+                        try {
+    
+                            oElement.focus();
+                        
+                        }
+                        catch(oException) {
+                        
+                        
+                        }
+                    
+                    }
+
+                }
+
+            }
+        },
+        
+        /**
+        * Sets the focus to the last button created via the "buttons" 
+        * configuration property.
+        * @method focusLastButton
+        */
+        focusLastButton: function () {
+    
+            var aButtons = this.cfg.getProperty("buttons"),
+                nButtons,
+                oButton,
+                oElement;
+
+            if (aButtons && Lang.isArray(aButtons)) {
+
+                nButtons = aButtons.length;
+                
+                if (nButtons > 0) {
+
+                    oButton = aButtons[(nButtons - 1)];
+                    
+                    if (oButton) {
+                    
+                        oElement = oButton.htmlButton;
+
+                        if (oElement) {
+
+                            /*
+                                Place the call to the "focus" method inside a 
+                                try/catch block to prevent IE from throwing 
+                                JavaScript errors if the element is disabled
+                                or hidden.
+                            */
+        
+                            try {
+        
+                                oElement.focus();
+                            
+                            }
+                            catch(oException) {
+                            
+                            
+                            }
+                        
+                        }
+                    
+                    }
+                
+                }
+            
+            }
+
+        },
+        
+        /**
+        * The default event handler for the "postmethod" configuration property
+        * @method configPostMethod
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For 
+        * configuration handlers, args[0] will equal the newly applied value 
+        * for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configPostMethod: function (type, args, obj) {
+    
+            var postmethod = args[0];
+        
+            this.registerForm();
+    
+        },
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * 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.
+        * @method validate
+        */
+        validate: function () {
+            return true;
+        },
+        
+        /**
+        * Executes a submit of the Dialog followed by a hide, if validation 
+        * is successful.
+        * @method submit
+        */
+        submit: function () {
+            if (this.validate()) {
+                this.beforeSubmitEvent.fire();
+                this.doSubmit();
+                this.submitEvent.fire();
+                this.hide();
+                return true;
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Executes the cancel of the Dialog followed by a hide.
+        * @method cancel
+        */
+        cancel: function () {
+            this.cancelEvent.fire();
+            this.hide();
+        },
+        
+        /**
+        * Returns a JSON-compatible data structure representing the data 
+        * currently contained in the form.
+        * @method getData
+        * @return {Object} A JSON object reprsenting the data of the 
+        * current form.
+        */
+        getData: function () {
+        
+            var oForm = this.form,
+                aElements,
+                nTotalElements,
+                oData,
+                sName,
+                oElement,
+                nElements,
+                sType,
+                sTagName,
+                aOptions,
+                nOptions,
+                aValues,
+                oOption,
+                sValue,
+                oRadio,
+                oCheckbox,
+                i,
+                n;    
+    
+            function isFormElement(p_oElement) {
+            
+                var sTag = p_oElement.tagName.toUpperCase();
+                
+                return ((sTag == "INPUT" || sTag == "TEXTAREA" || 
+                        sTag == "SELECT") && p_oElement.name == sName);
+    
+            }
+    
+    
+            if (oForm) {
+        
+                aElements = oForm.elements;
+                nTotalElements = aElements.length;
+                oData = {};
+    
+        
+                for (i = 0; i < nTotalElements; i++) {
+        
+                    sName = aElements[i].name;
+        
+                    /*
+                        Using "Dom.getElementsBy" to safeguard user from JS 
+                        errors that result from giving a form field (or set of 
+                        fields) the same name as a native method of a form 
+                        (like "submit") or a DOM collection (such as the "item"
+                        method). Originally tried accessing fields via the 
+                        "namedItem" method of the "element" collection, but 
+                        discovered that it won't return a collection of fields 
+                        in Gecko.
+                    */
+        
+                    oElement = Dom.getElementsBy(isFormElement, "*", oForm);
+                    nElements = oElement.length;
+        
+                    if (nElements > 0) {
+        
+                        if (nElements == 1) {
+        
+                            oElement = oElement[0];
+        
+                            sType = oElement.type;
+                            sTagName = oElement.tagName.toUpperCase();
+        
+                            switch (sTagName) {
+        
+                            case "INPUT":
+    
+                                if (sType == "checkbox") {
+    
+                                    oData[sName] = oElement.checked;
+    
+                                }
+                                else if (sType != "radio") {
+    
+                                    oData[sName] = oElement.value;
+    
+                                }
+    
+                                break;
+    
+                            case "TEXTAREA":
+    
+                                oData[sName] = oElement.value;
+    
+                                break;
+    
+                            case "SELECT":
+    
+                                aOptions = oElement.options;
+                                nOptions = aOptions.length;
+                                aValues = [];
+    
+                                for (n = 0; n < nOptions; n++) {
+    
+                                    oOption = aOptions[n];
+    
+                                    if (oOption.selected) {
+    
+                                        sValue = oOption.value;
+    
+                                        if (!sValue || sValue === "") {
+    
+                                            sValue = oOption.text;
+    
+                                        }
+    
+                                        aValues[aValues.length] = sValue;
+    
+                                    }
+    
+                                }
+    
+                                oData[sName] = aValues;
+    
+                                break;
+        
+                            }
+        
+        
+                        }
+                        else {
+        
+                            sType = oElement[0].type;
+        
+                            switch (sType) {
+        
+                            case "radio":
+    
+                                for (n = 0; n < nElements; n++) {
+    
+                                    oRadio = oElement[n];
+    
+                                    if (oRadio.checked) {
+    
+                                        oData[sName] = oRadio.value;
+                                        break;
+    
+                                    }
+    
+                                }
+    
+                                break;
+    
+                            case "checkbox":
+    
+                                aValues = [];
+    
+                                for (n = 0; n < nElements; n++) {
+    
+                                    oCheckbox = oElement[n];
+    
+                                    if (oCheckbox.checked) {
+    
+                                        aValues[aValues.length] = 
+                                            oCheckbox.value;
+    
+                                    }
+    
+                                }
+    
+                                oData[sName] = aValues;
+    
+                                break;
+        
+                            }
+        
+                        }
+        
+                    }
+        
+                }
+        
+            }
+        
+        
+            return oData;
+        
+        },
+        
+        /**
+        * Removes the Panel element from the DOM and sets all child elements 
+        * to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            removeButtonEventHandlers.call(this);
+            
+            this._aButtons = null;
+
+            var aForms = this.element.getElementsByTagName("form"),
+                oForm;
+            
+            if (aForms.length > 0) {
+
+                oForm = aForms[0];
+
+                if (oForm) {
+                   
+                    Event.purgeElement(oForm);
+            
+                    this.body.removeChild(oForm);
+                    
+                    this.form = null;
+            
+                }
+            
+            }
+        
+            Dialog.superclass.destroy.call(this);  
+        
+        },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Dialog
+        */
+        toString: function () {
+            return "Dialog " + this.id;
+        }
+    
+    });
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class SimpleDialog
+    * @extends YAHOO.widget.Dialog
+    * @constructor
+    * @param {String} el The element ID representing the SimpleDialog 
+    * <em>OR</em>
+    * @param {HTMLElement} el The element representing the SimpleDialog
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this SimpleDialog. See 
+    * configuration documentation for more details.
+    */
+    YAHOO.widget.SimpleDialog = function (el, userConfig) {
+    
+        YAHOO.widget.SimpleDialog.superclass.constructor.call(this, 
+            el, userConfig);
+    
+    };
 
-/**
-* Initializes the class's configurable properties which can be changed using the Dialog's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Dialog.prototype.initDefaultConfig = function() {
-       YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);
-
-       /**
-       * The internally maintained callback object for use with the Connection utility
-       * @property callback
-       * @type Object
-       */
-       this.callback = {
-               /**
-               * The function to execute upon success of the Connection submission
-               * @property callback.success
-               * @type Function
-               */
-               success : null,
-               /**
-               * The function to execute upon failure of the Connection submission
-               * @property callback.failure
-               * @type Function
-               */
-               failure : null,
-               /**
-               * The arbitraty argument or arguments to pass to the Connection callback functions
-               * @property callback.argument
-               * @type Object
-               */
-               argument: null
-       };
-
-       // Add form dialog config properties //
-       
-       /**
-       * The method to use for posting the Dialog's form. Possible values are "async", "form", and "manual".
-       * @config postmethod 
-       * @type String
-       * @default async
-       */
-       this.cfg.addProperty("postmethod", { value:"async", handler:this.configPostMethod, validator:function(val) { 
-                                                                                                       if (val != "form" && val != "async" && val != "none" && val != "manual") {
-                                                                                                               return false;
-                                                                                                       } else {
-                                                                                                               return true;
-                                                                                                       }
-                                                                                               } });
-
-       /**
-       * Object literal(s) defining the buttons for the Dialog's footer.
-       * @config buttons
-       * @type Object[]
-       * @default "none"
-       */
-       this.cfg.addProperty("buttons",         { value:"none", handler:this.configButtons } );
-};
-
-/**
-* Initializes the custom events for Dialog which are fired automatically at appropriate times by the Dialog class.
-* @method initEvents
-*/
-YAHOO.widget.Dialog.prototype.initEvents = function() {
-       YAHOO.widget.Dialog.superclass.initEvents.call(this);
-
-       /**
-       * CustomEvent fired prior to submission
-       * @event beforeSumitEvent
-       */      
-       this.beforeSubmitEvent  = new YAHOO.util.CustomEvent("beforeSubmit");
-       
-       /**
-       * CustomEvent fired after submission
-       * @event submitEvent
-       */
-       this.submitEvent                = new YAHOO.util.CustomEvent("submit");
-
-       /**
-       * CustomEvent fired prior to manual submission
-       * @event manualSubmitEvent
-       */
-       this.manualSubmitEvent  = new YAHOO.util.CustomEvent("manualSubmit");
-
-       /**
-       * CustomEvent fired prior to asynchronous submission
-       * @event asyncSubmitEvent
-       */      
-       this.asyncSubmitEvent   = new YAHOO.util.CustomEvent("asyncSubmit");
-
-       /**
-       * CustomEvent fired prior to form-based submission
-       * @event formSubmitEvent
-       */
-       this.formSubmitEvent    = new YAHOO.util.CustomEvent("formSubmit");
-
-       /**
-       * CustomEvent fired after cancel
-       * @event cancelEvent
-       */
-       this.cancelEvent                = new YAHOO.util.CustomEvent("cancel");
-};
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the Dialog <em>OR</em>
-* @param {HTMLElement} el      The element representing the Dialog
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.
-*/
-YAHOO.widget.Dialog.prototype.init = function(el, userConfig) {
-       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
-       
-       this.beforeInitEvent.fire(YAHOO.widget.Dialog);
+    var Dom = YAHOO.util.Dom,
+        SimpleDialog = YAHOO.widget.SimpleDialog,
+    
+        /**
+        * Constant representing the SimpleDialog's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "ICON": { 
+                key: "icon", 
+                value: "none", 
+                suppressEvent: true  
+            },
+        
+            "TEXT": { 
+                key: "text", 
+                value: "", 
+                suppressEvent: true, 
+                supercedes: ["icon"] 
+            }
+        
+        };
+
+    /**
+    * Constant for the standard network icon for a blocking action
+    * @property YAHOO.widget.SimpleDialog.ICON_BLOCK
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_BLOCK = "blckicon";
+    
+    /**
+    * Constant for the standard network icon for alarm
+    * @property YAHOO.widget.SimpleDialog.ICON_ALARM
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_ALARM = "alrticon";
+    
+    /**
+    * Constant for the standard network icon for help
+    * @property YAHOO.widget.SimpleDialog.ICON_HELP
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_HELP  = "hlpicon";
+    
+    /**
+    * Constant for the standard network icon for info
+    * @property YAHOO.widget.SimpleDialog.ICON_INFO
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_INFO  = "infoicon";
+    
+    /**
+    * Constant for the standard network icon for warn
+    * @property YAHOO.widget.SimpleDialog.ICON_WARN
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_WARN  = "warnicon";
+    
+    /**
+    * Constant for the standard network icon for a tip
+    * @property YAHOO.widget.SimpleDialog.ICON_TIP
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_TIP   = "tipicon";
+
+    /**
+    * Constant representing the name of the CSS class applied to the element 
+    * created by the "icon" configuration property.
+    * @property YAHOO.widget.SimpleDialog.ICON_CSS_CLASSNAME
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_CSS_CLASSNAME = "yui-icon";
+    
+    /**
+    * Constant representing the default CSS class used for a SimpleDialog
+    * @property YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.CSS_SIMPLEDIALOG = "yui-simple-dialog";
 
-       YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Dialog.CSS_DIALOG);
+    
+    YAHOO.extend(SimpleDialog, YAHOO.widget.Dialog, {
+    
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the SimpleDialog's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+        
+            SimpleDialog.superclass.initDefaultConfig.call(this);
+        
+            // Add dialog config properties //
+        
+            /**
+            * Sets the informational icon for the SimpleDialog
+            * @config icon
+            * @type String
+            * @default "none"
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.ICON.key, {
+                handler: this.configIcon,
+                value: DEFAULT_CONFIG.ICON.value,
+                suppressEvent: DEFAULT_CONFIG.ICON.suppressEvent
+            });
+        
+            /**
+            * Sets the text for the SimpleDialog
+            * @config text
+            * @type String
+            * @default ""
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key, { 
+                handler: this.configText, 
+                value: DEFAULT_CONFIG.TEXT.value, 
+                suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.TEXT.supercedes 
+            });
+        
+        },
+        
+        
+        /**
+        * 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.
+        * @method init
+        * @param {String} el The element ID representing the SimpleDialog 
+        * <em>OR</em>
+        * @param {HTMLElement} el The element representing the SimpleDialog
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this 
+        * SimpleDialog. See configuration documentation for more details.
+        */
+        init: function (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
+            */
+
+            SimpleDialog.superclass.init.call(this, el/*, userConfig*/);
+        
+            this.beforeInitEvent.fire(SimpleDialog);
+        
+            Dom.addClass(this.element, SimpleDialog.CSS_SIMPLEDIALOG);
+        
+            this.cfg.queueProperty("postmethod", "manual");
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+        
+            this.beforeRenderEvent.subscribe(function () {
+                if (! this.body) {
+                    this.setBody("");
+                }
+            }, this, true);
+        
+            this.initEvent.fire(SimpleDialog);
+        
+        },
+        
+        /**
+        * Prepares the SimpleDialog's internal FORM object, creating one if one 
+        * is not currently present, and adding the value hidden field.
+        * @method registerForm
+        */
+        registerForm: function () {
 
-       this.cfg.setProperty("visible", false);
+            SimpleDialog.superclass.registerForm.call(this);
 
-       if (userConfig) {
-               this.cfg.applyConfig(userConfig, true);
-       }
+            this.form.innerHTML += "<input type=\"hidden\" name=\"" + 
+                this.id + "\" value=\"\"/>";
 
-       this.showEvent.subscribe(this.focusFirst, this, true);
-       this.beforeHideEvent.subscribe(this.blurButtons, this, true);
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * Fired when the "icon" property is set.
+        * @method configIcon
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configIcon: function (type,args,obj) {
+        
+            var sIcon = args[0],
+                oBody = this.body,
+                sCSSClass = SimpleDialog.ICON_CSS_CLASSNAME,
+                oIcon,
+                oIconParent;
+        
+            if (sIcon && sIcon != "none") {
 
-       this.beforeRenderEvent.subscribe(function() {
-               var buttonCfg = this.cfg.getProperty("buttons");
-               if (buttonCfg && buttonCfg != "none") {
-                       if (! this.footer) {
-                               this.setFooter("");
-                       }
-               }
-       }, this, true);
+                oIcon = Dom.getElementsByClassName(sCSSClass, "*" , oBody);
 
-       this.initEvent.fire(YAHOO.widget.Dialog);
-};
+                if (oIcon) {
 
-/**
-* Performs the submission of the Dialog form depending on the value of "postmethod" property.
-* @method doSubmit
-*/
-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;
-       }
-};
-
-/**
-* Prepares the Dialog's internal FORM object, creating one if one is not currently present.
-* @method registerForm
-*/
-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];
-       }
-
-       this.firstFormElement = function() {
-               for (var f=0;f<form.elements.length;f++ ) {
-                       var el = form.elements[f];
-                       if (el.focus && ! el.disabled) {
-                               if (el.type && el.type != "hidden") {
-                                       return el;
-                               }
-                       }
-               }
-               return null;
-       }();
-
-       this.lastFormElement = function() {
-               for (var f=form.elements.length-1;f>=0;f-- ) {
-                       var el = form.elements[f];
-                       if (el.focus && ! el.disabled) {
-                               if (el.type && el.type != "hidden") {
-                                       return el;
-                               }
-                       }
-               }
-               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);
-               }
-
-               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);
-               }
-       }
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* 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 Dialog.
-* @method configClose
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Dialog.prototype.configClose = function(type, args, obj) {
-       var val = args[0];
-
-       var doCancel = function(e, obj) {
-               obj.cancel();
-       };
-
-       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");
-                       }
-
-                       this.close.innerHTML = "&#160;";
-                       this.innerElement.appendChild(this.close);
-                       YAHOO.util.Event.addListener(this.close, "click", doCancel, this);      
-               } else {
-                       this.close.style.display = "block";
-               }
-       } else {
-               if (this.close) {
-                       this.close.style.display = "none";
-               }
-       }
-};
-
-/**
-* The default event handler for the "buttons" configuration property
-* @method configButtons
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-                       }
-
-                       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;
-                       }
-
-                       if (b == (buttons.length-1)) {
-                               this.lastButton = button.htmlButton;
-                       }
-
-               }
-
-               this.setFooter(this.buttonSpan);
-
-               this.cfg.refireEvent("iframe");
-               this.cfg.refireEvent("underlay");
-       } else { // Do cleanup
-               if (this.buttonSpan) {
-                       if (this.buttonSpan.parentNode) {
-                               this.buttonSpan.parentNode.removeChild(this.buttonSpan);
-                       }
-
-                       this.buttonSpan = null;
-                       this.firstButton = null;
-                       this.lastButton = null;
-                       this.defaultHtmlButton = null;
-               }
-       }
-};
-
-
-/**
-* The default event handler used to focus the first field of the form when the Dialog is shown.
-* @method focusFirst
-*/
-YAHOO.widget.Dialog.prototype.focusFirst = function(type,args,obj) {
-       if (args) {
-               var e = args[1];
-               if (e) {
-                       YAHOO.util.Event.stopEvent(e);
-               }
-       }
-
-       if (this.firstFormElement) {
-               this.firstFormElement.focus();
-       } else {
-               this.focusDefaultButton();
-       }
-};
-
-/**
-* Sets the focus to the last button in the button or form element in the Dialog
-* @method focusLast
-*/
-YAHOO.widget.Dialog.prototype.focusLast = function(type,args,obj) {
-       if (args) {
-               var e = args[1];
-               if (e) {
-                       YAHOO.util.Event.stopEvent(e);
-               }
-       }
-
-       var buttons = this.cfg.getProperty("buttons");
-       if (buttons && buttons instanceof Array) {
-               this.focusLastButton();
-       } else {
-               if (this.lastFormElement) {
-                       this.lastFormElement.focus();
-               }
-       }
-};
-
-/**
-* Sets the focus to the button that is designated as the default. By default, his handler is executed when the show event is fired.
-* @method focusDefaultButton
-*/
-YAHOO.widget.Dialog.prototype.focusDefaultButton = function() {
-       if (this.defaultHtmlButton) {
-               this.defaultHtmlButton.focus();
-       }
-};
-
-/**
-* Blurs all the html buttons
-* @method blurButtons
-*/
-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();
-               }
-       }
-};
-
-/**
-* Sets the focus to the first button in the button list
-* @method focusFirstButton
-*/
-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();
-               }
-       }
-};
-
-/**
-* Sets the focus to the first button in the button list
-* @method focusLastButton
-*/
-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();
-               }
-       }
-};
-
-/**
-* The default event handler for the "postmethod" configuration property
-* @method configPostMethod
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Dialog.prototype.configPostMethod = function(type, args, obj) {
-       var postmethod = args[0];
-
-       this.registerForm();
-       YAHOO.util.Event.addListener(this.form, "submit", function(e) {
-                                                                                                               YAHOO.util.Event.stopEvent(e);
-                                                                                                               this.submit();
-                                                                                                               this.form.blur();
-                                                                                                         }, this, true); 
-};
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* 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.
-* @method validate
-*/
-YAHOO.widget.Dialog.prototype.validate = function() {
-       return true;
-};
+                    oIconParent = oIcon.parentNode;
+                    
+                    if (oIconParent) {
+                    
+                        oIconParent.removeChild(oIcon);
+                        
+                        oIcon = null;
+                    
+                    }
 
-/**
-* Executes a submit of the Dialog followed by a hide, if validation is successful.
-* @method submit
-*/
-YAHOO.widget.Dialog.prototype.submit = function() {
-       if (this.validate()) {
-               this.beforeSubmitEvent.fire();
-               this.doSubmit();
-               this.submitEvent.fire();
-               this.hide();
-               return true;
-       } else {
-               return false;
-       }
-};
-
-/**
-* Executes the cancel of the Dialog followed by a hide.
-* @method cancel
-*/
-YAHOO.widget.Dialog.prototype.cancel = function() {
-       this.cancelEvent.fire();
-       this.hide();    
-};
-
-/**
-* Returns a JSON-compatible data structure representing the data currently contained in the form.
-* @method getData
-* @return {Object} A JSON object reprsenting the data of the current form.
-*/
-YAHOO.widget.Dialog.prototype.getData = function() {
-       var form = this.form;
-       var data = {};
-
-       if (form) {
-               for (var i=0;i<form.elements.length;i++) {
-                       var formItem = form.elements[i];
-                       if (formItem) {
-                               if (formItem.tagName) { // Got a single form item
-                                       switch (formItem.tagName) {
-                                               case "INPUT":
-                                                       switch (formItem.type) {
-                                                               case "checkbox": 
-                                                                       data[formItem.name] = formItem.checked;
-                                                                       break;
-                                                               case "textbox":
-                                                               case "text":
-                                                               case "hidden":
-                                                                       data[formItem.name] = formItem.value;
-                                                                       break;
-                                                       }
-                                                       break;
-                                               case "TEXTAREA":
-                                                       data[formItem.name] = 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;
-                                                                       }
-                                                                       val[val.length] = selval;
-                                                               }
-                                                       }
-                                                       data[formItem.name] = val;
-                                                       break;
-                                       }
-                               } else if (formItem[0] && formItem[0].tagName) { // this is an array of form items
-                                       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;
-                                                                       }
-                                                               }
-                                                               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;
-                                                                       }
-                                                               }
-                                                               data[formItem[0].name] = cbArray;
-                                                               break;
-                                               }
-                                       }
-                               }
-                       }
-               }       
-       }
-       return data;
-};
-
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     The string representation of the Dialog
-*/ 
-YAHOO.widget.Dialog.prototype.toString = function() {
-       return "Dialog " + this.id;
-};
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class SimpleDialog
-* @extends YAHOO.widget.Dialog
-* @constructor
-* @param {String}      el      The element ID representing the SimpleDialog <em>OR</em>
-* @param {HTMLElement} el      The element representing the SimpleDialog
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.
-*/
-YAHOO.widget.SimpleDialog = function(el, userConfig) {
-       YAHOO.widget.SimpleDialog.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.SimpleDialog, YAHOO.widget.Dialog);
-
-/**
-* Constant for the standard network icon for a blocking action
-* @property YAHOO.widget.SimpleDialog.ICON_BLOCK
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_BLOCK = "nt/ic/ut/bsc/blck16_1.gif";
-
-/**
-* Constant for the standard network icon for alarm
-* @property YAHOO.widget.SimpleDialog.ICON_ALARM
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_ALARM = "nt/ic/ut/bsc/alrt16_1.gif";
-
-/**
-* Constant for the standard network icon for help
-* @property YAHOO.widget.SimpleDialog.ICON_HELP
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_HELP  = "nt/ic/ut/bsc/hlp16_1.gif";
-
-/**
-* Constant for the standard network icon for info
-* @property YAHOO.widget.SimpleDialog.ICON_INFO
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_INFO  = "nt/ic/ut/bsc/info16_1.gif";
-
-/**
-* Constant for the standard network icon for warn
-* @property YAHOO.widget.SimpleDialog.ICON_WARN
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_WARN  = "nt/ic/ut/bsc/warn16_1.gif";
-
-/**
-* Constant for the standard network icon for a tip
-* @property YAHOO.widget.SimpleDialog.ICON_TIP
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_TIP   = "nt/ic/ut/bsc/tip16_1.gif";
-
-/**
-* Constant representing the default CSS class used for a SimpleDialog
-* @property YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG = "simple-dialog";
+                }
 
-/**
-* Initializes the class's configurable properties which can be changed using the SimpleDialog's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.SimpleDialog.prototype.initDefaultConfig = function() {
-       YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);
-
-       // Add dialog config properties //
-
-       /**
-       * Sets the informational icon for the SimpleDialog
-       * @config icon
-       * @type String
-       * @default "none"
-       */
-       this.cfg.addProperty("icon",    { value:"none", handler:this.configIcon, suppressEvent:true } );
-       
-       /**
-       * Sets the text for the SimpleDialog
-       * @config text
-       * @type String
-       * @default ""
-       */
-       this.cfg.addProperty("text",    { value:"", handler:this.configText, suppressEvent:true, supercedes:["icon"] } );
-};
-
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the SimpleDialog <em>OR</em>
-* @param {HTMLElement} el      The element representing the SimpleDialog
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.
-*/
-YAHOO.widget.SimpleDialog.prototype.init = function(el, userConfig) {
-       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
 
-       this.beforeInitEvent.fire(YAHOO.widget.SimpleDialog);
+                if (sIcon.indexOf(".") == -1) {
 
-       YAHOO.util.Dom.addClass(this.element, YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG);
+                    oIcon = document.createElement("span");
+                    oIcon.className = (sCSSClass + " " + sIcon);
+                    oIcon.innerHTML = "&#160;";
 
-       this.cfg.queueProperty("postmethod", "manual");
+                } else {
 
-       if (userConfig) {
-               this.cfg.applyConfig(userConfig, true);
-       }
+                    oIcon = document.createElement("img");
+                    oIcon.src = (this.imageRoot + sIcon);
+                    oIcon.className = sCSSClass;
 
-       this.beforeRenderEvent.subscribe(function() {
-               if (! this.body) {
-                       this.setBody("");
-               }
-       }, this, true);
+                }
+                
 
-       this.initEvent.fire(YAHOO.widget.SimpleDialog);
+                if (oIcon) {
+                
+                    oBody.insertBefore(oIcon, oBody.firstChild);
+                
+                }
 
-};
-/**
-* Prepares the SimpleDialog's internal FORM object, creating one if one is not currently present, and adding the value hidden field.
-* @method registerForm
-*/
-YAHOO.widget.SimpleDialog.prototype.registerForm = function() {
-       YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);
-       this.form.innerHTML += "<input type=\"hidden\" name=\"" + this.id + "\" value=\"\"/>";
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Fired when the "icon" property is set.
-* @method configIcon
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-       }
-};
-
-/**
-* Fired when the "text" property is set.
-* @method configText
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.SimpleDialog.prototype.configText = function(type,args,obj) {
-       var text = args[0];
-       if (text) {
-               this.setBody(text);
-               this.cfg.refireEvent("icon");
-       }
-};
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     The string representation of the SimpleDialog
-*/ 
-YAHOO.widget.SimpleDialog.prototype.toString = function() {
-       return "SimpleDialog " + this.id;
-};
-
-/**
-* ContainerEffect encapsulates animation transitions that are executed when an Overlay is shown or hidden.
-* @namespace YAHOO.widget
-* @class ContainerEffect
-* @constructor
-* @param {YAHOO.widget.Overlay}        overlay         The Overlay that the animation should be associated with
-* @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).
-* @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).
-* @param {HTMLElement} targetElement   Optional. The target element that should be animated during the transition. Defaults to overlay.element.
-* @param {class}       Optional. The animation class to instantiate. Defaults to YAHOO.util.Anim. Other options include YAHOO.util.Motion.
-*/
-YAHOO.widget.ContainerEffect = function(overlay, attrIn, attrOut, targetElement, animClass) {
-       if (! animClass) {
-               animClass = YAHOO.util.Anim;
-       }
-
-       /**
-       * The overlay to animate
-       * @property overlay
-       * @type YAHOO.widget.Overlay
-       */
-       this.overlay = overlay;
-       /**
-       * The animation attributes to use when transitioning into view
-       * @property attrIn
-       * @type Object
-       */
-       this.attrIn = attrIn;
-       /**
-       * The animation attributes to use when transitioning out of view
-       * @property attrOut
-       * @type Object
-       */
-       this.attrOut = attrOut;
-       /**
-       * The target element to be animated
-       * @property targetElement
-       * @type HTMLElement
-       */
-       this.targetElement = targetElement || overlay.element;
-       /**
-       * The animation class to use for animating the overlay
-       * @property animClass
-       * @type class
-       */
-       this.animClass = animClass;
-};
-
-/**
-* Initializes the animation classes and events.
-* @method init
-*/
-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);
-};
-
-/**
-* Triggers the in-animation.
-* @method animateIn
-*/
-YAHOO.widget.ContainerEffect.prototype.animateIn = function() {
-       this.beforeAnimateInEvent.fire();
-       this.animIn.animate();
-};
-
-/**
-* Triggers the out-animation.
-* @method animateOut
-*/
-YAHOO.widget.ContainerEffect.prototype.animateOut = function() {
-       this.beforeAnimateOutEvent.fire();
-       this.animOut.animate();
-};
-
-/**
-* The default onStart handler for the in-animation.
-* @method handleStartAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn = function(type, args, obj) { };
-/**
-* The default onTween handler for the in-animation.
-* @method handleTweenAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn = function(type, args, obj) { };
-/**
-* The default onComplete handler for the in-animation.
-* @method handleCompleteAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn = function(type, args, obj) { };
-
-/**
-* The default onStart handler for the out-animation.
-* @method handleStartAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut = function(type, args, obj) { };
-/**
-* The default onTween handler for the out-animation.
-* @method handleTweenAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut = function(type, args, obj) { };
-/**
-* The default onComplete handler for the out-animation.
-* @method handleCompleteAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut = function(type, args, obj) { };
-
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     The string representation of the ContainerEffect
-*/ 
-YAHOO.widget.ContainerEffect.prototype.toString = function() {
-       var output = "ContainerEffect";
-       if (this.overlay) {
-               output += " [" + this.overlay.toString() + "]";
-       }
-       return output;
-};
-
-/**
-* A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.
-* @method FADE
-* @static
-* @param {Overlay}     overlay The Overlay object to animate
-* @param {Number}      dur     The duration of the animation
-* @return {ContainerEffect}    The configured ContainerEffect object
-*/
-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");
-               }
-
-               if (obj.overlay.underlay) {
-                       obj.initialUnderlayOpacity = YAHOO.util.Dom.getStyle(obj.overlay.underlay, "opacity");
-                       obj.overlay.underlay.style.filter = null;
-               }
-
-               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;
-               }                       
-               
-               if (obj.overlay.underlay) {
-                       YAHOO.util.Dom.setStyle(obj.overlay.underlay, "opacity", obj.initialUnderlayOpacity);
-               }
-
-               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;
-               }                               
-               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;
-};
-
-
-/**
-* A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.
-* @method SLIDE
-* @static
-* @param {Overlay}     overlay The Overlay object to animate
-* @param {Number}      dur     The duration of the animation
-* @return {ContainerEffect}    The configured ContainerEffect object
-*/
-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");
-               }
-
-               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
+            }
+
+        },
+        
+        /**
+        * Fired when the "text" property is set.
+        * @method configText
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configText: function (type,args,obj) {
+            var text = args[0];
+            if (text) {
+                this.setBody(text);
+                this.cfg.refireEvent("icon");
+            }
+        },
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the SimpleDialog
+        */
+        toString: function () {
+            return "SimpleDialog " + this.id;
+        }
+    
+    });
+
+}());
+(function () {
+
+    /**
+    * ContainerEffect encapsulates animation transitions that are executed when 
+    * an Overlay is shown or hidden.
+    * @namespace YAHOO.widget
+    * @class ContainerEffect
+    * @constructor
+    * @param {YAHOO.widget.Overlay} overlay The Overlay that the animation 
+    * should be associated with
+    * @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. Easing.easeIn).
+    * @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. Easing.easeIn).
+    * @param {HTMLElement} targetElement Optional. The target element that  
+    * should be animated during the transition. Defaults to overlay.element.
+    * @param {class} Optional. The animation class to instantiate. Defaults to 
+    * YAHOO.util.Anim. Other options include YAHOO.util.Motion.
+    */
+    YAHOO.widget.ContainerEffect = 
+    
+        function (overlay, attrIn, attrOut, targetElement, animClass) {
+    
+        if (!animClass) {
+            animClass = YAHOO.util.Anim;
+        }
+        
+        /**
+        * The overlay to animate
+        * @property overlay
+        * @type YAHOO.widget.Overlay
+        */
+        this.overlay = overlay;
+    
+        /**
+        * The animation attributes to use when transitioning into view
+        * @property attrIn
+        * @type Object
+        */
+        this.attrIn = attrIn;
+    
+        /**
+        * The animation attributes to use when transitioning out of view
+        * @property attrOut
+        * @type Object
+        */
+        this.attrOut = attrOut;
+    
+        /**
+        * The target element to be animated
+        * @property targetElement
+        * @type HTMLElement
+        */
+        this.targetElement = targetElement || overlay.element;
+    
+        /**
+        * The animation class to use for animating the overlay
+        * @property animClass
+        * @type class
+        */
+        this.animClass = animClass;
+    
+    };
+
+
+    var Dom = YAHOO.util.Dom,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Easing = YAHOO.util.Easing,
+        ContainerEffect = YAHOO.widget.ContainerEffect;
+
+
+    /**
+    * A pre-configured ContainerEffect instance that can be used for fading 
+    * an overlay in and out.
+    * @method FADE
+    * @static
+    * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate
+    * @param {Number} dur The duration of the animation
+    * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
+    */
+    ContainerEffect.FADE = function (overlay, dur) {
+    
+        var fade = new ContainerEffect(overlay, 
+        
+            { attributes: { opacity: { from: 0, to: 1 } }, 
+                duration: dur, 
+                method: Easing.easeIn }, 
+            
+            { attributes: { opacity: { to: 0 } },
+                duration: dur, 
+                method: Easing.easeOut }, 
+            
+            overlay.element);
+        
+    
+        fade.handleStartAnimateIn = function (type,args,obj) {
+            Dom.addClass(obj.overlay.element, "hide-select");
+        
+            if (! obj.overlay.underlay) {
+                obj.overlay.cfg.refireEvent("underlay");
+            }
+        
+            if (obj.overlay.underlay) {
+    
+                obj.initialUnderlayOpacity = 
+                    Dom.getStyle(obj.overlay.underlay, "opacity");
+    
+                obj.overlay.underlay.style.filter = null;
+    
+            }
+        
+            Dom.setStyle(obj.overlay.element, "visibility", "visible");
+            Dom.setStyle(obj.overlay.element, "opacity", 0);
+        };
+        
+    
+        fade.handleCompleteAnimateIn = function (type,args,obj) {
+            Dom.removeClass(obj.overlay.element, "hide-select");
+        
+            if (obj.overlay.element.style.filter) {
+                obj.overlay.element.style.filter = null;
+            }
+        
+            if (obj.overlay.underlay) {
+                Dom.setStyle(obj.overlay.underlay, "opacity", 
+                    obj.initialUnderlayOpacity);
+            }
+        
+            obj.overlay.cfg.refireEvent("iframe");
+            obj.animateInCompleteEvent.fire();
+        };
+        
+    
+        fade.handleStartAnimateOut = function (type, args, obj) {
+            Dom.addClass(obj.overlay.element, "hide-select");
+        
+            if (obj.overlay.underlay) {
+                obj.overlay.underlay.style.filter = null;
+            }
+        };
+        
+    
+        fade.handleCompleteAnimateOut =  function (type, args, obj) {
+            Dom.removeClass(obj.overlay.element, "hide-select");
+            if (obj.overlay.element.style.filter) {
+                obj.overlay.element.style.filter = null;
+            }
+            Dom.setStyle(obj.overlay.element, "visibility", "hidden");
+            Dom.setStyle(obj.overlay.element, "opacity", 1);
+        
+            obj.overlay.cfg.refireEvent("iframe");
+        
+            obj.animateOutCompleteEvent.fire();
+        };
+        
+        fade.init();
+        return fade;
+    };
+    
+    
+    /**
+    * A pre-configured ContainerEffect instance that can be used for sliding an 
+    * overlay in and out.
+    * @method SLIDE
+    * @static
+    * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate
+    * @param {Number} dur The duration of the animation
+    * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
+    */
+    ContainerEffect.SLIDE = function (overlay, dur) {
+    
+        var x = overlay.cfg.getProperty("x") || Dom.getX(overlay.element),
+    
+            y = overlay.cfg.getProperty("y") || Dom.getY(overlay.element),
+    
+            clientWidth = Dom.getClientWidth(),
+    
+            offsetWidth = overlay.element.offsetWidth,
+    
+            slide = new ContainerEffect(overlay, 
+            
+            { attributes: { points: { to: [x, y] } },
+                duration: dur,
+                method: Easing.easeIn },
+    
+            { attributes: { points: { to: [(clientWidth + 25), y] } },
+                duration: dur,
+                method: Easing.easeOut },
+    
+            overlay.element, YAHOO.util.Motion);
+        
+        
+        slide.handleStartAnimateIn = function (type,args,obj) {
+            obj.overlay.element.style.left = ((-25) - offsetWidth) + "px";
+            obj.overlay.element.style.top  = y + "px";
+        };
+        
+        slide.handleTweenAnimateIn = function (type, args, obj) {
+        
+            var pos = Dom.getXY(obj.overlay.element),
+                currentX = pos[0],
+                currentY = pos[1];
+        
+            if (Dom.getStyle(obj.overlay.element, "visibility") == 
+                "hidden" && currentX < x) {
+
+                Dom.setStyle(obj.overlay.element, "visibility", "visible");
+
+            }
+        
+            obj.overlay.cfg.setProperty("xy", [currentX, currentY], true);
+            obj.overlay.cfg.refireEvent("iframe");
+        };
+        
+        slide.handleCompleteAnimateIn = function (type, args, obj) {
+            obj.overlay.cfg.setProperty("xy", [x, y], true);
+            obj.startX = x;
+            obj.startY = y;
+            obj.overlay.cfg.refireEvent("iframe");
+            obj.animateInCompleteEvent.fire();
+        };
+        
+        slide.handleStartAnimateOut = function (type, args, obj) {
+    
+            var vw = Dom.getViewportWidth(),
+                pos = Dom.getXY(obj.overlay.element),
+                yso = pos[1],
+                currentTo = obj.animOut.attributes.points.to;
+    
+            obj.animOut.attributes.points.to = [(vw + 25), yso];
+    
+        };
+        
+        slide.handleTweenAnimateOut = function (type, args, obj) {
+    
+            var pos = Dom.getXY(obj.overlay.element),
+                xto = pos[0],
+                yto = pos[1];
+        
+            obj.overlay.cfg.setProperty("xy", [xto, yto], true);
+            obj.overlay.cfg.refireEvent("iframe");
+        };
+        
+        slide.handleCompleteAnimateOut = function (type, args, obj) {
+            Dom.setStyle(obj.overlay.element, "visibility", "hidden");
+        
+            obj.overlay.cfg.setProperty("xy", [x, y]);
+            obj.animateOutCompleteEvent.fire();
+        };
+        
+        slide.init();
+        return slide;
+    };
+    
+    ContainerEffect.prototype = {
+    
+        /**
+        * Initializes the animation classes and events.
+        * @method init
+        */
+        init: function () {
+
+            this.beforeAnimateInEvent = this.createEvent("beforeAnimateIn");
+            this.beforeAnimateInEvent.signature = CustomEvent.LIST;
+            
+            this.beforeAnimateOutEvent = this.createEvent("beforeAnimateOut");
+            this.beforeAnimateOutEvent.signature = CustomEvent.LIST;
+        
+            this.animateInCompleteEvent = this.createEvent("animateInComplete");
+            this.animateInCompleteEvent.signature = CustomEvent.LIST;
+        
+            this.animateOutCompleteEvent = 
+                this.createEvent("animateOutComplete");
+            this.animateOutCompleteEvent.signature = CustomEvent.LIST;
+        
+            this.animIn = new this.animClass(this.targetElement, 
+                this.attrIn.attributes, this.attrIn.duration, 
+                this.attrIn.method);
+
+            this.animIn.onStart.subscribe(this.handleStartAnimateIn, this);
+            this.animIn.onTween.subscribe(this.handleTweenAnimateIn, this);
+
+            this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn, 
+                this);
+        
+            this.animOut = new this.animClass(this.targetElement, 
+                this.attrOut.attributes, this.attrOut.duration, 
+                this.attrOut.method);
+
+            this.animOut.onStart.subscribe(this.handleStartAnimateOut, this);
+            this.animOut.onTween.subscribe(this.handleTweenAnimateOut, this);
+            this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut, 
+                this);
+
+        },
+        
+        /**
+        * Triggers the in-animation.
+        * @method animateIn
+        */
+        animateIn: function () {
+            this.beforeAnimateInEvent.fire();
+            this.animIn.animate();
+        },
+        
+        /**
+        * Triggers the out-animation.
+        * @method animateOut
+        */
+        animateOut: function () {
+            this.beforeAnimateOutEvent.fire();
+            this.animOut.animate();
+        },
+        
+        /**
+        * The default onStart handler for the in-animation.
+        * @method handleStartAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleStartAnimateIn: function (type, args, obj) { },
+    
+        /**
+        * The default onTween handler for the in-animation.
+        * @method handleTweenAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleTweenAnimateIn: function (type, args, obj) { },
+    
+        /**
+        * The default onComplete handler for the in-animation.
+        * @method handleCompleteAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleCompleteAnimateIn: function (type, args, obj) { },
+        
+        /**
+        * The default onStart handler for the out-animation.
+        * @method handleStartAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleStartAnimateOut: function (type, args, obj) { },
+    
+        /**
+        * The default onTween handler for the out-animation.
+        * @method handleTweenAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleTweenAnimateOut: function (type, args, obj) { },
+    
+        /**
+        * The default onComplete handler for the out-animation.
+        * @method handleCompleteAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleCompleteAnimateOut: function (type, args, obj) { },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the ContainerEffect
+        */
+        toString: function () {
+            var output = "ContainerEffect";
+            if (this.overlay) {
+                output += " [" + this.overlay.toString() + "]";
+            }
+            return output;
+        }
+    
+    };
+
+    YAHOO.lang.augmentProto(ContainerEffect, YAHOO.util.EventProvider);
+
+})();
+YAHOO.register("container", YAHOO.widget.Module, {version: "2.3.0", build: "442"});
index d0c8a5b459e0258b94b90fe7d50d9dc56378ed6d..efb6676b52ef8e4854bce2384c0a0aae82cc71a8 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
-*/
-/**
-* 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.
-* @namespace YAHOO.util
-* @class Config
-* @constructor
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config = function(owner) {
-       if (owner) {
-               this.init(owner);
-       } else {
-               YAHOO.log("No owner specified for Config object", "error");
-       }
-};
-
-YAHOO.util.Config.prototype = {
-       
-       /**
-       * Object reference to the owner of this Config Object
-       * @property owner
-       * @type Object
-       */
-       owner : null,
-
-       /**
-       * Boolean flag that specifies whether a queue is currently being executed
-       * @property queueInProgress
-       * @type Boolean
-       */
-       queueInProgress : false,
-
-
-       /**
-       * Validates that the value passed in is a Boolean.
-       * @method checkBoolean
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */      
-       checkBoolean: function(val) {
-               if (typeof val == 'boolean') {
-                       return true;
-               } else {
-                       return false;
-               }
-       },
-
-       /**
-       * Validates that the value passed in is a number.
-       * @method checkNumber
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */
-       checkNumber: function(val) {
-               if (isNaN(val)) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-};
-
-
-/**
-* Initializes the configuration Object and all of its local members.
-* @method init
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config.prototype.init = function(owner) {
-
-       this.owner = owner;
-
-       /**
-       * Object reference to the owner of this Config Object
-       * @event configChangedEvent
-       */
-       this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");
-       this.queueInProgress = false;
-
-       /* Private Members */
-
-       /**
-       * Maintains the local collection of configuration property objects and their specified values
-       * @property config
-       * @private
-       * @type Object
-       */ 
-       var config = {};
-
-       /**
-       * Maintains the local collection of configuration property objects as they were initially applied.
-       * This object is used when resetting a property.
-       * @property initialConfig
-       * @private
-       * @type Object
-       */ 
-       var initialConfig = {};
-
-       /**
-       * Maintains the local, normalized CustomEvent queue
-       * @property eventQueue
-       * @private
-       * @type Object
-       */ 
-       var eventQueue = [];
-
-       /**
-       * Fires a configuration property event using the specified value. 
-       * @method fireEvent
-       * @private
-       * @param {String}       key                     The configuration property's name
-       * @param {value}        Object          The value of the correct type for the property
-       */ 
-       var fireEvent = function( key, value ) {
-               YAHOO.log("Firing Config event: " + key + "=" + value, "info");
-               
-               key = key.toLowerCase();
-
-               var property = config[key];
-
-               if (typeof property != 'undefined' && property.event) {
-                       property.event.fire(value);
-               }       
-       };
-       /* End Private Members */
-
-       /**
-       * Adds a property to the Config Object's private config hash.
-       * @method addProperty
-       * @param {String}       key     The configuration property's name
-       * @param {Object}       propertyObject  The Object containing all of this property's arguments
-       */
-       this.addProperty = function( key, propertyObject ) {
-               key = key.toLowerCase();
-               
-               YAHOO.log("Added property: " + key, "info");
-
-               config[key] = propertyObject;
-
-               propertyObject.event = new YAHOO.util.CustomEvent(key);
-               propertyObject.key = key;
-
-               if (propertyObject.handler) {
-                       propertyObject.event.subscribe(propertyObject.handler, this.owner, true);
-               }
-
-               this.setProperty(key, propertyObject.value, true);
-               
-               if (! propertyObject.suppressEvent) {
-                       this.queueProperty(key, propertyObject.value);
-               }
-       };
-
-       /**
-       * Returns a key-value configuration map of the values currently set in the Config Object.
-       * @method getConfig
-       * @return {Object} The current config, represented in a key-value map
-       */
-       this.getConfig = function() {
-               var cfg = {};
-                       
-               for (var prop in config) {
-                       var property = config[prop];
-                       if (typeof property != 'undefined' && property.event) {
-                               cfg[prop] = property.value;
-                       }
-               }
-               
-               return cfg;
-       };
-
-       /**
-       * Returns the value of specified property.
-       * @method getProperty
-       * @param {String} key   The name of the property
-       * @return {Object}              The value of the specified property
-       */
-       this.getProperty = function(key) {
-               key = key.toLowerCase();
-
-               var property = config[key];
-               if (typeof property != 'undefined' && property.event) {
-                       return property.value;
-               } else {
-                       return undefined;
-               }
-       };
-
-       /**
-       * Resets the specified property's value to its initial value.
-       * @method resetProperty
-       * @param {String} key   The name of the property
-       * @return {Boolean} True is the property was reset, false if not
-       */
-       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]);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.
-       * @method setProperty
-       * @param {String} key           The name of the property
-       * @param {String} value         The value to set the property to
-       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.
-       * @return {Boolean}                     True, if the set was successful, false if it failed.
-       */
-       this.setProperty = function(key, value, silent) {
-               key = key.toLowerCase();
-               
-               YAHOO.log("setProperty: " + key + "=" + value, "info");
-
-               if (this.queueInProgress && ! silent) {
-                       this.queueProperty(key,value); // Currently running through a queue... 
-                       return true;
-               } else {
-                       var property = config[key];
-                       if (typeof property != 'undefined' && property.event) {
-                               if (property.validator && ! property.validator(value)) { // validator
-                                       return false;
-                               } else {
-                                       property.value = value;
-                                       if (! silent) {
-                                               fireEvent(key, value);
-                                               this.configChangedEvent.fire([key, value]);
-                                       }
-                                       return true;
-                               }
-                       } else {
-                               return false;
-                       }
-               }
-       };
-
-       /**
-       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is
-       * moved from its current position to the end of the queue.
-       * @method queueProperty
-       * @param {String} key   The name of the property
-       * @param {String} value The value to set the property to
-       * @return {Boolean}             true, if the set was successful, false if it failed.
-       */      
-       this.queueProperty = function(key, value) {
-               key = key.toLowerCase();
-
-               YAHOO.log("queueProperty: " + key + "=" + value, "info");
-
-               var property = config[key];
-                                                       
-               if (typeof property != 'undefined' && property.event) {
-                       if (typeof value != 'undefined' && property.validator && ! property.validator(value)) { // validator
-                               return false;
-                       } else {
-
-                               if (typeof value != 'undefined') {
-                                       property.value = value;
-                               } else {
-                                       value = property.value;
-                               }
-
-                               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) {
-                                                       // found a dupe... push to end of queue, null current item, and break
-                                                       eventQueue[i] = null;
-                                                       eventQueue.push([key, (typeof value != 'undefined' ? value : queueItemValue)]);
-                                                       foundDuplicate = true;
-                                                       break;
-                                               }
-                                       }
-                               }
-                               
-                               if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue
-                                       eventQueue.push([key, value]);
-                               }
-                       }
-
-                       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;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-       
-                       YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");
-
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Fires the event for a property using the property's current value.
-       * @method refireEvent
-       * @param {String} key   The name of the property
-       */
-       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);
-                       }
-               }
-       };
-
-       /**
-       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.
-       * Although the values will be set, fireQueue() must be called for their associated events to execute.
-       * @method applyConfig
-       * @param {Object}       userConfig      The configuration Object literal
-       * @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.
-       */
-       this.applyConfig = function(userConfig, init) {
-               if (init) {
-                       initialConfig = userConfig;
-               }
-               for (var prop in userConfig) {
-                       this.queueProperty(prop, userConfig[prop]);
-               }
-       };
-
-       /**
-       * Refires the events for all configuration properties using their current values.
-       * @method refresh
-       */
-       this.refresh = function() {
-               for (var prop in config) {
-                       this.refireEvent(prop);
-               }
-       };
-
-       /**
-       * Fires the normalized list of queued property change events
-       * @method fireQueue
-       */
-       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);
-                       }
-               }
-               
-               this.queueInProgress = false;
-               eventQueue = [];
-       };
-
-       /**
-       * Subscribes an external handler to the change event for any given property. 
-       * @method subscribeToConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.
-       * @return {Boolean}                             True, if the subscription was successful, otherwise false.
-       */      
-       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);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Unsubscribes an external handler from the change event for any given property. 
-       * @method unsubscribeFromConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @return {Boolean}                             True, if the unsubscription was successful, otherwise 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;
-               }
-       };
-
-       /**
-       * Returns a string representation of the Config object
-       * @method toString
-       * @return {String}      The Config object in string format.
-       */
-       this.toString = function() {
-               var output = "Config";
-               if (this.owner) {
-                       output += " [" + this.owner.toString() + "]";
-               }
-               return output;
-       };
-
-       /**
-       * Returns a string representation of the Config object's current CustomEvent queue
-       * @method outputEventQueue
-       * @return {String}      The string list of CustomEvents currently queued for execution
-       */
-       this.outputEventQueue = function() {
-               var output = "";
-               for (var q=0;q<eventQueue.length;q++) {
-                       var queueItem = eventQueue[q];
-                       if (queueItem) {
-                               output += queueItem[0] + "=" + queueItem[1] + ", ";
-                       }
-               }
-               return output;
-       };
-};
-
-/**
-* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent
-* @method YAHOO.util.Config.alreadySubscribed
-* @static
-* @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions
-* @param {Function}    fn      The function to look for in the subscribers list
-* @param {Object}      obj     The execution scope Object for the subscription
-* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in
-*/
-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;
-               }
-       }
-       return false;
-};
-
-/**
-*  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.
-* @module container
-* @title Container
-* @requires yahoo,dom,event,dragdrop,animation
+version: 2.3.0
 */
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.util
+    * @class Config
+    * @constructor
+    * @param {Object} owner The owner Object to which this Config Object belongs
+    */
+    YAHOO.util.Config = function (owner) {
+    
+        if (owner) {
+    
+            this.init(owner);
+    
+        }
+    
+        if (!owner) { 
+        
+            YAHOO.log("No owner specified for Config object", "error"); 
+    
+        }
+    
+    };
 
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Module
-* @constructor
-* @param {String} el                   The element ID representing the Module <em>OR</em>
-* @param {HTMLElement} el              The element representing the Module
-* @param {Object} userConfig   The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
-*/
-YAHOO.widget.Module = function(el, userConfig) {
-       if (el) { 
-               this.init(el, userConfig); 
-       } else {
-               YAHOO.log("No element or element ID specified for Module instantiation", "error");
-       }
-};
-
-/**
-* Constant representing the prefix path to use for non-secure images
-* @property YAHOO.widget.Module.IMG_ROOT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.IMG_ROOT = "http://us.i1.yimg.com/us.yimg.com/i/";
-
-/**
-* Constant representing the prefix path to use for securely served images
-* @property YAHOO.widget.Module.IMG_ROOT_SSL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.IMG_ROOT_SSL = "https://a248.e.akamai.net/sec.yimg.com/i/";
-
-/**
-* Constant for the default CSS class name that represents a Module
-* @property YAHOO.widget.Module.CSS_MODULE
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_MODULE = "module";
-
-/**
-* Constant representing the module header
-* @property YAHOO.widget.Module.CSS_HEADER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_HEADER = "hd";
-
-/**
-* Constant representing the module body
-* @property YAHOO.widget.Module.CSS_BODY
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_BODY = "bd";
-
-/**
-* Constant representing the module footer
-* @property YAHOO.widget.Module.CSS_FOOTER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_FOOTER = "ft";
-
-/**
-* Constant representing the url for the "src" attribute of the iframe used to monitor changes to the browser's base font size
-* @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";
-
-/**
-* Singleton CustomEvent fired when the font size is changed in the browser.
-* Opera's "zoom" functionality currently does not support text size detection.
-* @event YAHOO.widget.Module.textResizeEvent
-*/     
-YAHOO.widget.Module.textResizeEvent = new YAHOO.util.CustomEvent("textResize");
-
-YAHOO.widget.Module.prototype = {
-       /**
-       * The class's constructor function
-       * @property contructor
-       * @type Function
-       */
-       constructor : YAHOO.widget.Module,
-
-       /**
-       * The main module element that contains the header, body, and footer
-       * @property element
-       * @type HTMLElement
-       */
-       element : null, 
-
-       /**
-       * The header element, denoted with CSS class "hd"
-       * @property header
-       * @type HTMLElement
-       */
-       header : null,
-
-       /**
-       * The body element, denoted with CSS class "bd"
-       * @property body
-       * @type HTMLElement
-       */
-       body : null,
-
-       /**
-       * The footer element, denoted with CSS class "ft"
-       * @property footer
-       * @type HTMLElement
-       */
-       footer : null,
-
-       /**
-       * The id of the element
-       * @property id
-       * @type String
-       */
-       id : null,
-
-       /**
-       * The String representing the image root
-       * @property imageRoot
-       * @type String
-       */
-       imageRoot : YAHOO.widget.Module.IMG_ROOT,
-               
-       /**
-       * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-       * @method initEvents
-       */
-       initEvents : function() {
-
-               /**
-               * CustomEvent fired prior to class initalization.
-               * @event beforeInitEvent
-               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
-               */
-               this.beforeInitEvent = new YAHOO.util.CustomEvent("beforeInit");
-
-               /**
-               * CustomEvent fired after class initalization.
-               * @event initEvent
-               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
-               */              
-               this.initEvent = new YAHOO.util.CustomEvent("init");
-
-               /**
-               * CustomEvent fired when the Module is appended to the DOM
-               * @event appendEvent
-               */
-               this.appendEvent = new YAHOO.util.CustomEvent("append");
-
-               /**
-               * CustomEvent fired before the Module is rendered
-               * @event beforeRenderEvent
-               */
-               this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");
-
-               /**
-               * CustomEvent fired after the Module is rendered
-               * @event renderEvent
-               */
-               this.renderEvent = new YAHOO.util.CustomEvent("render");
-       
-               /**
-               * CustomEvent fired when the header content of the Module is modified
-               * @event changeHeaderEvent
-               * @param {String/HTMLElement} content   String/element representing the new header content
-               */
-               this.changeHeaderEvent = new YAHOO.util.CustomEvent("changeHeader");
-               
-               /**
-               * CustomEvent fired when the body content of the Module is modified
-               * @event changeBodyEvent
-               * @param {String/HTMLElement} content   String/element representing the new body content
-               */              
-               this.changeBodyEvent = new YAHOO.util.CustomEvent("changeBody");
-               
-               /**
-               * CustomEvent fired when the footer content of the Module is modified
-               * @event changeFooterEvent
-               * @param {String/HTMLElement} content   String/element representing the new footer content
-               */
-               this.changeFooterEvent = new YAHOO.util.CustomEvent("changeFooter");
-
-               /**
-               * CustomEvent fired when the content of the Module is modified
-               * @event changeContentEvent
-               */
-               this.changeContentEvent = new YAHOO.util.CustomEvent("changeContent");
-
-               /**
-               * CustomEvent fired when the Module is destroyed
-               * @event destroyEvent
-               */
-               this.destroyEvent = new YAHOO.util.CustomEvent("destroy");
-               
-               /**
-               * CustomEvent fired before the Module is shown
-               * @event beforeShowEvent
-               */
-               this.beforeShowEvent = new YAHOO.util.CustomEvent("beforeShow");
-
-               /**
-               * CustomEvent fired after the Module is shown
-               * @event showEvent
-               */
-               this.showEvent = new YAHOO.util.CustomEvent("show");
-
-               /**
-               * CustomEvent fired before the Module is hidden
-               * @event beforeHideEvent
-               */
-               this.beforeHideEvent = new YAHOO.util.CustomEvent("beforeHide");
-
-               /**
-               * CustomEvent fired after the Module is hidden
-               * @event hideEvent
-               */
-               this.hideEvent = new YAHOO.util.CustomEvent("hide");
-       }, 
-
-       /**
-       * String representing the current user-agent platform
-       * @property platform
-       * @type String
-       */
-       platform : function() {
-                                       var ua = navigator.userAgent.toLowerCase();
-                                       if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
-                                               return "windows";
-                                       } else if (ua.indexOf("macintosh") != -1) {
-                                               return "mac";
-                                       } else {
-                                               return false;
-                                       }
-                               }(),
-
-       /**
-       * String representing the current user-agent browser
-       * @property browser
-       * @type String
-       */
-       browser : function() {
-                       var ua = navigator.userAgent.toLowerCase();
-                                 if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
-                                        return 'opera';
-                                 } else if (ua.indexOf('msie 7')!=-1) { // IE7
-                                        return 'ie7';
-                                 } else if (ua.indexOf('msie') !=-1) { // IE
-                                        return 'ie';
-                                 } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
-                                        return 'safari';
-                                 } else if (ua.indexOf('gecko') != -1) { // Gecko
-                                        return 'gecko';
-                                 } else {
-                                        return false;
-                                 }
-                       }(),
-
-       /**
-       * Boolean representing whether or not the current browsing context is secure (https)
-       * @property isSecure
-       * @type Boolean
-       */
-       isSecure : function() {
-               if (window.location.href.toLowerCase().indexOf("https") === 0) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }(),
-
-       /**
-       * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-       */
-       initDefaultConfig : function() {
-               // Add properties //
-               
-               /**
-               * Specifies whether the Module is visible on the page.
-               * @config visible
-               * @type Boolean
-               * @default true
-               */
-               this.cfg.addProperty("visible", { value:true, handler:this.configVisible, validator:this.cfg.checkBoolean } );
-               
-               /**
-               * Object or array of objects representing the ContainerEffect classes that are active for animating the container.
-               * @config effect
-               * @type Object
-               * @default null
-               */
-               this.cfg.addProperty("effect", { suppressEvent:true, supercedes:["visible"] } );
-               
-               /**
-               * Specifies whether to create a special proxy iframe to monitor for user font resizing in the document
-               * @config monitorresize
-               * @type Boolean
-               * @default true
-               */
-               this.cfg.addProperty("monitorresize", { value:true, handler:this.configMonitorResize } );
-       },
-
-       /**
-       * 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.
-       * @method init
-       * @param {String}       el      The element ID representing the Module <em>OR</em>
-       * @param {HTMLElement}  el      The element representing the Module
-       * @param {Object}       userConfig      The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
-       */
-       init : function(el, userConfig) {
-
-               this.initEvents();
-
-               this.beforeInitEvent.fire(YAHOO.widget.Module);
-
-               /**
-               * The Module's Config object used for monitoring configuration properties.
-               * @property cfg
-               * @type YAHOO.util.Config
-               */
-               this.cfg = new YAHOO.util.Config(this);
-               
-               if (this.isSecure) {
-                       this.imageRoot = YAHOO.widget.Module.IMG_ROOT_SSL;
-               }
-
-               if (typeof el == "string") {
-                       var elId = el;
-
-                       el = document.getElementById(el);
-                       if (! el) {
-                               el = document.createElement("DIV");
-                               el.id = elId;
-                       }
-               }
-
-               this.element = el;
-               
-               if (el.id) {
-                       this.id = el.id;
-               } 
-
-               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;
-                               }
-                       }
-               }
-
-               this.initDefaultConfig();
-
-               YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Module.CSS_MODULE);
-
-               if (userConfig) {
-                       this.cfg.applyConfig(userConfig, true);
-               }
-
-               // Subscribe to the fireQueue() method of Config so that any queued configuration changes are
-               // excecuted upon render of the Module
-               if (! YAHOO.util.Config.alreadySubscribed(this.renderEvent, this.cfg.fireQueue, this.cfg)) {
-                       this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
-               }
-
-               this.initEvent.fire(YAHOO.widget.Module);
-       },
-
-       /**
-       * Initialized an empty IFRAME that is placed out of the visible area that can be used to detect text resize.
-       * @method initResizeMonitor
-       */
-       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;
-    
-                }                
-
-                resizeMonitor.id = "_yuiResizeMonitor";
-                resizeMonitor.style.visibility = "hidden";
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,        
+        Config = YAHOO.util.Config;
+    
+
+    /**
+     * Constant representing the CustomEvent type for the config changed event.
+     * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT
+     * @private
+     * @static
+     * @final
+     */
+    Config.CONFIG_CHANGED_EVENT = "configChanged";
+    
+    /**
+     * Constant representing the boolean type string
+     * @property YAHOO.util.Config.BOOLEAN_TYPE
+     * @private
+     * @static
+     * @final
+     */
+    Config.BOOLEAN_TYPE = "boolean";
+    
+    Config.prototype = {
+     
+        /**
+        * Object reference to the owner of this Config Object
+        * @property owner
+        * @type Object
+        */
+        owner: null,
+        
+        /**
+        * Boolean flag that specifies whether a queue is currently 
+        * being executed
+        * @property queueInProgress
+        * @type Boolean
+        */
+        queueInProgress: false,
+        
+        /**
+        * Maintains the local collection of configuration property objects and 
+        * their specified values
+        * @property config
+        * @private
+        * @type Object
+        */ 
+        config: null,
+        
+        /**
+        * Maintains the local collection of configuration property objects as 
+        * they were initially applied.
+        * This object is used when resetting a property.
+        * @property initialConfig
+        * @private
+        * @type Object
+        */ 
+        initialConfig: null,
+        
+        /**
+        * Maintains the local, normalized CustomEvent queue
+        * @property eventQueue
+        * @private
+        * @type Object
+        */ 
+        eventQueue: null,
+        
+        /**
+        * Custom Event, notifying subscribers when Config properties are set 
+        * (setProperty is called without the silent flag
+        * @event configChangedEvent
+        */
+        configChangedEvent: null,
+    
+        /**
+        * Initializes the configuration Object and all of its local members.
+        * @method init
+        * @param {Object} owner The owner Object to which this Config 
+        * Object belongs
+        */
+        init: function (owner) {
+    
+            this.owner = owner;
+    
+            this.configChangedEvent = 
+                this.createEvent(Config.CONFIG_CHANGED_EVENT);
+    
+            this.configChangedEvent.signature = CustomEvent.LIST;
+            this.queueInProgress = false;
+            this.config = {};
+            this.initialConfig = {};
+            this.eventQueue = [];
+        
+        },
+        
+        /**
+        * Validates that the value passed in is a Boolean.
+        * @method checkBoolean
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */ 
+        checkBoolean: function (val) {
+            return (typeof val == Config.BOOLEAN_TYPE);
+        },
+        
+        /**
+        * Validates that the value passed in is a number.
+        * @method checkNumber
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */
+        checkNumber: function (val) {
+            return (!isNaN(val));
+        },
+        
+        /**
+        * Fires a configuration property event using the specified value. 
+        * @method fireEvent
+        * @private
+        * @param {String} key The configuration property's name
+        * @param {value} Object The value of the correct type for the property
+        */ 
+        fireEvent: function ( key, value ) {
+            YAHOO.log("Firing Config event: " + key + "=" + value, "info");
+            var property = this.config[key];
+        
+            if (property && property.event) {
+                property.event.fire(value);
+            } 
+        },
+        
+        /**
+        * Adds a property to the Config Object's private config hash.
+        * @method addProperty
+        * @param {String} key The configuration property's name
+        * @param {Object} propertyObject The Object containing all of this 
+        * property's arguments
+        */
+        addProperty: function ( key, propertyObject ) {
+            key = key.toLowerCase();
+            YAHOO.log("Added property: " + key, "info");
+        
+            this.config[key] = propertyObject;
+        
+            propertyObject.event = this.createEvent(key, { scope: this.owner });
+            propertyObject.event.signature = CustomEvent.LIST;
+            
+            
+            propertyObject.key = key;
+        
+            if (propertyObject.handler) {
+                propertyObject.event.subscribe(propertyObject.handler, 
+                    this.owner);
+            }
+        
+            this.setProperty(key, propertyObject.value, true);
+            
+            if (! propertyObject.suppressEvent) {
+                this.queueProperty(key, propertyObject.value);
+            }
+            
+        },
+        
+        /**
+        * Returns a key-value configuration map of the values currently set in  
+        * the Config Object.
+        * @method getConfig
+        * @return {Object} The current config, represented in a key-value map
+        */
+        getConfig: function () {
+        
+            var cfg = {},
+                prop,
+                property;
                 
-                document.body.appendChild(resizeMonitor);
+            for (prop in this.config) {
+                property = this.config[prop];
+                if (property && property.event) {
+                    cfg[prop] = property.value;
+                }
+            }
+            
+            return cfg;
+        },
+        
+        /**
+        * Returns the value of specified property.
+        * @method getProperty
+        * @param {String} key The name of the property
+        * @return {Object}  The value of the specified property
+        */
+        getProperty: function (key) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.value;
+            } else {
+                return undefined;
+            }
+        },
+        
+        /**
+        * Resets the specified property's value to its initial value.
+        * @method resetProperty
+        * @param {String} key The name of the property
+        * @return {Boolean} True is the property was reset, false if not
+        */
+        resetProperty: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event) {
+    
+                if (this.initialConfig[key] && 
+                    !Lang.isUndefined(this.initialConfig[key])) {
+    
+                    this.setProperty(key, this.initialConfig[key]);
+
+                    return true;
+    
+                }
+    
+            } else {
+    
+                return false;
+            }
+    
+        },
+        
+        /**
+        * Sets the value of a property. If the silent property is passed as 
+        * true, the property's event will not be fired.
+        * @method setProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @param {Boolean} silent Whether the value should be set silently, 
+        * without firing the property event.
+        * @return {Boolean} True, if the set was successful, false if it failed.
+        */
+        setProperty: function (key, value, silent) {
+        
+            var property;
+        
+            key = key.toLowerCase();
+            YAHOO.log("setProperty: " + key + "=" + value, "info");
+        
+            if (this.queueInProgress && ! silent) {
+                // Currently running through a queue... 
+                this.queueProperty(key,value);
+                return true;
+    
+            } else {
+                property = this.config[key];
+                if (property && property.event) {
+                    if (property.validator && !property.validator(value)) {
+                        return false;
+                    } else {
+                        property.value = value;
+                        if (! silent) {
+                            this.fireEvent(key, value);
+                            this.configChangedEvent.fire([key, value]);
+                        }
+                        return true;
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        
+        /**
+        * Sets the value of a property and queues its event to execute. If the 
+        * event is already scheduled to execute, it is
+        * moved from its current position to the end of the queue.
+        * @method queueProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @return {Boolean}  true, if the set was successful, false if 
+        * it failed.
+        */ 
+        queueProperty: function (key, value) {
+        
+            key = key.toLowerCase();
+            YAHOO.log("queueProperty: " + key + "=" + value, "info");
+        
+            var property = this.config[key],
+                foundDuplicate = false,
+                iLen,
+                queueItem,
+                queueItemKey,
+                queueItemValue,
+                sLen,
+                supercedesCheck,
+                qLen,
+                queueItemCheck,
+                queueItemCheckKey,
+                queueItemCheckValue,
+                i,
+                s,
+                q;
+                                
+            if (property && property.event) {
+    
+                if (!Lang.isUndefined(value) && property.validator && 
+                    !property.validator(value)) { // validator
+                    return false;
+                } else {
+        
+                    if (!Lang.isUndefined(value)) {
+                        property.value = value;
+                    } else {
+                        value = property.value;
+                    }
+        
+                    foundDuplicate = false;
+                    iLen = this.eventQueue.length;
+        
+                    for (i = 0; i < iLen; i++) {
+                        queueItem = this.eventQueue[i];
+        
+                        if (queueItem) {
+                            queueItemKey = queueItem[0];
+                            queueItemValue = queueItem[1];
+                            
+                            if (queueItemKey == key) {
+    
+                                /*
+                                    found a dupe... push to end of queue, null 
+                                    current item, and break
+                                */
+    
+                                this.eventQueue[i] = null;
+    
+                                this.eventQueue.push(
+                                    [key, (!Lang.isUndefined(value) ? 
+                                    value : queueItemValue)]);
+    
+                                foundDuplicate = true;
+                                break;
+                            }
+                        }
+                    }
+                    
+                    // this is a refire, or a new property in the queue
+    
+                    if (! foundDuplicate && !Lang.isUndefined(value)) { 
+                        this.eventQueue.push([key, value]);
+                    }
+                }
+        
+                if (property.supercedes) {
+        
+                    sLen = property.supercedes.length;
+        
+                    for (s = 0; s < sLen; s++) {
+        
+                        supercedesCheck = property.supercedes[s];
+                        qLen = this.eventQueue.length;
+        
+                        for (q = 0; q < qLen; q++) {
+                            queueItemCheck = this.eventQueue[q];
+        
+                            if (queueItemCheck) {
+                                queueItemCheckKey = queueItemCheck[0];
+                                queueItemCheckValue = queueItemCheck[1];
+                                
+                                if (queueItemCheckKey == 
+                                    supercedesCheck.toLowerCase() ) {
+    
+                                    this.eventQueue.push([queueItemCheckKey, 
+                                        queueItemCheckValue]);
+    
+                                    this.eventQueue[q] = null;
+                                    break;
+    
+                                }
+                            }
+                        }
+                    }
+                }
+
+                YAHOO.log("Config event queue: " + this.outputEventQueue(), "info");
+        
+                return true;
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Fires the event for a property using the property's current value.
+        * @method refireEvent
+        * @param {String} key The name of the property
+        */
+        refireEvent: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event && 
     
-                resizeMonitor.style.width = "10em";
-                resizeMonitor.style.height = "10em";
-                resizeMonitor.style.position = "absolute";
+                !Lang.isUndefined(property.value)) {
+    
+                if (this.queueInProgress) {
+    
+                    this.queueProperty(key);
+    
+                } else {
+    
+                    this.fireEvent(key, property.value);
+    
+                }
+    
+            }
+        },
+        
+        /**
+        * Applies a key-value Object literal to the configuration, replacing  
+        * any existing values, and queueing the property events.
+        * Although the values will be set, fireQueue() must be called for their 
+        * associated events to execute.
+        * @method applyConfig
+        * @param {Object} userConfig The configuration Object literal
+        * @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.
+        */
+        applyConfig: function (userConfig, init) {
+        
+            var sKey,
+                oValue,
+                oConfig;
+
+            if (init) {
+
+                oConfig = {};
+
+                for (sKey in userConfig) {
+                
+                    if (Lang.hasOwnProperty(userConfig, sKey)) {
+
+                        oConfig[sKey.toLowerCase()] = userConfig[sKey];
+
+                    }
                 
-                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");
+                }
+
+                this.initialConfig = oConfig;
+
+            }
+
+            for (sKey in userConfig) {
+            
+                if (Lang.hasOwnProperty(userConfig, sKey)) {
+            
+                    this.queueProperty(sKey, userConfig[sKey]);
                 
-                resizeMonitor.style.visibility = "visible";
+                }
+
+            }
+
+        },
+        
+        /**
+        * Refires the events for all configuration properties using their 
+        * current values.
+        * @method refresh
+        */
+        refresh: function () {
+        
+            var prop;
+        
+            for (prop in this.config) {
+                this.refireEvent(prop);
+            }
+        },
+        
+        /**
+        * Fires the normalized list of queued property change events
+        * @method fireQueue
+        */
+        fireQueue: function () {
+        
+            var i, 
+                queueItem,
+                key,
+                value,
+                property;
+        
+            this.queueInProgress = true;
+            for (i = 0;i < this.eventQueue.length; i++) {
+                queueItem = this.eventQueue[i];
+                if (queueItem) {
+        
+                    key = queueItem[0];
+                    value = queueItem[1];
+                    property = this.config[key];
+        
+                    property.value = value;
+        
+                    this.fireEvent(key,value);
+                }
+            }
+            
+            this.queueInProgress = false;
+            this.eventQueue = [];
+        },
+        
+        /**
+        * Subscribes an external handler to the change event for any 
+        * given property. 
+        * @method subscribeToConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event handler 
+        * (see CustomEvent documentation)
+        * @param {Boolean} override Optional. If true, will override "this"  
+        * within the handler to map to the scope Object passed into the method.
+        * @return {Boolean} True, if the subscription was successful, 
+        * otherwise false.
+        */ 
+        subscribeToConfigEvent: function (key, handler, obj, override) {
     
-                if(!bIE) {
+            var property = this.config[key.toLowerCase()];
     
-                    var doc = resizeMonitor.contentWindow.document;
+            if (property && property.event) {
+    
+                if (!Config.alreadySubscribed(property.event, handler, obj)) {
+    
+                    property.event.subscribe(handler, obj, override);
     
-                    doc.open();
-                    doc.close();
-                
                 }
+    
+                return true;
+    
+            } else {
+    
+                return false;
+    
             }
     
-                       var fireTextResize = function() {
-                               YAHOO.widget.Module.textResizeEvent.fire();
-                       };
-
-            if(resizeMonitor && resizeMonitor.contentWindow) {
-                this.resizeMonitor = resizeMonitor;
-                               
-                               YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize, this, true);
-                               
-                               if (! YAHOO.widget.Module.textResizeInitialized) {
-                                       if (! YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", fireTextResize)) {
-                                               // This will fail in IE if document.domain has changed, so we must change the listener to
-                                               // use the resizeMonitor element instead
-                                               YAHOO.util.Event.addListener(this.resizeMonitor, "resize", fireTextResize);
-                                       }
-                                       YAHOO.widget.Module.textResizeInitialized = true;
-                               }
+        },
+        
+        /**
+        * Unsubscribes an external handler from the change event for any 
+        * given property. 
+        * @method unsubscribeFromConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event 
+        * handler (see CustomEvent documentation)
+        * @return {Boolean} True, if the unsubscription was successful, 
+        * otherwise false.
+        */
+        unsubscribeFromConfigEvent: function (key, handler, obj) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.event.unsubscribe(handler, obj);
+            } else {
+                return false;
             }
+        },
         
-        }
+        /**
+        * Returns a string representation of the Config object
+        * @method toString
+        * @return {String} The Config object in string format.
+        */
+        toString: function () {
+            var output = "Config";
+            if (this.owner) {
+                output += " [" + this.owner.toString() + "]";
+            }
+            return output;
+        },
+        
+        /**
+        * Returns a string representation of the Config object's current 
+        * CustomEvent queue
+        * @method outputEventQueue
+        * @return {String} The string list of CustomEvents currently queued 
+        * for execution
+        */
+        outputEventQueue: function () {
+
+            var output = "",
+                queueItem,
+                q,
+                nQueue = this.eventQueue.length;
+              
+            for (q = 0; q < nQueue; q++) {
+                queueItem = this.eventQueue[q];
+                if (queueItem) {
+                    output += queueItem[0] + "=" + queueItem[1] + ", ";
+                }
+            }
+            return output;
+        },
 
-       },
-
-       /**
-       * Event handler fired when the resize monitor element is resized.
-       * @method onDomResize
-       * @param {DOMEvent} e   The DOM resize event
-       * @param {Object} obj   The scope object passed to the handler
-       */
-       onDomResize : function(e, obj) { 
-
-        var nLeft = -1 * this.resizeMonitor.offsetWidth,
-            nTop = -1 * this.resizeMonitor.offsetHeight;
-        
-        this.resizeMonitor.style.top = nTop + "px";
-        this.resizeMonitor.style.left =  nLeft + "px";
-       
-       },
-
-       /**
-       * Sets the Module's header content to the HTML specified, or appends the passed element to the header. If no header is present, one will be automatically created.
-       * @method setHeader
-       * @param {String}       headerContent   The HTML used to set the header <em>OR</em>
-       * @param {HTMLElement}  headerContent   The HTMLElement to append to the header
-       */      
-       setHeader : function(headerContent) {
-               if (! this.header) {
-                       this.header = document.createElement("DIV");
-                       this.header.className = YAHOO.widget.Module.CSS_HEADER;
-               }
-               
-               if (typeof headerContent == "string") {
-                       this.header.innerHTML = headerContent;
-               } else {
-                       this.header.innerHTML = "";
-                       this.header.appendChild(headerContent);
-               }
-
-               this.changeHeaderEvent.fire(headerContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the header. If no header is present, one will be automatically created.
-       * @method appendToHeader
-       * @param {HTMLElement}  element The element to append to the header
-       */      
-       appendToHeader : function(element) {
-               if (! this.header) {
-                       this.header = document.createElement("DIV");
-                       this.header.className = YAHOO.widget.Module.CSS_HEADER;
-               }
-               
-               this.header.appendChild(element);
-               this.changeHeaderEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Sets the Module's body content to the HTML specified, or appends the passed element to the body. If no body is present, one will be automatically created.
-       * @method setBody
-       * @param {String}       bodyContent     The HTML used to set the body <em>OR</em>
-       * @param {HTMLElement}  bodyContent     The HTMLElement to append to the body
-       */              
-       setBody : function(bodyContent) {
-               if (! this.body) {
-                       this.body = document.createElement("DIV");
-                       this.body.className = YAHOO.widget.Module.CSS_BODY;
-               }
-
-               if (typeof bodyContent == "string")
-               {
-                       this.body.innerHTML = bodyContent;
-               } else {
-                       this.body.innerHTML = "";
-                       this.body.appendChild(bodyContent);
-               }
-
-               this.changeBodyEvent.fire(bodyContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the body. If no body is present, one will be automatically created.
-       * @method appendToBody
-       * @param {HTMLElement}  element The element to append to the body
-       */
-       appendToBody : function(element) {
-               if (! this.body) {
-                       this.body = document.createElement("DIV");
-                       this.body.className = YAHOO.widget.Module.CSS_BODY;
-               }
-
-               this.body.appendChild(element);
-               this.changeBodyEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method setFooter
-       * @param {String}       footerContent   The HTML used to set the footer <em>OR</em>
-       * @param {HTMLElement}  footerContent   The HTMLElement to append to the footer
-       */      
-       setFooter : function(footerContent) {
-               if (! this.footer) {
-                       this.footer = document.createElement("DIV");
-                       this.footer.className = YAHOO.widget.Module.CSS_FOOTER;
-               }
-
-               if (typeof footerContent == "string") {
-                       this.footer.innerHTML = footerContent;
-               } else {
-                       this.footer.innerHTML = "";
-                       this.footer.appendChild(footerContent);
-               }
-
-               this.changeFooterEvent.fire(footerContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the footer. If no footer is present, one will be automatically created.
-       * @method appendToFooter
-       * @param {HTMLElement}  element The element to append to the footer
-       */
-       appendToFooter : function(element) {
-               if (! this.footer) {
-                       this.footer = document.createElement("DIV");
-                       this.footer.className = YAHOO.widget.Module.CSS_FOOTER;
-               }
-
-               this.footer.appendChild(element);
-               this.changeFooterEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method render
-       * @param {String}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>
-       * @param {HTMLElement}  appendToNode    The element to which the Module should be appended to prior to rendering        
-       * @param {HTMLElement}  moduleElement   OPTIONAL. The element that represents the actual Standard Module container. 
-       * @return {Boolean} Success or failure of the render
-       */
-       render : function(appendToNode, moduleElement) {
-               this.beforeRenderEvent.fire();
-
-               if (! moduleElement) {
-                       moduleElement = this.element;
-               }
-
-               var me = this;
-               var appendTo = function(element) {
-                       if (typeof element == "string") {
-                               element = document.getElementById(element);
-                       }
-                       
-                       if (element) {
-                               element.appendChild(me.element);
-                               me.appendEvent.fire();
-                       }
-               };
-
-               if (appendToNode) {
-                       appendTo(appendToNode);
-               } else { // No node was passed in. If the element is not pre-marked up, this fails
-                       if (! YAHOO.util.Dom.inDocument(this.element)) {
-                               YAHOO.log("Render failed. Must specify appendTo node if Module isn't already in the DOM.", "error");
-                               return false;
-                       }
-               }
-
-               // Need to get everything into the DOM if it isn't already
-               
-               if (this.header && ! YAHOO.util.Dom.inDocument(this.header)) {
-                       // There is a header, but it's not in the DOM yet... need to add it
-                       var firstChild = moduleElement.firstChild;
-                       if (firstChild) { // Insert before first child if exists
-                               moduleElement.insertBefore(this.header, firstChild);
-                       } else { // Append to empty body because there are no children
-                               moduleElement.appendChild(this.header);
-                       }
-               }
-
-               if (this.body && ! YAHOO.util.Dom.inDocument(this.body)) {
-                       // There is a body, but it's not in the DOM yet... need to add it
-                       if (this.footer && YAHOO.util.Dom.isAncestor(this.moduleElement, this.footer)) { // Insert before footer if exists in DOM
-                               moduleElement.insertBefore(this.body, this.footer);
-                       } else { // Append to element because there is no footer
-                               moduleElement.appendChild(this.body);
-                       }
-               }
-
-               if (this.footer && ! YAHOO.util.Dom.inDocument(this.footer)) {
-                       // There is a footer, but it's not in the DOM yet... need to add it
-                       moduleElement.appendChild(this.footer);
-               }
-
-               this.renderEvent.fire();
-               return true;
-       },
-
-       /**
-       * Removes the Module element from the DOM and sets all child elements to null.
-       * @method destroy
-       */
-       destroy : function() {
-               var parent;
-
-               if (this.element) {
-                       YAHOO.util.Event.purgeElement(this.element, true);
-                       parent = this.element.parentNode;
-               }
-               if (parent) {
-                       parent.removeChild(this.element);
-               }
-
-               this.element = null;
-               this.header = null;
-               this.body = null;
-               this.footer = null;
-
-               for (var e in this) {
-                       if (e instanceof YAHOO.util.CustomEvent) {
-                               e.unsubscribeAll();
-                       }
-               }
-
-               YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this);
-
-               this.destroyEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method show
-       */
-       show : function() {
-               this.cfg.setProperty("visible", true);
-       },
-
-       /**
-       * 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.
-       * @method hide
-       */
-       hide : function() {
-               this.cfg.setProperty("visible", false);
-       },
-
-       // BUILT-IN EVENT HANDLERS FOR MODULE //
-
-       /**
-       * Default event handler for changing the visibility property of a Module. By default, this is achieved by switching the "display" style between "block" and "none".
-       * This method is responsible for firing showEvent and hideEvent.
-       * @param {String} type  The CustomEvent type (usually the property name)
-       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
-       * @method configVisible
-       */
-       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();
-               }
-       },
-
-       /**
-       * Default event handler for the "monitorresize" configuration property
-       * @param {String} type  The CustomEvent type (usually the property name)
-       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
-       * @method configMonitorResize
-       */
-       configMonitorResize : function(type, args, obj) {
-               var monitor = args[0];
-               if (monitor) {
-                       this.initResizeMonitor();
-               } else {
-                       YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this, true);
-                       this.resizeMonitor = null;
-               }
-       }
-};
-
-/**
-* Returns a String representation of the Object.
-* @method toString
-* @return {String}     The string representation of the Module
-*/ 
-YAHOO.widget.Module.prototype.toString = function() {
-       return "Module " + this.id;
-};
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Overlay
-* @extends YAHOO.widget.Module
-* @param {String}      el      The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement} el      The element representing the Overlay
-* @param {Object}      userConfig      The configuration object literal containing 10/23/2006the configuration that should be set for this Overlay. See configuration documentation for more details.
-* @constructor
-*/
-YAHOO.widget.Overlay = function(el, userConfig) {
-       YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Overlay, YAHOO.widget.Module);
-
-/**
-* The URL that will be placed in the iframe
-* @property YAHOO.widget.Overlay.IFRAME_SRC
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;";
-
-/**
-* Constant representing the top left corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.TOP_LEFT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.TOP_LEFT = "tl";
-
-/**
-* Constant representing the top right corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.TOP_RIGHT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.TOP_RIGHT = "tr";
-
-/**
-* Constant representing the top bottom left corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.BOTTOM_LEFT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.BOTTOM_LEFT = "bl";
-
-/**
-* Constant representing the bottom right corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.BOTTOM_RIGHT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.BOTTOM_RIGHT = "br";
-
-/**
-* Constant representing the default CSS class used for an Overlay
-* @property YAHOO.widget.Overlay.CSS_OVERLAY
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.CSS_OVERLAY = "overlay";
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement} el      The element representing the Overlay
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.
-*/
-YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {
-       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
-       
-       this.beforeInitEvent.fire(YAHOO.widget.Overlay);
+        /**
+        * Sets all properties to null, unsubscribes all listeners from each 
+        * property's change event and all listeners from the configChangedEvent.
+        * @method destroy
+        */
+        destroy: function () {
 
-       YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Overlay.CSS_OVERLAY);
+            var oConfig = this.config,
+                sProperty,
+                oProperty;
 
-       if (userConfig) {
-               this.cfg.applyConfig(userConfig, true);
-       }
 
-       if (this.platform == "mac" && this.browser == "gecko") {
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)) {
-                       this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)) {
-                       this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);
-               }
-       }
+            for (sProperty in oConfig) {
+            
+                if (Lang.hasOwnProperty(oConfig, sProperty)) {
 
-       this.initEvent.fire(YAHOO.widget.Overlay);
+                    oProperty = oConfig[sProperty];
 
-};
+                    oProperty.event.unsubscribeAll();
+                    oProperty.event = null;
 
-/**
-* Initializes the custom events for Overlay which are fired automatically at appropriate times by the Overlay class.
-* @method initEvents
-*/
-YAHOO.widget.Overlay.prototype.initEvents = function() {
-       YAHOO.widget.Overlay.superclass.initEvents.call(this);
-
-       /**
-       * CustomEvent fired before the Overlay is moved.
-       * @event beforeMoveEvent
-       * @param {Number} x     x coordinate
-       * @param {Number} y     y coordinate
-       */
-       this.beforeMoveEvent = new YAHOO.util.CustomEvent("beforeMove", this);
-
-       /**
-       * CustomEvent fired after the Overlay is moved.
-       * @event moveEvent
-       * @param {Number} x     x coordinate
-       * @param {Number} y     y coordinate
-       */
-       this.moveEvent = new YAHOO.util.CustomEvent("move", this);
-};
-
-/**
-* Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Overlay.prototype.initDefaultConfig = function() {
-       YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);
-
-       // Add overlay config properties //
-
-       /**
-       * The absolute x-coordinate position of the Overlay
-       * @config x
-       * @type Number
-       * @default null
-       */      
-       this.cfg.addProperty("x", { handler:this.configX, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * The absolute y-coordinate position of the Overlay
-       * @config y
-       * @type Number
-       * @default null
-       */      
-       this.cfg.addProperty("y", { handler:this.configY, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * An array with the absolute x and y positions of the Overlay
-       * @config xy
-       * @type Number[]
-       * @default null
-       */      
-       this.cfg.addProperty("xy",{ handler:this.configXY, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * 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.
-       * @config context
-       * @type Array
-       * @default null
-       */      
-       this.cfg.addProperty("context", { handler:this.configContext, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * True if the Overlay should be anchored to the center of the viewport.
-       * @config fixedcenter
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty("fixedcenter", { value:false, handler:this.configFixedCenter, validator:this.cfg.checkBoolean, supercedes:["iframe","visible"] } );
-
-       /**
-       * CSS width of the Overlay.
-       * @config width
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty("width", { handler:this.configWidth, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * CSS height of the Overlay.
-       * @config height
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty("height", { handler:this.configHeight, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * CSS z-index of the Overlay.
-       * @config zIndex
-       * @type Number
-       * @default null
-       */
-       this.cfg.addProperty("zIndex", { value:null, handler:this.configzIndex } );
-
-       /**
-       * True if the Overlay should be prevented from being positioned out of the viewport.
-       * @config constraintoviewport
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty("constraintoviewport", { value:false, handler:this.configConstrainToViewport, validator:this.cfg.checkBoolean, supercedes:["iframe","x","y","xy"] } );
-
-       /**
-       * True if the Overlay should have an IFRAME shim (for correcting the select z-index bug in IE6 and below).
-       * @config iframe
-       * @type Boolean
-       * @default true for IE6 and below, false for all others
-       */
-       this.cfg.addProperty("iframe", { value:(this.browser == "ie" ? true : false), handler:this.configIframe, validator:this.cfg.checkBoolean, supercedes:["zIndex"] } );
-};
-
-/**
-* Moves the Overlay to the specified position. This function is identical to calling this.cfg.setProperty("xy", [x,y]);
-* @method moveTo
-* @param {Number}      x       The Overlay's new x position
-* @param {Number}      y       The Overlay's new y position
-*/
-YAHOO.widget.Overlay.prototype.moveTo = function(x, y) {
-       this.cfg.setProperty("xy",[x,y]);
-};
-
-/**
-* Adds a special CSS class to the Overlay when Mac/Gecko is in use, to work around a Gecko bug where
-* scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
-* @method hideMacGeckoScrollbars
-*/
-YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars = function() {
-       YAHOO.util.Dom.removeClass(this.element, "show-scrollbars");
-       YAHOO.util.Dom.addClass(this.element, "hide-scrollbars");
-};
-
-/**
-* Removes a special CSS class from the Overlay when Mac/Gecko is in use, to work around a Gecko bug where
-* scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
-* @method showMacGeckoScrollbars
-*/
-YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars = function() {
-       YAHOO.util.Dom.removeClass(this.element, "hide-scrollbars");
-       YAHOO.util.Dom.addClass(this.element, "show-scrollbars");
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* The default event handler fired when the "visible" property is changed. This method is responsible for firing showEvent and hideEvent.
-* @method configVisible
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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; }
-                       e = e.parentNode;
-               }
-               if (currentVis == "inherit") { 
-                       currentVis = "visible";
-               }
-       }
-
-       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);
-               }
-       }
-
-       var isMacGecko = (this.platform == "mac" && this.browser == "gecko");
-
-       if (visible) { // Show
-               if (isMacGecko) {
-                       this.showMacGeckoScrollbars();
-               }       
-
-               if (effect) { // Animate in
-                       if (visible) { // Animate in if not showing
-                               if (currentVis != "visible" || currentVis === "") {
-                                       this.beforeShowEvent.fire();
-                                       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); // Delegate showEvent until end of animateInComplete
-                                               }
-                                               ei.animateIn();
-                                       }
-                               }
-                       }
-               } else { // Show
-                       if (currentVis != "visible" || currentVis === "") {
-                               this.beforeShowEvent.fire();
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "visible");
-                               this.cfg.refireEvent("iframe");
-                               this.showEvent.fire();
-                       }
-               }
-
-       } else { // Hide
-               if (isMacGecko) {
-                       this.hideMacGeckoScrollbars();
-               }       
-
-               if (effect) { // Animate out if showing
-                       if (currentVis == "visible") {
-                               this.beforeHideEvent.fire();
-                               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); // Delegate hideEvent until end of animateOutComplete
-                                       }
-                                       h.animateOut();
-                               }
-                       } else if (currentVis === "") {
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");
-                       }
-               } else { // Simple hide
-                       if (currentVis == "visible" || currentVis === "") {
-                               this.beforeHideEvent.fire();
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");
-                               this.cfg.refireEvent("iframe");
-                               this.hideEvent.fire();
-                       }
-               }       
-       }
-};
-
-/**
-* Center event handler used for centering on scroll/resize, but only if the Overlay is visible
-* @method doCenterOnDOMEvent
-*/
-YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent = function() {
-       if (this.cfg.getProperty("visible")) {
-               this.center();
-       }
-};
-
-/**
-* The default event handler fired when the "fixedcenter" property is changed.
-* @method configFixedCenter
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-               }
-               
-               if (! YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent, this.doCenterOnDOMEvent, this)) {
-                       YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);
-               }
-
-               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);
-       }
-};
-
-/**
-* The default event handler fired when the "height" property is changed.
-* @method configHeight
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "width" property is changed.
-* @method configWidth
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "zIndex" property is changed.
-* @method configzIndex
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-               }
-       }
-
-       if (this.iframe) {
-               if (zIndex <= 0) {
-                       zIndex = 1;
-               }
-               YAHOO.util.Dom.setStyle(this.iframe, "zIndex", (zIndex-1));
-       }
-
-       YAHOO.util.Dom.setStyle(el, "zIndex", zIndex);
-       this.cfg.setProperty("zIndex", zIndex, true);
-};
-
-/**
-* The default event handler fired when the "xy" property is changed.
-* @method configXY
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {
-       var pos = args[0];
-       var x = pos[0];
-       var y = pos[1];
+                }
+            
+            }
+            
+            this.configChangedEvent.unsubscribeAll();
+            
+            this.configChangedEvent = null;
+            this.owner = null;
+            this.config = null;
+            this.initialConfig = null;
+            this.eventQueue = null;
+        
+        }
 
-       this.cfg.setProperty("x", x);
-       this.cfg.setProperty("y", y);
+    };
+    
+    
+    
+    /**
+    * Checks to determine if a particular function/Object pair are already 
+    * subscribed to the specified CustomEvent
+    * @method YAHOO.util.Config.alreadySubscribed
+    * @static
+    * @param {YAHOO.util.CustomEvent} evt The CustomEvent for which to check 
+    * the subscriptions
+    * @param {Function} fn The function to look for in the subscribers list
+    * @param {Object} obj The execution scope Object for the subscription
+    * @return {Boolean} true, if the function/Object pair is already subscribed 
+    * to the CustomEvent passed in
+    */
+    Config.alreadySubscribed = function (evt, fn, obj) {
+    
+        var nSubscribers = evt.subscribers.length,
+            subsc,
+            i;
 
-       this.beforeMoveEvent.fire([x,y]);
+        if (nSubscribers > 0) {
 
-       x = this.cfg.getProperty("x");
-       y = this.cfg.getProperty("y");
+            i = nSubscribers - 1;
+        
+            do {
 
-       YAHOO.log("xy: " + [x,y], "iframe");
+                subsc = evt.subscribers[i];
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x,y]);
-};
+                if (subsc && subsc.obj == obj && subsc.fn == fn) {
+        
+                    return true;
+        
+                }    
+            
+            }
+            while (i--);
+        
+        }
+    
+        return false;
+    
+    };
+    
+    YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @module container
+    * @title Container
+    * @requires yahoo, dom, event 
+    * @optional dragdrop, animation, button
+    */
+    
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Module
+    * @constructor
+    * @param {String} el The element ID representing the Module <em>OR</em>
+    * @param {HTMLElement} el The element representing the Module
+    * @param {Object} userConfig The configuration Object literal containing 
+    * the configuration that should be set for this module. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Module = function (el, userConfig) {
+    
+        if (el) {
+    
+            this.init(el, userConfig);
+    
+        } else {
+    
+            YAHOO.log("No element or element ID specified" + 
+                " for Module instantiation", "error");
+    
+        }
+    
+    };
 
-/**
-* The default event handler fired when the "x" property is changed.
-* @method configX
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
+    var Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        Event = YAHOO.util.Event,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Module = YAHOO.widget.Module,
+        
+        m_oModuleTemplate,
+        m_oHeaderTemplate,
+        m_oBodyTemplate,
+        m_oFooterTemplate,
+
+        /**
+        * Constant representing the name of the Module's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_INIT": "beforeInit",
+            "INIT": "init",
+            "APPEND": "append",
+            "BEFORE_RENDER": "beforeRender",
+            "RENDER": "render",
+            "CHANGE_HEADER": "changeHeader",
+            "CHANGE_BODY": "changeBody",
+            "CHANGE_FOOTER": "changeFooter",
+            "CHANGE_CONTENT": "changeContent",
+            "DESTORY": "destroy",
+            "BEFORE_SHOW": "beforeShow",
+            "SHOW": "show",
+            "BEFORE_HIDE": "beforeHide",
+            "HIDE": "hide"
+        
+        },
+            
+        /**
+        * Constant representing the Module's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "VISIBLE": { 
+                key: "visible", 
+                value: true, 
+                validator: YAHOO.lang.isBoolean 
+            },
+        
+            "EFFECT": { 
+                key: "effect", 
+                suppressEvent: true, 
+                supercedes: ["visible"] 
+            },
+        
+            "MONITOR_RESIZE": { 
+                key: "monitorresize", 
+                value: true  
+            }
+        
+        };
 
-       this.beforeMoveEvent.fire([x,y]);
+    
+    /**
+    * Constant representing the prefix path to use for non-secure images
+    * @property YAHOO.widget.Module.IMG_ROOT
+    * @static
+    * @final
+    * @type String
+    */
+    Module.IMG_ROOT = null;
+    
+    /**
+    * Constant representing the prefix path to use for securely served images
+    * @property YAHOO.widget.Module.IMG_ROOT_SSL
+    * @static
+    * @final
+    * @type String
+    */
+    Module.IMG_ROOT_SSL = null;
+    
+    /**
+    * Constant for the default CSS class name that represents a Module
+    * @property YAHOO.widget.Module.CSS_MODULE
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_MODULE = "yui-module";
+    
+    /**
+    * Constant representing the module header
+    * @property YAHOO.widget.Module.CSS_HEADER
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_HEADER = "hd";
+    
+    /**
+    * Constant representing the module body
+    * @property YAHOO.widget.Module.CSS_BODY
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_BODY = "bd";
+    
+    /**
+    * Constant representing the module footer
+    * @property YAHOO.widget.Module.CSS_FOOTER
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_FOOTER = "ft";
+    
+    /**
+    * Constant representing the url for the "src" attribute of the iframe 
+    * used to monitor changes to the browser's base font size
+    * @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL
+    * @static
+    * @final
+    * @type String
+    */
+    Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";
+    
+    /**
+    * Singleton CustomEvent fired when the font size is changed in the browser.
+    * Opera's "zoom" functionality currently does not support text 
+    * size detection.
+    * @event YAHOO.widget.Module.textResizeEvent
+    */
+    Module.textResizeEvent = new CustomEvent("textResize");
 
-       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);
+    function createModuleTemplate() {
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x, y]);
-};
+        if (!m_oModuleTemplate) {
 
-/**
-* The default event handler fired when the "y" property is changed.
-* @method configY
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {
-       var x = this.cfg.getProperty("x");
-       var y = args[0];
+            m_oModuleTemplate = document.createElement("div");
+            
+            m_oModuleTemplate.innerHTML = ("<div class=\"" + 
+                Module.CSS_HEADER + "\"></div>" + "<div class=\"" + 
+                Module.CSS_BODY + "\"></div><div class=\"" + 
+                Module.CSS_FOOTER + "\"></div>");
 
-       this.cfg.setProperty("x", x, true);
-       this.cfg.setProperty("y", y, true);
+            m_oHeaderTemplate = m_oModuleTemplate.firstChild;
+            m_oBodyTemplate = m_oHeaderTemplate.nextSibling;
+            m_oFooterTemplate = m_oBodyTemplate.nextSibling;
 
-       this.beforeMoveEvent.fire([x,y]);
+        }
 
-       x = this.cfg.getProperty("x");
-       y = this.cfg.getProperty("y");
+        return m_oModuleTemplate;
 
-       YAHOO.util.Dom.setY(this.element, y, true);
+    }
 
-       this.cfg.setProperty("xy", [x, y], true);
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x, y]);
-};
+    function createHeader() {
 
-/**
-* Shows the iframe shim, if it has been enabled
-* @method showIframe
-*/
-YAHOO.widget.Overlay.prototype.showIframe = function() {
-       if (this.iframe) {
-               this.iframe.style.display = "block";
-       }
-};
-
-/**
-* Hides the iframe shim, if it has been enabled
-* @method hideIframe
-*/
-YAHOO.widget.Overlay.prototype.hideIframe = function() {
-       if (this.iframe) {
-               this.iframe.style.display = "none";
-       }
-};
-
-/**
-* The default event handler fired when the "iframe" property is changed.
-* @method configIframe
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
-
-       var val = args[0];
-
-       if (val) { // IFRAME shim is enabled
-
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, this.showIframe, this)) {
-                       this.showEvent.subscribe(this.showIframe, this, true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, this.hideIframe, this)) {
-                       this.hideEvent.subscribe(this.hideIframe, this, true);
-               }
-
-               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");
-               }
-
-               YAHOO.log("iframe positioning to: " + [x,y], "iframe");
-
-               if (! isNaN(x) && ! isNaN(y)) {
-                       if (! this.iframe) {
-                               this.iframe = document.createElement("iframe");
-                               if (this.isSecure) {
-                                       this.iframe.src = YAHOO.widget.Overlay.IFRAME_SRC;
-                               }
-                               
-                               var parent = this.element.parentNode;
-                               if (parent) {
-                                       parent.appendChild(this.iframe);
-                               } else {
-                                       document.body.appendChild(this.iframe);
-                               }
-
-                               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();
-                               }
-                       }
-                       
-                       var iframeDisplay = YAHOO.util.Dom.getStyle(this.iframe, "display");
-
-                       if (iframeDisplay == "none") {
-                               this.iframe.style.display = "block";
-                       }
-
-                       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";
-               }
-               this.showEvent.unsubscribe(this.showIframe, this);
-               this.hideEvent.unsubscribe(this.hideIframe, this);
-       }
-};
-
-
-/**
-* The default event handler fired when the "constraintoviewport" property is changed.
-* @method configConstrainToViewport
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-       }
-};
-
-/**
-* The default event handler fired when the "context" property is changed.
-* @method configContext
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-                       }
-                       
-                       if (elementMagnetCorner && contextMagnetCorner) {
-                               this.align(elementMagnetCorner, contextMagnetCorner);
-                       }
-               }       
-       }
-};
-
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Aligns the Overlay to its context element using the specified corner points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, and BOTTOM_RIGHT.
-* @method align
-* @param {String} elementAlign         The String representing the corner of the Overlay that should be aligned to the context element
-* @param {String} contextAlign         The corner of the context element that the elementAlign corner should stick to.
-*/
-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];
-               }
-
-               if (! contextAlign) {
-                       contextAlign = contextArgs[2];
-               }
-
-               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;
-                       }
-               }
-       }
-};
-
-/**
-* The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true.
-* @method enforceConstraints
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-       }
-
-       if (y < topConstraint) {
-               y = topConstraint;
-       } else if (y > bottomConstraint) {
-               y = bottomConstraint;
-       }
-
-       this.cfg.setProperty("x", x, true);
-       this.cfg.setProperty("y", y, true);
-       this.cfg.setProperty("xy", [x,y], true);
-};
-
-/**
-* Centers the container in the viewport.
-* @method center
-*/
-YAHOO.widget.Overlay.prototype.center = function() {
-       var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
-       var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+        if (!m_oHeaderTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oHeaderTemplate.cloneNode(false));
 
-       var viewPortWidth = YAHOO.util.Dom.getClientWidth();
-       var viewPortHeight = YAHOO.util.Dom.getClientHeight();
+    }
+    
 
-       var elementWidth = this.element.offsetWidth;
-       var elementHeight = this.element.offsetHeight;
+    function createBody() {
 
-       var x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX;
-       var y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
-               
-       this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
+        if (!m_oBodyTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oBodyTemplate.cloneNode(false));
+    
+    }
+    
 
-       this.cfg.refireEvent("iframe");
-};
+    function createFooter() {
 
-/**
-* 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.
-* @method syncPosition
-*/
-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);
-};
-
-/**
-* Event handler fired when the resize monitor element is resized.
-* @method onDomResize
-* @param {DOMEvent} e  The resize DOM event
-* @param {Object} obj  The scope object
-*/
-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);
-};
-
-/**
-* Removes the Overlay element from the DOM and sets all child elements to null.
-* @method destroy
-*/
-YAHOO.widget.Overlay.prototype.destroy = function() {
-       if (this.iframe) {
-               this.iframe.parentNode.removeChild(this.iframe);
-       }
-       
-       this.iframe = null;
-
-       YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-       YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-
-       YAHOO.widget.Overlay.superclass.destroy.call(this);  
-};
-
-/**
-* Returns a String representation of the object.
-* @method toString
-* @return {String} The string representation of the Overlay.
-*/ 
-YAHOO.widget.Overlay.prototype.toString = function() {
-       return "Overlay " + this.id;
-};
-
-/**
-* A singleton CustomEvent used for reacting to the DOM event for window scroll
-* @event YAHOO.widget.Overlay.windowScrollEvent
-*/
-YAHOO.widget.Overlay.windowScrollEvent = new YAHOO.util.CustomEvent("windowScroll");
+        if (!m_oFooterTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oFooterTemplate.cloneNode(false));
 
-/**
-* A singleton CustomEvent used for reacting to the DOM event for window resize
-* @event YAHOO.widget.Overlay.windowResizeEvent
-*/
-YAHOO.widget.Overlay.windowResizeEvent = new YAHOO.util.CustomEvent("windowResize");
+    }
+    
 
-/**
-* The DOM event handler used to fire the CustomEvent for window scroll
-* @method YAHOO.widget.Overlay.windowScrollHandler
-* @static
-* @param {DOMEvent} e The DOM scroll event
-*/
-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;
-               }
-               clearTimeout(window.scrollEnd);
-               window.scrollEnd = setTimeout(function() { YAHOO.widget.Overlay.windowScrollEvent.fire(); }, 1);
-       } else {
-               YAHOO.widget.Overlay.windowScrollEvent.fire();
-       }
-};
-
-/**
-* The DOM event handler used to fire the CustomEvent for window resize
-* @method YAHOO.widget.Overlay.windowResizeHandler
-* @static
-* @param {DOMEvent} e The DOM resize event
-*/
-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;
-               }
-               clearTimeout(window.resizeEnd);
-               window.resizeEnd = setTimeout(function() { YAHOO.widget.Overlay.windowResizeEvent.fire(); }, 100);
-       } else {
-               YAHOO.widget.Overlay.windowResizeEvent.fire();
-       }
-};
-
-/**
-* A boolean that indicated whether the window resize and scroll events have already been subscribed to.
-* @property YAHOO.widget.Overlay._initialized
-* @private
-* @type Boolean
-*/
-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;
-}
-
-/**
-* OverlayManager is used for maintaining the focus status of multiple Overlays.* @namespace YAHOO.widget
-* @namespace YAHOO.widget
-* @class OverlayManager
-* @constructor
-* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.
-* @param {Object}      userConfig              The object literal representing the user configuration of the OverlayManager
-*/
-YAHOO.widget.OverlayManager = function(userConfig) {
-       this.init(userConfig);
-};
-
-/**
-* The CSS class representing a focused Overlay
-* @property YAHOO.widget.OverlayManager.CSS_FOCUSED
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.OverlayManager.CSS_FOCUSED = "focused";
-
-YAHOO.widget.OverlayManager.prototype = {
-       /**
-       * The class's constructor function
-       * @property contructor
-       * @type Function
-       */
-       constructor : YAHOO.widget.OverlayManager,
-
-       /**
-       * The array of Overlays that are currently registered
-       * @property overlays
-       * @type YAHOO.widget.Overlay[]
-       */
-       overlays : null,
-
-       /**
-       * Initializes the default configuration of the OverlayManager
-       * @method initDefaultConfig
-       */      
-       initDefaultConfig : function() {
-               /**
-               * The collection of registered Overlays in use by the OverlayManager
-               * @config overlays
-               * @type YAHOO.widget.Overlay[]
-               * @default null
-               */
-               this.cfg.addProperty("overlays", { suppressEvent:true } );
-
-               /**
-               * The default DOM event that should be used to focus an Overlay
-               * @config focusevent
-               * @type String
-               * @default "mousedown"
-               */
-               this.cfg.addProperty("focusevent", { value:"mousedown" } );
-       }, 
-
-       /**
-       * Initializes the OverlayManager
-       * @method init
-       * @param {YAHOO.widget.Overlay[]}       overlays        Optional. A collection of Overlays to register with the manager.
-       * @param {Object}       userConfig              The object literal representing the user configuration of the OverlayManager
-       */
-       init : function(userConfig) {
-               /**
-               * The OverlayManager's Config object used for monitoring configuration properties.
-               * @property cfg
-               * @type YAHOO.util.Config
-               */
-               this.cfg = new YAHOO.util.Config(this);
-
-               this.initDefaultConfig();
-
-               if (userConfig) {
-                       this.cfg.applyConfig(userConfig, true);
-               }
-               this.cfg.fireQueue();
-
-               /**
-               * The currently activated Overlay
-               * @property activeOverlay
-               * @private
-               * @type YAHOO.widget.Overlay
-               */
-               var activeOverlay = null;
-
-               /**
-               * Returns the currently focused Overlay
-               * @method getActive
-               * @return {YAHOO.widget.Overlay}        The currently focused Overlay
-               */
-               this.getActive = function() {
-                       return activeOverlay;
-               };
-
-               /**
-               * Focuses the specified Overlay
-               * @method focus
-               * @param {YAHOO.widget.Overlay} overlay The Overlay to focus
-               * @param {String} overlay       The id of the Overlay to focus
-               */
-               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));
-                               }
-                               this.overlays.sort(this.compareZIndexDesc);
-                       }
-               };
-
-               /**
-               * Removes the specified Overlay from the manager
-               * @method remove
-               * @param {YAHOO.widget.Overlay} overlay The Overlay to remove
-               * @param {String} overlay       The id of the Overlay to remove
-               */
-               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;
-                       }
-               };
-
-               /**
-               * Removes focus from all registered Overlays in the manager
-               * @method blurAll
-               */
-               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 = [];
-               }
-
-               if (overlays) {
-                       this.register(overlays);
-                       this.overlays.sort(this.compareZIndexDesc);
-               }
-       },
-
-       /**
-       * 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.
-       * @method register
-       * @param {YAHOO.widget.Overlay} overlay         An Overlay to register with the manager.
-       * @param {YAHOO.widget.Overlay[]}       overlay         An array of Overlays to register with the manager.
-       * @return       {Boolean}       True if any Overlays are registered.
-       */
-       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);
-                       }
-                       
-                       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++;
-                               }
-                       }
-                       if (regcount > 0) {
-                               return true;
-                       }
-               } else {
-                       return false;
-               }
-       },
-
-       /**
-       * Attempts to locate an Overlay by instance or ID.
-       * @method find
-       * @param {YAHOO.widget.Overlay} overlay         An Overlay to locate within the manager
-       * @param {String}       overlay         An Overlay id to locate within the manager
-       * @return       {YAHOO.widget.Overlay}  The requested Overlay, if found, or null if it cannot be located.
-       */
-       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];
-                               }
-                       }                       
-               }
-               return null;
-       },
-
-       /**
-       * Used for sorting the manager's Overlays by z-index.
-       * @method compareZIndexDesc
-       * @private
-       * @return {Number}      0, 1, or -1, depending on where the Overlay should fall in the stacking order.
-       */
-       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;
-               }
-       },
-
-       /**
-       * Shows all Overlays in the manager.
-       * @method showAll
-       */
-       showAll : function() {
-               for (var o=0;o<this.overlays.length;o++) {
-                       this.overlays[o].show();
-               }
-       },
-
-       /**
-       * Hides all Overlays in the manager.
-       * @method hideAll
-       */
-       hideAll : function() {
-               for (var o=0;o<this.overlays.length;o++) {
-                       this.overlays[o].hide();
-               }
-       },
-
-       /**
-       * Returns a string representation of the object.
-       * @method toString
-       * @return {String}      The string representation of the OverlayManager
-       */ 
-       toString : function() {
-               return "OverlayManager";
-       }
-
-};
-
-/**
-* KeyListener is a utility that provides an easy interface for listening for keydown/keyup events fired against DOM elements.
-* @namespace YAHOO.util
-* @class KeyListener
-* @constructor
-* @param {HTMLElement} attachTo        The element or element ID to which the key event should be attached
-* @param {String}      attachTo        The element or element ID to which the key event should be attached
-* @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).
-* @param {Function}    handler         The CustomEvent handler to fire when the key event is detected
-* @param {Object}      handler         An object literal representing the handler. 
-* @param {String}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.
-*/
-YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
-       if (! attachTo) {
-               YAHOO.log("No attachTo element specified", "error");
-       }
-       if (! keyData) {
-               YAHOO.log("No keyData specified", "error");
-       }
-       if (! handler) {
-               YAHOO.log("No handler specified", "error");
-       }
-
-       if (! event) {
-               event = YAHOO.util.KeyListener.KEYDOWN;
-       }
-
-       /**
-       * The CustomEvent fired internally when a key is pressed
-       * @event keyEvent
-       * @private
-       * @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).
-       */
-       var keyEvent = new YAHOO.util.CustomEvent("keyPressed");
-       
-       /**
-       * The CustomEvent fired when the KeyListener is enabled via the enable() function
-       * @event enabledEvent
-       * @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).
-       */
-       this.enabledEvent = new YAHOO.util.CustomEvent("enabled");
-
-       /**
-       * The CustomEvent fired when the KeyListener is disabled via the disable() function
-       * @event disabledEvent
-       * @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).
-       */
-       this.disabledEvent = new YAHOO.util.CustomEvent("disabled");
-
-       if (typeof attachTo == 'string') {
-               attachTo = document.getElementById(attachTo);
-       }
-
-       if (typeof handler == 'function') {
-               keyEvent.subscribe(handler);
-       } else {
-               keyEvent.subscribe(handler.fn, handler.scope, handler.correctScope);
-       }
-
-       /**
-       * Handles the key event when a key is pressed.
-       * @method handleKeyPress
-       * @param {DOMEvent} e   The keypress DOM event
-       * @param {Object}       obj     The DOM event scope object
-       * @private
-       */
-       function handleKeyPress(e, obj) {
-               if (! keyData.shift) {  
-                       keyData.shift = false; 
-               }
-               if (! keyData.alt) {    
-                       keyData.alt = false;
-               }
-               if (! keyData.ctrl) {
-                       keyData.ctrl = false;
-               }
-
-               // check held down modifying keys first
-               if (e.shiftKey == keyData.shift && 
-                       e.altKey   == keyData.alt &&
-                       e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
-                       
-                       var dataItem;
-                       var keyPressed;
-
-                       if (keyData.keys instanceof Array) {
-                               for (var i=0;i<keyData.keys.length;i++) {
-                                       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);
-                               }
-                       }
-               }
-       }
-
-       /**
-       * Enables the KeyListener by attaching the DOM event listeners to the target DOM element
-       * @method enable
-       */
-       this.enable = function() {
-               if (! this.enabled) {
-                       YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);
-                       this.enabledEvent.fire(keyData);
-               }
-               /**
-               * Boolean indicating the enabled/disabled state of the Tooltip
-               * @property enabled
-               * @type Boolean
-               */
-               this.enabled = true;
-       };
-
-       /**
-       * Disables the KeyListener by removing the DOM event listeners from the target DOM element
-       * @method disable
-       */
-       this.disable = function() {
-               if (this.enabled) {
-                       YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);
-                       this.disabledEvent.fire(keyData);
-               }
-               this.enabled = false;
-       };
-
-       /**
-       * Returns a String representation of the object.
-       * @method toString
-       * @return {String}      The string representation of the KeyListener
-       */ 
-       this.toString = function() {
-               return "KeyListener [" + keyData.keys + "] " + attachTo.tagName + (attachTo.id ? "[" + attachTo.id + "]" : "");
-       };
-
-};
-
-/**
-* Constant representing the DOM "keydown" event.
-* @property YAHOO.util.KeyListener.KEYDOWN
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYDOWN = "keydown";
-
-/**
-* Constant representing the DOM "keyup" event.
-* @property YAHOO.util.KeyListener.KEYUP
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYUP = "keyup";
-
-/**
-* ContainerEffect encapsulates animation transitions that are executed when an Overlay is shown or hidden.
-* @namespace YAHOO.widget
-* @class ContainerEffect
-* @constructor
-* @param {YAHOO.widget.Overlay}        overlay         The Overlay that the animation should be associated with
-* @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).
-* @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).
-* @param {HTMLElement} targetElement   Optional. The target element that should be animated during the transition. Defaults to overlay.element.
-* @param {class}       Optional. The animation class to instantiate. Defaults to YAHOO.util.Anim. Other options include YAHOO.util.Motion.
-*/
-YAHOO.widget.ContainerEffect = function(overlay, attrIn, attrOut, targetElement, animClass) {
-       if (! animClass) {
-               animClass = YAHOO.util.Anim;
-       }
-
-       /**
-       * The overlay to animate
-       * @property overlay
-       * @type YAHOO.widget.Overlay
-       */
-       this.overlay = overlay;
-       /**
-       * The animation attributes to use when transitioning into view
-       * @property attrIn
-       * @type Object
-       */
-       this.attrIn = attrIn;
-       /**
-       * The animation attributes to use when transitioning out of view
-       * @property attrOut
-       * @type Object
-       */
-       this.attrOut = attrOut;
-       /**
-       * The target element to be animated
-       * @property targetElement
-       * @type HTMLElement
-       */
-       this.targetElement = targetElement || overlay.element;
-       /**
-       * The animation class to use for animating the overlay
-       * @property animClass
-       * @type class
-       */
-       this.animClass = animClass;
-};
-
-/**
-* Initializes the animation classes and events.
-* @method init
-*/
-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);
-};
-
-/**
-* Triggers the in-animation.
-* @method animateIn
-*/
-YAHOO.widget.ContainerEffect.prototype.animateIn = function() {
-       this.beforeAnimateInEvent.fire();
-       this.animIn.animate();
-};
-
-/**
-* Triggers the out-animation.
-* @method animateOut
-*/
-YAHOO.widget.ContainerEffect.prototype.animateOut = function() {
-       this.beforeAnimateOutEvent.fire();
-       this.animOut.animate();
-};
-
-/**
-* The default onStart handler for the in-animation.
-* @method handleStartAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn = function(type, args, obj) { };
-/**
-* The default onTween handler for the in-animation.
-* @method handleTweenAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn = function(type, args, obj) { };
-/**
-* The default onComplete handler for the in-animation.
-* @method handleCompleteAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn = function(type, args, obj) { };
-
-/**
-* The default onStart handler for the out-animation.
-* @method handleStartAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut = function(type, args, obj) { };
-/**
-* The default onTween handler for the out-animation.
-* @method handleTweenAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut = function(type, args, obj) { };
-/**
-* The default onComplete handler for the out-animation.
-* @method handleCompleteAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut = function(type, args, obj) { };
-
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     The string representation of the ContainerEffect
-*/ 
-YAHOO.widget.ContainerEffect.prototype.toString = function() {
-       var output = "ContainerEffect";
-       if (this.overlay) {
-               output += " [" + this.overlay.toString() + "]";
-       }
-       return output;
-};
-
-/**
-* A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.
-* @method FADE
-* @static
-* @param {Overlay}     overlay The Overlay object to animate
-* @param {Number}      dur     The duration of the animation
-* @return {ContainerEffect}    The configured ContainerEffect object
-*/
-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");
-               }
-
-               if (obj.overlay.underlay) {
-                       obj.initialUnderlayOpacity = YAHOO.util.Dom.getStyle(obj.overlay.underlay, "opacity");
-                       obj.overlay.underlay.style.filter = null;
-               }
-
-               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;
-               }                       
-               
-               if (obj.overlay.underlay) {
-                       YAHOO.util.Dom.setStyle(obj.overlay.underlay, "opacity", obj.initialUnderlayOpacity);
-               }
-
-               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;
-               }                               
-               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;
-};
-
-
-/**
-* A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.
-* @method SLIDE
-* @static
-* @param {Overlay}     overlay The Overlay object to animate
-* @param {Number}      dur     The duration of the animation
-* @return {ContainerEffect}    The configured ContainerEffect object
-*/
-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");
-               }
-
-               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
+    Module.prototype = {
+    
+        /**
+        * The class's constructor function
+        * @property contructor
+        * @type Function
+        */
+        constructor: Module,
+        
+        /**
+        * The main module element that contains the header, body, and footer
+        * @property element
+        * @type HTMLElement
+        */
+        element: null,
+        
+        /**
+        * The header element, denoted with CSS class "hd"
+        * @property header
+        * @type HTMLElement
+        */
+        header: null,
+        
+        /**
+        * The body element, denoted with CSS class "bd"
+        * @property body
+        * @type HTMLElement
+        */
+        body: null,
+        
+        /**
+        * The footer element, denoted with CSS class "ft"
+        * @property footer
+        * @type HTMLElement
+        */
+        footer: null,
+        
+        /**
+        * The id of the element
+        * @property id
+        * @type String
+        */
+        id: null,
+        
+        /**
+        * A string representing the root path for all images created by
+        * a Module instance.
+        * @deprecated It is recommend that any images for a Module be applied
+        * via CSS using the "background-image" property.
+        * @property imageRoot
+        * @type String
+        */
+        imageRoot: Module.IMG_ROOT,
+    
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        * @method initEvents
+        */
+        initEvents: function () {
+        
+            var SIGNATURE = CustomEvent.LIST;
+        
+            /**
+            * CustomEvent fired prior to class initalization.
+            * @event beforeInitEvent
+            * @param {class} classRef class reference of the initializing 
+            * class, such as this.beforeInitEvent.fire(Module)
+            */
+            this.beforeInitEvent = this.createEvent(EVENT_TYPES.BEFORE_INIT);
+            this.beforeInitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after class initalization.
+            * @event initEvent
+            * @param {class} classRef class reference of the initializing 
+            * class, such as this.beforeInitEvent.fire(Module)
+            */  
+            this.initEvent = this.createEvent(EVENT_TYPES.INIT);
+            this.initEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the Module is appended to the DOM
+            * @event appendEvent
+            */
+            this.appendEvent = this.createEvent(EVENT_TYPES.APPEND);
+            this.appendEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired before the Module is rendered
+            * @event beforeRenderEvent
+            */
+            this.beforeRenderEvent = 
+                this.createEvent(EVENT_TYPES.BEFORE_RENDER);
+            this.beforeRenderEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is rendered
+            * @event renderEvent
+            */
+            this.renderEvent = this.createEvent(EVENT_TYPES.RENDER);
+            this.renderEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the header content of the Module 
+            * is modified
+            * @event changeHeaderEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new header content
+            */
+            this.changeHeaderEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_HEADER);
+            this.changeHeaderEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired when the body content of the Module is modified
+            * @event changeBodyEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new body content
+            */  
+            this.changeBodyEvent = this.createEvent(EVENT_TYPES.CHANGE_BODY);
+            this.changeBodyEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired when the footer content of the Module 
+            * is modified
+            * @event changeFooterEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new footer content
+            */
+            this.changeFooterEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
+            this.changeFooterEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the content of the Module is modified
+            * @event changeContentEvent
+            */
+            this.changeContentEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
+            this.changeContentEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the Module is destroyed
+            * @event destroyEvent
+            */
+            this.destroyEvent = this.createEvent(EVENT_TYPES.DESTORY);
+            this.destroyEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired before the Module is shown
+            * @event beforeShowEvent
+            */
+            this.beforeShowEvent = this.createEvent(EVENT_TYPES.BEFORE_SHOW);
+            this.beforeShowEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is shown
+            * @event showEvent
+            */
+            this.showEvent = this.createEvent(EVENT_TYPES.SHOW);
+            this.showEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired before the Module is hidden
+            * @event beforeHideEvent
+            */
+            this.beforeHideEvent = this.createEvent(EVENT_TYPES.BEFORE_HIDE);
+            this.beforeHideEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is hidden
+            * @event hideEvent
+            */
+            this.hideEvent = this.createEvent(EVENT_TYPES.HIDE);
+            this.hideEvent.signature = SIGNATURE;
+        }, 
+        
+        /**
+        * String representing the current user-agent platform
+        * @property platform
+        * @type String
+        */
+        platform: function () {
+        
+            var ua = navigator.userAgent.toLowerCase();
+        
+            if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
+        
+                return "windows";
+        
+            } else if (ua.indexOf("macintosh") != -1) {
+        
+                return "mac";
+        
+            } else {
+        
+                return false;
+        
+            }
+        
+        }(),
+        
+        /**
+        * String representing the user-agent of the browser
+        * @deprecated Use YAHOO.env.ua
+        * @property browser
+        * @type String
+        */
+        browser: function () {
+        
+            var ua = navigator.userAgent.toLowerCase();
+            
+            /*
+                 Check Opera first in case of spoof and check Safari before
+                 Gecko since Safari's user agent string includes "like Gecko"
+            */
+
+            if (ua.indexOf('opera') != -1) { 
+            
+                return 'opera';
+            
+            } else if (ua.indexOf('msie 7') != -1) {
+            
+                return 'ie7';
+            
+            } else if (ua.indexOf('msie') != -1) {
+            
+                return 'ie';
+            
+            } else if (ua.indexOf('safari') != -1) { 
+            
+                return 'safari';
+            
+            } else if (ua.indexOf('gecko') != -1) {
+            
+                return 'gecko';
+            
+            } else {
+            
+                return false;
+            
+            }
+        
+        }(),
+        
+        /**
+        * Boolean representing whether or not the current browsing context is 
+        * secure (https)
+        * @property isSecure
+        * @type Boolean
+        */
+        isSecure: function () {
+        
+            if (window.location.href.toLowerCase().indexOf("https") === 0) {
+        
+                return true;
+        
+            } else {
+        
+                return false;
+        
+            }
+        
+        }(),
+        
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        */
+        initDefaultConfig: function () {
+    
+            // Add properties //
+        
+            /**
+            * Specifies whether the Module is visible on the page.
+            * @config visible
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.VISIBLE.key, {
+                handler: this.configVisible, 
+                value: DEFAULT_CONFIG.VISIBLE.value, 
+                validator: DEFAULT_CONFIG.VISIBLE.validator
+            });
+            
+            /**
+            * Object or array of objects representing the ContainerEffect 
+            * classes that are active for animating the container.
+            * @config effect
+            * @type Object
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key, {
+                suppressEvent: DEFAULT_CONFIG.EFFECT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.EFFECT.supercedes
+            });
+            
+            /**
+            * Specifies whether to create a special proxy iframe to monitor 
+            * for user font resizing in the document
+            * @config monitorresize
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key, {
+                handler: this.configMonitorResize,
+                value: DEFAULT_CONFIG.MONITOR_RESIZE.value
+            });
+            
+        },
+        
+        /**
+        * 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.
+        * @method init
+        * @param {String} el The element ID representing the Module <em>OR</em>
+        * @param {HTMLElement} el The element representing the Module
+        * @param {Object} userConfig The configuration Object literal 
+        * containing the configuration that should be set for this module. 
+        * See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
+        
+            var elId, i, child;
+        
+            this.initEvents();
+        
+            this.beforeInitEvent.fire(Module);
+        
+            /**
+            * The Module's Config object used for monitoring 
+            * configuration properties.
+            * @property cfg
+            * @type YAHOO.util.Config
+            */
+            this.cfg = new Config(this);
+        
+            if (this.isSecure) {
+                this.imageRoot = Module.IMG_ROOT_SSL;
+            }
+        
+            if (typeof el == "string") {
+
+                elId = el;
+        
+                el = document.getElementById(el);
+
+                if (! el) {
+
+                    el = (createModuleTemplate()).cloneNode(false);
+
+                    el.id = elId;
+
+                }
+
+            }
+        
+            this.element = el;
+        
+            if (el.id) {
+                this.id = el.id;
+            }
+        
+            child = this.element.firstChild;
+            
+            if (child) {
+
+                do {
+
+                    switch (child.className) {
+    
+                    case Module.CSS_HEADER:
+    
+                        this.header = child;
+    
+                        break;
+    
+                    case Module.CSS_BODY:
+    
+                        this.body = child;
+    
+                        break;
+    
+                    case Module.CSS_FOOTER:
+    
+                        this.footer = child;
+    
+                        break;
+    
+                    }
+                    
+                } while ((child = child.nextSibling));
+            
+            }
+
+        
+            this.initDefaultConfig();
+        
+            Dom.addClass(this.element, Module.CSS_MODULE);
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+        
+            /*
+                Subscribe to the fireQueue() method of Config so that any 
+                queued configuration changes are excecuted upon render of 
+                the Module
+            */ 
+            
+            if (!Config.alreadySubscribed(this.renderEvent, 
+                this.cfg.fireQueue, this.cfg)) {
+
+                this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
+
+            }
+        
+            this.initEvent.fire(Module);
+        },
+        
+        /**
+        * Initialized an empty IFRAME that is placed out of the visible area 
+        * that can be used to detect text resize.
+        * @method initResizeMonitor
+        */
+        initResizeMonitor: function () {
+        
+            var oDoc, 
+                oIFrame, 
+                sHTML;
+        
+            function fireTextResize() {
+        
+                Module.textResizeEvent.fire();
+        
+            }
+        
+            if (!YAHOO.env.ua.opera) {
+        
+                oIFrame = Dom.get("_yuiResizeMonitor");
+        
+                if (!oIFrame) {
+        
+                    oIFrame = document.createElement("iframe");
+        
+                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && 
+                        YAHOO.env.ua.ie) {
+    
+                        oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL;
+    
+                    }
+
+
+                    /*
+                        Need to set "src" attribute of the iframe to 
+                        prevent the browser from reporting duplicate 
+                        cookies. (See SourceForge bug #1721755)
+                    */
+        
+                    if (YAHOO.env.ua.gecko) {
+
+                        sHTML = "<html><head><script " +
+                                "type=\"text/javascript\">" + 
+                                "window.onresize=function(){window.parent." +
+                                "YAHOO.widget.Module.textResizeEvent." +
+                                "fire();};window.parent.YAHOO.widget.Module." +
+                                "textResizeEvent.fire();</script></head>" + 
+                                "<body></body></html>";
+
+                        oIFrame.src = "data:text/html;charset=utf-8," + 
+                            encodeURIComponent(sHTML);
+
+                    }
+
+                    oIFrame.id = "_yuiResizeMonitor";
+                    
+                    /*
+                        Need to set "position" property before inserting the 
+                        iframe into the document or Safari's status bar will 
+                        forever indicate the iframe is loading 
+                        (See SourceForge bug #1723064)
+                    */
+                    
+                    oIFrame.style.position = "absolute";
+                    oIFrame.style.visibility = "hidden";
+        
+                    document.body.appendChild(oIFrame);
+        
+                    oIFrame.style.width = "10em";
+                    oIFrame.style.height = "10em";
+                    oIFrame.style.top = (-1 * oIFrame.offsetHeight) + "px";
+                    oIFrame.style.left = (-1 * oIFrame.offsetWidth) + "px";
+                    oIFrame.style.borderWidth = "0";
+                    oIFrame.style.visibility = "visible";
+        
+                    if (YAHOO.env.ua.webkit) {
+        
+                        oDoc = oIFrame.contentWindow.document;
+        
+                        oDoc.open();
+                        oDoc.close();
+        
+                    }
+
+                }
+        
+                if (oIFrame && oIFrame.contentWindow) {
+
+                    Module.textResizeEvent.subscribe(this.onDomResize, 
+                        this, true);
+        
+                    if (!Module.textResizeInitialized) {
+
+                        if (!Event.on(oIFrame.contentWindow, "resize", 
+                            fireTextResize)) {
+
+                            /*
+                                 This will fail in IE if document.domain has 
+                                 changed, so we must change the listener to 
+                                 use the oIFrame element instead
+                            */
+
+                            Event.on(oIFrame, "resize", fireTextResize);
+
+                        }
+
+                        Module.textResizeInitialized = true;
+
+                    }
+
+                    this.resizeMonitor = oIFrame;
+
+                }
+        
+            }
+        
+        },
+        
+        /**
+        * Event handler fired when the resize monitor element is resized.
+        * @method onDomResize
+        * @param {DOMEvent} e The DOM resize event
+        * @param {Object} obj The scope object passed to the handler
+        */
+        onDomResize: function (e, obj) {
+        
+            var nLeft = -1 * this.resizeMonitor.offsetWidth,
+                nTop = -1 * this.resizeMonitor.offsetHeight;
+        
+            this.resizeMonitor.style.top = nTop + "px";
+            this.resizeMonitor.style.left =  nLeft + "px";
+        
+        },
+        
+        /**
+        * Sets the Module's header content to the HTML specified, or appends 
+        * the passed element to the header. If no header is present, one will 
+        * be automatically created.
+        * @method setHeader
+        * @param {String} headerContent The HTML used to set the header 
+        * <em>OR</em>
+        * @param {HTMLElement} headerContent The HTMLElement to append to 
+        * the header
+        */
+        setHeader: function (headerContent) {
+
+            var oHeader = this.header || (this.header = createHeader());
+        
+            if (typeof headerContent == "string") {
+
+                oHeader.innerHTML = headerContent;
+
+            } else {
+
+                oHeader.innerHTML = "";
+                oHeader.appendChild(headerContent);
+
+            }
+        
+            this.changeHeaderEvent.fire(headerContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the header. If no header is present, 
+        * one will be automatically created.
+        * @method appendToHeader
+        * @param {HTMLElement} element The element to append to the header
+        */
+        appendToHeader: function (element) {
+
+            var oHeader = this.header || (this.header = createHeader());
+        
+            oHeader.appendChild(element);
+
+            this.changeHeaderEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Sets the Module's body content to the HTML specified, or appends the
+        * passed element to the body. If no body is present, one will be 
+        * automatically created.
+        * @method setBody
+        * @param {String} bodyContent The HTML used to set the body <em>OR</em>
+        * @param {HTMLElement} bodyContent The HTMLElement to append to the body
+        */
+        setBody: function (bodyContent) {
+
+            var oBody = this.body || (this.body = createBody());
+        
+            if (typeof bodyContent == "string") {
+
+                oBody.innerHTML = bodyContent;
+
+            } else {
+
+                oBody.innerHTML = "";
+                oBody.appendChild(bodyContent);
+
+            }
+        
+            this.changeBodyEvent.fire(bodyContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the body. If no body is present, one 
+        * will be automatically created.
+        * @method appendToBody
+        * @param {HTMLElement} element The element to append to the body
+        */
+        appendToBody: function (element) {
+
+            var oBody = this.body || (this.body = createBody());
+        
+            oBody.appendChild(element);
+
+            this.changeBodyEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * 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.
+        * @method setFooter
+        * @param {String} footerContent The HTML used to set the footer 
+        * <em>OR</em>
+        * @param {HTMLElement} footerContent The HTMLElement to append to 
+        * the footer
+        */
+        setFooter: function (footerContent) {
+
+            var oFooter = this.footer || (this.footer = createFooter());
+        
+            if (typeof footerContent == "string") {
+
+                oFooter.innerHTML = footerContent;
+
+            } else {
+
+                oFooter.innerHTML = "";
+                oFooter.appendChild(footerContent);
+
+            }
+        
+            this.changeFooterEvent.fire(footerContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the footer. If no footer is present, 
+        * one will be automatically created.
+        * @method appendToFooter
+        * @param {HTMLElement} element The element to append to the footer
+        */
+        appendToFooter: function (element) {
+
+            var oFooter = this.footer || (this.footer = createFooter());
+        
+            oFooter.appendChild(element);
+
+            this.changeFooterEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * 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.
+        * @method render
+        * @param {String} appendToNode The element id to which the Module 
+        * should be appended to prior to rendering <em>OR</em>
+        * @param {HTMLElement} appendToNode The element to which the Module 
+        * should be appended to prior to rendering
+        * @param {HTMLElement} moduleElement OPTIONAL. The element that 
+        * represents the actual Standard Module container.
+        * @return {Boolean} Success or failure of the render
+        */
+        render: function (appendToNode, moduleElement) {
+        
+            var me = this,
+                firstChild;
+        
+            function appendTo(element) {
+                if (typeof element == "string") {
+                    element = document.getElementById(element);
+                }
+        
+                if (element) {
+                    element.appendChild(me.element);
+                    me.appendEvent.fire();
+                }
+            }
+        
+            this.beforeRenderEvent.fire();
+        
+            if (! moduleElement) {
+                moduleElement = this.element;
+            }
+        
+            if (appendToNode) {
+
+                appendTo(appendToNode);
+
+            } else { 
+
+                /*
+                     No node was passed in. If the element is not already in 
+                     the Dom, this fails
+                */
+
+                if (! Dom.inDocument(this.element)) {
+
+                    YAHOO.log("Render failed. Must specify appendTo node if " + 
+                        " Module isn't already in the DOM.", "error");
+
+                    return false;
+
+                }
+
+            }
+        
+            // Need to get everything into the DOM if it isn't already
+        
+            if (this.header && ! Dom.inDocument(this.header)) {
+
+                /*
+                    There is a header, but it's not in the DOM yet... 
+                    need to add it
+                */
+
+                firstChild = moduleElement.firstChild;
+
+                if (firstChild) { // Insert before first child if exists
+
+                    moduleElement.insertBefore(this.header, firstChild);
+
+                } else { // Append to empty body because there are no children
+
+                    moduleElement.appendChild(this.header);
+
+                }
+
+            }
+        
+            if (this.body && ! Dom.inDocument(this.body)) {
+
+                /*
+                     There is a body, but it's not in the DOM yet... 
+                     need to add it
+                */
+
+
+                // Insert before footer if exists in DOM
+
+                if (this.footer && Dom.isAncestor(
+                    this.moduleElement, this.footer)) { 
+
+                    moduleElement.insertBefore(this.body, this.footer);
+
+                } else { // Append to element because there is no footer
+
+                    moduleElement.appendChild(this.body);
+
+                }
+
+            }
+        
+            if (this.footer && ! Dom.inDocument(this.footer)) {
+
+                /*
+                     There is a footer, but it's not in the DOM yet... 
+                     need to add it
+                */
+
+                moduleElement.appendChild(this.footer);
+
+            }
+        
+            this.renderEvent.fire();
+            return true;
+        },
+        
+        /**
+        * Removes the Module element from the DOM and sets all child elements 
+        * to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            var parent,
+                e;
+        
+            if (this.element) {
+                Event.purgeElement(this.element, true);
+                parent = this.element.parentNode;
+            }
+
+            if (parent) {
+                parent.removeChild(this.element);
+            }
+        
+            this.element = null;
+            this.header = null;
+            this.body = null;
+            this.footer = null;
+
+            Module.textResizeEvent.unsubscribe(this.onDomResize, this);
+
+            this.cfg.destroy();
+            this.cfg = null;
+
+            this.destroyEvent.fire();
+        
+            for (e in this) {
+                if (e instanceof CustomEvent) {
+                    e.unsubscribeAll();
+                }
+            }
+
+        },
+        
+        /**
+        * 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.
+        * @method show
+        */
+        show: function () {
+            this.cfg.setProperty("visible", true);
+        },
+        
+        /**
+        * 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.
+        * @method hide
+        */
+        hide: function () {
+            this.cfg.setProperty("visible", false);
+        },
+        
+        // BUILT-IN EVENT HANDLERS FOR MODULE //
+        
+        /**
+        * Default event handler for changing the visibility property of a 
+        * Module. By default, this is achieved by switching the "display" style 
+        * between "block" and "none".
+        * This method is responsible for firing showEvent and hideEvent.
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        * @method configVisible
+        */
+        configVisible: function (type, args, obj) {
+            var visible = args[0];
+            if (visible) {
+                this.beforeShowEvent.fire();
+                Dom.setStyle(this.element, "display", "block");
+                this.showEvent.fire();
+            } else {
+                this.beforeHideEvent.fire();
+                Dom.setStyle(this.element, "display", "none");
+                this.hideEvent.fire();
+            }
+        },
+        
+        /**
+        * Default event handler for the "monitorresize" configuration property
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        * @method configMonitorResize
+        */
+        configMonitorResize: function (type, args, obj) {
+
+            var monitor = args[0];
+
+            if (monitor) {
+
+                this.initResizeMonitor();
+
+            } else {
+
+                Module.textResizeEvent.unsubscribe(
+                    this.onDomResize, this, true);
+
+                this.resizeMonitor = null;
+            }
+
+        },
+        
+        /**
+        * Returns a String representation of the Object.
+        * @method toString
+        * @return {String} The string representation of the Module
+        */
+        toString: function () {
+            return "Module " + this.id;
+        }
+        
+    };
+    
+    YAHOO.lang.augmentProto(Module, YAHOO.util.EventProvider);
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Overlay
+    * @extends Module
+    * @param {String} el The element ID representing the Overlay <em>OR</em>
+    * @param {HTMLElement} el The element representing the Overlay
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Overlay. See configuration 
+    * documentation for more details.
+    * @constructor
+    */
+    YAHOO.widget.Overlay = function (el, userConfig) {
+    
+        YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
+    
+    };
+
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Module = YAHOO.widget.Module,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        Overlay = YAHOO.widget.Overlay,
+        
+        m_oIFrameTemplate,
+
+        /**
+        * Constant representing the name of the Overlay's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_MOVE": "beforeMove",
+            "MOVE": "move"
+        
+        },
+        
+        /**
+        * Constant representing the Overlay's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "X": { 
+                key: "x", 
+                validator: Lang.isNumber, 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "Y": { 
+                key: "y", 
+                validator: Lang.isNumber, 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "XY": { 
+                key: "xy", 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "CONTEXT": { 
+                key: "context", 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "FIXED_CENTER": { 
+                key: "fixedcenter", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["iframe", "visible"] 
+            },
+        
+            "WIDTH": { 
+                key: "width", 
+                suppressEvent: true, 
+                supercedes: ["context", "fixedcenter", "iframe"] 
+            }, 
+        
+            "HEIGHT": { 
+                key: "height", 
+                suppressEvent: true, 
+                supercedes: ["context", "fixedcenter", "iframe"] 
+            }, 
+        
+            "ZINDEX": { 
+                key: "zindex", 
+                value: null 
+            }, 
+        
+            "CONSTRAIN_TO_VIEWPORT": { 
+                key: "constraintoviewport", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["iframe", "x", "y", "xy"] 
+            }, 
+        
+            "IFRAME": { 
+                key: "iframe", 
+                value: (YAHOO.env.ua.ie == 6 ? true : false), 
+                validator: Lang.isBoolean, 
+                supercedes: ["zindex"] 
+            }
+        
+        };
+
+
+    /**
+    * The URL that will be placed in the iframe
+    * @property YAHOO.widget.Overlay.IFRAME_SRC
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.IFRAME_SRC = "javascript:false;";
+
+    /**
+    * Number representing how much the iframe shim should be offset from each 
+    * side of an Overlay instance.
+    * @property YAHOO.widget.Overlay.IFRAME_SRC
+    * @default 3
+    * @static
+    * @final
+    * @type Number
+    */
+    Overlay.IFRAME_OFFSET = 3;
+    
+    /**
+    * Constant representing the top left corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.TOP_LEFT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.TOP_LEFT = "tl";
+    
+    /**
+    * Constant representing the top right corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.TOP_RIGHT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.TOP_RIGHT = "tr";
+    
+    /**
+    * Constant representing the top bottom left corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.BOTTOM_LEFT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.BOTTOM_LEFT = "bl";
+    
+    /**
+    * Constant representing the bottom right corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.BOTTOM_RIGHT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.BOTTOM_RIGHT = "br";
+    
+    /**
+    * Constant representing the default CSS class used for an Overlay
+    * @property YAHOO.widget.Overlay.CSS_OVERLAY
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.CSS_OVERLAY = "yui-overlay";
+    
+    
+    /**
+    * A singleton CustomEvent used for reacting to the DOM event for 
+    * window scroll
+    * @event YAHOO.widget.Overlay.windowScrollEvent
+    */
+    Overlay.windowScrollEvent = new CustomEvent("windowScroll");
+    
+    /**
+    * A singleton CustomEvent used for reacting to the DOM event for
+    * window resize
+    * @event YAHOO.widget.Overlay.windowResizeEvent
+    */
+    Overlay.windowResizeEvent = new CustomEvent("windowResize");
+    
+    /**
+    * The DOM event handler used to fire the CustomEvent for window scroll
+    * @method YAHOO.widget.Overlay.windowScrollHandler
+    * @static
+    * @param {DOMEvent} e The DOM scroll event
+    */
+    Overlay.windowScrollHandler = function (e) {
+    
+        if (YAHOO.env.ua.ie) {
+    
+            if (! window.scrollEnd) {
+    
+                window.scrollEnd = -1;
+    
+            }
+    
+            clearTimeout(window.scrollEnd);
+    
+            window.scrollEnd = setTimeout(function () { 
+            
+                Overlay.windowScrollEvent.fire(); 
+    
+            }, 1);
+    
+        } else {
+    
+            Overlay.windowScrollEvent.fire();
+    
+        }
+    
+    };
+    
+    /**
+    * The DOM event handler used to fire the CustomEvent for window resize
+    * @method YAHOO.widget.Overlay.windowResizeHandler
+    * @static
+    * @param {DOMEvent} e The DOM resize event
+    */
+    Overlay.windowResizeHandler = function (e) {
+    
+        if (YAHOO.env.ua.ie) {
+    
+            if (! window.resizeEnd) {
+                window.resizeEnd = -1;
+            }
+    
+            clearTimeout(window.resizeEnd);
+    
+            window.resizeEnd = setTimeout(function () {
+    
+                Overlay.windowResizeEvent.fire(); 
+    
+            }, 100);
+    
+        } else {
+    
+            Overlay.windowResizeEvent.fire();
+    
+        }
+    
+    };
+    
+    /**
+    * A boolean that indicated whether the window resize and scroll events have 
+    * already been subscribed to.
+    * @property YAHOO.widget.Overlay._initialized
+    * @private
+    * @type Boolean
+    */
+    Overlay._initialized = null;
+    
+    if (Overlay._initialized === null) {
+    
+        Event.on(window, "scroll", Overlay.windowScrollHandler);
+        Event.on(window, "resize", Overlay.windowResizeHandler);
+    
+        Overlay._initialized = true;
+    
+    }
+    
+    YAHOO.extend(Overlay, Module, {
+    
+        /**
+        * The Overlay initialization method, which is executed for Overlay and  
+        * all of its subclasses. This method is automatically called by the 
+        * constructor, and  sets up all DOM references for pre-existing markup, 
+        * and creates required markup if it is not already present.
+        * @method init
+        * @param {String} el The element ID representing the Overlay <em>OR</em>
+        * @param {HTMLElement} el The element representing the Overlay
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Overlay. 
+        * See configuration documentation for more details.
+        */
+        init: function (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
+            */
+    
+            Overlay.superclass.init.call(this, el/*, userConfig*/);  
+            
+            this.beforeInitEvent.fire(Overlay);
+            
+            Dom.addClass(this.element, Overlay.CSS_OVERLAY);
+            
+            if (userConfig) {
+    
+                this.cfg.applyConfig(userConfig, true);
+    
+            }
+            
+            if (this.platform == "mac" && YAHOO.env.ua.gecko) {
+    
+                if (! Config.alreadySubscribed(this.showEvent,
+                    this.showMacGeckoScrollbars, this)) {
+    
+                    this.showEvent.subscribe(this.showMacGeckoScrollbars, 
+                        this, true);
+    
+                }
+    
+                if (! Config.alreadySubscribed(this.hideEvent, 
+                    this.hideMacGeckoScrollbars, this)) {
+    
+                    this.hideEvent.subscribe(this.hideMacGeckoScrollbars, 
+                        this, true);
+    
+                }
+    
+            }
+            
+            this.initEvent.fire(Overlay);
+        
+        },
+        
+        /**
+        * Initializes the custom events for Overlay which are fired  
+        * automatically at appropriate times by the Overlay class.
+        * @method initEvents
+        */
+        initEvents: function () {
+    
+            Overlay.superclass.initEvents.call(this);
+            
+            var SIGNATURE = CustomEvent.LIST;
+            
+            /**
+            * CustomEvent fired before the Overlay is moved.
+            * @event beforeMoveEvent
+            * @param {Number} x x coordinate
+            * @param {Number} y y coordinate
+            */
+            this.beforeMoveEvent = this.createEvent(EVENT_TYPES.BEFORE_MOVE);
+            this.beforeMoveEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired after the Overlay is moved.
+            * @event moveEvent
+            * @param {Number} x x coordinate
+            * @param {Number} y y coordinate
+            */
+            this.moveEvent = this.createEvent(EVENT_TYPES.MOVE);
+            this.moveEvent.signature = SIGNATURE;
+        
+        },
+        
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the Overlay's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+    
+            Overlay.superclass.initDefaultConfig.call(this);
+            
+            
+            // Add overlay config properties //
+            
+            /**
+            * The absolute x-coordinate position of the Overlay
+            * @config x
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.X.key, { 
+    
+                handler: this.configX, 
+                validator: DEFAULT_CONFIG.X.validator, 
+                suppressEvent: DEFAULT_CONFIG.X.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.X.supercedes
+    
+            });
+        
+    
+            /**
+            * The absolute y-coordinate position of the Overlay
+            * @config y
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.Y.key, {
+    
+                handler: this.configY, 
+                validator: DEFAULT_CONFIG.Y.validator, 
+                suppressEvent: DEFAULT_CONFIG.Y.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.Y.supercedes
+    
+            });
+        
+    
+            /**
+            * An array with the absolute x and y positions of the Overlay
+            * @config xy
+            * @type Number[]
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.XY.key, {
+            
+                handler: this.configXY, 
+                suppressEvent: DEFAULT_CONFIG.XY.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.XY.supercedes
+            
+            });
+        
+    
+            /**
+            * 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.
+            * @config context
+            * @type Array
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key, {
+            
+                handler: this.configContext, 
+                suppressEvent: DEFAULT_CONFIG.CONTEXT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.CONTEXT.supercedes
+            
+            });
+        
+    
+            /**
+            * True if the Overlay should be anchored to the center of 
+            * the viewport.
+            * @config fixedcenter
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key, {
+            
+                handler: this.configFixedCenter,
+                value: DEFAULT_CONFIG.FIXED_CENTER.value, 
+                validator: DEFAULT_CONFIG.FIXED_CENTER.validator, 
+                supercedes: DEFAULT_CONFIG.FIXED_CENTER.supercedes
+            
+            });
+        
+    
+            /**
+            * CSS width of the Overlay.
+            * @config width
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key, {
+            
+                handler: this.configWidth, 
+                suppressEvent: DEFAULT_CONFIG.WIDTH.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.WIDTH.supercedes
+            
+            });
+            
+            /**
+            * CSS height of the Overlay.
+            * @config height
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key, {
+            
+                handler: this.configHeight, 
+                suppressEvent: DEFAULT_CONFIG.HEIGHT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.HEIGHT.supercedes
+            
+            });
+            
+            /**
+            * CSS z-index of the Overlay.
+            * @config zIndex
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key, {
+    
+                handler: this.configzIndex,
+                value: DEFAULT_CONFIG.ZINDEX.value
+    
+            });
+            
+            /**
+            * True if the Overlay should be prevented from being positioned 
+            * out of the viewport.
+            * @config constraintoviewport
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, {
+            
+                handler: this.configConstrainToViewport, 
+                value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
+                validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
+                supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes
+            
+            });
+            
+            /**
+            * @config iframe
+            * @description Boolean indicating whether or not the Overlay should 
+            * have an IFRAME shim; used to prevent <SELECT> elements from 
+            * poking through an Overlay instance in IE6.  When set to "true", 
+            * the iframe shim is created when the Overlay instance is intially
+            * made visible.
+            * @type Boolean
+            * @default true for IE6 and below, false for all other browsers.
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key, {
+            
+                handler: this.configIframe, 
+                value: DEFAULT_CONFIG.IFRAME.value, 
+                validator: DEFAULT_CONFIG.IFRAME.validator, 
+                supercedes: DEFAULT_CONFIG.IFRAME.supercedes
+            
+            });
+        
+        },
+        
+        /**
+        * Moves the Overlay to the specified position. This function is  
+        * identical to calling this.cfg.setProperty("xy", [x,y]);
+        * @method moveTo
+        * @param {Number} x The Overlay's new x position
+        * @param {Number} y The Overlay's new y position
+        */
+        moveTo: function (x, y) {
+    
+            this.cfg.setProperty("xy", [x, y]);
+    
+        },
+        
+        /**
+        * Adds a CSS class ("hide-scrollbars") and removes a CSS class 
+        * ("show-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
+        * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435)
+        * @method hideMacGeckoScrollbars
+        */
+        hideMacGeckoScrollbars: function () {
+    
+            Dom.removeClass(this.element, "show-scrollbars");
+            Dom.addClass(this.element, "hide-scrollbars");
+    
+        },
+        
+        /**
+        * Adds a CSS class ("show-scrollbars") and removes a CSS class 
+        * ("hide-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
+        * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435)
+        * @method showMacGeckoScrollbars
+        */
+        showMacGeckoScrollbars: function () {
+    
+            Dom.removeClass(this.element, "hide-scrollbars");
+            Dom.addClass(this.element, "show-scrollbars");
+    
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the "visible" property is 
+        * changed.  This method is responsible for firing showEvent
+        * and hideEvent.
+        * @method configVisible
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configVisible: function (type, args, obj) {
+    
+            var visible = args[0],
+                currentVis = Dom.getStyle(this.element, "visibility"),
+                effect = this.cfg.getProperty("effect"),
+                effectInstances = [],
+                isMacGecko = (this.platform == "mac" && YAHOO.env.ua.gecko),
+                alreadySubscribed = Config.alreadySubscribed,
+                eff, ei, e, i, j, k, h,
+                nEffects,
+                nEffectInstances;
+    
+    
+            if (currentVis == "inherit") {
+    
+                e = this.element.parentNode;
+    
+                while (e.nodeType != 9 && e.nodeType != 11) {
+    
+                    currentVis = Dom.getStyle(e, "visibility");
+    
+                    if (currentVis != "inherit") { 
+    
+                        break; 
+    
+                    }
+    
+                    e = e.parentNode;
+    
+                }
+    
+                if (currentVis == "inherit") {
+    
+                    currentVis = "visible";
+                
+                }
+    
+            }
+        
+    
+            if (effect) {
+    
+                if (effect instanceof Array) {
+
+                    nEffects = effect.length;
+    
+                    for (i = 0; i < nEffects; i++) {
+    
+                        eff = effect[i];
+    
+                        effectInstances[effectInstances.length] = 
+                            eff.effect(this, eff.duration);
+    
+                    }
+    
+                } else {
+    
+                    effectInstances[effectInstances.length] = 
+                        effect.effect(this, effect.duration);
+    
+                }
+    
+            }
+    
+        
+            if (visible) { // Show
+    
+                if (isMacGecko) {
+    
+                    this.showMacGeckoScrollbars();
+    
+                }
+                
+    
+                if (effect) { // Animate in
+    
+    
+                    if (visible) { // Animate in if not showing
+    
+    
+                        if (currentVis != "visible" || currentVis === "") {
+    
+                            this.beforeShowEvent.fire();
+
+                            nEffectInstances = effectInstances.length;
+    
+                            for (j = 0; j < nEffectInstances; j++) {
+    
+                                ei = effectInstances[j];
+    
+                                if (j === 0 && !alreadySubscribed(
+                                        ei.animateInCompleteEvent, 
+                                        this.showEvent.fire, this.showEvent)) {
+    
+                                    /*
+                                         Delegate showEvent until end 
+                                         of animateInComplete
+                                    */
+    
+                                    ei.animateInCompleteEvent.subscribe(
+                                     this.showEvent.fire, this.showEvent, true);
+    
+                                }
+    
+                                ei.animateIn();
+    
+                            }
+    
+                        }
+    
+                    }
+    
+                } else { // Show
+    
+                    if (currentVis != "visible" || currentVis === "") {
+    
+                        this.beforeShowEvent.fire();
+    
+                        Dom.setStyle(this.element, "visibility", "visible");
+    
+                        this.cfg.refireEvent("iframe");
+                        this.showEvent.fire();
+    
+                    }
+        
+                }
+        
+            } else { // Hide
+    
+                if (isMacGecko) {
+    
+                    this.hideMacGeckoScrollbars();
+    
+                }
+                    
+                if (effect) { // Animate out if showing
+    
+                    if (currentVis == "visible") {
+    
+                        this.beforeHideEvent.fire();
+
+                        nEffectInstances = effectInstances.length;
+    
+                        for (k = 0; k < nEffectInstances; k++) {
+    
+                            h = effectInstances[k];
+    
+                            if (k === 0 && !alreadySubscribed(
+                                h.animateOutCompleteEvent, this.hideEvent.fire, 
+                                this.hideEvent)) {
+    
+                                /*
+                                     Delegate hideEvent until end 
+                                     of animateOutComplete
+                                */
+    
+                                h.animateOutCompleteEvent.subscribe(
+                                    this.hideEvent.fire, this.hideEvent, true);
+    
+                            }
+    
+                            h.animateOut();
+    
+                        }
+    
+                    } else if (currentVis === "") {
+    
+                        Dom.setStyle(this.element, "visibility", "hidden");
+    
+                    }
+    
+                } else { // Simple hide
+    
+                    if (currentVis == "visible" || currentVis === "") {
+    
+                        this.beforeHideEvent.fire();
+    
+                        Dom.setStyle(this.element, "visibility", "hidden");
+
+                        this.hideEvent.fire();
+    
+                    }
+    
+                }
+    
+            }
+    
+        },
+        
+        /**
+        * Center event handler used for centering on scroll/resize, but only if 
+        * the Overlay is visible
+        * @method doCenterOnDOMEvent
+        */
+        doCenterOnDOMEvent: function () {
+    
+            if (this.cfg.getProperty("visible")) {
+    
+                this.center();
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "fixedcenter" property 
+        * is changed.
+        * @method configFixedCenter
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configFixedCenter: function (type, args, obj) {
+    
+            var val = args[0],
+                alreadySubscribed = Config.alreadySubscribed,
+                windowResizeEvent = Overlay.windowResizeEvent,
+                windowScrollEvent = Overlay.windowScrollEvent;
+            
+            if (val) {
+    
+                this.center();
+            
+                if (!alreadySubscribed(this.beforeShowEvent, 
+                    this.center, this)) {
+    
+                    this.beforeShowEvent.subscribe(this.center);
+    
+                }
+            
+                if (!alreadySubscribed(windowResizeEvent, 
+                    this.doCenterOnDOMEvent, this)) {
+    
+                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, 
+                        this, true);
+    
+                }
+            
+                if (!alreadySubscribed(windowScrollEvent, 
+                    this.doCenterOnDOMEvent, this)) {
+        
+                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, 
+                        this, true);
+    
+                }
+    
+            } else {
+    
+                this.beforeShowEvent.unsubscribe(this.center);
+    
+                windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
+                windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "height" property is changed.
+        * @method configHeight
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configHeight: function (type, args, obj) {
+    
+            var height = args[0],
+                el = this.element;
+    
+            Dom.setStyle(el, "height", height);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "width" property is changed.
+        * @method configWidth
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configWidth: function (type, args, obj) {
+    
+            var width = args[0],
+                el = this.element;
+    
+            Dom.setStyle(el, "width", width);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "zIndex" property is changed.
+        * @method configzIndex
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configzIndex: function (type, args, obj) {
+    
+            var zIndex = args[0],
+                el = this.element;
+        
+            if (! zIndex) {
+    
+                zIndex = Dom.getStyle(el, "zIndex");
+        
+                if (! zIndex || isNaN(zIndex)) {
+    
+                    zIndex = 0;
+    
+                }
+    
+            }
+            
+            if (this.iframe) {
+    
+                if (zIndex <= 0) {
+    
+                    zIndex = 1;
+    
+                }
+    
+                Dom.setStyle(this.iframe, "zIndex", (zIndex - 1));
+            }
+            
+            Dom.setStyle(el, "zIndex", zIndex);
+            this.cfg.setProperty("zIndex", zIndex, true);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "xy" property is changed.
+        * @method configXY
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configXY: function (type, args, obj) {
+    
+            var pos = args[0],
+                x = pos[0],
+                y = pos[1];
+            
+            this.cfg.setProperty("x", x);
+            this.cfg.setProperty("y", y);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            YAHOO.log(("xy: " + [x, y]), "iframe");
+            
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "x" property is changed.
+        * @method configX
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configX: function (type, args, obj) {
+    
+            var x = args[0],
+                y = this.cfg.getProperty("y");
+            
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            Dom.setX(this.element, x, true);
+            
+            this.cfg.setProperty("xy", [x, y], true);
+           
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "y" property is changed.
+        * @method configY
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configY: function (type, args, obj) {
+    
+            var x = this.cfg.getProperty("x"),
+                y = args[0];
+        
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            Dom.setY(this.element, y, true);
+            
+            this.cfg.setProperty("xy", [x, y], true);
+            
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * Shows the iframe shim, if it has been enabled.
+        * @method showIframe
+        */
+        showIframe: function () {
+
+            var oIFrame = this.iframe,
+                oParentNode;
+
+            if (oIFrame) {
+    
+                oParentNode = this.element.parentNode;
+
+                if (oParentNode != oIFrame.parentNode) {
+
+                    oParentNode.appendChild(oIFrame);
+                
+                }
+
+                oIFrame.style.display = "block";
+    
+            }
+    
+        },
+        
+        /**
+        * Hides the iframe shim, if it has been enabled.
+        * @method hideIframe
+        */
+        hideIframe: function () {
+    
+            if (this.iframe) {
+    
+                this.iframe.style.display = "none";
+    
+            }
+    
+        },
+
+        /**
+        * Syncronizes the size and position of iframe shim to that of its 
+        * corresponding Overlay instance.
+        * @method syncIframe
+        */
+        syncIframe: function () {
+
+            var oIFrame = this.iframe,
+                oElement = this.element,
+                nOffset = Overlay.IFRAME_OFFSET,
+                nDimensionOffset = (nOffset * 2),
+                aXY;
+
+
+            if (oIFrame) {
+
+                // Size <iframe>
+
+                oIFrame.style.width = 
+                    (oElement.offsetWidth + nDimensionOffset + "px");
+
+                oIFrame.style.height = 
+                    (oElement.offsetHeight + nDimensionOffset + "px");
+
+
+                // Position <iframe>
+
+                aXY = this.cfg.getProperty("xy");
+
+                if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) {
+
+                    this.syncPosition();
+
+                    aXY = this.cfg.getProperty("xy");
+
+                }
+
+                Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]);
+
+            }
+        
+        },
+
+        
+        /**
+        * The default event handler fired when the "iframe" property is changed.
+        * @method configIframe
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configIframe: function (type, args, obj) {
+
+            var bIFrame = args[0];
+
+            function createIFrame() {
+
+                var oIFrame = this.iframe,
+                    oElement = this.element,
+                    oParent,
+                    aXY;
+
+
+                if (!oIFrame) {
+
+                    if (!m_oIFrameTemplate) {
+    
+                        m_oIFrameTemplate = document.createElement("iframe");
+
+                        if (this.isSecure) {
+        
+                            m_oIFrameTemplate.src = Overlay.IFRAME_SRC;
+        
+                        }
+
+                        /*
+                            Set the opacity of the <iframe> to 0 so that it 
+                            doesn't modify the opacity of any transparent 
+                            elements that may be on top of it (like a shadow).
+                        */
+        
+                        if (YAHOO.env.ua.ie) {
+        
+                            m_oIFrameTemplate.style.filter = "alpha(opacity=0)";
+        
+                            /*
+                                 Need to set the "frameBorder" property to 0 
+                                 supress the default <iframe> border in IE.  
+                                 Setting the CSS "border" property alone 
+                                 doesn't supress it.
+                            */
+        
+                            m_oIFrameTemplate.frameBorder = 0;
+        
+                        }
+                        else {
+        
+                            m_oIFrameTemplate.style.opacity = "0";
+                        
+                        }
+
+                        m_oIFrameTemplate.style.position = "absolute";
+                        m_oIFrameTemplate.style.border = "none";
+                        m_oIFrameTemplate.style.margin = "0";
+                        m_oIFrameTemplate.style.padding = "0";
+                        m_oIFrameTemplate.style.display = "none";
+    
+                    }
+
+                    oIFrame = m_oIFrameTemplate.cloneNode(false);
+
+                    oParent = oElement.parentNode;
+
+                    if (oParent) {
+
+                        oParent.appendChild(oIFrame);
+
+                    } else {
+
+                        document.body.appendChild(oIFrame);
+
+                    }
+                    
+                    this.iframe = oIFrame;
+
+                }
+
+
+                /*
+                     Show the <iframe> before positioning it since the "setXY" 
+                     method of DOM requires the element be in the document 
+                     and visible.
+                */
+
+                this.showIframe();
+
+
+                /*
+                     Syncronize the size and position of the <iframe> to that 
+                     of the Overlay.
+                */
+                
+                this.syncIframe();
+
+
+                // Add event listeners to update the <iframe> when necessary
+
+                if (!this._hasIframeEventListeners) {
+
+                    this.showEvent.subscribe(this.showIframe);
+                    this.hideEvent.subscribe(this.hideIframe);
+                    this.changeContentEvent.subscribe(this.syncIframe);
+
+                    this._hasIframeEventListeners = true;
+                    
+                }
+                
+            }
+
+
+            function onBeforeShow() {
+            
+                createIFrame.call(this);
+        
+                this.beforeShowEvent.unsubscribe(onBeforeShow);
+                
+                this._iframeDeferred = false;
+            
+            }
+            
+
+            if (bIFrame) { // <iframe> shim is enabled
+                
+                if (this.cfg.getProperty("visible")) {
+
+                    createIFrame.call(this);
+                
+                }
+                else {
+
+                    if (!this._iframeDeferred) {
+
+                        this.beforeShowEvent.subscribe(onBeforeShow);
+
+                        this._iframeDeferred = true;
+                    
+                    }
+                
+                }
+    
+            } else {    // <iframe> shim is disabled
+    
+                this.hideIframe();
+
+                if (this._hasIframeEventListeners) {
+
+                    this.showEvent.unsubscribe(this.showIframe);
+                    this.hideEvent.unsubscribe(this.hideIframe);
+                    this.changeContentEvent.unsubscribe(this.syncIframe);
+
+                    this._hasIframeEventListeners = false;
+
+                }
+                
+            }
+    
+        },
+        
+        
+        /**
+        * The default event handler fired when the "constraintoviewport" 
+        * property is changed.
+        * @method configConstrainToViewport
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for 
+        * the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configConstrainToViewport: function (type, args, obj) {
+    
+            var val = args[0];
+    
+            if (val) {
+    
+                if (! Config.alreadySubscribed(this.beforeMoveEvent, 
+                    this.enforceConstraints, this)) {
+    
+                    this.beforeMoveEvent.subscribe(this.enforceConstraints, 
+                        this, true);
+    
+                }
+    
+            } else {
+    
+                this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "context" property 
+        * is changed.
+        * @method configContext
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configContext: function (type, args, obj) {
+    
+            var contextArgs = args[0],
+                contextEl,
+                elementMagnetCorner,
+                contextMagnetCorner;
+            
+            if (contextArgs) {
+            
+                contextEl = contextArgs[0];
+                elementMagnetCorner = contextArgs[1];
+                contextMagnetCorner = contextArgs[2];
+                
+                if (contextEl) {
+    
+                    if (typeof contextEl == "string") {
+    
+                        this.cfg.setProperty("context", 
+                            [document.getElementById(contextEl), 
+                                elementMagnetCorner, contextMagnetCorner], 
+                                true);
+    
+                    }
+                    
+                    if (elementMagnetCorner && contextMagnetCorner) {
+    
+                        this.align(elementMagnetCorner, contextMagnetCorner);
+    
+                    }
+    
+                }
+    
+            }
+    
+        },
+        
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * Aligns the Overlay to its context element using the specified corner 
+        * points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, 
+        * and BOTTOM_RIGHT.
+        * @method align
+        * @param {String} elementAlign  The String representing the corner of 
+        * the Overlay that should be aligned to the context element
+        * @param {String} contextAlign  The corner of the context element 
+        * that the elementAlign corner should stick to.
+        */
+        align: function (elementAlign, contextAlign) {
+    
+            var contextArgs = this.cfg.getProperty("context"),
+                me = this,
+                context,
+                element,
+                contextRegion;
+    
+    
+            function doAlign(v, h) {
+    
+                switch (elementAlign) {
+    
+                case Overlay.TOP_LEFT:
+    
+                    me.moveTo(h, v);
+    
+                    break;
+    
+                case Overlay.TOP_RIGHT:
+    
+                    me.moveTo((h - element.offsetWidth), v);
+    
+                    break;
+    
+                case Overlay.BOTTOM_LEFT:
+    
+                    me.moveTo(h, (v - element.offsetHeight));
+    
+                    break;
+    
+                case Overlay.BOTTOM_RIGHT:
+    
+                    me.moveTo((h - element.offsetWidth), 
+                        (v - element.offsetHeight));
+    
+                    break;
+    
+                }
+    
+            }
+    
+    
+            if (contextArgs) {
+            
+                context = contextArgs[0];
+                element = this.element;
+                me = this;
+                
+                if (! elementAlign) {
+    
+                    elementAlign = contextArgs[1];
+    
+                }
+                
+                if (! contextAlign) {
+    
+                    contextAlign = contextArgs[2];
+    
+                }
+                
+                if (element && context) {
+    
+                    contextRegion = Dom.getRegion(context);
+                    
+                    switch (contextAlign) {
+    
+                    case Overlay.TOP_LEFT:
+    
+                        doAlign(contextRegion.top, contextRegion.left);
+    
+                        break;
+    
+                    case Overlay.TOP_RIGHT:
+    
+                        doAlign(contextRegion.top, contextRegion.right);
+    
+                        break;
+    
+                    case Overlay.BOTTOM_LEFT:
+    
+                        doAlign(contextRegion.bottom, contextRegion.left);
+    
+                        break;
+    
+                    case Overlay.BOTTOM_RIGHT:
+    
+                        doAlign(contextRegion.bottom, contextRegion.right);
+    
+                        break;
+    
+                    }
+    
+                }
+    
+            }
+            
+        },
+        
+        /**
+        * The default event handler executed when the moveEvent is fired, if the 
+        * "constraintoviewport" is set to true.
+        * @method enforceConstraints
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        enforceConstraints: function (type, args, obj) {
+    
+            var pos = args[0],
+                x = pos[0],
+                y = pos[1],
+                offsetHeight = this.element.offsetHeight,
+                offsetWidth = this.element.offsetWidth,
+                viewPortWidth = Dom.getViewportWidth(),
+                viewPortHeight = Dom.getViewportHeight(),
+                scrollX = Dom.getDocumentScrollLeft(),
+                scrollY = Dom.getDocumentScrollTop(),
+                topConstraint = scrollY + 10,
+                leftConstraint = scrollX + 10,
+                bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,
+                rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;
+        
+    
+            if (x < leftConstraint) {
+    
+                x = leftConstraint;
+    
+            } else if (x > rightConstraint) {
+    
+                x = rightConstraint;
+    
+            }
+            
+            if (y < topConstraint) {
+    
+                y = topConstraint;
+    
+            } else if (y > bottomConstraint) {
+    
+                y = bottomConstraint;
+    
+            }
+            
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            this.cfg.setProperty("xy", [x, y], true);
+    
+        },
+        
+        /**
+        * Centers the container in the viewport.
+        * @method center
+        */
+        center: function () {
+    
+            var scrollX = Dom.getDocumentScrollLeft(),
+                scrollY = Dom.getDocumentScrollTop(),
+    
+                viewPortWidth = Dom.getClientWidth(),
+                viewPortHeight = Dom.getClientHeight(),
+                elementWidth = this.element.offsetWidth,
+                elementHeight = this.element.offsetHeight,
+                x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX,
+                y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
+            
+            this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
+            
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * 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.
+        * @method syncPosition
+        */
+        syncPosition: function () {
+    
+            var pos = Dom.getXY(this.element);
+    
+            this.cfg.setProperty("x", pos[0], true);
+            this.cfg.setProperty("y", pos[1], true);
+            this.cfg.setProperty("xy", pos, true);
+    
+        },
+        
+        /**
+        * Event handler fired when the resize monitor element is resized.
+        * @method onDomResize
+        * @param {DOMEvent} e The resize DOM event
+        * @param {Object} obj The scope object
+        */
+        onDomResize: function (e, obj) {
+    
+            var me = this;
+    
+            Overlay.superclass.onDomResize.call(this, e, obj);
+    
+            setTimeout(function () {
+                me.syncPosition();
+                me.cfg.refireEvent("iframe");
+                me.cfg.refireEvent("context");
+            }, 0);
+    
+        },
+
+        /**
+        * Places the Overlay on top of all other instances of 
+        * YAHOO.widget.Overlay.
+        * @method bringToTop
+        */
+        bringToTop: function() {
+    
+            var aOverlays = [],
+                oElement = this.element;
+    
+            function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {
+        
+                var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
+        
+                    sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),
+        
+                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 
+                        0 : parseInt(sZIndex1, 10),
+        
+                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 
+                        0 : parseInt(sZIndex2, 10);
+        
+                if (nZIndex1 > nZIndex2) {
+        
+                    return -1;
+        
+                } else if (nZIndex1 < nZIndex2) {
+        
+                    return 1;
+        
+                } else {
+        
+                    return 0;
+        
+                }
+        
+            }
+        
+            function isOverlayElement(p_oElement) {
+        
+                var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
+                    Panel = YAHOO.widget.Panel;
+            
+                if (oOverlay && !Dom.isAncestor(oElement, oOverlay)) {
+                
+                    if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
+        
+                        aOverlays[aOverlays.length] = p_oElement.parentNode;
+                    
+                    }
+                    else {
+        
+                        aOverlays[aOverlays.length] = p_oElement;
+        
+                    }
+                
+                }
+            
+            }
+            
+            Dom.getElementsBy(isOverlayElement, "DIV", document.body);
+    
+            aOverlays.sort(compareZIndexDesc);
+            
+            var oTopOverlay = aOverlays[0],
+                nTopZIndex;
+            
+            if (oTopOverlay) {
+    
+                nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");
+    
+                if (!isNaN(nTopZIndex) && oTopOverlay != oElement) {
+    
+                    this.cfg.setProperty("zindex", 
+                        (parseInt(nTopZIndex, 10) + 2));
+    
+                }
+            
+            }
+        
+        },
+        
+        /**
+        * Removes the Overlay element from the DOM and sets all child 
+        * elements to null.
+        * @method destroy
+        */
+        destroy: function () {
+    
+            if (this.iframe) {
+    
+                this.iframe.parentNode.removeChild(this.iframe);
+    
+            }
+        
+            this.iframe = null;
+        
+            Overlay.windowResizeEvent.unsubscribe(
+                this.doCenterOnDOMEvent, this);
+    
+            Overlay.windowScrollEvent.unsubscribe(
+                this.doCenterOnDOMEvent, this);
+        
+            Overlay.superclass.destroy.call(this);
+        },
+        
+        /**
+        * Returns a String representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Overlay.
+        */
+        toString: function () {
+    
+            return "Overlay " + this.id;
+    
+        }
+    
+    });
+    
+}());
+(function () {
+    
+    /**
+    * OverlayManager is used for maintaining the focus status of 
+    * multiple Overlays.
+    * @namespace YAHOO.widget
+    * @namespace YAHOO.widget
+    * @class OverlayManager
+    * @constructor
+    * @param {Array} overlays Optional. A collection of Overlays to register 
+    * with the manager.
+    * @param {Object} userConfig  The object literal representing the user 
+    * configuration of the OverlayManager
+    */
+    YAHOO.widget.OverlayManager = function (userConfig) {
+    
+        this.init(userConfig);
+    
+    };
+
+
+    var Overlay = YAHOO.widget.Overlay,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        CustomEvent = YAHOO.util.CustomEvent,
+        OverlayManager = YAHOO.widget.OverlayManager;
+
+    
+    /**
+    * The CSS class representing a focused Overlay
+    * @property OverlayManager.CSS_FOCUSED
+    * @static
+    * @final
+    * @type String
+    */
+    OverlayManager.CSS_FOCUSED = "focused";
+    
+    OverlayManager.prototype = {
+    
+        /**
+        * The class's constructor function
+        * @property contructor
+        * @type Function
+        */
+        constructor: OverlayManager,
+        
+        /**
+        * The array of Overlays that are currently registered
+        * @property overlays
+        * @type YAHOO.widget.Overlay[]
+        */
+        overlays: null,
+        
+        /**
+        * Initializes the default configuration of the OverlayManager
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+        
+            /**
+            * The collection of registered Overlays in use by 
+            * the OverlayManager
+            * @config overlays
+            * @type YAHOO.widget.Overlay[]
+            * @default null
+            */
+            this.cfg.addProperty("overlays", { suppressEvent: true } );
+        
+            /**
+            * The default DOM event that should be used to focus an Overlay
+            * @config focusevent
+            * @type String
+            * @default "mousedown"
+            */
+            this.cfg.addProperty("focusevent", { value: "mousedown" } );
+        
+        },
+        
+        /**
+        * Initializes the OverlayManager
+        * @method init
+        * @param {Overlay[]} overlays Optional. A collection of Overlays to 
+        * register with the manager.
+        * @param {Object} userConfig  The object literal representing the user 
+        * configuration of the OverlayManager
+        */
+        init: function (userConfig) {
+
+            /**
+            * The OverlayManager's Config object used for monitoring 
+            * configuration properties.
+            * @property cfg
+            * @type Config
+            */
+            this.cfg = new Config(this);
+        
+            this.initDefaultConfig();
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+            this.cfg.fireQueue();
+        
+            /**
+            * The currently activated Overlay
+            * @property activeOverlay
+            * @private
+            * @type YAHOO.widget.Overlay
+            */
+            var activeOverlay = null;
+        
+            /**
+            * Returns the currently focused Overlay
+            * @method getActive
+            * @return {Overlay} The currently focused Overlay
+            */
+            this.getActive = function () {
+                return activeOverlay;
+            };
+        
+            /**
+            * Focuses the specified Overlay
+            * @method focus
+            * @param {Overlay} overlay The Overlay to focus
+            * @param {String} overlay The id of the Overlay to focus
+            */
+            this.focus = function (overlay) {
+        
+                var o = this.find(overlay);
+        
+                if (o) {
+        
+                    if (activeOverlay != o) {
+        
+                        if (activeOverlay) {
+        
+                            activeOverlay.blur();
+        
+                        }
+        
+                        this.bringToTop(o);
+                        
+                        activeOverlay = o;
+        
+                        Dom.addClass(activeOverlay.element, 
+                            OverlayManager.CSS_FOCUSED);
+
+                        o.focusEvent.fire();
+                        
+                    }
+        
+                }
+        
+            };
+        
+            /**
+            * Removes the specified Overlay from the manager
+            * @method remove
+            * @param {Overlay} overlay The Overlay to remove
+            * @param {String} overlay The id of the Overlay to remove
+            */
+            this.remove = function (overlay) {
+    
+                var o = this.find(overlay),
+                    originalZ;
+        
+                if (o) {
+
+                    if (activeOverlay == o) {
+                    
+                        activeOverlay = null;
+                    
+                    }
+
+                    originalZ = Dom.getStyle(o.element, "zIndex");
+
+                    o.cfg.setProperty("zIndex", -1000, true);
+
+                    this.overlays.sort(this.compareZIndexDesc);
+
+                    this.overlays = 
+                        this.overlays.slice(0, (this.overlays.length - 1));
+        
+                    o.hideEvent.unsubscribe(o.blur);
+                    o.destroyEvent.unsubscribe(this._onOverlayDestroy, o);
+        
+                    if (o.element) {
+        
+                        Event.removeListener(o.element, 
+                            this.cfg.getProperty("focusevent"), 
+                            this._onOverlayElementFocus);
+        
+                    }
+        
+                    o.cfg.setProperty("zIndex", originalZ, true);
+                    o.cfg.setProperty("manager", null);
+        
+                    o.focusEvent.unsubscribeAll();
+                    o.blurEvent.unsubscribeAll();
+        
+                    o.focusEvent = null;
+                    o.blurEvent = null;
+        
+                    o.focus = null;
+                    o.blur = null;
+                }
+
+            };
+        
+            /**
+            * Removes focus from all registered Overlays in the manager
+            * @method blurAll
+            */
+            this.blurAll = function () {
+    
+                var nOverlays = this.overlays.length,
+                    i;
+
+                if (nOverlays > 0) {
+
+                    i = nOverlays - 1;
+                    
+                    do {
+
+                        this.overlays[i].blur();                    
+                    
+                    }
+                    while(i--);
+                
+                }
+    
+            };
+        
+        
+            this._onOverlayBlur = function (p_sType, p_aArgs) {
+
+                activeOverlay = null;
+
+            };
+        
+        
+            var overlays = this.cfg.getProperty("overlays");
+        
+            if (! this.overlays) {
+                this.overlays = [];
+            }
+        
+            if (overlays) {
+                this.register(overlays);
+                this.overlays.sort(this.compareZIndexDesc);
+            }
+        },
+        
+        
+        /**
+        * @method _onOverlayElementFocus
+        * @description Event handler for the DOM event that is used to focus 
+        * the Overlay instance as specified by the "focusevent" 
+        * configuration property.
+        * @private
+        * @param {Event} p_oEvent Object representing the DOM event 
+        * object passed back by the event utility (Event).
+        */
+        _onOverlayElementFocus: function (p_oEvent) {
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                oClose = this.close;
+        
+            
+            if (oClose && (oTarget == oClose || 
+                    Dom.isAncestor(oClose, oTarget))) {
+            
+                this.blur();
+            
+            }
+            else {
+            
+                this.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOverlayDestroy
+        * @description "destroy" event handler for the Overlay.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {Overlay} p_oOverlay Object representing the menu that 
+        * fired the event.
+        */
+        _onOverlayDestroy: function (p_sType, p_aArgs, p_oOverlay) {
+        
+            this.remove(p_oOverlay);
+        
+        },
+        
+        /**
+        * 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.
+        * @method register
+        * @param {Overlay} overlay  An Overlay to register with the manager.
+        * @param {Overlay[]} overlay  An array of Overlays to register with 
+        * the manager.
+        * @return {Boolean} True if any Overlays are registered.
+        */
+        register: function (overlay) {
+        
+            var mgr = this,
+                zIndex,
+                regcount,
+                i,
+                nOverlays;
+        
+            if (overlay instanceof Overlay) {
+
+                overlay.cfg.addProperty("manager", { value: this } );
+        
+                overlay.focusEvent = overlay.createEvent("focus");
+                overlay.focusEvent.signature = CustomEvent.LIST;
+        
+                overlay.blurEvent = overlay.createEvent("blur");
+                overlay.blurEvent.signature = CustomEvent.LIST;
+        
+                overlay.focus = function () {
+                    mgr.focus(this);
+                };
+        
+                overlay.blur = function () {
+    
+                    if (mgr.getActive() == this) {
+
+                        Dom.removeClass(this.element, 
+                            OverlayManager.CSS_FOCUSED);
+
+                        this.blurEvent.fire();
+
+                    }
+
+                };
+        
+                overlay.blurEvent.subscribe(mgr._onOverlayBlur);
+        
+                overlay.hideEvent.subscribe(overlay.blur);
+                
+                overlay.destroyEvent.subscribe(this._onOverlayDestroy, 
+                    overlay, this);
+        
+                Event.on(overlay.element, this.cfg.getProperty("focusevent"), 
+                    this._onOverlayElementFocus, null, overlay);
+        
+                zIndex = Dom.getStyle(overlay.element, "zIndex");
+
+                if (!isNaN(zIndex)) {
+
+                    overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));
+
+                } else {
+
+                    overlay.cfg.setProperty("zIndex", 0);
+
+                }
+        
+
+                this.overlays.push(overlay);
+
+                this.bringToTop(overlay);
+
+                return true;
+
+            } else if (overlay instanceof Array) {
+
+                regcount = 0;
+                nOverlays = overlay.length;
+
+                for (i = 0; i < nOverlays; i++) {
+
+                    if (this.register(overlay[i])) {
+
+                        regcount++;
+
+                    }
+                }
+
+                if (regcount > 0) {
+
+                    return true;
+
+                }
+
+            } else {
+
+                return false;
+
+            }
+
+        },
+
+        /**
+        * Places the specified Overlay instance on top of all other 
+        * Overlay instances.
+        * @method bringToTop
+        * @param {YAHOO.widget.Overlay} p_oOverlay Object representing an 
+        * Overlay instance.
+        * @param {String} p_oOverlay String representing the id of an 
+        * Overlay instance.
+        */        
+        bringToTop: function (p_oOverlay) {
+
+            var oOverlay = this.find(p_oOverlay),
+                nTopZIndex,
+                oTopOverlay,
+                aOverlays;
+
+            if (oOverlay) {
+
+                aOverlays = this.overlays;
+
+                aOverlays.sort(this.compareZIndexDesc);
+                
+                oTopOverlay = aOverlays[0];
+                
+                if (oTopOverlay) {
+
+                    nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex");
+    
+                    if (!isNaN(nTopZIndex) && oTopOverlay != oOverlay) {
+    
+                        oOverlay.cfg.setProperty("zIndex", 
+                            (parseInt(nTopZIndex, 10) + 2));
+    
+                    }
+    
+                    aOverlays.sort(this.compareZIndexDesc);
+                
+                }
+
+            }
+        
+        },
+        
+        /**
+        * Attempts to locate an Overlay by instance or ID.
+        * @method find
+        * @param {Overlay} overlay  An Overlay to locate within the manager
+        * @param {String} overlay  An Overlay id to locate within the manager
+        * @return {Overlay} The requested Overlay, if found, or null if it 
+        * cannot be located.
+        */
+        find: function (overlay) {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+
+                i = nOverlays - 1;
+
+                if (overlay instanceof Overlay) {
+
+                    do {
+
+                        if (aOverlays[i] == overlay) {
+
+                            return aOverlays[i];
+
+                        }
+                    
+                    }
+                    while(i--);
+
+                } else if (typeof overlay == "string") {
+
+                    do {
+
+                        if (aOverlays[i].id == overlay) {
+
+                            return aOverlays[i];
+
+                        }
+
+                    }
+                    while(i--);
+
+                }
+
+                return null;
+            
+            }
+
+        },
+        
+        /**
+        * Used for sorting the manager's Overlays by z-index.
+        * @method compareZIndexDesc
+        * @private
+        * @return {Number} 0, 1, or -1, depending on where the Overlay should 
+        * fall in the stacking order.
+        */
+        compareZIndexDesc: function (o1, o2) {
+    
+            var zIndex1 = o1.cfg.getProperty("zIndex"),
+                zIndex2 = o2.cfg.getProperty("zIndex");
+        
+            if (zIndex1 > zIndex2) {
+                return -1;
+            } else if (zIndex1 < zIndex2) {
+                return 1;
+            } else {
+                return 0;
+            }
+        },
+        
+        /**
+        * Shows all Overlays in the manager.
+        * @method showAll
+        */
+        showAll: function () {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+            
+                i = nOverlays - 1;
+                
+                do {
+
+                    aOverlays[i].show();
+                
+                }
+                while(i--);
+            
+            }
+    
+        },
+        
+        /**
+        * Hides all Overlays in the manager.
+        * @method hideAll
+        */
+        hideAll: function () {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+            
+                i = nOverlays - 1;
+                
+                do {
+
+                    aOverlays[i].hide();
+                
+                }
+                while(i--);
+            
+            }
+    
+        },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the OverlayManager
+        */
+        toString: function () {
+            return "OverlayManager";
+        }
+    
+    };
+
+}());
+(function () {
+
+    /**
+    * ContainerEffect encapsulates animation transitions that are executed when 
+    * an Overlay is shown or hidden.
+    * @namespace YAHOO.widget
+    * @class ContainerEffect
+    * @constructor
+    * @param {YAHOO.widget.Overlay} overlay The Overlay that the animation 
+    * should be associated with
+    * @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. Easing.easeIn).
+    * @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. Easing.easeIn).
+    * @param {HTMLElement} targetElement Optional. The target element that  
+    * should be animated during the transition. Defaults to overlay.element.
+    * @param {class} Optional. The animation class to instantiate. Defaults to 
+    * YAHOO.util.Anim. Other options include YAHOO.util.Motion.
+    */
+    YAHOO.widget.ContainerEffect = 
+    
+        function (overlay, attrIn, attrOut, targetElement, animClass) {
+    
+        if (!animClass) {
+            animClass = YAHOO.util.Anim;
+        }
+        
+        /**
+        * The overlay to animate
+        * @property overlay
+        * @type YAHOO.widget.Overlay
+        */
+        this.overlay = overlay;
+    
+        /**
+        * The animation attributes to use when transitioning into view
+        * @property attrIn
+        * @type Object
+        */
+        this.attrIn = attrIn;
+    
+        /**
+        * The animation attributes to use when transitioning out of view
+        * @property attrOut
+        * @type Object
+        */
+        this.attrOut = attrOut;
+    
+        /**
+        * The target element to be animated
+        * @property targetElement
+        * @type HTMLElement
+        */
+        this.targetElement = targetElement || overlay.element;
+    
+        /**
+        * The animation class to use for animating the overlay
+        * @property animClass
+        * @type class
+        */
+        this.animClass = animClass;
+    
+    };
+
+
+    var Dom = YAHOO.util.Dom,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Easing = YAHOO.util.Easing,
+        ContainerEffect = YAHOO.widget.ContainerEffect;
+
+
+    /**
+    * A pre-configured ContainerEffect instance that can be used for fading 
+    * an overlay in and out.
+    * @method FADE
+    * @static
+    * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate
+    * @param {Number} dur The duration of the animation
+    * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
+    */
+    ContainerEffect.FADE = function (overlay, dur) {
+    
+        var fade = new ContainerEffect(overlay, 
+        
+            { attributes: { opacity: { from: 0, to: 1 } }, 
+                duration: dur, 
+                method: Easing.easeIn }, 
+            
+            { attributes: { opacity: { to: 0 } },
+                duration: dur, 
+                method: Easing.easeOut }, 
+            
+            overlay.element);
+        
+    
+        fade.handleStartAnimateIn = function (type,args,obj) {
+            Dom.addClass(obj.overlay.element, "hide-select");
+        
+            if (! obj.overlay.underlay) {
+                obj.overlay.cfg.refireEvent("underlay");
+            }
+        
+            if (obj.overlay.underlay) {
+    
+                obj.initialUnderlayOpacity = 
+                    Dom.getStyle(obj.overlay.underlay, "opacity");
+    
+                obj.overlay.underlay.style.filter = null;
+    
+            }
+        
+            Dom.setStyle(obj.overlay.element, "visibility", "visible");
+            Dom.setStyle(obj.overlay.element, "opacity", 0);
+        };
+        
+    
+        fade.handleCompleteAnimateIn = function (type,args,obj) {
+            Dom.removeClass(obj.overlay.element, "hide-select");
+        
+            if (obj.overlay.element.style.filter) {
+                obj.overlay.element.style.filter = null;
+            }
+        
+            if (obj.overlay.underlay) {
+                Dom.setStyle(obj.overlay.underlay, "opacity", 
+                    obj.initialUnderlayOpacity);
+            }
+        
+            obj.overlay.cfg.refireEvent("iframe");
+            obj.animateInCompleteEvent.fire();
+        };
+        
+    
+        fade.handleStartAnimateOut = function (type, args, obj) {
+            Dom.addClass(obj.overlay.element, "hide-select");
+        
+            if (obj.overlay.underlay) {
+                obj.overlay.underlay.style.filter = null;
+            }
+        };
+        
+    
+        fade.handleCompleteAnimateOut =  function (type, args, obj) {
+            Dom.removeClass(obj.overlay.element, "hide-select");
+            if (obj.overlay.element.style.filter) {
+                obj.overlay.element.style.filter = null;
+            }
+            Dom.setStyle(obj.overlay.element, "visibility", "hidden");
+            Dom.setStyle(obj.overlay.element, "opacity", 1);
+        
+            obj.overlay.cfg.refireEvent("iframe");
+        
+            obj.animateOutCompleteEvent.fire();
+        };
+        
+        fade.init();
+        return fade;
+    };
+    
+    
+    /**
+    * A pre-configured ContainerEffect instance that can be used for sliding an 
+    * overlay in and out.
+    * @method SLIDE
+    * @static
+    * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate
+    * @param {Number} dur The duration of the animation
+    * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
+    */
+    ContainerEffect.SLIDE = function (overlay, dur) {
+    
+        var x = overlay.cfg.getProperty("x") || Dom.getX(overlay.element),
+    
+            y = overlay.cfg.getProperty("y") || Dom.getY(overlay.element),
+    
+            clientWidth = Dom.getClientWidth(),
+    
+            offsetWidth = overlay.element.offsetWidth,
+    
+            slide = new ContainerEffect(overlay, 
+            
+            { attributes: { points: { to: [x, y] } },
+                duration: dur,
+                method: Easing.easeIn },
+    
+            { attributes: { points: { to: [(clientWidth + 25), y] } },
+                duration: dur,
+                method: Easing.easeOut },
+    
+            overlay.element, YAHOO.util.Motion);
+        
+        
+        slide.handleStartAnimateIn = function (type,args,obj) {
+            obj.overlay.element.style.left = ((-25) - offsetWidth) + "px";
+            obj.overlay.element.style.top  = y + "px";
+        };
+        
+        slide.handleTweenAnimateIn = function (type, args, obj) {
+        
+            var pos = Dom.getXY(obj.overlay.element),
+                currentX = pos[0],
+                currentY = pos[1];
+        
+            if (Dom.getStyle(obj.overlay.element, "visibility") == 
+                "hidden" && currentX < x) {
+
+                Dom.setStyle(obj.overlay.element, "visibility", "visible");
+
+            }
+        
+            obj.overlay.cfg.setProperty("xy", [currentX, currentY], true);
+            obj.overlay.cfg.refireEvent("iframe");
+        };
+        
+        slide.handleCompleteAnimateIn = function (type, args, obj) {
+            obj.overlay.cfg.setProperty("xy", [x, y], true);
+            obj.startX = x;
+            obj.startY = y;
+            obj.overlay.cfg.refireEvent("iframe");
+            obj.animateInCompleteEvent.fire();
+        };
+        
+        slide.handleStartAnimateOut = function (type, args, obj) {
+    
+            var vw = Dom.getViewportWidth(),
+                pos = Dom.getXY(obj.overlay.element),
+                yso = pos[1],
+                currentTo = obj.animOut.attributes.points.to;
+    
+            obj.animOut.attributes.points.to = [(vw + 25), yso];
+    
+        };
+        
+        slide.handleTweenAnimateOut = function (type, args, obj) {
+    
+            var pos = Dom.getXY(obj.overlay.element),
+                xto = pos[0],
+                yto = pos[1];
+        
+            obj.overlay.cfg.setProperty("xy", [xto, yto], true);
+            obj.overlay.cfg.refireEvent("iframe");
+        };
+        
+        slide.handleCompleteAnimateOut = function (type, args, obj) {
+            Dom.setStyle(obj.overlay.element, "visibility", "hidden");
+        
+            obj.overlay.cfg.setProperty("xy", [x, y]);
+            obj.animateOutCompleteEvent.fire();
+        };
+        
+        slide.init();
+        return slide;
+    };
+    
+    ContainerEffect.prototype = {
+    
+        /**
+        * Initializes the animation classes and events.
+        * @method init
+        */
+        init: function () {
+
+            this.beforeAnimateInEvent = this.createEvent("beforeAnimateIn");
+            this.beforeAnimateInEvent.signature = CustomEvent.LIST;
+            
+            this.beforeAnimateOutEvent = this.createEvent("beforeAnimateOut");
+            this.beforeAnimateOutEvent.signature = CustomEvent.LIST;
+        
+            this.animateInCompleteEvent = this.createEvent("animateInComplete");
+            this.animateInCompleteEvent.signature = CustomEvent.LIST;
+        
+            this.animateOutCompleteEvent = 
+                this.createEvent("animateOutComplete");
+            this.animateOutCompleteEvent.signature = CustomEvent.LIST;
+        
+            this.animIn = new this.animClass(this.targetElement, 
+                this.attrIn.attributes, this.attrIn.duration, 
+                this.attrIn.method);
+
+            this.animIn.onStart.subscribe(this.handleStartAnimateIn, this);
+            this.animIn.onTween.subscribe(this.handleTweenAnimateIn, this);
+
+            this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn, 
+                this);
+        
+            this.animOut = new this.animClass(this.targetElement, 
+                this.attrOut.attributes, this.attrOut.duration, 
+                this.attrOut.method);
+
+            this.animOut.onStart.subscribe(this.handleStartAnimateOut, this);
+            this.animOut.onTween.subscribe(this.handleTweenAnimateOut, this);
+            this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut, 
+                this);
+
+        },
+        
+        /**
+        * Triggers the in-animation.
+        * @method animateIn
+        */
+        animateIn: function () {
+            this.beforeAnimateInEvent.fire();
+            this.animIn.animate();
+        },
+        
+        /**
+        * Triggers the out-animation.
+        * @method animateOut
+        */
+        animateOut: function () {
+            this.beforeAnimateOutEvent.fire();
+            this.animOut.animate();
+        },
+        
+        /**
+        * The default onStart handler for the in-animation.
+        * @method handleStartAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleStartAnimateIn: function (type, args, obj) { },
+    
+        /**
+        * The default onTween handler for the in-animation.
+        * @method handleTweenAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleTweenAnimateIn: function (type, args, obj) { },
+    
+        /**
+        * The default onComplete handler for the in-animation.
+        * @method handleCompleteAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleCompleteAnimateIn: function (type, args, obj) { },
+        
+        /**
+        * The default onStart handler for the out-animation.
+        * @method handleStartAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleStartAnimateOut: function (type, args, obj) { },
+    
+        /**
+        * The default onTween handler for the out-animation.
+        * @method handleTweenAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleTweenAnimateOut: function (type, args, obj) { },
+    
+        /**
+        * The default onComplete handler for the out-animation.
+        * @method handleCompleteAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleCompleteAnimateOut: function (type, args, obj) { },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the ContainerEffect
+        */
+        toString: function () {
+            var output = "ContainerEffect";
+            if (this.overlay) {
+                output += " [" + this.overlay.toString() + "]";
+            }
+            return output;
+        }
+    
+    };
+
+    YAHOO.lang.augmentProto(ContainerEffect, YAHOO.util.EventProvider);
+
+})();
+YAHOO.register("container_core", YAHOO.widget.Module, {version: "2.3.0", build: "442"});
index e9c97b31e99465833718f9dc69203c534b140ea7..1151f46b0a74d8658644177d8cf0d790ffcf6586 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 
-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);}
-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;}}
-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]);}
-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]);}
-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;}
-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;}}}
-if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}
-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;}}}}}
-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;}
-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);}}
-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);}
-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()+"]";}
-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]+", ";}}
-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;}}
-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.textResizeEvent=new YAHOO.util.CustomEvent("textResize");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;}
-if(typeof el=="string"){var elId=el;el=document.getElementById(el);if(!el){el=document.createElement("DIV");el.id=elId;}}
+(function(){YAHOO.util.Config=function(owner){if(owner){this.init(owner);}
+if(!owner){}};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config;Config.CONFIG_CHANGED_EVENT="configChanged";Config.BOOLEAN_TYPE="boolean";Config.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(owner){this.owner=owner;this.configChangedEvent=this.createEvent(Config.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=CustomEvent.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(val){return(typeof val==Config.BOOLEAN_TYPE);},checkNumber:function(val){return(!isNaN(val));},fireEvent:function(key,value){var property=this.config[key];if(property&&property.event){property.event.fire(value);}},addProperty:function(key,propertyObject){key=key.toLowerCase();this.config[key]=propertyObject;propertyObject.event=this.createEvent(key,{scope:this.owner});propertyObject.event.signature=CustomEvent.LIST;propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner);}
+this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}},getConfig:function(){var cfg={},prop,property;for(prop in this.config){property=this.config[prop];if(property&&property.event){cfg[prop]=property.value;}}
+return cfg;},getProperty:function(key){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.value;}else{return undefined;}},resetProperty:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event){if(this.initialConfig[key]&&!Lang.isUndefined(this.initialConfig[key])){this.setProperty(key,this.initialConfig[key]);return true;}}else{return false;}},setProperty:function(key,value,silent){var property;key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{property=this.config[key];if(property&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){this.fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
+return true;}}else{return false;}}},queueProperty:function(key,value){key=key.toLowerCase();var property=this.config[key],foundDuplicate=false,iLen,queueItem,queueItemKey,queueItemValue,sLen,supercedesCheck,qLen,queueItemCheck,queueItemCheckKey,queueItemCheckValue,i,s,q;if(property&&property.event){if(!Lang.isUndefined(value)&&property.validator&&!property.validator(value)){return false;}else{if(!Lang.isUndefined(value)){property.value=value;}else{value=property.value;}
+foundDuplicate=false;iLen=this.eventQueue.length;for(i=0;i<iLen;i++){queueItem=this.eventQueue[i];if(queueItem){queueItemKey=queueItem[0];queueItemValue=queueItem[1];if(queueItemKey==key){this.eventQueue[i]=null;this.eventQueue.push([key,(!Lang.isUndefined(value)?value:queueItemValue)]);foundDuplicate=true;break;}}}
+if(!foundDuplicate&&!Lang.isUndefined(value)){this.eventQueue.push([key,value]);}}
+if(property.supercedes){sLen=property.supercedes.length;for(s=0;s<sLen;s++){supercedesCheck=property.supercedes[s];qLen=this.eventQueue.length;for(q=0;q<qLen;q++){queueItemCheck=this.eventQueue[q];if(queueItemCheck){queueItemCheckKey=queueItemCheck[0];queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey==supercedesCheck.toLowerCase()){this.eventQueue.push([queueItemCheckKey,queueItemCheckValue]);this.eventQueue[q]=null;break;}}}}}
+return true;}else{return false;}},refireEvent:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event&&!Lang.isUndefined(property.value)){if(this.queueInProgress){this.queueProperty(key);}else{this.fireEvent(key,property.value);}}},applyConfig:function(userConfig,init){var sKey,oValue,oConfig;if(init){oConfig={};for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){oConfig[sKey.toLowerCase()]=userConfig[sKey];}}
+this.initialConfig=oConfig;}
+for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){this.queueProperty(sKey,userConfig[sKey]);}}},refresh:function(){var prop;for(prop in this.config){this.refireEvent(prop);}},fireQueue:function(){var i,queueItem,key,value,property;this.queueInProgress=true;for(i=0;i<this.eventQueue.length;i++){queueItem=this.eventQueue[i];if(queueItem){key=queueItem[0];value=queueItem[1];property=this.config[key];property.value=value;this.fireEvent(key,value);}}
+this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(key,handler,obj,override){var property=this.config[key.toLowerCase()];if(property&&property.event){if(!Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
+return true;}else{return false;}},unsubscribeFromConfigEvent:function(key,handler,obj){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}},toString:function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
+return output;},outputEventQueue:function(){var output="",queueItem,q,nQueue=this.eventQueue.length;for(q=0;q<nQueue;q++){queueItem=this.eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
+return output;},destroy:function(){var oConfig=this.config,sProperty,oProperty;for(sProperty in oConfig){if(Lang.hasOwnProperty(oConfig,sProperty)){oProperty=oConfig[sProperty];oProperty.event.unsubscribeAll();oProperty.event=null;}}
+this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};Config.alreadySubscribed=function(evt,fn,obj){var nSubscribers=evt.subscribers.length,subsc,i;if(nSubscribers>0){i=nSubscribers-1;do{subsc=evt.subscribers[i];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
+while(i--);}
+return false;};YAHOO.lang.augmentProto(Config,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}else{}};var Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,m_oModuleTemplate,m_oHeaderTemplate,m_oBodyTemplate,m_oFooterTemplate,EVENT_TYPES={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},DEFAULT_CONFIG={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true}};Module.IMG_ROOT=null;Module.IMG_ROOT_SSL=null;Module.CSS_MODULE="yui-module";Module.CSS_HEADER="hd";Module.CSS_BODY="bd";Module.CSS_FOOTER="ft";Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";Module.textResizeEvent=new CustomEvent("textResize");function createModuleTemplate(){if(!m_oModuleTemplate){m_oModuleTemplate=document.createElement("div");m_oModuleTemplate.innerHTML=("<div class=\""+
+Module.CSS_HEADER+"\"></div>"+"<div class=\""+
+Module.CSS_BODY+"\"></div><div class=\""+
+Module.CSS_FOOTER+"\"></div>");m_oHeaderTemplate=m_oModuleTemplate.firstChild;m_oBodyTemplate=m_oHeaderTemplate.nextSibling;m_oFooterTemplate=m_oBodyTemplate.nextSibling;}
+return m_oModuleTemplate;}
+function createHeader(){if(!m_oHeaderTemplate){createModuleTemplate();}
+return(m_oHeaderTemplate.cloneNode(false));}
+function createBody(){if(!m_oBodyTemplate){createModuleTemplate();}
+return(m_oBodyTemplate.cloneNode(false));}
+function createFooter(){if(!m_oFooterTemplate){createModuleTemplate();}
+return(m_oFooterTemplate.cloneNode(false));}
+Module.prototype={constructor:Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:Module.IMG_ROOT,initEvents:function(){var SIGNATURE=CustomEvent.LIST;this.beforeInitEvent=this.createEvent(EVENT_TYPES.BEFORE_INIT);this.beforeInitEvent.signature=SIGNATURE;this.initEvent=this.createEvent(EVENT_TYPES.INIT);this.initEvent.signature=SIGNATURE;this.appendEvent=this.createEvent(EVENT_TYPES.APPEND);this.appendEvent.signature=SIGNATURE;this.beforeRenderEvent=this.createEvent(EVENT_TYPES.BEFORE_RENDER);this.beforeRenderEvent.signature=SIGNATURE;this.renderEvent=this.createEvent(EVENT_TYPES.RENDER);this.renderEvent.signature=SIGNATURE;this.changeHeaderEvent=this.createEvent(EVENT_TYPES.CHANGE_HEADER);this.changeHeaderEvent.signature=SIGNATURE;this.changeBodyEvent=this.createEvent(EVENT_TYPES.CHANGE_BODY);this.changeBodyEvent.signature=SIGNATURE;this.changeFooterEvent=this.createEvent(EVENT_TYPES.CHANGE_FOOTER);this.changeFooterEvent.signature=SIGNATURE;this.changeContentEvent=this.createEvent(EVENT_TYPES.CHANGE_CONTENT);this.changeContentEvent.signature=SIGNATURE;this.destroyEvent=this.createEvent(EVENT_TYPES.DESTORY);this.destroyEvent.signature=SIGNATURE;this.beforeShowEvent=this.createEvent(EVENT_TYPES.BEFORE_SHOW);this.beforeShowEvent.signature=SIGNATURE;this.showEvent=this.createEvent(EVENT_TYPES.SHOW);this.showEvent.signature=SIGNATURE;this.beforeHideEvent=this.createEvent(EVENT_TYPES.BEFORE_HIDE);this.beforeHideEvent.signature=SIGNATURE;this.hideEvent=this.createEvent(EVENT_TYPES.HIDE);this.hideEvent.signature=SIGNATURE;},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(DEFAULT_CONFIG.VISIBLE.key,{handler:this.configVisible,value:DEFAULT_CONFIG.VISIBLE.value,validator:DEFAULT_CONFIG.VISIBLE.validator});this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key,{suppressEvent:DEFAULT_CONFIG.EFFECT.suppressEvent,supercedes:DEFAULT_CONFIG.EFFECT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:DEFAULT_CONFIG.MONITOR_RESIZE.value});},init:function(el,userConfig){var elId,i,child;this.initEvents();this.beforeInitEvent.fire(Module);this.cfg=new Config(this);if(this.isSecure){this.imageRoot=Module.IMG_ROOT_SSL;}
+if(typeof el=="string"){elId=el;el=document.getElementById(el);if(!el){el=(createModuleTemplate()).cloneNode(false);el.id=elId;}}
 this.element=el;if(el.id){this.id=el.id;}
-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;}}}
-this.initDefaultConfig();YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
-if(!YAHOO.util.Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
-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;}
-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();}}
-var fireTextResize=function(){YAHOO.widget.Module.textResizeEvent.fire();};if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize,this,true);if(!YAHOO.widget.Module.textResizeInitialized){if(!YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",fireTextResize)){YAHOO.util.Event.addListener(this.resizeMonitor,"resize",fireTextResize);}
-YAHOO.widget.Module.textResizeInitialized=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;}
-if(typeof headerContent=="string"){this.header.innerHTML=headerContent;}else{this.header.innerHTML="";this.header.appendChild(headerContent);}
-this.changeHeaderEvent.fire(headerContent);this.changeContentEvent.fire();},appendToHeader:function(element){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}
-this.header.appendChild(element);this.changeHeaderEvent.fire(element);this.changeContentEvent.fire();},setBody:function(bodyContent){if(!this.body){this.body=document.createElement("DIV");this.body.className=YAHOO.widget.Module.CSS_BODY;}
-if(typeof bodyContent=="string")
-{this.body.innerHTML=bodyContent;}else{this.body.innerHTML="";this.body.appendChild(bodyContent);}
-this.changeBodyEvent.fire(bodyContent);this.changeContentEvent.fire();},appendToBody:function(element){if(!this.body){this.body=document.createElement("DIV");this.body.className=YAHOO.widget.Module.CSS_BODY;}
-this.body.appendChild(element);this.changeBodyEvent.fire(element);this.changeContentEvent.fire();},setFooter:function(footerContent){if(!this.footer){this.footer=document.createElement("DIV");this.footer.className=YAHOO.widget.Module.CSS_FOOTER;}
-if(typeof footerContent=="string"){this.footer.innerHTML=footerContent;}else{this.footer.innerHTML="";this.footer.appendChild(footerContent);}
-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;}
-this.footer.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
-var me=this;var appendTo=function(element){if(typeof element=="string"){element=document.getElementById(element);}
-if(element){element.appendChild(me.element);me.appendEvent.fire();}};if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}
-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);}}
-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);}}
-if(this.footer&&!YAHOO.util.Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
-this.renderEvent.fire();return true;},destroy:function(){var parent;if(this.element){YAHOO.util.Event.purgeElement(this.element,true);parent=this.element.parentNode;}
+child=this.element.firstChild;if(child){do{switch(child.className){case Module.CSS_HEADER:this.header=child;break;case Module.CSS_BODY:this.body=child;break;case Module.CSS_FOOTER:this.footer=child;break;}}while((child=child.nextSibling));}
+this.initDefaultConfig();Dom.addClass(this.element,Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
+if(!Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
+this.initEvent.fire(Module);},initResizeMonitor:function(){var oDoc,oIFrame,sHTML;function fireTextResize(){Module.textResizeEvent.fire();}
+if(!YAHOO.env.ua.opera){oIFrame=Dom.get("_yuiResizeMonitor");if(!oIFrame){oIFrame=document.createElement("iframe");if(this.isSecure&&Module.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){oIFrame.src=Module.RESIZE_MONITOR_SECURE_URL;}
+if(YAHOO.env.ua.gecko){sHTML="<html><head><script "+"type=\"text/javascript\">"+"window.onresize=function(){window.parent."+"YAHOO.widget.Module.textResizeEvent."+"fire();};window.parent.YAHOO.widget.Module."+"textResizeEvent.fire();</script></head>"+"<body></body></html>";oIFrame.src="data:text/html;charset=utf-8,"+
+encodeURIComponent(sHTML);}
+oIFrame.id="_yuiResizeMonitor";oIFrame.style.position="absolute";oIFrame.style.visibility="hidden";document.body.appendChild(oIFrame);oIFrame.style.width="10em";oIFrame.style.height="10em";oIFrame.style.top=(-1*oIFrame.offsetHeight)+"px";oIFrame.style.left=(-1*oIFrame.offsetWidth)+"px";oIFrame.style.borderWidth="0";oIFrame.style.visibility="visible";if(YAHOO.env.ua.webkit){oDoc=oIFrame.contentWindow.document;oDoc.open();oDoc.close();}}
+if(oIFrame&&oIFrame.contentWindow){Module.textResizeEvent.subscribe(this.onDomResize,this,true);if(!Module.textResizeInitialized){if(!Event.on(oIFrame.contentWindow,"resize",fireTextResize)){Event.on(oIFrame,"resize",fireTextResize);}
+Module.textResizeInitialized=true;}
+this.resizeMonitor=oIFrame;}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){var oHeader=this.header||(this.header=createHeader());if(typeof headerContent=="string"){oHeader.innerHTML=headerContent;}else{oHeader.innerHTML="";oHeader.appendChild(headerContent);}
+this.changeHeaderEvent.fire(headerContent);this.changeContentEvent.fire();},appendToHeader:function(element){var oHeader=this.header||(this.header=createHeader());oHeader.appendChild(element);this.changeHeaderEvent.fire(element);this.changeContentEvent.fire();},setBody:function(bodyContent){var oBody=this.body||(this.body=createBody());if(typeof bodyContent=="string"){oBody.innerHTML=bodyContent;}else{oBody.innerHTML="";oBody.appendChild(bodyContent);}
+this.changeBodyEvent.fire(bodyContent);this.changeContentEvent.fire();},appendToBody:function(element){var oBody=this.body||(this.body=createBody());oBody.appendChild(element);this.changeBodyEvent.fire(element);this.changeContentEvent.fire();},setFooter:function(footerContent){var oFooter=this.footer||(this.footer=createFooter());if(typeof footerContent=="string"){oFooter.innerHTML=footerContent;}else{oFooter.innerHTML="";oFooter.appendChild(footerContent);}
+this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){var oFooter=this.footer||(this.footer=createFooter());oFooter.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){var me=this,firstChild;function appendTo(element){if(typeof element=="string"){element=document.getElementById(element);}
+if(element){element.appendChild(me.element);me.appendEvent.fire();}}
+this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
+if(appendToNode){appendTo(appendToNode);}else{if(!Dom.inDocument(this.element)){return false;}}
+if(this.header&&!Dom.inDocument(this.header)){firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}
+if(this.body&&!Dom.inDocument(this.body)){if(this.footer&&Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}
+if(this.footer&&!Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
+this.renderEvent.fire();return true;},destroy:function(){var parent,e;if(this.element){Event.purgeElement(this.element,true);parent=this.element.parentNode;}
 if(parent){parent.removeChild(this.element);}
-this.element=null;this.header=null;this.body=null;this.footer=null;for(var e in this){if(e instanceof YAHOO.util.CustomEvent){e.unsubscribeAll();}}
-YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize,this);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.widget.Module.textResizeEvent.unsubscribe(this.onDomResize,this,true);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;";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);}
-if(this.platform=="mac"&&this.browser=="gecko"){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
-if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
-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;}
+this.element=null;this.header=null;this.body=null;this.footer=null;Module.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();for(e in this){if(e instanceof CustomEvent){e.unsubscribeAll();}}},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{Module.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(Module,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,Overlay=YAHOO.widget.Overlay,m_oIFrameTemplate,EVENT_TYPES={"BEFORE_MOVE":"beforeMove","MOVE":"move"},DEFAULT_CONFIG={"X":{key:"x",validator:Lang.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:Lang.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:Lang.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:Lang.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(YAHOO.env.ua.ie==6?true:false),validator:Lang.isBoolean,supercedes:["zindex"]}};Overlay.IFRAME_SRC="javascript:false;";Overlay.IFRAME_OFFSET=3;Overlay.TOP_LEFT="tl";Overlay.TOP_RIGHT="tr";Overlay.BOTTOM_LEFT="bl";Overlay.BOTTOM_RIGHT="br";Overlay.CSS_OVERLAY="yui-overlay";Overlay.windowScrollEvent=new CustomEvent("windowScroll");Overlay.windowResizeEvent=new CustomEvent("windowResize");Overlay.windowScrollHandler=function(e){if(YAHOO.env.ua.ie){if(!window.scrollEnd){window.scrollEnd=-1;}
+clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){Overlay.windowScrollEvent.fire();},1);}else{Overlay.windowScrollEvent.fire();}};Overlay.windowResizeHandler=function(e){if(YAHOO.env.ua.ie){if(!window.resizeEnd){window.resizeEnd=-1;}
+clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){Overlay.windowResizeEvent.fire();},100);}else{Overlay.windowResizeEvent.fire();}};Overlay._initialized=null;if(Overlay._initialized===null){Event.on(window,"scroll",Overlay.windowScrollHandler);Event.on(window,"resize",Overlay.windowResizeHandler);Overlay._initialized=true;}
+YAHOO.extend(Overlay,Module,{init:function(el,userConfig){Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(Overlay);Dom.addClass(this.element,Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
+if(this.platform=="mac"&&YAHOO.env.ua.gecko){if(!Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
+if(!Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
+this.initEvent.fire(Overlay);},initEvents:function(){Overlay.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.beforeMoveEvent=this.createEvent(EVENT_TYPES.BEFORE_MOVE);this.beforeMoveEvent.signature=SIGNATURE;this.moveEvent=this.createEvent(EVENT_TYPES.MOVE);this.moveEvent.signature=SIGNATURE;},initDefaultConfig:function(){Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.X.key,{handler:this.configX,validator:DEFAULT_CONFIG.X.validator,suppressEvent:DEFAULT_CONFIG.X.suppressEvent,supercedes:DEFAULT_CONFIG.X.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.Y.key,{handler:this.configY,validator:DEFAULT_CONFIG.Y.validator,suppressEvent:DEFAULT_CONFIG.Y.suppressEvent,supercedes:DEFAULT_CONFIG.Y.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.XY.key,{handler:this.configXY,suppressEvent:DEFAULT_CONFIG.XY.suppressEvent,supercedes:DEFAULT_CONFIG.XY.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key,{handler:this.configContext,suppressEvent:DEFAULT_CONFIG.CONTEXT.suppressEvent,supercedes:DEFAULT_CONFIG.CONTEXT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key,{handler:this.configFixedCenter,value:DEFAULT_CONFIG.FIXED_CENTER.value,validator:DEFAULT_CONFIG.FIXED_CENTER.validator,supercedes:DEFAULT_CONFIG.FIXED_CENTER.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key,{handler:this.configWidth,suppressEvent:DEFAULT_CONFIG.WIDTH.suppressEvent,supercedes:DEFAULT_CONFIG.WIDTH.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key,{handler:this.configHeight,suppressEvent:DEFAULT_CONFIG.HEIGHT.suppressEvent,supercedes:DEFAULT_CONFIG.HEIGHT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key,{handler:this.configzIndex,value:DEFAULT_CONFIG.ZINDEX.value});this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value,validator:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator,supercedes:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key,{handler:this.configIframe,value:DEFAULT_CONFIG.IFRAME.value,validator:DEFAULT_CONFIG.IFRAME.validator,supercedes:DEFAULT_CONFIG.IFRAME.supercedes});},moveTo:function(x,y){this.cfg.setProperty("xy",[x,y]);},hideMacGeckoScrollbars:function(){Dom.removeClass(this.element,"show-scrollbars");Dom.addClass(this.element,"hide-scrollbars");},showMacGeckoScrollbars:function(){Dom.removeClass(this.element,"hide-scrollbars");Dom.addClass(this.element,"show-scrollbars");},configVisible:function(type,args,obj){var visible=args[0],currentVis=Dom.getStyle(this.element,"visibility"),effect=this.cfg.getProperty("effect"),effectInstances=[],isMacGecko=(this.platform=="mac"&&YAHOO.env.ua.gecko),alreadySubscribed=Config.alreadySubscribed,eff,ei,e,i,j,k,h,nEffects,nEffectInstances;if(currentVis=="inherit"){e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}
 e=e.parentNode;}
 if(currentVis=="inherit"){currentVis="visible";}}
-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);}}
-var isMacGecko=(this.platform=="mac"&&this.browser=="gecko");if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
-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);}
-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();}
-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);}
-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);}
-if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
-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;}}
+if(effect){if(effect instanceof Array){nEffects=effect.length;for(i=0;i<nEffects;i++){eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
+if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
+if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();nEffectInstances=effectInstances.length;for(j=0;j<nEffectInstances;j++){ei=effectInstances[j];if(j===0&&!alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
+ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
+if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();nEffectInstances=effectInstances.length;for(k=0;k<nEffectInstances;k++){h=effectInstances[k];if(k===0&&!alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
+h.animateOut();}}else if(currentVis===""){Dom.setStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();Dom.setStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(type,args,obj){var val=args[0],alreadySubscribed=Config.alreadySubscribed,windowResizeEvent=Overlay.windowResizeEvent,windowScrollEvent=Overlay.windowScrollEvent;if(val){this.center();if(!alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}
+if(!alreadySubscribed(windowResizeEvent,this.doCenterOnDOMEvent,this)){windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
+if(!alreadySubscribed(windowScrollEvent,this.doCenterOnDOMEvent,this)){windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(type,args,obj){var height=args[0],el=this.element;Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");},configWidth:function(type,args,obj){var width=args[0],el=this.element;Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");},configzIndex:function(type,args,obj){var zIndex=args[0],el=this.element;if(!zIndex){zIndex=Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
 if(this.iframe){if(zIndex<=0){zIndex=1;}
-YAHOO.util.Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}
-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);}
-if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideIframe,this)){this.hideEvent.subscribe(this.hideIframe,this,true);}
-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");}
-if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=YAHOO.widget.Overlay.IFRAME_SRC;}
-var parent=this.element.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}
-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();}}
-var iframeDisplay=YAHOO.util.Dom.getStyle(this.iframe,"display");if(iframeDisplay=="none"){this.iframe.style.display="block";}
-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";}
-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);}
-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];}
+Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}
+Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);},configXY:function(type,args,obj){var pos=args[0],x=pos[0],y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configX:function(type,args,obj){var x=args[0],y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configY:function(type,args,obj){var x=this.cfg.getProperty("x"),y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},showIframe:function(){var oIFrame=this.iframe,oParentNode;if(oIFrame){oParentNode=this.element.parentNode;if(oParentNode!=oIFrame.parentNode){oParentNode.appendChild(oIFrame);}
+oIFrame.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var oIFrame=this.iframe,oElement=this.element,nOffset=Overlay.IFRAME_OFFSET,nDimensionOffset=(nOffset*2),aXY;if(oIFrame){oIFrame.style.width=(oElement.offsetWidth+nDimensionOffset+"px");oIFrame.style.height=(oElement.offsetHeight+nDimensionOffset+"px");aXY=this.cfg.getProperty("xy");if(!Lang.isArray(aXY)||(isNaN(aXY[0])||isNaN(aXY[1]))){this.syncPosition();aXY=this.cfg.getProperty("xy");}
+Dom.setXY(oIFrame,[(aXY[0]-nOffset),(aXY[1]-nOffset)]);}},configIframe:function(type,args,obj){var bIFrame=args[0];function createIFrame(){var oIFrame=this.iframe,oElement=this.element,oParent,aXY;if(!oIFrame){if(!m_oIFrameTemplate){m_oIFrameTemplate=document.createElement("iframe");if(this.isSecure){m_oIFrameTemplate.src=Overlay.IFRAME_SRC;}
+if(YAHOO.env.ua.ie){m_oIFrameTemplate.style.filter="alpha(opacity=0)";m_oIFrameTemplate.frameBorder=0;}
+else{m_oIFrameTemplate.style.opacity="0";}
+m_oIFrameTemplate.style.position="absolute";m_oIFrameTemplate.style.border="none";m_oIFrameTemplate.style.margin="0";m_oIFrameTemplate.style.padding="0";m_oIFrameTemplate.style.display="none";}
+oIFrame=m_oIFrameTemplate.cloneNode(false);oParent=oElement.parentNode;if(oParent){oParent.appendChild(oIFrame);}else{document.body.appendChild(oIFrame);}
+this.iframe=oIFrame;}
+this.showIframe();this.syncIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}
+function onBeforeShow(){createIFrame.call(this);this.beforeShowEvent.unsubscribe(onBeforeShow);this._iframeDeferred=false;}
+if(bIFrame){if(this.cfg.getProperty("visible")){createIFrame.call(this);}
+else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(onBeforeShow);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},configConstrainToViewport:function(type,args,obj){var val=args[0];if(val){if(!Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(type,args,obj){var contextArgs=args[0],contextEl,elementMagnetCorner,contextMagnetCorner;if(contextArgs){contextEl=contextArgs[0];elementMagnetCorner=contextArgs[1];contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
+if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}},align:function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context"),me=this,context,element,contextRegion;function doAlign(v,h){switch(elementAlign){case Overlay.TOP_LEFT:me.moveTo(h,v);break;case Overlay.TOP_RIGHT:me.moveTo((h-element.offsetWidth),v);break;case Overlay.BOTTOM_LEFT:me.moveTo(h,(v-element.offsetHeight));break;case Overlay.BOTTOM_RIGHT:me.moveTo((h-element.offsetWidth),(v-element.offsetHeight));break;}}
+if(contextArgs){context=contextArgs[0];element=this.element;me=this;if(!elementAlign){elementAlign=contextArgs[1];}
 if(!contextAlign){contextAlign=contextArgs[2];}
-if(element&&context){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;}
+if(element&&context){contextRegion=Dom.getRegion(context);switch(contextAlign){case Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}},enforceConstraints:function(type,args,obj){var pos=args[0],x=pos[0],y=pos[1],offsetHeight=this.element.offsetHeight,offsetWidth=this.element.offsetWidth,viewPortWidth=Dom.getViewportWidth(),viewPortHeight=Dom.getViewportHeight(),scrollX=Dom.getDocumentScrollLeft(),scrollY=Dom.getDocumentScrollTop(),topConstraint=scrollY+10,leftConstraint=scrollX+10,bottomConstraint=scrollY+viewPortHeight-offsetHeight-10,rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
 if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}
-this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);};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);}
-this.iframe=null;YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);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;}
-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;}
-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;}
-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);}
-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));}
-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=[];}
-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);}
-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++;}}
-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];}}}
-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;}
-var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
-if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
-function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
-if(!keyData.alt){keyData.alt=false;}
-if(!keyData.ctrl){keyData.ctrl=false;}
-if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
-this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
-this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
-this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
-this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};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()+"]";}
-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");}
-if(obj.overlay.underlay){obj.initialUnderlayOpacity=YAHOO.util.Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}
-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;}
-if(obj.overlay.underlay){YAHOO.util.Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
-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;}
-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");}
-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
+this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);},center:function(){var scrollX=Dom.getDocumentScrollLeft(),scrollY=Dom.getDocumentScrollTop(),viewPortWidth=Dom.getClientWidth(),viewPortHeight=Dom.getClientHeight(),elementWidth=this.element.offsetWidth,elementHeight=this.element.offsetHeight,x=(viewPortWidth/2)-(elementWidth/2)+scrollX,y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var pos=Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);},onDomResize:function(e,obj){var me=this;Overlay.superclass.onDomResize.call(this,e,obj);setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);},bringToTop:function(){var aOverlays=[],oElement=this.element;function compareZIndexDesc(p_oOverlay1,p_oOverlay2){var sZIndex1=Dom.getStyle(p_oOverlay1,"zIndex"),sZIndex2=Dom.getStyle(p_oOverlay2,"zIndex"),nZIndex1=(!sZIndex1||isNaN(sZIndex1))?0:parseInt(sZIndex1,10),nZIndex2=(!sZIndex2||isNaN(sZIndex2))?0:parseInt(sZIndex2,10);if(nZIndex1>nZIndex2){return-1;}else if(nZIndex1<nZIndex2){return 1;}else{return 0;}}
+function isOverlayElement(p_oElement){var oOverlay=Dom.hasClass(p_oElement,Overlay.CSS_OVERLAY),Panel=YAHOO.widget.Panel;if(oOverlay&&!Dom.isAncestor(oElement,oOverlay)){if(Panel&&Dom.hasClass(p_oElement,Panel.CSS_PANEL)){aOverlays[aOverlays.length]=p_oElement.parentNode;}
+else{aOverlays[aOverlays.length]=p_oElement;}}}
+Dom.getElementsBy(isOverlayElement,"DIV",document.body);aOverlays.sort(compareZIndexDesc);var oTopOverlay=aOverlays[0],nTopZIndex;if(oTopOverlay){nTopZIndex=Dom.getStyle(oTopOverlay,"zIndex");if(!isNaN(nTopZIndex)&&oTopOverlay!=oElement){this.cfg.setProperty("zindex",(parseInt(nTopZIndex,10)+2));}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
+this.iframe=null;Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);Overlay.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};var Overlay=YAHOO.widget.Overlay,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,CustomEvent=YAHOO.util.CustomEvent,OverlayManager=YAHOO.widget.OverlayManager;OverlayManager.CSS_FOCUSED="focused";OverlayManager.prototype={constructor:OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
+this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){if(activeOverlay!=o){if(activeOverlay){activeOverlay.blur();}
+this.bringToTop(o);activeOverlay=o;Dom.addClass(activeOverlay.element,OverlayManager.CSS_FOCUSED);o.focusEvent.fire();}}};this.remove=function(overlay){var o=this.find(overlay),originalZ;if(o){if(activeOverlay==o){activeOverlay=null;}
+originalZ=Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));o.hideEvent.unsubscribe(o.blur);o.destroyEvent.unsubscribe(this._onOverlayDestroy,o);if(o.element){Event.removeListener(o.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);}
+o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent.unsubscribeAll();o.blurEvent.unsubscribeAll();o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){var nOverlays=this.overlays.length,i;if(nOverlays>0){i=nOverlays-1;do{this.overlays[i].blur();}
+while(i--);}};this._onOverlayBlur=function(p_sType,p_aArgs){activeOverlay=null;};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}
+if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oClose=this.close;if(oClose&&(oTarget==oClose||Dom.isAncestor(oClose,oTarget))){this.blur();}
+else{this.focus();}},_onOverlayDestroy:function(p_sType,p_aArgs,p_oOverlay){this.remove(p_oOverlay);},register:function(overlay){var mgr=this,zIndex,regcount,i,nOverlays;if(overlay instanceof Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=overlay.createEvent("focus");overlay.focusEvent.signature=CustomEvent.LIST;overlay.blurEvent=overlay.createEvent("blur");overlay.blurEvent.signature=CustomEvent.LIST;overlay.focus=function(){mgr.focus(this);};overlay.blur=function(){if(mgr.getActive()==this){Dom.removeClass(this.element,OverlayManager.CSS_FOCUSED);this.blurEvent.fire();}};overlay.blurEvent.subscribe(mgr._onOverlayBlur);overlay.hideEvent.subscribe(overlay.blur);overlay.destroyEvent.subscribe(this._onOverlayDestroy,overlay,this);Event.on(overlay.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus,null,overlay);zIndex=Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}
+this.overlays.push(overlay);this.bringToTop(overlay);return true;}else if(overlay instanceof Array){regcount=0;nOverlays=overlay.length;for(i=0;i<nOverlays;i++){if(this.register(overlay[i])){regcount++;}}
+if(regcount>0){return true;}}else{return false;}},bringToTop:function(p_oOverlay){var oOverlay=this.find(p_oOverlay),nTopZIndex,oTopOverlay,aOverlays;if(oOverlay){aOverlays=this.overlays;aOverlays.sort(this.compareZIndexDesc);oTopOverlay=aOverlays[0];if(oTopOverlay){nTopZIndex=Dom.getStyle(oTopOverlay.element,"zIndex");if(!isNaN(nTopZIndex)&&oTopOverlay!=oOverlay){oOverlay.cfg.setProperty("zIndex",(parseInt(nTopZIndex,10)+2));}
+aOverlays.sort(this.compareZIndexDesc);}}},find:function(overlay){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;if(overlay instanceof Overlay){do{if(aOverlays[i]==overlay){return aOverlays[i];}}
+while(i--);}else if(typeof overlay=="string"){do{if(aOverlays[i].id==overlay){return aOverlays[i];}}
+while(i--);}
+return null;}},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex"),zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;do{aOverlays[i].show();}
+while(i--);}},hideAll:function(){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;do{aOverlays[i].hide();}
+while(i--);}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
+this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};var Dom=YAHOO.util.Dom,CustomEvent=YAHOO.util.CustomEvent,Easing=YAHOO.util.Easing,ContainerEffect=YAHOO.widget.ContainerEffect;ContainerEffect.FADE=function(overlay,dur){var fade=new ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
+if(obj.overlay.underlay){obj.initialUnderlayOpacity=Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}
+Dom.setStyle(obj.overlay.element,"visibility","visible");Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
+if(obj.overlay.underlay){Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
+obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}};fade.handleCompleteAnimateOut=function(type,args,obj){Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
+Dom.setStyle(obj.overlay.element,"visibility","hidden");Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||Dom.getX(overlay.element),y=overlay.cfg.getProperty("y")||Dom.getY(overlay.element),clientWidth=Dom.getClientWidth(),offsetWidth=overlay.element.offsetWidth,slide=new ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=((-25)-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";};slide.handleTweenAnimateIn=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),currentX=pos[0],currentY=pos[1];if(Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){Dom.setStyle(obj.overlay.element,"visibility","visible");}
+obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};slide.handleStartAnimateOut=function(type,args,obj){var vw=Dom.getViewportWidth(),pos=Dom.getXY(obj.overlay.element),yso=pos[1],currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),xto=pos[0],yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){Dom.setStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};ContainerEffect.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=CustomEvent.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=CustomEvent.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=CustomEvent.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=CustomEvent.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(type,args,obj){},handleTweenAnimateIn:function(type,args,obj){},handleCompleteAnimateIn:function(type,args,obj){},handleStartAnimateOut:function(type,args,obj){},handleTweenAnimateOut:function(type,args,obj){},handleCompleteAnimateOut:function(type,args,obj){},toString:function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
+return output;}};YAHOO.lang.augmentProto(ContainerEffect,YAHOO.util.EventProvider);})();YAHOO.register("container_core",YAHOO.widget.Module,{version:"2.3.0",build:"442"});
\ No newline at end of file
index ea494286399c2c685d2fbf7cde0c48fd4cd4a3c0..47d32703adfe8932a535e2a9679aaadd0b9de14d 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
-*/
-/**
-* 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.
-* @namespace YAHOO.util
-* @class Config
-* @constructor
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config = function(owner) {
-       if (owner) {
-               this.init(owner);
-       }
-};
-
-YAHOO.util.Config.prototype = {
-       
-       /**
-       * Object reference to the owner of this Config Object
-       * @property owner
-       * @type Object
-       */
-       owner : null,
-
-       /**
-       * Boolean flag that specifies whether a queue is currently being executed
-       * @property queueInProgress
-       * @type Boolean
-       */
-       queueInProgress : false,
-
-
-       /**
-       * Validates that the value passed in is a Boolean.
-       * @method checkBoolean
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */      
-       checkBoolean: function(val) {
-               if (typeof val == 'boolean') {
-                       return true;
-               } else {
-                       return false;
-               }
-       },
-
-       /**
-       * Validates that the value passed in is a number.
-       * @method checkNumber
-       * @param        {Object}        val     The value to validate
-       * @return       {Boolean}       true, if the value is valid
-       */
-       checkNumber: function(val) {
-               if (isNaN(val)) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-};
-
-
-/**
-* Initializes the configuration Object and all of its local members.
-* @method init
-* @param {Object}      owner   The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config.prototype.init = function(owner) {
-
-       this.owner = owner;
-
-       /**
-       * Object reference to the owner of this Config Object
-       * @event configChangedEvent
-       */
-       this.configChangedEvent = new YAHOO.util.CustomEvent("configChanged");
-
-       this.queueInProgress = false;
-
-       /* Private Members */
-
-       /**
-       * Maintains the local collection of configuration property objects and their specified values
-       * @property config
-       * @private
-       * @type Object
-       */ 
-       var config = {};
-
-       /**
-       * Maintains the local collection of configuration property objects as they were initially applied.
-       * This object is used when resetting a property.
-       * @property initialConfig
-       * @private
-       * @type Object
-       */ 
-       var initialConfig = {};
-
-       /**
-       * Maintains the local, normalized CustomEvent queue
-       * @property eventQueue
-       * @private
-       * @type Object
-       */ 
-       var eventQueue = [];
-
-       /**
-       * Fires a configuration property event using the specified value. 
-       * @method fireEvent
-       * @private
-       * @param {String}       key                     The configuration property's name
-       * @param {value}        Object          The value of the correct type for the property
-       */ 
-       var fireEvent = function( key, value ) {
-               key = key.toLowerCase();
-
-               var property = config[key];
-
-               if (typeof property != 'undefined' && property.event) {
-                       property.event.fire(value);
-               }       
-       };
-       /* End Private Members */
-
-       /**
-       * Adds a property to the Config Object's private config hash.
-       * @method addProperty
-       * @param {String}       key     The configuration property's name
-       * @param {Object}       propertyObject  The Object containing all of this property's arguments
-       */
-       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);
-               }
-
-               this.setProperty(key, propertyObject.value, true);
-               
-               if (! propertyObject.suppressEvent) {
-                       this.queueProperty(key, propertyObject.value);
-               }
-       };
-
-       /**
-       * Returns a key-value configuration map of the values currently set in the Config Object.
-       * @method getConfig
-       * @return {Object} The current config, represented in a key-value map
-       */
-       this.getConfig = function() {
-               var cfg = {};
-                       
-               for (var prop in config) {
-                       var property = config[prop];
-                       if (typeof property != 'undefined' && property.event) {
-                               cfg[prop] = property.value;
-                       }
-               }
-               
-               return cfg;
-       };
-
-       /**
-       * Returns the value of specified property.
-       * @method getProperty
-       * @param {String} key   The name of the property
-       * @return {Object}              The value of the specified property
-       */
-       this.getProperty = function(key) {
-               key = key.toLowerCase();
-
-               var property = config[key];
-               if (typeof property != 'undefined' && property.event) {
-                       return property.value;
-               } else {
-                       return undefined;
-               }
-       };
-
-       /**
-       * Resets the specified property's value to its initial value.
-       * @method resetProperty
-       * @param {String} key   The name of the property
-       * @return {Boolean} True is the property was reset, false if not
-       */
-       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]);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.
-       * @method setProperty
-       * @param {String} key           The name of the property
-       * @param {String} value         The value to set the property to
-       * @param {Boolean} silent       Whether the value should be set silently, without firing the property event.
-       * @return {Boolean}                     True, if the set was successful, false if it failed.
-       */
-       this.setProperty = function(key, value, silent) {
-               key = key.toLowerCase();
-
-               if (this.queueInProgress && ! silent) {
-                       this.queueProperty(key,value); // Currently running through a queue... 
-                       return true;
-               } else {
-                       var property = config[key];
-                       if (typeof property != 'undefined' && property.event) {
-                               if (property.validator && ! property.validator(value)) { // validator
-                                       return false;
-                               } else {
-                                       property.value = value;
-                                       if (! silent) {
-                                               fireEvent(key, value);
-                                               this.configChangedEvent.fire([key, value]);
-                                       }
-                                       return true;
-                               }
-                       } else {
-                               return false;
-                       }
-               }
-       };
-
-       /**
-       * Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is
-       * moved from its current position to the end of the queue.
-       * @method queueProperty
-       * @param {String} key   The name of the property
-       * @param {String} value The value to set the property to
-       * @return {Boolean}             true, if the set was successful, false if it failed.
-       */      
-       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)) { // validator
-                               return false;
-                       } else {
-
-                               if (typeof value != 'undefined') {
-                                       property.value = value;
-                               } else {
-                                       value = property.value;
-                               }
-
-                               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) {
-                                                       // found a dupe... push to end of queue, null current item, and break
-                                                       eventQueue[i] = null;
-                                                       eventQueue.push([key, (typeof value != 'undefined' ? value : queueItemValue)]);
-                                                       foundDuplicate = true;
-                                                       break;
-                                               }
-                                       }
-                               }
-                               
-                               if (! foundDuplicate && typeof value != 'undefined') { // this is a refire, or a new property in the queue
-                                       eventQueue.push([key, value]);
-                               }
-                       }
-
-                       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;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Fires the event for a property using the property's current value.
-       * @method refireEvent
-       * @param {String} key   The name of the property
-       */
-       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);
-                       }
-               }
-       };
-
-       /**
-       * Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.
-       * Although the values will be set, fireQueue() must be called for their associated events to execute.
-       * @method applyConfig
-       * @param {Object}       userConfig      The configuration Object literal
-       * @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.
-       */
-       this.applyConfig = function(userConfig, init) {
-               if (init) {
-                       initialConfig = userConfig;
-               }
-               for (var prop in userConfig) {
-                       this.queueProperty(prop, userConfig[prop]);
-               }
-       };
-
-       /**
-       * Refires the events for all configuration properties using their current values.
-       * @method refresh
-       */
-       this.refresh = function() {
-               for (var prop in config) {
-                       this.refireEvent(prop);
-               }
-       };
-
-       /**
-       * Fires the normalized list of queued property change events
-       * @method fireQueue
-       */
-       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);
-                       }
-               }
-               
-               this.queueInProgress = false;
-               eventQueue = [];
-       };
-
-       /**
-       * Subscribes an external handler to the change event for any given property. 
-       * @method subscribeToConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @param {Boolean}      override        Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.
-       * @return {Boolean}                             True, if the subscription was successful, otherwise false.
-       */      
-       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);
-                       }
-                       return true;
-               } else {
-                       return false;
-               }
-       };
-
-       /**
-       * Unsubscribes an external handler from the change event for any given property. 
-       * @method unsubscribeFromConfigEvent
-       * @param {String}       key                     The property name
-       * @param {Function}     handler         The handler function to use subscribe to the property's event
-       * @param {Object}       obj                     The Object to use for scoping the event handler (see CustomEvent documentation)
-       * @return {Boolean}                             True, if the unsubscription was successful, otherwise 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;
-               }
-       };
-
-       /**
-       * Returns a string representation of the Config object
-       * @method toString
-       * @return {String}      The Config object in string format.
-       */
-       this.toString = function() {
-               var output = "Config";
-               if (this.owner) {
-                       output += " [" + this.owner.toString() + "]";
-               }
-               return output;
-       };
-
-       /**
-       * Returns a string representation of the Config object's current CustomEvent queue
-       * @method outputEventQueue
-       * @return {String}      The string list of CustomEvents currently queued for execution
-       */
-       this.outputEventQueue = function() {
-               var output = "";
-               for (var q=0;q<eventQueue.length;q++) {
-                       var queueItem = eventQueue[q];
-                       if (queueItem) {
-                               output += queueItem[0] + "=" + queueItem[1] + ", ";
-                       }
-               }
-               return output;
-       };
-};
-
-/**
-* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent
-* @method YAHOO.util.Config.alreadySubscribed
-* @static
-* @param {YAHOO.util.CustomEvent} evt  The CustomEvent for which to check the subscriptions
-* @param {Function}    fn      The function to look for in the subscribers list
-* @param {Object}      obj     The execution scope Object for the subscription
-* @return {Boolean}    true, if the function/Object pair is already subscribed to the CustomEvent passed in
-*/
-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;
-               }
-       }
-       return false;
-};
-
-/**
-*  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.
-* @module container
-* @title Container
-* @requires yahoo,dom,event,dragdrop,animation
+version: 2.3.0
 */
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.util
+    * @class Config
+    * @constructor
+    * @param {Object} owner The owner Object to which this Config Object belongs
+    */
+    YAHOO.util.Config = function (owner) {
+    
+        if (owner) {
+    
+            this.init(owner);
+    
+        }
+    
+        if (!owner) { 
+        
+    
+        }
+    
+    };
 
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Module
-* @constructor
-* @param {String} el                   The element ID representing the Module <em>OR</em>
-* @param {HTMLElement} el              The element representing the Module
-* @param {Object} userConfig   The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
-*/
-YAHOO.widget.Module = function(el, userConfig) {
-       if (el) { 
-               this.init(el, userConfig); 
-       }
-};
-
-/**
-* Constant representing the prefix path to use for non-secure images
-* @property YAHOO.widget.Module.IMG_ROOT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.IMG_ROOT = "http://us.i1.yimg.com/us.yimg.com/i/";
-
-/**
-* Constant representing the prefix path to use for securely served images
-* @property YAHOO.widget.Module.IMG_ROOT_SSL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.IMG_ROOT_SSL = "https://a248.e.akamai.net/sec.yimg.com/i/";
-
-/**
-* Constant for the default CSS class name that represents a Module
-* @property YAHOO.widget.Module.CSS_MODULE
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_MODULE = "module";
-
-/**
-* Constant representing the module header
-* @property YAHOO.widget.Module.CSS_HEADER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_HEADER = "hd";
-
-/**
-* Constant representing the module body
-* @property YAHOO.widget.Module.CSS_BODY
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_BODY = "bd";
-
-/**
-* Constant representing the module footer
-* @property YAHOO.widget.Module.CSS_FOOTER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_FOOTER = "ft";
-
-/**
-* Constant representing the url for the "src" attribute of the iframe used to monitor changes to the browser's base font size
-* @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";
-
-/**
-* Singleton CustomEvent fired when the font size is changed in the browser.
-* Opera's "zoom" functionality currently does not support text size detection.
-* @event YAHOO.widget.Module.textResizeEvent
-*/     
-YAHOO.widget.Module.textResizeEvent = new YAHOO.util.CustomEvent("textResize");
-
-YAHOO.widget.Module.prototype = {
-       /**
-       * The class's constructor function
-       * @property contructor
-       * @type Function
-       */
-       constructor : YAHOO.widget.Module,
-
-       /**
-       * The main module element that contains the header, body, and footer
-       * @property element
-       * @type HTMLElement
-       */
-       element : null, 
-
-       /**
-       * The header element, denoted with CSS class "hd"
-       * @property header
-       * @type HTMLElement
-       */
-       header : null,
-
-       /**
-       * The body element, denoted with CSS class "bd"
-       * @property body
-       * @type HTMLElement
-       */
-       body : null,
-
-       /**
-       * The footer element, denoted with CSS class "ft"
-       * @property footer
-       * @type HTMLElement
-       */
-       footer : null,
-
-       /**
-       * The id of the element
-       * @property id
-       * @type String
-       */
-       id : null,
-
-       /**
-       * The String representing the image root
-       * @property imageRoot
-       * @type String
-       */
-       imageRoot : YAHOO.widget.Module.IMG_ROOT,
-               
-       /**
-       * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-       * @method initEvents
-       */
-       initEvents : function() {
-
-               /**
-               * CustomEvent fired prior to class initalization.
-               * @event beforeInitEvent
-               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
-               */
-               this.beforeInitEvent = new YAHOO.util.CustomEvent("beforeInit");
-
-               /**
-               * CustomEvent fired after class initalization.
-               * @event initEvent
-               * @param {class} classRef       class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
-               */              
-               this.initEvent = new YAHOO.util.CustomEvent("init");
-
-               /**
-               * CustomEvent fired when the Module is appended to the DOM
-               * @event appendEvent
-               */
-               this.appendEvent = new YAHOO.util.CustomEvent("append");
-
-               /**
-               * CustomEvent fired before the Module is rendered
-               * @event beforeRenderEvent
-               */
-               this.beforeRenderEvent = new YAHOO.util.CustomEvent("beforeRender");
-
-               /**
-               * CustomEvent fired after the Module is rendered
-               * @event renderEvent
-               */
-               this.renderEvent = new YAHOO.util.CustomEvent("render");
-       
-               /**
-               * CustomEvent fired when the header content of the Module is modified
-               * @event changeHeaderEvent
-               * @param {String/HTMLElement} content   String/element representing the new header content
-               */
-               this.changeHeaderEvent = new YAHOO.util.CustomEvent("changeHeader");
-               
-               /**
-               * CustomEvent fired when the body content of the Module is modified
-               * @event changeBodyEvent
-               * @param {String/HTMLElement} content   String/element representing the new body content
-               */              
-               this.changeBodyEvent = new YAHOO.util.CustomEvent("changeBody");
-               
-               /**
-               * CustomEvent fired when the footer content of the Module is modified
-               * @event changeFooterEvent
-               * @param {String/HTMLElement} content   String/element representing the new footer content
-               */
-               this.changeFooterEvent = new YAHOO.util.CustomEvent("changeFooter");
-
-               /**
-               * CustomEvent fired when the content of the Module is modified
-               * @event changeContentEvent
-               */
-               this.changeContentEvent = new YAHOO.util.CustomEvent("changeContent");
-
-               /**
-               * CustomEvent fired when the Module is destroyed
-               * @event destroyEvent
-               */
-               this.destroyEvent = new YAHOO.util.CustomEvent("destroy");
-               
-               /**
-               * CustomEvent fired before the Module is shown
-               * @event beforeShowEvent
-               */
-               this.beforeShowEvent = new YAHOO.util.CustomEvent("beforeShow");
-
-               /**
-               * CustomEvent fired after the Module is shown
-               * @event showEvent
-               */
-               this.showEvent = new YAHOO.util.CustomEvent("show");
-
-               /**
-               * CustomEvent fired before the Module is hidden
-               * @event beforeHideEvent
-               */
-               this.beforeHideEvent = new YAHOO.util.CustomEvent("beforeHide");
-
-               /**
-               * CustomEvent fired after the Module is hidden
-               * @event hideEvent
-               */
-               this.hideEvent = new YAHOO.util.CustomEvent("hide");
-       }, 
-
-       /**
-       * String representing the current user-agent platform
-       * @property platform
-       * @type String
-       */
-       platform : function() {
-                                       var ua = navigator.userAgent.toLowerCase();
-                                       if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
-                                               return "windows";
-                                       } else if (ua.indexOf("macintosh") != -1) {
-                                               return "mac";
-                                       } else {
-                                               return false;
-                                       }
-                               }(),
-
-       /**
-       * String representing the current user-agent browser
-       * @property browser
-       * @type String
-       */
-       browser : function() {
-                       var ua = navigator.userAgent.toLowerCase();
-                                 if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
-                                        return 'opera';
-                                 } else if (ua.indexOf('msie 7')!=-1) { // IE7
-                                        return 'ie7';
-                                 } else if (ua.indexOf('msie') !=-1) { // IE
-                                        return 'ie';
-                                 } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
-                                        return 'safari';
-                                 } else if (ua.indexOf('gecko') != -1) { // Gecko
-                                        return 'gecko';
-                                 } else {
-                                        return false;
-                                 }
-                       }(),
-
-       /**
-       * Boolean representing whether or not the current browsing context is secure (https)
-       * @property isSecure
-       * @type Boolean
-       */
-       isSecure : function() {
-               if (window.location.href.toLowerCase().indexOf("https") === 0) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }(),
-
-       /**
-       * Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-       */
-       initDefaultConfig : function() {
-               // Add properties //
-               
-               /**
-               * Specifies whether the Module is visible on the page.
-               * @config visible
-               * @type Boolean
-               * @default true
-               */
-               this.cfg.addProperty("visible", { value:true, handler:this.configVisible, validator:this.cfg.checkBoolean } );
-               
-               /**
-               * Object or array of objects representing the ContainerEffect classes that are active for animating the container.
-               * @config effect
-               * @type Object
-               * @default null
-               */
-               this.cfg.addProperty("effect", { suppressEvent:true, supercedes:["visible"] } );
-               
-               /**
-               * Specifies whether to create a special proxy iframe to monitor for user font resizing in the document
-               * @config monitorresize
-               * @type Boolean
-               * @default true
-               */
-               this.cfg.addProperty("monitorresize", { value:true, handler:this.configMonitorResize } );
-       },
-
-       /**
-       * 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.
-       * @method init
-       * @param {String}       el      The element ID representing the Module <em>OR</em>
-       * @param {HTMLElement}  el      The element representing the Module
-       * @param {Object}       userConfig      The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
-       */
-       init : function(el, userConfig) {
-
-               this.initEvents();
-
-               this.beforeInitEvent.fire(YAHOO.widget.Module);
-
-               /**
-               * The Module's Config object used for monitoring configuration properties.
-               * @property cfg
-               * @type YAHOO.util.Config
-               */
-               this.cfg = new YAHOO.util.Config(this);
-               
-               if (this.isSecure) {
-                       this.imageRoot = YAHOO.widget.Module.IMG_ROOT_SSL;
-               }
-
-               if (typeof el == "string") {
-                       var elId = el;
-
-                       el = document.getElementById(el);
-                       if (! el) {
-                               el = document.createElement("DIV");
-                               el.id = elId;
-                       }
-               }
-
-               this.element = el;
-               
-               if (el.id) {
-                       this.id = el.id;
-               } 
-
-               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;
-                               }
-                       }
-               }
-
-               this.initDefaultConfig();
-
-               YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Module.CSS_MODULE);
-
-               if (userConfig) {
-                       this.cfg.applyConfig(userConfig, true);
-               }
-
-               // Subscribe to the fireQueue() method of Config so that any queued configuration changes are
-               // excecuted upon render of the Module
-               if (! YAHOO.util.Config.alreadySubscribed(this.renderEvent, this.cfg.fireQueue, this.cfg)) {
-                       this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
-               }
-
-               this.initEvent.fire(YAHOO.widget.Module);
-       },
-
-       /**
-       * Initialized an empty IFRAME that is placed out of the visible area that can be used to detect text resize.
-       * @method initResizeMonitor
-       */
-       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;
-    
-                }                
-
-                resizeMonitor.id = "_yuiResizeMonitor";
-                resizeMonitor.style.visibility = "hidden";
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,        
+        Config = YAHOO.util.Config;
+    
+
+    /**
+     * Constant representing the CustomEvent type for the config changed event.
+     * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT
+     * @private
+     * @static
+     * @final
+     */
+    Config.CONFIG_CHANGED_EVENT = "configChanged";
+    
+    /**
+     * Constant representing the boolean type string
+     * @property YAHOO.util.Config.BOOLEAN_TYPE
+     * @private
+     * @static
+     * @final
+     */
+    Config.BOOLEAN_TYPE = "boolean";
+    
+    Config.prototype = {
+     
+        /**
+        * Object reference to the owner of this Config Object
+        * @property owner
+        * @type Object
+        */
+        owner: null,
+        
+        /**
+        * Boolean flag that specifies whether a queue is currently 
+        * being executed
+        * @property queueInProgress
+        * @type Boolean
+        */
+        queueInProgress: false,
+        
+        /**
+        * Maintains the local collection of configuration property objects and 
+        * their specified values
+        * @property config
+        * @private
+        * @type Object
+        */ 
+        config: null,
+        
+        /**
+        * Maintains the local collection of configuration property objects as 
+        * they were initially applied.
+        * This object is used when resetting a property.
+        * @property initialConfig
+        * @private
+        * @type Object
+        */ 
+        initialConfig: null,
+        
+        /**
+        * Maintains the local, normalized CustomEvent queue
+        * @property eventQueue
+        * @private
+        * @type Object
+        */ 
+        eventQueue: null,
+        
+        /**
+        * Custom Event, notifying subscribers when Config properties are set 
+        * (setProperty is called without the silent flag
+        * @event configChangedEvent
+        */
+        configChangedEvent: null,
+    
+        /**
+        * Initializes the configuration Object and all of its local members.
+        * @method init
+        * @param {Object} owner The owner Object to which this Config 
+        * Object belongs
+        */
+        init: function (owner) {
+    
+            this.owner = owner;
+    
+            this.configChangedEvent = 
+                this.createEvent(Config.CONFIG_CHANGED_EVENT);
+    
+            this.configChangedEvent.signature = CustomEvent.LIST;
+            this.queueInProgress = false;
+            this.config = {};
+            this.initialConfig = {};
+            this.eventQueue = [];
+        
+        },
+        
+        /**
+        * Validates that the value passed in is a Boolean.
+        * @method checkBoolean
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */ 
+        checkBoolean: function (val) {
+            return (typeof val == Config.BOOLEAN_TYPE);
+        },
+        
+        /**
+        * Validates that the value passed in is a number.
+        * @method checkNumber
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */
+        checkNumber: function (val) {
+            return (!isNaN(val));
+        },
+        
+        /**
+        * Fires a configuration property event using the specified value. 
+        * @method fireEvent
+        * @private
+        * @param {String} key The configuration property's name
+        * @param {value} Object The value of the correct type for the property
+        */ 
+        fireEvent: function ( key, value ) {
+            var property = this.config[key];
+        
+            if (property && property.event) {
+                property.event.fire(value);
+            } 
+        },
+        
+        /**
+        * Adds a property to the Config Object's private config hash.
+        * @method addProperty
+        * @param {String} key The configuration property's name
+        * @param {Object} propertyObject The Object containing all of this 
+        * property's arguments
+        */
+        addProperty: function ( key, propertyObject ) {
+            key = key.toLowerCase();
+        
+            this.config[key] = propertyObject;
+        
+            propertyObject.event = this.createEvent(key, { scope: this.owner });
+            propertyObject.event.signature = CustomEvent.LIST;
+            
+            
+            propertyObject.key = key;
+        
+            if (propertyObject.handler) {
+                propertyObject.event.subscribe(propertyObject.handler, 
+                    this.owner);
+            }
+        
+            this.setProperty(key, propertyObject.value, true);
+            
+            if (! propertyObject.suppressEvent) {
+                this.queueProperty(key, propertyObject.value);
+            }
+            
+        },
+        
+        /**
+        * Returns a key-value configuration map of the values currently set in  
+        * the Config Object.
+        * @method getConfig
+        * @return {Object} The current config, represented in a key-value map
+        */
+        getConfig: function () {
+        
+            var cfg = {},
+                prop,
+                property;
                 
-                document.body.appendChild(resizeMonitor);
+            for (prop in this.config) {
+                property = this.config[prop];
+                if (property && property.event) {
+                    cfg[prop] = property.value;
+                }
+            }
+            
+            return cfg;
+        },
+        
+        /**
+        * Returns the value of specified property.
+        * @method getProperty
+        * @param {String} key The name of the property
+        * @return {Object}  The value of the specified property
+        */
+        getProperty: function (key) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.value;
+            } else {
+                return undefined;
+            }
+        },
+        
+        /**
+        * Resets the specified property's value to its initial value.
+        * @method resetProperty
+        * @param {String} key The name of the property
+        * @return {Boolean} True is the property was reset, false if not
+        */
+        resetProperty: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event) {
+    
+                if (this.initialConfig[key] && 
+                    !Lang.isUndefined(this.initialConfig[key])) {
+    
+                    this.setProperty(key, this.initialConfig[key]);
+
+                    return true;
+    
+                }
+    
+            } else {
+    
+                return false;
+            }
+    
+        },
+        
+        /**
+        * Sets the value of a property. If the silent property is passed as 
+        * true, the property's event will not be fired.
+        * @method setProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @param {Boolean} silent Whether the value should be set silently, 
+        * without firing the property event.
+        * @return {Boolean} True, if the set was successful, false if it failed.
+        */
+        setProperty: function (key, value, silent) {
+        
+            var property;
+        
+            key = key.toLowerCase();
+        
+            if (this.queueInProgress && ! silent) {
+                // Currently running through a queue... 
+                this.queueProperty(key,value);
+                return true;
+    
+            } else {
+                property = this.config[key];
+                if (property && property.event) {
+                    if (property.validator && !property.validator(value)) {
+                        return false;
+                    } else {
+                        property.value = value;
+                        if (! silent) {
+                            this.fireEvent(key, value);
+                            this.configChangedEvent.fire([key, value]);
+                        }
+                        return true;
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        
+        /**
+        * Sets the value of a property and queues its event to execute. If the 
+        * event is already scheduled to execute, it is
+        * moved from its current position to the end of the queue.
+        * @method queueProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @return {Boolean}  true, if the set was successful, false if 
+        * it failed.
+        */ 
+        queueProperty: function (key, value) {
+        
+            key = key.toLowerCase();
+        
+            var property = this.config[key],
+                foundDuplicate = false,
+                iLen,
+                queueItem,
+                queueItemKey,
+                queueItemValue,
+                sLen,
+                supercedesCheck,
+                qLen,
+                queueItemCheck,
+                queueItemCheckKey,
+                queueItemCheckValue,
+                i,
+                s,
+                q;
+                                
+            if (property && property.event) {
+    
+                if (!Lang.isUndefined(value) && property.validator && 
+                    !property.validator(value)) { // validator
+                    return false;
+                } else {
+        
+                    if (!Lang.isUndefined(value)) {
+                        property.value = value;
+                    } else {
+                        value = property.value;
+                    }
+        
+                    foundDuplicate = false;
+                    iLen = this.eventQueue.length;
+        
+                    for (i = 0; i < iLen; i++) {
+                        queueItem = this.eventQueue[i];
+        
+                        if (queueItem) {
+                            queueItemKey = queueItem[0];
+                            queueItemValue = queueItem[1];
+                            
+                            if (queueItemKey == key) {
+    
+                                /*
+                                    found a dupe... push to end of queue, null 
+                                    current item, and break
+                                */
+    
+                                this.eventQueue[i] = null;
+    
+                                this.eventQueue.push(
+                                    [key, (!Lang.isUndefined(value) ? 
+                                    value : queueItemValue)]);
+    
+                                foundDuplicate = true;
+                                break;
+                            }
+                        }
+                    }
+                    
+                    // this is a refire, or a new property in the queue
+    
+                    if (! foundDuplicate && !Lang.isUndefined(value)) { 
+                        this.eventQueue.push([key, value]);
+                    }
+                }
+        
+                if (property.supercedes) {
+        
+                    sLen = property.supercedes.length;
+        
+                    for (s = 0; s < sLen; s++) {
+        
+                        supercedesCheck = property.supercedes[s];
+                        qLen = this.eventQueue.length;
+        
+                        for (q = 0; q < qLen; q++) {
+                            queueItemCheck = this.eventQueue[q];
+        
+                            if (queueItemCheck) {
+                                queueItemCheckKey = queueItemCheck[0];
+                                queueItemCheckValue = queueItemCheck[1];
+                                
+                                if (queueItemCheckKey == 
+                                    supercedesCheck.toLowerCase() ) {
+    
+                                    this.eventQueue.push([queueItemCheckKey, 
+                                        queueItemCheckValue]);
+    
+                                    this.eventQueue[q] = null;
+                                    break;
+    
+                                }
+                            }
+                        }
+                    }
+                }
+
+        
+                return true;
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Fires the event for a property using the property's current value.
+        * @method refireEvent
+        * @param {String} key The name of the property
+        */
+        refireEvent: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event && 
     
-                resizeMonitor.style.width = "10em";
-                resizeMonitor.style.height = "10em";
-                resizeMonitor.style.position = "absolute";
+                !Lang.isUndefined(property.value)) {
+    
+                if (this.queueInProgress) {
+    
+                    this.queueProperty(key);
+    
+                } else {
+    
+                    this.fireEvent(key, property.value);
+    
+                }
+    
+            }
+        },
+        
+        /**
+        * Applies a key-value Object literal to the configuration, replacing  
+        * any existing values, and queueing the property events.
+        * Although the values will be set, fireQueue() must be called for their 
+        * associated events to execute.
+        * @method applyConfig
+        * @param {Object} userConfig The configuration Object literal
+        * @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.
+        */
+        applyConfig: function (userConfig, init) {
+        
+            var sKey,
+                oValue,
+                oConfig;
+
+            if (init) {
+
+                oConfig = {};
+
+                for (sKey in userConfig) {
+                
+                    if (Lang.hasOwnProperty(userConfig, sKey)) {
+
+                        oConfig[sKey.toLowerCase()] = userConfig[sKey];
+
+                    }
                 
-                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");
+                }
+
+                this.initialConfig = oConfig;
+
+            }
+
+            for (sKey in userConfig) {
+            
+                if (Lang.hasOwnProperty(userConfig, sKey)) {
+            
+                    this.queueProperty(sKey, userConfig[sKey]);
                 
-                resizeMonitor.style.visibility = "visible";
+                }
+
+            }
+
+        },
+        
+        /**
+        * Refires the events for all configuration properties using their 
+        * current values.
+        * @method refresh
+        */
+        refresh: function () {
+        
+            var prop;
+        
+            for (prop in this.config) {
+                this.refireEvent(prop);
+            }
+        },
+        
+        /**
+        * Fires the normalized list of queued property change events
+        * @method fireQueue
+        */
+        fireQueue: function () {
+        
+            var i, 
+                queueItem,
+                key,
+                value,
+                property;
+        
+            this.queueInProgress = true;
+            for (i = 0;i < this.eventQueue.length; i++) {
+                queueItem = this.eventQueue[i];
+                if (queueItem) {
+        
+                    key = queueItem[0];
+                    value = queueItem[1];
+                    property = this.config[key];
+        
+                    property.value = value;
+        
+                    this.fireEvent(key,value);
+                }
+            }
+            
+            this.queueInProgress = false;
+            this.eventQueue = [];
+        },
+        
+        /**
+        * Subscribes an external handler to the change event for any 
+        * given property. 
+        * @method subscribeToConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event handler 
+        * (see CustomEvent documentation)
+        * @param {Boolean} override Optional. If true, will override "this"  
+        * within the handler to map to the scope Object passed into the method.
+        * @return {Boolean} True, if the subscription was successful, 
+        * otherwise false.
+        */ 
+        subscribeToConfigEvent: function (key, handler, obj, override) {
     
-                if(!bIE) {
+            var property = this.config[key.toLowerCase()];
     
-                    var doc = resizeMonitor.contentWindow.document;
+            if (property && property.event) {
+    
+                if (!Config.alreadySubscribed(property.event, handler, obj)) {
+    
+                    property.event.subscribe(handler, obj, override);
     
-                    doc.open();
-                    doc.close();
-                
                 }
+    
+                return true;
+    
+            } else {
+    
+                return false;
+    
             }
     
-                       var fireTextResize = function() {
-                               YAHOO.widget.Module.textResizeEvent.fire();
-                       };
+        },
+        
+        /**
+        * Unsubscribes an external handler from the change event for any 
+        * given property. 
+        * @method unsubscribeFromConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event 
+        * handler (see CustomEvent documentation)
+        * @return {Boolean} True, if the unsubscription was successful, 
+        * otherwise false.
+        */
+        unsubscribeFromConfigEvent: function (key, handler, obj) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.event.unsubscribe(handler, obj);
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Returns a string representation of the Config object
+        * @method toString
+        * @return {String} The Config object in string format.
+        */
+        toString: function () {
+            var output = "Config";
+            if (this.owner) {
+                output += " [" + this.owner.toString() + "]";
+            }
+            return output;
+        },
+        
+        /**
+        * Returns a string representation of the Config object's current 
+        * CustomEvent queue
+        * @method outputEventQueue
+        * @return {String} The string list of CustomEvents currently queued 
+        * for execution
+        */
+        outputEventQueue: function () {
+
+            var output = "",
+                queueItem,
+                q,
+                nQueue = this.eventQueue.length;
+              
+            for (q = 0; q < nQueue; q++) {
+                queueItem = this.eventQueue[q];
+                if (queueItem) {
+                    output += queueItem[0] + "=" + queueItem[1] + ", ";
+                }
+            }
+            return output;
+        },
+
+        /**
+        * Sets all properties to null, unsubscribes all listeners from each 
+        * property's change event and all listeners from the configChangedEvent.
+        * @method destroy
+        */
+        destroy: function () {
+
+            var oConfig = this.config,
+                sProperty,
+                oProperty;
+
+
+            for (sProperty in oConfig) {
+            
+                if (Lang.hasOwnProperty(oConfig, sProperty)) {
 
-            if(resizeMonitor && resizeMonitor.contentWindow) {
-                this.resizeMonitor = resizeMonitor;
-                               
-                               YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize, this, true);
-                               
-                               if (! YAHOO.widget.Module.textResizeInitialized) {
-                                       if (! YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", fireTextResize)) {
-                                               // This will fail in IE if document.domain has changed, so we must change the listener to
-                                               // use the resizeMonitor element instead
-                                               YAHOO.util.Event.addListener(this.resizeMonitor, "resize", fireTextResize);
-                                       }
-                                       YAHOO.widget.Module.textResizeInitialized = true;
-                               }
+                    oProperty = oConfig[sProperty];
+
+                    oProperty.event.unsubscribeAll();
+                    oProperty.event = null;
+
+                }
+            
             }
+            
+            this.configChangedEvent.unsubscribeAll();
+            
+            this.configChangedEvent = null;
+            this.owner = null;
+            this.config = null;
+            this.initialConfig = null;
+            this.eventQueue = null;
         
         }
 
-       },
-
-       /**
-       * Event handler fired when the resize monitor element is resized.
-       * @method onDomResize
-       * @param {DOMEvent} e   The DOM resize event
-       * @param {Object} obj   The scope object passed to the handler
-       */
-       onDomResize : function(e, obj) { 
-        var nLeft = -1 * this.resizeMonitor.offsetWidth,
-            nTop = -1 * this.resizeMonitor.offsetHeight;
-        
-        this.resizeMonitor.style.top = nTop + "px";
-        this.resizeMonitor.style.left =  nLeft + "px";
-       
-       },
-
-       /**
-       * Sets the Module's header content to the HTML specified, or appends the passed element to the header. If no header is present, one will be automatically created.
-       * @method setHeader
-       * @param {String}       headerContent   The HTML used to set the header <em>OR</em>
-       * @param {HTMLElement}  headerContent   The HTMLElement to append to the header
-       */      
-       setHeader : function(headerContent) {
-               if (! this.header) {
-                       this.header = document.createElement("DIV");
-                       this.header.className = YAHOO.widget.Module.CSS_HEADER;
-               }
-               
-               if (typeof headerContent == "string") {
-                       this.header.innerHTML = headerContent;
-               } else {
-                       this.header.innerHTML = "";
-                       this.header.appendChild(headerContent);
-               }
-
-               this.changeHeaderEvent.fire(headerContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the header. If no header is present, one will be automatically created.
-       * @method appendToHeader
-       * @param {HTMLElement}  element The element to append to the header
-       */      
-       appendToHeader : function(element) {
-               if (! this.header) {
-                       this.header = document.createElement("DIV");
-                       this.header.className = YAHOO.widget.Module.CSS_HEADER;
-               }
-               
-               this.header.appendChild(element);
-               this.changeHeaderEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Sets the Module's body content to the HTML specified, or appends the passed element to the body. If no body is present, one will be automatically created.
-       * @method setBody
-       * @param {String}       bodyContent     The HTML used to set the body <em>OR</em>
-       * @param {HTMLElement}  bodyContent     The HTMLElement to append to the body
-       */              
-       setBody : function(bodyContent) {
-               if (! this.body) {
-                       this.body = document.createElement("DIV");
-                       this.body.className = YAHOO.widget.Module.CSS_BODY;
-               }
-
-               if (typeof bodyContent == "string")
-               {
-                       this.body.innerHTML = bodyContent;
-               } else {
-                       this.body.innerHTML = "";
-                       this.body.appendChild(bodyContent);
-               }
-
-               this.changeBodyEvent.fire(bodyContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the body. If no body is present, one will be automatically created.
-       * @method appendToBody
-       * @param {HTMLElement}  element The element to append to the body
-       */
-       appendToBody : function(element) {
-               if (! this.body) {
-                       this.body = document.createElement("DIV");
-                       this.body.className = YAHOO.widget.Module.CSS_BODY;
-               }
-
-               this.body.appendChild(element);
-               this.changeBodyEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method setFooter
-       * @param {String}       footerContent   The HTML used to set the footer <em>OR</em>
-       * @param {HTMLElement}  footerContent   The HTMLElement to append to the footer
-       */      
-       setFooter : function(footerContent) {
-               if (! this.footer) {
-                       this.footer = document.createElement("DIV");
-                       this.footer.className = YAHOO.widget.Module.CSS_FOOTER;
-               }
-
-               if (typeof footerContent == "string") {
-                       this.footer.innerHTML = footerContent;
-               } else {
-                       this.footer.innerHTML = "";
-                       this.footer.appendChild(footerContent);
-               }
-
-               this.changeFooterEvent.fire(footerContent);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * Appends the passed element to the footer. If no footer is present, one will be automatically created.
-       * @method appendToFooter
-       * @param {HTMLElement}  element The element to append to the footer
-       */
-       appendToFooter : function(element) {
-               if (! this.footer) {
-                       this.footer = document.createElement("DIV");
-                       this.footer.className = YAHOO.widget.Module.CSS_FOOTER;
-               }
-
-               this.footer.appendChild(element);
-               this.changeFooterEvent.fire(element);
-               this.changeContentEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method render
-       * @param {String}       appendToNode    The element id to which the Module should be appended to prior to rendering <em>OR</em>
-       * @param {HTMLElement}  appendToNode    The element to which the Module should be appended to prior to rendering        
-       * @param {HTMLElement}  moduleElement   OPTIONAL. The element that represents the actual Standard Module container. 
-       * @return {Boolean} Success or failure of the render
-       */
-       render : function(appendToNode, moduleElement) {
-               this.beforeRenderEvent.fire();
-
-               if (! moduleElement) {
-                       moduleElement = this.element;
-               }
-
-               var me = this;
-               var appendTo = function(element) {
-                       if (typeof element == "string") {
-                               element = document.getElementById(element);
-                       }
-                       
-                       if (element) {
-                               element.appendChild(me.element);
-                               me.appendEvent.fire();
-                       }
-               };
-
-               if (appendToNode) {
-                       appendTo(appendToNode);
-               } else { // No node was passed in. If the element is not pre-marked up, this fails
-                       if (! YAHOO.util.Dom.inDocument(this.element)) {
-                               return false;
-                       }
-               }
-
-               // Need to get everything into the DOM if it isn't already
-               
-               if (this.header && ! YAHOO.util.Dom.inDocument(this.header)) {
-                       // There is a header, but it's not in the DOM yet... need to add it
-                       var firstChild = moduleElement.firstChild;
-                       if (firstChild) { // Insert before first child if exists
-                               moduleElement.insertBefore(this.header, firstChild);
-                       } else { // Append to empty body because there are no children
-                               moduleElement.appendChild(this.header);
-                       }
-               }
-
-               if (this.body && ! YAHOO.util.Dom.inDocument(this.body)) {
-                       // There is a body, but it's not in the DOM yet... need to add it
-                       if (this.footer && YAHOO.util.Dom.isAncestor(this.moduleElement, this.footer)) { // Insert before footer if exists in DOM
-                               moduleElement.insertBefore(this.body, this.footer);
-                       } else { // Append to element because there is no footer
-                               moduleElement.appendChild(this.body);
-                       }
-               }
-
-               if (this.footer && ! YAHOO.util.Dom.inDocument(this.footer)) {
-                       // There is a footer, but it's not in the DOM yet... need to add it
-                       moduleElement.appendChild(this.footer);
-               }
-
-               this.renderEvent.fire();
-               return true;
-       },
-
-       /**
-       * Removes the Module element from the DOM and sets all child elements to null.
-       * @method destroy
-       */
-       destroy : function() {
-               var parent;
-
-               if (this.element) {
-                       YAHOO.util.Event.purgeElement(this.element, true);
-                       parent = this.element.parentNode;
-               }
-               if (parent) {
-                       parent.removeChild(this.element);
-               }
-
-               this.element = null;
-               this.header = null;
-               this.body = null;
-               this.footer = null;
-
-               for (var e in this) {
-                       if (e instanceof YAHOO.util.CustomEvent) {
-                               e.unsubscribeAll();
-                       }
-               }
-
-               YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this);
-
-               this.destroyEvent.fire();
-       },
-
-       /**
-       * 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.
-       * @method show
-       */
-       show : function() {
-               this.cfg.setProperty("visible", true);
-       },
-
-       /**
-       * 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.
-       * @method hide
-       */
-       hide : function() {
-               this.cfg.setProperty("visible", false);
-       },
-
-       // BUILT-IN EVENT HANDLERS FOR MODULE //
-
-       /**
-       * Default event handler for changing the visibility property of a Module. By default, this is achieved by switching the "display" style between "block" and "none".
-       * This method is responsible for firing showEvent and hideEvent.
-       * @param {String} type  The CustomEvent type (usually the property name)
-       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
-       * @method configVisible
-       */
-       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();
-               }
-       },
-
-       /**
-       * Default event handler for the "monitorresize" configuration property
-       * @param {String} type  The CustomEvent type (usually the property name)
-       * @param {Object[]}     args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-       * @param {Object} obj   The scope object. For configuration handlers, this will usually equal the owner.
-       * @method configMonitorResize
-       */
-       configMonitorResize : function(type, args, obj) {
-               var monitor = args[0];
-               if (monitor) {
-                       this.initResizeMonitor();
-               } else {
-                       YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this, true);
-                       this.resizeMonitor = null;
-               }
-       }
-};
-
-/**
-* Returns a String representation of the Object.
-* @method toString
-* @return {String}     The string representation of the Module
-*/ 
-YAHOO.widget.Module.prototype.toString = function() {
-       return "Module " + this.id;
-};
-
-/**
-* 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.
-* @namespace YAHOO.widget
-* @class Overlay
-* @extends YAHOO.widget.Module
-* @param {String}      el      The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement} el      The element representing the Overlay
-* @param {Object}      userConfig      The configuration object literal containing 10/23/2006the configuration that should be set for this Overlay. See configuration documentation for more details.
-* @constructor
-*/
-YAHOO.widget.Overlay = function(el, userConfig) {
-       YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Overlay, YAHOO.widget.Module);
-
-/**
-* The URL that will be placed in the iframe
-* @property YAHOO.widget.Overlay.IFRAME_SRC
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;";
-
-/**
-* Constant representing the top left corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.TOP_LEFT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.TOP_LEFT = "tl";
-
-/**
-* Constant representing the top right corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.TOP_RIGHT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.TOP_RIGHT = "tr";
-
-/**
-* Constant representing the top bottom left corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.BOTTOM_LEFT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.BOTTOM_LEFT = "bl";
-
-/**
-* Constant representing the bottom right corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.BOTTOM_RIGHT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.BOTTOM_RIGHT = "br";
-
-/**
-* Constant representing the default CSS class used for an Overlay
-* @property YAHOO.widget.Overlay.CSS_OVERLAY
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.CSS_OVERLAY = "overlay";
-
-/**
-* 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.
-* @method init
-* @param {String}      el      The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement} el      The element representing the Overlay
-* @param {Object}      userConfig      The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.
-*/
-YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {
-       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
-       
-       this.beforeInitEvent.fire(YAHOO.widget.Overlay);
-
-       YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Overlay.CSS_OVERLAY);
-
-       if (userConfig) {
-               this.cfg.applyConfig(userConfig, true);
-       }
-
-       if (this.platform == "mac" && this.browser == "gecko") {
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)) {
-                       this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)) {
-                       this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);
-               }
-       }
-
-       this.initEvent.fire(YAHOO.widget.Overlay);
-};
-
-/**
-* Initializes the custom events for Overlay which are fired automatically at appropriate times by the Overlay class.
-* @method initEvents
-*/
-YAHOO.widget.Overlay.prototype.initEvents = function() {
-       YAHOO.widget.Overlay.superclass.initEvents.call(this);
-
-       /**
-       * CustomEvent fired before the Overlay is moved.
-       * @event beforeMoveEvent
-       * @param {Number} x     x coordinate
-       * @param {Number} y     y coordinate
-       */
-       this.beforeMoveEvent = new YAHOO.util.CustomEvent("beforeMove", this);
-
-       /**
-       * CustomEvent fired after the Overlay is moved.
-       * @event moveEvent
-       * @param {Number} x     x coordinate
-       * @param {Number} y     y coordinate
-       */
-       this.moveEvent = new YAHOO.util.CustomEvent("move", this);
-};
-
-/**
-* Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Overlay.prototype.initDefaultConfig = function() {
-       YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);
-
-       // Add overlay config properties //
-
-       /**
-       * The absolute x-coordinate position of the Overlay
-       * @config x
-       * @type Number
-       * @default null
-       */      
-       this.cfg.addProperty("x", { handler:this.configX, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * The absolute y-coordinate position of the Overlay
-       * @config y
-       * @type Number
-       * @default null
-       */      
-       this.cfg.addProperty("y", { handler:this.configY, validator:this.cfg.checkNumber, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * An array with the absolute x and y positions of the Overlay
-       * @config xy
-       * @type Number[]
-       * @default null
-       */      
-       this.cfg.addProperty("xy",{ handler:this.configXY, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * 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.
-       * @config context
-       * @type Array
-       * @default null
-       */      
-       this.cfg.addProperty("context", { handler:this.configContext, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * True if the Overlay should be anchored to the center of the viewport.
-       * @config fixedcenter
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty("fixedcenter", { value:false, handler:this.configFixedCenter, validator:this.cfg.checkBoolean, supercedes:["iframe","visible"] } );
-
-       /**
-       * CSS width of the Overlay.
-       * @config width
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty("width", { handler:this.configWidth, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * CSS height of the Overlay.
-       * @config height
-       * @type String
-       * @default null
-       */
-       this.cfg.addProperty("height", { handler:this.configHeight, suppressEvent:true, supercedes:["iframe"] } );
-
-       /**
-       * CSS z-index of the Overlay.
-       * @config zIndex
-       * @type Number
-       * @default null
-       */
-       this.cfg.addProperty("zIndex", { value:null, handler:this.configzIndex } );
-
-       /**
-       * True if the Overlay should be prevented from being positioned out of the viewport.
-       * @config constraintoviewport
-       * @type Boolean
-       * @default false
-       */
-       this.cfg.addProperty("constraintoviewport", { value:false, handler:this.configConstrainToViewport, validator:this.cfg.checkBoolean, supercedes:["iframe","x","y","xy"] } );
-
-       /**
-       * True if the Overlay should have an IFRAME shim (for correcting the select z-index bug in IE6 and below).
-       * @config iframe
-       * @type Boolean
-       * @default true for IE6 and below, false for all others
-       */
-       this.cfg.addProperty("iframe", { value:(this.browser == "ie" ? true : false), handler:this.configIframe, validator:this.cfg.checkBoolean, supercedes:["zIndex"] } );
-};
-
-/**
-* Moves the Overlay to the specified position. This function is identical to calling this.cfg.setProperty("xy", [x,y]);
-* @method moveTo
-* @param {Number}      x       The Overlay's new x position
-* @param {Number}      y       The Overlay's new y position
-*/
-YAHOO.widget.Overlay.prototype.moveTo = function(x, y) {
-       this.cfg.setProperty("xy",[x,y]);
-};
-
-/**
-* Adds a special CSS class to the Overlay when Mac/Gecko is in use, to work around a Gecko bug where
-* scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
-* @method hideMacGeckoScrollbars
-*/
-YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars = function() {
-       YAHOO.util.Dom.removeClass(this.element, "show-scrollbars");
-       YAHOO.util.Dom.addClass(this.element, "hide-scrollbars");
-};
-
-/**
-* Removes a special CSS class from the Overlay when Mac/Gecko is in use, to work around a Gecko bug where
-* scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
-* @method showMacGeckoScrollbars
-*/
-YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars = function() {
-       YAHOO.util.Dom.removeClass(this.element, "hide-scrollbars");
-       YAHOO.util.Dom.addClass(this.element, "show-scrollbars");
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* The default event handler fired when the "visible" property is changed. This method is responsible for firing showEvent and hideEvent.
-* @method configVisible
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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; }
-                       e = e.parentNode;
-               }
-               if (currentVis == "inherit") { 
-                       currentVis = "visible";
-               }
-       }
-       
-       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);
-               }
-       }
-
-       var isMacGecko = (this.platform == "mac" && this.browser == "gecko");
-
-       if (visible) { // Show
-               if (isMacGecko) {
-                       this.showMacGeckoScrollbars();
-               }       
-
-               if (effect) { // Animate in
-                       if (visible) { // Animate in if not showing
-                               if (currentVis != "visible" || currentVis === "") {
-                                       this.beforeShowEvent.fire();
-                                       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); // Delegate showEvent until end of animateInComplete
-                                               }
-                                               ei.animateIn();
-                                       }
-                               }
-                       }
-               } else { // Show
-                       if (currentVis != "visible" || currentVis === "") {
-                               this.beforeShowEvent.fire();
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "visible");
-                               this.cfg.refireEvent("iframe");
-                               this.showEvent.fire();
-                       }
-               }
-
-       } else { // Hide
-               if (isMacGecko) {
-                       this.hideMacGeckoScrollbars();
-               }       
-
-               if (effect) { // Animate out if showing
-                       if (currentVis == "visible") {
-                               this.beforeHideEvent.fire();
-                               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); // Delegate hideEvent until end of animateOutComplete
-                                       }
-                                       h.animateOut();
-                               }
-                       } else if (currentVis === "") {
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");
-                       }
-               } else { // Simple hide
-                       if (currentVis == "visible" || currentVis === "") {
-                               this.beforeHideEvent.fire();
-                               YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");
-                               this.cfg.refireEvent("iframe");
-                               this.hideEvent.fire();
-                       }
-               }       
-       }
-};
-
-/**
-* Center event handler used for centering on scroll/resize, but only if the Overlay is visible
-* @method doCenterOnDOMEvent
-*/
-YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent = function() {
-       if (this.cfg.getProperty("visible")) {
-               this.center();
-       }
-};
-
-/**
-* The default event handler fired when the "fixedcenter" property is changed.
-* @method configFixedCenter
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-               }
-               
-               if (! YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent, this.doCenterOnDOMEvent, this)) {
-                       YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);
-               }
-
-               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);
-       }
-};
-
-/**
-* The default event handler fired when the "height" property is changed.
-* @method configHeight
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "width" property is changed.
-* @method configWidth
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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");
-};
-
-/**
-* The default event handler fired when the "zIndex" property is changed.
-* @method configzIndex
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-               }
-       }
-
-       if (this.iframe) {
-               if (zIndex <= 0) {
-                       zIndex = 1;
-               }
-               YAHOO.util.Dom.setStyle(this.iframe, "zIndex", (zIndex-1));
-       }
-
-       YAHOO.util.Dom.setStyle(el, "zIndex", zIndex);
-       this.cfg.setProperty("zIndex", zIndex, true);
-};
-
-/**
-* The default event handler fired when the "xy" property is changed.
-* @method configXY
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {
-       var pos = args[0];
-       var x = pos[0];
-       var y = pos[1];
+    };
+    
+    
+    
+    /**
+    * Checks to determine if a particular function/Object pair are already 
+    * subscribed to the specified CustomEvent
+    * @method YAHOO.util.Config.alreadySubscribed
+    * @static
+    * @param {YAHOO.util.CustomEvent} evt The CustomEvent for which to check 
+    * the subscriptions
+    * @param {Function} fn The function to look for in the subscribers list
+    * @param {Object} obj The execution scope Object for the subscription
+    * @return {Boolean} true, if the function/Object pair is already subscribed 
+    * to the CustomEvent passed in
+    */
+    Config.alreadySubscribed = function (evt, fn, obj) {
+    
+        var nSubscribers = evt.subscribers.length,
+            subsc,
+            i;
 
-       this.cfg.setProperty("x", x);
-       this.cfg.setProperty("y", y);
+        if (nSubscribers > 0) {
 
-       this.beforeMoveEvent.fire([x,y]);
+            i = nSubscribers - 1;
+        
+            do {
 
-       x = this.cfg.getProperty("x");
-       y = this.cfg.getProperty("y");
+                subsc = evt.subscribers[i];
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x,y]);
-};
+                if (subsc && subsc.obj == obj && subsc.fn == fn) {
+        
+                    return true;
+        
+                }    
+            
+            }
+            while (i--);
+        
+        }
+    
+        return false;
+    
+    };
+    
+    YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @module container
+    * @title Container
+    * @requires yahoo, dom, event 
+    * @optional dragdrop, animation, button
+    */
+    
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Module
+    * @constructor
+    * @param {String} el The element ID representing the Module <em>OR</em>
+    * @param {HTMLElement} el The element representing the Module
+    * @param {Object} userConfig The configuration Object literal containing 
+    * the configuration that should be set for this module. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Module = function (el, userConfig) {
+    
+        if (el) {
+    
+            this.init(el, userConfig);
+    
+        } else {
+    
+    
+        }
+    
+    };
 
-/**
-* The default event handler fired when the "x" property is changed.
-* @method configX
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
+    var Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        Event = YAHOO.util.Event,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Module = YAHOO.widget.Module,
+        
+        m_oModuleTemplate,
+        m_oHeaderTemplate,
+        m_oBodyTemplate,
+        m_oFooterTemplate,
+
+        /**
+        * Constant representing the name of the Module's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_INIT": "beforeInit",
+            "INIT": "init",
+            "APPEND": "append",
+            "BEFORE_RENDER": "beforeRender",
+            "RENDER": "render",
+            "CHANGE_HEADER": "changeHeader",
+            "CHANGE_BODY": "changeBody",
+            "CHANGE_FOOTER": "changeFooter",
+            "CHANGE_CONTENT": "changeContent",
+            "DESTORY": "destroy",
+            "BEFORE_SHOW": "beforeShow",
+            "SHOW": "show",
+            "BEFORE_HIDE": "beforeHide",
+            "HIDE": "hide"
+        
+        },
+            
+        /**
+        * Constant representing the Module's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "VISIBLE": { 
+                key: "visible", 
+                value: true, 
+                validator: YAHOO.lang.isBoolean 
+            },
+        
+            "EFFECT": { 
+                key: "effect", 
+                suppressEvent: true, 
+                supercedes: ["visible"] 
+            },
+        
+            "MONITOR_RESIZE": { 
+                key: "monitorresize", 
+                value: true  
+            }
+        
+        };
 
-       this.beforeMoveEvent.fire([x,y]);
+    
+    /**
+    * Constant representing the prefix path to use for non-secure images
+    * @property YAHOO.widget.Module.IMG_ROOT
+    * @static
+    * @final
+    * @type String
+    */
+    Module.IMG_ROOT = null;
+    
+    /**
+    * Constant representing the prefix path to use for securely served images
+    * @property YAHOO.widget.Module.IMG_ROOT_SSL
+    * @static
+    * @final
+    * @type String
+    */
+    Module.IMG_ROOT_SSL = null;
+    
+    /**
+    * Constant for the default CSS class name that represents a Module
+    * @property YAHOO.widget.Module.CSS_MODULE
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_MODULE = "yui-module";
+    
+    /**
+    * Constant representing the module header
+    * @property YAHOO.widget.Module.CSS_HEADER
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_HEADER = "hd";
+    
+    /**
+    * Constant representing the module body
+    * @property YAHOO.widget.Module.CSS_BODY
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_BODY = "bd";
+    
+    /**
+    * Constant representing the module footer
+    * @property YAHOO.widget.Module.CSS_FOOTER
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_FOOTER = "ft";
+    
+    /**
+    * Constant representing the url for the "src" attribute of the iframe 
+    * used to monitor changes to the browser's base font size
+    * @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL
+    * @static
+    * @final
+    * @type String
+    */
+    Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";
+    
+    /**
+    * Singleton CustomEvent fired when the font size is changed in the browser.
+    * Opera's "zoom" functionality currently does not support text 
+    * size detection.
+    * @event YAHOO.widget.Module.textResizeEvent
+    */
+    Module.textResizeEvent = new CustomEvent("textResize");
 
-       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);
+    function createModuleTemplate() {
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x, y]);
-};
+        if (!m_oModuleTemplate) {
 
-/**
-* The default event handler fired when the "y" property is changed.
-* @method configY
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {
-       var x = this.cfg.getProperty("x");
-       var y = args[0];
+            m_oModuleTemplate = document.createElement("div");
+            
+            m_oModuleTemplate.innerHTML = ("<div class=\"" + 
+                Module.CSS_HEADER + "\"></div>" + "<div class=\"" + 
+                Module.CSS_BODY + "\"></div><div class=\"" + 
+                Module.CSS_FOOTER + "\"></div>");
 
-       this.cfg.setProperty("x", x, true);
-       this.cfg.setProperty("y", y, true);
+            m_oHeaderTemplate = m_oModuleTemplate.firstChild;
+            m_oBodyTemplate = m_oHeaderTemplate.nextSibling;
+            m_oFooterTemplate = m_oBodyTemplate.nextSibling;
 
-       this.beforeMoveEvent.fire([x,y]);
+        }
 
-       x = this.cfg.getProperty("x");
-       y = this.cfg.getProperty("y");
+        return m_oModuleTemplate;
 
-       YAHOO.util.Dom.setY(this.element, y, true);
+    }
 
-       this.cfg.setProperty("xy", [x, y], true);
 
-       this.cfg.refireEvent("iframe");
-       this.moveEvent.fire([x, y]);
-};
+    function createHeader() {
 
-/**
-* Shows the iframe shim, if it has been enabled
-* @method showIframe
-*/
-YAHOO.widget.Overlay.prototype.showIframe = function() {
-       if (this.iframe) {
-               this.iframe.style.display = "block";
-       }
-};
-
-/**
-* Hides the iframe shim, if it has been enabled
-* @method hideIframe
-*/
-YAHOO.widget.Overlay.prototype.hideIframe = function() {
-       if (this.iframe) {
-               this.iframe.style.display = "none";
-       }
-};
-
-/**
-* The default event handler fired when the "iframe" property is changed.
-* @method configIframe
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
-
-       var val = args[0];
-
-       if (val) { // IFRAME shim is enabled
-
-               if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, this.showIframe, this)) {
-                       this.showEvent.subscribe(this.showIframe, this, true);
-               }
-               if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, this.hideIframe, this)) {
-                       this.hideEvent.subscribe(this.hideIframe, this, true);
-               }
-
-               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");
-               }
-
-               if (! isNaN(x) && ! isNaN(y)) {
-                       if (! this.iframe) {
-                               this.iframe = document.createElement("iframe");
-                               if (this.isSecure) {
-                                       this.iframe.src = YAHOO.widget.Overlay.IFRAME_SRC;
-                               }
-                               
-                               var parent = this.element.parentNode;
-                               if (parent) {
-                                       parent.appendChild(this.iframe);
-                               } else {
-                                       document.body.appendChild(this.iframe);
-                               }
-
-                               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();
-                               }
-                       }
-                       
-                       var iframeDisplay = YAHOO.util.Dom.getStyle(this.iframe, "display");
-
-                       if (iframeDisplay == "none") {
-                               this.iframe.style.display = "block";
-                       }
-
-                       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";
-               }
-               this.showEvent.unsubscribe(this.showIframe, this);
-               this.hideEvent.unsubscribe(this.hideIframe, this);
-       }
-};
-
-
-/**
-* The default event handler fired when the "constraintoviewport" property is changed.
-* @method configConstrainToViewport
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-       }
-};
-
-/**
-* The default event handler fired when the "context" property is changed.
-* @method configContext
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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);
-                       }
-                       
-                       if (elementMagnetCorner && contextMagnetCorner) {
-                               this.align(elementMagnetCorner, contextMagnetCorner);
-                       }
-               }       
-       }
-};
-
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Aligns the Overlay to its context element using the specified corner points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, and BOTTOM_RIGHT.
-* @method align
-* @param {String} elementAlign         The String representing the corner of the Overlay that should be aligned to the context element
-* @param {String} contextAlign         The corner of the context element that the elementAlign corner should stick to.
-*/
-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];
-               }
-
-               if (! contextAlign) {
-                       contextAlign = contextArgs[2];
-               }
-
-               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;
-                       }
-               }
-       }
-};
-
-/**
-* The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true.
-* @method enforceConstraints
-* @param {String} type The CustomEvent type (usually the property name)
-* @param {Object[]}    args    The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj  The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.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;
-       }
-
-       if (y < topConstraint) {
-               y = topConstraint;
-       } else if (y > bottomConstraint) {
-               y = bottomConstraint;
-       }
-
-       this.cfg.setProperty("x", x, true);
-       this.cfg.setProperty("y", y, true);
-       this.cfg.setProperty("xy", [x,y], true);
-};
-
-/**
-* Centers the container in the viewport.
-* @method center
-*/
-YAHOO.widget.Overlay.prototype.center = function() {
-       var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
-       var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+        if (!m_oHeaderTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oHeaderTemplate.cloneNode(false));
 
-       var viewPortWidth = YAHOO.util.Dom.getClientWidth();
-       var viewPortHeight = YAHOO.util.Dom.getClientHeight();
+    }
+    
 
-       var elementWidth = this.element.offsetWidth;
-       var elementHeight = this.element.offsetHeight;
+    function createBody() {
 
-       var x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX;
-       var y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
-               
-       this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
+        if (!m_oBodyTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oBodyTemplate.cloneNode(false));
+    
+    }
+    
 
-       this.cfg.refireEvent("iframe");
-};
+    function createFooter() {
 
-/**
-* 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.
-* @method syncPosition
-*/
-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);
-};
-
-/**
-* Event handler fired when the resize monitor element is resized.
-* @method onDomResize
-* @param {DOMEvent} e  The resize DOM event
-* @param {Object} obj  The scope object
-*/
-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);
-};
-
-/**
-* Removes the Overlay element from the DOM and sets all child elements to null.
-* @method destroy
-*/
-YAHOO.widget.Overlay.prototype.destroy = function() {
-       if (this.iframe) {
-               this.iframe.parentNode.removeChild(this.iframe);
-       }
-       
-       this.iframe = null;
-
-       YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-       YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-
-       YAHOO.widget.Overlay.superclass.destroy.call(this);  
-};
-
-/**
-* Returns a String representation of the object.
-* @method toString
-* @return {String} The string representation of the Overlay.
-*/ 
-YAHOO.widget.Overlay.prototype.toString = function() {
-       return "Overlay " + this.id;
-};
-
-/**
-* A singleton CustomEvent used for reacting to the DOM event for window scroll
-* @event YAHOO.widget.Overlay.windowScrollEvent
-*/
-YAHOO.widget.Overlay.windowScrollEvent = new YAHOO.util.CustomEvent("windowScroll");
+        if (!m_oFooterTemplate) {
+        
+            createModuleTemplate();
+        
+        }
+        
+        return (m_oFooterTemplate.cloneNode(false));
 
-/**
-* A singleton CustomEvent used for reacting to the DOM event for window resize
-* @event YAHOO.widget.Overlay.windowResizeEvent
-*/
-YAHOO.widget.Overlay.windowResizeEvent = new YAHOO.util.CustomEvent("windowResize");
+    }
+    
 
-/**
-* The DOM event handler used to fire the CustomEvent for window scroll
-* @method YAHOO.widget.Overlay.windowScrollHandler
-* @static
-* @param {DOMEvent} e The DOM scroll event
-*/
-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;
-               }
-               clearTimeout(window.scrollEnd);
-               window.scrollEnd = setTimeout(function() { YAHOO.widget.Overlay.windowScrollEvent.fire(); }, 1);
-       } else {
-               YAHOO.widget.Overlay.windowScrollEvent.fire();
-       }
-};
-
-/**
-* The DOM event handler used to fire the CustomEvent for window resize
-* @method YAHOO.widget.Overlay.windowResizeHandler
-* @static
-* @param {DOMEvent} e The DOM resize event
-*/
-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;
-               }
-               clearTimeout(window.resizeEnd);
-               window.resizeEnd = setTimeout(function() { YAHOO.widget.Overlay.windowResizeEvent.fire(); }, 100);
-       } else {
-               YAHOO.widget.Overlay.windowResizeEvent.fire();
-       }
-};
-
-/**
-* A boolean that indicated whether the window resize and scroll events have already been subscribed to.
-* @property YAHOO.widget.Overlay._initialized
-* @private
-* @type Boolean
-*/
-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;
-}
-
-/**
-* OverlayManager is used for maintaining the focus status of multiple Overlays.* @namespace YAHOO.widget
-* @namespace YAHOO.widget
-* @class OverlayManager
-* @constructor
-* @param {Array}       overlays        Optional. A collection of Overlays to register with the manager.
-* @param {Object}      userConfig              The object literal representing the user configuration of the OverlayManager
-*/
-YAHOO.widget.OverlayManager = function(userConfig) {
-       this.init(userConfig);
-};
-
-/**
-* The CSS class representing a focused Overlay
-* @property YAHOO.widget.OverlayManager.CSS_FOCUSED
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.OverlayManager.CSS_FOCUSED = "focused";
-
-YAHOO.widget.OverlayManager.prototype = {
-       /**
-       * The class's constructor function
-       * @property contructor
-       * @type Function
-       */
-       constructor : YAHOO.widget.OverlayManager,
-
-       /**
-       * The array of Overlays that are currently registered
-       * @property overlays
-       * @type YAHOO.widget.Overlay[]
-       */
-       overlays : null,
-
-       /**
-       * Initializes the default configuration of the OverlayManager
-       * @method initDefaultConfig
-       */      
-       initDefaultConfig : function() {
-               /**
-               * The collection of registered Overlays in use by the OverlayManager
-               * @config overlays
-               * @type YAHOO.widget.Overlay[]
-               * @default null
-               */
-               this.cfg.addProperty("overlays", { suppressEvent:true } );
-
-               /**
-               * The default DOM event that should be used to focus an Overlay
-               * @config focusevent
-               * @type String
-               * @default "mousedown"
-               */
-               this.cfg.addProperty("focusevent", { value:"mousedown" } );
-       }, 
-
-       /**
-       * Initializes the OverlayManager
-       * @method init
-       * @param {YAHOO.widget.Overlay[]}       overlays        Optional. A collection of Overlays to register with the manager.
-       * @param {Object}       userConfig              The object literal representing the user configuration of the OverlayManager
-       */
-       init : function(userConfig) {
-               /**
-               * The OverlayManager's Config object used for monitoring configuration properties.
-               * @property cfg
-               * @type YAHOO.util.Config
-               */
-               this.cfg = new YAHOO.util.Config(this);
-
-               this.initDefaultConfig();
-
-               if (userConfig) {
-                       this.cfg.applyConfig(userConfig, true);
-               }
-               this.cfg.fireQueue();
-
-               /**
-               * The currently activated Overlay
-               * @property activeOverlay
-               * @private
-               * @type YAHOO.widget.Overlay
-               */
-               var activeOverlay = null;
-
-               /**
-               * Returns the currently focused Overlay
-               * @method getActive
-               * @return {YAHOO.widget.Overlay}        The currently focused Overlay
-               */
-               this.getActive = function() {
-                       return activeOverlay;
-               };
-
-               /**
-               * Focuses the specified Overlay
-               * @method focus
-               * @param {YAHOO.widget.Overlay} overlay The Overlay to focus
-               * @param {String} overlay       The id of the Overlay to focus
-               */
-               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));
-                               }
-                               this.overlays.sort(this.compareZIndexDesc);
-                       }
-               };
-
-               /**
-               * Removes the specified Overlay from the manager
-               * @method remove
-               * @param {YAHOO.widget.Overlay} overlay The Overlay to remove
-               * @param {String} overlay       The id of the Overlay to remove
-               */
-               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;
-                       }
-               };
-
-               /**
-               * Removes focus from all registered Overlays in the manager
-               * @method blurAll
-               */
-               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 = [];
-               }
-
-               if (overlays) {
-                       this.register(overlays);
-                       this.overlays.sort(this.compareZIndexDesc);
-               }
-       },
-
-       /**
-       * 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.
-       * @method register
-       * @param {YAHOO.widget.Overlay} overlay         An Overlay to register with the manager.
-       * @param {YAHOO.widget.Overlay[]}       overlay         An array of Overlays to register with the manager.
-       * @return       {Boolean}       True if any Overlays are registered.
-       */
-       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);
-                       }
-                       
-                       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++;
-                               }
-                       }
-                       if (regcount > 0) {
-                               return true;
-                       }
-               } else {
-                       return false;
-               }
-       },
-
-       /**
-       * Attempts to locate an Overlay by instance or ID.
-       * @method find
-       * @param {YAHOO.widget.Overlay} overlay         An Overlay to locate within the manager
-       * @param {String}       overlay         An Overlay id to locate within the manager
-       * @return       {YAHOO.widget.Overlay}  The requested Overlay, if found, or null if it cannot be located.
-       */
-       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];
-                               }
-                       }                       
-               }
-               return null;
-       },
-
-       /**
-       * Used for sorting the manager's Overlays by z-index.
-       * @method compareZIndexDesc
-       * @private
-       * @return {Number}      0, 1, or -1, depending on where the Overlay should fall in the stacking order.
-       */
-       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;
-               }
-       },
-
-       /**
-       * Shows all Overlays in the manager.
-       * @method showAll
-       */
-       showAll : function() {
-               for (var o=0;o<this.overlays.length;o++) {
-                       this.overlays[o].show();
-               }
-       },
-
-       /**
-       * Hides all Overlays in the manager.
-       * @method hideAll
-       */
-       hideAll : function() {
-               for (var o=0;o<this.overlays.length;o++) {
-                       this.overlays[o].hide();
-               }
-       },
-
-
-       /**
-       * Returns a string representation of the object.
-       * @method toString
-       * @return {String}      The string representation of the OverlayManager
-       */ 
-       toString : function() {
-               return "OverlayManager";
-       }
-
-};
-
-/**
-* KeyListener is a utility that provides an easy interface for listening for keydown/keyup events fired against DOM elements.
-* @namespace YAHOO.util
-* @class KeyListener
-* @constructor
-* @param {HTMLElement} attachTo        The element or element ID to which the key event should be attached
-* @param {String}      attachTo        The element or element ID to which the key event should be attached
-* @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).
-* @param {Function}    handler         The CustomEvent handler to fire when the key event is detected
-* @param {Object}      handler         An object literal representing the handler. 
-* @param {String}      event           Optional. The event (keydown or keyup) to listen for. Defaults automatically to keydown.
-*/
-YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
-       if (! event) {
-               event = YAHOO.util.KeyListener.KEYDOWN;
-       }
-
-       /**
-       * The CustomEvent fired internally when a key is pressed
-       * @event keyEvent
-       * @private
-       * @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).
-       */
-       var keyEvent = new YAHOO.util.CustomEvent("keyPressed");
-       
-       /**
-       * The CustomEvent fired when the KeyListener is enabled via the enable() function
-       * @event enabledEvent
-       * @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).
-       */
-       this.enabledEvent = new YAHOO.util.CustomEvent("enabled");
-
-       /**
-       * The CustomEvent fired when the KeyListener is disabled via the disable() function
-       * @event disabledEvent
-       * @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).
-       */
-       this.disabledEvent = new YAHOO.util.CustomEvent("disabled");
-
-       if (typeof attachTo == 'string') {
-               attachTo = document.getElementById(attachTo);
-       }
-
-       if (typeof handler == 'function') {
-               keyEvent.subscribe(handler);
-       } else {
-               keyEvent.subscribe(handler.fn, handler.scope, handler.correctScope);
-       }
-
-       /**
-       * Handles the key event when a key is pressed.
-       * @method handleKeyPress
-       * @param {DOMEvent} e   The keypress DOM event
-       * @param {Object}       obj     The DOM event scope object
-       * @private
-       */
-       function handleKeyPress(e, obj) {
-               if (! keyData.shift) {  
-                       keyData.shift = false; 
-               }
-               if (! keyData.alt) {    
-                       keyData.alt = false;
-               }
-               if (! keyData.ctrl) {
-                       keyData.ctrl = false;
-               }
-
-               // check held down modifying keys first
-               if (e.shiftKey == keyData.shift && 
-                       e.altKey   == keyData.alt &&
-                       e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
-                       
-                       var dataItem;
-                       var keyPressed;
-
-                       if (keyData.keys instanceof Array) {
-                               for (var i=0;i<keyData.keys.length;i++) {
-                                       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);
-                               }
-                       }
-               }
-       }
-
-       /**
-       * Enables the KeyListener by attaching the DOM event listeners to the target DOM element
-       * @method enable
-       */
-       this.enable = function() {
-               if (! this.enabled) {
-                       YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);
-                       this.enabledEvent.fire(keyData);
-               }
-               /**
-               * Boolean indicating the enabled/disabled state of the Tooltip
-               * @property enabled
-               * @type Boolean
-               */
-               this.enabled = true;
-       };
-
-       /**
-       * Disables the KeyListener by removing the DOM event listeners from the target DOM element
-       * @method disable
-       */
-       this.disable = function() {
-               if (this.enabled) {
-                       YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);
-                       this.disabledEvent.fire(keyData);
-               }
-               this.enabled = false;
-       };
-
-       /**
-       * Returns a String representation of the object.
-       * @method toString
-       * @return {String}      The string representation of the KeyListener
-       */ 
-       this.toString = function() {
-               return "KeyListener [" + keyData.keys + "] " + attachTo.tagName + (attachTo.id ? "[" + attachTo.id + "]" : "");
-       };
-
-};
-
-/**
-* Constant representing the DOM "keydown" event.
-* @property YAHOO.util.KeyListener.KEYDOWN
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYDOWN = "keydown";
-
-/**
-* Constant representing the DOM "keyup" event.
-* @property YAHOO.util.KeyListener.KEYUP
-* @static
-* @final
-* @type String
-*/
-YAHOO.util.KeyListener.KEYUP = "keyup";
-
-/**
-* ContainerEffect encapsulates animation transitions that are executed when an Overlay is shown or hidden.
-* @namespace YAHOO.widget
-* @class ContainerEffect
-* @constructor
-* @param {YAHOO.widget.Overlay}        overlay         The Overlay that the animation should be associated with
-* @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).
-* @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).
-* @param {HTMLElement} targetElement   Optional. The target element that should be animated during the transition. Defaults to overlay.element.
-* @param {class}       Optional. The animation class to instantiate. Defaults to YAHOO.util.Anim. Other options include YAHOO.util.Motion.
-*/
-YAHOO.widget.ContainerEffect = function(overlay, attrIn, attrOut, targetElement, animClass) {
-       if (! animClass) {
-               animClass = YAHOO.util.Anim;
-       }
-
-       /**
-       * The overlay to animate
-       * @property overlay
-       * @type YAHOO.widget.Overlay
-       */
-       this.overlay = overlay;
-       /**
-       * The animation attributes to use when transitioning into view
-       * @property attrIn
-       * @type Object
-       */
-       this.attrIn = attrIn;
-       /**
-       * The animation attributes to use when transitioning out of view
-       * @property attrOut
-       * @type Object
-       */
-       this.attrOut = attrOut;
-       /**
-       * The target element to be animated
-       * @property targetElement
-       * @type HTMLElement
-       */
-       this.targetElement = targetElement || overlay.element;
-       /**
-       * The animation class to use for animating the overlay
-       * @property animClass
-       * @type class
-       */
-       this.animClass = animClass;
-};
-
-/**
-* Initializes the animation classes and events.
-* @method init
-*/
-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);
-};
-
-/**
-* Triggers the in-animation.
-* @method animateIn
-*/
-YAHOO.widget.ContainerEffect.prototype.animateIn = function() {
-       this.beforeAnimateInEvent.fire();
-       this.animIn.animate();
-};
-
-/**
-* Triggers the out-animation.
-* @method animateOut
-*/
-YAHOO.widget.ContainerEffect.prototype.animateOut = function() {
-       this.beforeAnimateOutEvent.fire();
-       this.animOut.animate();
-};
-
-/**
-* The default onStart handler for the in-animation.
-* @method handleStartAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn = function(type, args, obj) { };
-/**
-* The default onTween handler for the in-animation.
-* @method handleTweenAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn = function(type, args, obj) { };
-/**
-* The default onComplete handler for the in-animation.
-* @method handleCompleteAnimateIn
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn = function(type, args, obj) { };
-
-/**
-* The default onStart handler for the out-animation.
-* @method handleStartAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut = function(type, args, obj) { };
-/**
-* The default onTween handler for the out-animation.
-* @method handleTweenAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut = function(type, args, obj) { };
-/**
-* The default onComplete handler for the out-animation.
-* @method handleCompleteAnimateOut
-* @param {String} type The CustomEvent type
-* @param {Object[]}    args    The CustomEvent arguments
-* @param {Object} obj  The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut = function(type, args, obj) { };
-
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}     The string representation of the ContainerEffect
-*/ 
-YAHOO.widget.ContainerEffect.prototype.toString = function() {
-       var output = "ContainerEffect";
-       if (this.overlay) {
-               output += " [" + this.overlay.toString() + "]";
-       }
-       return output;
-};
-
-/**
-* A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.
-* @method FADE
-* @static
-* @param {Overlay}     overlay The Overlay object to animate
-* @param {Number}      dur     The duration of the animation
-* @return {ContainerEffect}    The configured ContainerEffect object
-*/
-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");
-               }
-
-               if (obj.overlay.underlay) {
-                       obj.initialUnderlayOpacity = YAHOO.util.Dom.getStyle(obj.overlay.underlay, "opacity");
-                       obj.overlay.underlay.style.filter = null;
-               }
-
-               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;
-               }                       
-               
-               if (obj.overlay.underlay) {
-                       YAHOO.util.Dom.setStyle(obj.overlay.underlay, "opacity", obj.initialUnderlayOpacity);
-               }
-
-               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;
-               }                               
-               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;
-};
-
-
-/**
-* A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.
-* @method SLIDE
-* @static
-* @param {Overlay}     overlay The Overlay object to animate
-* @param {Number}      dur     The duration of the animation
-* @return {ContainerEffect}    The configured ContainerEffect object
-*/
-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");
-               }
-
-               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
+    Module.prototype = {
+    
+        /**
+        * The class's constructor function
+        * @property contructor
+        * @type Function
+        */
+        constructor: Module,
+        
+        /**
+        * The main module element that contains the header, body, and footer
+        * @property element
+        * @type HTMLElement
+        */
+        element: null,
+        
+        /**
+        * The header element, denoted with CSS class "hd"
+        * @property header
+        * @type HTMLElement
+        */
+        header: null,
+        
+        /**
+        * The body element, denoted with CSS class "bd"
+        * @property body
+        * @type HTMLElement
+        */
+        body: null,
+        
+        /**
+        * The footer element, denoted with CSS class "ft"
+        * @property footer
+        * @type HTMLElement
+        */
+        footer: null,
+        
+        /**
+        * The id of the element
+        * @property id
+        * @type String
+        */
+        id: null,
+        
+        /**
+        * A string representing the root path for all images created by
+        * a Module instance.
+        * @deprecated It is recommend that any images for a Module be applied
+        * via CSS using the "background-image" property.
+        * @property imageRoot
+        * @type String
+        */
+        imageRoot: Module.IMG_ROOT,
+    
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        * @method initEvents
+        */
+        initEvents: function () {
+        
+            var SIGNATURE = CustomEvent.LIST;
+        
+            /**
+            * CustomEvent fired prior to class initalization.
+            * @event beforeInitEvent
+            * @param {class} classRef class reference of the initializing 
+            * class, such as this.beforeInitEvent.fire(Module)
+            */
+            this.beforeInitEvent = this.createEvent(EVENT_TYPES.BEFORE_INIT);
+            this.beforeInitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after class initalization.
+            * @event initEvent
+            * @param {class} classRef class reference of the initializing 
+            * class, such as this.beforeInitEvent.fire(Module)
+            */  
+            this.initEvent = this.createEvent(EVENT_TYPES.INIT);
+            this.initEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the Module is appended to the DOM
+            * @event appendEvent
+            */
+            this.appendEvent = this.createEvent(EVENT_TYPES.APPEND);
+            this.appendEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired before the Module is rendered
+            * @event beforeRenderEvent
+            */
+            this.beforeRenderEvent = 
+                this.createEvent(EVENT_TYPES.BEFORE_RENDER);
+            this.beforeRenderEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is rendered
+            * @event renderEvent
+            */
+            this.renderEvent = this.createEvent(EVENT_TYPES.RENDER);
+            this.renderEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the header content of the Module 
+            * is modified
+            * @event changeHeaderEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new header content
+            */
+            this.changeHeaderEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_HEADER);
+            this.changeHeaderEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired when the body content of the Module is modified
+            * @event changeBodyEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new body content
+            */  
+            this.changeBodyEvent = this.createEvent(EVENT_TYPES.CHANGE_BODY);
+            this.changeBodyEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired when the footer content of the Module 
+            * is modified
+            * @event changeFooterEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new footer content
+            */
+            this.changeFooterEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
+            this.changeFooterEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the content of the Module is modified
+            * @event changeContentEvent
+            */
+            this.changeContentEvent = 
+                this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
+            this.changeContentEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the Module is destroyed
+            * @event destroyEvent
+            */
+            this.destroyEvent = this.createEvent(EVENT_TYPES.DESTORY);
+            this.destroyEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired before the Module is shown
+            * @event beforeShowEvent
+            */
+            this.beforeShowEvent = this.createEvent(EVENT_TYPES.BEFORE_SHOW);
+            this.beforeShowEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is shown
+            * @event showEvent
+            */
+            this.showEvent = this.createEvent(EVENT_TYPES.SHOW);
+            this.showEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired before the Module is hidden
+            * @event beforeHideEvent
+            */
+            this.beforeHideEvent = this.createEvent(EVENT_TYPES.BEFORE_HIDE);
+            this.beforeHideEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is hidden
+            * @event hideEvent
+            */
+            this.hideEvent = this.createEvent(EVENT_TYPES.HIDE);
+            this.hideEvent.signature = SIGNATURE;
+        }, 
+        
+        /**
+        * String representing the current user-agent platform
+        * @property platform
+        * @type String
+        */
+        platform: function () {
+        
+            var ua = navigator.userAgent.toLowerCase();
+        
+            if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
+        
+                return "windows";
+        
+            } else if (ua.indexOf("macintosh") != -1) {
+        
+                return "mac";
+        
+            } else {
+        
+                return false;
+        
+            }
+        
+        }(),
+        
+        /**
+        * String representing the user-agent of the browser
+        * @deprecated Use YAHOO.env.ua
+        * @property browser
+        * @type String
+        */
+        browser: function () {
+        
+            var ua = navigator.userAgent.toLowerCase();
+            
+            /*
+                 Check Opera first in case of spoof and check Safari before
+                 Gecko since Safari's user agent string includes "like Gecko"
+            */
+
+            if (ua.indexOf('opera') != -1) { 
+            
+                return 'opera';
+            
+            } else if (ua.indexOf('msie 7') != -1) {
+            
+                return 'ie7';
+            
+            } else if (ua.indexOf('msie') != -1) {
+            
+                return 'ie';
+            
+            } else if (ua.indexOf('safari') != -1) { 
+            
+                return 'safari';
+            
+            } else if (ua.indexOf('gecko') != -1) {
+            
+                return 'gecko';
+            
+            } else {
+            
+                return false;
+            
+            }
+        
+        }(),
+        
+        /**
+        * Boolean representing whether or not the current browsing context is 
+        * secure (https)
+        * @property isSecure
+        * @type Boolean
+        */
+        isSecure: function () {
+        
+            if (window.location.href.toLowerCase().indexOf("https") === 0) {
+        
+                return true;
+        
+            } else {
+        
+                return false;
+        
+            }
+        
+        }(),
+        
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        */
+        initDefaultConfig: function () {
+    
+            // Add properties //
+        
+            /**
+            * Specifies whether the Module is visible on the page.
+            * @config visible
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.VISIBLE.key, {
+                handler: this.configVisible, 
+                value: DEFAULT_CONFIG.VISIBLE.value, 
+                validator: DEFAULT_CONFIG.VISIBLE.validator
+            });
+            
+            /**
+            * Object or array of objects representing the ContainerEffect 
+            * classes that are active for animating the container.
+            * @config effect
+            * @type Object
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key, {
+                suppressEvent: DEFAULT_CONFIG.EFFECT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.EFFECT.supercedes
+            });
+            
+            /**
+            * Specifies whether to create a special proxy iframe to monitor 
+            * for user font resizing in the document
+            * @config monitorresize
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key, {
+                handler: this.configMonitorResize,
+                value: DEFAULT_CONFIG.MONITOR_RESIZE.value
+            });
+            
+        },
+        
+        /**
+        * 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.
+        * @method init
+        * @param {String} el The element ID representing the Module <em>OR</em>
+        * @param {HTMLElement} el The element representing the Module
+        * @param {Object} userConfig The configuration Object literal 
+        * containing the configuration that should be set for this module. 
+        * See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
+        
+            var elId, i, child;
+        
+            this.initEvents();
+        
+            this.beforeInitEvent.fire(Module);
+        
+            /**
+            * The Module's Config object used for monitoring 
+            * configuration properties.
+            * @property cfg
+            * @type YAHOO.util.Config
+            */
+            this.cfg = new Config(this);
+        
+            if (this.isSecure) {
+                this.imageRoot = Module.IMG_ROOT_SSL;
+            }
+        
+            if (typeof el == "string") {
+
+                elId = el;
+        
+                el = document.getElementById(el);
+
+                if (! el) {
+
+                    el = (createModuleTemplate()).cloneNode(false);
+
+                    el.id = elId;
+
+                }
+
+            }
+        
+            this.element = el;
+        
+            if (el.id) {
+                this.id = el.id;
+            }
+        
+            child = this.element.firstChild;
+            
+            if (child) {
+
+                do {
+
+                    switch (child.className) {
+    
+                    case Module.CSS_HEADER:
+    
+                        this.header = child;
+    
+                        break;
+    
+                    case Module.CSS_BODY:
+    
+                        this.body = child;
+    
+                        break;
+    
+                    case Module.CSS_FOOTER:
+    
+                        this.footer = child;
+    
+                        break;
+    
+                    }
+                    
+                } while ((child = child.nextSibling));
+            
+            }
+
+        
+            this.initDefaultConfig();
+        
+            Dom.addClass(this.element, Module.CSS_MODULE);
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+        
+            /*
+                Subscribe to the fireQueue() method of Config so that any 
+                queued configuration changes are excecuted upon render of 
+                the Module
+            */ 
+            
+            if (!Config.alreadySubscribed(this.renderEvent, 
+                this.cfg.fireQueue, this.cfg)) {
+
+                this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
+
+            }
+        
+            this.initEvent.fire(Module);
+        },
+        
+        /**
+        * Initialized an empty IFRAME that is placed out of the visible area 
+        * that can be used to detect text resize.
+        * @method initResizeMonitor
+        */
+        initResizeMonitor: function () {
+        
+            var oDoc, 
+                oIFrame, 
+                sHTML;
+        
+            function fireTextResize() {
+        
+                Module.textResizeEvent.fire();
+        
+            }
+        
+            if (!YAHOO.env.ua.opera) {
+        
+                oIFrame = Dom.get("_yuiResizeMonitor");
+        
+                if (!oIFrame) {
+        
+                    oIFrame = document.createElement("iframe");
+        
+                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && 
+                        YAHOO.env.ua.ie) {
+    
+                        oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL;
+    
+                    }
+
+
+                    /*
+                        Need to set "src" attribute of the iframe to 
+                        prevent the browser from reporting duplicate 
+                        cookies. (See SourceForge bug #1721755)
+                    */
+        
+                    if (YAHOO.env.ua.gecko) {
+
+                        sHTML = "<html><head><script " +
+                                "type=\"text/javascript\">" + 
+                                "window.onresize=function(){window.parent." +
+                                "YAHOO.widget.Module.textResizeEvent." +
+                                "fire();};window.parent.YAHOO.widget.Module." +
+                                "textResizeEvent.fire();</script></head>" + 
+                                "<body></body></html>";
+
+                        oIFrame.src = "data:text/html;charset=utf-8," + 
+                            encodeURIComponent(sHTML);
+
+                    }
+
+                    oIFrame.id = "_yuiResizeMonitor";
+                    
+                    /*
+                        Need to set "position" property before inserting the 
+                        iframe into the document or Safari's status bar will 
+                        forever indicate the iframe is loading 
+                        (See SourceForge bug #1723064)
+                    */
+                    
+                    oIFrame.style.position = "absolute";
+                    oIFrame.style.visibility = "hidden";
+        
+                    document.body.appendChild(oIFrame);
+        
+                    oIFrame.style.width = "10em";
+                    oIFrame.style.height = "10em";
+                    oIFrame.style.top = (-1 * oIFrame.offsetHeight) + "px";
+                    oIFrame.style.left = (-1 * oIFrame.offsetWidth) + "px";
+                    oIFrame.style.borderWidth = "0";
+                    oIFrame.style.visibility = "visible";
+        
+                    if (YAHOO.env.ua.webkit) {
+        
+                        oDoc = oIFrame.contentWindow.document;
+        
+                        oDoc.open();
+                        oDoc.close();
+        
+                    }
+
+                }
+        
+                if (oIFrame && oIFrame.contentWindow) {
+
+                    Module.textResizeEvent.subscribe(this.onDomResize, 
+                        this, true);
+        
+                    if (!Module.textResizeInitialized) {
+
+                        if (!Event.on(oIFrame.contentWindow, "resize", 
+                            fireTextResize)) {
+
+                            /*
+                                 This will fail in IE if document.domain has 
+                                 changed, so we must change the listener to 
+                                 use the oIFrame element instead
+                            */
+
+                            Event.on(oIFrame, "resize", fireTextResize);
+
+                        }
+
+                        Module.textResizeInitialized = true;
+
+                    }
+
+                    this.resizeMonitor = oIFrame;
+
+                }
+        
+            }
+        
+        },
+        
+        /**
+        * Event handler fired when the resize monitor element is resized.
+        * @method onDomResize
+        * @param {DOMEvent} e The DOM resize event
+        * @param {Object} obj The scope object passed to the handler
+        */
+        onDomResize: function (e, obj) {
+        
+            var nLeft = -1 * this.resizeMonitor.offsetWidth,
+                nTop = -1 * this.resizeMonitor.offsetHeight;
+        
+            this.resizeMonitor.style.top = nTop + "px";
+            this.resizeMonitor.style.left =  nLeft + "px";
+        
+        },
+        
+        /**
+        * Sets the Module's header content to the HTML specified, or appends 
+        * the passed element to the header. If no header is present, one will 
+        * be automatically created.
+        * @method setHeader
+        * @param {String} headerContent The HTML used to set the header 
+        * <em>OR</em>
+        * @param {HTMLElement} headerContent The HTMLElement to append to 
+        * the header
+        */
+        setHeader: function (headerContent) {
+
+            var oHeader = this.header || (this.header = createHeader());
+        
+            if (typeof headerContent == "string") {
+
+                oHeader.innerHTML = headerContent;
+
+            } else {
+
+                oHeader.innerHTML = "";
+                oHeader.appendChild(headerContent);
+
+            }
+        
+            this.changeHeaderEvent.fire(headerContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the header. If no header is present, 
+        * one will be automatically created.
+        * @method appendToHeader
+        * @param {HTMLElement} element The element to append to the header
+        */
+        appendToHeader: function (element) {
+
+            var oHeader = this.header || (this.header = createHeader());
+        
+            oHeader.appendChild(element);
+
+            this.changeHeaderEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Sets the Module's body content to the HTML specified, or appends the
+        * passed element to the body. If no body is present, one will be 
+        * automatically created.
+        * @method setBody
+        * @param {String} bodyContent The HTML used to set the body <em>OR</em>
+        * @param {HTMLElement} bodyContent The HTMLElement to append to the body
+        */
+        setBody: function (bodyContent) {
+
+            var oBody = this.body || (this.body = createBody());
+        
+            if (typeof bodyContent == "string") {
+
+                oBody.innerHTML = bodyContent;
+
+            } else {
+
+                oBody.innerHTML = "";
+                oBody.appendChild(bodyContent);
+
+            }
+        
+            this.changeBodyEvent.fire(bodyContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the body. If no body is present, one 
+        * will be automatically created.
+        * @method appendToBody
+        * @param {HTMLElement} element The element to append to the body
+        */
+        appendToBody: function (element) {
+
+            var oBody = this.body || (this.body = createBody());
+        
+            oBody.appendChild(element);
+
+            this.changeBodyEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * 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.
+        * @method setFooter
+        * @param {String} footerContent The HTML used to set the footer 
+        * <em>OR</em>
+        * @param {HTMLElement} footerContent The HTMLElement to append to 
+        * the footer
+        */
+        setFooter: function (footerContent) {
+
+            var oFooter = this.footer || (this.footer = createFooter());
+        
+            if (typeof footerContent == "string") {
+
+                oFooter.innerHTML = footerContent;
+
+            } else {
+
+                oFooter.innerHTML = "";
+                oFooter.appendChild(footerContent);
+
+            }
+        
+            this.changeFooterEvent.fire(footerContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the footer. If no footer is present, 
+        * one will be automatically created.
+        * @method appendToFooter
+        * @param {HTMLElement} element The element to append to the footer
+        */
+        appendToFooter: function (element) {
+
+            var oFooter = this.footer || (this.footer = createFooter());
+        
+            oFooter.appendChild(element);
+
+            this.changeFooterEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * 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.
+        * @method render
+        * @param {String} appendToNode The element id to which the Module 
+        * should be appended to prior to rendering <em>OR</em>
+        * @param {HTMLElement} appendToNode The element to which the Module 
+        * should be appended to prior to rendering
+        * @param {HTMLElement} moduleElement OPTIONAL. The element that 
+        * represents the actual Standard Module container.
+        * @return {Boolean} Success or failure of the render
+        */
+        render: function (appendToNode, moduleElement) {
+        
+            var me = this,
+                firstChild;
+        
+            function appendTo(element) {
+                if (typeof element == "string") {
+                    element = document.getElementById(element);
+                }
+        
+                if (element) {
+                    element.appendChild(me.element);
+                    me.appendEvent.fire();
+                }
+            }
+        
+            this.beforeRenderEvent.fire();
+        
+            if (! moduleElement) {
+                moduleElement = this.element;
+            }
+        
+            if (appendToNode) {
+
+                appendTo(appendToNode);
+
+            } else { 
+
+                /*
+                     No node was passed in. If the element is not already in 
+                     the Dom, this fails
+                */
+
+                if (! Dom.inDocument(this.element)) {
+
+
+                    return false;
+
+                }
+
+            }
+        
+            // Need to get everything into the DOM if it isn't already
+        
+            if (this.header && ! Dom.inDocument(this.header)) {
+
+                /*
+                    There is a header, but it's not in the DOM yet... 
+                    need to add it
+                */
+
+                firstChild = moduleElement.firstChild;
+
+                if (firstChild) { // Insert before first child if exists
+
+                    moduleElement.insertBefore(this.header, firstChild);
+
+                } else { // Append to empty body because there are no children
+
+                    moduleElement.appendChild(this.header);
+
+                }
+
+            }
+        
+            if (this.body && ! Dom.inDocument(this.body)) {
+
+                /*
+                     There is a body, but it's not in the DOM yet... 
+                     need to add it
+                */
+
+
+                // Insert before footer if exists in DOM
+
+                if (this.footer && Dom.isAncestor(
+                    this.moduleElement, this.footer)) { 
+
+                    moduleElement.insertBefore(this.body, this.footer);
+
+                } else { // Append to element because there is no footer
+
+                    moduleElement.appendChild(this.body);
+
+                }
+
+            }
+        
+            if (this.footer && ! Dom.inDocument(this.footer)) {
+
+                /*
+                     There is a footer, but it's not in the DOM yet... 
+                     need to add it
+                */
+
+                moduleElement.appendChild(this.footer);
+
+            }
+        
+            this.renderEvent.fire();
+            return true;
+        },
+        
+        /**
+        * Removes the Module element from the DOM and sets all child elements 
+        * to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            var parent,
+                e;
+        
+            if (this.element) {
+                Event.purgeElement(this.element, true);
+                parent = this.element.parentNode;
+            }
+
+            if (parent) {
+                parent.removeChild(this.element);
+            }
+        
+            this.element = null;
+            this.header = null;
+            this.body = null;
+            this.footer = null;
+
+            Module.textResizeEvent.unsubscribe(this.onDomResize, this);
+
+            this.cfg.destroy();
+            this.cfg = null;
+
+            this.destroyEvent.fire();
+        
+            for (e in this) {
+                if (e instanceof CustomEvent) {
+                    e.unsubscribeAll();
+                }
+            }
+
+        },
+        
+        /**
+        * 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.
+        * @method show
+        */
+        show: function () {
+            this.cfg.setProperty("visible", true);
+        },
+        
+        /**
+        * 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.
+        * @method hide
+        */
+        hide: function () {
+            this.cfg.setProperty("visible", false);
+        },
+        
+        // BUILT-IN EVENT HANDLERS FOR MODULE //
+        
+        /**
+        * Default event handler for changing the visibility property of a 
+        * Module. By default, this is achieved by switching the "display" style 
+        * between "block" and "none".
+        * This method is responsible for firing showEvent and hideEvent.
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        * @method configVisible
+        */
+        configVisible: function (type, args, obj) {
+            var visible = args[0];
+            if (visible) {
+                this.beforeShowEvent.fire();
+                Dom.setStyle(this.element, "display", "block");
+                this.showEvent.fire();
+            } else {
+                this.beforeHideEvent.fire();
+                Dom.setStyle(this.element, "display", "none");
+                this.hideEvent.fire();
+            }
+        },
+        
+        /**
+        * Default event handler for the "monitorresize" configuration property
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        * @method configMonitorResize
+        */
+        configMonitorResize: function (type, args, obj) {
+
+            var monitor = args[0];
+
+            if (monitor) {
+
+                this.initResizeMonitor();
+
+            } else {
+
+                Module.textResizeEvent.unsubscribe(
+                    this.onDomResize, this, true);
+
+                this.resizeMonitor = null;
+            }
+
+        },
+        
+        /**
+        * Returns a String representation of the Object.
+        * @method toString
+        * @return {String} The string representation of the Module
+        */
+        toString: function () {
+            return "Module " + this.id;
+        }
+        
+    };
+    
+    YAHOO.lang.augmentProto(Module, YAHOO.util.EventProvider);
+
+}());
+(function () {
+
+    /**
+    * 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.
+    * @namespace YAHOO.widget
+    * @class Overlay
+    * @extends Module
+    * @param {String} el The element ID representing the Overlay <em>OR</em>
+    * @param {HTMLElement} el The element representing the Overlay
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Overlay. See configuration 
+    * documentation for more details.
+    * @constructor
+    */
+    YAHOO.widget.Overlay = function (el, userConfig) {
+    
+        YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
+    
+    };
+
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Module = YAHOO.widget.Module,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        Overlay = YAHOO.widget.Overlay,
+        
+        m_oIFrameTemplate,
+
+        /**
+        * Constant representing the name of the Overlay's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_MOVE": "beforeMove",
+            "MOVE": "move"
+        
+        },
+        
+        /**
+        * Constant representing the Overlay's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "X": { 
+                key: "x", 
+                validator: Lang.isNumber, 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "Y": { 
+                key: "y", 
+                validator: Lang.isNumber, 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "XY": { 
+                key: "xy", 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "CONTEXT": { 
+                key: "context", 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+        
+            "FIXED_CENTER": { 
+                key: "fixedcenter", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["iframe", "visible"] 
+            },
+        
+            "WIDTH": { 
+                key: "width", 
+                suppressEvent: true, 
+                supercedes: ["context", "fixedcenter", "iframe"] 
+            }, 
+        
+            "HEIGHT": { 
+                key: "height", 
+                suppressEvent: true, 
+                supercedes: ["context", "fixedcenter", "iframe"] 
+            }, 
+        
+            "ZINDEX": { 
+                key: "zindex", 
+                value: null 
+            }, 
+        
+            "CONSTRAIN_TO_VIEWPORT": { 
+                key: "constraintoviewport", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["iframe", "x", "y", "xy"] 
+            }, 
+        
+            "IFRAME": { 
+                key: "iframe", 
+                value: (YAHOO.env.ua.ie == 6 ? true : false), 
+                validator: Lang.isBoolean, 
+                supercedes: ["zindex"] 
+            }
+        
+        };
+
+
+    /**
+    * The URL that will be placed in the iframe
+    * @property YAHOO.widget.Overlay.IFRAME_SRC
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.IFRAME_SRC = "javascript:false;";
+
+    /**
+    * Number representing how much the iframe shim should be offset from each 
+    * side of an Overlay instance.
+    * @property YAHOO.widget.Overlay.IFRAME_SRC
+    * @default 3
+    * @static
+    * @final
+    * @type Number
+    */
+    Overlay.IFRAME_OFFSET = 3;
+    
+    /**
+    * Constant representing the top left corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.TOP_LEFT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.TOP_LEFT = "tl";
+    
+    /**
+    * Constant representing the top right corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.TOP_RIGHT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.TOP_RIGHT = "tr";
+    
+    /**
+    * Constant representing the top bottom left corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.BOTTOM_LEFT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.BOTTOM_LEFT = "bl";
+    
+    /**
+    * Constant representing the bottom right corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.BOTTOM_RIGHT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.BOTTOM_RIGHT = "br";
+    
+    /**
+    * Constant representing the default CSS class used for an Overlay
+    * @property YAHOO.widget.Overlay.CSS_OVERLAY
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.CSS_OVERLAY = "yui-overlay";
+    
+    
+    /**
+    * A singleton CustomEvent used for reacting to the DOM event for 
+    * window scroll
+    * @event YAHOO.widget.Overlay.windowScrollEvent
+    */
+    Overlay.windowScrollEvent = new CustomEvent("windowScroll");
+    
+    /**
+    * A singleton CustomEvent used for reacting to the DOM event for
+    * window resize
+    * @event YAHOO.widget.Overlay.windowResizeEvent
+    */
+    Overlay.windowResizeEvent = new CustomEvent("windowResize");
+    
+    /**
+    * The DOM event handler used to fire the CustomEvent for window scroll
+    * @method YAHOO.widget.Overlay.windowScrollHandler
+    * @static
+    * @param {DOMEvent} e The DOM scroll event
+    */
+    Overlay.windowScrollHandler = function (e) {
+    
+        if (YAHOO.env.ua.ie) {
+    
+            if (! window.scrollEnd) {
+    
+                window.scrollEnd = -1;
+    
+            }
+    
+            clearTimeout(window.scrollEnd);
+    
+            window.scrollEnd = setTimeout(function () { 
+            
+                Overlay.windowScrollEvent.fire(); 
+    
+            }, 1);
+    
+        } else {
+    
+            Overlay.windowScrollEvent.fire();
+    
+        }
+    
+    };
+    
+    /**
+    * The DOM event handler used to fire the CustomEvent for window resize
+    * @method YAHOO.widget.Overlay.windowResizeHandler
+    * @static
+    * @param {DOMEvent} e The DOM resize event
+    */
+    Overlay.windowResizeHandler = function (e) {
+    
+        if (YAHOO.env.ua.ie) {
+    
+            if (! window.resizeEnd) {
+                window.resizeEnd = -1;
+            }
+    
+            clearTimeout(window.resizeEnd);
+    
+            window.resizeEnd = setTimeout(function () {
+    
+                Overlay.windowResizeEvent.fire(); 
+    
+            }, 100);
+    
+        } else {
+    
+            Overlay.windowResizeEvent.fire();
+    
+        }
+    
+    };
+    
+    /**
+    * A boolean that indicated whether the window resize and scroll events have 
+    * already been subscribed to.
+    * @property YAHOO.widget.Overlay._initialized
+    * @private
+    * @type Boolean
+    */
+    Overlay._initialized = null;
+    
+    if (Overlay._initialized === null) {
+    
+        Event.on(window, "scroll", Overlay.windowScrollHandler);
+        Event.on(window, "resize", Overlay.windowResizeHandler);
+    
+        Overlay._initialized = true;
+    
+    }
+    
+    YAHOO.extend(Overlay, Module, {
+    
+        /**
+        * The Overlay initialization method, which is executed for Overlay and  
+        * all of its subclasses. This method is automatically called by the 
+        * constructor, and  sets up all DOM references for pre-existing markup, 
+        * and creates required markup if it is not already present.
+        * @method init
+        * @param {String} el The element ID representing the Overlay <em>OR</em>
+        * @param {HTMLElement} el The element representing the Overlay
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Overlay. 
+        * See configuration documentation for more details.
+        */
+        init: function (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
+            */
+    
+            Overlay.superclass.init.call(this, el/*, userConfig*/);  
+            
+            this.beforeInitEvent.fire(Overlay);
+            
+            Dom.addClass(this.element, Overlay.CSS_OVERLAY);
+            
+            if (userConfig) {
+    
+                this.cfg.applyConfig(userConfig, true);
+    
+            }
+            
+            if (this.platform == "mac" && YAHOO.env.ua.gecko) {
+    
+                if (! Config.alreadySubscribed(this.showEvent,
+                    this.showMacGeckoScrollbars, this)) {
+    
+                    this.showEvent.subscribe(this.showMacGeckoScrollbars, 
+                        this, true);
+    
+                }
+    
+                if (! Config.alreadySubscribed(this.hideEvent, 
+                    this.hideMacGeckoScrollbars, this)) {
+    
+                    this.hideEvent.subscribe(this.hideMacGeckoScrollbars, 
+                        this, true);
+    
+                }
+    
+            }
+            
+            this.initEvent.fire(Overlay);
+        
+        },
+        
+        /**
+        * Initializes the custom events for Overlay which are fired  
+        * automatically at appropriate times by the Overlay class.
+        * @method initEvents
+        */
+        initEvents: function () {
+    
+            Overlay.superclass.initEvents.call(this);
+            
+            var SIGNATURE = CustomEvent.LIST;
+            
+            /**
+            * CustomEvent fired before the Overlay is moved.
+            * @event beforeMoveEvent
+            * @param {Number} x x coordinate
+            * @param {Number} y y coordinate
+            */
+            this.beforeMoveEvent = this.createEvent(EVENT_TYPES.BEFORE_MOVE);
+            this.beforeMoveEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired after the Overlay is moved.
+            * @event moveEvent
+            * @param {Number} x x coordinate
+            * @param {Number} y y coordinate
+            */
+            this.moveEvent = this.createEvent(EVENT_TYPES.MOVE);
+            this.moveEvent.signature = SIGNATURE;
+        
+        },
+        
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the Overlay's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+    
+            Overlay.superclass.initDefaultConfig.call(this);
+            
+            
+            // Add overlay config properties //
+            
+            /**
+            * The absolute x-coordinate position of the Overlay
+            * @config x
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.X.key, { 
+    
+                handler: this.configX, 
+                validator: DEFAULT_CONFIG.X.validator, 
+                suppressEvent: DEFAULT_CONFIG.X.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.X.supercedes
+    
+            });
+        
+    
+            /**
+            * The absolute y-coordinate position of the Overlay
+            * @config y
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.Y.key, {
+    
+                handler: this.configY, 
+                validator: DEFAULT_CONFIG.Y.validator, 
+                suppressEvent: DEFAULT_CONFIG.Y.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.Y.supercedes
+    
+            });
+        
+    
+            /**
+            * An array with the absolute x and y positions of the Overlay
+            * @config xy
+            * @type Number[]
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.XY.key, {
+            
+                handler: this.configXY, 
+                suppressEvent: DEFAULT_CONFIG.XY.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.XY.supercedes
+            
+            });
+        
+    
+            /**
+            * 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.
+            * @config context
+            * @type Array
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key, {
+            
+                handler: this.configContext, 
+                suppressEvent: DEFAULT_CONFIG.CONTEXT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.CONTEXT.supercedes
+            
+            });
+        
+    
+            /**
+            * True if the Overlay should be anchored to the center of 
+            * the viewport.
+            * @config fixedcenter
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key, {
+            
+                handler: this.configFixedCenter,
+                value: DEFAULT_CONFIG.FIXED_CENTER.value, 
+                validator: DEFAULT_CONFIG.FIXED_CENTER.validator, 
+                supercedes: DEFAULT_CONFIG.FIXED_CENTER.supercedes
+            
+            });
+        
+    
+            /**
+            * CSS width of the Overlay.
+            * @config width
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key, {
+            
+                handler: this.configWidth, 
+                suppressEvent: DEFAULT_CONFIG.WIDTH.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.WIDTH.supercedes
+            
+            });
+            
+            /**
+            * CSS height of the Overlay.
+            * @config height
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key, {
+            
+                handler: this.configHeight, 
+                suppressEvent: DEFAULT_CONFIG.HEIGHT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.HEIGHT.supercedes
+            
+            });
+            
+            /**
+            * CSS z-index of the Overlay.
+            * @config zIndex
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key, {
+    
+                handler: this.configzIndex,
+                value: DEFAULT_CONFIG.ZINDEX.value
+    
+            });
+            
+            /**
+            * True if the Overlay should be prevented from being positioned 
+            * out of the viewport.
+            * @config constraintoviewport
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, {
+            
+                handler: this.configConstrainToViewport, 
+                value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
+                validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
+                supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes
+            
+            });
+            
+            /**
+            * @config iframe
+            * @description Boolean indicating whether or not the Overlay should 
+            * have an IFRAME shim; used to prevent <SELECT> elements from 
+            * poking through an Overlay instance in IE6.  When set to "true", 
+            * the iframe shim is created when the Overlay instance is intially
+            * made visible.
+            * @type Boolean
+            * @default true for IE6 and below, false for all other browsers.
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key, {
+            
+                handler: this.configIframe, 
+                value: DEFAULT_CONFIG.IFRAME.value, 
+                validator: DEFAULT_CONFIG.IFRAME.validator, 
+                supercedes: DEFAULT_CONFIG.IFRAME.supercedes
+            
+            });
+        
+        },
+        
+        /**
+        * Moves the Overlay to the specified position. This function is  
+        * identical to calling this.cfg.setProperty("xy", [x,y]);
+        * @method moveTo
+        * @param {Number} x The Overlay's new x position
+        * @param {Number} y The Overlay's new y position
+        */
+        moveTo: function (x, y) {
+    
+            this.cfg.setProperty("xy", [x, y]);
+    
+        },
+        
+        /**
+        * Adds a CSS class ("hide-scrollbars") and removes a CSS class 
+        * ("show-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
+        * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435)
+        * @method hideMacGeckoScrollbars
+        */
+        hideMacGeckoScrollbars: function () {
+    
+            Dom.removeClass(this.element, "show-scrollbars");
+            Dom.addClass(this.element, "hide-scrollbars");
+    
+        },
+        
+        /**
+        * Adds a CSS class ("show-scrollbars") and removes a CSS class 
+        * ("hide-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
+        * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435)
+        * @method showMacGeckoScrollbars
+        */
+        showMacGeckoScrollbars: function () {
+    
+            Dom.removeClass(this.element, "hide-scrollbars");
+            Dom.addClass(this.element, "show-scrollbars");
+    
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the "visible" property is 
+        * changed.  This method is responsible for firing showEvent
+        * and hideEvent.
+        * @method configVisible
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configVisible: function (type, args, obj) {
+    
+            var visible = args[0],
+                currentVis = Dom.getStyle(this.element, "visibility"),
+                effect = this.cfg.getProperty("effect"),
+                effectInstances = [],
+                isMacGecko = (this.platform == "mac" && YAHOO.env.ua.gecko),
+                alreadySubscribed = Config.alreadySubscribed,
+                eff, ei, e, i, j, k, h,
+                nEffects,
+                nEffectInstances;
+    
+    
+            if (currentVis == "inherit") {
+    
+                e = this.element.parentNode;
+    
+                while (e.nodeType != 9 && e.nodeType != 11) {
+    
+                    currentVis = Dom.getStyle(e, "visibility");
+    
+                    if (currentVis != "inherit") { 
+    
+                        break; 
+    
+                    }
+    
+                    e = e.parentNode;
+    
+                }
+    
+                if (currentVis == "inherit") {
+    
+                    currentVis = "visible";
+                
+                }
+    
+            }
+        
+    
+            if (effect) {
+    
+                if (effect instanceof Array) {
+
+                    nEffects = effect.length;
+    
+                    for (i = 0; i < nEffects; i++) {
+    
+                        eff = effect[i];
+    
+                        effectInstances[effectInstances.length] = 
+                            eff.effect(this, eff.duration);
+    
+                    }
+    
+                } else {
+    
+                    effectInstances[effectInstances.length] = 
+                        effect.effect(this, effect.duration);
+    
+                }
+    
+            }
+    
+        
+            if (visible) { // Show
+    
+                if (isMacGecko) {
+    
+                    this.showMacGeckoScrollbars();
+    
+                }
+                
+    
+                if (effect) { // Animate in
+    
+    
+                    if (visible) { // Animate in if not showing
+    
+    
+                        if (currentVis != "visible" || currentVis === "") {
+    
+                            this.beforeShowEvent.fire();
+
+                            nEffectInstances = effectInstances.length;
+    
+                            for (j = 0; j < nEffectInstances; j++) {
+    
+                                ei = effectInstances[j];
+    
+                                if (j === 0 && !alreadySubscribed(
+                                        ei.animateInCompleteEvent, 
+                                        this.showEvent.fire, this.showEvent)) {
+    
+                                    /*
+                                         Delegate showEvent until end 
+                                         of animateInComplete
+                                    */
+    
+                                    ei.animateInCompleteEvent.subscribe(
+                                     this.showEvent.fire, this.showEvent, true);
+    
+                                }
+    
+                                ei.animateIn();
+    
+                            }
+    
+                        }
+    
+                    }
+    
+                } else { // Show
+    
+                    if (currentVis != "visible" || currentVis === "") {
+    
+                        this.beforeShowEvent.fire();
+    
+                        Dom.setStyle(this.element, "visibility", "visible");
+    
+                        this.cfg.refireEvent("iframe");
+                        this.showEvent.fire();
+    
+                    }
+        
+                }
+        
+            } else { // Hide
+    
+                if (isMacGecko) {
+    
+                    this.hideMacGeckoScrollbars();
+    
+                }
+                    
+                if (effect) { // Animate out if showing
+    
+                    if (currentVis == "visible") {
+    
+                        this.beforeHideEvent.fire();
+
+                        nEffectInstances = effectInstances.length;
+    
+                        for (k = 0; k < nEffectInstances; k++) {
+    
+                            h = effectInstances[k];
+    
+                            if (k === 0 && !alreadySubscribed(
+                                h.animateOutCompleteEvent, this.hideEvent.fire, 
+                                this.hideEvent)) {
+    
+                                /*
+                                     Delegate hideEvent until end 
+                                     of animateOutComplete
+                                */
+    
+                                h.animateOutCompleteEvent.subscribe(
+                                    this.hideEvent.fire, this.hideEvent, true);
+    
+                            }
+    
+                            h.animateOut();
+    
+                        }
+    
+                    } else if (currentVis === "") {
+    
+                        Dom.setStyle(this.element, "visibility", "hidden");
+    
+                    }
+    
+                } else { // Simple hide
+    
+                    if (currentVis == "visible" || currentVis === "") {
+    
+                        this.beforeHideEvent.fire();
+    
+                        Dom.setStyle(this.element, "visibility", "hidden");
+
+                        this.hideEvent.fire();
+    
+                    }
+    
+                }
+    
+            }
+    
+        },
+        
+        /**
+        * Center event handler used for centering on scroll/resize, but only if 
+        * the Overlay is visible
+        * @method doCenterOnDOMEvent
+        */
+        doCenterOnDOMEvent: function () {
+    
+            if (this.cfg.getProperty("visible")) {
+    
+                this.center();
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "fixedcenter" property 
+        * is changed.
+        * @method configFixedCenter
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configFixedCenter: function (type, args, obj) {
+    
+            var val = args[0],
+                alreadySubscribed = Config.alreadySubscribed,
+                windowResizeEvent = Overlay.windowResizeEvent,
+                windowScrollEvent = Overlay.windowScrollEvent;
+            
+            if (val) {
+    
+                this.center();
+            
+                if (!alreadySubscribed(this.beforeShowEvent, 
+                    this.center, this)) {
+    
+                    this.beforeShowEvent.subscribe(this.center);
+    
+                }
+            
+                if (!alreadySubscribed(windowResizeEvent, 
+                    this.doCenterOnDOMEvent, this)) {
+    
+                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, 
+                        this, true);
+    
+                }
+            
+                if (!alreadySubscribed(windowScrollEvent, 
+                    this.doCenterOnDOMEvent, this)) {
+        
+                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, 
+                        this, true);
+    
+                }
+    
+            } else {
+    
+                this.beforeShowEvent.unsubscribe(this.center);
+    
+                windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
+                windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "height" property is changed.
+        * @method configHeight
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configHeight: function (type, args, obj) {
+    
+            var height = args[0],
+                el = this.element;
+    
+            Dom.setStyle(el, "height", height);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "width" property is changed.
+        * @method configWidth
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configWidth: function (type, args, obj) {
+    
+            var width = args[0],
+                el = this.element;
+    
+            Dom.setStyle(el, "width", width);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "zIndex" property is changed.
+        * @method configzIndex
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configzIndex: function (type, args, obj) {
+    
+            var zIndex = args[0],
+                el = this.element;
+        
+            if (! zIndex) {
+    
+                zIndex = Dom.getStyle(el, "zIndex");
+        
+                if (! zIndex || isNaN(zIndex)) {
+    
+                    zIndex = 0;
+    
+                }
+    
+            }
+            
+            if (this.iframe) {
+    
+                if (zIndex <= 0) {
+    
+                    zIndex = 1;
+    
+                }
+    
+                Dom.setStyle(this.iframe, "zIndex", (zIndex - 1));
+            }
+            
+            Dom.setStyle(el, "zIndex", zIndex);
+            this.cfg.setProperty("zIndex", zIndex, true);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "xy" property is changed.
+        * @method configXY
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configXY: function (type, args, obj) {
+    
+            var pos = args[0],
+                x = pos[0],
+                y = pos[1];
+            
+            this.cfg.setProperty("x", x);
+            this.cfg.setProperty("y", y);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "x" property is changed.
+        * @method configX
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configX: function (type, args, obj) {
+    
+            var x = args[0],
+                y = this.cfg.getProperty("y");
+            
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            Dom.setX(this.element, x, true);
+            
+            this.cfg.setProperty("xy", [x, y], true);
+           
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * The default event handler fired when the "y" property is changed.
+        * @method configY
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configY: function (type, args, obj) {
+    
+            var x = this.cfg.getProperty("x"),
+                y = args[0];
+        
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            
+            this.beforeMoveEvent.fire([x, y]);
+            
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            Dom.setY(this.element, y, true);
+            
+            this.cfg.setProperty("xy", [x, y], true);
+            
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+    
+        },
+        
+        /**
+        * Shows the iframe shim, if it has been enabled.
+        * @method showIframe
+        */
+        showIframe: function () {
+
+            var oIFrame = this.iframe,
+                oParentNode;
+
+            if (oIFrame) {
+    
+                oParentNode = this.element.parentNode;
+
+                if (oParentNode != oIFrame.parentNode) {
+
+                    oParentNode.appendChild(oIFrame);
+                
+                }
+
+                oIFrame.style.display = "block";
+    
+            }
+    
+        },
+        
+        /**
+        * Hides the iframe shim, if it has been enabled.
+        * @method hideIframe
+        */
+        hideIframe: function () {
+    
+            if (this.iframe) {
+    
+                this.iframe.style.display = "none";
+    
+            }
+    
+        },
+
+        /**
+        * Syncronizes the size and position of iframe shim to that of its 
+        * corresponding Overlay instance.
+        * @method syncIframe
+        */
+        syncIframe: function () {
+
+            var oIFrame = this.iframe,
+                oElement = this.element,
+                nOffset = Overlay.IFRAME_OFFSET,
+                nDimensionOffset = (nOffset * 2),
+                aXY;
+
+
+            if (oIFrame) {
+
+                // Size <iframe>
+
+                oIFrame.style.width = 
+                    (oElement.offsetWidth + nDimensionOffset + "px");
+
+                oIFrame.style.height = 
+                    (oElement.offsetHeight + nDimensionOffset + "px");
+
+
+                // Position <iframe>
+
+                aXY = this.cfg.getProperty("xy");
+
+                if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) {
+
+                    this.syncPosition();
+
+                    aXY = this.cfg.getProperty("xy");
+
+                }
+
+                Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]);
+
+            }
+        
+        },
+
+        
+        /**
+        * The default event handler fired when the "iframe" property is changed.
+        * @method configIframe
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configIframe: function (type, args, obj) {
+
+            var bIFrame = args[0];
+
+            function createIFrame() {
+
+                var oIFrame = this.iframe,
+                    oElement = this.element,
+                    oParent,
+                    aXY;
+
+
+                if (!oIFrame) {
+
+                    if (!m_oIFrameTemplate) {
+    
+                        m_oIFrameTemplate = document.createElement("iframe");
+
+                        if (this.isSecure) {
+        
+                            m_oIFrameTemplate.src = Overlay.IFRAME_SRC;
+        
+                        }
+
+                        /*
+                            Set the opacity of the <iframe> to 0 so that it 
+                            doesn't modify the opacity of any transparent 
+                            elements that may be on top of it (like a shadow).
+                        */
+        
+                        if (YAHOO.env.ua.ie) {
+        
+                            m_oIFrameTemplate.style.filter = "alpha(opacity=0)";
+        
+                            /*
+                                 Need to set the "frameBorder" property to 0 
+                                 supress the default <iframe> border in IE.  
+                                 Setting the CSS "border" property alone 
+                                 doesn't supress it.
+                            */
+        
+                            m_oIFrameTemplate.frameBorder = 0;
+        
+                        }
+                        else {
+        
+                            m_oIFrameTemplate.style.opacity = "0";
+                        
+                        }
+
+                        m_oIFrameTemplate.style.position = "absolute";
+                        m_oIFrameTemplate.style.border = "none";
+                        m_oIFrameTemplate.style.margin = "0";
+                        m_oIFrameTemplate.style.padding = "0";
+                        m_oIFrameTemplate.style.display = "none";
+    
+                    }
+
+                    oIFrame = m_oIFrameTemplate.cloneNode(false);
+
+                    oParent = oElement.parentNode;
+
+                    if (oParent) {
+
+                        oParent.appendChild(oIFrame);
+
+                    } else {
+
+                        document.body.appendChild(oIFrame);
+
+                    }
+                    
+                    this.iframe = oIFrame;
+
+                }
+
+
+                /*
+                     Show the <iframe> before positioning it since the "setXY" 
+                     method of DOM requires the element be in the document 
+                     and visible.
+                */
+
+                this.showIframe();
+
+
+                /*
+                     Syncronize the size and position of the <iframe> to that 
+                     of the Overlay.
+                */
+                
+                this.syncIframe();
+
+
+                // Add event listeners to update the <iframe> when necessary
+
+                if (!this._hasIframeEventListeners) {
+
+                    this.showEvent.subscribe(this.showIframe);
+                    this.hideEvent.subscribe(this.hideIframe);
+                    this.changeContentEvent.subscribe(this.syncIframe);
+
+                    this._hasIframeEventListeners = true;
+                    
+                }
+                
+            }
+
+
+            function onBeforeShow() {
+            
+                createIFrame.call(this);
+        
+                this.beforeShowEvent.unsubscribe(onBeforeShow);
+                
+                this._iframeDeferred = false;
+            
+            }
+            
+
+            if (bIFrame) { // <iframe> shim is enabled
+                
+                if (this.cfg.getProperty("visible")) {
+
+                    createIFrame.call(this);
+                
+                }
+                else {
+
+                    if (!this._iframeDeferred) {
+
+                        this.beforeShowEvent.subscribe(onBeforeShow);
+
+                        this._iframeDeferred = true;
+                    
+                    }
+                
+                }
+    
+            } else {    // <iframe> shim is disabled
+    
+                this.hideIframe();
+
+                if (this._hasIframeEventListeners) {
+
+                    this.showEvent.unsubscribe(this.showIframe);
+                    this.hideEvent.unsubscribe(this.hideIframe);
+                    this.changeContentEvent.unsubscribe(this.syncIframe);
+
+                    this._hasIframeEventListeners = false;
+
+                }
+                
+            }
+    
+        },
+        
+        
+        /**
+        * The default event handler fired when the "constraintoviewport" 
+        * property is changed.
+        * @method configConstrainToViewport
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for 
+        * the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configConstrainToViewport: function (type, args, obj) {
+    
+            var val = args[0];
+    
+            if (val) {
+    
+                if (! Config.alreadySubscribed(this.beforeMoveEvent, 
+                    this.enforceConstraints, this)) {
+    
+                    this.beforeMoveEvent.subscribe(this.enforceConstraints, 
+                        this, true);
+    
+                }
+    
+            } else {
+    
+                this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);
+    
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "context" property 
+        * is changed.
+        * @method configContext
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configContext: function (type, args, obj) {
+    
+            var contextArgs = args[0],
+                contextEl,
+                elementMagnetCorner,
+                contextMagnetCorner;
+            
+            if (contextArgs) {
+            
+                contextEl = contextArgs[0];
+                elementMagnetCorner = contextArgs[1];
+                contextMagnetCorner = contextArgs[2];
+                
+                if (contextEl) {
+    
+                    if (typeof contextEl == "string") {
+    
+                        this.cfg.setProperty("context", 
+                            [document.getElementById(contextEl), 
+                                elementMagnetCorner, contextMagnetCorner], 
+                                true);
+    
+                    }
+                    
+                    if (elementMagnetCorner && contextMagnetCorner) {
+    
+                        this.align(elementMagnetCorner, contextMagnetCorner);
+    
+                    }
+    
+                }
+    
+            }
+    
+        },
+        
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * Aligns the Overlay to its context element using the specified corner 
+        * points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, 
+        * and BOTTOM_RIGHT.
+        * @method align
+        * @param {String} elementAlign  The String representing the corner of 
+        * the Overlay that should be aligned to the context element
+        * @param {String} contextAlign  The corner of the context element 
+        * that the elementAlign corner should stick to.
+        */
+        align: function (elementAlign, contextAlign) {
+    
+            var contextArgs = this.cfg.getProperty("context"),
+                me = this,
+                context,
+                element,
+                contextRegion;
+    
+    
+            function doAlign(v, h) {
+    
+                switch (elementAlign) {
+    
+                case Overlay.TOP_LEFT:
+    
+                    me.moveTo(h, v);
+    
+                    break;
+    
+                case Overlay.TOP_RIGHT:
+    
+                    me.moveTo((h - element.offsetWidth), v);
+    
+                    break;
+    
+                case Overlay.BOTTOM_LEFT:
+    
+                    me.moveTo(h, (v - element.offsetHeight));
+    
+                    break;
+    
+                case Overlay.BOTTOM_RIGHT:
+    
+                    me.moveTo((h - element.offsetWidth), 
+                        (v - element.offsetHeight));
+    
+                    break;
+    
+                }
+    
+            }
+    
+    
+            if (contextArgs) {
+            
+                context = contextArgs[0];
+                element = this.element;
+                me = this;
+                
+                if (! elementAlign) {
+    
+                    elementAlign = contextArgs[1];
+    
+                }
+                
+                if (! contextAlign) {
+    
+                    contextAlign = contextArgs[2];
+    
+                }
+                
+                if (element && context) {
+    
+                    contextRegion = Dom.getRegion(context);
+                    
+                    switch (contextAlign) {
+    
+                    case Overlay.TOP_LEFT:
+    
+                        doAlign(contextRegion.top, contextRegion.left);
+    
+                        break;
+    
+                    case Overlay.TOP_RIGHT:
+    
+                        doAlign(contextRegion.top, contextRegion.right);
+    
+                        break;
+    
+                    case Overlay.BOTTOM_LEFT:
+    
+                        doAlign(contextRegion.bottom, contextRegion.left);
+    
+                        break;
+    
+                    case Overlay.BOTTOM_RIGHT:
+    
+                        doAlign(contextRegion.bottom, contextRegion.right);
+    
+                        break;
+    
+                    }
+    
+                }
+    
+            }
+            
+        },
+        
+        /**
+        * The default event handler executed when the moveEvent is fired, if the 
+        * "constraintoviewport" is set to true.
+        * @method enforceConstraints
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        enforceConstraints: function (type, args, obj) {
+    
+            var pos = args[0],
+                x = pos[0],
+                y = pos[1],
+                offsetHeight = this.element.offsetHeight,
+                offsetWidth = this.element.offsetWidth,
+                viewPortWidth = Dom.getViewportWidth(),
+                viewPortHeight = Dom.getViewportHeight(),
+                scrollX = Dom.getDocumentScrollLeft(),
+                scrollY = Dom.getDocumentScrollTop(),
+                topConstraint = scrollY + 10,
+                leftConstraint = scrollX + 10,
+                bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,
+                rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;
+        
+    
+            if (x < leftConstraint) {
+    
+                x = leftConstraint;
+    
+            } else if (x > rightConstraint) {
+    
+                x = rightConstraint;
+    
+            }
+            
+            if (y < topConstraint) {
+    
+                y = topConstraint;
+    
+            } else if (y > bottomConstraint) {
+    
+                y = bottomConstraint;
+    
+            }
+            
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+            this.cfg.setProperty("xy", [x, y], true);
+    
+        },
+        
+        /**
+        * Centers the container in the viewport.
+        * @method center
+        */
+        center: function () {
+    
+            var scrollX = Dom.getDocumentScrollLeft(),
+                scrollY = Dom.getDocumentScrollTop(),
+    
+                viewPortWidth = Dom.getClientWidth(),
+                viewPortHeight = Dom.getClientHeight(),
+                elementWidth = this.element.offsetWidth,
+                elementHeight = this.element.offsetHeight,
+                x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX,
+                y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
+            
+            this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
+            
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * 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.
+        * @method syncPosition
+        */
+        syncPosition: function () {
+    
+            var pos = Dom.getXY(this.element);
+    
+            this.cfg.setProperty("x", pos[0], true);
+            this.cfg.setProperty("y", pos[1], true);
+            this.cfg.setProperty("xy", pos, true);
+    
+        },
+        
+        /**
+        * Event handler fired when the resize monitor element is resized.
+        * @method onDomResize
+        * @param {DOMEvent} e The resize DOM event
+        * @param {Object} obj The scope object
+        */
+        onDomResize: function (e, obj) {
+    
+            var me = this;
+    
+            Overlay.superclass.onDomResize.call(this, e, obj);
+    
+            setTimeout(function () {
+                me.syncPosition();
+                me.cfg.refireEvent("iframe");
+                me.cfg.refireEvent("context");
+            }, 0);
+    
+        },
+
+        /**
+        * Places the Overlay on top of all other instances of 
+        * YAHOO.widget.Overlay.
+        * @method bringToTop
+        */
+        bringToTop: function() {
+    
+            var aOverlays = [],
+                oElement = this.element;
+    
+            function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {
+        
+                var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
+        
+                    sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),
+        
+                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 
+                        0 : parseInt(sZIndex1, 10),
+        
+                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 
+                        0 : parseInt(sZIndex2, 10);
+        
+                if (nZIndex1 > nZIndex2) {
+        
+                    return -1;
+        
+                } else if (nZIndex1 < nZIndex2) {
+        
+                    return 1;
+        
+                } else {
+        
+                    return 0;
+        
+                }
+        
+            }
+        
+            function isOverlayElement(p_oElement) {
+        
+                var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
+                    Panel = YAHOO.widget.Panel;
+            
+                if (oOverlay && !Dom.isAncestor(oElement, oOverlay)) {
+                
+                    if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
+        
+                        aOverlays[aOverlays.length] = p_oElement.parentNode;
+                    
+                    }
+                    else {
+        
+                        aOverlays[aOverlays.length] = p_oElement;
+        
+                    }
+                
+                }
+            
+            }
+            
+            Dom.getElementsBy(isOverlayElement, "DIV", document.body);
+    
+            aOverlays.sort(compareZIndexDesc);
+            
+            var oTopOverlay = aOverlays[0],
+                nTopZIndex;
+            
+            if (oTopOverlay) {
+    
+                nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");
+    
+                if (!isNaN(nTopZIndex) && oTopOverlay != oElement) {
+    
+                    this.cfg.setProperty("zindex", 
+                        (parseInt(nTopZIndex, 10) + 2));
+    
+                }
+            
+            }
+        
+        },
+        
+        /**
+        * Removes the Overlay element from the DOM and sets all child 
+        * elements to null.
+        * @method destroy
+        */
+        destroy: function () {
+    
+            if (this.iframe) {
+    
+                this.iframe.parentNode.removeChild(this.iframe);
+    
+            }
+        
+            this.iframe = null;
+        
+            Overlay.windowResizeEvent.unsubscribe(
+                this.doCenterOnDOMEvent, this);
+    
+            Overlay.windowScrollEvent.unsubscribe(
+                this.doCenterOnDOMEvent, this);
+        
+            Overlay.superclass.destroy.call(this);
+        },
+        
+        /**
+        * Returns a String representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Overlay.
+        */
+        toString: function () {
+    
+            return "Overlay " + this.id;
+    
+        }
+    
+    });
+    
+}());
+(function () {
+    
+    /**
+    * OverlayManager is used for maintaining the focus status of 
+    * multiple Overlays.
+    * @namespace YAHOO.widget
+    * @namespace YAHOO.widget
+    * @class OverlayManager
+    * @constructor
+    * @param {Array} overlays Optional. A collection of Overlays to register 
+    * with the manager.
+    * @param {Object} userConfig  The object literal representing the user 
+    * configuration of the OverlayManager
+    */
+    YAHOO.widget.OverlayManager = function (userConfig) {
+    
+        this.init(userConfig);
+    
+    };
+
+
+    var Overlay = YAHOO.widget.Overlay,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        CustomEvent = YAHOO.util.CustomEvent,
+        OverlayManager = YAHOO.widget.OverlayManager;
+
+    
+    /**
+    * The CSS class representing a focused Overlay
+    * @property OverlayManager.CSS_FOCUSED
+    * @static
+    * @final
+    * @type String
+    */
+    OverlayManager.CSS_FOCUSED = "focused";
+    
+    OverlayManager.prototype = {
+    
+        /**
+        * The class's constructor function
+        * @property contructor
+        * @type Function
+        */
+        constructor: OverlayManager,
+        
+        /**
+        * The array of Overlays that are currently registered
+        * @property overlays
+        * @type YAHOO.widget.Overlay[]
+        */
+        overlays: null,
+        
+        /**
+        * Initializes the default configuration of the OverlayManager
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+        
+            /**
+            * The collection of registered Overlays in use by 
+            * the OverlayManager
+            * @config overlays
+            * @type YAHOO.widget.Overlay[]
+            * @default null
+            */
+            this.cfg.addProperty("overlays", { suppressEvent: true } );
+        
+            /**
+            * The default DOM event that should be used to focus an Overlay
+            * @config focusevent
+            * @type String
+            * @default "mousedown"
+            */
+            this.cfg.addProperty("focusevent", { value: "mousedown" } );
+        
+        },
+        
+        /**
+        * Initializes the OverlayManager
+        * @method init
+        * @param {Overlay[]} overlays Optional. A collection of Overlays to 
+        * register with the manager.
+        * @param {Object} userConfig  The object literal representing the user 
+        * configuration of the OverlayManager
+        */
+        init: function (userConfig) {
+
+            /**
+            * The OverlayManager's Config object used for monitoring 
+            * configuration properties.
+            * @property cfg
+            * @type Config
+            */
+            this.cfg = new Config(this);
+        
+            this.initDefaultConfig();
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+            this.cfg.fireQueue();
+        
+            /**
+            * The currently activated Overlay
+            * @property activeOverlay
+            * @private
+            * @type YAHOO.widget.Overlay
+            */
+            var activeOverlay = null;
+        
+            /**
+            * Returns the currently focused Overlay
+            * @method getActive
+            * @return {Overlay} The currently focused Overlay
+            */
+            this.getActive = function () {
+                return activeOverlay;
+            };
+        
+            /**
+            * Focuses the specified Overlay
+            * @method focus
+            * @param {Overlay} overlay The Overlay to focus
+            * @param {String} overlay The id of the Overlay to focus
+            */
+            this.focus = function (overlay) {
+        
+                var o = this.find(overlay);
+        
+                if (o) {
+        
+                    if (activeOverlay != o) {
+        
+                        if (activeOverlay) {
+        
+                            activeOverlay.blur();
+        
+                        }
+        
+                        this.bringToTop(o);
+                        
+                        activeOverlay = o;
+        
+                        Dom.addClass(activeOverlay.element, 
+                            OverlayManager.CSS_FOCUSED);
+
+                        o.focusEvent.fire();
+                        
+                    }
+        
+                }
+        
+            };
+        
+            /**
+            * Removes the specified Overlay from the manager
+            * @method remove
+            * @param {Overlay} overlay The Overlay to remove
+            * @param {String} overlay The id of the Overlay to remove
+            */
+            this.remove = function (overlay) {
+    
+                var o = this.find(overlay),
+                    originalZ;
+        
+                if (o) {
+
+                    if (activeOverlay == o) {
+                    
+                        activeOverlay = null;
+                    
+                    }
+
+                    originalZ = Dom.getStyle(o.element, "zIndex");
+
+                    o.cfg.setProperty("zIndex", -1000, true);
+
+                    this.overlays.sort(this.compareZIndexDesc);
+
+                    this.overlays = 
+                        this.overlays.slice(0, (this.overlays.length - 1));
+        
+                    o.hideEvent.unsubscribe(o.blur);
+                    o.destroyEvent.unsubscribe(this._onOverlayDestroy, o);
+        
+                    if (o.element) {
+        
+                        Event.removeListener(o.element, 
+                            this.cfg.getProperty("focusevent"), 
+                            this._onOverlayElementFocus);
+        
+                    }
+        
+                    o.cfg.setProperty("zIndex", originalZ, true);
+                    o.cfg.setProperty("manager", null);
+        
+                    o.focusEvent.unsubscribeAll();
+                    o.blurEvent.unsubscribeAll();
+        
+                    o.focusEvent = null;
+                    o.blurEvent = null;
+        
+                    o.focus = null;
+                    o.blur = null;
+                }
+
+            };
+        
+            /**
+            * Removes focus from all registered Overlays in the manager
+            * @method blurAll
+            */
+            this.blurAll = function () {
+    
+                var nOverlays = this.overlays.length,
+                    i;
+
+                if (nOverlays > 0) {
+
+                    i = nOverlays - 1;
+                    
+                    do {
+
+                        this.overlays[i].blur();                    
+                    
+                    }
+                    while(i--);
+                
+                }
+    
+            };
+        
+        
+            this._onOverlayBlur = function (p_sType, p_aArgs) {
+
+                activeOverlay = null;
+
+            };
+        
+        
+            var overlays = this.cfg.getProperty("overlays");
+        
+            if (! this.overlays) {
+                this.overlays = [];
+            }
+        
+            if (overlays) {
+                this.register(overlays);
+                this.overlays.sort(this.compareZIndexDesc);
+            }
+        },
+        
+        
+        /**
+        * @method _onOverlayElementFocus
+        * @description Event handler for the DOM event that is used to focus 
+        * the Overlay instance as specified by the "focusevent" 
+        * configuration property.
+        * @private
+        * @param {Event} p_oEvent Object representing the DOM event 
+        * object passed back by the event utility (Event).
+        */
+        _onOverlayElementFocus: function (p_oEvent) {
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                oClose = this.close;
+        
+            
+            if (oClose && (oTarget == oClose || 
+                    Dom.isAncestor(oClose, oTarget))) {
+            
+                this.blur();
+            
+            }
+            else {
+            
+                this.focus();
+            
+            }
+        
+        },
+        
+        
+        /**
+        * @method _onOverlayDestroy
+        * @description "destroy" event handler for the Overlay.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {Overlay} p_oOverlay Object representing the menu that 
+        * fired the event.
+        */
+        _onOverlayDestroy: function (p_sType, p_aArgs, p_oOverlay) {
+        
+            this.remove(p_oOverlay);
+        
+        },
+        
+        /**
+        * 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.
+        * @method register
+        * @param {Overlay} overlay  An Overlay to register with the manager.
+        * @param {Overlay[]} overlay  An array of Overlays to register with 
+        * the manager.
+        * @return {Boolean} True if any Overlays are registered.
+        */
+        register: function (overlay) {
+        
+            var mgr = this,
+                zIndex,
+                regcount,
+                i,
+                nOverlays;
+        
+            if (overlay instanceof Overlay) {
+
+                overlay.cfg.addProperty("manager", { value: this } );
+        
+                overlay.focusEvent = overlay.createEvent("focus");
+                overlay.focusEvent.signature = CustomEvent.LIST;
+        
+                overlay.blurEvent = overlay.createEvent("blur");
+                overlay.blurEvent.signature = CustomEvent.LIST;
+        
+                overlay.focus = function () {
+                    mgr.focus(this);
+                };
+        
+                overlay.blur = function () {
+    
+                    if (mgr.getActive() == this) {
+
+                        Dom.removeClass(this.element, 
+                            OverlayManager.CSS_FOCUSED);
+
+                        this.blurEvent.fire();
+
+                    }
+
+                };
+        
+                overlay.blurEvent.subscribe(mgr._onOverlayBlur);
+        
+                overlay.hideEvent.subscribe(overlay.blur);
+                
+                overlay.destroyEvent.subscribe(this._onOverlayDestroy, 
+                    overlay, this);
+        
+                Event.on(overlay.element, this.cfg.getProperty("focusevent"), 
+                    this._onOverlayElementFocus, null, overlay);
+        
+                zIndex = Dom.getStyle(overlay.element, "zIndex");
+
+                if (!isNaN(zIndex)) {
+
+                    overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));
+
+                } else {
+
+                    overlay.cfg.setProperty("zIndex", 0);
+
+                }
+        
+
+                this.overlays.push(overlay);
+
+                this.bringToTop(overlay);
+
+                return true;
+
+            } else if (overlay instanceof Array) {
+
+                regcount = 0;
+                nOverlays = overlay.length;
+
+                for (i = 0; i < nOverlays; i++) {
+
+                    if (this.register(overlay[i])) {
+
+                        regcount++;
+
+                    }
+                }
+
+                if (regcount > 0) {
+
+                    return true;
+
+                }
+
+            } else {
+
+                return false;
+
+            }
+
+        },
+
+        /**
+        * Places the specified Overlay instance on top of all other 
+        * Overlay instances.
+        * @method bringToTop
+        * @param {YAHOO.widget.Overlay} p_oOverlay Object representing an 
+        * Overlay instance.
+        * @param {String} p_oOverlay String representing the id of an 
+        * Overlay instance.
+        */        
+        bringToTop: function (p_oOverlay) {
+
+            var oOverlay = this.find(p_oOverlay),
+                nTopZIndex,
+                oTopOverlay,
+                aOverlays;
+
+            if (oOverlay) {
+
+                aOverlays = this.overlays;
+
+                aOverlays.sort(this.compareZIndexDesc);
+                
+                oTopOverlay = aOverlays[0];
+                
+                if (oTopOverlay) {
+
+                    nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex");
+    
+                    if (!isNaN(nTopZIndex) && oTopOverlay != oOverlay) {
+    
+                        oOverlay.cfg.setProperty("zIndex", 
+                            (parseInt(nTopZIndex, 10) + 2));
+    
+                    }
+    
+                    aOverlays.sort(this.compareZIndexDesc);
+                
+                }
+
+            }
+        
+        },
+        
+        /**
+        * Attempts to locate an Overlay by instance or ID.
+        * @method find
+        * @param {Overlay} overlay  An Overlay to locate within the manager
+        * @param {String} overlay  An Overlay id to locate within the manager
+        * @return {Overlay} The requested Overlay, if found, or null if it 
+        * cannot be located.
+        */
+        find: function (overlay) {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+
+                i = nOverlays - 1;
+
+                if (overlay instanceof Overlay) {
+
+                    do {
+
+                        if (aOverlays[i] == overlay) {
+
+                            return aOverlays[i];
+
+                        }
+                    
+                    }
+                    while(i--);
+
+                } else if (typeof overlay == "string") {
+
+                    do {
+
+                        if (aOverlays[i].id == overlay) {
+
+                            return aOverlays[i];
+
+                        }
+
+                    }
+                    while(i--);
+
+                }
+
+                return null;
+            
+            }
+
+        },
+        
+        /**
+        * Used for sorting the manager's Overlays by z-index.
+        * @method compareZIndexDesc
+        * @private
+        * @return {Number} 0, 1, or -1, depending on where the Overlay should 
+        * fall in the stacking order.
+        */
+        compareZIndexDesc: function (o1, o2) {
+    
+            var zIndex1 = o1.cfg.getProperty("zIndex"),
+                zIndex2 = o2.cfg.getProperty("zIndex");
+        
+            if (zIndex1 > zIndex2) {
+                return -1;
+            } else if (zIndex1 < zIndex2) {
+                return 1;
+            } else {
+                return 0;
+            }
+        },
+        
+        /**
+        * Shows all Overlays in the manager.
+        * @method showAll
+        */
+        showAll: function () {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+            
+                i = nOverlays - 1;
+                
+                do {
+
+                    aOverlays[i].show();
+                
+                }
+                while(i--);
+            
+            }
+    
+        },
+        
+        /**
+        * Hides all Overlays in the manager.
+        * @method hideAll
+        */
+        hideAll: function () {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+            
+                i = nOverlays - 1;
+                
+                do {
+
+                    aOverlays[i].hide();
+                
+                }
+                while(i--);
+            
+            }
+    
+        },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the OverlayManager
+        */
+        toString: function () {
+            return "OverlayManager";
+        }
+    
+    };
+
+}());
+(function () {
+
+    /**
+    * ContainerEffect encapsulates animation transitions that are executed when 
+    * an Overlay is shown or hidden.
+    * @namespace YAHOO.widget
+    * @class ContainerEffect
+    * @constructor
+    * @param {YAHOO.widget.Overlay} overlay The Overlay that the animation 
+    * should be associated with
+    * @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. Easing.easeIn).
+    * @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. Easing.easeIn).
+    * @param {HTMLElement} targetElement Optional. The target element that  
+    * should be animated during the transition. Defaults to overlay.element.
+    * @param {class} Optional. The animation class to instantiate. Defaults to 
+    * YAHOO.util.Anim. Other options include YAHOO.util.Motion.
+    */
+    YAHOO.widget.ContainerEffect = 
+    
+        function (overlay, attrIn, attrOut, targetElement, animClass) {
+    
+        if (!animClass) {
+            animClass = YAHOO.util.Anim;
+        }
+        
+        /**
+        * The overlay to animate
+        * @property overlay
+        * @type YAHOO.widget.Overlay
+        */
+        this.overlay = overlay;
+    
+        /**
+        * The animation attributes to use when transitioning into view
+        * @property attrIn
+        * @type Object
+        */
+        this.attrIn = attrIn;
+    
+        /**
+        * The animation attributes to use when transitioning out of view
+        * @property attrOut
+        * @type Object
+        */
+        this.attrOut = attrOut;
+    
+        /**
+        * The target element to be animated
+        * @property targetElement
+        * @type HTMLElement
+        */
+        this.targetElement = targetElement || overlay.element;
+    
+        /**
+        * The animation class to use for animating the overlay
+        * @property animClass
+        * @type class
+        */
+        this.animClass = animClass;
+    
+    };
+
+
+    var Dom = YAHOO.util.Dom,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Easing = YAHOO.util.Easing,
+        ContainerEffect = YAHOO.widget.ContainerEffect;
+
+
+    /**
+    * A pre-configured ContainerEffect instance that can be used for fading 
+    * an overlay in and out.
+    * @method FADE
+    * @static
+    * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate
+    * @param {Number} dur The duration of the animation
+    * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
+    */
+    ContainerEffect.FADE = function (overlay, dur) {
+    
+        var fade = new ContainerEffect(overlay, 
+        
+            { attributes: { opacity: { from: 0, to: 1 } }, 
+                duration: dur, 
+                method: Easing.easeIn }, 
+            
+            { attributes: { opacity: { to: 0 } },
+                duration: dur, 
+                method: Easing.easeOut }, 
+            
+            overlay.element);
+        
+    
+        fade.handleStartAnimateIn = function (type,args,obj) {
+            Dom.addClass(obj.overlay.element, "hide-select");
+        
+            if (! obj.overlay.underlay) {
+                obj.overlay.cfg.refireEvent("underlay");
+            }
+        
+            if (obj.overlay.underlay) {
+    
+                obj.initialUnderlayOpacity = 
+                    Dom.getStyle(obj.overlay.underlay, "opacity");
+    
+                obj.overlay.underlay.style.filter = null;
+    
+            }
+        
+            Dom.setStyle(obj.overlay.element, "visibility", "visible");
+            Dom.setStyle(obj.overlay.element, "opacity", 0);
+        };
+        
+    
+        fade.handleCompleteAnimateIn = function (type,args,obj) {
+            Dom.removeClass(obj.overlay.element, "hide-select");
+        
+            if (obj.overlay.element.style.filter) {
+                obj.overlay.element.style.filter = null;
+            }
+        
+            if (obj.overlay.underlay) {
+                Dom.setStyle(obj.overlay.underlay, "opacity", 
+                    obj.initialUnderlayOpacity);
+            }
+        
+            obj.overlay.cfg.refireEvent("iframe");
+            obj.animateInCompleteEvent.fire();
+        };
+        
+    
+        fade.handleStartAnimateOut = function (type, args, obj) {
+            Dom.addClass(obj.overlay.element, "hide-select");
+        
+            if (obj.overlay.underlay) {
+                obj.overlay.underlay.style.filter = null;
+            }
+        };
+        
+    
+        fade.handleCompleteAnimateOut =  function (type, args, obj) {
+            Dom.removeClass(obj.overlay.element, "hide-select");
+            if (obj.overlay.element.style.filter) {
+                obj.overlay.element.style.filter = null;
+            }
+            Dom.setStyle(obj.overlay.element, "visibility", "hidden");
+            Dom.setStyle(obj.overlay.element, "opacity", 1);
+        
+            obj.overlay.cfg.refireEvent("iframe");
+        
+            obj.animateOutCompleteEvent.fire();
+        };
+        
+        fade.init();
+        return fade;
+    };
+    
+    
+    /**
+    * A pre-configured ContainerEffect instance that can be used for sliding an 
+    * overlay in and out.
+    * @method SLIDE
+    * @static
+    * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate
+    * @param {Number} dur The duration of the animation
+    * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
+    */
+    ContainerEffect.SLIDE = function (overlay, dur) {
+    
+        var x = overlay.cfg.getProperty("x") || Dom.getX(overlay.element),
+    
+            y = overlay.cfg.getProperty("y") || Dom.getY(overlay.element),
+    
+            clientWidth = Dom.getClientWidth(),
+    
+            offsetWidth = overlay.element.offsetWidth,
+    
+            slide = new ContainerEffect(overlay, 
+            
+            { attributes: { points: { to: [x, y] } },
+                duration: dur,
+                method: Easing.easeIn },
+    
+            { attributes: { points: { to: [(clientWidth + 25), y] } },
+                duration: dur,
+                method: Easing.easeOut },
+    
+            overlay.element, YAHOO.util.Motion);
+        
+        
+        slide.handleStartAnimateIn = function (type,args,obj) {
+            obj.overlay.element.style.left = ((-25) - offsetWidth) + "px";
+            obj.overlay.element.style.top  = y + "px";
+        };
+        
+        slide.handleTweenAnimateIn = function (type, args, obj) {
+        
+            var pos = Dom.getXY(obj.overlay.element),
+                currentX = pos[0],
+                currentY = pos[1];
+        
+            if (Dom.getStyle(obj.overlay.element, "visibility") == 
+                "hidden" && currentX < x) {
+
+                Dom.setStyle(obj.overlay.element, "visibility", "visible");
+
+            }
+        
+            obj.overlay.cfg.setProperty("xy", [currentX, currentY], true);
+            obj.overlay.cfg.refireEvent("iframe");
+        };
+        
+        slide.handleCompleteAnimateIn = function (type, args, obj) {
+            obj.overlay.cfg.setProperty("xy", [x, y], true);
+            obj.startX = x;
+            obj.startY = y;
+            obj.overlay.cfg.refireEvent("iframe");
+            obj.animateInCompleteEvent.fire();
+        };
+        
+        slide.handleStartAnimateOut = function (type, args, obj) {
+    
+            var vw = Dom.getViewportWidth(),
+                pos = Dom.getXY(obj.overlay.element),
+                yso = pos[1],
+                currentTo = obj.animOut.attributes.points.to;
+    
+            obj.animOut.attributes.points.to = [(vw + 25), yso];
+    
+        };
+        
+        slide.handleTweenAnimateOut = function (type, args, obj) {
+    
+            var pos = Dom.getXY(obj.overlay.element),
+                xto = pos[0],
+                yto = pos[1];
+        
+            obj.overlay.cfg.setProperty("xy", [xto, yto], true);
+            obj.overlay.cfg.refireEvent("iframe");
+        };
+        
+        slide.handleCompleteAnimateOut = function (type, args, obj) {
+            Dom.setStyle(obj.overlay.element, "visibility", "hidden");
+        
+            obj.overlay.cfg.setProperty("xy", [x, y]);
+            obj.animateOutCompleteEvent.fire();
+        };
+        
+        slide.init();
+        return slide;
+    };
+    
+    ContainerEffect.prototype = {
+    
+        /**
+        * Initializes the animation classes and events.
+        * @method init
+        */
+        init: function () {
+
+            this.beforeAnimateInEvent = this.createEvent("beforeAnimateIn");
+            this.beforeAnimateInEvent.signature = CustomEvent.LIST;
+            
+            this.beforeAnimateOutEvent = this.createEvent("beforeAnimateOut");
+            this.beforeAnimateOutEvent.signature = CustomEvent.LIST;
+        
+            this.animateInCompleteEvent = this.createEvent("animateInComplete");
+            this.animateInCompleteEvent.signature = CustomEvent.LIST;
+        
+            this.animateOutCompleteEvent = 
+                this.createEvent("animateOutComplete");
+            this.animateOutCompleteEvent.signature = CustomEvent.LIST;
+        
+            this.animIn = new this.animClass(this.targetElement, 
+                this.attrIn.attributes, this.attrIn.duration, 
+                this.attrIn.method);
+
+            this.animIn.onStart.subscribe(this.handleStartAnimateIn, this);
+            this.animIn.onTween.subscribe(this.handleTweenAnimateIn, this);
+
+            this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn, 
+                this);
+        
+            this.animOut = new this.animClass(this.targetElement, 
+                this.attrOut.attributes, this.attrOut.duration, 
+                this.attrOut.method);
+
+            this.animOut.onStart.subscribe(this.handleStartAnimateOut, this);
+            this.animOut.onTween.subscribe(this.handleTweenAnimateOut, this);
+            this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut, 
+                this);
+
+        },
+        
+        /**
+        * Triggers the in-animation.
+        * @method animateIn
+        */
+        animateIn: function () {
+            this.beforeAnimateInEvent.fire();
+            this.animIn.animate();
+        },
+        
+        /**
+        * Triggers the out-animation.
+        * @method animateOut
+        */
+        animateOut: function () {
+            this.beforeAnimateOutEvent.fire();
+            this.animOut.animate();
+        },
+        
+        /**
+        * The default onStart handler for the in-animation.
+        * @method handleStartAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleStartAnimateIn: function (type, args, obj) { },
+    
+        /**
+        * The default onTween handler for the in-animation.
+        * @method handleTweenAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleTweenAnimateIn: function (type, args, obj) { },
+    
+        /**
+        * The default onComplete handler for the in-animation.
+        * @method handleCompleteAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleCompleteAnimateIn: function (type, args, obj) { },
+        
+        /**
+        * The default onStart handler for the out-animation.
+        * @method handleStartAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleStartAnimateOut: function (type, args, obj) { },
+    
+        /**
+        * The default onTween handler for the out-animation.
+        * @method handleTweenAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleTweenAnimateOut: function (type, args, obj) { },
+    
+        /**
+        * The default onComplete handler for the out-animation.
+        * @method handleCompleteAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleCompleteAnimateOut: function (type, args, obj) { },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the ContainerEffect
+        */
+        toString: function () {
+            var output = "ContainerEffect";
+            if (this.overlay) {
+                output += " [" + this.overlay.toString() + "]";
+            }
+            return output;
+        }
+    
+    };
+
+    YAHOO.lang.augmentProto(ContainerEffect, YAHOO.util.EventProvider);
+
+})();
+YAHOO.register("container_core", YAHOO.widget.Module, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/datasource/README b/lib/yui/datasource/README
new file mode 100755 (executable)
index 0000000..570d501
--- /dev/null
@@ -0,0 +1,47 @@
+DataSource Release Notes
+
+**** version 2.3.0 ****
+
+* DataSource requests over XHR no longer automatically insert a "?" in the URIs
+between the host and the query. Implementers should explicitly include the
+question mark if it is required by your server. Please refer to the DataTable XHR
+examples for implementation details.
+
+* DataSource provides the following static type conversion methods:
+DataSource.parseDate(), DataSource.parseNumber(), and DataSource.parseString().
+These are executed in the scope of the DataSource instance.
+
+* DataSource now supports the following values for the property xhrConnMode:
+    "queueRequests"
+    "allowAll"
+    "cancelStaleRequests"
+    "ignoreStaleResponses"
+
+
+
+
+**** version 2.2.2 ***
+
+* No changes.
+
+
+
+**** version 2.2.1 ***
+
+* Fixed parseTextData() to longer reverse-order data or truncate first record.
+* Fixed bug where data values of 0 (zero) were being converted to empty string.
+* Fixed erroneous undefined values created by parseDataArray().
+* Callback functions now receive an additional argument in the form of a boolean
+to indicate data error.
+* Support for nested JSON data.
+* Support for responseShema.fields.converter to take string response and custom
+convert data type.
+* Added static converter methods YAHOO.util.DataSource.convertNumber and
+YAHOO.util.DataSource.convertDate.
+* Improved type checking with YAHOO.lang.
+
+
+
+**** version 2.2.0 ***
+
+* Beta release.
diff --git a/lib/yui/datasource/datasource-beta-debug.js b/lib/yui/datasource/datasource-beta-debug.js
new file mode 100755 (executable)
index 0000000..b3fe913
--- /dev/null
@@ -0,0 +1,1430 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * The DataSource utility provides a common configurable interface for widgets
+ * to access a variety of data, from JavaScript arrays to online servers over
+ * XHR.
+ *
+ * @namespace YAHOO.util
+ * @module datasource
+ * @requires yahoo, event
+ * @optional connection
+ * @title DataSource Utility
+ * @beta
+ */
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The DataSource class defines and manages a live set of data for widgets to
+ * interact with. Examples of live databases include in-memory
+ * local data such as a JavaScript array, a JavaScript function, or JSON, or
+ * remote data such as data retrieved through an XHR connection.
+ *
+ * @class DataSource
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param oLiveData {Object} Pointer to live database.
+ * @param oConfigs {Object} (optional) Object literal of configuration values.
+ */
+YAHOO.util.DataSource = function(oLiveData, oConfigs) {
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            if(sConfig) {
+                this[sConfig] = oConfigs[sConfig];
+            }
+        }
+    }
+    
+    if(!oLiveData) {
+        YAHOO.log("Could not instantiate DataSource due to invalid live database",
+                "error", this.toString());
+        return;
+    }
+
+    if(oLiveData.nodeType && oLiveData.nodeType == 9) {
+        this.dataType = YAHOO.util.DataSource.TYPE_XML;
+    }
+    else if(YAHOO.lang.isArray(oLiveData)) {
+        this.dataType = YAHOO.util.DataSource.TYPE_JSARRAY;
+    }
+    else if(YAHOO.lang.isString(oLiveData)) {
+        this.dataType = YAHOO.util.DataSource.TYPE_XHR;
+    }
+    else if(YAHOO.lang.isFunction(oLiveData)) {
+        this.dataType = YAHOO.util.DataSource.TYPE_JSFUNCTION;
+    }
+    else if(oLiveData.nodeName && (oLiveData.nodeName.toLowerCase() == "table")) {
+        this.dataType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
+    }
+    else if(YAHOO.lang.isObject(oLiveData)) {
+        this.dataType = YAHOO.util.DataSource.TYPE_JSON;
+    }
+    else {
+        this.dataType = YAHOO.util.DataSource.TYPE_UNKNOWN;
+    }
+
+    this.liveData = oLiveData;
+    this._oQueue = {interval:null, conn:null, requests:[]};
+
+
+    // Validate and initialize public configs
+    var maxCacheEntries = this.maxCacheEntries;
+    if(!YAHOO.lang.isNumber(maxCacheEntries) || (maxCacheEntries < 0)) {
+        maxCacheEntries = 0;
+    }
+
+    // Initialize local cache
+    if(maxCacheEntries > 0 && !this._aCache) {
+        this._aCache = [];
+        YAHOO.log("Cache initialized", "info", this.toString());
+    }
+
+    this._sName = "DataSource instance" + YAHOO.util.DataSource._nIndex;
+    YAHOO.util.DataSource._nIndex++;
+    YAHOO.log("DataSource initialized", "info", this.toString());
+
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Custom Events
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Fired when a request is made to the local cache.
+     *
+     * @event cacheRequestEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     */
+    this.createEvent("cacheRequestEvent");
+
+    /**
+     * Fired when data is retrieved from the local cache.
+     *
+     * @event getCachedResponseEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.response {Object} The response object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.tId {Number} Transaction ID.
+     */
+    this.createEvent("cacheResponseEvent");
+
+    /**
+     * Fired when a request is sent to the live data source.
+     *
+     * @event requestEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     */
+    this.createEvent("requestEvent");
+
+    /**
+     * Fired when live data source sends response.
+     *
+     * @event responseEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.response {Object} The raw response object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     */
+    this.createEvent("responseEvent");
+
+    /**
+     * Fired when response is parsed.
+     *
+     * @event responseParseEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.response {Object} The parsed response object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     */
+    this.createEvent("responseParseEvent");
+
+    /**
+     * Fired when response is cached.
+     *
+     * @event responseCacheEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.response {Object} The parsed response object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     */
+    this.createEvent("responseCacheEvent");
+    /**
+     * Fired when an error is encountered with the live data source.
+     *
+     * @event dataErrorEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.message {String} The error message.
+     */
+    this.createEvent("dataErrorEvent");
+
+    /**
+     * Fired when the local cache is flushed.
+     *
+     * @event cacheFlushEvent
+     */
+    this.createEvent("cacheFlushEvent");
+};
+
+YAHOO.augment(YAHOO.util.DataSource, YAHOO.util.EventProvider);
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public constants
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Type is unknown.
+ *
+ * @property TYPE_UNKNOWN
+ * @type Number
+ * @final
+ * @default -1
+ */
+YAHOO.util.DataSource.TYPE_UNKNOWN = -1;
+
+/**
+ * Type is a JavaScript Array.
+ *
+ * @property TYPE_JSARRAY
+ * @type Number
+ * @final
+ * @default 0
+ */
+YAHOO.util.DataSource.TYPE_JSARRAY = 0;
+
+/**
+ * Type is a JavaScript Function.
+ *
+ * @property TYPE_JSFUNCTION
+ * @type Number
+ * @final
+ * @default 1
+ */
+YAHOO.util.DataSource.TYPE_JSFUNCTION = 1;
+
+/**
+ * Type is hosted on a server via an XHR connection.
+ *
+ * @property TYPE_XHR
+ * @type Number
+ * @final
+ * @default 2
+ */
+YAHOO.util.DataSource.TYPE_XHR = 2;
+
+/**
+ * Type is JSON.
+ *
+ * @property TYPE_JSON
+ * @type Number
+ * @final
+ * @default 3
+ */
+YAHOO.util.DataSource.TYPE_JSON = 3;
+
+/**
+ * Type is XML.
+ *
+ * @property TYPE_XML
+ * @type Number
+ * @final
+ * @default 4
+ */
+YAHOO.util.DataSource.TYPE_XML = 4;
+
+/**
+ * Type is plain text.
+ *
+ * @property TYPE_TEXT
+ * @type Number
+ * @final
+ * @default 5
+ */
+YAHOO.util.DataSource.TYPE_TEXT = 5;
+
+/**
+ * Type is an HTML TABLE element.
+ *
+ * @property TYPE_HTMLTABLE
+ * @type Number
+ * @final
+ * @default 6
+ */
+YAHOO.util.DataSource.TYPE_HTMLTABLE = 6;
+
+/**
+ * Error message for invalid dataresponses.
+ *
+ * @property ERROR_DATAINVALID
+ * @type String
+ * @final
+ * @default "Invalid data"
+ */
+YAHOO.util.DataSource.ERROR_DATAINVALID = "Invalid data";
+
+/**
+ * Error message for null data responses.
+ *
+ * @property ERROR_DATANULL
+ * @type String
+ * @final
+ * @default "Null data"
+ */
+YAHOO.util.DataSource.ERROR_DATANULL = "Null data";
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class variable to index multiple DataSource instances.
+ *
+ * @property DataSource._nIndex
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.util.DataSource._nIndex = 0;
+
+/**
+ * Internal class variable to assign unique transaction IDs.
+ *
+ * @property DataSource._nTransactionId
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.util.DataSource._nTransactionId = 0;
+
+/**
+ * Name of DataSource instance.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.util.DataSource.prototype._sName = null;
+
+/**
+ * Local cache of data result object literals indexed chronologically.
+ *
+ * @property _aCache
+ * @type Object[]
+ * @private
+ */
+YAHOO.util.DataSource.prototype._aCache = null;
+
+/**
+ * Local queue of request connections, enabled if queue needs to be managed.
+ *
+ * @property _oQueue
+ * @type Object
+ * @private
+ */
+YAHOO.util.DataSource.prototype._oQueue = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Max size of the local cache.  Set to 0 to turn off caching.  Caching is
+ * useful to reduce the number of server connections.  Recommended only for data
+ * sources that return comprehensive results for queries or when stale data is
+ * not an issue.
+ *
+ * @property maxCacheEntries
+ * @type Number
+ * @default 0
+ */
+YAHOO.util.DataSource.prototype.maxCacheEntries = 0;
+
+ /**
+ * Pointer to live database.
+ *
+ * @property liveData
+ * @type Object
+ */
+YAHOO.util.DataSource.prototype.liveData = null;
+
+/**
+ * Where the live data is held.
+ *
+ * @property dataType
+ * @type Number
+ * @default YAHOO.util.DataSource.TYPE_UNKNOWN
+ *
+ */
+YAHOO.util.DataSource.prototype.dataType = YAHOO.util.DataSource.TYPE_UNKNOWN;
+
+/**
+ * Format of response.
+ *
+ * @property responseType
+ * @type Number
+ * @default YAHOO.util.DataSource.TYPE_UNKNOWN
+ */
+YAHOO.util.DataSource.prototype.responseType = YAHOO.util.DataSource.TYPE_UNKNOWN;
+
+/**
+ * Response schema object literal takes a combination of the following properties:
+ *
+ * <dl>
+ * <dt>resultsList</dt> <dd>Pointer to array of tabular data</dd>
+ * <dt>resultNode</dt> <dd>Pointer to node name of row data (XML data only)</dd>
+ * <dt>recordDelim</dt> <dd>Record delimiter (text data only)</dd>
+ * <dt>fieldDelim</dt> <dd>Field delimiter (text data only)</dd>
+ * <dt>fields</dt> <dd>Array of field names (aka keys), or array of object literals
+ * such as: {key:"fieldname",parser:YAHOO.util.DataSource.parseDate}</dd>
+ * </dl>
+ *
+ * @property responseSchema
+ * @type Object
+ */
+YAHOO.util.DataSource.prototype.responseSchema = null;
+
+ /**
+ * Alias to YUI Connection Manager. Allows implementers to specify their own
+ * subclasses of the YUI Connection Manager utility.
+ *
+ * @property connMgr
+ * @type Object
+ * @default YAHOO.util.Connect
+ */
+YAHOO.util.DataSource.prototype.connMgr = null;
+
+ /**
+ * If data is accessed over XHR via Connection Manager, this setting defines
+ * request/response management in the following manner:
+ * <dl>
+ *     <dt>queueRequests</dt>
+ *     <dd>If a request is already in progress, wait until response is returned
+ *     before sending the next request.</dd>
+ *
+ *     <dt>cancelStaleRequests</dt>
+ *     <dd>If a request is already in progress, cancel it before sending the next
+ *     request.</dd>
+ *
+ *     <dt>ignoreStaleResponses</dt>
+ *     <dd>Send all requests, but handle only the response for the most recently
+ *     sent request.</dd>
+ *
+ *     <dt>allowAll</dt>
+ *     <dd>Send all requests and handle all responses.</dd>
+ *
+ * </dl>
+ *
+ * @property connXhrMode
+ * @type String
+ * @default "allowAll"
+ */
+YAHOO.util.DataSource.prototype.connXhrMode = "allowAll";
+
+ /**
+ * If data is accessed over XHR via Connection Manager, true if data should be
+ * sent via POST, otherwise data will be sent via GET.
+ *
+ * @property connMethodPost
+ * @type Boolean
+ * @default false
+ */
+YAHOO.util.DataSource.prototype.connMethodPost = false;
+
+ /**
+ * If data is accessed over XHR via Connection Manager, the connection timeout
+ * defines how many  milliseconds the XHR connection will wait for a server
+ * response. Any non-zero value will enable the Connection utility's
+ * Auto-Abort feature.
+ *
+ * @property connTimeout
+ * @type Number
+ * @default 0
+ */
+YAHOO.util.DataSource.prototype.connTimeout = 0;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public static methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Converts data to type String.
+ *
+ * @method DataSource.parseString
+ * @param oData {String | Number | Boolean | Date | Array | Object} Data to parse.
+ * The special values null and undefined will return null.
+ * @return {Number} A string, or null.
+ * @static
+ */
+YAHOO.util.DataSource.parseString = function(oData) {
+    // Special case null and undefined
+    if(!YAHOO.lang.isValue(oData)) {
+        return null;
+    }
+    
+    //Convert to string
+    var string = oData + "";
+
+    // Validate
+    if(YAHOO.lang.isString(string)) {
+        return string;
+    }
+    else {
+        YAHOO.log("Could not convert data " + YAHOO.lang.dump(oData) + " to type String", "warn", this.toString());
+        return null;
+    }
+};
+
+/**
+ * Converts data to type Number.
+ *
+ * @method DataSource.parseNumber
+ * @param oData {String | Number | Boolean | Null} Data to convert. Beware, null
+ * returns as 0.
+ * @return {Number} A number, or null if NaN.
+ * @static
+ */
+YAHOO.util.DataSource.parseNumber = function(oData) {
+    //Convert to number
+    var number = oData * 1;
+    
+    // Validate
+    if(YAHOO.lang.isNumber(number)) {
+        return number;
+    }
+    else {
+        YAHOO.log("Could not convert data " + YAHOO.lang.dump(oData) + " to type Number", "warn", this.toString());
+        return null;
+    }
+};
+// Backward compatibility
+YAHOO.util.DataSource.convertNumber = function(oData) {
+    YAHOO.log("The method YAHOO.util.DataSource.convertNumber() has been" +
+    " deprecated in favor of YAHOO.util.DataSource.parseNumber()", "warn",
+    this.toString());
+    return YAHOO.util.DataSource.parseNumber(oData);
+};
+
+/**
+ * Converts data to type Date.
+ *
+ * @method DataSource.parseDate
+ * @param oData {Date | String | Number} Data to convert.
+ * @return {Date} A Date instance.
+ * @static
+ */
+YAHOO.util.DataSource.parseDate = function(oData) {
+    var date = null;
+    
+    //Convert to date
+    if(!(oData instanceof Date)) {
+        date = new Date(oData);
+    }
+    else {
+        return oData;
+    }
+    
+    // Validate
+    if(date instanceof Date) {
+        return date;
+    }
+    else {
+        YAHOO.log("Could not convert data " + YAHOO.lang.dump(oData) + " to type Date", "warn", this.toString());
+        return null;
+    }
+};
+// Backward compatibility
+YAHOO.util.DataSource.convertDate = function(oData) {
+    YAHOO.log("The method YAHOO.util.DataSource.convertDate() has been" +
+    " deprecated in favor of YAHOO.util.DataSource.parseDate()", "warn",
+    this.toString());
+    return YAHOO.util.DataSource.parseDate(oData);
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Public accessor to the unique name of the DataSource instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the DataSource instance.
+ */
+YAHOO.util.DataSource.prototype.toString = function() {
+    return this._sName;
+};
+
+/**
+ * Overridable method passes request to cache and returns cached response if any,
+ * refreshing the hit in the cache as the newest item. Returns null if there is
+ * no cache hit.
+ *
+ * @method getCachedResponse
+ * @param oRequest {Object} Request object.
+ * @param oCallback {Function} Handler function to receive the response.
+ * @param oCaller {Object} The Calling object that is making the request.
+ * @return {Object} Cached response object or null.
+ */
+YAHOO.util.DataSource.prototype.getCachedResponse = function(oRequest, oCallback, oCaller) {
+    var aCache = this._aCache;
+    var nCacheLength = (aCache) ? aCache.length : 0;
+    var oResponse = null;
+
+    // If cache is enabled...
+    if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {
+        this.fireEvent("cacheRequestEvent", {request:oRequest,callback:oCallback,caller:oCaller});
+
+        // Loop through each cached element
+        for(var i = nCacheLength-1; i >= 0; i--) {
+            var oCacheElem = aCache[i];
+
+            // Defer cache hit logic to a public overridable method
+            if(this.isCacheHit(oRequest,oCacheElem.request)) {
+                // Grab the cached response
+                oResponse = oCacheElem.response;
+                // The cache returned a hit!
+                // Remove element from its original location
+                aCache.splice(i,1);
+                // Add as newest
+                this.addToCache(oRequest, oResponse);
+                this.fireEvent("cacheResponseEvent", {request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});
+                break;
+            }
+        }
+    }
+    YAHOO.log("The cached response for \"" + YAHOO.lang.dump(oRequest) +
+            "\" is " + YAHOO.lang.dump(oResponse), "info", this.toString());
+    return oResponse;
+};
+
+/**
+ * Default overridable method matches given request to given cached request.
+ * Returns true if is a hit, returns false otherwise.  Implementers should
+ * override this method to customize the cache-matching algorithm.
+ *
+ * @method isCacheHit
+ * @param oRequest {Object} Request object.
+ * @param oCachedRequest {Object} Cached request object.
+ * @return {Boolean} True if given request matches cached request, false otherwise.
+ */
+YAHOO.util.DataSource.prototype.isCacheHit = function(oRequest, oCachedRequest) {
+    return (oRequest === oCachedRequest);
+};
+
+/**
+ * Adds a new item to the cache. If cache is full, evicts the stalest item
+ * before adding the new item.
+ *
+ * @method addToCache
+ * @param oRequest {Object} Request object.
+ * @param oResponse {Object} Response object to cache.
+ */
+YAHOO.util.DataSource.prototype.addToCache = function(oRequest, oResponse) {
+    var aCache = this._aCache;
+    if(!aCache) {
+        return;
+    }
+
+    //TODO: check for duplicate entries
+
+    // If the cache is full, make room by removing stalest element (index=0)
+    while(aCache.length >= this.maxCacheEntries) {
+        aCache.shift();
+    }
+
+    // Add to cache in the newest position, at the end of the array
+    var oCacheElem = {request:oRequest,response:oResponse};
+    aCache.push(oCacheElem);
+    this.fireEvent("responseCacheEvent", {request:oRequest,response:oResponse});
+    YAHOO.log("Cached the response for \"" +  oRequest + "\"", "info", this.toString());
+};
+
+/**
+ * Flushes cache.
+ *
+ * @method flushCache
+ */
+YAHOO.util.DataSource.prototype.flushCache = function() {
+    if(this._aCache) {
+        this._aCache = [];
+        this.fireEvent("cacheFlushEvent");
+        YAHOO.log("Flushed the cache", "info", this.toString());
+    }
+};
+
+/**
+ * First looks for cached response, then sends request to live data.
+ *
+ * @method sendRequest
+ * @param oRequest {Object} Request object.
+ * @param oCallback {Function} Handler function to receive the response.
+ * @param oCaller {Object} The Calling object that is making the request.
+ * @return {Number} Transaction ID, or null if response found in cache.
+ */
+YAHOO.util.DataSource.prototype.sendRequest = function(oRequest, oCallback, oCaller) {
+    // First look in cache
+    var oCachedResponse = this.getCachedResponse(oRequest, oCallback, oCaller);
+    if(oCachedResponse) {
+        oCallback.call(oCaller, oRequest, oCachedResponse);
+        return null;
+    }
+
+    // Not in cache, so forward request to live data
+    YAHOO.log("Making connection to live data for \"" + oRequest + "\"", "info", this.toString());
+    return this.makeConnection(oRequest, oCallback, oCaller);
+};
+
+/**
+ * Overridable method provides default functionality to make a connection to
+ * live data in order to send request. The response coming back is then
+ * forwarded to the handleResponse function. This method should be customized
+ * to achieve more complex implementations.
+ *
+ * @method makeConnection
+ * @param oRequest {Object} Request object.
+ * @param oCallback {Function} Handler function to receive the response.
+ * @param oCaller {Object} The Calling object that is making the request.
+ * @return {Number} Transaction ID.
+ */
+YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, oCaller) {
+    this.fireEvent("requestEvent", {request:oRequest,callback:oCallback,caller:oCaller});
+    var oRawResponse = null;
+    var tId = YAHOO.util.DataSource._nTransactionId++;
+
+    // How to make the connection depends on the type of data
+    switch(this.dataType) {
+        // If the live data is a JavaScript Function
+        // pass the request in as a parameter and
+        // forward the return value to the handler
+        case YAHOO.util.DataSource.TYPE_JSFUNCTION:
+            oRawResponse = this.liveData(oRequest);
+            this.handleResponse(oRequest, oRawResponse, oCallback, oCaller, tId);
+            break;
+        // If the live data is over Connection Manager
+        // set up the callback object and
+        // pass the request in as a URL query and
+        // forward the response to the handler
+        case YAHOO.util.DataSource.TYPE_XHR:
+            var oSelf = this;
+            var oConnMgr = this.connMgr || YAHOO.util.Connect;
+            var oQueue = this._oQueue;
+
+            /**
+             * Define Connection Manager success handler
+             *
+             * @method _xhrSuccess
+             * @param oResponse {Object} HTTPXMLRequest object
+             * @private
+             */
+            var _xhrSuccess = function(oResponse) {
+                // If response ID does not match last made request ID,
+                // silently fail and wait for the next response
+                if(oResponse && (this.connXhrMode == "ignoreStaleResponses") &&
+                        (oResponse.tId != oQueue.conn.tId)) {
+                    YAHOO.log("Ignored stale response", "warn", this.toString());
+                    return null;
+                }
+                // Error if no response
+                else if(!oResponse) {
+                    this.fireEvent("dataErrorEvent", {request:oRequest,
+                            callback:oCallback, caller:oCaller,
+                            message:YAHOO.util.DataSource.ERROR_DATANULL});
+                    YAHOO.log(YAHOO.util.DataSource.ERROR_DATANULL, "error", this.toString());
+
+                    // Send error response back to the caller with the error flag on
+                    oCallback.call(oCaller, oRequest, oResponse, true);
+
+                    return null;
+                }
+                // Forward to handler
+                else {
+                    this.handleResponse(oRequest, oResponse, oCallback, oCaller, tId);
+                }
+            };
+
+            /**
+             * Define Connection Manager failure handler
+             *
+             * @method _xhrFailure
+             * @param oResponse {Object} HTTPXMLRequest object
+             * @private
+             */
+            var _xhrFailure = function(oResponse) {
+                this.fireEvent("dataErrorEvent", {request:oRequest,
+                        callback:oCallback, caller:oCaller,
+                        message:YAHOO.util.DataSource.ERROR_DATAINVALID});
+                YAHOO.log(YAHOO.util.DataSource.ERROR_DATAINVALID + ": " +
+                        oResponse.statusText, "error", this.toString());
+
+                // Backward compatibility
+                if((this.liveData.lastIndexOf("?") !== this.liveData.length-1) &&
+                    (oRequest.indexOf("?") !== 0)){
+                        YAHOO.log("DataSources using XHR no longer supply a \"?\"" +
+                        " between the host and query parameters" +
+                        " -- please check that the request URL is correct", "warn", this.toString());
+                }
+
+                // Send failure response back to the caller with the error flag on
+                oCallback.call(oCaller, oRequest, oResponse, true);
+                return null;
+            };
+
+            /**
+             * Define Connection Manager callback object
+             *
+             * @property _xhrCallback
+             * @param oResponse {Object} HTTPXMLRequest object
+             * @private
+             */
+             var _xhrCallback = {
+                success:_xhrSuccess,
+                failure:_xhrFailure,
+                scope: this
+            };
+
+            // Apply Connection Manager timeout
+            if(YAHOO.lang.isNumber(this.connTimeout)) {
+                _xhrCallback.timeout = this.connTimeout;
+            }
+
+            // Cancel stale requests
+            if(this.connXhrMode == "cancelStaleRequests") {
+                    // Look in queue for stale requests
+                    if(oQueue.conn) {
+                        if(oConnMgr.abort) {
+                            oConnMgr.abort(oQueue.conn);
+                            oQueue.conn = null;
+                            YAHOO.log("Canceled stale request", "warn", this.toString());
+                        }
+                        else {
+                            YAHOO.log("Could not find Connection Manager abort() function", "error", this.toString());
+                        }
+                    }
+            }
+
+            // Get ready to send the request URL
+            if(oConnMgr && oConnMgr.asyncRequest) {
+                var sLiveData = this.liveData;
+                var isPost = this.connMethodPost;
+                var sMethod = (isPost) ? "POST" : "GET";
+                var sUri = (isPost) ? sLiveData : sLiveData+oRequest;
+                var sRequest = (isPost) ? oRequest : null;
+
+                // Send the request right away
+                if(this.connXhrMode != "queueRequests") {
+                    oQueue.conn = oConnMgr.asyncRequest(sMethod, sUri, _xhrCallback, sRequest);
+                }
+                // Queue up then send the request
+                else {
+                    // Found a request already in progress
+                    if(oQueue.conn) {
+                        // Add request to queue
+                        oQueue.requests.push({request:oRequest, callback:_xhrCallback});
+
+                        // Interval needs to be started
+                        if(!oQueue.interval) {
+                            oQueue.interval = setInterval(function() {
+                                // Connection is in progress
+                                if(oConnMgr.isCallInProgress(oQueue.conn)) {
+                                    return;
+                                }
+                                else {
+                                    // Send next request
+                                    if(oQueue.requests.length > 0) {
+                                        sUri = (isPost) ? sLiveData : sLiveData+oQueue.requests[0].request;
+                                        sRequest = (isPost) ? oQueue.requests[0].request : null;
+                                        oQueue.conn = oConnMgr.asyncRequest(sMethod, sUri, oQueue.requests[0].callback, sRequest);
+
+                                        // Remove request from queue
+                                        oQueue.requests.shift();
+                                    }
+                                    // No more requests
+                                    else {
+                                        clearInterval(oQueue.interval);
+                                        oQueue.interval = null;
+                                    }
+                                }
+                            }, 50);
+                        }
+                    }
+                    // Nothing is in progress
+                    else {
+                        oQueue.conn = oConnMgr.asyncRequest(sMethod, sUri, _xhrCallback, sRequest);
+                    }
+                }
+            }
+            else {
+                YAHOO.log("Could not find Connection Manager asyncRequest() function", "error", this.toString());
+                // Send null response back to the caller with the error flag on
+                oCallback.call(oCaller, oRequest, null, true);
+            }
+
+            break;
+        // Simply forward the entire data object to the handler
+        default:
+            /* accounts for the following cases:
+            YAHOO.util.DataSource.TYPE_UNKNOWN:
+            YAHOO.util.DataSource.TYPE_JSARRAY:
+            YAHOO.util.DataSource.TYPE_JSON:
+            YAHOO.util.DataSource.TYPE_HTMLTABLE:
+            YAHOO.util.DataSource.TYPE_XML:
+            */
+            oRawResponse = this.liveData;
+            this.handleResponse(oRequest, oRawResponse, oCallback, oCaller, tId);
+            break;
+    }
+    return tId;
+};
+
+/**
+ * Handles raw data response from live data source. Sends a parsed response object
+ * to the callback function in this format:
+ *
+ * fnCallback(oRequest, oParsedResponse)
+ *
+ * where the oParsedResponse object literal with the following properties:
+ * <ul>
+ *     <li>tId {Number} Unique transaction ID</li>
+ *     <li>results {Array} Array of parsed data results</li>
+ *     <li>error {Boolean} True if there was an error</li>
+ * </ul>
+ *
+ * @method handleResponse
+ * @param oRequest {Object} Request object
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @param oCallback {Function} Handler function to receive the response.
+ * @param oCaller {Object} The calling object that is making the request.
+ * @param tId {Number} Transaction ID.
+ */
+YAHOO.util.DataSource.prototype.handleResponse = function(oRequest, oRawResponse, oCallback, oCaller, tId) {
+    this.fireEvent("responseEvent", {request:oRequest, response:oRawResponse,
+            callback:oCallback, caller:oCaller, tId: tId});
+    YAHOO.log("Received live data response for \"" + oRequest + "\"", "info", this.toString());
+    var xhr = (this.dataType == YAHOO.util.DataSource.TYPE_XHR) ? true : false;
+    var oParsedResponse = null;
+    var bError = false;
+
+    // Access to the raw response before it gets parsed
+    oRawResponse = this.doBeforeParseData(oRequest, oRawResponse);
+
+    switch(this.responseType) {
+        case YAHOO.util.DataSource.TYPE_JSARRAY:
+            if(xhr && oRawResponse.responseText) {
+                oRawResponse = oRawResponse.responseText;
+            }
+            oParsedResponse = this.parseArrayData(oRequest, oRawResponse);
+            break;
+        case YAHOO.util.DataSource.TYPE_JSON:
+            if(xhr && oRawResponse.responseText) {
+                oRawResponse = oRawResponse.responseText;
+            }
+            oParsedResponse = this.parseJSONData(oRequest, oRawResponse);
+            break;
+        case YAHOO.util.DataSource.TYPE_HTMLTABLE:
+            if(xhr && oRawResponse.responseText) {
+                oRawResponse = oRawResponse.responseText;
+            }
+            oParsedResponse = this.parseHTMLTableData(oRequest, oRawResponse);
+            break;
+        case YAHOO.util.DataSource.TYPE_XML:
+            if(xhr && oRawResponse.responseXML) {
+                oRawResponse = oRawResponse.responseXML;
+            }
+            oParsedResponse = this.parseXMLData(oRequest, oRawResponse);
+            break;
+        case YAHOO.util.DataSource.TYPE_TEXT:
+            if(xhr && oRawResponse.responseText) {
+                oRawResponse = oRawResponse.responseText;
+            }
+            oParsedResponse = this.parseTextData(oRequest, oRawResponse);
+            break;
+        default:
+            //var contentType = oRawResponse.getResponseHeader["Content-Type"];
+            YAHOO.log("Could not parse data for request \"" + oRequest +
+                    "\" due to unknown response type", "error", this.toString());
+            break;
+    }
+
+
+    if(oParsedResponse) {
+        // Last chance to touch the raw response or the parsed response
+        oParsedResponse.tId = tId;
+        oParsedResponse = this.doBeforeCallback(oRequest, oRawResponse, oParsedResponse);
+        this.fireEvent("responseParseEvent", {request:oRequest,
+                response:oParsedResponse, callback:oCallback, caller:oCaller});
+        // Cache the response
+        this.addToCache(oRequest, oParsedResponse);
+    }
+    else {
+        this.fireEvent("dataErrorEvent", {request:oRequest, callback:oCallback,
+                caller:oCaller, message:YAHOO.util.DataSource.ERROR_DATANULL});
+        YAHOO.log(YAHOO.util.DataSource.ERROR_DATANULL, "error", this.toString());
+        
+        // Send response back to the caller with the error flag on
+        oParsedResponse = {error:true};
+    }
+    
+    // Send the response back to the caller
+    oCallback.call(oCaller, oRequest, oParsedResponse);
+};
+
+/**
+ * Overridable method gives implementers access to the original raw response
+ * before the data gets parsed. Implementers should take care not to return an
+ * unparsable or otherwise invalid raw response.
+ *
+ * @method doBeforeParseData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Raw response for parsing.
+ */
+YAHOO.util.DataSource.prototype.doBeforeParseData = function(oRequest, oRawResponse) {
+    return oRawResponse;
+};
+
+/**
+ * Overridable method gives implementers access to the original raw response and
+ * the parsed response (parsed against the given schema) before the data
+ * is added to the cache (if applicable) and then sent back to callback function.
+ * This is your chance to access the raw response and/or populate the parsed
+ * response with any custom data.
+ *
+ * @method doBeforeCallback
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @param oParsedResponse {Object} The parsed response to return to calling object.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.doBeforeCallback = function(oRequest, oRawResponse, oParsedResponse) {
+    return oParsedResponse;
+};
+
+/**
+ * Overridable method parses raw array data into a response object.
+ *
+ * @method parseArrayData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.parseArrayData = function(oRequest, oRawResponse) {
+    if(YAHOO.lang.isArray(oRawResponse) && YAHOO.lang.isArray(this.responseSchema.fields)) {
+        var oParsedResponse = {results:[]};
+        var fields = this.responseSchema.fields;
+        for(var i=oRawResponse.length-1; i>-1; i--) {
+            var oResult = {};
+            for(var j=fields.length-1; j>-1; j--) {
+                var field = fields[j];
+                var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                var data = (YAHOO.lang.isValue(oRawResponse[i][j])) ? oRawResponse[i][j] : oRawResponse[i][key];
+                // Backward compatibility
+                if(!field.parser && field.converter) {
+                    field.parser = field.converter;
+                    YAHOO.log("The field property converter has been deprecated" +
+                            " in favor of parser", "warn", this.toString());
+                }
+                if(field.parser) {
+                    data = field.parser.call(this, data);
+                }
+                // Safety measure
+                if(data === undefined) {
+                    data = null;
+                }
+                oResult[key] = data;
+            }
+            oParsedResponse.results.unshift(oResult);
+        }
+        YAHOO.log("Parsed array data is " +
+                YAHOO.lang.dump(oParsedResponse), "info", this.toString());
+        return oParsedResponse;
+    }
+    else {
+        YAHOO.log("Array data could not be parsed: " +
+                YAHOO.lang.dump(oRawResponse), "error", this.toString());
+        return null;
+    }
+};
+
+/**
+ * Overridable method parses raw plain text data into a response object.
+ *
+ * @method parseTextData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.parseTextData = function(oRequest, oRawResponse) {
+    var oParsedResponse = {};
+    if(YAHOO.lang.isString(oRawResponse) &&
+            YAHOO.lang.isArray(this.responseSchema.fields) &&
+            YAHOO.lang.isString(this.responseSchema.recordDelim) &&
+            YAHOO.lang.isString(this.responseSchema.fieldDelim)) {
+        oParsedResponse.results = [];
+        var recDelim = this.responseSchema.recordDelim;
+        var fieldDelim = this.responseSchema.fieldDelim;
+        var fields = this.responseSchema.fields;
+        if(oRawResponse.length > 0) {
+            // Delete the last line delimiter at the end of the data if it exists
+            var newLength = oRawResponse.length-recDelim.length;
+            if(oRawResponse.substr(newLength) == recDelim) {
+                oRawResponse = oRawResponse.substr(0, newLength);
+            }
+            // Split along record delimiter to get an array of strings
+            var recordsarray = oRawResponse.split(recDelim);
+            // Cycle through each record, except the first which contains header info
+            for(var i = recordsarray.length-1; i>-1; i--) {
+                var oResult = {};
+                for(var j=fields.length-1; j>-1; j--) {
+                    // Split along field delimter to get each data value
+                    var fielddataarray = recordsarray[i].split(fieldDelim);
+
+                    // Remove quotation marks from edges, if applicable
+                    var data = fielddataarray[j];
+                    if(data.charAt(0) == "\"") {
+                        data = data.substr(1);
+                    }
+                    if(data.charAt(data.length-1) == "\"") {
+                        data = data.substr(0,data.length-1);
+                    }
+                    var field = fields[j];
+                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                    // Backward compatibility
+                    if(!field.parser && field.converter) {
+                        field.parser = field.converter;
+                        YAHOO.log("The field property converter has been deprecated" +
+                                " in favor of parser", "warn", this.toString());
+                    }
+                    if(field.parser) {
+                        data = field.parser.call(this, data);
+                    }
+                    // Safety measure
+                    if(data === undefined) {
+                        data = null;
+                    }
+                    oResult[key] = data;
+                }
+                oParsedResponse.results.unshift(oResult);
+            }
+        }
+        YAHOO.log("Parsed text data is " +
+                YAHOO.lang.dump(oParsedResponse), "info", this.toString());
+    }
+    else {
+        YAHOO.log("Text data could not be parsed: " +
+                YAHOO.lang.dump(oRawResponse), "error", this.toString());
+        oParsedResponse.error = true;
+    }
+    return oParsedResponse;
+};
+
+/**
+ * Overridable method parses raw XML data into a response object.
+ *
+ * @method parseXMLData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.parseXMLData = function(oRequest, oRawResponse) {
+        var bError = false;
+        var oParsedResponse = {};
+        var xmlList = (this.responseSchema.resultNode) ?
+                oRawResponse.getElementsByTagName(this.responseSchema.resultNode) :
+                null;
+        if(!xmlList || !YAHOO.lang.isArray(this.responseSchema.fields)) {
+            bError = true;
+        }
+        // Loop through each result
+        else {
+            oParsedResponse.results = [];
+            for(var k = xmlList.length-1; k >= 0 ; k--) {
+                var result = xmlList.item(k);
+                var oResult = {};
+                // Loop through each data field in each result using the schema
+                for(var m = this.responseSchema.fields.length-1; m >= 0 ; m--) {
+                    var field = this.responseSchema.fields[m];
+                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                    var data = null;
+                    // Values may be held in an attribute...
+                    var xmlAttr = result.attributes.getNamedItem(key);
+                    if(xmlAttr) {
+                        data = xmlAttr.value;
+                    }
+                    // ...or in a node
+                    else {
+                        var xmlNode = result.getElementsByTagName(key);
+                        if(xmlNode && xmlNode.item(0) && xmlNode.item(0).firstChild) {
+                            data = xmlNode.item(0).firstChild.nodeValue;
+                        }
+                        else {
+                               data = "";
+                        }
+                    }
+                    // Backward compatibility
+                    if(!field.parser && field.converter) {
+                        field.parser = field.converter;
+                        YAHOO.log("The field property converter has been deprecated" +
+                                " in favor of parser", "warn", this.toString());
+                    }
+                    if(field.parser) {
+                        data = field.parser.call(this, data);
+                    }
+                    // Safety measure
+                    if(data === undefined) {
+                        data = null;
+                    }
+                    oResult[key] = data;
+                }
+                // Capture each array of values into an array of results
+                oParsedResponse.results.unshift(oResult);
+            }
+        }
+        if(bError) {
+            YAHOO.log("XML data could not be parsed: " +
+                    YAHOO.lang.dump(oRawResponse), "error", this.toString());
+            oParsedResponse.error = true;
+        }
+        else {
+            YAHOO.log("Parsed XML data is " +
+                    YAHOO.lang.dump(oParsedResponse), "info", this.toString());
+        }
+        return oParsedResponse;
+};
+
+/**
+ * Overridable method parses raw JSON data into a response object.
+ *
+ * @method parseJSONData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.parseJSONData = function(oRequest, oRawResponse) {
+    var oParsedResponse = {};
+    if(oRawResponse && YAHOO.lang.isArray(this.responseSchema.fields)) {
+        var fields = this.responseSchema.fields;
+        var bError = false;
+        oParsedResponse.results = [];
+        var jsonObj,jsonList;
+
+        // Parse JSON object out if it's a string
+        if(YAHOO.lang.isString(oRawResponse)) {
+            // Check for latest JSON lib but divert KHTML clients
+            var isNotMac = (navigator.userAgent.toLowerCase().indexOf('khtml')== -1);
+            if(oRawResponse.parseJSON && isNotMac) {
+                // Use the new JSON utility if available
+                jsonObj = oRawResponse.parseJSON();
+                if(!jsonObj) {
+                    bError = true;
+                }
+            }
+            // Check for older JSON lib but divert KHTML clients
+            else if(window.JSON && JSON.parse && isNotMac) {
+                // Use the JSON utility if available
+                jsonObj = JSON.parse(oRawResponse);
+                if(!jsonObj) {
+                    bError = true;
+                }
+            }
+            // No JSON lib found so parse the string
+            else {
+                try {
+                    // Trim leading spaces
+                    while (oRawResponse.length > 0 &&
+                            (oRawResponse.charAt(0) != "{") &&
+                            (oRawResponse.charAt(0) != "[")) {
+                        oRawResponse = oRawResponse.substring(1, oRawResponse.length);
+                    }
+
+                    if(oRawResponse.length > 0) {
+                        // Strip extraneous stuff at the end
+                        var objEnd = Math.max(oRawResponse.lastIndexOf("]"),oRawResponse.lastIndexOf("}"));
+                        oRawResponse = oRawResponse.substring(0,objEnd+1);
+
+                        // Turn the string into an object literal...
+                        // ...eval is necessary here
+                        jsonObj = eval("(" + oRawResponse + ")");
+                        if(!jsonObj) {
+                            bError = true;
+                        }
+
+                    }
+                    else {
+                        jsonObj = null;
+                        bError = true;
+                    }
+                }
+                catch(e) {
+                    bError = true;
+               }
+            }
+        }
+        // Response must already be a JSON object
+        else if(oRawResponse.constructor == Object) {
+            jsonObj = oRawResponse;
+        }
+        // Not a string or an object
+        else {
+            bError = true;
+        }
+        // Now that we have a JSON object, parse a jsonList out of it
+        if(jsonObj && jsonObj.constructor == Object) {
+            try {
+                // eval is necessary here since schema can be of unknown depth
+                jsonList = eval("jsonObj." + this.responseSchema.resultsList);
+            }
+            catch(e) {
+                bError = true;
+            }
+        }
+
+        if(bError || !jsonList) {
+            YAHOO.log("JSON data could not be parsed: " +
+                    YAHOO.lang.dump(oRawResponse), "error", this.toString());
+            oParsedResponse.error = true;
+        }
+        if(jsonList && !YAHOO.lang.isArray(jsonList)) {
+            jsonList = [jsonList];
+        }
+        else if(!jsonList) {
+            jsonList = [];
+        }
+
+        // Loop through the array of all responses...
+        for(var i = jsonList.length-1; i >= 0 ; i--) {
+            var oResult = {};
+            var jsonResult = jsonList[i];
+            // ...and loop through each data field value of each response
+            for(var j = fields.length-1; j >= 0 ; j--) {
+                var field = fields[j];
+                var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                // ...and capture data into an array mapped according to the schema...
+                // eval is necessary here since schema can be of unknown depth
+                var data = eval("jsonResult." + key);
+                //YAHOO.log("data: " + i + " value:" +j+" = "+dataFieldValue,"debug",this.toString());
+                
+                // Backward compatibility
+                if(!field.parser && field.converter) {
+                    field.parser = field.converter;
+                    YAHOO.log("The field property converter has been deprecated" +
+                            " in favor of parser", "warn", this.toString());
+                }
+                if(field.parser) {
+                    data = field.parser.call(this, data);
+                }
+                // Safety measure
+                if(data === undefined) {
+                    data = null;
+                }
+                oResult[key] = data;
+            }
+            // Capture the array of data field values in an array of results
+            oParsedResponse.results.unshift(oResult);
+        }
+        YAHOO.log("Parsed JSON data is " +
+                YAHOO.lang.dump(oParsedResponse), "info", this.toString());
+    }
+    else {
+        YAHOO.log("JSON data could not be parsed: " +
+                YAHOO.lang.dump(oRawResponse), "error", this.toString());
+        oParsedResponse.error = true;
+    }
+    return oParsedResponse;
+};
+
+/**
+ * Overridable method parses raw HTML TABLE element data into a response object.
+ *
+ * @method parseHTMLTableData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.parseHTMLTableData = function(oRequest, oRawResponse) {
+        var bError = false;
+        var elTable = oRawResponse;
+        var fields = this.responseSchema.fields;
+        var oParsedResponse = {};
+        oParsedResponse.results = [];
+
+        // Iterate through each TBODY
+        for(var i=0; i<elTable.tBodies.length; i++) {
+            var elTbody = elTable.tBodies[i];
+
+            // Iterate through each TR
+            for(var j=elTbody.rows.length-1; j>-1; j--) {
+                var elRow = elTbody.rows[j];
+                var oResult = {};
+                
+                for(var k=fields.length-1; k>-1; k--) {
+                    var field = fields[k];
+                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                    var data = elRow.cells[k].innerHTML;
+
+                    // Backward compatibility
+                    if(!field.parser && field.converter) {
+                        field.parser = field.converter;
+                        YAHOO.log("The field property converter has been deprecated" +
+                                " in favor of parser", "warn", this.toString());
+                    }
+                    if(field.parser) {
+                        data = field.parser.call(this, data);
+                    }
+                    // Safety measure
+                    if(data === undefined) {
+                        data = null;
+                    }
+                    oResult[key] = data;
+                }
+                oParsedResponse.results.unshift(oResult);
+            }
+        }
+
+        if(bError) {
+            YAHOO.log("HTML TABLE data could not be parsed: " +
+                    YAHOO.lang.dump(oRawResponse), "error", this.toString());
+            oParsedResponse.error = true;
+        }
+        else {
+            YAHOO.log("Parsed HTML TABLE data is " +
+                    YAHOO.lang.dump(oParsedResponse), "info", this.toString());
+        }
+        return oParsedResponse;
+};
+
+YAHOO.register("datasource", YAHOO.util.DataSource, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/datasource/datasource-beta-min.js b/lib/yui/datasource/datasource-beta-min.js
new file mode 100755 (executable)
index 0000000..e248bad
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
+YAHOO.util.DataSource=function(oLiveData,oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}
+if(!oLiveData){return;}
+if(oLiveData.nodeType&&oLiveData.nodeType==9){this.dataType=YAHOO.util.DataSource.TYPE_XML;}
+else if(YAHOO.lang.isArray(oLiveData)){this.dataType=YAHOO.util.DataSource.TYPE_JSARRAY;}
+else if(YAHOO.lang.isString(oLiveData)){this.dataType=YAHOO.util.DataSource.TYPE_XHR;}
+else if(YAHOO.lang.isFunction(oLiveData)){this.dataType=YAHOO.util.DataSource.TYPE_JSFUNCTION;}
+else if(oLiveData.nodeName&&(oLiveData.nodeName.toLowerCase()=="table")){this.dataType=YAHOO.util.DataSource.TYPE_HTMLTABLE;}
+else if(YAHOO.lang.isObject(oLiveData)){this.dataType=YAHOO.util.DataSource.TYPE_JSON;}
+else{this.dataType=YAHOO.util.DataSource.TYPE_UNKNOWN;}
+this.liveData=oLiveData;this._oQueue={interval:null,conn:null,requests:[]};var maxCacheEntries=this.maxCacheEntries;if(!YAHOO.lang.isNumber(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}
+if(maxCacheEntries>0&&!this._aCache){this._aCache=[];}
+this._sName="DataSource instance"+YAHOO.util.DataSource._nIndex;YAHOO.util.DataSource._nIndex++;this.createEvent("cacheRequestEvent");this.createEvent("cacheResponseEvent");this.createEvent("requestEvent");this.createEvent("responseEvent");this.createEvent("responseParseEvent");this.createEvent("responseCacheEvent");this.createEvent("dataErrorEvent");this.createEvent("cacheFlushEvent");};YAHOO.augment(YAHOO.util.DataSource,YAHOO.util.EventProvider);YAHOO.util.DataSource.TYPE_UNKNOWN=-1;YAHOO.util.DataSource.TYPE_JSARRAY=0;YAHOO.util.DataSource.TYPE_JSFUNCTION=1;YAHOO.util.DataSource.TYPE_XHR=2;YAHOO.util.DataSource.TYPE_JSON=3;YAHOO.util.DataSource.TYPE_XML=4;YAHOO.util.DataSource.TYPE_TEXT=5;YAHOO.util.DataSource.TYPE_HTMLTABLE=6;YAHOO.util.DataSource.ERROR_DATAINVALID="Invalid data";YAHOO.util.DataSource.ERROR_DATANULL="Null data";YAHOO.util.DataSource._nIndex=0;YAHOO.util.DataSource._nTransactionId=0;YAHOO.util.DataSource.prototype._sName=null;YAHOO.util.DataSource.prototype._aCache=null;YAHOO.util.DataSource.prototype._oQueue=null;YAHOO.util.DataSource.prototype.maxCacheEntries=0;YAHOO.util.DataSource.prototype.liveData=null;YAHOO.util.DataSource.prototype.dataType=YAHOO.util.DataSource.TYPE_UNKNOWN;YAHOO.util.DataSource.prototype.responseType=YAHOO.util.DataSource.TYPE_UNKNOWN;YAHOO.util.DataSource.prototype.responseSchema=null;YAHOO.util.DataSource.prototype.connMgr=null;YAHOO.util.DataSource.prototype.connXhrMode="allowAll";YAHOO.util.DataSource.prototype.connMethodPost=false;YAHOO.util.DataSource.prototype.connTimeout=0;YAHOO.util.DataSource.parseString=function(oData){if(!YAHOO.lang.isValue(oData)){return null;}
+var string=oData+"";if(YAHOO.lang.isString(string)){return string;}
+else{return null;}};YAHOO.util.DataSource.parseNumber=function(oData){var number=oData*1;if(YAHOO.lang.isNumber(number)){return number;}
+else{return null;}};YAHOO.util.DataSource.convertNumber=function(oData){return YAHOO.util.DataSource.parseNumber(oData);};YAHOO.util.DataSource.parseDate=function(oData){var date=null;if(!(oData instanceof Date)){date=new Date(oData);}
+else{return oData;}
+if(date instanceof Date){return date;}
+else{return null;}};YAHOO.util.DataSource.convertDate=function(oData){return YAHOO.util.DataSource.parseDate(oData);};YAHOO.util.DataSource.prototype.toString=function(){return this._sName;};YAHOO.util.DataSource.prototype.getCachedResponse=function(oRequest,oCallback,oCaller){var aCache=this._aCache;var nCacheLength=(aCache)?aCache.length:0;var oResponse=null;if((this.maxCacheEntries>0)&&aCache&&(nCacheLength>0)){this.fireEvent("cacheRequestEvent",{request:oRequest,callback:oCallback,caller:oCaller});for(var i=nCacheLength-1;i>=0;i--){var oCacheElem=aCache[i];if(this.isCacheHit(oRequest,oCacheElem.request)){oResponse=oCacheElem.response;aCache.splice(i,1);this.addToCache(oRequest,oResponse);this.fireEvent("cacheResponseEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});break;}}}
+return oResponse;};YAHOO.util.DataSource.prototype.isCacheHit=function(oRequest,oCachedRequest){return(oRequest===oCachedRequest);};YAHOO.util.DataSource.prototype.addToCache=function(oRequest,oResponse){var aCache=this._aCache;if(!aCache){return;}
+while(aCache.length>=this.maxCacheEntries){aCache.shift();}
+var oCacheElem={request:oRequest,response:oResponse};aCache.push(oCacheElem);this.fireEvent("responseCacheEvent",{request:oRequest,response:oResponse});};YAHOO.util.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[];this.fireEvent("cacheFlushEvent");}};YAHOO.util.DataSource.prototype.sendRequest=function(oRequest,oCallback,oCaller){var oCachedResponse=this.getCachedResponse(oRequest,oCallback,oCaller);if(oCachedResponse){oCallback.call(oCaller,oRequest,oCachedResponse);return null;}
+return this.makeConnection(oRequest,oCallback,oCaller);};YAHOO.util.DataSource.prototype.makeConnection=function(oRequest,oCallback,oCaller){this.fireEvent("requestEvent",{request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=null;var tId=YAHOO.util.DataSource._nTransactionId++;switch(this.dataType){case YAHOO.util.DataSource.TYPE_JSFUNCTION:oRawResponse=this.liveData(oRequest);this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);break;case YAHOO.util.DataSource.TYPE_XHR:var oSelf=this;var oConnMgr=this.connMgr||YAHOO.util.Connect;var oQueue=this._oQueue;var _xhrSuccess=function(oResponse){if(oResponse&&(this.connXhrMode=="ignoreStaleResponses")&&(oResponse.tId!=oQueue.conn.tId)){return null;}
+else if(!oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:YAHOO.util.DataSource.ERROR_DATANULL});oCallback.call(oCaller,oRequest,oResponse,true);return null;}
+else{this.handleResponse(oRequest,oResponse,oCallback,oCaller,tId);}};var _xhrFailure=function(oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:YAHOO.util.DataSource.ERROR_DATAINVALID});if((this.liveData.lastIndexOf("?")!==this.liveData.length-1)&&(oRequest.indexOf("?")!==0)){}
+oCallback.call(oCaller,oRequest,oResponse,true);return null;};var _xhrCallback={success:_xhrSuccess,failure:_xhrFailure,scope:this};if(YAHOO.lang.isNumber(this.connTimeout)){_xhrCallback.timeout=this.connTimeout;}
+if(this.connXhrMode=="cancelStaleRequests"){if(oQueue.conn){if(oConnMgr.abort){oConnMgr.abort(oQueue.conn);oQueue.conn=null;}
+else{}}}
+if(oConnMgr&&oConnMgr.asyncRequest){var sLiveData=this.liveData;var isPost=this.connMethodPost;var sMethod=(isPost)?"POST":"GET";var sUri=(isPost)?sLiveData:sLiveData+oRequest;var sRequest=(isPost)?oRequest:null;if(this.connXhrMode!="queueRequests"){oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}
+else{if(oQueue.conn){oQueue.requests.push({request:oRequest,callback:_xhrCallback});if(!oQueue.interval){oQueue.interval=setInterval(function(){if(oConnMgr.isCallInProgress(oQueue.conn)){return;}
+else{if(oQueue.requests.length>0){sUri=(isPost)?sLiveData:sLiveData+oQueue.requests[0].request;sRequest=(isPost)?oQueue.requests[0].request:null;oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,oQueue.requests[0].callback,sRequest);oQueue.requests.shift();}
+else{clearInterval(oQueue.interval);oQueue.interval=null;}}},50);}}
+else{oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}}}
+else{oCallback.call(oCaller,oRequest,null,true);}
+break;default:oRawResponse=this.liveData;this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);break;}
+return tId;};YAHOO.util.DataSource.prototype.handleResponse=function(oRequest,oRawResponse,oCallback,oCaller,tId){this.fireEvent("responseEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,tId:tId});var xhr=(this.dataType==YAHOO.util.DataSource.TYPE_XHR)?true:false;var oParsedResponse=null;var bError=false;oRawResponse=this.doBeforeParseData(oRequest,oRawResponse);switch(this.responseType){case YAHOO.util.DataSource.TYPE_JSARRAY:if(xhr&&oRawResponse.responseText){oRawResponse=oRawResponse.responseText;}
+oParsedResponse=this.parseArrayData(oRequest,oRawResponse);break;case YAHOO.util.DataSource.TYPE_JSON:if(xhr&&oRawResponse.responseText){oRawResponse=oRawResponse.responseText;}
+oParsedResponse=this.parseJSONData(oRequest,oRawResponse);break;case YAHOO.util.DataSource.TYPE_HTMLTABLE:if(xhr&&oRawResponse.responseText){oRawResponse=oRawResponse.responseText;}
+oParsedResponse=this.parseHTMLTableData(oRequest,oRawResponse);break;case YAHOO.util.DataSource.TYPE_XML:if(xhr&&oRawResponse.responseXML){oRawResponse=oRawResponse.responseXML;}
+oParsedResponse=this.parseXMLData(oRequest,oRawResponse);break;case YAHOO.util.DataSource.TYPE_TEXT:if(xhr&&oRawResponse.responseText){oRawResponse=oRawResponse.responseText;}
+oParsedResponse=this.parseTextData(oRequest,oRawResponse);break;default:break;}
+if(oParsedResponse){oParsedResponse.tId=tId;oParsedResponse=this.doBeforeCallback(oRequest,oRawResponse,oParsedResponse);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});this.addToCache(oRequest,oParsedResponse);}
+else{this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:YAHOO.util.DataSource.ERROR_DATANULL});oParsedResponse={error:true};}
+oCallback.call(oCaller,oRequest,oParsedResponse);};YAHOO.util.DataSource.prototype.doBeforeParseData=function(oRequest,oRawResponse){return oRawResponse;};YAHOO.util.DataSource.prototype.doBeforeCallback=function(oRequest,oRawResponse,oParsedResponse){return oParsedResponse;};YAHOO.util.DataSource.prototype.parseArrayData=function(oRequest,oRawResponse){if(YAHOO.lang.isArray(oRawResponse)&&YAHOO.lang.isArray(this.responseSchema.fields)){var oParsedResponse={results:[]};var fields=this.responseSchema.fields;for(var i=oRawResponse.length-1;i>-1;i--){var oResult={};for(var j=fields.length-1;j>-1;j--){var field=fields[j];var key=(YAHOO.lang.isValue(field.key))?field.key:field;var data=(YAHOO.lang.isValue(oRawResponse[i][j]))?oRawResponse[i][j]:oRawResponse[i][key];if(!field.parser&&field.converter){field.parser=field.converter;}
+if(field.parser){data=field.parser.call(this,data);}
+if(data===undefined){data=null;}
+oResult[key]=data;}
+oParsedResponse.results.unshift(oResult);}
+return oParsedResponse;}
+else{return null;}};YAHOO.util.DataSource.prototype.parseTextData=function(oRequest,oRawResponse){var oParsedResponse={};if(YAHOO.lang.isString(oRawResponse)&&YAHOO.lang.isArray(this.responseSchema.fields)&&YAHOO.lang.isString(this.responseSchema.recordDelim)&&YAHOO.lang.isString(this.responseSchema.fieldDelim)){oParsedResponse.results=[];var recDelim=this.responseSchema.recordDelim;var fieldDelim=this.responseSchema.fieldDelim;var fields=this.responseSchema.fields;if(oRawResponse.length>0){var newLength=oRawResponse.length-recDelim.length;if(oRawResponse.substr(newLength)==recDelim){oRawResponse=oRawResponse.substr(0,newLength);}
+var recordsarray=oRawResponse.split(recDelim);for(var i=recordsarray.length-1;i>-1;i--){var oResult={};for(var j=fields.length-1;j>-1;j--){var fielddataarray=recordsarray[i].split(fieldDelim);var data=fielddataarray[j];if(data.charAt(0)=="\""){data=data.substr(1);}
+if(data.charAt(data.length-1)=="\""){data=data.substr(0,data.length-1);}
+var field=fields[j];var key=(YAHOO.lang.isValue(field.key))?field.key:field;if(!field.parser&&field.converter){field.parser=field.converter;}
+if(field.parser){data=field.parser.call(this,data);}
+if(data===undefined){data=null;}
+oResult[key]=data;}
+oParsedResponse.results.unshift(oResult);}}}
+else{oParsedResponse.error=true;}
+return oParsedResponse;};YAHOO.util.DataSource.prototype.parseXMLData=function(oRequest,oRawResponse){var bError=false;var oParsedResponse={};var xmlList=(this.responseSchema.resultNode)?oRawResponse.getElementsByTagName(this.responseSchema.resultNode):null;if(!xmlList||!YAHOO.lang.isArray(this.responseSchema.fields)){bError=true;}
+else{oParsedResponse.results=[];for(var k=xmlList.length-1;k>=0;k--){var result=xmlList.item(k);var oResult={};for(var m=this.responseSchema.fields.length-1;m>=0;m--){var field=this.responseSchema.fields[m];var key=(YAHOO.lang.isValue(field.key))?field.key:field;var data=null;var xmlAttr=result.attributes.getNamedItem(key);if(xmlAttr){data=xmlAttr.value;}
+else{var xmlNode=result.getElementsByTagName(key);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){data=xmlNode.item(0).firstChild.nodeValue;}
+else{data="";}}
+if(!field.parser&&field.converter){field.parser=field.converter;}
+if(field.parser){data=field.parser.call(this,data);}
+if(data===undefined){data=null;}
+oResult[key]=data;}
+oParsedResponse.results.unshift(oResult);}}
+if(bError){oParsedResponse.error=true;}
+else{}
+return oParsedResponse;};YAHOO.util.DataSource.prototype.parseJSONData=function(oRequest,oRawResponse){var oParsedResponse={};if(oRawResponse&&YAHOO.lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;var bError=false;oParsedResponse.results=[];var jsonObj,jsonList;if(YAHOO.lang.isString(oRawResponse)){var isNotMac=(navigator.userAgent.toLowerCase().indexOf('khtml')==-1);if(oRawResponse.parseJSON&&isNotMac){jsonObj=oRawResponse.parseJSON();if(!jsonObj){bError=true;}}
+else if(window.JSON&&JSON.parse&&isNotMac){jsonObj=JSON.parse(oRawResponse);if(!jsonObj){bError=true;}}
+else{try{while(oRawResponse.length>0&&(oRawResponse.charAt(0)!="{")&&(oRawResponse.charAt(0)!="[")){oRawResponse=oRawResponse.substring(1,oRawResponse.length);}
+if(oRawResponse.length>0){var objEnd=Math.max(oRawResponse.lastIndexOf("]"),oRawResponse.lastIndexOf("}"));oRawResponse=oRawResponse.substring(0,objEnd+1);jsonObj=eval("("+oRawResponse+")");if(!jsonObj){bError=true;}}
+else{jsonObj=null;bError=true;}}
+catch(e){bError=true;}}}
+else if(oRawResponse.constructor==Object){jsonObj=oRawResponse;}
+else{bError=true;}
+if(jsonObj&&jsonObj.constructor==Object){try{jsonList=eval("jsonObj."+this.responseSchema.resultsList);}
+catch(e){bError=true;}}
+if(bError||!jsonList){oParsedResponse.error=true;}
+if(jsonList&&!YAHOO.lang.isArray(jsonList)){jsonList=[jsonList];}
+else if(!jsonList){jsonList=[];}
+for(var i=jsonList.length-1;i>=0;i--){var oResult={};var jsonResult=jsonList[i];for(var j=fields.length-1;j>=0;j--){var field=fields[j];var key=(YAHOO.lang.isValue(field.key))?field.key:field;var data=eval("jsonResult."+key);if(!field.parser&&field.converter){field.parser=field.converter;}
+if(field.parser){data=field.parser.call(this,data);}
+if(data===undefined){data=null;}
+oResult[key]=data;}
+oParsedResponse.results.unshift(oResult);}}
+else{oParsedResponse.error=true;}
+return oParsedResponse;};YAHOO.util.DataSource.prototype.parseHTMLTableData=function(oRequest,oRawResponse){var bError=false;var elTable=oRawResponse;var fields=this.responseSchema.fields;var oParsedResponse={};oParsedResponse.results=[];for(var i=0;i<elTable.tBodies.length;i++){var elTbody=elTable.tBodies[i];for(var j=elTbody.rows.length-1;j>-1;j--){var elRow=elTbody.rows[j];var oResult={};for(var k=fields.length-1;k>-1;k--){var field=fields[k];var key=(YAHOO.lang.isValue(field.key))?field.key:field;var data=elRow.cells[k].innerHTML;if(!field.parser&&field.converter){field.parser=field.converter;}
+if(field.parser){data=field.parser.call(this,data);}
+if(data===undefined){data=null;}
+oResult[key]=data;}
+oParsedResponse.results.unshift(oResult);}}
+if(bError){oParsedResponse.error=true;}
+else{}
+return oParsedResponse;};YAHOO.register("datasource",YAHOO.util.DataSource,{version:"2.3.0",build:"442"});
\ No newline at end of file
diff --git a/lib/yui/datasource/datasource-beta.js b/lib/yui/datasource/datasource-beta.js
new file mode 100755 (executable)
index 0000000..1061f34
--- /dev/null
@@ -0,0 +1,1365 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * The DataSource utility provides a common configurable interface for widgets
+ * to access a variety of data, from JavaScript arrays to online servers over
+ * XHR.
+ *
+ * @namespace YAHOO.util
+ * @module datasource
+ * @requires yahoo, event
+ * @optional connection
+ * @title DataSource Utility
+ * @beta
+ */
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The DataSource class defines and manages a live set of data for widgets to
+ * interact with. Examples of live databases include in-memory
+ * local data such as a JavaScript array, a JavaScript function, or JSON, or
+ * remote data such as data retrieved through an XHR connection.
+ *
+ * @class DataSource
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param oLiveData {Object} Pointer to live database.
+ * @param oConfigs {Object} (optional) Object literal of configuration values.
+ */
+YAHOO.util.DataSource = function(oLiveData, oConfigs) {
+    // Set any config params passed in to override defaults
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            if(sConfig) {
+                this[sConfig] = oConfigs[sConfig];
+            }
+        }
+    }
+    
+    if(!oLiveData) {
+        return;
+    }
+
+    if(oLiveData.nodeType && oLiveData.nodeType == 9) {
+        this.dataType = YAHOO.util.DataSource.TYPE_XML;
+    }
+    else if(YAHOO.lang.isArray(oLiveData)) {
+        this.dataType = YAHOO.util.DataSource.TYPE_JSARRAY;
+    }
+    else if(YAHOO.lang.isString(oLiveData)) {
+        this.dataType = YAHOO.util.DataSource.TYPE_XHR;
+    }
+    else if(YAHOO.lang.isFunction(oLiveData)) {
+        this.dataType = YAHOO.util.DataSource.TYPE_JSFUNCTION;
+    }
+    else if(oLiveData.nodeName && (oLiveData.nodeName.toLowerCase() == "table")) {
+        this.dataType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
+    }
+    else if(YAHOO.lang.isObject(oLiveData)) {
+        this.dataType = YAHOO.util.DataSource.TYPE_JSON;
+    }
+    else {
+        this.dataType = YAHOO.util.DataSource.TYPE_UNKNOWN;
+    }
+
+    this.liveData = oLiveData;
+    this._oQueue = {interval:null, conn:null, requests:[]};
+
+
+    // Validate and initialize public configs
+    var maxCacheEntries = this.maxCacheEntries;
+    if(!YAHOO.lang.isNumber(maxCacheEntries) || (maxCacheEntries < 0)) {
+        maxCacheEntries = 0;
+    }
+
+    // Initialize local cache
+    if(maxCacheEntries > 0 && !this._aCache) {
+        this._aCache = [];
+    }
+
+    this._sName = "DataSource instance" + YAHOO.util.DataSource._nIndex;
+    YAHOO.util.DataSource._nIndex++;
+
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Custom Events
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Fired when a request is made to the local cache.
+     *
+     * @event cacheRequestEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     */
+    this.createEvent("cacheRequestEvent");
+
+    /**
+     * Fired when data is retrieved from the local cache.
+     *
+     * @event getCachedResponseEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.response {Object} The response object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.tId {Number} Transaction ID.
+     */
+    this.createEvent("cacheResponseEvent");
+
+    /**
+     * Fired when a request is sent to the live data source.
+     *
+     * @event requestEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     */
+    this.createEvent("requestEvent");
+
+    /**
+     * Fired when live data source sends response.
+     *
+     * @event responseEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.response {Object} The raw response object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     */
+    this.createEvent("responseEvent");
+
+    /**
+     * Fired when response is parsed.
+     *
+     * @event responseParseEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.response {Object} The parsed response object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     */
+    this.createEvent("responseParseEvent");
+
+    /**
+     * Fired when response is cached.
+     *
+     * @event responseCacheEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.response {Object} The parsed response object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     */
+    this.createEvent("responseCacheEvent");
+    /**
+     * Fired when an error is encountered with the live data source.
+     *
+     * @event dataErrorEvent
+     * @param oArgs.request {Object} The request object.
+     * @param oArgs.callback {Function} The callback function.
+     * @param oArgs.caller {Object} The parent object of the callback function.
+     * @param oArgs.message {String} The error message.
+     */
+    this.createEvent("dataErrorEvent");
+
+    /**
+     * Fired when the local cache is flushed.
+     *
+     * @event cacheFlushEvent
+     */
+    this.createEvent("cacheFlushEvent");
+};
+
+YAHOO.augment(YAHOO.util.DataSource, YAHOO.util.EventProvider);
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public constants
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Type is unknown.
+ *
+ * @property TYPE_UNKNOWN
+ * @type Number
+ * @final
+ * @default -1
+ */
+YAHOO.util.DataSource.TYPE_UNKNOWN = -1;
+
+/**
+ * Type is a JavaScript Array.
+ *
+ * @property TYPE_JSARRAY
+ * @type Number
+ * @final
+ * @default 0
+ */
+YAHOO.util.DataSource.TYPE_JSARRAY = 0;
+
+/**
+ * Type is a JavaScript Function.
+ *
+ * @property TYPE_JSFUNCTION
+ * @type Number
+ * @final
+ * @default 1
+ */
+YAHOO.util.DataSource.TYPE_JSFUNCTION = 1;
+
+/**
+ * Type is hosted on a server via an XHR connection.
+ *
+ * @property TYPE_XHR
+ * @type Number
+ * @final
+ * @default 2
+ */
+YAHOO.util.DataSource.TYPE_XHR = 2;
+
+/**
+ * Type is JSON.
+ *
+ * @property TYPE_JSON
+ * @type Number
+ * @final
+ * @default 3
+ */
+YAHOO.util.DataSource.TYPE_JSON = 3;
+
+/**
+ * Type is XML.
+ *
+ * @property TYPE_XML
+ * @type Number
+ * @final
+ * @default 4
+ */
+YAHOO.util.DataSource.TYPE_XML = 4;
+
+/**
+ * Type is plain text.
+ *
+ * @property TYPE_TEXT
+ * @type Number
+ * @final
+ * @default 5
+ */
+YAHOO.util.DataSource.TYPE_TEXT = 5;
+
+/**
+ * Type is an HTML TABLE element.
+ *
+ * @property TYPE_HTMLTABLE
+ * @type Number
+ * @final
+ * @default 6
+ */
+YAHOO.util.DataSource.TYPE_HTMLTABLE = 6;
+
+/**
+ * Error message for invalid dataresponses.
+ *
+ * @property ERROR_DATAINVALID
+ * @type String
+ * @final
+ * @default "Invalid data"
+ */
+YAHOO.util.DataSource.ERROR_DATAINVALID = "Invalid data";
+
+/**
+ * Error message for null data responses.
+ *
+ * @property ERROR_DATANULL
+ * @type String
+ * @final
+ * @default "Null data"
+ */
+YAHOO.util.DataSource.ERROR_DATANULL = "Null data";
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class variable to index multiple DataSource instances.
+ *
+ * @property DataSource._nIndex
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.util.DataSource._nIndex = 0;
+
+/**
+ * Internal class variable to assign unique transaction IDs.
+ *
+ * @property DataSource._nTransactionId
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.util.DataSource._nTransactionId = 0;
+
+/**
+ * Name of DataSource instance.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.util.DataSource.prototype._sName = null;
+
+/**
+ * Local cache of data result object literals indexed chronologically.
+ *
+ * @property _aCache
+ * @type Object[]
+ * @private
+ */
+YAHOO.util.DataSource.prototype._aCache = null;
+
+/**
+ * Local queue of request connections, enabled if queue needs to be managed.
+ *
+ * @property _oQueue
+ * @type Object
+ * @private
+ */
+YAHOO.util.DataSource.prototype._oQueue = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Max size of the local cache.  Set to 0 to turn off caching.  Caching is
+ * useful to reduce the number of server connections.  Recommended only for data
+ * sources that return comprehensive results for queries or when stale data is
+ * not an issue.
+ *
+ * @property maxCacheEntries
+ * @type Number
+ * @default 0
+ */
+YAHOO.util.DataSource.prototype.maxCacheEntries = 0;
+
+ /**
+ * Pointer to live database.
+ *
+ * @property liveData
+ * @type Object
+ */
+YAHOO.util.DataSource.prototype.liveData = null;
+
+/**
+ * Where the live data is held.
+ *
+ * @property dataType
+ * @type Number
+ * @default YAHOO.util.DataSource.TYPE_UNKNOWN
+ *
+ */
+YAHOO.util.DataSource.prototype.dataType = YAHOO.util.DataSource.TYPE_UNKNOWN;
+
+/**
+ * Format of response.
+ *
+ * @property responseType
+ * @type Number
+ * @default YAHOO.util.DataSource.TYPE_UNKNOWN
+ */
+YAHOO.util.DataSource.prototype.responseType = YAHOO.util.DataSource.TYPE_UNKNOWN;
+
+/**
+ * Response schema object literal takes a combination of the following properties:
+ *
+ * <dl>
+ * <dt>resultsList</dt> <dd>Pointer to array of tabular data</dd>
+ * <dt>resultNode</dt> <dd>Pointer to node name of row data (XML data only)</dd>
+ * <dt>recordDelim</dt> <dd>Record delimiter (text data only)</dd>
+ * <dt>fieldDelim</dt> <dd>Field delimiter (text data only)</dd>
+ * <dt>fields</dt> <dd>Array of field names (aka keys), or array of object literals
+ * such as: {key:"fieldname",parser:YAHOO.util.DataSource.parseDate}</dd>
+ * </dl>
+ *
+ * @property responseSchema
+ * @type Object
+ */
+YAHOO.util.DataSource.prototype.responseSchema = null;
+
+ /**
+ * Alias to YUI Connection Manager. Allows implementers to specify their own
+ * subclasses of the YUI Connection Manager utility.
+ *
+ * @property connMgr
+ * @type Object
+ * @default YAHOO.util.Connect
+ */
+YAHOO.util.DataSource.prototype.connMgr = null;
+
+ /**
+ * If data is accessed over XHR via Connection Manager, this setting defines
+ * request/response management in the following manner:
+ * <dl>
+ *     <dt>queueRequests</dt>
+ *     <dd>If a request is already in progress, wait until response is returned
+ *     before sending the next request.</dd>
+ *
+ *     <dt>cancelStaleRequests</dt>
+ *     <dd>If a request is already in progress, cancel it before sending the next
+ *     request.</dd>
+ *
+ *     <dt>ignoreStaleResponses</dt>
+ *     <dd>Send all requests, but handle only the response for the most recently
+ *     sent request.</dd>
+ *
+ *     <dt>allowAll</dt>
+ *     <dd>Send all requests and handle all responses.</dd>
+ *
+ * </dl>
+ *
+ * @property connXhrMode
+ * @type String
+ * @default "allowAll"
+ */
+YAHOO.util.DataSource.prototype.connXhrMode = "allowAll";
+
+ /**
+ * If data is accessed over XHR via Connection Manager, true if data should be
+ * sent via POST, otherwise data will be sent via GET.
+ *
+ * @property connMethodPost
+ * @type Boolean
+ * @default false
+ */
+YAHOO.util.DataSource.prototype.connMethodPost = false;
+
+ /**
+ * If data is accessed over XHR via Connection Manager, the connection timeout
+ * defines how many  milliseconds the XHR connection will wait for a server
+ * response. Any non-zero value will enable the Connection utility's
+ * Auto-Abort feature.
+ *
+ * @property connTimeout
+ * @type Number
+ * @default 0
+ */
+YAHOO.util.DataSource.prototype.connTimeout = 0;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public static methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Converts data to type String.
+ *
+ * @method DataSource.parseString
+ * @param oData {String | Number | Boolean | Date | Array | Object} Data to parse.
+ * The special values null and undefined will return null.
+ * @return {Number} A string, or null.
+ * @static
+ */
+YAHOO.util.DataSource.parseString = function(oData) {
+    // Special case null and undefined
+    if(!YAHOO.lang.isValue(oData)) {
+        return null;
+    }
+    
+    //Convert to string
+    var string = oData + "";
+
+    // Validate
+    if(YAHOO.lang.isString(string)) {
+        return string;
+    }
+    else {
+        return null;
+    }
+};
+
+/**
+ * Converts data to type Number.
+ *
+ * @method DataSource.parseNumber
+ * @param oData {String | Number | Boolean | Null} Data to convert. Beware, null
+ * returns as 0.
+ * @return {Number} A number, or null if NaN.
+ * @static
+ */
+YAHOO.util.DataSource.parseNumber = function(oData) {
+    //Convert to number
+    var number = oData * 1;
+    
+    // Validate
+    if(YAHOO.lang.isNumber(number)) {
+        return number;
+    }
+    else {
+        return null;
+    }
+};
+// Backward compatibility
+YAHOO.util.DataSource.convertNumber = function(oData) {
+    return YAHOO.util.DataSource.parseNumber(oData);
+};
+
+/**
+ * Converts data to type Date.
+ *
+ * @method DataSource.parseDate
+ * @param oData {Date | String | Number} Data to convert.
+ * @return {Date} A Date instance.
+ * @static
+ */
+YAHOO.util.DataSource.parseDate = function(oData) {
+    var date = null;
+    
+    //Convert to date
+    if(!(oData instanceof Date)) {
+        date = new Date(oData);
+    }
+    else {
+        return oData;
+    }
+    
+    // Validate
+    if(date instanceof Date) {
+        return date;
+    }
+    else {
+        return null;
+    }
+};
+// Backward compatibility
+YAHOO.util.DataSource.convertDate = function(oData) {
+    return YAHOO.util.DataSource.parseDate(oData);
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Public accessor to the unique name of the DataSource instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the DataSource instance.
+ */
+YAHOO.util.DataSource.prototype.toString = function() {
+    return this._sName;
+};
+
+/**
+ * Overridable method passes request to cache and returns cached response if any,
+ * refreshing the hit in the cache as the newest item. Returns null if there is
+ * no cache hit.
+ *
+ * @method getCachedResponse
+ * @param oRequest {Object} Request object.
+ * @param oCallback {Function} Handler function to receive the response.
+ * @param oCaller {Object} The Calling object that is making the request.
+ * @return {Object} Cached response object or null.
+ */
+YAHOO.util.DataSource.prototype.getCachedResponse = function(oRequest, oCallback, oCaller) {
+    var aCache = this._aCache;
+    var nCacheLength = (aCache) ? aCache.length : 0;
+    var oResponse = null;
+
+    // If cache is enabled...
+    if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {
+        this.fireEvent("cacheRequestEvent", {request:oRequest,callback:oCallback,caller:oCaller});
+
+        // Loop through each cached element
+        for(var i = nCacheLength-1; i >= 0; i--) {
+            var oCacheElem = aCache[i];
+
+            // Defer cache hit logic to a public overridable method
+            if(this.isCacheHit(oRequest,oCacheElem.request)) {
+                // Grab the cached response
+                oResponse = oCacheElem.response;
+                // The cache returned a hit!
+                // Remove element from its original location
+                aCache.splice(i,1);
+                // Add as newest
+                this.addToCache(oRequest, oResponse);
+                this.fireEvent("cacheResponseEvent", {request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});
+                break;
+            }
+        }
+    }
+    return oResponse;
+};
+
+/**
+ * Default overridable method matches given request to given cached request.
+ * Returns true if is a hit, returns false otherwise.  Implementers should
+ * override this method to customize the cache-matching algorithm.
+ *
+ * @method isCacheHit
+ * @param oRequest {Object} Request object.
+ * @param oCachedRequest {Object} Cached request object.
+ * @return {Boolean} True if given request matches cached request, false otherwise.
+ */
+YAHOO.util.DataSource.prototype.isCacheHit = function(oRequest, oCachedRequest) {
+    return (oRequest === oCachedRequest);
+};
+
+/**
+ * Adds a new item to the cache. If cache is full, evicts the stalest item
+ * before adding the new item.
+ *
+ * @method addToCache
+ * @param oRequest {Object} Request object.
+ * @param oResponse {Object} Response object to cache.
+ */
+YAHOO.util.DataSource.prototype.addToCache = function(oRequest, oResponse) {
+    var aCache = this._aCache;
+    if(!aCache) {
+        return;
+    }
+
+    //TODO: check for duplicate entries
+
+    // If the cache is full, make room by removing stalest element (index=0)
+    while(aCache.length >= this.maxCacheEntries) {
+        aCache.shift();
+    }
+
+    // Add to cache in the newest position, at the end of the array
+    var oCacheElem = {request:oRequest,response:oResponse};
+    aCache.push(oCacheElem);
+    this.fireEvent("responseCacheEvent", {request:oRequest,response:oResponse});
+};
+
+/**
+ * Flushes cache.
+ *
+ * @method flushCache
+ */
+YAHOO.util.DataSource.prototype.flushCache = function() {
+    if(this._aCache) {
+        this._aCache = [];
+        this.fireEvent("cacheFlushEvent");
+    }
+};
+
+/**
+ * First looks for cached response, then sends request to live data.
+ *
+ * @method sendRequest
+ * @param oRequest {Object} Request object.
+ * @param oCallback {Function} Handler function to receive the response.
+ * @param oCaller {Object} The Calling object that is making the request.
+ * @return {Number} Transaction ID, or null if response found in cache.
+ */
+YAHOO.util.DataSource.prototype.sendRequest = function(oRequest, oCallback, oCaller) {
+    // First look in cache
+    var oCachedResponse = this.getCachedResponse(oRequest, oCallback, oCaller);
+    if(oCachedResponse) {
+        oCallback.call(oCaller, oRequest, oCachedResponse);
+        return null;
+    }
+
+    // Not in cache, so forward request to live data
+    return this.makeConnection(oRequest, oCallback, oCaller);
+};
+
+/**
+ * Overridable method provides default functionality to make a connection to
+ * live data in order to send request. The response coming back is then
+ * forwarded to the handleResponse function. This method should be customized
+ * to achieve more complex implementations.
+ *
+ * @method makeConnection
+ * @param oRequest {Object} Request object.
+ * @param oCallback {Function} Handler function to receive the response.
+ * @param oCaller {Object} The Calling object that is making the request.
+ * @return {Number} Transaction ID.
+ */
+YAHOO.util.DataSource.prototype.makeConnection = function(oRequest, oCallback, oCaller) {
+    this.fireEvent("requestEvent", {request:oRequest,callback:oCallback,caller:oCaller});
+    var oRawResponse = null;
+    var tId = YAHOO.util.DataSource._nTransactionId++;
+
+    // How to make the connection depends on the type of data
+    switch(this.dataType) {
+        // If the live data is a JavaScript Function
+        // pass the request in as a parameter and
+        // forward the return value to the handler
+        case YAHOO.util.DataSource.TYPE_JSFUNCTION:
+            oRawResponse = this.liveData(oRequest);
+            this.handleResponse(oRequest, oRawResponse, oCallback, oCaller, tId);
+            break;
+        // If the live data is over Connection Manager
+        // set up the callback object and
+        // pass the request in as a URL query and
+        // forward the response to the handler
+        case YAHOO.util.DataSource.TYPE_XHR:
+            var oSelf = this;
+            var oConnMgr = this.connMgr || YAHOO.util.Connect;
+            var oQueue = this._oQueue;
+
+            /**
+             * Define Connection Manager success handler
+             *
+             * @method _xhrSuccess
+             * @param oResponse {Object} HTTPXMLRequest object
+             * @private
+             */
+            var _xhrSuccess = function(oResponse) {
+                // If response ID does not match last made request ID,
+                // silently fail and wait for the next response
+                if(oResponse && (this.connXhrMode == "ignoreStaleResponses") &&
+                        (oResponse.tId != oQueue.conn.tId)) {
+                    return null;
+                }
+                // Error if no response
+                else if(!oResponse) {
+                    this.fireEvent("dataErrorEvent", {request:oRequest,
+                            callback:oCallback, caller:oCaller,
+                            message:YAHOO.util.DataSource.ERROR_DATANULL});
+
+                    // Send error response back to the caller with the error flag on
+                    oCallback.call(oCaller, oRequest, oResponse, true);
+
+                    return null;
+                }
+                // Forward to handler
+                else {
+                    this.handleResponse(oRequest, oResponse, oCallback, oCaller, tId);
+                }
+            };
+
+            /**
+             * Define Connection Manager failure handler
+             *
+             * @method _xhrFailure
+             * @param oResponse {Object} HTTPXMLRequest object
+             * @private
+             */
+            var _xhrFailure = function(oResponse) {
+                this.fireEvent("dataErrorEvent", {request:oRequest,
+                        callback:oCallback, caller:oCaller,
+                        message:YAHOO.util.DataSource.ERROR_DATAINVALID});
+
+                // Backward compatibility
+                if((this.liveData.lastIndexOf("?") !== this.liveData.length-1) &&
+                    (oRequest.indexOf("?") !== 0)){
+                }
+
+                // Send failure response back to the caller with the error flag on
+                oCallback.call(oCaller, oRequest, oResponse, true);
+                return null;
+            };
+
+            /**
+             * Define Connection Manager callback object
+             *
+             * @property _xhrCallback
+             * @param oResponse {Object} HTTPXMLRequest object
+             * @private
+             */
+             var _xhrCallback = {
+                success:_xhrSuccess,
+                failure:_xhrFailure,
+                scope: this
+            };
+
+            // Apply Connection Manager timeout
+            if(YAHOO.lang.isNumber(this.connTimeout)) {
+                _xhrCallback.timeout = this.connTimeout;
+            }
+
+            // Cancel stale requests
+            if(this.connXhrMode == "cancelStaleRequests") {
+                    // Look in queue for stale requests
+                    if(oQueue.conn) {
+                        if(oConnMgr.abort) {
+                            oConnMgr.abort(oQueue.conn);
+                            oQueue.conn = null;
+                        }
+                        else {
+                        }
+                    }
+            }
+
+            // Get ready to send the request URL
+            if(oConnMgr && oConnMgr.asyncRequest) {
+                var sLiveData = this.liveData;
+                var isPost = this.connMethodPost;
+                var sMethod = (isPost) ? "POST" : "GET";
+                var sUri = (isPost) ? sLiveData : sLiveData+oRequest;
+                var sRequest = (isPost) ? oRequest : null;
+
+                // Send the request right away
+                if(this.connXhrMode != "queueRequests") {
+                    oQueue.conn = oConnMgr.asyncRequest(sMethod, sUri, _xhrCallback, sRequest);
+                }
+                // Queue up then send the request
+                else {
+                    // Found a request already in progress
+                    if(oQueue.conn) {
+                        // Add request to queue
+                        oQueue.requests.push({request:oRequest, callback:_xhrCallback});
+
+                        // Interval needs to be started
+                        if(!oQueue.interval) {
+                            oQueue.interval = setInterval(function() {
+                                // Connection is in progress
+                                if(oConnMgr.isCallInProgress(oQueue.conn)) {
+                                    return;
+                                }
+                                else {
+                                    // Send next request
+                                    if(oQueue.requests.length > 0) {
+                                        sUri = (isPost) ? sLiveData : sLiveData+oQueue.requests[0].request;
+                                        sRequest = (isPost) ? oQueue.requests[0].request : null;
+                                        oQueue.conn = oConnMgr.asyncRequest(sMethod, sUri, oQueue.requests[0].callback, sRequest);
+
+                                        // Remove request from queue
+                                        oQueue.requests.shift();
+                                    }
+                                    // No more requests
+                                    else {
+                                        clearInterval(oQueue.interval);
+                                        oQueue.interval = null;
+                                    }
+                                }
+                            }, 50);
+                        }
+                    }
+                    // Nothing is in progress
+                    else {
+                        oQueue.conn = oConnMgr.asyncRequest(sMethod, sUri, _xhrCallback, sRequest);
+                    }
+                }
+            }
+            else {
+                // Send null response back to the caller with the error flag on
+                oCallback.call(oCaller, oRequest, null, true);
+            }
+
+            break;
+        // Simply forward the entire data object to the handler
+        default:
+            /* accounts for the following cases:
+            YAHOO.util.DataSource.TYPE_UNKNOWN:
+            YAHOO.util.DataSource.TYPE_JSARRAY:
+            YAHOO.util.DataSource.TYPE_JSON:
+            YAHOO.util.DataSource.TYPE_HTMLTABLE:
+            YAHOO.util.DataSource.TYPE_XML:
+            */
+            oRawResponse = this.liveData;
+            this.handleResponse(oRequest, oRawResponse, oCallback, oCaller, tId);
+            break;
+    }
+    return tId;
+};
+
+/**
+ * Handles raw data response from live data source. Sends a parsed response object
+ * to the callback function in this format:
+ *
+ * fnCallback(oRequest, oParsedResponse)
+ *
+ * where the oParsedResponse object literal with the following properties:
+ * <ul>
+ *     <li>tId {Number} Unique transaction ID</li>
+ *     <li>results {Array} Array of parsed data results</li>
+ *     <li>error {Boolean} True if there was an error</li>
+ * </ul>
+ *
+ * @method handleResponse
+ * @param oRequest {Object} Request object
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @param oCallback {Function} Handler function to receive the response.
+ * @param oCaller {Object} The calling object that is making the request.
+ * @param tId {Number} Transaction ID.
+ */
+YAHOO.util.DataSource.prototype.handleResponse = function(oRequest, oRawResponse, oCallback, oCaller, tId) {
+    this.fireEvent("responseEvent", {request:oRequest, response:oRawResponse,
+            callback:oCallback, caller:oCaller, tId: tId});
+    var xhr = (this.dataType == YAHOO.util.DataSource.TYPE_XHR) ? true : false;
+    var oParsedResponse = null;
+    var bError = false;
+
+    // Access to the raw response before it gets parsed
+    oRawResponse = this.doBeforeParseData(oRequest, oRawResponse);
+
+    switch(this.responseType) {
+        case YAHOO.util.DataSource.TYPE_JSARRAY:
+            if(xhr && oRawResponse.responseText) {
+                oRawResponse = oRawResponse.responseText;
+            }
+            oParsedResponse = this.parseArrayData(oRequest, oRawResponse);
+            break;
+        case YAHOO.util.DataSource.TYPE_JSON:
+            if(xhr && oRawResponse.responseText) {
+                oRawResponse = oRawResponse.responseText;
+            }
+            oParsedResponse = this.parseJSONData(oRequest, oRawResponse);
+            break;
+        case YAHOO.util.DataSource.TYPE_HTMLTABLE:
+            if(xhr && oRawResponse.responseText) {
+                oRawResponse = oRawResponse.responseText;
+            }
+            oParsedResponse = this.parseHTMLTableData(oRequest, oRawResponse);
+            break;
+        case YAHOO.util.DataSource.TYPE_XML:
+            if(xhr && oRawResponse.responseXML) {
+                oRawResponse = oRawResponse.responseXML;
+            }
+            oParsedResponse = this.parseXMLData(oRequest, oRawResponse);
+            break;
+        case YAHOO.util.DataSource.TYPE_TEXT:
+            if(xhr && oRawResponse.responseText) {
+                oRawResponse = oRawResponse.responseText;
+            }
+            oParsedResponse = this.parseTextData(oRequest, oRawResponse);
+            break;
+        default:
+            //var contentType = oRawResponse.getResponseHeader["Content-Type"];
+            break;
+    }
+
+
+    if(oParsedResponse) {
+        // Last chance to touch the raw response or the parsed response
+        oParsedResponse.tId = tId;
+        oParsedResponse = this.doBeforeCallback(oRequest, oRawResponse, oParsedResponse);
+        this.fireEvent("responseParseEvent", {request:oRequest,
+                response:oParsedResponse, callback:oCallback, caller:oCaller});
+        // Cache the response
+        this.addToCache(oRequest, oParsedResponse);
+    }
+    else {
+        this.fireEvent("dataErrorEvent", {request:oRequest, callback:oCallback,
+                caller:oCaller, message:YAHOO.util.DataSource.ERROR_DATANULL});
+        
+        // Send response back to the caller with the error flag on
+        oParsedResponse = {error:true};
+    }
+    
+    // Send the response back to the caller
+    oCallback.call(oCaller, oRequest, oParsedResponse);
+};
+
+/**
+ * Overridable method gives implementers access to the original raw response
+ * before the data gets parsed. Implementers should take care not to return an
+ * unparsable or otherwise invalid raw response.
+ *
+ * @method doBeforeParseData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Raw response for parsing.
+ */
+YAHOO.util.DataSource.prototype.doBeforeParseData = function(oRequest, oRawResponse) {
+    return oRawResponse;
+};
+
+/**
+ * Overridable method gives implementers access to the original raw response and
+ * the parsed response (parsed against the given schema) before the data
+ * is added to the cache (if applicable) and then sent back to callback function.
+ * This is your chance to access the raw response and/or populate the parsed
+ * response with any custom data.
+ *
+ * @method doBeforeCallback
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @param oParsedResponse {Object} The parsed response to return to calling object.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.doBeforeCallback = function(oRequest, oRawResponse, oParsedResponse) {
+    return oParsedResponse;
+};
+
+/**
+ * Overridable method parses raw array data into a response object.
+ *
+ * @method parseArrayData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.parseArrayData = function(oRequest, oRawResponse) {
+    if(YAHOO.lang.isArray(oRawResponse) && YAHOO.lang.isArray(this.responseSchema.fields)) {
+        var oParsedResponse = {results:[]};
+        var fields = this.responseSchema.fields;
+        for(var i=oRawResponse.length-1; i>-1; i--) {
+            var oResult = {};
+            for(var j=fields.length-1; j>-1; j--) {
+                var field = fields[j];
+                var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                var data = (YAHOO.lang.isValue(oRawResponse[i][j])) ? oRawResponse[i][j] : oRawResponse[i][key];
+                // Backward compatibility
+                if(!field.parser && field.converter) {
+                    field.parser = field.converter;
+                }
+                if(field.parser) {
+                    data = field.parser.call(this, data);
+                }
+                // Safety measure
+                if(data === undefined) {
+                    data = null;
+                }
+                oResult[key] = data;
+            }
+            oParsedResponse.results.unshift(oResult);
+        }
+        return oParsedResponse;
+    }
+    else {
+        return null;
+    }
+};
+
+/**
+ * Overridable method parses raw plain text data into a response object.
+ *
+ * @method parseTextData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.parseTextData = function(oRequest, oRawResponse) {
+    var oParsedResponse = {};
+    if(YAHOO.lang.isString(oRawResponse) &&
+            YAHOO.lang.isArray(this.responseSchema.fields) &&
+            YAHOO.lang.isString(this.responseSchema.recordDelim) &&
+            YAHOO.lang.isString(this.responseSchema.fieldDelim)) {
+        oParsedResponse.results = [];
+        var recDelim = this.responseSchema.recordDelim;
+        var fieldDelim = this.responseSchema.fieldDelim;
+        var fields = this.responseSchema.fields;
+        if(oRawResponse.length > 0) {
+            // Delete the last line delimiter at the end of the data if it exists
+            var newLength = oRawResponse.length-recDelim.length;
+            if(oRawResponse.substr(newLength) == recDelim) {
+                oRawResponse = oRawResponse.substr(0, newLength);
+            }
+            // Split along record delimiter to get an array of strings
+            var recordsarray = oRawResponse.split(recDelim);
+            // Cycle through each record, except the first which contains header info
+            for(var i = recordsarray.length-1; i>-1; i--) {
+                var oResult = {};
+                for(var j=fields.length-1; j>-1; j--) {
+                    // Split along field delimter to get each data value
+                    var fielddataarray = recordsarray[i].split(fieldDelim);
+
+                    // Remove quotation marks from edges, if applicable
+                    var data = fielddataarray[j];
+                    if(data.charAt(0) == "\"") {
+                        data = data.substr(1);
+                    }
+                    if(data.charAt(data.length-1) == "\"") {
+                        data = data.substr(0,data.length-1);
+                    }
+                    var field = fields[j];
+                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                    // Backward compatibility
+                    if(!field.parser && field.converter) {
+                        field.parser = field.converter;
+                    }
+                    if(field.parser) {
+                        data = field.parser.call(this, data);
+                    }
+                    // Safety measure
+                    if(data === undefined) {
+                        data = null;
+                    }
+                    oResult[key] = data;
+                }
+                oParsedResponse.results.unshift(oResult);
+            }
+        }
+    }
+    else {
+        oParsedResponse.error = true;
+    }
+    return oParsedResponse;
+};
+
+/**
+ * Overridable method parses raw XML data into a response object.
+ *
+ * @method parseXMLData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.parseXMLData = function(oRequest, oRawResponse) {
+        var bError = false;
+        var oParsedResponse = {};
+        var xmlList = (this.responseSchema.resultNode) ?
+                oRawResponse.getElementsByTagName(this.responseSchema.resultNode) :
+                null;
+        if(!xmlList || !YAHOO.lang.isArray(this.responseSchema.fields)) {
+            bError = true;
+        }
+        // Loop through each result
+        else {
+            oParsedResponse.results = [];
+            for(var k = xmlList.length-1; k >= 0 ; k--) {
+                var result = xmlList.item(k);
+                var oResult = {};
+                // Loop through each data field in each result using the schema
+                for(var m = this.responseSchema.fields.length-1; m >= 0 ; m--) {
+                    var field = this.responseSchema.fields[m];
+                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                    var data = null;
+                    // Values may be held in an attribute...
+                    var xmlAttr = result.attributes.getNamedItem(key);
+                    if(xmlAttr) {
+                        data = xmlAttr.value;
+                    }
+                    // ...or in a node
+                    else {
+                        var xmlNode = result.getElementsByTagName(key);
+                        if(xmlNode && xmlNode.item(0) && xmlNode.item(0).firstChild) {
+                            data = xmlNode.item(0).firstChild.nodeValue;
+                        }
+                        else {
+                               data = "";
+                        }
+                    }
+                    // Backward compatibility
+                    if(!field.parser && field.converter) {
+                        field.parser = field.converter;
+                    }
+                    if(field.parser) {
+                        data = field.parser.call(this, data);
+                    }
+                    // Safety measure
+                    if(data === undefined) {
+                        data = null;
+                    }
+                    oResult[key] = data;
+                }
+                // Capture each array of values into an array of results
+                oParsedResponse.results.unshift(oResult);
+            }
+        }
+        if(bError) {
+            oParsedResponse.error = true;
+        }
+        else {
+        }
+        return oParsedResponse;
+};
+
+/**
+ * Overridable method parses raw JSON data into a response object.
+ *
+ * @method parseJSONData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.parseJSONData = function(oRequest, oRawResponse) {
+    var oParsedResponse = {};
+    if(oRawResponse && YAHOO.lang.isArray(this.responseSchema.fields)) {
+        var fields = this.responseSchema.fields;
+        var bError = false;
+        oParsedResponse.results = [];
+        var jsonObj,jsonList;
+
+        // Parse JSON object out if it's a string
+        if(YAHOO.lang.isString(oRawResponse)) {
+            // Check for latest JSON lib but divert KHTML clients
+            var isNotMac = (navigator.userAgent.toLowerCase().indexOf('khtml')== -1);
+            if(oRawResponse.parseJSON && isNotMac) {
+                // Use the new JSON utility if available
+                jsonObj = oRawResponse.parseJSON();
+                if(!jsonObj) {
+                    bError = true;
+                }
+            }
+            // Check for older JSON lib but divert KHTML clients
+            else if(window.JSON && JSON.parse && isNotMac) {
+                // Use the JSON utility if available
+                jsonObj = JSON.parse(oRawResponse);
+                if(!jsonObj) {
+                    bError = true;
+                }
+            }
+            // No JSON lib found so parse the string
+            else {
+                try {
+                    // Trim leading spaces
+                    while (oRawResponse.length > 0 &&
+                            (oRawResponse.charAt(0) != "{") &&
+                            (oRawResponse.charAt(0) != "[")) {
+                        oRawResponse = oRawResponse.substring(1, oRawResponse.length);
+                    }
+
+                    if(oRawResponse.length > 0) {
+                        // Strip extraneous stuff at the end
+                        var objEnd = Math.max(oRawResponse.lastIndexOf("]"),oRawResponse.lastIndexOf("}"));
+                        oRawResponse = oRawResponse.substring(0,objEnd+1);
+
+                        // Turn the string into an object literal...
+                        // ...eval is necessary here
+                        jsonObj = eval("(" + oRawResponse + ")");
+                        if(!jsonObj) {
+                            bError = true;
+                        }
+
+                    }
+                    else {
+                        jsonObj = null;
+                        bError = true;
+                    }
+                }
+                catch(e) {
+                    bError = true;
+               }
+            }
+        }
+        // Response must already be a JSON object
+        else if(oRawResponse.constructor == Object) {
+            jsonObj = oRawResponse;
+        }
+        // Not a string or an object
+        else {
+            bError = true;
+        }
+        // Now that we have a JSON object, parse a jsonList out of it
+        if(jsonObj && jsonObj.constructor == Object) {
+            try {
+                // eval is necessary here since schema can be of unknown depth
+                jsonList = eval("jsonObj." + this.responseSchema.resultsList);
+            }
+            catch(e) {
+                bError = true;
+            }
+        }
+
+        if(bError || !jsonList) {
+            oParsedResponse.error = true;
+        }
+        if(jsonList && !YAHOO.lang.isArray(jsonList)) {
+            jsonList = [jsonList];
+        }
+        else if(!jsonList) {
+            jsonList = [];
+        }
+
+        // Loop through the array of all responses...
+        for(var i = jsonList.length-1; i >= 0 ; i--) {
+            var oResult = {};
+            var jsonResult = jsonList[i];
+            // ...and loop through each data field value of each response
+            for(var j = fields.length-1; j >= 0 ; j--) {
+                var field = fields[j];
+                var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                // ...and capture data into an array mapped according to the schema...
+                // eval is necessary here since schema can be of unknown depth
+                var data = eval("jsonResult." + key);
+                
+                // Backward compatibility
+                if(!field.parser && field.converter) {
+                    field.parser = field.converter;
+                }
+                if(field.parser) {
+                    data = field.parser.call(this, data);
+                }
+                // Safety measure
+                if(data === undefined) {
+                    data = null;
+                }
+                oResult[key] = data;
+            }
+            // Capture the array of data field values in an array of results
+            oParsedResponse.results.unshift(oResult);
+        }
+    }
+    else {
+        oParsedResponse.error = true;
+    }
+    return oParsedResponse;
+};
+
+/**
+ * Overridable method parses raw HTML TABLE element data into a response object.
+ *
+ * @method parseHTMLTableData
+ * @param oRequest {Object} Request object.
+ * @param oRawResponse {Object} The raw response from the live database.
+ * @return {Object} Parsed response object.
+ */
+YAHOO.util.DataSource.prototype.parseHTMLTableData = function(oRequest, oRawResponse) {
+        var bError = false;
+        var elTable = oRawResponse;
+        var fields = this.responseSchema.fields;
+        var oParsedResponse = {};
+        oParsedResponse.results = [];
+
+        // Iterate through each TBODY
+        for(var i=0; i<elTable.tBodies.length; i++) {
+            var elTbody = elTable.tBodies[i];
+
+            // Iterate through each TR
+            for(var j=elTbody.rows.length-1; j>-1; j--) {
+                var elRow = elTbody.rows[j];
+                var oResult = {};
+                
+                for(var k=fields.length-1; k>-1; k--) {
+                    var field = fields[k];
+                    var key = (YAHOO.lang.isValue(field.key)) ? field.key : field;
+                    var data = elRow.cells[k].innerHTML;
+
+                    // Backward compatibility
+                    if(!field.parser && field.converter) {
+                        field.parser = field.converter;
+                    }
+                    if(field.parser) {
+                        data = field.parser.call(this, data);
+                    }
+                    // Safety measure
+                    if(data === undefined) {
+                        data = null;
+                    }
+                    oResult[key] = data;
+                }
+                oParsedResponse.results.unshift(oResult);
+            }
+        }
+
+        if(bError) {
+            oParsedResponse.error = true;
+        }
+        else {
+        }
+        return oParsedResponse;
+};
+
+YAHOO.register("datasource", YAHOO.util.DataSource, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/datatable/README b/lib/yui/datatable/README
new file mode 100755 (executable)
index 0000000..ed31cca
--- /dev/null
@@ -0,0 +1,211 @@
+DataTable Release Notes
+
+*** version 2.3.0 ***
+
+* DataSource requests over XHR no longer automatically insert a "?" in the URIs
+between the host and the query. Implementers should explicitly include the
+question mark if it is required by your server. Please refer to the XHR
+examples for implementation details.
+
+* Applied new skinning model.
+
+* The MVC model has been stabilized and many APIs have been renamed or changed
+quite a bit from the previous version. Implementers should now only use
+DataTable APIs and not use any Record or RecordSet APIs to add/delete/update
+rows, Records, and DOM elements. RecordSet synchronization will be managed for
+you under the hood. For example, myDataTable.addRow() now accepts an object
+literal of data and will create a Record and update the DOM. Calling
+myDataTable.deleteRow() will delete the appropriate Record and update the DOM.
+Please refer to the API reference for full details on property and method names and
+argument signatures. When possible, Logger messages will provide deprecation warnings,
+so implementers upgrading from the previous version are encouraged to use the debug
+build of DataTable.
+
+* The DataTable constructor signature has changed in 2 major ways:
+1) Do not pass in a ColumnSet instance. Instead, pass in an array of Column
+definitions directly, and a ColumnSet instance will be created for you under the hood.
+2) In the progressive enhancement case, first instantiate a DataSource pointing
+to your HTML TABLE element, and then pass in that DataSource instance to your
+DataTable constructor. Please refer to the progressive enhancement example
+for implementation details.
+
+* DataTable now extends Element, which has become a required dependency. Implementers
+should now use the myDataTable.set("propertyName", newValue) syntax instead of direct
+dot notation of any properties.
+
+* The underlying pagination architecture and API have been revised. Specifically,
+the property paginator has been deprecated in favor of paginated,
+paginatorOptions has been deprecated in favor of paginator, and related events
+and method names have been changed. Please see the pagination examples for
+implementation details. Please refer to the API reference for full details on
+new property and method names and argument signatures.
+
+* There is a known pagination bug where changing the rows-per-page dropdown while
+on a page number that is out of bounds of the new range, the current page value
+fails to get reset to an appropriate default value.
+
+* There is a known pagination bug where custom containers are ignored.
+
+* There is a known bug where row and cell selections are not tracked correctly in
+paginated DataTables.
+
+* The underlying editing architecture and API have been revised. Specifically, the
+ColumnEditor class is no longer used, the method editCell() has been deprecated
+in favor of showCellEditor(), and the Custom Event "cellEditEvent" is now
+"editorSaveEvent". Please see the inline editing example for
+implementation details. Please refer to the API reference for full details on
+property and method names and argument signatures.
+
+* There is a known issue where the built-in date editor throws a JavaScript
+exception when encountering a null or non-Date value. Implementers using the built-in
+date editor should validate for type Date and avoid null values in these data
+fields.
+
+* The underlying sort architecture, including YAHOO.util.Sort, has been modified
+to accept a single sort function rather than separate functions for ascending
+and descending sorts.
+
+* Scrolling a DataTable with an active Cell Editor will cancel the edit to
+to prevent the Cell Editor's position from getting out of sync with its
+associated TD element.
+
+* The following static methods are executed in the scope of the DataTable
+instance: DataTable.validateNumber(), DataTable.formatButton(),
+DataTable.formatCheckbox(), DataTable.formatCurrency(), DataTable.formatDate(),
+DataTable.formatDropdown(), DataTable.formatEmail(), DataTable.formatLink(),
+DataTable.formatNumber(), DataTable.formatRadio(), DataTable.formatText(),
+DataTable.formatTextarea(), DataTable.formatTextbox().
+
+* The following DataTable APIs have changed:
+- The following static constants have been removed: CLASS_CURRENCY, CLASS_CURRENTPAGE,
+CLASS_DATE, CLASS_EMAIL, CLASS_FIRSTLINK, CLASS_FIRSTPAGE, CLASS_HEADCONTAINER,
+CLASS_HEADRESIZER, CLASS_HEADTEXT, CLASS_HIGHLIGHT, CLASS_LASTLINK, CLASS_LASTPAGE,
+CLASS_LINK, CLASS_NEXTLINK, CLASS_NEXTPAGE, CLASS_NUMBER, CLASS_PAGELINK,
+CLASS_PAGELINKS, CLASS_PAGESELECT, CLASS_PREVLINK, CLASS_PREVPAGE, CLASS_SORTEDBYASC,
+CLASS_SORTEDBYDESC, CLASS_STRING.
+- The following static constants have been added: CLASS_ASC, CLASS_BUTTON,
+CLASS_DEFAULT, CLASS_DESC, CLASS_DISABLED, CLASS_DROPDOWN, CLASS_HEADER,
+CLASS_HIGHLIGHTED, CLASS_LABEL, CLASS_NEXT, CLASS_PAGE, CLASS_PREVIOUS,
+CLASS_RESIZER
+- The property contextMenu is no longer supported.
+- The property dataSource has been deprecated in favor of the accessor method
+getDataSource().
+- The property fixedWidth is not fully supported.
+- The property sortedBy now defines key instead of colKey.
+- The property rowSingleSelect has been deprecated in favor of selectionMode.
+
+* The following Record APIs have changed:
+- Record data values are no longer accessible with oRecord[key] or oRecord.key.
+Implementers should now use oRecord.getData(key).
+- The property yuiRecordId has been deprecated in favor of the accessor method
+getId().
+
+* The following RecordSet APIs have changed:
+- The method getRecordBy() is not implemented.
+- The method insert() has been deprecated in favor of addRecord() and addRecords().
+- The method replace() has been renamed replaceRecords().
+- The method sort() has been deprecated in favor of sortRecords().
+
+* The following Column APIs have changed:
+- Column type has been deprecated in favor of formatter. In your Column
+definitions, please change type:"date" to formatter:"date", type:"currency" to
+formatter:"currency", etc.
+- The property parser is no longer used. Implementers should use the static
+DataSource methods DataSource.parseDate(), DataSource.parseNumber(), and
+DataSource.parseString() for type conversion functionality.
+- The methods getColSpan() and getRowSpan() have been renamed to getColspan()
+and getRowspan().
+- The return value for the method getId() has been changed.
+- The following methods are no longer implemented: parse(), parseCheckbox(),
+parseDate(), parseNumber(), parseSelect(). Implementers should now use a
+DataSource with a data type of HTML TABLE element.
+- The showEditor() method is no longer implemented. Implementers should now use
+the DataTable method showCellEditor().
+- All static formatter functions have been moved from the Column class to the
+DataTable class.
+
+* The DataTable method getColumn() has a known issue where instead of accepting
+a Column's key index value, the method accepts a Column's ID value. Until this
+issue is fixed, implementers can use the following workaround:
+
+    // Instead of this:
+    // var oColumn = myDataTable.getColumn(0);
+
+    // Use this:
+    var oColumn = myDataTable.getColumn(myDataTable.getFirstTrEl().cells[0].yuiColumnId);
+
+
+
+
+
+
+
+
+
+
+*** version 2.2.2 ***
+
+* Removed workaround for a fixed Dom.getXY() bug that was causing a positioning
+problem for inline editors on scrolled pages.
+
+
+
+**** version 2.2.1 ***
+
+* Changed default pagination from enabled to disabled. Must set property
+paginator to true to enable built-in client-side pagination.
+* Removed deleteSelectedRows() and added deleteRows().
+* Deprecated properties isEmpty and isLoading, and methods showLoadingMessage(),
+showEmptyMessage(), and hideTableMessages(). Implementers should now use
+showTableMessage() and hideTableMessage().
+* Deprecated methods paginateRows() and onDataReturnPaginateRows(). Implementers
+should now use popualateTable() and onDataReturnPopulateTable().
+* Deprecated pagination properties pageCurrent, rowsPerPage, startRecordIndex,
+pageLinksLength, rowsPerPageDropdown, pageLinksStart, and pagers.
+* Fixed unclickable links.
+* Fix to support data values of 0 (zero).
+* Fixed broken validation in multiple places when the value 0 (zero) is passed
+in as an argument.
+* Fixed incorrect month output in formatDate().
+* Fixed broken empty message when there are zero rows.
+* Allow implementers to use data with field name "id".
+* Fixed Column resizeability in -min builds.
+* Fixed Column sorting of null, undefined, and empty values.
+* Fixed Column sorting of nested headers.
+* Fixed paginator dropdowns to stay in sync when paginating.
+* Fixed rowSingleSelect for paginated DataTable.
+* Fix for currency values with more than 2 decimal places.
+* Fixed broken TR ID assignments in replaceRows().
+* Fixed Opera UI artifacting problem when repaginating via dropdowns.
+* Fixed orphaned ColumnEditor during pagination or other de facto blur
+interaction. Data gets saved.
+* Extracted non-foundational CSS for scrollable DataTables to make UI easier to
+customize.
+* Updated methods select() and unselect() to also accept an array of elements or
+an array of strings.
+* Improved row selection behavior to model the desktop paradigm (i.e., require
+CONTROL and/or SHIFT keys to multi-select).
+* Tweaked inline editing for better Mac performance.
+* Refactored pagination code to be easier to implement, configure, and extend.
+* Accept an error boolean from DataSource in case of data error and show error
+message.
+* The CustomEvent rowDeleteEvent is now only fired once per deleted row and
+its argument signature has been modified.
+* Added selectRow(), rowSelectEvent, unselectRow(), rowUnselectEvent, rowAddEvent,
+and rowUpdateEvent.
+* Added constants CLASS_TABLE, CLASS_EDITOR, CLASS_FIRST, and CLASS_LAST.
+* Added ColumnEditor class moveContainerTo().
+* Add IDs and class hooks to TABLE element and ColumnEditor's container DIV.
+* Add class hooks to first and last TR elements.
+* Added hook to doBeforeLoadData() for the not-from-markup constructor flow.
+* Added properties paginator and paginatorOptions, as well as method getPaginator().
+* Added methods saveEditorData() and cancelEditorData().
+* Improved type checking with YAHOO.lang.
+
+
+
+**** version 2.2.0 ***
+
+* Beta release.
+* Caption is not supported when scrolling is enabled.
+* Resizeability is not supported for fixed-width DataTables.
diff --git a/lib/yui/datatable/assets/datatable-core.css b/lib/yui/datatable/assets/datatable-core.css
new file mode 100755 (executable)
index 0000000..aab6e40
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/*foundational css*/\r
+.yui-dt-table th, .yui-dt-table td {\r
+    overflow:hidden;\r
+}\r
+\r
+th .yui-dt-header {\r
+    position:relative;\r
+}\r
+\r
+th .yui-dt-label {\r
+    position:relative;\r
+}\r
+\r
+th .yui-dt-resizer {\r
+    position:absolute;\r
+    margin-right:-6px;\r
+    right:0;\r
+    bottom:0;\r
+    width:6px;\r
+    height:100%;\r
+    cursor:w-resize;\r
+    cursor:col-resize;\r
+}\r
+\r
+/* foundational scrolling css */\r
+.yui-dt-scrollable  {\r
+    *overflow-y:auto; /* for ie */\r
+}\r
+.yui-dt-scrollable  thead {\r
+    display:block; /* for safari and opera */\r
+}\r
+.yui-dt-scrollable thead tr {\r
+    position:relative;  /* for ie */\r
+}\r
+.yui-dt-scrollbody {\r
+    display:block; /* for safari and opera */\r
+    overflow:auto; /* for gecko */\r
+}\r
+\r
+.yui-dt-editor {\r
+    position:absolute;z-index:9000;\r
+}\r
diff --git a/lib/yui/datatable/assets/datatable.css b/lib/yui/datatable/assets/datatable.css
new file mode 100755 (executable)
index 0000000..4130405
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/*foundational css*/\r
+.yui-dt-table th, .yui-dt-table td {\r
+    overflow:hidden;\r
+}\r
+\r
+th .yui-dt-header {\r
+    position:relative;\r
+}\r
+\r
+th .yui-dt-label {\r
+    position:relative;\r
+    border-right:10px;\r
+}\r
+\r
+th .yui-dt-resizer {\r
+    position:absolute;\r
+    margin-right:-6px;\r
+    right:0;\r
+    bottom:0;\r
+    width:6px;\r
+    height:100%;\r
+    cursor:w-resize;\r
+    cursor:col-resize;\r
+}\r
+\r
+/* foundational scrolling css */\r
+.yui-dt-scrollable  {\r
+    *overflow-y:auto; /* for ie */\r
+}\r
+.yui-dt-scrollable  thead {\r
+    display:block; /* for safari and opera */\r
+}\r
+.yui-dt-scrollable thead tr {\r
+    position:relative;  /* for ie */\r
+}\r
+.yui-dt-scrollbody {\r
+    display:block; /* for safari and opera */\r
+    overflow:auto; /* for gecko */\r
+}\r
+\r
+.yui-dt-editor {\r
+    position:absolute;\r
+}\r
diff --git a/lib/yui/datatable/assets/skins/sam/datatable-skin.css b/lib/yui/datatable/assets/skins/sam/datatable-skin.css
new file mode 100755 (executable)
index 0000000..bcdd378
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* basic skin styles */\r
+.yui-skin-sam .yui-dt-table {margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border:1px solid #7F7F7F;}\r
+.yui-skin-sam .yui-dt-table caption {padding-bottom:1em;text-align:left;}\r
+.yui-skin-sam .yui-dt-table th {\r
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; /* header gradient */\r
+}\r
+.yui-skin-sam .yui-dt-table th,\r
+.yui-skin-sam .yui-dt-table th a {\r
+    font-weight:normal;text-decoration:none;color:#000; /* header text */\r
+    vertical-align:bottom;\r
+}\r
+.yui-skin-sam .yui-dt-table th,\r
+.yui-skin-sam .yui-dt-table td {\r
+    padding:4px 10px 4px 10px; /* cell padding */\r
+    border-right:1px solid #CBCBCB; /* inner column border */\r
+}\r
+.yui-skin-sam .yui-dt-table td {\r
+    white-space:nowrap;\r
+    text-align:left;\r
+}\r
+.yui-skin-sam .yui-dt-table th.yui-dt-last,\r
+.yui-skin-sam .yui-dt-table td.yui-dt-last {\r
+    border-right:1px solid #7F7F7F; /* outer border */\r
+}\r
+.yui-skin-sam .yui-dt-list td {\r
+    border-right:none; /* disable inner column border in list mode */\r
+}\r
+.yui-skin-sam .yui-dt-table thead {\r
+    border:1px solid #989898; /* outer border */\r
+}\r
+.yui-skin-sam .yui-dt-table tbody {\r
+    border-left:1px solid #7F7F7F;border-right:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F; /* outer border */\r
+}\r
+\r
+/* messaging */\r
+.yui-skin-sam .yui-dt-loading {\r
+    background-color:#FFF;\r
+}\r
+\r
+.yui-skin-sam .yui-dt-loading {\r
+    background-color:#FFF;\r
+}\r
+\r
+/* sortable columns */\r
+.yui-skin-sam .yui-dt-sortable {\r
+    cursor:pointer;\r
+}\r
+.yui-skin-sam th.yui-dt-sortable {\r
+    padding-right:5px; /* room for arrow */\r
+}\r
+.yui-skin-sam th.yui-dt-sortable .yui-dt-label {\r
+    margin-right:15px; /* room for arrow */\r
+}\r
+.yui-skin-sam th.yui-dt-asc,\r
+.yui-skin-sam th.yui-dt-desc {\r
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -100px; /* sorted header gradient */\r
+}\r
+.yui-skin-sam th.yui-dt-asc .yui-dt-header {\r
+    background:url(dt-arrow-up.png) no-repeat right; /* sorted header gradient */\r
+    /*background-image: url('../img/arrow_up.gif'); background-repeat:no-repeat; background-position:right; sorted header icon */\r
+}\r
+.yui-skin-sam th.yui-dt-desc .yui-dt-header {\r
+    background:url(dt-arrow-dn.png) no-repeat right; /* sorted header gradient */\r
+    /*background-image: url('../img/arrow_dn.gif'); background-repeat:no-repeat; background-position:right; /*sorted header icon */\r
+} \r
+\r
+/* editing */\r
+.yui-dt-editable {\r
+    cursor:pointer;\r
+}\r
+.yui-dt-editor {\r
+    text-align:left;\r
+    background-color:#F2F2F2;\r
+    border:1px solid #808080;\r
+    padding:6px;\r
+}\r
+.yui-dt-editor label {\r
+    padding-left:4px;padding-right:6px;\r
+}\r
+.yui-dt-editor .yui-dt-button {\r
+    padding-top:6px;text-align:right;\r
+}\r
+.yui-dt-editor .yui-dt-button button {\r
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;\r
+    border:1px solid #999;\r
+    width:4em;height:1.8em;\r
+    margin-left:6px;\r
+}\r
+.yui-dt-editor .yui-dt-button button.yui-dt-default {\r
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px;\r
+    background-color: #5584E0;\r
+    border:1px solid #304369;\r
+    color:#FFF\r
+}\r
+.yui-dt-editor .yui-dt-button button:hover {\r
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;\r
+    color:#000;\r
+}\r
+.yui-dt-editor .yui-dt-button button:active {\r
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;\r
+    color:#000;\r
+}\r
+\r
+/* striping */\r
+.yui-skin-sam tr.yui-dt-even { background-color:#FFF; } /* white */\r
+.yui-skin-sam tr.yui-dt-odd { background-color:#EDF5FF; } /* light blue */\r
+.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,\r
+.yui-skin-sam tr.yui-dt-even td.yui-dt-desc { background-color:#EDF5FF; } /* light blue sorted */\r
+.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,\r
+.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc { background-color:#DBEAFF; } /* dark blue sorted */\r
+\r
+/* disable striping in list mode */\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-even { background-color:#FFF; } /* white */\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-odd { background-color:#FFF; } /* white */\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc { background-color:#EDF5FF; } /* light blue sorted */\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc { background-color:#EDF5FF; } /* light blue sorted */\r
+\r
+/* highlighting */\r
+.yui-skin-sam tr.yui-dt-highlighted,\r
+.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,\r
+.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,\r
+.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,\r
+.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted {\r
+    cursor:pointer;\r
+    background-color:#B2D2FF; /* med blue hover */\r
+}\r
+\r
+/* enable highlighting in list mode */\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted {\r
+    cursor:pointer;\r
+    background-color:#B2D2FF; /* med blue  hover */\r
+}\r
+\r
+/* selection */\r
+.yui-skin-sam tr.yui-dt-selected td,\r
+.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,\r
+.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc {\r
+    background-color:#426FD9; /* bright blue selected row */\r
+    color:#FFF;\r
+}\r
+.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,\r
+.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected {\r
+    background-color:#446CD7; /* bright blue selected cell */\r
+    color:#FFF;\r
+}\r
+\r
+/* enable selection in list mode */\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc {\r
+    background-color:#426FD9; /* bright blue selected row */\r
+    color:#FFF;\r
+}\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,\r
+.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected {\r
+    background-color:#446CD7; /* bright blue selected cell */\r
+    color:#FFF;\r
+}\r
+\r
+/* pagination */\r
+.yui-skin-sam .yui-dt-paginator {\r
+    display:block;margin:6px 0;white-space:nowrap;\r
+}\r
+.yui-skin-sam .yui-dt-paginator .yui-dt-first,\r
+.yui-skin-sam .yui-dt-paginator .yui-dt-last,\r
+.yui-skin-sam .yui-dt-paginator .yui-dt-selected {\r
+    padding:2px 6px;\r
+}\r
+.yui-skin-sam .yui-dt-paginator a.yui-dt-first,\r
+.yui-skin-sam .yui-dt-paginator a.yui-dt-last {\r
+    text-decoration:none;\r
+}\r
+.yui-skin-sam .yui-dt-paginator .yui-dt-previous,\r
+.yui-skin-sam .yui-dt-paginator .yui-dt-next {\r
+    display:none;\r
+}\r
+.yui-skin-sam a.yui-dt-page {\r
+    border:1px solid #CBCBCB;\r
+    padding:2px 6px;\r
+    text-decoration:none;\r
+}\r
diff --git a/lib/yui/datatable/assets/skins/sam/datatable.css b/lib/yui/datatable/assets/skins/sam/datatable.css
new file mode 100755 (executable)
index 0000000..b3f56e5
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-dt-table th,.yui-dt-table td{overflow:hidden;}th .yui-dt-header{position:relative;}th .yui-dt-label{position:relative;}th .yui-dt-resizer{position:absolute;margin-right:-6px;right:0;bottom:0;width:6px;height:100%;cursor:w-resize;cursor:col-resize;}.yui-dt-scrollable{*overflow-y:auto;}.yui-dt-scrollable thead{display:block;}.yui-dt-scrollable thead tr{position:relative;}.yui-dt-scrollbody{display:block;overflow:auto;}.yui-dt-editor{position:absolute;z-index:9000;}.yui-skin-sam .yui-dt-table{margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:collapse;border:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-table caption{padding-bottom:1em;text-align:left;}.yui-skin-sam .yui-dt-table th{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table th a{font-weight:normal;text-decoration:none;color:#000;vertical-align:bottom;}.yui-skin-sam .yui-dt-table th,.yui-skin-sam .yui-dt-table td{padding:4px 10px 4px 10px;border-right:1px solid #CBCBCB;}.yui-skin-sam .yui-dt-table td{white-space:nowrap;text-align:left;}.yui-skin-sam .yui-dt-table th.yui-dt-last,.yui-skin-sam .yui-dt-table td.yui-dt-last{border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-list td{border-right:none;}.yui-skin-sam .yui-dt-table thead{border:1px solid #989898;}.yui-skin-sam .yui-dt-table tbody{border-left:1px solid #7F7F7F;border-right:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-loading{background-color:#FFF;}.yui-skin-sam .yui-dt-sortable{cursor:pointer;}.yui-skin-sam th.yui-dt-sortable{padding-right:5px;}.yui-skin-sam th.yui-dt-sortable .yui-dt-label{margin-right:15px;}.yui-skin-sam th.yui-dt-asc,.yui-skin-sam th.yui-dt-desc{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -100px;}.yui-skin-sam th.yui-dt-asc .yui-dt-header{background:url(dt-arrow-up.png) no-repeat right;}.yui-skin-sam th.yui-dt-desc .yui-dt-header{background:url(dt-arrow-dn.png) no-repeat right;}.yui-dt-editable{cursor:pointer;}.yui-dt-editor{text-align:left;background-color:#F2F2F2;border:1px solid #808080;padding:6px;}.yui-dt-editor label{padding-left:4px;padding-right:6px;}.yui-dt-editor .yui-dt-button{padding-top:6px;text-align:right;}.yui-dt-editor .yui-dt-button button{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;border:1px solid #999;width:4em;height:1.8em;margin-left:6px;}.yui-dt-editor .yui-dt-button button.yui-dt-default{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px;background-color:#5584E0;border:1px solid #304369;color:#FFF}.yui-dt-editor .yui-dt-button button:hover{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;color:#000;}.yui-dt-editor .yui-dt-button button:active{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;color:#000;}.yui-skin-sam tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam tr.yui-dt-odd{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc{background-color:#DBEAFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam tr.yui-dt-selected td,.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-paginator{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-dt-paginator .yui-dt-first,.yui-skin-sam .yui-dt-paginator .yui-dt-last,.yui-skin-sam .yui-dt-paginator .yui-dt-selected{padding:2px 6px;}.yui-skin-sam .yui-dt-paginator a.yui-dt-first,.yui-skin-sam .yui-dt-paginator a.yui-dt-last{text-decoration:none;}.yui-skin-sam .yui-dt-paginator .yui-dt-previous,.yui-skin-sam .yui-dt-paginator .yui-dt-next{display:none;}.yui-skin-sam a.yui-dt-page{border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;}
diff --git a/lib/yui/datatable/assets/skins/sam/dt-arrow-dn.png b/lib/yui/datatable/assets/skins/sam/dt-arrow-dn.png
new file mode 100755 (executable)
index 0000000..2178f11
Binary files /dev/null and b/lib/yui/datatable/assets/skins/sam/dt-arrow-dn.png differ
diff --git a/lib/yui/datatable/assets/skins/sam/dt-arrow-up.png b/lib/yui/datatable/assets/skins/sam/dt-arrow-up.png
new file mode 100755 (executable)
index 0000000..5a543a5
Binary files /dev/null and b/lib/yui/datatable/assets/skins/sam/dt-arrow-up.png differ
diff --git a/lib/yui/datatable/datatable-beta-debug.js b/lib/yui/datatable/datatable-beta-debug.js
new file mode 100755 (executable)
index 0000000..ba6106a
--- /dev/null
@@ -0,0 +1,9117 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * The DataTable widget provides a progressively enhanced DHTML control for
+ * displaying tabular data across A-grade browsers.
+ *
+ * @module datatable
+ * @requires yahoo, dom, event, datasource
+ * @optional dragdrop
+ * @title DataTable Widget
+ * @beta
+ */
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * DataTable class for the YUI DataTable widget.
+ *
+ * @namespace YAHOO.widget
+ * @class DataTable
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param elContainer {HTMLElement} Container element for the TABLE.
+ * @param aColumnDefs {Object[]} Array of object literal Column definitions.
+ * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param oConfigs {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.DataTable = function(elContainer,aColumnDefs,oDataSource,oConfigs) {
+    // Internal vars
+    this._nIndex = YAHOO.widget.DataTable._nCount;
+    this._sName = "instance" + this._nIndex;
+    this.id = "yui-dt"+this._nIndex;
+
+    // Initialize container element
+    this._initContainerEl(elContainer);
+    if(!this._elContainer) {
+        YAHOO.log("Could not instantiate DataTable due to an invalid container element", "error", this.toString());
+        return;
+    }
+
+    // Initialize configs
+    this._initConfigs(oConfigs);
+
+    // Initialize ColumnSet
+    this._initColumnSet(aColumnDefs);
+    if(!this._oColumnSet) {
+        YAHOO.log("Could not instantiate DataTable due to an invalid ColumnSet", "error", this.toString());
+        return;
+    }
+    
+    // Initialize RecordSet
+    this._initRecordSet();
+    if(!this._oRecordSet) {
+        YAHOO.log("Could not instantiate DataTable due to an invalid RecordSet", "error", this.toString());
+        return;
+    }
+
+    // Initialize DataSource
+    this._initDataSource(oDataSource);
+    if(!this._oDataSource) {
+        YAHOO.log("Could not instantiate DataTable due to an invalid DataSource", "error", this.toString());
+        return;
+    }
+
+    // Progressive enhancement special case
+    if(this._oDataSource.dataType == YAHOO.util.DataSource.TYPE_HTMLTABLE) {
+        this._oDataSource.sendRequest(this.get("initialRequest"), this._onDataReturnEnhanceTable, this);
+    }
+    else {
+        // Initialize DOM elements
+        this._initTableEl();
+        if(!this._elTable || !this._elThead || !this._elTbody) {
+            YAHOO.log("Could not instantiate DataTable due to an invalid DOM elements", "error", this.toString());
+            return;
+        }
+
+        // Call Element's constructor after DOM elements are created
+        // but *before* table is populated with data
+        YAHOO.widget.DataTable.superclass.constructor.call(this, this._elContainer, this._oConfigs);
+        
+        //HACK: Set the Paginator values here via updatePaginator
+        if(this._oConfigs && this._oConfigs.paginator) {
+            this.updatePaginator(this._oConfigs.paginator);
+        }
+
+        // Send out for data in an asynchronous request
+        this._oDataSource.sendRequest(this.get("initialRequest"), this.onDataReturnInitializeTable, this);
+    }
+
+    // Initialize inline Cell editing
+    this._initCellEditorEl();
+
+    // Initialize Column sort
+    this._initColumnSort();
+
+    // Initialize DOM event listeners
+    this._initDomEvents();
+
+    YAHOO.widget.DataTable._nCount++;
+    YAHOO.log("DataTable initialized", "info", this.toString());
+};
+
+if(YAHOO.util.Element) {
+    YAHOO.lang.extend(YAHOO.widget.DataTable, YAHOO.util.Element);
+}
+else {
+    YAHOO.log("Missing dependency: YAHOO.util.Element","error",this.toString());
+}
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Superclass methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Implementation of Element's abstract method. Sets up config values.
+ *
+ * @method initAttributes
+ * @param oConfigs {Object} (Optional) Object literal definition of configuration values.
+ * @private
+ */
+
+YAHOO.widget.DataTable.prototype.initAttributes = function(oConfigs) {
+    oConfigs = oConfigs || {};
+    YAHOO.widget.DataTable.superclass.initAttributes.call(this, oConfigs);
+
+    /**
+    * @config summary
+    * @description Value for the SUMMARY attribute.
+    * @type String
+    */
+    this.setAttributeConfig("summary", {
+        value: null,
+        validator: YAHOO.lang.isString,
+        method: function(sSummary) {
+            this._elTable.summary = sSummary;
+        }
+    });
+
+    /**
+    * @config selectionMode
+    * @description Specifies row or cell selection mode. Accepts the following strings:
+    *    <dl>
+    *      <dt>"standard"</dt>
+    *      <dd>Standard row selection with support for modifier keys to enable
+    *      multiple selections.</dd>
+    *
+    *      <dt>"single"</dt>
+    *      <dd>Row selection with modifier keys disabled to not allow
+    *      multiple selections.</dd>
+    *
+    *      <dt>"singlecell"</dt>
+    *      <dd>Cell selection with modifier keys disabled to not allow
+    *      multiple selections.</dd>
+    *
+    *      <dt>"cellblock"</dt>
+    *      <dd>Cell selection with support for modifier keys to enable multiple
+    *      selections in a block-fashion, like a spreadsheet.</dd>
+    *
+    *      <dt>"cellrange"</dt>
+    *      <dd>Cell selection with support for modifier keys to enable multiple
+    *      selections in a range-fashion, like a calendar.</dd>
+    *    </dl>
+    *
+    * @default "standard"
+    * @type String
+    */
+    this.setAttributeConfig("selectionMode", {
+        value: "standard",
+        validator: YAHOO.lang.isString
+    });
+
+    /**
+    * @config initialRequest
+    * @description Defines the initial request that gets sent to the DataSource.
+    * @type String
+    */
+    this.setAttributeConfig("initialRequest", {
+        value: "",
+        validator: YAHOO.lang.isString
+    });
+
+    /**
+    * @config sortedBy
+    * @description Object literal provides metadata for initial sort values if
+    * data will arrive pre-sorted:
+    * <dl>
+    *     <dt>sortedBy.key</dt>
+    *     <dd>Key of sorted Column</dd>
+    *     <dt>sortedBy.dir</dt>
+    *     <dd>Initial sort direction, either "asc" or "desc"</dd>
+    * </dl>
+    * @type Object
+    */
+    this.setAttributeConfig("sortedBy", {
+        value: null,
+        // TODO: accepted array for nested sorts
+        validator: function(oNewSortedBy) {
+            return (oNewSortedBy && (oNewSortedBy.constructor == Object) && oNewSortedBy.key);
+        },
+        method: function(oNewSortedBy) {
+            // Remove ASC/DESC from TH
+            var oOldSortedBy = this.get("sortedBy");
+            if(oOldSortedBy && (oOldSortedBy.constructor == Object) && oOldSortedBy.key) {
+                var oldColumn = this._oColumnSet.getColumn(oOldSortedBy.key);
+                var oldThEl = this.getThEl(oldColumn);
+                YAHOO.util.Dom.removeClass(oldThEl, YAHOO.widget.DataTable.CLASS_ASC);
+                YAHOO.util.Dom.removeClass(oldThEl, YAHOO.widget.DataTable.CLASS_DESC);
+            }
+            
+            // Set ASC/DESC on TH
+            var column = (oNewSortedBy.column) ? oNewSortedBy.column : this._oColumnSet.getColumn(oNewSortedBy.key);
+            if(column) {
+                var newClass = (oNewSortedBy.dir && (oNewSortedBy.dir != "asc")) ?
+                        YAHOO.widget.DataTable.CLASS_DESC :
+                        YAHOO.widget.DataTable.CLASS_ASC;
+                YAHOO.util.Dom.addClass(this.id + "-col" + column.getId(), newClass);
+            }
+        }
+    });
+
+    /**
+    * @config paginator
+    * @description Object literal of pagination values.
+    * @default <br>
+    *   { containers:[], // UI container elements <br>
+    *   rowsPerPage:500, // 500 rows <br>
+    *   currentPage:1,  // page one <br>
+    *   pageLinks:0,    // show all links <br>
+    *   pageLinksStart:1, // first link is page 1 <br>
+    *   dropdownOptions:null, // no dropdown <br>
+    *   links: [], // links elements <br>
+    *   dropdowns: [] } //dropdown elements
+    * 
+    * @type Object
+    */
+    this.setAttributeConfig("paginator", {
+        value: {
+            rowsPerPage:500, // 500 rows per page
+            currentPage:1,  // show page one
+            startRecordIndex:0, // start with first Record
+            totalRecords:0, // how many Records total
+            totalPages:0, // how many pages total
+            rowsThisPage:0, // how many rows this page
+            pageLinks:0,    // show all links
+            pageLinksStart:1, // first link is page 1
+            dropdownOptions: null, //no dropdown
+            containers:[], // Paginator container element references
+            dropdowns: [], //dropdown element references,
+            links: [] // links elements
+        },
+        validator: function(oNewPaginator) {
+            if(oNewPaginator && (oNewPaginator.constructor == Object)) {
+                // Check for incomplete set of values
+                if((oNewPaginator.rowsPerPage !== undefined) &&
+                        (oNewPaginator.currentPage !== undefined) &&
+                        (oNewPaginator.startRecordIndex !== undefined) &&
+                        (oNewPaginator.totalRecords !== undefined) &&
+                        (oNewPaginator.totalPages !== undefined) &&
+                        (oNewPaginator.rowsThisPage !== undefined) &&
+                        (oNewPaginator.pageLinks !== undefined) &&
+                        (oNewPaginator.pageLinksStart !== undefined) &&
+                        (oNewPaginator.dropdownOptions !== undefined) &&
+                        (oNewPaginator.containers !== undefined) &&
+                        (oNewPaginator.dropdowns !== undefined) &&
+                        (oNewPaginator.links !== undefined)) {
+
+                    // Validate each value
+                    if(YAHOO.lang.isNumber(oNewPaginator.rowsPerPage) &&
+                            YAHOO.lang.isNumber(oNewPaginator.currentPage) &&
+                            YAHOO.lang.isNumber(oNewPaginator.startRecordIndex) &&
+                            YAHOO.lang.isNumber(oNewPaginator.totalRecords) &&
+                            YAHOO.lang.isNumber(oNewPaginator.totalPages) &&
+                            YAHOO.lang.isNumber(oNewPaginator.rowsThisPage) &&
+                            YAHOO.lang.isNumber(oNewPaginator.pageLinks) &&
+                            YAHOO.lang.isNumber(oNewPaginator.pageLinksStart) &&
+                            YAHOO.lang.isArray(oNewPaginator.dropdownOptions) &&
+                            YAHOO.lang.isArray(oNewPaginator.containers) &&
+                            YAHOO.lang.isArray(oNewPaginator.dropdowns) &&
+                            YAHOO.lang.isArray(oNewPaginator.links)) {
+                        return true;
+                    }
+                }
+            }
+            return false;
+        }
+    });
+
+    /**
+    * @config paginated
+    * @description True if built-in client-side pagination is enabled
+    * @default false
+    * @type Boolean
+    */
+    this.setAttributeConfig("paginated", {
+        value: false,
+        validator: YAHOO.lang.isBoolean,
+        method: function(oParam) {
+            var oPaginator = this.get("paginator");
+            var aContainerEls = oPaginator.containers;
+            
+            // Paginator is enabled
+            if(oParam) {
+                // No containers found, create two from scratch
+                if(aContainerEls.length === 0) {
+                    // One before TABLE
+                    var pag0 = document.createElement("span");
+                    pag0.id = this.id + "-paginator0";
+                    YAHOO.util.Dom.addClass(pag0, YAHOO.widget.DataTable.CLASS_PAGINATOR);
+                    pag0 = this._elContainer.insertBefore(pag0, this._elTable);
+                    aContainerEls.push(pag0);
+
+                    // One after TABLE
+                    var pag1 = document.createElement("span");
+                    pag1.id = this.id + "-paginator1";
+                    YAHOO.util.Dom.addClass(pag1, YAHOO.widget.DataTable.CLASS_PAGINATOR);
+                    pag1 = this._elContainer.insertBefore(pag1, this._elTable.nextSibling);
+                    aContainerEls.push(pag1);
+
+                    // Add containers directly to tracker
+                    this._configs.paginator.value.containers = [pag0, pag1];
+
+                }
+                else {
+                    // Show each container
+                    for(var i=0; i<aContainerEls.length; i++) {
+                        aContainerEls[i].style.display = "";
+                    }
+                }
+
+                // Links are enabled
+                if(oPaginator.pageLinks > -1) {
+                    var aLinkEls = oPaginator.links;
+                    // No links containers found, create from scratch
+                    if(aLinkEls.length === 0) {
+                        for(i=0; i<aContainerEls.length; i++) {
+                            // Create one links container per Paginator container
+                            var linkEl = document.createElement("span");
+                            linkEl.id = "yui-dt-pagselect"+i;
+                            linkEl = aContainerEls[i].appendChild(linkEl);
+
+                            // Add event listener
+                            //TODO: anon fnc
+                            YAHOO.util.Event.addListener(linkEl,"click",this._onPaginatorLinkClick,this);
+
+                             // Add directly to tracker
+                            this._configs.paginator.value.links.push(linkEl);
+                       }
+                   }
+                }
+
+                // Show these options in the dropdown
+                var dropdownOptions = oPaginator.dropdownOptions || [];
+
+                for(i=0; i<aContainerEls.length; i++) {
+                    // Create one SELECT element per Paginator container
+                    var selectEl = document.createElement("select");
+                    YAHOO.util.Dom.addClass(selectEl, YAHOO.widget.DataTable.CLASS_DROPDOWN);
+                    selectEl = aContainerEls[i].appendChild(selectEl);
+                    selectEl.id = "yui-dt-pagselect"+i;
+
+                    // Add event listener
+                    //TODO: anon fnc
+                    YAHOO.util.Event.addListener(selectEl,"change",this._onPaginatorDropdownChange,this);
+
+                    // Add DOM reference directly to tracker
+                   this._configs.paginator.value.dropdowns.push(selectEl);
+
+                    // Hide dropdown
+                    if(!oPaginator.dropdownOptions) {
+                        selectEl.style.display = "none";
+                    }
+                }
+
+                //TODO: fire paginatorDisabledEvent & add to api doc
+                YAHOO.log("Paginator enabled", "info", this.toString());
+            }
+            // Pagination is disabled
+            else {
+                // Containers found
+                if(aContainerEls.length > 0) {
+                    // Destroy or just hide?
+                    
+                    // Hide each container
+                    for(i=0; i<aContainerEls.length; i++) {
+                        aContainerEls[i].style.display = "none";
+                    }
+
+                    /*TODO?
+                    // Destroy each container
+                    for(i=0; i<aContainerEls.length; i++) {
+                        YAHOO.util.Event.purgeElement(aContainerEls[i], true);
+                        aContainerEls.innerHTML = null;
+                        //TODO: remove container?
+                        // aContainerEls[i].parentNode.removeChild(aContainerEls[i]);
+                    }
+                    */
+                }
+                //TODO: fire paginatorDisabledEvent & add to api doc
+                YAHOO.log("Paginator disabled", "info", this.toString());
+            }
+        }
+    });
+
+    /**
+    * @config caption
+    * @description Value for the CAPTION element.
+    * @type String
+    */
+    this.setAttributeConfig("caption", {
+        value: null,
+        validator: YAHOO.lang.isString,
+        method: function(sCaption) {
+            // Create CAPTION element
+            if(!this._elCaption) {
+                if(!this._elTable.firstChild) {
+                    this._elCaption = this._elTable.appendChild(document.createElement("caption"));
+                }
+                else {
+                    this._elCaption = this._elTable.insertBefore(document.createElement("caption"), this._elTable.firstChild);
+                }
+            }
+            // Set CAPTION value
+            this._elCaption.innerHTML = sCaption;
+        }
+    });
+
+    /**
+    * @config scrollable
+    * @description True if primary TBODY should scroll while THEAD remains fixed.
+    * When enabling this feature, captions cannot be used, and the following
+    * features are not recommended: inline editing, resizeable columns.
+    * @default false
+    * @type Boolean
+    */
+    this.setAttributeConfig("scrollable", {
+        value: false,
+        validator: function(oParam) {
+            //TODO: validate agnst resizeable
+            return (YAHOO.lang.isBoolean(oParam) &&
+                    // Not compatible with caption
+                    !YAHOO.lang.isString(this.get("caption")));
+        },
+        method: function(oParam) {
+            if(oParam) {
+                //TODO: conf height
+                YAHOO.util.Dom.addClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);
+                YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);
+            }
+            else {
+                YAHOO.util.Dom.removeClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);
+                YAHOO.util.Dom.removeClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);
+
+            }
+        }
+    });
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public constants
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Class name assigned to TABLE element.
+ *
+ * @property DataTable.CLASS_TABLE
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-table"
+ */
+YAHOO.widget.DataTable.CLASS_TABLE = "yui-dt-table";
+
+/**
+ * Class name assigned to header container elements within each TH element.
+ *
+ * @property DataTable.CLASS_HEADER
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-header"
+ */
+YAHOO.widget.DataTable.CLASS_HEADER = "yui-dt-header";
+
+/**
+ * Class name assigned to the primary TBODY element.
+ *
+ * @property DataTable.CLASS_BODY
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-body"
+ */
+YAHOO.widget.DataTable.CLASS_BODY = "yui-dt-body";
+
+/**
+ * Class name assigned to the scrolling TBODY element of a fixed scrolling DataTable.
+ *
+ * @property DataTable.CLASS_SCROLLBODY
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-scrollbody"
+ */
+YAHOO.widget.DataTable.CLASS_SCROLLBODY = "yui-dt-scrollbody";
+
+/**
+ * Class name assigned to display label elements.
+ *
+ * @property DataTable.CLASS_LABEL
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-label"
+ */
+YAHOO.widget.DataTable.CLASS_LABEL = "yui-dt-label";
+
+/**
+ * Class name assigned to resizer handle elements.
+ *
+ * @property DataTable.CLASS_RESIZER
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-resizer"
+ */
+YAHOO.widget.DataTable.CLASS_RESIZER = "yui-dt-resizer";
+
+/**
+ * Class name assigned to Editor container elements.
+ *
+ * @property DataTable.CLASS_EDITOR
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-editor"
+ */
+YAHOO.widget.DataTable.CLASS_EDITOR = "yui-dt-editor";
+
+/**
+ * Class name assigned to paginator container elements.
+ *
+ * @property DataTable.CLASS_PAGINATOR
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-paginator"
+ */
+YAHOO.widget.DataTable.CLASS_PAGINATOR = "yui-dt-paginator";
+
+/**
+ * Class name assigned to page number indicators.
+ *
+ * @property DataTable.CLASS_PAGE
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-page"
+ */
+YAHOO.widget.DataTable.CLASS_PAGE = "yui-dt-page";
+
+/**
+ * Class name assigned to default indicators.
+ *
+ * @property DataTable.CLASS_DEFAULT
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-default"
+ */
+YAHOO.widget.DataTable.CLASS_DEFAULT = "yui-dt-default";
+
+/**
+ * Class name assigned to previous indicators.
+ *
+ * @property DataTable.CLASS_PREVIOUS
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-previous"
+ */
+YAHOO.widget.DataTable.CLASS_PREVIOUS = "yui-dt-previous";
+
+/**
+ * Class name assigned next indicators.
+ *
+ * @property DataTable.CLASS_NEXT
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-next"
+ */
+YAHOO.widget.DataTable.CLASS_NEXT = "yui-dt-next";
+
+/**
+ * Class name assigned to first elements.
+ *
+ * @property DataTable.CLASS_FIRST
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-first"
+ */
+YAHOO.widget.DataTable.CLASS_FIRST = "yui-dt-first";
+
+/**
+ * Class name assigned to last elements.
+ *
+ * @property DataTable.CLASS_LAST
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-last"
+ */
+YAHOO.widget.DataTable.CLASS_LAST = "yui-dt-last";
+
+/**
+ * Class name assigned to even elements.
+ *
+ * @property DataTable.CLASS_EVEN
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-even"
+ */
+YAHOO.widget.DataTable.CLASS_EVEN = "yui-dt-even";
+
+/**
+ * Class name assigned to odd elements.
+ *
+ * @property DataTable.CLASS_ODD
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-odd"
+ */
+YAHOO.widget.DataTable.CLASS_ODD = "yui-dt-odd";
+
+/**
+ * Class name assigned to selected elements.
+ *
+ * @property DataTable.CLASS_SELECTED
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-selected"
+ */
+YAHOO.widget.DataTable.CLASS_SELECTED = "yui-dt-selected";
+
+/**
+ * Class name assigned to highlighted elements.
+ *
+ * @property DataTable.CLASS_HIGHLIGHTED
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-highlighted"
+ */
+YAHOO.widget.DataTable.CLASS_HIGHLIGHTED = "yui-dt-highlighted";
+
+/**
+ * Class name assigned to disabled elements.
+ *
+ * @property DataTable.CLASS_DISABLED
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-disabled"
+ */
+YAHOO.widget.DataTable.CLASS_DISABLED = "yui-dt-disabled";
+
+/**
+ * Class name assigned to empty indicators.
+ *
+ * @property DataTable.CLASS_EMPTY
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-empty"
+ */
+YAHOO.widget.DataTable.CLASS_EMPTY = "yui-dt-empty";
+
+/**
+ * Class name assigned to loading indicatorx.
+ *
+ * @property DataTable.CLASS_LOADING
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-loading"
+ */
+YAHOO.widget.DataTable.CLASS_LOADING = "yui-dt-loading";
+
+/**
+ * Class name assigned to error indicators.
+ *
+ * @property DataTable.CLASS_ERROR
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-error"
+ */
+YAHOO.widget.DataTable.CLASS_ERROR = "yui-dt-error";
+
+/**
+ * Class name assigned to editable elements.
+ *
+ * @property DataTable.CLASS_EDITABLE
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-editable"
+ */
+YAHOO.widget.DataTable.CLASS_EDITABLE = "yui-dt-editable";
+
+/**
+ * Class name assigned to scrollable elements.
+ *
+ * @property DataTable.CLASS_SCROLLABLE
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-scrollable"
+ */
+YAHOO.widget.DataTable.CLASS_SCROLLABLE = "yui-dt-scrollable";
+
+/**
+ * Class name assigned to sortable elements.
+ *
+ * @property DataTable.CLASS_SORTABLE
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-sortable"
+ */
+YAHOO.widget.DataTable.CLASS_SORTABLE = "yui-dt-sortable";
+
+/**
+ * Class name assigned to ascending elements.
+ *
+ * @property DataTable.CLASS_ASC
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-asc"
+ */
+YAHOO.widget.DataTable.CLASS_ASC = "yui-dt-asc";
+
+/**
+ * Class name assigned to descending elements.
+ *
+ * @property DataTable.CLASS_DESC
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-desc"
+ */
+YAHOO.widget.DataTable.CLASS_DESC = "yui-dt-desc";
+
+/**
+ * Class name assigned to BUTTON container elements.
+ *
+ * @property DataTable.CLASS_BUTTON
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-button"
+ */
+YAHOO.widget.DataTable.CLASS_BUTTON = "yui-dt-button";
+
+/**
+ * Class name assigned to SELECT container elements.
+ *
+ * @property DataTable.CLASS_DROPDOWN
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-dropdown"
+ */
+YAHOO.widget.DataTable.CLASS_DROPDOWN = "yui-dt-dropdown";
+
+/**
+ * Class name assigned to INPUT TYPE=CHECKBOX container elements.
+ *
+ * @property DataTable.CLASS_CHECKBOX
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-checkbox"
+ */
+YAHOO.widget.DataTable.CLASS_CHECKBOX = "yui-dt-checkbox";
+
+/**
+ * Message to display if DataTable has no data.
+ *
+ * @property DataTable.MSG_EMPTY
+ * @type String
+ * @static
+ * @final
+ * @default "No records found."
+ */
+YAHOO.widget.DataTable.MSG_EMPTY = "No records found.";
+
+/**
+ * Message to display while DataTable is loading data.
+ *
+ * @property DataTable.MSG_LOADING
+ * @type String
+ * @static
+ * @final
+ * @default "Loading data..."
+ */
+YAHOO.widget.DataTable.MSG_LOADING = "Loading data...";
+
+/**
+ * Message to display while DataTable has data error.
+ *
+ * @property DataTable.MSG_ERROR
+ * @type String
+ * @static
+ * @final
+ * @default "Data error."
+ */
+YAHOO.widget.DataTable.MSG_ERROR = "Data error.";
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class variable for indexing multiple DataTable instances.
+ *
+ * @property DataTable._nCount
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.widget.DataTable._nCount = 0;
+
+/**
+ * Index assigned to instance.
+ *
+ * @property _nIndex
+ * @type Number
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._nIndex = null;
+
+/**
+ * Counter for IDs assigned to TR elements.
+ *
+ * @property _nTrCount
+ * @type Number
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._nTrCount = 0;
+
+/**
+ * Unique name assigned to instance.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sName = null;
+
+/**
+ * DOM reference to the container element for the DataTable instance into which
+ * the TABLE element gets created.
+ *
+ * @property _elContainer
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elContainer = null;
+
+/**
+ * DOM reference to the CAPTION element for the DataTable instance.
+ *
+ * @property _elCaption
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elCaption = null;
+
+/**
+ * DOM reference to the TABLE element for the DataTable instance.
+ *
+ * @property _elTable
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elTable = null;
+
+/**
+ * DOM reference to the THEAD element for the DataTable instance.
+ *
+ * @property _elThead
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elThead = null;
+
+/**
+ * DOM reference to the primary TBODY element for the DataTable instance.
+ *
+ * @property _elTbody
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elTbody = null;
+
+/**
+ * DOM reference to the secondary TBODY element used to display DataTable messages.
+ *
+ * @property _elMsgTbody
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elMsgTbody = null;
+
+/**
+ * DOM reference to the secondary TBODY element's single TR element used to display DataTable messages.
+ *
+ * @property _elMsgTbodyRow
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elMsgTbodyRow = null;
+
+/**
+ * DOM reference to the secondary TBODY element's single TD element used to display DataTable messages.
+ *
+ * @property _elMsgTbodyCell
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elMsgTbodyCell = null;
+
+/**
+ * DataSource instance for the DataTable instance.
+ *
+ * @property _oDataSource
+ * @type YAHOO.util.DataSource
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._oDataSource = null;
+
+/**
+ * ColumnSet instance for the DataTable instance.
+ *
+ * @property _oColumnSet
+ * @type YAHOO.widget.ColumnSet
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._oColumnSet = null;
+
+/**
+ * RecordSet instance for the DataTable instance.
+ *
+ * @property _oRecordSet
+ * @type YAHOO.widget.RecordSet
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._oRecordSet = null;
+
+/**
+ * ID string of first label link element of the current DataTable page, if any.
+ * Used for focusing sortable Columns with TAB.
+ *
+ * @property _sFirstLabelLinkId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sFirstLabelLinkId = null;
+
+/**
+ * ID string of first TR element of the current DataTable page.
+ *
+ * @property _sFirstTrId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sFirstTrId = null;
+
+/**
+ * ID string of the last TR element of the current DataTable page.
+ *
+ * @property _sLastTrId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sLastTrId = null;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Sets focus on the given element.
+ *
+ * @method _focusEl
+ * @param el {HTMLElement} Element.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._focusEl = function(el) {
+    el = el || this._elTable;
+    // http://developer.mozilla.org/en/docs/index.php?title=Key-navigable_custom_DHTML_widgets
+    // The timeout is necessary in both IE and Firefox 1.5, to prevent scripts from doing
+    // strange unexpected things as the user clicks on buttons and other controls.
+    setTimeout(function() { el.focus(); },0);
+};
+
+
+
+
+
+// INIT FUNCTIONS
+
+/**
+ * Initializes container element.
+ *
+ * @method _initContainerEl
+ * @param elContainer {HTMLElement | String} HTML DIV element by reference or ID.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initContainerEl = function(elContainer) {
+    this._elContainer = null;
+    elContainer = YAHOO.util.Dom.get(elContainer);
+    if(elContainer && elContainer.tagName && (elContainer.tagName.toLowerCase() == "div")) {
+        this._elContainer = elContainer;
+    }
+};
+
+/**
+ * Initializes object literal of config values.
+ *
+ * @method _initConfigs
+ * @param oConfig {Object} Object literal of config values.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initConfigs = function(oConfigs) {
+    if(oConfigs) {
+        if(oConfigs.constructor != Object) {
+            oConfigs = null;
+            YAHOO.log("Invalid configs", "warn", this.toString());
+        }
+        // Backward compatibility
+        else if(YAHOO.lang.isBoolean(oConfigs.paginator)) {
+            YAHOO.log("DataTable's paginator model has been revised" +
+            " -- please refer to the documentation for implementation" +
+            " details", "warn", this.toString());
+        }
+        this._oConfigs = oConfigs;
+    }
+};
+
+/**
+ * Initializes ColumnSet.
+ *
+ * @method _initColumnSet
+ * @param aColumnDefs {Object[]} Array of object literal Column definitions.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initColumnSet = function(aColumnDefs) {
+    this._oColumnSet = null;
+    if(YAHOO.lang.isArray(aColumnDefs)) {
+        this._oColumnSet =  new YAHOO.widget.ColumnSet(aColumnDefs);
+    }
+    // Backward compatibility
+    else if(aColumnDefs instanceof YAHOO.widget.ColumnSet) {
+        this._oColumnSet =  aColumnDefs;
+        YAHOO.log("DataTable's constructor now requires an array" +
+        " of object literal Column definitions instead of a ColumnSet instance",
+        "warn", this.toString());
+    }
+};
+
+/**
+ * Initializes DataSource.
+ *
+ * @method _initDataSource
+ * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initDataSource = function(oDataSource) {
+    this._oDataSource = null;
+    if(oDataSource && (oDataSource instanceof YAHOO.util.DataSource)) {
+        this._oDataSource = oDataSource;
+    }
+    // Backward compatibility
+    else {
+        var tmpTable = null;
+        var tmpContainer = this._elContainer;
+        // Peek in container child nodes to see if TABLE already exists
+        if(tmpContainer.hasChildNodes()) {
+            var tmpChildren = tmpContainer.childNodes;
+            for(i=0; i<tmpChildren.length; i++) {
+                if(tmpChildren[i].tagName && tmpChildren[i].tagName.toLowerCase() == "table") {
+                    tmpTable = tmpChildren[i];
+                    break;
+                }
+            }
+            if(tmpTable) {
+                var tmpFieldsArray = [];
+                for(i=0; i<this._oColumnSet.keys.length; i++) {
+                    tmpFieldsArray.push({key:this._oColumnSet.keys[i].key});
+                }
+
+                this._oDataSource = new YAHOO.util.DataSource(tmpTable);
+                this._oDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
+                this._oDataSource.responseSchema = {fields: tmpFieldsArray};
+                YAHOO.log("Null DataSource for progressive enhancement from" +
+                " markup has been deprecated", "warn", this.toString());
+            }
+        }
+    }
+};
+
+/**
+ * Initializes RecordSet.
+ *
+ * @method _initRecordSet
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initRecordSet = function() {
+    if(this._oRecordSet) {
+        this._oRecordSet.reset();
+    }
+    else {
+        this._oRecordSet = new YAHOO.widget.RecordSet();
+    }
+};
+
+/**
+ * Creates HTML markup for TABLE, THEAD and TBODY elements.
+ *
+ * @method _initTableEl
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initTableEl = function() {
+    // Clear the container
+    YAHOO.util.Event.purgeElement(this._elContainer, true);
+    this._elContainer.innerHTML = "";
+
+    // Create TABLE
+    this._elTable = this._elContainer.appendChild(document.createElement("table"));
+    var elTable = this._elTable;
+    elTable.tabIndex = 0;
+    elTable.id = this.id + "-table";
+    YAHOO.util.Dom.addClass(elTable, YAHOO.widget.DataTable.CLASS_TABLE);
+
+    // Create THEAD
+    this._initTheadEl(elTable, this._oColumnSet);
+
+
+    // Create TBODY for messages
+    var elMsgTbody = document.createElement("tbody");
+    var elMsgRow = elMsgTbody.appendChild(document.createElement("tr"));
+    YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_FIRST);
+    YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_LAST);
+    this._elMsgRow = elMsgRow;
+    var elMsgCell = elMsgRow.appendChild(document.createElement("td"));
+    elMsgCell.colSpan = this._oColumnSet.keys.length;
+    YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_FIRST);
+    YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_LAST);
+    this._elMsgTd = elMsgCell;
+    this._elMsgTbody = elTable.appendChild(elMsgTbody);
+    this.showTableMessage(YAHOO.widget.DataTable.MSG_LOADING, YAHOO.widget.DataTable.CLASS_LOADING);
+
+    // Create TBODY for data
+    this._elTbody = elTable.appendChild(document.createElement("tbody"));
+    YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_BODY);
+};
+
+/**
+ * Populates THEAD element with TH cells as defined by ColumnSet.
+ *
+ * @method _initTheadEl
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initTheadEl = function() {
+    var i,oColumn, colId;
+    var oColumnSet = this._oColumnSet;
+    this._sFirstLabelLinkId = null;
+    
+    // Create THEAD
+    var elThead = document.createElement("thead");
+
+    // Iterate through each row of Column headers...
+    var colTree = oColumnSet.tree;
+    for(i=0; i<colTree.length; i++) {
+        var elTheadRow = elThead.appendChild(document.createElement("tr"));
+        elTheadRow.id = this.id+"-hdrow"+i;
+
+        var elTheadCell;
+        // ...and create THEAD cells
+        for(var j=0; j<colTree[i].length; j++) {
+            oColumn = colTree[i][j];
+            colId = oColumn.getId();
+            elTheadCell = elTheadRow.appendChild(document.createElement("th"));
+            elTheadCell.id = this.id + "-col" + colId;
+            this._initThEl(elTheadCell,oColumn,i,j);
+        }
+
+        // Set FIRST/LAST on THEAD rows
+        if(i === 0) {
+            YAHOO.util.Dom.addClass(elTheadRow, YAHOO.widget.DataTable.CLASS_FIRST);
+        }
+        if(i === (colTree.length-1)) {
+            YAHOO.util.Dom.addClass(elTheadRow, YAHOO.widget.DataTable.CLASS_LAST);
+        }
+    }
+
+    this._elThead = this._elTable.appendChild(elThead);
+
+    // Set FIRST/LAST on THEAD cells using the values in ColumnSet headers array
+    var aFirstHeaders = oColumnSet.headers[0].split(" ");
+    var aLastHeaders = oColumnSet.headers[oColumnSet.headers.length-1].split(" ");
+    for(i=0; i<aFirstHeaders.length; i++) {
+        YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aFirstHeaders[i]), YAHOO.widget.DataTable.CLASS_FIRST);
+    }
+    for(i=0; i<aLastHeaders.length; i++) {
+        YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aLastHeaders[i]), YAHOO.widget.DataTable.CLASS_LAST);
+    }
+    
+    // Add Resizer only after DOM has been updated
+    var foundDD = (YAHOO.util.DD) ? true : false;
+    var needDD = false;
+    for(i=0; i<this._oColumnSet.keys.length; i++) {
+        oColumn = this._oColumnSet.keys[i];
+        colId = oColumn.getId();
+        var elTheadCellId = YAHOO.util.Dom.get(this.id + "-col" + colId);
+        if(oColumn.resizeable) {
+            if(foundDD) {
+                //TODO: fix fixed width tables
+                // Skip the last column for fixed-width tables
+                if(!this.fixedWidth || (this.fixedWidth &&
+                        (oColumn.getKeyIndex() != this._oColumnSet.keys.length-1))) {
+                    // TODO: better way to get elTheadContainer
+                    var elThContainer = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_HEADER,"div",elTheadCellId)[0];
+                    var elThResizer = elThContainer.appendChild(document.createElement("span"));
+                    elThResizer.id = this.id + "-resizer" + colId;
+                    YAHOO.util.Dom.addClass(elThResizer,YAHOO.widget.DataTable.CLASS_RESIZER);
+                    oColumn.ddResizer = new YAHOO.util.ColumnResizer(
+                            this, oColumn, elTheadCellId, elThResizer.id, elThResizer.id);
+                    var cancelClick = function(e) {
+                        YAHOO.util.Event.stopPropagation(e);
+                    };
+                    YAHOO.util.Event.addListener(elThResizer,"click",cancelClick);
+                }
+                if(this.fixedWidth) {
+                    //TODO: fix fixedWidth
+                    //elThContainer.style.overflow = "hidden";
+                    //TODO: better way to get elTheadText
+                    var elThLabel = (YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",elTheadCellId))[0];
+                    elThLabel.style.overflow = "hidden";
+                }
+            }
+            else {
+                needDD = true;
+            }
+        }
+    }
+    if(needDD) {
+        YAHOO.log("Could not find DragDrop dependancy for resizeable Columns", "warn", this.toString());
+    }
+
+    YAHOO.log("Column headers for " + this._oColumnSet.keys.length + " keys created","info",this.toString());
+};
+
+/**
+ * Populates TH cell as defined by Column.
+ *
+ * @method _initThEl
+ * @param elTheadCell {HTMLElement} TH cell element reference.
+ * @param oColumn {YAHOO.widget.Column} Column object.
+ * @param row {number} Row index.
+ * @param col {number} Column index.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initThEl = function(elTheadCell,oColumn,row,col) {
+    // Clear out the cell of prior content
+    // TODO: purgeListeners and other validation-related things
+    var index = this._nIndex;
+    var colId = oColumn.getId();
+    elTheadCell.yuiColumnId = colId;
+    if(oColumn.abbr) {
+        elTheadCell.abbr = oColumn.abbr;
+    }
+    if(oColumn.width) {
+        elTheadCell.style.width = oColumn.width;
+    }
+
+    var aCustomClasses;
+    if(YAHOO.lang.isString(oColumn.className)) {
+        aCustomClasses = [oColumn.className];
+    }
+    else if(YAHOO.lang.isArray(oColumn.className)) {
+        aCustomClasses = oColumn.className;
+    }
+    if(aCustomClasses) {
+        for(var i=0; i<aCustomClasses.length; i++) {
+            YAHOO.util.Dom.addClass(elTheadCell,aCustomClasses[i]);
+        }
+    }
+    
+    YAHOO.util.Dom.addClass(elTheadCell, "yui-dt-col-"+oColumn.key);
+    
+    elTheadCell.innerHTML = "";
+    elTheadCell.rowSpan = oColumn.getRowspan();
+    elTheadCell.colSpan = oColumn.getColspan();
+
+    var elTheadContainer = elTheadCell.appendChild(document.createElement("div"));
+    elTheadContainer.id = this.id + "-container" + colId;
+    YAHOO.util.Dom.addClass(elTheadContainer,YAHOO.widget.DataTable.CLASS_HEADER);
+    var elTheadLabel = elTheadContainer.appendChild(document.createElement("span"));
+    elTheadLabel.id = this.id + "-label" + colId;
+    YAHOO.util.Dom.addClass(elTheadLabel,YAHOO.widget.DataTable.CLASS_LABEL);
+
+    var sLabel = YAHOO.lang.isValue(oColumn.label) ? oColumn.label : oColumn.key;
+    if(oColumn.sortable) {
+        YAHOO.util.Dom.addClass(elTheadCell,YAHOO.widget.DataTable.CLASS_SORTABLE);
+        //TODO: Make sortLink customizeable
+        //TODO: Make title configurable
+        //TODO: Separate label from an accessibility link that says
+        // "Click to sort ascending" and push it offscreen
+        var sLabelLinkId = this.id + "-labellink" + colId;
+        var sortLink = "?key=" + oColumn.key;
+        elTheadLabel.innerHTML = "<a id=\"" + sLabelLinkId + "\" href=\"" + sortLink + "\" title=\"Click to sort\" class=\"" + YAHOO.widget.DataTable.CLASS_SORTABLE + "\">" + sLabel + "</a>";
+        if(!this._sFirstLabelLinkId) {
+            this._sFirstLabelLinkId = sLabelLinkId;
+        }
+    }
+    else {
+        elTheadLabel.innerHTML = sLabel;
+    }
+};
+
+/**
+ * Creates HTML markup for Cell Editor.
+ *
+ * @method _initCellEditorEl
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initCellEditorEl = function() {
+    // Attach Cell Editor container element to body
+    var elCellEditor = document.createElement("div");
+    elCellEditor.id = this.id + "-celleditor";
+    elCellEditor.style.display = "none";
+    YAHOO.util.Dom.addClass(elCellEditor, YAHOO.widget.DataTable.CLASS_EDITOR);
+    elCellEditor = document.body.appendChild(elCellEditor);
+
+    // Internal tracker of Cell Editor values
+    var oCellEditor = {};
+    oCellEditor.container = elCellEditor;
+    oCellEditor.value = null;
+    oCellEditor.isActive = false;
+    this._oCellEditor = oCellEditor;
+
+    // Handle ESC key
+    this.subscribe("editorKeydownEvent", function(oArgs) {
+        var e = oArgs.event;
+        var elTarget = YAHOO.util.Event.getTarget(e);
+
+        // ESC hides Cell Editor
+        if((e.keyCode == 27)) {
+            this.cancelCellEditor();
+        }
+    });
+};
+
+/**
+ * Initializes Column sorting.
+ *
+ * @method _initColumnSort
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initColumnSort = function() {
+    this.subscribe("headerCellClickEvent", this.onEventSortColumn);
+};
+
+/**
+ * Initializes DOM event listeners.
+ *
+ * @method _initDomEvents
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initDomEvents = function() {
+    var elTable = this._elTable;
+    var elThead = this._elThead;
+    var elTbody = this._elTbody;
+    var elContainer = this._elContainer;
+
+    YAHOO.util.Event.addListener(document, "click", this._onDocumentClick, this);
+    YAHOO.util.Event.addListener(document, "keydown", this._onDocumentKeydown, this);
+
+    YAHOO.util.Event.addListener(elTable, "focus", this._onTableFocus, this);
+    YAHOO.util.Event.addListener(elTable, "mouseover", this._onTableMouseover, this);
+    YAHOO.util.Event.addListener(elTable, "mouseout", this._onTableMouseout, this);
+    YAHOO.util.Event.addListener(elTable, "mousedown", this._onTableMousedown, this);
+    YAHOO.util.Event.addListener(elTable, "keydown", this._onTableKeydown, this);
+    YAHOO.util.Event.addListener(elTable, "keypress", this._onTableKeypress, this);
+
+    // Since we can't listen for click and dblclick on the same element...
+    YAHOO.util.Event.addListener(elTable, "dblclick", this._onTableDblclick, this);
+    YAHOO.util.Event.addListener(elThead, "click", this._onTheadClick, this);
+    YAHOO.util.Event.addListener(elTbody, "click", this._onTbodyClick, this);
+
+    YAHOO.util.Event.addListener(elContainer, "scroll", this._onScroll, this); // for IE
+    YAHOO.util.Event.addListener(elTbody, "scroll", this._onScroll, this); // for everyone else
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// DOM MUTATION FUNCTIONS
+
+
+
+
+/**
+ * Adds a TR element to the primary TBODY at the page row index if given, otherwise
+ * at the end of the page. Formats TD elements within the TR element using data
+ * from the given Record.
+ *
+ * @method _addTrEl
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param index {Number} (optional) The page row index at which to add the TR
+ * element.
+ * @return {String} ID of the added TR element, or null.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._addTrEl = function(oRecord, index) {
+    this.hideTableMessage();
+
+    // It's an append if no index provided, or index is negative or too big
+    var append = (!YAHOO.lang.isNumber(index) || (index < 0) ||
+            (index >= (this._elTbody.rows.length))) ? true : false;
+            
+    var oColumnSet = this._oColumnSet;
+    var oRecordSet = this._oRecordSet;
+    var isSortedBy = this.get("sortedBy");
+    var sortedColKeyIndex  = null;
+    var sortedDir, newClass;
+    if(isSortedBy) {
+        sortedColKeyIndex = (isSortedBy.column) ?
+                isSortedBy.column.getKeyIndex() :
+                this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();
+        sortedDir = isSortedBy.dir;
+        newClass = (sortedDir === "desc") ? YAHOO.widget.DataTable.CLASS_DESC :
+                YAHOO.widget.DataTable.CLASS_ASC;
+
+    }
+
+
+    var elRow = (append) ? this._elTbody.appendChild(document.createElement("tr")) :
+        this._elTbody.insertBefore(document.createElement("tr"),this._elTbody.rows[index]);
+
+    elRow.id = this.id+"-bdrow"+this._nTrCount;
+    this._nTrCount++;
+    elRow.yuiRecordId = oRecord.getId();
+
+    // Create TD cells
+    for(var j=0; j<oColumnSet.keys.length; j++) {
+        var oColumn = oColumnSet.keys[j];
+        var elCell = elRow.appendChild(document.createElement("td"));
+        elCell.id = elRow.id+"-cell"+j;
+        elCell.yuiColumnId = oColumn.getId();
+        elCell.headers = oColumnSet.headers[j];
+        // For SF2 cellIndex bug: http://www.webreference.com/programming/javascript/ppk2/3.html
+        elCell.yuiCellIndex = j;
+
+        // Update UI
+        this.formatCell(elCell, oRecord, oColumn);
+
+        // Set FIRST/LAST on TD
+        if (j === 0) {
+            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_FIRST);
+        }
+        else if (j === this._oColumnSet.keys.length-1) {
+            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_LAST);
+        }
+        
+        // Remove ASC/DESC
+        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_ASC);
+        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_DESC);
+        
+        // Set ASC/DESC on TD
+        if(j === sortedColKeyIndex) {
+            newClass = (sortedDir === "desc") ?
+                    YAHOO.widget.DataTable.CLASS_DESC :
+                    YAHOO.widget.DataTable.CLASS_ASC;
+            YAHOO.util.Dom.addClass(elCell, newClass);
+        }
+
+
+        /*p.abx {word-wrap:break-word;}
+ought to solve the problem for Safari (the long words will wrap in your
+tds, instead of overflowing to the next td.
+(this is supported by IE win as well, so hide it if needed).
+
+One thing, though: it doesn't work in combination with
+'white-space:nowrap'.*/
+
+// need a div wrapper for safari?
+        //TODO: fix fixedWidth
+        if(this.fixedWidth) {
+            elCell.style.overflow = "hidden";
+            //elCell.style.width = "20px";
+        }
+    }
+
+    return elRow.id;
+};
+
+/**
+ * Formats all TD elements of given TR element with data from the given Record.
+ *
+ * @method _updateTrEl
+ * @param elRow {HTMLElement} The TR element to update.
+ * @param oRecord {YAHOO.widget.Record} The associated Record instance.
+ * @return {String} ID of the updated TR element, or null.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._updateTrEl = function(elRow, oRecord) {
+    this.hideTableMessage();
+
+    var isSortedBy = this.get("sortedBy");
+    var sortedColKeyIndex  = null;
+    var sortedDir, newClass;
+    if(isSortedBy) {
+        sortedColKeyIndex = (isSortedBy.column) ?
+                isSortedBy.column.getKeyIndex() :
+                this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();
+        sortedDir = isSortedBy.dir;
+        newClass = (sortedDir === "desc") ? YAHOO.widget.DataTable.CLASS_DESC :
+                YAHOO.widget.DataTable.CLASS_ASC;
+    }
+
+    // Update TD elements with new data
+    for(var j=0; j<elRow.cells.length; j++) {
+        var oColumn = this._oColumnSet.keys[j];
+        var elCell = elRow.cells[j];
+        this.formatCell(elCell, oRecord, oColumn);
+
+        // Remove ASC/DESC
+        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_ASC);
+        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_DESC);
+
+        // Set ASC/DESC on TD
+        if(j === sortedColKeyIndex) {
+            YAHOO.util.Dom.addClass(elCell, newClass);
+        }
+    }
+
+    // Update Record ID
+    elRow.yuiRecordId = oRecord.getId();
+    
+    return elRow.id;
+};
+
+
+/**
+ * Deletes TR element by DOM reference or by DataTable page row index.
+ *
+ * @method _deleteTrEl
+ * @param row {HTMLElement | Number} TR element reference or Datatable page row index.
+ * @return {Boolean} Returns true if successful, else returns false.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._deleteTrEl = function(row) {
+    var rowIndex;
+    
+    // Get page row index for the element
+    if(!YAHOO.lang.isNumber(row)) {
+        rowIndex = YAHOO.util.Dom.get(row).sectionRowIndex;
+    }
+    else {
+        rowIndex = row;
+    }
+    if(YAHOO.lang.isNumber(rowIndex) && (rowIndex > -2) && (rowIndex < this._elTbody.rows.length)) {
+        this._elTbody.deleteRow(rowIndex);
+        return true;
+    }
+    else {
+        return false;
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// CSS/STATE FUNCTIONS
+
+
+
+
+/**
+ * Assigns the class YAHOO.widget.DataTable.CLASS_FIRST to the first TR element
+ * of the DataTable page and updates internal tracker.
+ *
+ * @method _setFirstRow
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._setFirstRow = function() {
+    var rowEl = this.getFirstTrEl();
+    if(rowEl) {
+        // Remove FIRST
+        if(this._sFirstTrId) {
+            YAHOO.util.Dom.removeClass(this._sFirstTrId, YAHOO.widget.DataTable.CLASS_FIRST);
+        }
+        // Set FIRST
+        YAHOO.util.Dom.addClass(rowEl, YAHOO.widget.DataTable.CLASS_FIRST);
+        this._sFirstTrId = rowEl.id;
+    }
+    else {
+        this._sFirstTrId = null;
+    }
+};
+
+/**
+ * Assigns the class YAHOO.widget.DataTable.CLASS_LAST to the last TR element
+ * of the DataTable page and updates internal tracker.
+ *
+ * @method _setLastRow
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._setLastRow = function() {
+    var rowEl = this.getLastTrEl();
+    if(rowEl) {
+        // Unassign previous class
+        if(this._sLastTrId) {
+            YAHOO.util.Dom.removeClass(this._sLastTrId, YAHOO.widget.DataTable.CLASS_LAST);
+        }
+        // Assign class
+        YAHOO.util.Dom.addClass(rowEl, YAHOO.widget.DataTable.CLASS_LAST);
+        this._sLastTrId = rowEl.id;
+    }
+    else {
+        this._sLastTrId = null;
+    }
+};
+
+/**
+ * Assigns the classes YAHOO.widget.DataTable.CLASS_EVEN and
+ * YAHOO.widget.DataTable.CLASS_ODD to alternating TR elements of the DataTable
+ * page. For performance, a subset of rows may be specified.
+ *
+ * @method _setRowStripes
+ * @param row {HTMLElement | String | Number} (optional) HTML TR element reference
+ * or string ID, or page row index of where to start striping.
+ * @param range {Number} (optional) If given, how many rows to stripe, otherwise
+ * stripe all the rows until the end.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._setRowStripes = function(row, range) {
+    // Default values stripe all rows
+    var allRows = this._elTbody.rows;
+    var nStartIndex = 0;
+    var nEndIndex = allRows.length;
+    
+    // Stripe a subset
+    if((row !== null) && (row !== undefined)) {
+        // Validate given start row
+        var elStartRow = this.getTrEl(row);
+        if(elStartRow) {
+            nStartIndex = elStartRow.sectionRowIndex;
+            
+            // Validate given range
+            if(YAHOO.lang.isNumber(range) && (range > 1)) {
+                nEndIndex = nStartIndex + range;
+            }
+        }
+    }
+
+    for(var i=nStartIndex; i<nEndIndex; i++) {
+        if(i%2) {
+            YAHOO.util.Dom.removeClass(allRows[i], YAHOO.widget.DataTable.CLASS_EVEN);
+            YAHOO.util.Dom.addClass(allRows[i], YAHOO.widget.DataTable.CLASS_ODD);
+        }
+        else {
+            YAHOO.util.Dom.removeClass(allRows[i], YAHOO.widget.DataTable.CLASS_ODD);
+            YAHOO.util.Dom.addClass(allRows[i], YAHOO.widget.DataTable.CLASS_EVEN);
+        }
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private DOM Event Handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Handles scroll events on the CONTAINER (for IE) and TBODY elements (for everyone else).
+ *
+ * @method _onScroll
+ * @param e {HTMLEvent} The scroll event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onScroll = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+    
+    if(oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+        oSelf.cancelCellEditor();
+    }
+
+    oSelf.fireEvent("tableScrollEvent", {event:e, target:elTarget});
+};
+
+/**
+ * Handles click events on the DOCUMENT.
+ *
+ * @method _onDocumentClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onDocumentClick = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    if(!YAHOO.util.Dom.isAncestor(oSelf._elTable, elTarget)) {
+        oSelf.fireEvent("tableBlurEvent");
+
+        // Fires editorBlurEvent when click is not within the TABLE.
+        // For cases when click is within the TABLE, due to timing issues,
+        // the editorBlurEvent needs to get fired by the lower-level DOM click
+        // handlers below rather than by the TABLE click handler directly.
+        if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+            // Only if the click was not within the Cell Editor container
+            if(!YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container, elTarget) &&
+                    (oSelf._oCellEditor.container.id !== elTarget.id)) {
+                oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+            }
+        }
+    }
+};
+
+/**
+ * Handles keydown events on the DOCUMENT.
+ *
+ * @method _onDocumentKeydown
+ * @param e {HTMLEvent} The keydown event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onDocumentKeydown = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive &&
+            YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container, elTarget)) {
+        oSelf.fireEvent("editorKeydownEvent", {editor:oSelf._oCellEditor, event:e});
+    }
+};
+
+/**
+ * Handles focus events on the TABLE element.
+ *
+ * @method _onTableFocus
+ * @param e {HTMLEvent} The focus event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableMouseover = function(e, oSelf) {
+    oSelf.fireEvent("tableFocusEvent");
+};
+
+/**
+ * Handles mouseover events on the TABLE element.
+ *
+ * @method _onTableMouseover
+ * @param e {HTMLEvent} The mouseover event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableMouseover = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                 break;
+            case "a":
+                break;
+            case "td":
+                oSelf.fireEvent("cellMouseoverEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
+                    oSelf.fireEvent("headerLabelMouseoverEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                oSelf.fireEvent("headerCellMouseoverEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
+                    oSelf.fireEvent("headerRowMouseoverEvent",{target:elTarget,event:e});
+                }
+                else {
+                    oSelf.fireEvent("rowMouseoverEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+    }
+    oSelf.fireEvent("tableMouseoverEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/**
+ * Handles mouseout events on the TABLE element.
+ *
+ * @method _onTableMouseout
+ * @param e {HTMLEvent} The mouseout event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableMouseout = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                break;
+            case "a":
+                break;
+            case "td":
+                oSelf.fireEvent("cellMouseoutEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
+                    oSelf.fireEvent("headerLabelMouseoutEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                oSelf.fireEvent("headerCellMouseoutEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
+                    oSelf.fireEvent("headerRowMouseoutEvent",{target:elTarget,event:e});
+                }
+                else {
+                    oSelf.fireEvent("rowMouseoutEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+    }
+    oSelf.fireEvent("tableMouseoutEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/**
+ * Handles mousedown events on the TABLE element.
+ *
+ * @method _onTableMousedown
+ * @param e {HTMLEvent} The mousedown event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableMousedown = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                break;
+            case "a":
+                break;
+            case "td":
+                oSelf.fireEvent("cellMousedownEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
+                    oSelf.fireEvent("headerLabelMousedownEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                oSelf.fireEvent("headerCellMousedownEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
+                    oSelf.fireEvent("headerRowMousedownEvent",{target:elTarget,event:e});
+                }
+                else {
+                    oSelf.fireEvent("rowMousedownEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+    }
+    oSelf.fireEvent("tableMousedownEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/**
+ * Handles dblclick events on the TABLE element.
+ *
+ * @method _onTableDblclick
+ * @param e {HTMLEvent} The dblclick event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableDblclick = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                break;
+            case "td":
+                oSelf.fireEvent("cellDblclickEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
+                    oSelf.fireEvent("headerLabelDblclickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                oSelf.fireEvent("headerCellDblclickEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
+                    oSelf.fireEvent("headerRowDblclickEvent",{target:elTarget,event:e});
+                }
+                else {
+                    oSelf.fireEvent("rowDblclickEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+    }
+    oSelf.fireEvent("tableDblclickEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/**
+ * Handles keydown events on the TABLE element. Handles arrow selection.
+ *
+ * @method _onTableKeydown
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableKeydown = function(e, oSelf) {
+    var bSHIFT = e.shiftKey;
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    
+    // Ignore actions in the THEAD
+    if(YAHOO.util.Dom.isAncestor(oSelf._elThead, elTarget)) {
+        return;
+    }
+    
+    var nKey = YAHOO.util.Event.getCharCode(e);
+    
+    // TAB to first label link if any
+    if(nKey === 9 && !bSHIFT && (elTarget.id === oSelf._elTable.id)) {
+        if(oSelf._sFirstLabelLinkId) {
+            YAHOO.util.Event.stopEvent(e);
+            oSelf._focusEl(YAHOO.util.Dom.get(oSelf._sFirstLabelLinkId));
+        }
+        return;
+    }
+
+    // Something is currently selected
+    var lastSelectedId = oSelf._sLastSelectedId;
+    var lastSelectedEl = YAHOO.util.Dom.get(lastSelectedId);
+    if(lastSelectedEl && oSelf.isSelected(lastSelectedEl)) {
+        //TODO: handle tab, backspace, delete
+        
+        // Handle arrow selection
+        if((nKey > 36) && (nKey < 41)) {
+            YAHOO.util.Event.stopEvent(e);
+        }
+        else {
+            return;
+        }
+
+        var sMode = oSelf.get("selectionMode");
+        var allRows = oSelf._elTbody.rows;
+        var anchorId = oSelf._sSelectionAnchorId;
+        var anchorEl = YAHOO.util.Dom.get(anchorId);
+        var newSelectedEl, trIndex, tdIndex, startIndex, endIndex, i, anchorPos;
+
+        ////////////////////////////////////////////////////////////////////////
+        //
+        // SHIFT cell block selection
+        //
+        ////////////////////////////////////////////////////////////////////////
+        if(bSHIFT && (sMode == "cellblock")) {
+            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
+            tdIndex = lastSelectedEl.yuiCellIndex;
+
+            // Arrow DOWN
+            if(nKey == 40) {
+                // Is the anchor cell above, below, or same row
+                if(anchorEl.parentNode.sectionRowIndex > trIndex) {
+                    anchorPos = 1;
+                }
+                else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
+                    anchorPos = -1;
+                }
+                else {
+                    anchorPos = 0;
+                }
+
+                // Is the anchor cell left or right
+                startIndex = Math.min(anchorEl.yuiCellIndex, tdIndex);
+                endIndex = Math.max(anchorEl.yuiCellIndex, tdIndex);
+
+                // Selecting away from anchor cell
+                if(anchorPos <= 0) {
+                    // Select the horiz block on the next row
+                    if(trIndex < allRows.length-1) {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            newSelectedEl = allRows[trIndex+1].cells[i];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect the horiz block on this row towards the next row
+                    for(i=startIndex; i<=endIndex; i++) {
+                        oSelf.unselectCell(allRows[trIndex].cells[i]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
+                }
+            }
+            // Arrow up
+            else if(nKey == 38) {
+                // Is the anchor cell above, below, or same row
+                if(anchorEl.parentNode.sectionRowIndex > trIndex) {
+                    anchorPos = 1;
+                }
+                else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
+                    anchorPos = -1;
+                }
+                else {
+                    anchorPos = 0;
+                }
+
+                // Is the anchor cell left or right?
+                startIndex = Math.min(anchorEl.yuiCellIndex, tdIndex);
+                endIndex = Math.max(anchorEl.yuiCellIndex, tdIndex);
+
+                // Selecting away from anchor cell
+                if(anchorPos >= 0) {
+                    // Select the horiz block on the previous row
+                    if(trIndex > 0) {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            newSelectedEl = allRows[trIndex-1].cells[i];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect the horiz block on this row towards the previous row
+                    for(i=startIndex; i<=endIndex; i++) {
+                        oSelf.unselectCell(allRows[trIndex].cells[i]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
+                }
+            }
+            // Arrow right
+            else if(nKey == 39) {
+                // Is the anchor cell left, right, or same column
+                if(anchorEl.yuiCellIndex > tdIndex) {
+                    anchorPos = 1;
+                }
+                else if(anchorEl.yuiCellIndex < tdIndex) {
+                    anchorPos = -1;
+                }
+                else {
+                    anchorPos = 0;
+                }
+
+                // Selecting away from anchor cell
+                if(anchorPos <= 0) {
+                    //Select the next vert block to the right
+                    if(tdIndex < allRows[trIndex].cells.length-1) {
+                        startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
+                        endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
+                        for(i=startIndex; i<=endIndex; i++) {
+                            newSelectedEl = allRows[i].cells[tdIndex+1];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect the vert block on this column towards the right
+                    startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
+                    endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
+                    for(i=startIndex; i<=endIndex; i++) {
+                        oSelf.unselectCell(allRows[i].cells[tdIndex]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
+                }
+            }
+            // Arrow left
+            else if(nKey == 37) {
+                // Is the anchor cell left, right, or same column
+                if(anchorEl.yuiCellIndex > tdIndex) {
+                    anchorPos = 1;
+                }
+                else if(anchorEl.yuiCellIndex < tdIndex) {
+                    anchorPos = -1;
+                }
+                else {
+                    anchorPos = 0;
+                }
+
+                // Selecting away from anchor cell
+                if(anchorPos >= 0) {
+                    //Select the previous vert block to the left
+                    if(tdIndex > 0) {
+                        startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
+                        endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
+                        for(i=startIndex; i<=endIndex; i++) {
+                            newSelectedEl = allRows[i].cells[tdIndex-1];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect the vert block on this column towards the left
+                    startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
+                    endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
+                    for(i=startIndex; i<=endIndex; i++) {
+                        oSelf.unselectCell(allRows[i].cells[tdIndex]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
+                }
+            }
+        }
+        ////////////////////////////////////////////////////////////////////////
+        //
+        // SHIFT cell range selection
+        //
+        ////////////////////////////////////////////////////////////////////////
+        else if(bSHIFT && (sMode == "cellrange")) {
+            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
+            tdIndex = lastSelectedEl.yuiCellIndex;
+
+            // Is the anchor cell above, below, or same row
+            if(anchorEl.parentNode.sectionRowIndex > trIndex) {
+                anchorPos = 1;
+            }
+            else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
+                anchorPos = -1;
+            }
+            else {
+                anchorPos = 0;
+            }
+
+            // Arrow down
+            if(nKey == 40) {
+                // Selecting away from anchor cell
+                if(anchorPos <= 0) {
+                    // Select all cells to the end of this row
+                    for(i=tdIndex+1; i<allRows[trIndex].cells.length; i++){
+                        newSelectedEl = allRows[trIndex].cells[i];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+
+                    // Select some of the cells on the next row down
+                    if(trIndex < allRows.length-1) {
+                        for(i=0; i<=tdIndex; i++){
+                            newSelectedEl = allRows[trIndex+1].cells[i];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect all cells to the end of this row
+                    for(i=tdIndex; i<allRows[trIndex].cells.length; i++){
+                        oSelf.unselectCell(allRows[trIndex].cells[i]);
+                    }
+
+                    // Unselect some of the cells on the next row down
+                    for(i=0; i<tdIndex; i++){
+                        oSelf.unselectCell(allRows[trIndex+1].cells[i]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
+                }
+            }
+            // Arrow up
+            else if(nKey == 38) {
+                // Selecting away from anchor cell
+                if(anchorPos >= 0) {
+                    // Select all the cells to the beginning of this row
+                    for(i=tdIndex-1; i>-1; i--){
+                        newSelectedEl = allRows[trIndex].cells[i];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+
+                    // Select some of the cells from the end of the previous row
+                    if(trIndex > 0) {
+                        for(i=allRows[trIndex].cells.length-1; i>=tdIndex; i--){
+                            newSelectedEl = allRows[trIndex-1].cells[i];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect all the cells to the beginning of this row
+                    for(i=tdIndex; i>-1; i--){
+                        oSelf.unselectCell(allRows[trIndex].cells[i]);
+                    }
+
+                    // Unselect some of the cells from the end of the previous row
+                    for(i=allRows[trIndex].cells.length-1; i>tdIndex; i--){
+                        oSelf.unselectCell(allRows[trIndex-1].cells[i]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
+                }
+            }
+            // Arrow right
+            else if(nKey == 39) {
+                // Selecting away from anchor cell
+                if(anchorPos < 0) {
+                    // Select the next cell to the right
+                    if(tdIndex < allRows[trIndex].cells.length-1) {
+                        newSelectedEl = allRows[trIndex].cells[tdIndex+1];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+                    // Select the first cell of the next row
+                    else if(trIndex < allRows.length-1) {
+                        newSelectedEl = allRows[trIndex+1].cells[0];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+                }
+                // Unselecting towards anchor cell
+                else if(anchorPos > 0) {
+                    oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+
+                    // Unselect this cell towards the right
+                    if(tdIndex < allRows[trIndex].cells.length-1) {
+                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
+                    }
+                    // Unselect this cells towards the first cell of the next row
+                    else {
+                        oSelf._sLastSelectedId = allRows[trIndex+1].cells[0].id;
+                    }
+                }
+                // Anchor is on this row
+                else {
+                    // Selecting away from anchor
+                    if(anchorEl.yuiCellIndex <= tdIndex) {
+                        // Select the next cell to the right
+                        if(tdIndex < allRows[trIndex].cells.length-1) {
+                            newSelectedEl = allRows[trIndex].cells[tdIndex+1];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        // Select the first cell on the next row
+                        else if(trIndex < allRows.length-1){
+                            newSelectedEl = allRows[trIndex+1].cells[0];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                    }
+                    // Unselecting towards anchor
+                    else {
+                        // Unselect this cell towards the right
+                        oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
+                    }
+                }
+            }
+            // Arrow left
+            else if(nKey == 37) {
+                // Unselecting towards the anchor
+                if(anchorPos < 0) {
+                    oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+
+                    // Unselect this cell towards the left
+                    if(tdIndex > 0) {
+                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
+                    }
+                    // Unselect this cell towards the last cell of the previous row
+                    else {
+                        oSelf._sLastSelectedId = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;
+                    }
+                }
+                // Selecting towards the anchor
+                else if(anchorPos > 0) {
+                    // Select the next cell to the left
+                    if(tdIndex > 0) {
+                        newSelectedEl = allRows[trIndex].cells[tdIndex-1];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+                    // Select the last cell of the previous row
+                    else if(trIndex > 0){
+                        newSelectedEl = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+                }
+                // Anchor is on this row
+                else {
+                    // Selecting away from anchor cell
+                    if(anchorEl.yuiCellIndex >= tdIndex) {
+                        // Select the next cell to the left
+                        if(tdIndex > 0) {
+                            newSelectedEl = allRows[trIndex].cells[tdIndex-1];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        // Select the last cell of the previous row
+                        else if(trIndex > 0){
+                            newSelectedEl = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                    }
+                    // Unselecting towards anchor cell
+                    else {
+                        oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+
+                        // Unselect this cell towards the left
+                        if(tdIndex > 0) {
+                            oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
+                        }
+                        // Unselect this cell towards the last cell of the previous row
+                        else {
+                            oSelf._sLastSelectedId = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;
+                        }
+                    }
+                }
+            }
+        }
+        ////////////////////////////////////////////////////////////////////////
+        //
+        // Simple single cell selection
+        //
+        ////////////////////////////////////////////////////////////////////////
+        else if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
+            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
+            tdIndex = lastSelectedEl.yuiCellIndex;
+
+            // Arrow down
+            if(nKey == 40) {
+                oSelf.unselectAllCells();
+
+                // Select the next cell down
+                if(trIndex < allRows.length-1) {
+                    newSelectedEl = allRows[trIndex+1].cells[tdIndex];
+                    oSelf.selectCell(newSelectedEl);
+                }
+                // Select only the bottom cell
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectCell(newSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+            // Arrow up
+            else if(nKey == 38) {
+                oSelf.unselectAllCells();
+
+                // Select the next cell up
+                if(trIndex > 0) {
+                    newSelectedEl = allRows[trIndex-1].cells[tdIndex];
+                    oSelf.selectCell(newSelectedEl);
+                }
+                // Select only the top cell
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectCell(newSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+            // Arrow right
+            else if(nKey == 39) {
+                oSelf.unselectAllCells();
+
+                // Select the next cell to the right
+                if(tdIndex < lastSelectedEl.parentNode.cells.length-1) {
+                    newSelectedEl = lastSelectedEl.parentNode.cells[tdIndex+1];
+                    oSelf.selectCell(newSelectedEl);
+                }
+                // Select only the right cell
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectCell(newSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+            // Arrow left
+            else if(nKey == 37) {
+                oSelf.unselectAllCells();
+
+                // Select the next cell to the left
+                if(tdIndex > 0) {
+                    newSelectedEl = lastSelectedEl.parentNode.cells[tdIndex-1];
+                    oSelf.selectCell(newSelectedEl);
+                }
+                // Select only the left cell
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectCell(newSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+        }
+        ////////////////////////////////////////////////////////////////////////
+        //
+        // SHIFT row selection
+        //
+        ////////////////////////////////////////////////////////////////////////
+        else if(bSHIFT && (sMode != "single")) {
+            trIndex = lastSelectedEl.sectionRowIndex;
+
+            if(anchorEl.sectionRowIndex > trIndex) {
+                anchorPos = 1;
+            }
+            else if(anchorEl.sectionRowIndex < trIndex) {
+                anchorPos = -1;
+            }
+            else {
+                anchorPos = 0;
+            }
+
+            // Arrow down
+            if(nKey == 40) {
+                // Selecting away from anchor row
+                if(anchorPos <= 0) {
+                    // Select the next row down
+                    if(trIndex < allRows.length-1) {
+                        oSelf.selectRow(trIndex+1);
+                    }
+                }
+                // Unselecting toward anchor row
+                else {
+                    // Unselect this row towards the anchor row down
+                    oSelf.unselectRow(lastSelectedEl);
+                    oSelf._sLastSelectedId = allRows[trIndex+1].id;
+                }
+
+            }
+            // Arrow up
+            else if(nKey == 38) {
+                // Selecting away from anchor row
+                if(anchorPos >= 0) {
+                    // Select the next row up
+                    if(trIndex > 0) {
+                        oSelf.selectRow(trIndex-1);
+                    }
+                }
+                // Unselect this row towards the anchor row up
+                else {
+                    oSelf.unselectRow(lastSelectedEl);
+                    oSelf._sLastSelectedId = allRows[trIndex-1].id;
+                }
+            }
+            // Arrow right
+            else if(nKey == 39) {
+                // Do nothing
+            }
+            // Arrow left
+            else if(nKey == 37) {
+                // Do nothing
+            }
+        }
+        ////////////////////////////////////////////////////////////////////////
+        //
+        // Simple single row selection
+        //
+        ////////////////////////////////////////////////////////////////////////
+        else {
+            trIndex = lastSelectedEl.sectionRowIndex;
+
+            // Arrow down
+            if(nKey == 40) {
+                oSelf.unselectAllRows();
+
+                // Select the next row
+                if(trIndex < allRows.length-1) {
+                    newSelectedEl = allRows[trIndex+1];
+                    oSelf.selectRow(newSelectedEl);
+                }
+                // Select only the last row
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectRow(lastSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+            // Arrow up
+            else if(nKey == 38) {
+                oSelf.unselectAllRows();
+
+                // Select the previous row
+                if(trIndex > 0) {
+                    newSelectedEl = allRows[trIndex-1];
+                    oSelf.selectRow(newSelectedEl);
+                }
+                // Select only the first row
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectRow(newSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+            // Arrow right
+            else if(nKey == 39) {
+                // Do nothing
+            }
+            // Arrow left
+            else if(nKey == 37) {
+                // Do nothing
+            }
+        }
+    }
+};
+
+/**
+ * Handles keypress events on the TABLE. Mainly to support stopEvent on Mac.
+ *
+ * @method _onTableKeypress
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableKeypress = function(e, oSelf) {
+    var isMac = (navigator.userAgent.toLowerCase().indexOf("mac") != -1);
+    if(isMac) {
+        var nKey = YAHOO.util.Event.getCharCode(e);
+        // arrow down
+        if(nKey == 40) {
+            YAHOO.util.Event.stopEvent(e);
+        }
+        // arrow up
+        else if(nKey == 38) {
+            YAHOO.util.Event.stopEvent(e);
+        }
+    }
+};
+
+/**
+ * Handles click events on the THEAD element.
+ *
+ * @method _onTheadClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTheadClick = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+    }
+
+    while(elTarget && (elTag != "thead")) {
+            switch(elTag) {
+                case "body":
+                    break;
+                case "span":
+                    if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
+                        oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});
+                    }
+                    break;
+                case "th":
+                    oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});
+                    break;
+                case "tr":
+                    oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});
+                    break;
+                default:
+                    break;
+            }
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.tagName.toLowerCase();
+            }
+    }
+    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/**
+ * Handles click events on the primary TBODY element.
+ *
+ * @method _onTbodyClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTbodyClick = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+    }
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                break;
+            case "input":
+                if(elTarget.type.toLowerCase() == "checkbox") {
+                    oSelf.fireEvent("checkboxClickEvent",{target:elTarget,event:e});
+                }
+                else if(elTarget.type.toLowerCase() == "radio") {
+                    oSelf.fireEvent("radioClickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "a":
+                oSelf.fireEvent("linkClickEvent",{target:elTarget,event:e});
+                break;
+            case "button":
+                oSelf.fireEvent("buttonClickEvent",{target:elTarget,event:e});
+                break;
+            case "td":
+                oSelf.fireEvent("cellClickEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                oSelf.fireEvent("rowClickEvent",{target:elTarget,event:e});
+                break;
+            default:
+                break;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+    }
+    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/*TODO: delete
+ * Handles keyup events on the TBODY. Executes deletion.
+ *
+ * @method _onTbodyKeyup
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+/*YAHOO.widget.DataTable.prototype._onTbodyKeyup = function(e, oSelf) {
+   var nKey = YAHOO.util.Event.getCharCode(e);
+    // delete
+    if(nKey == 46) {//TODO: if something is selected
+        //TODO: delete row
+    }
+};*/
+
+/**
+ * Handles click events on paginator links.
+ *
+ * @method _onPaginatorLinkClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onPaginatorLinkClick = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+    }
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "a":
+                YAHOO.util.Event.stopEvent(e);
+                //TODO: after the showPage call, figure out which link
+                //TODO: was clicked and reset focus to the new version of it
+                switch(elTarget.className) {
+                    case YAHOO.widget.DataTable.CLASS_PAGE:
+                        oSelf.showPage(parseInt(elTarget.innerHTML,10));
+                        return;
+                    case YAHOO.widget.DataTable.CLASS_FIRST:
+                        oSelf.showPage(1);
+                        return;
+                    case YAHOO.widget.DataTable.CLASS_LAST:
+                        oSelf.showPage(oSelf.get("paginator").totalPages);
+                        return;
+                    case YAHOO.widget.DataTable.CLASS_PREVIOUS:
+                        oSelf.showPage(oSelf.get("paginator").currentPage - 1);
+                        return;
+                    case YAHOO.widget.DataTable.CLASS_NEXT:
+                        oSelf.showPage(oSelf.get("paginator").currentPage + 1);
+                        return;
+                }
+                break;
+            default:
+                return;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+        else {
+            return;
+        }
+    }
+};
+
+/**
+ * Handles change events on paginator SELECT element.
+ *
+ * @method _onPaginatorDropdownChange
+ * @param e {HTMLEvent} The change event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onPaginatorDropdownChange = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var newValue = elTarget[elTarget.selectedIndex].value;
+
+    var newRowsPerPage = YAHOO.lang.isValue(parseInt(newValue,10)) ? parseInt(newValue,10) : null;
+    if(newRowsPerPage !== null) {
+        var newStartRecordIndex = (oSelf.get("paginator").currentPage-1) * newRowsPerPage;
+        oSelf.updatePaginator({rowsPerPage:newRowsPerPage, startRecordIndex:newStartRecordIndex});
+        oSelf.refreshView();
+    }
+    else {
+        YAHOO.log("Could not paginate with " + newValue + " rows per page", "error", oSelf.toString());
+    }
+};
+
+/**
+ * Handles change events on SELECT elements within DataTable.
+ *
+ * @method _onDropdownChange
+ * @param e {HTMLEvent} The change event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onDropdownChange = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    //TODO: pass what args?
+    //var value = elTarget[elTarget.selectedIndex].value;
+    oSelf.fireEvent("dropdownChangeEvent", {event:e, target:elTarget});
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+// OBJECT ACCESSORS
+
+/**
+ * Public accessor to the unique name of the DataSource instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the DataSource instance.
+ */
+
+YAHOO.widget.DataTable.prototype.toString = function() {
+    return "DataTable " + this._sName;
+};
+
+/**
+ * Returns the DataTable instance's DataSource instance.
+ *
+ * @method getDataSource
+ * @return {YAHOO.util.DataSource} DataSource instance.
+ */
+YAHOO.widget.DataTable.prototype.getDataSource = function() {
+    return this._oDataSource;
+};
+
+/**
+ * Returns the DataTable instance's ColumnSet instance.
+ *
+ * @method getColumnSet
+ * @return {YAHOO.widget.ColumnSet} ColumnSet instance.
+ */
+YAHOO.widget.DataTable.prototype.getColumnSet = function() {
+    return this._oColumnSet;
+};
+
+/**
+ * Returns the DataTable instance's RecordSet instance.
+ *
+ * @method getRecordSet
+ * @return {YAHOO.widget.RecordSet} RecordSet instance.
+ */
+YAHOO.widget.DataTable.prototype.getRecordSet = function() {
+    return this._oRecordSet;
+};
+
+/**
+ * Returns the DataTable instance's Cell Editor as an object literal with the
+ * following properties:
+ * <dl>
+ * <dt>cell</dt>
+ * <dd>Cell element being edited</dd>
+ *
+ * <dt>column</dt>
+ * <dd>Associated Column instance</dd>
+ *
+ * <dt>container</dt>
+ * <dd>Reference to editor's container DIV element</dd>
+ *
+ * <dt>isActive</dt>
+ * <dd>True if cell is currently being edited</dd>
+ *
+ * <dt>record</dt>
+ * <dd>Associated Record instance</dd>
+ *
+ * <dt>validator</dt>
+ * <dd>Associated validator function</dd>
+ *
+ * <dt>value</dt>
+ * <dd>Current input value</dd>
+ * </dl>
+ *
+ *
+ *
+ *
+ *
+ *
+ * @method getCellEditor
+ * @return {Object} Cell Editor object literal values.
+ */
+YAHOO.widget.DataTable.prototype.getCellEditor = function() {
+    return this._oCellEditor;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// DOM ACCESSORS
+
+/**
+ * Returns DOM reference to the DataTable's TABLE element.
+ *
+ * @method getTableEl
+ * @return {HTMLElement} Reference to TABLE element.
+ */
+YAHOO.widget.DataTable.prototype.getTableEl = function() {
+    return this._elTable;
+};
+
+/**
+ * Returns DOM reference to the DataTable's THEAD element.
+ *
+ * @method getTheadEl
+ * @return {HTMLElement} Reference to THEAD element.
+ */
+YAHOO.widget.DataTable.prototype.getTheadEl = function() {
+    return this._elThead;
+};
+
+/**
+ * Returns DOM reference to the DataTable's primary TBODY element.
+ *
+ * @method getTbodyEl
+ * @return {HTMLElement} Reference to TBODY element.
+ */
+YAHOO.widget.DataTable.prototype.getTbodyEl = function() {
+    return this._elTbody;
+};
+// Backward compatibility
+YAHOO.widget.DataTable.prototype.getBody = function() {
+    YAHOO.log("The method getBody() has been deprecated" +
+            " in favor of getTbodyEl()", "warn", this.toString());
+    return this.getTbodyEl();
+};
+
+/**
+ * Returns DOM reference to the DataTable's secondary TBODY element that is
+ * used to display messages.
+ *
+ * @method getMsgTbodyEl
+ * @return {HTMLElement} Reference to TBODY element.
+ */
+YAHOO.widget.DataTable.prototype.getMsgTbodyEl = function() {
+    return this._elMsgTbody;
+};
+
+/**
+ * Returns DOM reference to the TD element within the secondary TBODY that is
+ * used to display messages.
+ *
+ * @method getMsgTdEl
+ * @return {HTMLElement} Reference to TD element.
+ */
+YAHOO.widget.DataTable.prototype.getMsgTdEl = function() {
+    return this._elMsgTd;
+};
+
+/**
+ * Returns the corresponding TR reference for a given DOM element, ID string or
+ * directly page row index. If the given identifier is a child of a TR element,
+ * then DOM tree is traversed until a parent TR element is returned, otherwise
+ * null.
+ *
+ * @method getTrEl
+ * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Which row to
+ * get: by element reference, ID string, page row index, or Record.
+ * @return {HTMLElement} Reference to TR element, or null.
+ */
+YAHOO.widget.DataTable.prototype.getTrEl = function(row) {
+    var allRows = this._elTbody.rows;
+    
+    // By Record
+    if(row instanceof YAHOO.widget.Record) {
+        var nTrIndex = this.getTrIndex(row);
+        return allRows[nTrIndex];
+    }
+    // By page row index
+    else if(YAHOO.lang.isNumber(row) && (row > -1) && (row < allRows.length)) {
+        return allRows[row];
+    }
+    // By ID string or element reference
+    else {
+        var elRow;
+        var el = YAHOO.util.Dom.get(row);
+        
+        // Validate HTML element
+        if(el && (el.ownerDocument == document)) {
+            // Validate TR element
+            if(el.tagName.toLowerCase() != "tr") {
+                // Traverse up the DOM to find the corresponding TR element
+                elRow = YAHOO.util.Dom.getAncestorByTagName(el,"tr");
+            }
+            else {
+                elRow = el;
+            }
+
+            // Make sure the TR is in this TBODY
+            if(elRow && (elRow.parentNode == this._elTbody)) {
+                // Now we can return the TR element
+                return elRow;
+            }
+        }
+    }
+    
+    YAHOO.log("Could not get TR element for row " + row, "warn", this.toString());
+    return null;
+};
+// Backward compatibility
+YAHOO.widget.DataTable.prototype.getRow = function(index) {
+    YAHOO.log("The method getRow() has been deprecated" +
+            " in favor of getTrEl()", "warn", this.toString());
+    return this.getTrEl(index);
+};
+
+/**
+ * Returns DOM reference to the first TR element in the DataTable page, or null.
+ *
+ * @method getFirstTrEl
+ * @return {HTMLElement} Reference to TR element.
+ */
+YAHOO.widget.DataTable.prototype.getFirstTrEl = function() {
+    return this._elTbody.rows[0] || null;
+};
+
+/**
+ * Returns DOM reference to the last TR element in the DataTable page, or null.
+ *
+ * @method getLastTrEl
+ * @return {HTMLElement} Reference to last TR element.
+ */
+YAHOO.widget.DataTable.prototype.getLastTrEl = function() {
+    var allRows = this._elTbody.rows;
+        if(allRows.length > 0) {
+            return allRows[allRows.length-1] || null;
+        }
+};
+
+/**
+ * Returns DOM reference to the given TD element.
+ *
+ * @method getTdEl
+ * @param cell {HTMLElement | String} DOM element reference or string ID.
+ * @return {HTMLElement} Reference to TD element.
+ */
+YAHOO.widget.DataTable.prototype.getTdEl = function(cell) {
+    var elCell;
+    var el = YAHOO.util.Dom.get(cell);
+
+    // Validate HTML element
+    if(el && (el.ownerDocument == document)) {
+        // Validate TD element
+        if(el.tagName.toLowerCase() != "td") {
+            // Traverse up the DOM to find the corresponding TR element
+            elCell = YAHOO.util.Dom.getAncestorByTagName(el, "td");
+        }
+        else {
+            elCell = el;
+        }
+
+        // Make sure the TD is in this TBODY
+        if(elCell && (elCell.parentNode.parentNode == this._elTbody)) {
+            // Now we can return the TD element
+            return elCell;
+        }
+    }
+    
+    YAHOO.log("Could not get TD element for cell " + cell, "warn", this.toString());
+    return null;
+};
+
+/**
+ * Returns DOM reference to the TH element at given DataTable page coordinates, or null.
+ *
+ * @method getThEl
+ * @param header {HTMLElement | String | YAHOO.widget.Column} DOM element
+ * reference or string ID, or Column instance.
+ * @return {HTMLElement} Reference to TH element.
+ */
+YAHOO.widget.DataTable.prototype.getThEl = function(header) {
+    var elHeader;
+        
+    // Validate Column instance
+    if(header instanceof YAHOO.widget.Column) {
+        var oColumn = header;
+        elHeader = YAHOO.util.Dom.get(this.id + "-col" + oColumn.getId());
+        if(elHeader) {
+            return elHeader;
+        }
+    }
+    // Validate HTML element
+    else {
+        var el = YAHOO.util.Dom.get(header);
+
+        if(el && (el.ownerDocument == document)) {
+            // Validate TH element
+            if(el.tagName.toLowerCase() != "th") {
+                // Traverse up the DOM to find the corresponding TR element
+                elHeader = YAHOO.util.Dom.getAncestorByTagName(el,"th");
+            }
+            else {
+                elHeader = el;
+            }
+
+            // Make sure the TH is in this THEAD
+            if(elHeader && (elHeader.parentNode.parentNode == this._elThead)) {
+                // Now we can return the TD element
+                return elHeader;
+            }
+        }
+    }
+
+    YAHOO.log("Could not get TH element for header " + header, "warn", this.toString());
+    return null;
+};
+
+/**
+ * Returns the page row index of given row. Returns null if the row is not in
+ * view on the current DataTable page.
+ *
+ * @method getTrIndex
+ * @param row {HTMLElement | String | YAHOO.widget.Record | Number} DOM or ID
+ * string reference to an element within the DataTable page, a Record instance,
+ * or a Record's RecordSet index.
+ * @return {Number} Page row index, or null if row does not exist or is not in view.
+ */
+YAHOO.widget.DataTable.prototype.getTrIndex = function(row) {
+    var nRecordIndex;
+    
+    // By Record
+    if(row instanceof YAHOO.widget.Record) {
+        nRecordIndex = this._oRecordSet.getRecordIndex(row);
+    }
+    // Calculate page row index from Record index
+    else if(YAHOO.lang.isNumber(row)) {
+        nRecordIndex = row;
+    }
+    if(YAHOO.lang.isNumber(nRecordIndex)) {
+        // DataTable is paginated
+        if(this.get("paginated")) {
+            // Get the first and last Record on this page
+            var startRecordIndex = this.get("paginator").startRecordIndex;
+            var endRecordIndex = startRecordIndex + this.get("paginator").rowsPerPage - 1;
+            // This Record is in view
+            if((nRecordIndex >= startRecordIndex) && (nRecordIndex <= endRecordIndex)) {
+                return nRecordIndex - startRecordIndex;
+            }
+            // This Record is not in view
+            else {
+                return null;
+            }
+        }
+        // Not paginated, just return the Record index
+        else {
+            return nRecordIndex;
+        }
+
+    }
+    // By element reference or ID string
+    else {
+        // Validate TR element
+        elRow = this.getTrEl(row);
+        if(elRow && (elRow.ownerDocument == document) &&
+                (elRow.parentNode == this._elTbody)) {
+            return elRow.sectionRowIndex;
+        }
+    }
+    
+    YAHOO.log("Could not get page row index for row " + row, "warn", this.toString());
+    return null;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// TABLE FUNCTIONS
+
+/**
+ * Resets a RecordSet with the given data and populates the page view
+ * with the new data. Any previous data and selection states are cleared.
+ * However, sort states are not cleared, so if the given data is in a particular
+ * sort order, implementers should take care to reset the sortedBy property. If
+ * pagination is enabled, the currentPage is shown and Paginator UI updated,
+ * otherwise all rows are displayed as a single page. For performance, existing
+ * DOM elements are reused when possible.
+ *
+ * @method initializeTable
+ * @param oData {Object | Object[]} An object literal of data or an array of
+ * object literals containing data.
+ */
+YAHOO.widget.DataTable.prototype.initializeTable = function(oData) {
+    // Clear the RecordSet
+    this._oRecordSet.reset();
+
+    // Add data to RecordSet
+    var records = this._oRecordSet.addRecords(oData);
+
+    // Clear selections
+    this._unselectAllTrEls();
+    this._unselectAllTdEls();
+    this._aSelections = null;
+    this._sLastSelectedId = null;
+    this._sSelectionAnchorId = null;
+
+    // Refresh the view
+    this.refreshView();
+    this.fireEvent("initEvent");
+};
+
+/**
+ * Refreshes the view with existing Records from the RecordSet while
+ * maintaining sort, pagination, and selection states. For performance, reuses
+ * existing DOM elements when possible while deleting extraneous elements.
+ *
+ * @method refreshView
+ */
+YAHOO.widget.DataTable.prototype.refreshView = function() {
+    var i, j, k, l, aRecords;
+    var oPaginator = this.updatePaginator();
+
+    // Paginator is enabled, show a subset of Records and update Paginator UI
+    if(this.get("paginated")) {
+        var rowsPerPage = oPaginator.rowsPerPage;
+        var startRecordIndex = (oPaginator.currentPage - 1) * rowsPerPage;
+        aRecords = this._oRecordSet.getRecords(startRecordIndex, rowsPerPage);
+        this.formatPaginators();
+    }
+    // Show all records
+    else {
+        aRecords = this._oRecordSet.getRecords();
+    }
+
+    var elTbody = this._elTbody;
+    var elRows = elTbody.rows;
+
+    // Has rows
+    if(YAHOO.lang.isArray(aRecords) && (aRecords.length > 0)) {
+        this.hideTableMessage();
+
+        // Keep track of selected rows
+        var aSelectedRows = this.getSelectedRows();
+        // Keep track of selected cells
+        var aSelectedCells = this.getSelectedCells();
+        // Anything to reinstate?
+        var bReselect = (aSelectedRows.length>0) || (aSelectedCells.length > 0);
+
+        // Remove extra rows from the bottom so as to preserve ID order
+        while(elTbody.hasChildNodes() && (elRows.length > aRecords.length)) {
+            elTbody.deleteRow(-1);
+        }
+
+        // Unselect all TR and TD elements in the UI
+        if(bReselect) {
+            this._unselectAllTrEls();
+            this._unselectAllTdEls();
+        }
+
+        // From the top, update in-place existing rows
+        for(i=0; i<elRows.length; i++) {
+            this._updateTrEl(elRows[i], aRecords[i]);
+        }
+
+        // Add TR elements as necessary
+        for(i=elRows.length; i<aRecords.length; i++) {
+            this._addTrEl(aRecords[i]);
+        }
+
+        // Reinstate selected and sorted classes
+        var allRows = elTbody.rows;
+        if(bReselect) {
+            // Loop over each row
+            for(j=0; j<allRows.length; j++) {
+                var thisRow = allRows[j];
+                var sMode = this.get("selectionMode");
+                if ((sMode == "standard") || (sMode == "single")) {
+                    // Set SELECTED
+                    for(k=0; k<aSelectedRows.length; k++) {
+                        if(aSelectedRows[k] === thisRow.yuiRecordId) {
+                            YAHOO.util.Dom.addClass(thisRow, YAHOO.widget.DataTable.CLASS_SELECTED);
+                            if(j === allRows.length-1) {
+                                this._sLastSelectedId = thisRow.id;
+                                this._sSelectionAnchorId = thisRow.id;
+                            }
+                        }
+                    }
+                }
+                else {
+                    // Loop over each cell
+                    for(k=0; k<thisRow.cells.length; k++) {
+                        var thisCell = thisRow.cells[k];
+                        // Set SELECTED
+                        for(l=0; l<aSelectedCells.length; l++) {
+                            if((aSelectedCells[l].recordId === thisRow.yuiRecordId) &&
+                                    (aSelectedCells[l].columnId === thisCell.yuiColumnId)) {
+                                YAHOO.util.Dom.addClass(thisCell, YAHOO.widget.DataTable.CLASS_SELECTED);
+                                if(k === thisRow.cells.length-1) {
+                                    this._sLastSelectedId = thisCell.id;
+                                    this._sSelectionAnchorId = thisCell.id;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        
+        // Set FIRST/LAST, EVEN/ODD
+        this._setFirstRow();
+        this._setLastRow();
+        this._setRowStripes();
+
+        this.fireEvent("refreshEvent");
+        YAHOO.log("DataTable showing " + aRecords.length + " of " + this._oRecordSet.getLength() + " rows", "info", this.toString());
+    }
+    // Empty
+    else {
+        // Remove all rows
+        while(elTbody.hasChildNodes()) {
+            elTbody.deleteRow(-1);
+        }
+
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
+    }
+};
+
+/**
+ * Nulls out the entire DataTable instance and related objects, removes attached
+ * event listeners, and clears out DOM elements inside the container. After
+ * calling this method, the instance reference should be expliclitly nulled by
+ * implementer, as in myDataTable = null. Use with caution!
+ *
+ * @method destroy
+ */
+YAHOO.widget.DataTable.prototype.destroy = function() {
+    // Destroy Cell Editor
+    YAHOO.util.Event.purgeElement(this._oCellEditor.container, true);
+    document.body.removeChild(this._oCellEditor.container);
+    
+    var instanceName = this.toString();
+    var elContainer = this._elContainer;
+
+    // Unhook custom events
+    this._oRecordSet.unsubscribeAll();
+    this.unsubscribeAll();
+
+    // Unhook DOM events
+    YAHOO.util.Event.purgeElement(elContainer, true);
+
+    // Remove DOM elements
+    elContainer.innerHTML = "";
+
+    // Null out objects
+    for(var param in this) {
+        if(this.hasOwnProperty(param)) {
+            this[param] = null;
+        }
+    }
+
+    YAHOO.log("DataTable instance destroyed: " + instanceName);
+};
+
+/**
+ * Displays message within secondary TBODY.
+ *
+ * @method showTableMessage
+ * @param sHTML {String} (optional) Value for innerHTML.
+ * @param sClassName {String} (optional) Classname.
+ */
+YAHOO.widget.DataTable.prototype.showTableMessage = function(sHTML, sClassName) {
+    var elCell = this._elMsgTd;
+    if(YAHOO.lang.isString(sHTML)) {
+        elCell.innerHTML = sHTML;
+    }
+    if(YAHOO.lang.isString(sClassName)) {
+        YAHOO.util.Dom.addClass(elCell, sClassName);
+    }
+    this._elMsgTbody.style.display = "";
+    this.fireEvent("tableMsgShowEvent", {html:sHTML, className:sClassName});
+    YAHOO.log("DataTable showing message: " + sHTML, "info", this.toString());
+};
+
+/**
+ * Hides secondary TBODY.
+ *
+ * @method hideTableMessage
+ */
+YAHOO.widget.DataTable.prototype.hideTableMessage = function() {
+    if(this._elMsgTbody.style.display != "none") {
+        this._elMsgTbody.style.display = "none";
+        this.fireEvent("tableMsgHideEvent");
+        YAHOO.log("DataTable message hidden", "info", this.toString());
+    }
+};
+
+/**
+ * Brings focus to DataTable instance.
+ *
+ * @method focus
+ */
+YAHOO.widget.DataTable.prototype.focus = function() {
+    this._focusEl(this._elTable);
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// RECORDSET FUNCTIONS
+
+/**
+ * Returns Record index for given TR element or page row index.
+ *
+ * @method getRecordIndex
+ * @param row {YAHOO.widget.Record | HTMLElement | Number} Record instance, TR
+ * element reference or page row index.
+ * @return {Number} Record's RecordSet index, or null.
+ */
+YAHOO.widget.DataTable.prototype.getRecordIndex = function(row) {
+    var nTrIndex;
+
+    if(!YAHOO.lang.isNumber(row)) {
+        // By Record
+        if(row instanceof YAHOO.widget.Record) {
+            return this._oRecordSet.getRecordIndex(row);
+        }
+        // By element reference
+        else {
+            // Find the TR element
+            var el = this.getTrEl(row);
+            if(el) {
+                nTrIndex = el.sectionRowIndex;
+            }
+        }
+    }
+    // By page row index
+    else {
+        nTrIndex = row;
+    }
+
+    if(YAHOO.lang.isNumber(nTrIndex)) {
+        if(this.get("paginated")) {
+            return this.get("paginator").startRecordIndex + nTrIndex;
+        }
+        else {
+            return nTrIndex;
+        }
+    }
+
+    YAHOO.log("Could not get Record index for row " + row, "warn", this.toString());
+    return null;
+};
+
+/**
+ * For the given identifier, returns the associated Record instance.
+ *
+ * @method getRecord
+ * @param row {HTMLElement | String | Number} RecordSet position index, DOM
+ * reference or ID string to an element within the DataTable page.
+ * @return {YAHOO.widget.Record} Record instance.
+ */
+YAHOO.widget.DataTable.prototype.getRecord = function(row) {
+    var nRecordIndex = row;
+    
+    // By element reference or ID string
+    if(!YAHOO.lang.isNumber(nRecordIndex)) {
+        // Validate TR element
+        var elRow = this.getTrEl(row);
+        if(elRow) {
+            nRecordIndex = this.getRecordIndex(row);
+        }
+    }
+    // By Record index
+    if(YAHOO.lang.isNumber(nRecordIndex)) {
+        return this._oRecordSet.getRecord(nRecordIndex);
+    }
+    
+    YAHOO.log("Could not get Record for row at " + row, "warn", this.toString());
+    return null;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// COLUMN FUNCTIONS
+
+/**
+ * For the given identifier, returns the associated Column instance.
+ *
+ * @method getColumn
+ * @param column {HTMLElement | String | Number} ColumnSet.keys position index, DOM
+ * reference or ID string to an element within the DataTable page.
+ * @return {YAHOO.widget.Column} Column instance.
+ */
+ YAHOO.widget.DataTable.prototype.getColumn = function(column) {
+    var nColumnIndex = column;
+
+    // By element reference or ID string
+    if(!YAHOO.lang.isNumber(nColumnIndex)) {
+        // Validate TD element
+        var elCell = this.getTdEl(column);
+        if(elCell) {
+            nColumnIndex = elCell.yuiColumnId;
+        }
+        // Validate TH element
+        else {
+            elCell = this.getThEl(column);
+            if(elCell) {
+                nColumnIndex = elCell.yuiColumnId;
+            }
+        }
+    }
+    
+    // By Column index
+    if(YAHOO.lang.isNumber(nColumnIndex)) {
+        return this._oColumnSet.getColumn(nColumnIndex);
+    }
+
+    YAHOO.log("Could not get Column for column at " + column, "warn", this.toString());
+    return null;
+ };
+
+/**
+ * Sorts given Column.
+ *
+ * @method sortColumn
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ */
+YAHOO.widget.DataTable.prototype.sortColumn = function(oColumn) {
+    if(!oColumn) {
+        return;
+    }
+    if(!oColumn instanceof YAHOO.widget.Column) {
+        //TODO: accept the TH or TH.key
+        //TODO: Get the column based on TH.yuiColumnId
+        return;
+    }
+    if(oColumn.sortable) {
+        // What is the default sort direction?
+        var sortDir = (oColumn.sortOptions && oColumn.sortOptions.defaultOrder) ? oColumn.sortOptions.defaultOrder : "asc";
+
+        // Already sorted?
+        var oSortedBy = this.get("sortedBy");
+        if(oSortedBy && (oSortedBy.key === oColumn.key)) {
+            if(oSortedBy.dir) {
+                sortDir = (oSortedBy.dir == "asc") ? "desc" : "asc";
+            }
+            else {
+                sortDir = (sortDir == "asc") ? "desc" : "asc";
+            }
+        }
+
+        // Is there a custom sort handler function defined?
+        var sortFnc = (oColumn.sortOptions && YAHOO.lang.isFunction(oColumn.sortOptions.sortFunction)) ?
+                oColumn.sortOptions.sortFunction : function(a, b, desc) {
+                    var sorted = YAHOO.util.Sort.compare(a.getData(oColumn.key),b.getData(oColumn.key), desc);
+                    if(sorted === 0) {
+                        return YAHOO.util.Sort.compare(a.getId(),b.getId(), desc);
+                    }
+                    else {
+                        return sorted;
+                    }
+        };
+
+        // Do the actual sort
+        var desc = (sortDir == "desc") ? true : false;
+        this._oRecordSet.sortRecords(sortFnc, desc);
+
+        // Update sortedBy tracker
+        this.set("sortedBy", {key:oColumn.key, dir:sortDir, column:oColumn});
+        
+        // Reset to first page
+        //TODO: Keep selection in view
+        this.updatePaginator({currentPage:1});
+
+        // Update the UI
+        this.refreshView();
+
+        this.fireEvent("columnSortEvent",{column:oColumn,dir:sortDir});
+        YAHOO.log("Column \"" + oColumn.key + "\" sorted \"" + sortDir + "\"", "info", this.toString());
+    }
+    else {
+        //TODO
+        YAHOO.log("Column is not sortable", "info", this.toString());
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// ROW FUNCTIONS
+
+
+/**
+ * Adds one new Record of data into the RecordSet at the index if given,
+ * otherwise at the end. If the new Record is in page view, the
+ * corresponding DOM elements are also updated.
+ *
+ * @method addRow
+ * @param oData {Object} Object literal of data for the row.
+ * @param index {Number} (optional) RecordSet position index at which to add data.
+ */
+YAHOO.widget.DataTable.prototype.addRow = function(oData, index) {
+    if(oData && (oData.constructor == Object)) {
+        var oRecord = this._oRecordSet.addRecord(oData, index);
+        if(oRecord) {
+            var nTrIndex = this.getTrIndex(oRecord);
+
+            // Row is in view
+            if(YAHOO.lang.isNumber(nTrIndex)) {
+                // Paginated so just refresh the view to keep pagination state
+                if(this.get("paginated")) {
+                    this.refreshView();
+                }
+                // Add the TR element
+                else {
+                    var newTrId = this._addTrEl(oRecord, nTrIndex);
+                    if(newTrId) {
+                        // Is this an insert or an append?
+                        var append = (YAHOO.lang.isNumber(nTrIndex) &&
+                                (nTrIndex == this._elTbody.rows.length-1)) ? true : false;
+
+                        // Stripe the one new row
+                        if(append) {
+                            if((this._elTbody.rows.length-1)%2) {
+                                YAHOO.util.Dom.addClass(newTrId, YAHOO.widget.DataTable.CLASS_ODD);
+                            }
+                            else {
+                                YAHOO.util.Dom.addClass(newTrId, YAHOO.widget.DataTable.CLASS_EVEN);
+                            }
+                        }
+                        // Restripe all the rows after the new one
+                        else {
+                            this._setRowStripes(nTrIndex);
+                        }
+
+                        // If new row is at the bottom
+                        if(append) {
+                            this._setLastRow();
+                        }
+                        // If new row is at the top
+                        else if(YAHOO.lang.isNumber(index) && (nTrIndex === 0)) {
+                            this._setFirstRow();
+                        }
+                    }
+                }
+            }
+            // Record is not in view so just update pagination UI
+            else {
+                this.updatePaginator();
+            }
+
+            // TODO: what args to pass?
+            this.fireEvent("rowAddEvent", {record:oRecord});
+
+            // For log message
+            nTrIndex = (YAHOO.lang.isValue(nTrIndex))? nTrIndex : "n/a";
+
+            YAHOO.log("Added row: Record ID = " + oRecord.getId() +
+                    ", Record index = " + this.getRecordIndex(oRecord) +
+                    ", page row index = " + nTrIndex, "info", this.toString());
+            return;
+        }
+    }
+    YAHOO.log("Could not add row with " + YAHOO.lang.dump(oData), "error", this.toString());
+};
+
+/**
+ * Convenience method to add multiple rows.
+ *
+ * @method addRows
+ * @param aData {Object[]} Array of object literal data for the rows.
+ * @param index {Number} (optional) RecordSet position index at which to add data.
+ */
+YAHOO.widget.DataTable.prototype.addRows = function(aData, index) {
+    if(YAHOO.lang.isArray(aData)) {
+        var i;
+        if(YAHOO.lang.isNumber(index)) {
+            for(i=aData.length-1; i>-1; i--) {
+                this.addRow(aData[i], index);
+            }
+        }
+        else {
+            for(i=0; i<aData.length; i++) {
+                this.addRow(aData[i]);
+            }
+        }
+    }
+    else {
+        YAHOO.log("Could not add rows " + YAHOO.lang.dump(aData));
+    }
+};
+
+/**
+ * For the given row, updates the associated Record with the given data. If the
+ * row is in view, the corresponding DOM elements are also updated.
+ *
+ * @method updateRow
+ * @param row {YAHOO.widget.Record | Number | HTMLElement | String}
+ * Which row to update: By Record instance, by Record's RecordSet
+ * position index, by HTMLElement reference to the TR element, or by ID string
+ * of the TR element.
+ * @param oData {Object} Object literal of data for the row.
+ */
+YAHOO.widget.DataTable.prototype.updateRow = function(row, oData) {
+    var oldRecord, updatedRecord, elRow;
+
+    // Get the Record directly
+    if((row instanceof YAHOO.widget.Record) || (YAHOO.lang.isNumber(row))) {
+            // Get the Record directly
+            oldRecord = this._oRecordSet.getRecord(row);
+            
+            // Is this row in view?
+            elRow = this.getTrEl(oldRecord);
+    }
+    // Get the Record by TR element
+    else {
+        elRow = this.getTrEl(row);
+        if(elRow) {
+            oldRecord = this._oRecordSet.getRecord(this.getRecordIndex(elRow));
+        }
+    }
+
+    // Update the Record
+    if(oldRecord) {
+        // Copy data from the Record for the event that gets fired later
+        var oRecordData = oldRecord.getData();
+        var oldData = {};
+        for(var param in oRecordData) {
+            oldData[param] = oRecordData[param];
+        }
+
+        updatedRecord = this._oRecordSet.updateRecord(oldRecord, oData);
+    }
+    else {
+        YAHOO.log("Could not update row " + row + " with the data : " +
+                YAHOO.lang.dump(oData), "error", this.toString());
+        return;
+
+    }
+    
+    // Update the TR only if row is in view
+    if(elRow) {
+        this._updateTrEl(elRow, updatedRecord);
+    }
+
+    this.fireEvent("rowUpdateEvent", {record:updatedRecord, oldData:oldData});
+    YAHOO.log("DataTable row updated: Record ID = " + updatedRecord.getId() +
+            ", Record index = " + this.getRecordIndex(updatedRecord) +
+            ", page row index = " + this.getTrIndex(updatedRecord), "info", this.toString());
+};
+
+/**
+ * Deletes the given row's Record from the RecordSet. If the row is in view, the
+ * corresponding DOM elements are also deleted.
+ *
+ * @method deleteRow
+ * @param row {HTMLElement | String | Number} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ */
+YAHOO.widget.DataTable.prototype.deleteRow = function(row) {
+    // Get the Record index...
+    var nRecordIndex = null;
+    // ...by Record index
+    if(YAHOO.lang.isNumber(row)) {
+        nRecordIndex = row;
+    }
+    // ...by element reference
+    else {
+        var elRow = YAHOO.util.Dom.get(row);
+        elRow = this.getTrEl(elRow);
+        if(elRow) {
+            nRecordIndex = this.getRecordIndex(elRow);
+        }
+    }
+    if(nRecordIndex !== null) {
+        var oRecord = this._oRecordSet.getRecord(nRecordIndex);
+        if(oRecord) {
+            var nRecordId = oRecord.getId();
+            
+            // Remove from selection tracker if there
+            var tracker = this._aSelections || [];
+            for(var j=0; j<tracker.length; j++) {
+                if((YAHOO.lang.isNumber(tracker[j]) && (tracker[j] === nRecordId)) ||
+                        ((tracker[j].constructor == Object) && (tracker[j].recordId === nRecordId))) {
+                    tracker.splice(j,1);
+                }
+            }
+
+            // Copy data from the Record for the event that gets fired later
+            var oRecordData = oRecord.getData();
+            var oData = {};
+            for(var param in oRecordData) {
+                oData[param] = oRecordData[param];
+            }
+
+            // Delete Record from RecordSet
+            this._oRecordSet.deleteRecord(nRecordIndex);
+
+            // If row is in view, delete the TR element
+            var nTrIndex = this.getTrIndex(nRecordIndex);
+            if(YAHOO.lang.isNumber(nTrIndex)) {
+                var isLast = (nTrIndex == this.getLastTrEl().sectionRowIndex) ?
+                        true : false;
+                this._deleteTrEl(nTrIndex);
+
+                // Empty body
+                if(this._elTbody.rows.length === 0) {
+                    this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
+                }
+                // Update UI
+                else {
+                    // Set FIRST/LAST
+                    if(nTrIndex === 0) {
+                        this._setFirstRow();
+                    }
+                    if(isLast) {
+                        this._setLastRow();
+                    }
+                    // Set EVEN/ODD
+                    if(nTrIndex != this._elTbody.rows.length) {
+                        this._setRowStripes(nTrIndex);
+                    }
+                }
+            }
+
+            this.fireEvent("rowDeleteEvent", {recordIndex:nRecordIndex,
+                    oldData:oData, trElIndex:nTrIndex});
+            YAHOO.log("DataTable row deleted: Record ID = " + nRecordId +
+                    ", Record index = " + nRecordIndex +
+                    ", page row index = " + nTrIndex, "info", this.toString());
+        }
+    }
+    else {
+        YAHOO.log("Could not delete row: " + row, "warn", this.toString());
+    }
+};
+
+/**
+ * Convenience method to delete multiple rows.
+ *
+ * @method deleteRows
+ * @param row {HTMLElement | String | Number} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ * @param count {Number} (optional) How many rows to delete. A negative value
+ * will delete towards the beginning.
+ */
+YAHOO.widget.DataTable.prototype.deleteRows = function(row, count) {
+    // Get the Record index...
+    var nRecordIndex = null;
+    // ...by Record index
+    if(YAHOO.lang.isNumber(row)) {
+        nRecordIndex = row;
+    }
+    // ...by element reference
+    else {
+        var elRow = YAHOO.util.Dom.get(row);
+        elRow = this.getTrEl(elRow);
+        if(elRow) {
+            nRecordIndex = this.getRecordIndex(elRow);
+        }
+    }
+    if(nRecordIndex !== null) {
+        if(count && YAHOO.lang.isNumber(count)) {
+            // Start with highest index and work down
+            var startIndex = (count > 0) ? nRecordIndex + count -1 : nRecordIndex;
+            var endIndex = (count > 0) ? nRecordIndex : nRecordIndex + count + 1;
+            for(var i=startIndex; i>endIndex-1; i--) {
+                this.deleteRow(i);
+            }
+        }
+        else {
+            this.deleteRow(nRecordIndex);
+        }
+    }
+    else {
+        YAHOO.log("Could not delete row " + row, "info", this.toString());
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// CELL FUNCTIONS
+
+/**
+ * Outputs markup into the given TD based on given Record.
+ *
+ * @method formatCell
+ * @param elCell {HTMLElement} TD Element.
+ * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
+ * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
+ * @return {HTML} Markup.
+ */
+YAHOO.widget.DataTable.prototype.formatCell = function(elCell, oRecord, oColumn) {
+    if(!(oRecord instanceof YAHOO.widget.Record)) {
+        oRecord = this.getRecord(elCell);
+    }
+    if(!(oColumn instanceof YAHOO.widget.Column)) {
+        oColumn = this._oColumnSet.getColumn(elCell.yuiColumnId);
+    }
+    
+    if(oRecord && oColumn) {
+        var oData = oRecord.getData(oColumn.key);
+
+        var fnFormatter;
+        if(YAHOO.lang.isString(oColumn.formatter)) {
+            switch(oColumn.formatter) {
+                case "button":
+                    fnFormatter = YAHOO.widget.DataTable.formatButton;
+                    break;
+                case "checkbox":
+                    fnFormatter = YAHOO.widget.DataTable.formatCheckbox;
+                    break;
+                case "currency":
+                    fnFormatter = YAHOO.widget.DataTable.formatCurrency;
+                    break;
+                case "date":
+                    fnFormatter = YAHOO.widget.DataTable.formatDate;
+                    break;
+                case "dropdown":
+                    fnFormatter = YAHOO.widget.DataTable.formatDropdown;
+                    break;
+                case "email":
+                    fnFormatter = YAHOO.widget.DataTable.formatEmail;
+                    break;
+                case "link":
+                    fnFormatter = YAHOO.widget.DataTable.formatLink;
+                    break;
+                case "number":
+                    fnFormatter = YAHOO.widget.DataTable.formatNumber;
+                    break;
+                case "radio":
+                    fnFormatter = YAHOO.widget.DataTable.formatRadio;
+                    break;
+                case "text":
+                    fnFormatter = YAHOO.widget.DataTable.formatText;
+                    break;
+                case "textarea":
+                    fnFormatter = YAHOO.widget.DataTable.formatTextarea;
+                    break;
+                case "textbox":
+                    fnFormatter = YAHOO.widget.DataTable.formatTextbox;
+                    break;
+                case "html":
+                    // This is the default
+                    break;
+                default:
+                    YAHOO.log("Could not find formatter function \"" +
+                            oColumn.formatter + "\"", "warn", this.toString());
+                    fnFormatter = null;
+            }
+        }
+        else if(YAHOO.lang.isFunction(oColumn.formatter)) {
+            fnFormatter = oColumn.formatter;
+        }
+
+        // Apply special formatter
+        if(fnFormatter) {
+            fnFormatter.call(this, elCell, oRecord, oColumn, oData);
+        }
+        else {
+            elCell.innerHTML = (YAHOO.lang.isValue(oData)) ? oData.toString() : "";
+        }
+
+        // Add custom classNames
+        var aCustomClasses = null;
+        if(YAHOO.lang.isString(oColumn.className)) {
+            aCustomClasses = [oColumn.className];
+        }
+        else if(YAHOO.lang.isArray(oColumn.className)) {
+            aCustomClasses = oColumn.className;
+        }
+        if(aCustomClasses) {
+            for(var i=0; i<aCustomClasses.length; i++) {
+                YAHOO.util.Dom.addClass(elCell, aCustomClasses[i]);
+            }
+        }
+        
+        YAHOO.util.Dom.addClass(elCell, "yui-dt-col-"+oColumn.key);
+
+        // Is editable?
+        if(oColumn.editor) {
+            YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_EDITABLE);
+        }
+        
+        this.fireEvent("cellFormatEvent", {record:oRecord, key:oColumn.key, el:elCell});
+    }
+    else {
+        YAHOO.log("Could not format cell " + elCell, "error", this.toString());
+    }
+};
+
+
+/**
+ * Formats a BUTTON element.
+ *
+ * @method DataTable.formatButton
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object | Boolean} Data value for the cell. By default, the value
+ * is what gets written to the BUTTON.
+ * @static
+ */
+YAHOO.widget.DataTable.formatButton= function(el, oRecord, oColumn, oData) {
+    var sValue = YAHOO.lang.isValue(oData) ? oData : "Click";
+    //TODO: support YAHOO.widget.Button
+    //if(YAHOO.widget.Button) {
+    
+    //}
+    //else {
+        el.innerHTML = "<button type=\"button\" class=\""+
+                YAHOO.widget.DataTable.CLASS_BUTTON + "\">" + sValue + "</button>";
+    //}
+};
+
+/**
+ * Formats a CHECKBOX element.
+ *
+ * @method DataTable.formatCheckbox
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object | Boolean} Data value for the cell. Can be a simple
+ * Boolean to indicate whether checkbox is checked or not. Can be object literal
+ * {checked:bBoolean, label:sLabel}. Other forms of oData require a custom
+ * formatter.
+ * @static
+ */
+YAHOO.widget.DataTable.formatCheckbox = function(el, oRecord, oColumn, oData) {
+    var bChecked = oData;
+    bChecked = (bChecked) ? " checked" : "";
+    el.innerHTML = "<input type=\"checkbox\"" + bChecked +
+            " class=\"" + YAHOO.widget.DataTable.CLASS_CHECKBOX + "\">";
+};
+
+/**
+ * Formats currency. Default unit is USD.
+ *
+ * @method DataTable.formatCurrency
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Number} Data value for the cell.
+ * @static
+ */
+YAHOO.widget.DataTable.formatCurrency = function(el, oRecord, oColumn, oData) {
+    if(YAHOO.lang.isNumber(oData)) {
+        var nAmount = oData;
+        var markup;
+
+        // Round to the penny
+        nAmount = Math.round(nAmount*100)/100;
+
+        // Default currency is USD
+        markup = "$"+nAmount;
+
+        // Normalize digits
+        var dotIndex = markup.indexOf(".");
+        if(dotIndex < 0) {
+            markup += ".00";
+        }
+        else {
+            while(dotIndex > markup.length-3) {
+                markup += "0";
+            }
+        }
+        el.innerHTML = markup;
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats JavaScript Dates.
+ *
+ * @method DataTable.formatDate
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} Data value for the cell, or null.
+ * @static
+ */
+YAHOO.widget.DataTable.formatDate = function(el, oRecord, oColumn, oData) {
+    var oDate = oData;
+    if(oDate instanceof Date) {
+        el.innerHTML = (oDate.getMonth()+1) + "/" + oDate.getDate()  + "/" + oDate.getFullYear();
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats SELECT elements.
+ *
+ * @method DataTable.formatDropdown
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} Data value for the cell, or null.
+ * @static
+ */
+YAHOO.widget.DataTable.formatDropdown = function(el, oRecord, oColumn, oData) {
+    var selectedValue = (YAHOO.lang.isValue(oData)) ? oData : oRecord.getData(oColumn.key);
+    var options = (YAHOO.lang.isArray(oColumn.dropdownOptions)) ?
+            oColumn.dropdownOptions : null;
+
+    var selectEl;
+    var collection = el.getElementsByTagName("select");
+    
+    // Create the form element only once, so we can attach the onChange listener
+    if(collection.length === 0) {
+        // Create SELECT element
+        selectEl = document.createElement("select");
+        YAHOO.util.Dom.addClass(selectEl, YAHOO.widget.DataTable.CLASS_DROPDOWN);
+        selectEl = el.appendChild(selectEl);
+
+        // Add event listener
+        //TODO: static method doesn't have access to the datatable instance...
+        YAHOO.util.Event.addListener(selectEl,"change",oDataTable._onDropdownChange,oDataTable);
+    }
+
+    selectEl = collection[0];
+
+    // Update the form element
+    if(selectEl) {
+        // Clear out previous options
+        selectEl.innerHTML = "";
+        
+        // We have options to populate
+        if(options) {
+            // Create OPTION elements
+            for(var i=0; i<options.length; i++) {
+                var option = options[i];
+                var optionEl = document.createElement("option");
+                optionEl.value = (YAHOO.lang.isValue(option.value)) ?
+                        option.value : option;
+                optionEl.innerHTML = (YAHOO.lang.isValue(option.text)) ?
+                        option.text : option;
+                optionEl = selectEl.appendChild(optionEl);
+            }
+        }
+        // Selected value is our only option
+        else {
+            selectEl.innerHTML = "<option value=\"" + selectedValue + "\">" + selectedValue + "</option>";
+        }
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats emails.
+ *
+ * @method DataTable.formatEmail
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} Data value for the cell, or null.
+ * @static
+ */
+YAHOO.widget.DataTable.formatEmail = function(el, oRecord, oColumn, oData) {
+    if(YAHOO.lang.isString(oData)) {
+        el.innerHTML = "<a href=\"mailto:" + oData + "\">" + oData + "</a>";
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats links.
+ *
+ * @method DataTable.formatLink
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} Data value for the cell, or null.
+ * @static
+ */
+YAHOO.widget.DataTable.formatLink = function(el, oRecord, oColumn, oData) {
+    if(YAHOO.lang.isString(oData)) {
+        el.innerHTML = "<a href=\"" + oData + "\">" + oData + "</a>";
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats numbers.
+ *
+ * @method DataTable.formatNumber
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} Data value for the cell, or null.
+ * @static
+ */
+YAHOO.widget.DataTable.formatNumber = function(el, oRecord, oColumn, oData) {
+    if(YAHOO.lang.isNumber(oData)) {
+        el.innerHTML = oData;
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats INPUT TYPE=RADIO elements.
+ *
+ * @method DataTable.formatRadio
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} (Optional) Data value for the cell.
+ * @static
+ */
+YAHOO.widget.DataTable.formatRadio = function(el, oRecord, oColumn, oData) {
+    var bChecked = oData;
+    bChecked = (bChecked) ? " checked" : "";
+    el.innerHTML = "<input type=\"radio\"" + bChecked +
+            " name=\"" + oColumn.getId() + "-radio\"" +
+            " class=\"" + YAHOO.widget.DataTable.CLASS_CHECKBOX + "\">";
+};
+
+/**
+ * Formats text strings.
+ *
+ * @method DataTable.formatText
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} (Optional) Data value for the cell.
+ * @static
+ */
+YAHOO.widget.DataTable.formatText = function(el, oRecord, oColumn, oData) {
+    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
+            oRecord.getData(oColumn.key) : "";
+    //TODO: move to util function
+    el.innerHTML = value.toString().replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");
+};
+
+/**
+ * Formats TEXTAREA elements.
+ *
+ * @method DataTable.formatTextarea
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} (Optional) Data value for the cell.
+ * @static
+ */
+YAHOO.widget.DataTable.formatTextarea = function(el, oRecord, oColumn, oData) {
+    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
+            oRecord.getData(oColumn.key) : "";
+    var markup = "<textarea>" + value + "</textarea>";
+    el.innerHTML = markup;
+};
+
+/**
+ * Formats INPUT TYPE=TEXT elements.
+ *
+ * @method DataTable.formatTextbox
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} (Optional) Data value for the cell.
+ * @static
+ */
+YAHOO.widget.DataTable.formatTextbox = function(el, oRecord, oColumn, oData) {
+    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
+            oRecord.getData(oColumn.key) : "";
+    var markup = "<input type=\"text\" value=\"" + value + "\">";
+    el.innerHTML = markup;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// PAGINATION
+
+/**
+ * Updates Paginator values in response to RecordSet changes and/or DOM events.
+ * Pass in all, a subset, or no values.
+ *
+ * @method updatePaginator
+ * @param oNewValues {Object} (Optional) Object literal of Paginator values, or
+ * a subset of Paginator values.
+ * @param {Object} Object literal of all Paginator values.
+ */
+
+YAHOO.widget.DataTable.prototype.updatePaginator = function(oNewValues) {
+    // Complete the set
+    var oValidPaginator = this.get("paginator");
+    for(var param in oNewValues) {
+        if(oValidPaginator.hasOwnProperty(param)) {
+            oValidPaginator[param] = oNewValues[param];
+        }
+    }
+    
+    oValidPaginator.totalRecords = this._oRecordSet.getLength();
+    oValidPaginator.rowsThisPage = Math.min(oValidPaginator.rowsPerPage, oValidPaginator.totalRecords);
+    oValidPaginator.totalPages = Math.ceil(oValidPaginator.totalRecords / oValidPaginator.rowsThisPage);
+    if(isNaN(oValidPaginator.totalPages)) {
+        oValidPaginator.totalPages = 0;
+    }
+
+    this.set("paginator", oValidPaginator);
+    return this.get("paginator");
+};
+
+/**
+ * Displays given page of a paginated DataTable.
+ *
+ * @method showPage
+ * @param nPage {Number} Which page.
+ */
+YAHOO.widget.DataTable.prototype.showPage = function(nPage) {
+    // Validate input
+    if(!YAHOO.lang.isNumber(nPage) || (nPage < 1) || (nPage > this.get("paginator").totalPages)) {
+        nPage = 1;
+    }
+    this.updatePaginator({currentPage:nPage});
+    this.refreshView();
+};
+
+/**
+ * Updates Paginator containers with markup. Override this method to customize pagination UI.
+ *
+ * @method formatPaginators
+ */
+ YAHOO.widget.DataTable.prototype.formatPaginators = function() {
+    var pag = this.get("paginator");
+
+    // For Opera workaround
+    var dropdownEnabled = false;
+
+    // Links are enabled
+    if(pag.pageLinks > -1) {
+        for(var i=0; i<pag.links.length; i++) {
+            this.formatPaginatorLinks(pag.links[i], pag.currentPage, pag.pageLinksStart, pag.pageLinks, pag.totalPages);
+        }
+    }
+
+    // Dropdown is enabled
+    for(i=0; i<pag.dropdowns.length; i++) {
+         if(pag.dropdownOptions) {
+            dropdownEnabled = true;
+            this.formatPaginatorDropdown(pag.dropdowns[i], pag.dropdownOptions);
+        }
+        else {
+            pag.dropdowns[i].style.display = "none";
+        }
+    }
+
+    // For Opera artifacting in dropdowns
+    if(dropdownEnabled && navigator.userAgent.toLowerCase().indexOf("opera") != -1) {
+        document.body.style += '';
+    }
+    YAHOO.log("Paginators formatted", "info", this.toString());
+};
+
+/**
+ * Updates Paginator dropdown. If dropdown doesn't exist, the markup is created.
+ * Sets dropdown elements's "selected" value.
+ *
+ * @method formatPaginatorDropdown
+ * @param elDropdown {HTMLElement} The SELECT element.
+ * @param dropdownOptions {Object[]} OPTION values for display in the SELECT element.
+ */
+YAHOO.widget.DataTable.prototype.formatPaginatorDropdown = function(elDropdown, dropdownOptions) {
+    if(elDropdown && (elDropdown.ownerDocument == document)) {
+        // Clear OPTION elements
+        while (elDropdown.firstChild) {
+            elDropdown.removeChild(elDropdown.firstChild);
+        }
+
+        // Create OPTION elements
+        for(var j=0; j<dropdownOptions.length; j++) {
+            var dropdownOption = dropdownOptions[j];
+            var optionEl = document.createElement("option");
+            optionEl.value = (YAHOO.lang.isValue(dropdownOption.value)) ?
+                    dropdownOption.value : dropdownOption;
+            optionEl.innerHTML = (YAHOO.lang.isValue(dropdownOption.text)) ?
+                    dropdownOption.text : dropdownOption;
+            optionEl = elDropdown.appendChild(optionEl);
+        }
+
+        var options = elDropdown.options;
+        // Update dropdown's "selected" value
+        if(options.length) {
+            for(var i=options.length-1; i>-1; i--) {
+                if((this.get("paginator").rowsPerPage + "") === options[i].value) {
+                    options[i].selected = true;
+                }
+            }
+        }
+
+        // Show the dropdown
+        elDropdown.style.display = "";
+        return;
+    }
+    YAHOO.log("Could not update Paginator dropdown " + elDropdown, "error", this.toString());
+};
+
+/**
+ * Updates Paginator links container with markup.
+ *
+ * @method formatPaginatorLinks
+ * @param elContainer {HTMLElement} The link container element.
+ * @param nCurrentPage {Number} Current page.
+ * @param nPageLinksStart {Number} First page link to display.
+ * @param nPageLinksLength {Number} How many page links to display.
+ * @param nTotalPages {Number} Total number of pages.
+ */
+YAHOO.widget.DataTable.prototype.formatPaginatorLinks = function(elContainer, nCurrentPage, nPageLinksStart, nPageLinksLength, nTotalPages) {
+    if(elContainer && (elContainer.ownerDocument == document) &&
+            YAHOO.lang.isNumber(nCurrentPage) && YAHOO.lang.isNumber(nPageLinksStart) &&
+            YAHOO.lang.isNumber(nTotalPages)) {
+        // Set up markup for first/last/previous/next
+        var bIsFirstPage = (nCurrentPage == 1) ? true : false;
+        var bIsLastPage = (nCurrentPage == nTotalPages) ? true : false;
+        var sFirstLinkMarkup = (bIsFirstPage) ?
+                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
+                " " + YAHOO.widget.DataTable.CLASS_FIRST + "\">&lt;&lt;</span> " :
+                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_FIRST + "\">&lt;&lt;</a> ";
+        var sPrevLinkMarkup = (bIsFirstPage) ?
+                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
+                " " + YAHOO.widget.DataTable.CLASS_PREVIOUS + "\">&lt;</span> " :
+                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_PREVIOUS + "\">&lt;</a> " ;
+        var sNextLinkMarkup = (bIsLastPage) ?
+                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
+                " " + YAHOO.widget.DataTable.CLASS_NEXT + "\">&gt;</span> " :
+                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_NEXT + "\">&gt;</a> " ;
+        var sLastLinkMarkup = (bIsLastPage) ?
+                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
+                " " + YAHOO.widget.DataTable.CLASS_LAST +  "\">&gt;&gt;</span> " :
+                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_LAST + "\">&gt;&gt;</a> ";
+
+        // Start with first and previous
+        var sMarkup = sFirstLinkMarkup + sPrevLinkMarkup;
+        
+        // Ok to show all links
+        var nMaxLinks = nTotalPages;
+        var nFirstLink = 1;
+        var nLastLink = nTotalPages;
+
+        if(nPageLinksLength > 0) {
+        // Calculate how many links to show
+            nMaxLinks = (nPageLinksStart+nPageLinksLength < nTotalPages) ?
+                    nPageLinksStart+nPageLinksLength-1 : nTotalPages;
+
+            // Try to keep the current page in the middle
+            nFirstLink = (nCurrentPage - Math.floor(nMaxLinks/2) > 0) ? nCurrentPage - Math.floor(nMaxLinks/2) : 1;
+            nLastLink = (nCurrentPage + Math.floor(nMaxLinks/2) <= nTotalPages) ? nCurrentPage + Math.floor(nMaxLinks/2) : nTotalPages;
+
+            // Keep the last link in range
+            if(nFirstLink === 1) {
+                nLastLink = nMaxLinks;
+            }
+            // Keep the first link in range
+            else if(nLastLink === nTotalPages) {
+                nFirstLink = nTotalPages - nMaxLinks + 1;
+            }
+
+            // An even number of links can get funky
+            if(nLastLink - nFirstLink === nMaxLinks) {
+                nLastLink--;
+            }
+      }
+        
+        // Generate markup for each page
+        for(var i=nFirstLink; i<=nLastLink; i++) {
+            if(i != nCurrentPage) {
+                sMarkup += " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_PAGE + "\">" + i + "</a> ";
+            }
+            else {
+                sMarkup += " <span class=\"" + YAHOO.widget.DataTable.CLASS_SELECTED + "\">" + i + "</span>";
+            }
+        }
+        sMarkup += sNextLinkMarkup + sLastLinkMarkup;
+        elContainer.innerHTML = sMarkup;
+        return;
+    }
+    YAHOO.log("Could not format Paginator links", "error", this.toString());
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// SELECTION/HIGHLIGHTING
+
+/**
+ * ID string of last highlighted cell element
+ *
+ * @property _sLastHighlightedCellId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sLastHighlightedCellId = null;
+
+/**
+ * ID string of last highlighted row element
+ *
+ * @property _sLastHighlightedRowId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sLastHighlightedRowId = null;
+
+/**
+ * Array of selections: {recordId:nRecordId, cellIndex:nCellIndex}
+ *
+ * @property _aSelections
+ * @type Object[]
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._aSelections = null;
+
+/**
+ * ID string of last selected element
+ *
+ * @property _sLastSelectedId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sLastSelectedId = null;
+
+/**
+ * ID string of the selection anchor element.
+ *
+ * @property _sSelectionAnchorId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sSelectionAnchorId = null;
+
+/**
+ * Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED
+ * from all TR elements on the page.
+ *
+ * @method _unselectAllTrEls
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._unselectAllTrEls = function() {
+    var selectedRows = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);
+    YAHOO.util.Dom.removeClass(selectedRows, YAHOO.widget.DataTable.CLASS_SELECTED);
+};
+
+/**
+ * Returns array of selected TR elements on the page.
+ *
+ * @method getSelectedTrEls
+ * @return {HTMLElement[]} Array of selected TR elements.
+ */
+YAHOO.widget.DataTable.prototype.getSelectedTrEls = function() {
+    return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);
+};
+
+/**
+ * Sets given row to the selected state.
+ *
+ * @method selectRow
+ * @param row {HTMLElement | String} HTML element reference or ID.
+ */
+YAHOO.widget.DataTable.prototype.selectRow = function(row) {
+    // Validate the row
+    var elRow = this.getTrEl(row);
+    if(elRow) {
+        var oRecord = this.getRecord(elRow);
+        if(oRecord) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var nRecordId = oRecord.getId();
+            // Remove if already there
+
+            // Use Array.indexOf if available...
+            if(tracker.indexOf && (tracker.indexOf(nRecordId) >  -1)) {
+                tracker.splice(tracker.indexOf(nRecordId),1);
+            }
+            // ...or do it the old-fashioned way
+            else {
+                for(var j=0; j<tracker.length; j++) {
+                   if(tracker[j] === nRecordId){
+                        tracker.splice(j,1);
+                    }
+                }
+            }
+            // Add to the end
+            tracker.push(nRecordId);
+
+            // Update trackers
+            this._sLastSelectedId = elRow.id;
+            if(!this._sSelectionAnchorId) {
+                this._sSelectionAnchorId = elRow.id;
+            }
+            this._aSelections = tracker;
+        
+            // Update UI
+            YAHOO.util.Dom.addClass(elRow, YAHOO.widget.DataTable.CLASS_SELECTED);
+
+            this.fireEvent("rowSelectEvent", {record:oRecord, el:elRow});
+            YAHOO.log("Selected " + elRow, "info", this.toString());
+
+            return;
+        }
+    }
+    YAHOO.log("Could not select " + row, "warn", this.toString());
+};
+// Backward compatibility
+YAHOO.widget.DataTable.prototype.select = function(els) {
+    YAHOO.log("The method select() has been deprecated" +
+            " in favor of selectRow()", "warn", this.toString());
+    if(!YAHOO.lang.isArray(els)) {
+        els = [els];
+    }
+    for(var i=0; i<els.length; i++) {
+        this.selectRow(els[i]);
+    }
+};
+
+/**
+ * Sets given row to the unselected state.
+ *
+ * @method unselectRow
+ * @param row {HTMLElement | String} HTML TR element reference or ID.
+ */
+YAHOO.widget.DataTable.prototype.unselectRow = function(row) {
+    // Validate the row
+    var elRow = this.getTrEl(row);
+    if(elRow) {
+        var oRecord = this.getRecord(elRow);
+        if(oRecord) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var nRecordId = oRecord.getId();
+
+            // Remove if there
+            var bFound = false;
+            
+            // Use Array.indexOf if available...
+            if(tracker.indexOf && (tracker.indexOf(nRecordId) >  -1)) {
+                tracker.splice(tracker.indexOf(nRecordId),1);
+                bFound = true;
+            }
+            // ...or do it the old-fashioned way
+            else {
+                for(var j=0; j<tracker.length; j++) {
+                   if(tracker[j] === nRecordId){
+                        tracker.splice(j,1);
+                        bFound = true;
+                    }
+                }
+            }
+
+            if(bFound) {
+                // Update tracker
+                this._aSelections = tracker;
+
+                // Update the UI
+                YAHOO.util.Dom.removeClass(elRow, YAHOO.widget.DataTable.CLASS_SELECTED);
+
+                this.fireEvent("rowUnselectEvent", {record:oRecord, el:elRow});
+                YAHOO.log("Unselected " + elRow, "info", this.toString());
+
+                return;
+            }
+        }
+    }
+    YAHOO.log("Could not unselect row " + row, "warn", this.toString());
+};
+
+/**
+ * Clears out all row selections.
+ *
+ * @method unselectAllRows
+ */
+YAHOO.widget.DataTable.prototype.unselectAllRows = function() {
+    // Remove from tracker
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(YAHOO.lang.isNumber(tracker[j])){
+            tracker.splice(j,1);
+        }
+    }
+
+    // Update tracker
+    this._aSelections = tracker;
+
+    // Update UI
+    this._unselectAllTrEls();
+
+    //TODO: send an array of [{el:el,record:record}]
+    //TODO: or convert this to an unselectRows method
+    //TODO: that takes an array of rows or unselects all if none given
+    this.fireEvent("unselectAllRowsEvent");
+    YAHOO.log("Unselected all rows", "info", this.toString());
+};
+
+/**
+ * Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED
+ * from all TD elements in the internal tracker.
+ *
+ * @method _unselectAllTdEls
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._unselectAllTdEls = function() {
+    var selectedCells = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);
+    YAHOO.util.Dom.removeClass(selectedCells, YAHOO.widget.DataTable.CLASS_SELECTED);
+};
+
+/**
+ * Returns array of selected TD elements on the page.
+ *
+ * @method getSelectedTdEls
+ * @return {HTMLElement[]} Array of selected TD elements.
+ */
+YAHOO.widget.DataTable.prototype.getSelectedTdEls = function() {
+    return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);
+};
+
+/**
+ * Sets given cell to the selected state.
+ *
+ * @method selectCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ */
+YAHOO.widget.DataTable.prototype.selectCell = function(cell) {
+    var elCell = this.getTdEl(cell);
+    
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        var nColumnId = elCell.yuiColumnId;
+
+        if(oRecord && YAHOO.lang.isNumber(nColumnId)) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var nRecordId = oRecord.getId();
+
+            // Remove if there
+            for(var j=0; j<tracker.length; j++) {
+               if((tracker[j].recordId === nRecordId) && (tracker[j].columnId === nColumnId)){
+                    tracker.splice(j,1);
+                }
+            }
+
+            // Add to the end
+            tracker.push({recordId:nRecordId, columnId:nColumnId});
+
+            // Update trackers
+            this._aSelections = tracker;
+            this._sLastSelectedId = elCell.id;
+            if(!this._sSelectionAnchorId) {
+                this._sSelectionAnchorId = elCell.id;
+            }
+
+            // Update the UI
+            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_SELECTED);
+
+            this.fireEvent("cellSelectEvent", {record:oRecord,
+                    key: this._oColumnSet.getColumn(nColumnId).key, el:elCell});
+            YAHOO.log("Selected " + elCell, "info", this.toString());
+            return;
+        }
+    }
+    YAHOO.log("Could not select " + cell, "warn", this.toString());
+};
+
+/**
+ * Sets given cell to the unselected state.
+ *
+ * @method unselectCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ */
+YAHOO.widget.DataTable.prototype.unselectCell = function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        var nColumnId = elCell.yuiColumnId;
+
+        if(oRecord && YAHOO.lang.isNumber(nColumnId)) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var id = oRecord.getId();
+
+            // Is it selected?
+            for(var j=0; j<tracker.length; j++) {
+                if((tracker[j].recordId === id) && (tracker[j].columnId === nColumnId)){
+                    // Remove from tracker
+                    tracker.splice(j,1);
+                    
+                    // Update tracker
+                    this._aSelections = tracker;
+
+                    // Update the UI
+                    YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_SELECTED);
+
+                    this.fireEvent("cellUnselectEvent", {record:oRecord,
+                            key:this._oColumnSet.getColumn(nColumnId).key, el:elCell});
+                    YAHOO.log("Unselected " + elCell, "info", this.toString());
+
+                    return;
+                }
+            }
+        }
+    }
+    YAHOO.log("Could not unselect " + cell, "warn", this.toString());
+};
+
+/**
+ * Clears out all cell selections.
+ *
+ * @method unselectAllCells
+ */
+YAHOO.widget.DataTable.prototype.unselectAllCells= function() {
+    // Remove from tracker
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(tracker[j].constructor == Object){
+            tracker.splice(j,1);
+        }
+    }
+
+    // Update tracker
+    this._aSelections = tracker;
+
+    // Update UI
+    this._unselectAllTdEls();
+    
+    //TODO: send data
+    //TODO: or fire individual cellUnselectEvent
+    this.fireEvent("unselectAllCellsEvent");
+    YAHOO.log("Unselected all cells", "info", this.toString());
+};
+
+/**
+ * Returns true if given TR or TD element is select, false otherwise.
+ *
+ * @method isSelected
+ * @param el {HTMLElement} HTML element reference or ID of a TR or TD.
+ * @return {Boolean} True if element is selected.
+ */
+YAHOO.widget.DataTable.prototype.isSelected = function(el) {
+    return YAHOO.util.Dom.hasClass(el,YAHOO.widget.DataTable.CLASS_SELECTED);
+};
+
+/**
+ * Returns selected rows as an array of Record IDs.
+ *
+ * @method getSelectedRows
+ * @return {HTMLElement[]} Array of selected rows by Record ID.
+ */
+YAHOO.widget.DataTable.prototype.getSelectedRows = function() {
+    var aSelectedRows = [];
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(YAHOO.lang.isNumber(tracker[j])){
+            aSelectedRows.push(tracker[j]);
+        }
+    }
+    return aSelectedRows;
+};
+
+/**
+ * Returns selected cells as an array of object literals:
+ *     {recordId:nRecordID, columnId:nColumnId}.
+ *
+ * @method getSelectedCells
+ * @return {HTMLElement[]} Array of selected cells by Record and Column IDs.
+ */
+YAHOO.widget.DataTable.prototype.getSelectedCells = function() {
+    var aSelectedCells = [];
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(tracker[j] && (tracker[j].constructor == Object)){
+            aSelectedCells.push({recordId:tracker[j].recordId, columnId:tracker[j].columnId});
+        }
+    }
+    return aSelectedCells;
+};
+
+/**
+ * Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given row.
+ *
+ * @method highlightRow
+ * @param row {HTMLElement | String} DOM element reference or ID string.
+ */
+YAHOO.widget.DataTable.prototype.highlightRow = function(row) {
+    var elRow = this.getTrEl(row);
+
+    if(elRow) {
+        // Make sure previous row is unhighlighted
+        if(this._sLastHighlightedRowId) {
+            YAHOO.util.Dom.removeClass(this._sLastHighlightedRowId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        }
+        var oRecord = this.getRecord(elRow);
+        YAHOO.util.Dom.addClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        this._sLastHighlightedRowId = elRow.id;
+        this.fireEvent("rowHighlightEvent", {record:oRecord, el:elRow});
+        YAHOO.log("Highlighted " + elRow, "info", this.toString());
+        return;
+    }
+    YAHOO.log("Could not highlight " + row, "warn", this.toString());
+};
+
+/**
+ * Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED from the given row.
+ *
+ * @method unhighlightRow
+ * @param row {HTMLElement | String} DOM element reference or ID string.
+ */
+YAHOO.widget.DataTable.prototype.unhighlightRow = function(row) {
+    var elRow = this.getTrEl(row);
+
+    if(elRow) {
+        var oRecord = this.getRecord(elRow);
+        YAHOO.util.Dom.removeClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        this.fireEvent("rowUnhighlightEvent", {record:oRecord, el:elRow});
+        YAHOO.log("Unhighlighted " + elRow, "info", this.toString());
+        return;
+    }
+    YAHOO.log("Could not unhighlight " + row, "warn", this.toString());
+};
+
+/**
+ * Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given cell.
+ *
+ * @method highlightCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string.
+ */
+YAHOO.widget.DataTable.prototype.highlightCell = function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        // Make sure previous cell is unhighlighted
+        if(this._sLastHighlightedCellId) {
+            YAHOO.util.Dom.removeClass(this._sLastHighlightedCellId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        }
+        
+        var oRecord = this.getRecord(elCell);
+        YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        this._sLastHighlightedCellId = elCell.id;
+        this.fireEvent("cellHighlightEvent", {record:oRecord,
+                    key:this._oColumnSet.getColumn(elCell.yuiColumnId).key, el:elCell});
+        YAHOO.log("Highlighted " + elCell, "info", this.toString());
+        return;
+    }
+    YAHOO.log("Could not highlight " + cell, "warn", this.toString());
+};
+
+/**
+ * Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED from the given cell.
+ *
+ * @method unhighlightCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string.
+ */
+YAHOO.widget.DataTable.prototype.unhighlightCell = function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        this.fireEvent("cellUnhighlightEvent", {record:oRecord,
+                    key:this._oColumnSet.getColumn(elCell.yuiColumnId).key, el:elCell});
+        YAHOO.log("Unhighlighted " + elCell, "info", this.toString());
+        return;
+    }
+    YAHOO.log("Could not unhighlight " + cell, "warn", this.toString());
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// INLINE EDITING
+
+/*TODO: for TAB handling
+ * Shows Cell Editor for next cell.
+ *
+ * @method editNextCell
+ * @param elCell {HTMLElement} Cell element from which to edit next cell.
+ */
+//YAHOO.widget.DataTable.prototype.editNextCell = function(elCell) {
+//};
+
+/**
+ * Shows Cell Editor for given cell.
+ *
+ * @method showCellEditor
+ * @param elCell {HTMLElement | String} Cell element to edit.
+ * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
+ * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
+ */
+YAHOO.widget.DataTable.prototype.showCellEditor = function(elCell, oRecord, oColumn) {
+    elCell = YAHOO.util.Dom.get(elCell);
+    
+    if(elCell && (elCell.ownerDocument === document)) {
+        if(!oRecord || !(oRecord instanceof YAHOO.widget.Record)) {
+            oRecord = this.getRecord(elCell);
+        }
+        if(!oColumn || !(oColumn instanceof YAHOO.widget.Column)) {
+            oColumn = this.getColumn(elCell);
+        }
+        if(oRecord && oColumn) {
+            var oCellEditor = this._oCellEditor;
+            
+            // Clear previous Editor
+            if(oCellEditor.isActive) {
+                this.cancelCellEditor();
+            }
+
+            // Editor not defined
+            if(!oColumn.editor) {
+                return;
+            }
+            
+            // Update Editor values
+            oCellEditor.cell = elCell;
+            oCellEditor.record = oRecord;
+            oCellEditor.column = oColumn;
+            oCellEditor.validator = (oColumn.editorOptions &&
+                    YAHOO.lang.isFunction(oColumn.editorOptions.validator)) ?
+                    oColumn.editorOptions.validator : null;
+            oCellEditor.value = oRecord.getData(oColumn.key);
+
+            // Move Editor
+            var elContainer = oCellEditor.container;
+            var x = YAHOO.util.Dom.getX(elCell);
+            var y = YAHOO.util.Dom.getY(elCell);
+
+            // SF doesn't get xy for cells in scrolling table
+            // when tbody display is set to block
+            if(isNaN(x) || isNaN(y)) {
+                x = elCell.offsetLeft + // cell pos relative to table
+                        YAHOO.util.Dom.getX(this._elTable) - // plus table pos relative to document
+                        this._elTbody.scrollLeft; // minus tbody scroll
+                y = elCell.offsetTop + // cell pos relative to table
+                        YAHOO.util.Dom.getY(this._elTable) - // plus table pos relative to document
+                        this._elTbody.scrollTop + // minus tbody scroll
+                        this._elThead.offsetHeight; // account for fixed headers
+            }
+            
+            elContainer.style.left = x + "px";
+            elContainer.style.top = y + "px";
+
+            // Show Editor
+            elContainer.style.display = "";
+            
+            // Render Editor markup
+            var fnEditor;
+            if(YAHOO.lang.isString(oColumn.editor)) {
+                switch(oColumn.editor) {
+                    case "checkbox":
+                        fnEditor = YAHOO.widget.DataTable.editCheckbox;
+                        break;
+                    case "date":
+                        fnEditor = YAHOO.widget.DataTable.editDate;
+                        break;
+                    case "dropdown":
+                        fnEditor = YAHOO.widget.DataTable.editDropdown;
+                        break;
+                    case "radio":
+                        fnEditor = YAHOO.widget.DataTable.editRadio;
+                        break;
+                    case "textarea":
+                        fnEditor = YAHOO.widget.DataTable.editTextarea;
+                        break;
+                    case "textbox":
+                        fnEditor = YAHOO.widget.DataTable.editTextbox;
+                        break;
+                    default:
+                        fnEditor = null;
+                }
+            }
+            else if(YAHOO.lang.isFunction(oColumn.editor)) {
+                fnEditor = oColumn.editor;
+            }
+
+            if(fnEditor) {
+                // Create DOM input elements
+                fnEditor(this._oCellEditor, this);
+                
+                // Show Save/Cancel buttons
+                if(!oColumn.editorOptions || !oColumn.editorOptions.disableBtns) {
+                    this.showCellEditorBtns(elContainer);
+                }
+
+                // Hook to customize the UI
+                this.doBeforeShowCellEditor(this._oCellEditor);
+
+                oCellEditor.isActive = true;
+                
+                //TODO: verify which args to pass
+                this.fireEvent("editorShowEvent", {editor:oCellEditor});
+                YAHOO.log("Cell Editor shown for " + elCell, "info", this.toString());
+                return;
+            }
+        }
+    }
+    YAHOO.log("Could not show Cell Editor for " + elCell, "warn", this.toString());
+};
+
+/**
+ * Overridable abstract method to customize Cell Editor UI.
+ *
+ * @method doBeforeShowCellEditor
+ * @param oCellEditor {Object} Cell Editor object literal.
+ */
+YAHOO.widget.DataTable.prototype.doBeforeShowCellEditor = function(oCellEditor) {
+};
+
+/**
+ * Adds Save/Cancel buttons to Cell Editor.
+ *
+ * @method showCellEditorBtns
+ * @param elContainer {HTMLElement} Cell Editor container.
+ */
+YAHOO.widget.DataTable.prototype.showCellEditorBtns = function(elContainer) {
+    // Buttons
+    var elBtnsDiv = elContainer.appendChild(document.createElement("div"));
+    YAHOO.util.Dom.addClass(elBtnsDiv, YAHOO.widget.DataTable.CLASS_BUTTON);
+
+    // Save button
+    var elSaveBtn = elBtnsDiv.appendChild(document.createElement("button"));
+    YAHOO.util.Dom.addClass(elSaveBtn, YAHOO.widget.DataTable.CLASS_DEFAULT);
+    elSaveBtn.innerHTML = "OK";
+    YAHOO.util.Event.addListener(elSaveBtn, "click", this.saveCellEditor, this, true);
+
+    // Cancel button
+    var elCancelBtn = elBtnsDiv.appendChild(document.createElement("button"));
+    elCancelBtn.innerHTML = "Cancel";
+    YAHOO.util.Event.addListener(elCancelBtn, "click", this.cancelCellEditor, this, true);
+};
+
+/**
+ * Clears Cell Editor of all state and UI.
+ *
+ * @method resetCellEditor
+ */
+
+YAHOO.widget.DataTable.prototype.resetCellEditor = function() {
+    var elContainer = this._oCellEditor.container;
+    elContainer.style.display = "none";
+    YAHOO.util.Event.purgeElement(elContainer, true);
+    elContainer.innerHTML = "";
+    this._oCellEditor.value = null;
+    this._oCellEditor.isActive = false;
+};
+
+/**
+ * Saves Cell Editor input to Record.
+ *
+ * @method saveCellEditor
+ */
+YAHOO.widget.DataTable.prototype.saveCellEditor = function() {
+    //TODO: Copy the editor's values to pass to the event
+    if(this._oCellEditor.isActive) {
+        var newData = this._oCellEditor.value;
+        var oldData = this._oCellEditor.record.getData(this._oCellEditor.column.key);
+
+        // Validate input data
+        if(this._oCellEditor.validator) {
+            this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData);
+            if(this._oCellEditor.value === null ) {
+                this.resetCellEditor();
+                this.fireEvent("editorRevertEvent",
+                        {editor:this._oCellEditor, oldData:oldData, newData:newData});
+                YAHOO.log("Could not save Cell Editor input due to invalid data " +
+                        YAHOO.lang.dump(newData), "warn", this.toString());
+                return;
+            }
+        }
+
+        // Update the Record
+        this._oRecordSet.updateKey(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);
+
+        // Update the UI
+        this.formatCell(this._oCellEditor.cell);
+
+        // Clear out the Cell Editor
+        this.resetCellEditor();
+
+        this.fireEvent("editorSaveEvent",
+                {editor:this._oCellEditor, oldData:oldData, newData:newData});
+        YAHOO.log("Cell Editor input saved", "info", this.toString());
+    }
+    else {
+        YAHOO.log("Cell Editor not active to save input", "warn", this.toString());
+    }
+};
+
+/**
+ * Cancels Cell Editor.
+ *
+ * @method cancelCellEditor
+ */
+YAHOO.widget.DataTable.prototype.cancelCellEditor = function() {
+    if(this._oCellEditor.isActive) {
+        this.resetCellEditor();
+        //TODO: preserve values for the event?
+        this.fireEvent("editorCancelEvent", {editor:this._oCellEditor});
+        YAHOO.log("Cell Editor input canceled", "info", this.toString());
+    }
+    else {
+        YAHOO.log("Cell Editor not active to cancel input", "warn", this.toString());
+    }
+};
+
+/**
+ * Enables CHECKBOX Editor.
+ *
+ * @method editCheckbox
+ */
+//YAHOO.widget.DataTable.editCheckbox = function(elContainer, oRecord, oColumn, oEditor, oSelf) {
+YAHOO.widget.DataTable.editCheckbox = function(oEditor, oSelf) {
+    var elCell = oEditor.cell;
+    var oRecord = oEditor.record;
+    var oColumn = oEditor.column;
+    var elContainer = oEditor.container;
+    var aCheckedValues = oRecord.getData(oColumn.key);
+    if(!YAHOO.lang.isArray(aCheckedValues)) {
+        aCheckedValues = [aCheckedValues];
+    }
+
+    // Checkboxes
+    if(oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.checkboxOptions)) {
+        var checkboxOptions = oColumn.editorOptions.checkboxOptions;
+        var checkboxValue, checkboxId, elLabel, j, k;
+        // First create the checkbox buttons in an IE-friendly way
+        for(j=0; j<checkboxOptions.length; j++) {
+            checkboxValue = YAHOO.lang.isValue(checkboxOptions[j].label) ?
+                    checkboxOptions[j].label : checkboxOptions[j];
+            checkboxId =  oSelf.id + "-editor-checkbox" + j;
+            elContainer.innerHTML += "<input type=\"checkbox\"" +
+                    " name=\"" + oSelf.id + "-editor-checkbox\"" +
+                    " value=\"" + checkboxValue + "\"" +
+                    " id=\"" +  checkboxId + "\">";
+            // Then create the labels in an IE-friendly way
+            elLabel = elContainer.appendChild(document.createElement("label"));
+            elLabel.htmlFor = checkboxId;
+            elLabel.innerHTML = checkboxValue;
+        }
+        var aCheckboxEls = [];
+        var checkboxEl;
+        // Loop through checkboxes to check them
+        for(j=0; j<checkboxOptions.length; j++) {
+            checkboxEl = YAHOO.util.Dom.get(oSelf.id + "-editor-checkbox" + j);
+            aCheckboxEls.push(checkboxEl);
+            for(k=0; k<aCheckedValues.length; k++) {
+                if(checkboxEl.value === aCheckedValues[k]) {
+                    checkboxEl.checked = true;
+                }
+            }
+            // Focus the first checkbox
+            if(j===0) {
+                oSelf._focusEl(checkboxEl);
+            }
+        }
+        // Loop through checkboxes to assign click handlers
+        for(j=0; j<checkboxOptions.length; j++) {
+            checkboxEl = YAHOO.util.Dom.get(oSelf.id + "-editor-checkbox" + j);
+            YAHOO.util.Event.addListener(checkboxEl, "click", function(){
+                var aNewValues = [];
+                for(var m=0; m<aCheckboxEls.length; m++) {
+                    if(aCheckboxEls[m].checked) {
+                        aNewValues.push(aCheckboxEls[m].value);
+                    }
+                }
+                oSelf._oCellEditor.value = aNewValues;
+                oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+            });
+        }
+    }
+};
+
+/**
+ * Enables Date Editor.
+ *
+ * @method editDate
+ */
+YAHOO.widget.DataTable.editDate = function(oEditor, oSelf) {
+    var elCell = oEditor.cell;
+    var oRecord = oEditor.record;
+    var oColumn = oEditor.column;
+    var elContainer = oEditor.container;
+    var value = oRecord.getData(oColumn.key);
+
+    // Calendar widget
+    if(YAHOO.widget.Calendar) {
+        var selectedValue = (value.getMonth()+1)+"/"+value.getDate()+"/"+value.getFullYear();
+        var calContainer = elContainer.appendChild(document.createElement("div"));
+        calContainer.id = "yui-dt-" + oSelf._nIndex + "-col" + oColumn.getKeyIndex() + "-dateContainer";
+        var calendar =
+                new YAHOO.widget.Calendar("yui-dt-" + oSelf._nIndex + "-col" + oColumn.getKeyIndex() + "-date",
+                calContainer.id,
+                {selected:selectedValue, pagedate:value});
+        calendar.render();
+        calContainer.style.cssFloat = "none";
+
+        //var calFloatClearer = elContainer.appendChild(document.createElement("br"));
+        //calFloatClearer.style.clear = "both";
+        
+        calendar.selectEvent.subscribe(function(type, args, obj) {
+            oSelf._oCellEditor.value = new Date(args[0][0][0], args[0][0][1]-1, args[0][0][2]);
+        });
+        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+    }
+    else {
+        //TODO;
+    }
+};
+
+/**
+ * Enables SELECT Editor.
+ *
+ * @method editDropdown
+ */
+YAHOO.widget.DataTable.editDropdown = function(oEditor, oSelf) {
+    var elCell = oEditor.cell;
+    var oRecord = oEditor.record;
+    var oColumn = oEditor.column;
+    var elContainer = oEditor.container;
+    var value = oRecord.getData(oColumn.key);
+
+    // Textbox
+    var elDropdown = elContainer.appendChild(document.createElement("select"));
+    var dropdownOptions = (oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.dropdownOptions)) ?
+            oColumn.editorOptions.dropdownOptions : [];
+    for(var j=0; j<dropdownOptions.length; j++) {
+        var dropdownOption = dropdownOptions[j];
+        var elOption = document.createElement("option");
+        elOption.value = (YAHOO.lang.isValue(dropdownOption.value)) ?
+                dropdownOption.value : dropdownOption;
+        elOption.innerHTML = (YAHOO.lang.isValue(dropdownOption.text)) ?
+                dropdownOption.text : dropdownOption;
+        elOption = elDropdown.appendChild(elOption);
+        if(value === elDropdown.options[j].value) {
+            elDropdown.options[j].selected = true;
+        }
+    }
+    
+    // Set up a listener on each check box to track the input value
+    YAHOO.util.Event.addListener(elDropdown, "change",
+        function(){
+            oSelf._oCellEditor.value = elDropdown[elDropdown.selectedIndex].value;
+            oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+    });
+            
+    // Focus the dropdown
+    oSelf._focusEl(elDropdown);
+};
+
+/**
+ * Enables INPUT TYPE=RADIO Editor.
+ *
+ * @method editRadio
+ */
+YAHOO.widget.DataTable.editRadio = function(oEditor, oSelf) {
+    var elCell = oEditor.cell;
+    var oRecord = oEditor.record;
+    var oColumn = oEditor.column;
+    var elContainer = oEditor.container;
+    var value = oRecord.getData(oColumn.key);
+
+    // Radios
+    if(oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.radioOptions)) {
+        var radioOptions = oColumn.editorOptions.radioOptions;
+        var radioValue, radioId, elLabel, j;
+        // First create the radio buttons in an IE-friendly way
+        for(j=0; j<radioOptions.length; j++) {
+            radioValue = YAHOO.lang.isValue(radioOptions[j].label) ?
+                    radioOptions[j].label : radioOptions[j];
+            radioId =  oSelf.id + "-editor-radio" + j;
+            elContainer.innerHTML += "<input type=\"radio\"" +
+                    " name=\"" + oSelf.id + "-editor-radio\"" +
+                    " value=\"" + radioValue + "\"" +
+                    " id=\"" +  radioId + "\">";
+            // Then create the labels in an IE-friendly way
+            elLabel = elContainer.appendChild(document.createElement("label"));
+            elLabel.htmlFor = radioId;
+            elLabel.innerHTML = radioValue;
+        }
+        // Then check one, and assign click handlers
+        for(j=0; j<radioOptions.length; j++) {
+            var radioEl = YAHOO.util.Dom.get(oSelf.id + "-editor-radio" + j);
+            if(value === radioEl.value) {
+                radioEl.checked = true;
+                oSelf._focusEl(radioEl);
+            }
+            YAHOO.util.Event.addListener(radioEl, "click",
+                function(){
+                    oSelf._oCellEditor.value = this.value;
+                    oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+            });
+        }
+    }
+};
+
+/**
+ * Enables TEXTAREA Editor.
+ *
+ * @method editTextarea
+ */
+YAHOO.widget.DataTable.editTextarea = function(oEditor, oSelf) {
+   var elCell = oEditor.cell;
+   var oRecord = oEditor.record;
+   var oColumn = oEditor.column;
+   var elContainer = oEditor.container;
+   var value = oRecord.getData(oColumn.key);
+
+    // Textarea
+    var elTextarea = elContainer.appendChild(document.createElement("textarea"));
+    elTextarea.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
+    elTextarea.style.height = "3em"; //(parseInt(elCell.offsetHeight,10)) + "px";
+    elTextarea.value = YAHOO.lang.isValue(value) ? value : "";
+    
+    // Set up a listener on each check box to track the input value
+    YAHOO.util.Event.addListener(elTextarea, "keyup", function(){
+        //TODO: set on a timeout
+        oSelf._oCellEditor.value = elTextarea.value;
+        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+    });
+    
+    // Select the text
+    elTextarea.focus();
+    elTextarea.select();
+};
+
+/**
+ * Enables INPUT TYPE=TEXT Editor.
+ *
+ * @method editTextbox
+ */
+YAHOO.widget.DataTable.editTextbox = function(oEditor, oSelf) {
+   var elCell = oEditor.cell;
+   var oRecord = oEditor.record;
+   var oColumn = oEditor.column;
+   var elContainer = oEditor.container;
+   var value = YAHOO.lang.isValue(oRecord.getData(oColumn.key)) ? oRecord.getData(oColumn.key) : "";
+
+    // Textbox
+    var elTextbox = elContainer.appendChild(document.createElement("input"));
+    elTextbox.type = "text";
+    elTextbox.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
+    //elTextbox.style.height = "1em"; //(parseInt(elCell.offsetHeight,10)) + "px";
+    elTextbox.value = value;
+
+    // Set up a listener on each textbox to track the input value
+    YAHOO.util.Event.addListener(elTextbox, "keyup", function(){
+        //TODO: set on a timeout
+        oSelf._oCellEditor.value = elTextbox.value;
+        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+    });
+
+    // Select the text
+    elTextbox.focus();
+    elTextbox.select();
+};
+
+/*
+ * Validates Editor input value to type Number, doing type conversion as
+ * necessary. A valid Number value is return, else the previous value is returned
+ * if input value does not validate.
+ * 
+ *
+ * @method validateNumber
+ * @static
+*/
+YAHOO.widget.DataTable.validateNumber = function(oData) {
+    //Convert to number
+    var number = oData * 1;
+
+    // Validate
+    if(YAHOO.lang.isNumber(number)) {
+        return number;
+    }
+    else {
+        YAHOO.log("Could not validate data " + YAHOO.lang.dump(oData) + " to type Number", "warn", this.toString());
+        return null;
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// ABSTRACT METHODS
+
+/**
+ * Overridable method gives implementers a hook to access data before
+ * it gets added to RecordSet and rendered to the TBODY.
+ *
+ * @method doBeforeLoadData
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @return {Boolean} Return true to continue loading data into RecordSet and
+ * updating DataTable with new Records, false to cancel.
+ */
+YAHOO.widget.DataTable.prototype.doBeforeLoadData = function(sRequest, oResponse) {
+    return true;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public Custom Event Handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Overridable custom event handler to sort Column.
+ *
+ * @method onEventSortColumn
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventSortColumn = function(oArgs) {
+//TODO: support nested header column sorting
+    var evt = oArgs.event;
+    var target = oArgs.target;
+    YAHOO.util.Event.stopEvent(evt);
+    
+    var el = this.getThEl(target) || this.getTdEl(target);
+    if(el && YAHOO.lang.isNumber(el.yuiColumnId)) {
+        this.sortColumn(this._oColumnSet.getColumn(el.yuiColumnId));
+    }
+    else {
+        YAHOO.log("Could not sort column " + target, "warn", this.toString());
+    }
+};
+
+/**
+ * Overridable custom event handler to manage selection according to desktop paradigm.
+ *
+ * @method onEventSelectRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventSelectRow = function(oArgs) {
+    var sMode = this.get("selectionMode");
+    if ((sMode == "singlecell") || (sMode == "cellblock") || (sMode == "cellrange")) {
+        return;
+    }
+
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+
+    var bSHIFT = evt.shiftKey;
+    var bCTRL = evt.ctrlKey;
+    var i, nAnchorTrIndex;
+
+    // Validate target row
+    var elTargetRow = this.getTrEl(elTarget);
+    if(elTargetRow) {
+        var allRows = this._elTbody.rows;
+        var nTargetTrIndex = elTargetRow.sectionRowIndex;
+        var elAnchorRow = YAHOO.util.Dom.get(this._sSelectionAnchorId);
+        
+        // Both SHIFT and CTRL
+        if((sMode != "single") && bSHIFT && bCTRL) {
+            // Validate anchor row
+            if(elAnchorRow && YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)) {
+                nAnchorTrIndex = elAnchorRow.sectionRowIndex;
+                if(this.isSelected(elAnchorRow)) {
+                    // Select all rows between anchor row and target row, including target row
+                    if(nAnchorTrIndex < nTargetTrIndex) {
+                        for(i=nAnchorTrIndex+1; i<=nTargetTrIndex; i++) {
+                            if(!this.isSelected(allRows[i])) {
+                                this.selectRow(allRows[i]);
+                            }
+                        }
+                    }
+                    // Select all rows between target row and anchor row, including target row
+                    else {
+                        for(i=nAnchorTrIndex-1; i>=nTargetTrIndex; i--) {
+                            if(!this.isSelected(allRows[i])) {
+                                this.selectRow(allRows[i]);
+                            }
+                        }
+                    }
+                }
+                else {
+                    // Unselect all rows between anchor row and target row
+                    if(nAnchorTrIndex < nTargetTrIndex) {
+                        for(i=nAnchorTrIndex+1; i<=nTargetTrIndex-1; i++) {
+                            if(this.isSelected(allRows[i])) {
+                                this.unselectRow(allRows[i]);
+                            }
+                        }
+                    }
+                    // Unselect all rows between target row and anchor row
+                    else {
+                        for(i=nTargetTrIndex+1; i<=nAnchorTrIndex-1; i++) {
+                            if(this.isSelected(allRows[i])) {
+                                this.unselectRow(allRows[i]);
+                            }
+                        }
+                    }
+                    // Select the target row
+                    this.selectRow(elTargetRow);
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._sSelectionAnchorId = elTargetRow.id;
+
+                // Toggle selection of target
+                if(this.isSelected(elTargetRow)) {
+                    this.unselectRow(elTargetRow);
+                }
+                else {
+                    this.selectRow(elTargetRow);
+                }
+            }
+        }
+        // Only SHIFT
+        else if((sMode != "single") && bSHIFT) {
+            this.unselectAllRows();
+
+            // Validate anchor
+            if(elAnchorRow && YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)) {
+                nAnchorTrIndex = elAnchorRow.sectionRowIndex;
+
+                // Select all rows between anchor row and target row,
+                // including the anchor row and target row
+                if(nAnchorTrIndex < nTargetTrIndex) {
+                    for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
+                        this.selectRow(allRows[i]);
+                    }
+                }
+                // Select all rows between target row and anchor row,
+                // including the target row and anchor row
+                else {
+                    for(i=nAnchorTrIndex; i>=nTargetTrIndex; i--) {
+                        this.selectRow(allRows[i]);
+                    }
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._sSelectionAnchorId = elTargetRow.id;
+
+                // Select target row only
+                this.selectRow(elTargetRow);
+            }
+        }
+        // Only CTRL
+        else if((sMode != "single") && bCTRL) {
+            // Set anchor
+            this._sSelectionAnchorId = elTargetRow.id;
+
+            // Toggle selection of target
+            if(this.isSelected(elTargetRow)) {
+                this.unselectRow(elTargetRow);
+            }
+            else {
+                this.selectRow(elTargetRow);
+            }
+        }
+        // Neither SHIFT nor CTRL
+        else if(sMode == "single") {
+            this.unselectAllRows();
+            this.selectRow(elTargetRow);
+        }
+        // Neither SHIFT nor CTRL
+        else {
+            // Set anchor
+            this._sSelectionAnchorId = elTargetRow.id;
+
+            // Select only target
+            this.unselectAllRows();
+            this.selectRow(elTargetRow);
+        }
+        YAHOO.util.Event.stopEvent(evt);
+
+        // Clear any selections that are a byproduct of the click or dblclick
+        var sel;
+        if(window.getSelection) {
+               sel = window.getSelection();
+        }
+        else if(document.getSelection) {
+               sel = document.getSelection();
+        }
+        else if(document.selection) {
+               sel = document.selection;
+        }
+        if(sel) {
+            if(sel.empty) {
+                sel.empty();
+            }
+            else if (sel.removeAllRanges) {
+                sel.removeAllRanges();
+            }
+            else if(sel.collapse) {
+                sel.collapse();
+            }
+        }
+    }
+    else {
+        YAHOO.log("Could not select row " + elTarget, "warn", this.toString());
+    }
+};
+
+/**
+ * Overridable custom event handler to select cell.
+ *
+ * @method onEventSelectCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventSelectCell = function(oArgs) {
+    var sMode = this.get("selectionMode");
+    if ((sMode == "standard") || (sMode == "single")) {
+        return;
+    }
+
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+
+    var bSHIFT = evt.shiftKey;
+    var bCTRL = evt.ctrlKey;
+    var i, j, nAnchorTrIndex, nAnchorTdIndex, currentRow, startIndex, endIndex;
+    
+    var elTargetCell = this.getTdEl(elTarget);
+    if(elTargetCell) {
+        var elTargetRow = this.getTrEl(elTargetCell);
+        var allRows = this._elTbody.rows;
+        var nTargetTrIndex = elTargetRow.sectionRowIndex;
+        var nTargetTdIndex = elTarget.yuiCellIndex;
+        var elAnchorCell = YAHOO.util.Dom.get(this._sSelectionAnchorId);
+
+        // Both SHIFT and CTRL
+        if((sMode != "singlecell") && bSHIFT && bCTRL) {
+            // Validate anchor
+            if(elAnchorCell && YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)) {
+                nAnchorTrIndex = elAnchorCell.parentNode.sectionRowIndex;
+                nAnchorTdIndex = elAnchorCell.yuiCellIndex;
+                
+                // Anchor is selected
+                if(this.isSelected(elAnchorCell)) {
+                    // All cells are on the same row
+                    if(nAnchorTrIndex == nTargetTrIndex) {
+                        // Select all cells between anchor cell and target cell, including target cell
+                        if(nAnchorTdIndex < nTargetTdIndex) {
+                            for(i=nAnchorTdIndex+1; i<=nTargetTdIndex; i++) {
+                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell, including target cell
+                        else if(nTargetTdIndex < nAnchorTdIndex) {
+                            for(i=nTargetTdIndex; i<nAnchorTdIndex; i++) {
+                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    else if(nAnchorTrIndex < nTargetTrIndex) {
+                        if(sMode == "cellrange") {
+                            // Select all cells on anchor row from anchor cell to the end of the row
+                            for(i=nAnchorTdIndex+1; i<allRows[nAnchorTrIndex].cells.length; i++) {
+                                this.selectCell(allRows[nAnchorTrIndex].cells[i]);
+                            }
+                            
+                            // Select all cells on all rows between anchor row and target row
+                            for(i=nAnchorTrIndex+1; i<nTargetTrIndex; i++) {
+                                for(j=0; j<allRows[i].cells.length; j++){
+                                    this.selectCell(allRows[i].cells[j]);
+                                }
+                            }
+
+                            // Select all cells on target row from first cell to the target cell
+                            for(i=0; i<=nTargetTdIndex; i++) {
+                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+                        }
+                        else if(sMode == "cellblock") {
+                            startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
+                            endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
+                            
+                            // Select all cells from startIndex to endIndex on rows between anchor row and target row
+                            for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
+                                for(j=startIndex; j<=endIndex; j++) {
+                                    this.selectCell(allRows[i].cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        if(sMode == "cellrange") {
+                            // Select all cells on target row from target cell to the end of the row
+                            for(i=nTargetTdIndex; i<allRows[nTargetTrIndex].cells.length; i++) {
+                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+
+                            // Select all cells on all rows between target row and anchor row
+                            for(i=nTargetTrIndex+1; i<nAnchorTrIndex; i++) {
+                                for(j=0; j<allRows[i].cells.length; j++){
+                                    this.selectCell(allRows[i].cells[j]);
+                                }
+                            }
+
+                            // Select all cells on anchor row from first cell to the anchor cell
+                            for(i=0; i<nAnchorTdIndex; i++) {
+                                this.selectCell(allRows[nAnchorTrIndex].cells[i]);
+                            }
+                        }
+                        else if(sMode == "cellblock") {
+                            startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
+                            endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
+
+                            // Select all cells from startIndex to endIndex on rows between target row and anchor row
+                            for(i=nAnchorTrIndex; i>=nTargetTrIndex; i--) {
+                                for(j=endIndex; j>=startIndex; j--) {
+                                    this.selectCell(allRows[i].cells[j]);
+                                }
+                            }
+                        }
+                    }
+                }
+                // Anchor cell is unselected
+                else {
+                    // All cells are on the same row
+                    if(nAnchorTrIndex == nTargetTrIndex) {
+                        // Unselect all cells between anchor cell and target cell
+                        if(nAnchorTdIndex < nTargetTdIndex) {
+                            for(i=nAnchorTdIndex+1; i<nTargetTdIndex; i++) {
+                                this.unselectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell
+                        else if(nTargetTdIndex < nAnchorTdIndex) {
+                            for(i=nTargetTdIndex+1; i<nAnchorTdIndex; i++) {
+                                this.unselectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    if(nAnchorTrIndex < nTargetTrIndex) {
+                        // Unselect all cells from anchor cell to target cell
+                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the anchor row, only unselect cells after the anchor cell
+                                if(currentRow.sectionRowIndex == nAnchorTrIndex) {
+                                    if(j>nAnchorTdIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the target row, only unelect cells before the target cell
+                                else if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j<nTargetTdIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        // Unselect all cells from target cell to anchor cell
+                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the target row, only unselect cells after the target cell
+                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j>nTargetTdIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the anchor row, only unselect cells before the anchor cell
+                                else if(currentRow.sectionRowIndex == nAnchorTrIndex) {
+                                    if(j<nAnchorTdIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+
+                    // Select the target cell
+                    this.selectCell(elTargetCell);
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._sSelectionAnchorId = elTargetCell.id;
+
+                // Toggle selection of target
+                if(this.isSelected(elTargetCell)) {
+                    this.unselectCell(elTargetCell);
+                }
+                else {
+                    this.selectCell(elTargetCell);
+                }
+            }
+        }
+        // Only SHIFT
+        else if((sMode != "singlecell") && bSHIFT) {
+            this.unselectAllCells();
+
+            // Validate anchor
+            if(elAnchorCell && YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)) {
+                nAnchorTrIndex = elAnchorCell.parentNode.sectionRowIndex;
+                nAnchorTdIndex = elAnchorCell.yuiCellIndex;
+                
+                // All cells are on the same row
+                if(nAnchorTrIndex == nTargetTrIndex) {
+                    // Select all cells between anchor cell and target cell,
+                    // including the anchor cell and target cell
+                    if(nAnchorTdIndex < nTargetTdIndex) {
+                        for(i=nAnchorTdIndex; i<=nTargetTdIndex; i++) {
+                            this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                        }
+                    }
+                    // Select all cells between target cell and anchor cell
+                    // including the target cell and anchor cell
+                    else if(nTargetTdIndex < nAnchorTdIndex) {
+                        for(i=nTargetTdIndex; i<=nAnchorTdIndex; i++) {
+                            this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                        }
+                    }
+                }
+                // Anchor row is above target row
+                else if(nAnchorTrIndex < nTargetTrIndex) {
+                    if(sMode == "cellrange") {
+                        // Select all cells from anchor cell to target cell
+                        // including the anchor cell and target cell
+                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the anchor row, only select the anchor cell and after
+                                if(currentRow.sectionRowIndex == nAnchorTrIndex) {
+                                    if(j>=nAnchorTdIndex) {
+                                        this.selectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the target row, only select the target cell and before
+                                else if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j<=nTargetTdIndex) {
+                                        this.selectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Select all cells on this row
+                                else {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    else if(sMode == "cellblock") {
+                        // Select the cellblock from anchor cell to target cell
+                        // including the anchor cell and the target cell
+                        startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
+                        endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
+
+                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
+                            for(j=startIndex; j<=endIndex; j++) {
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+                        
+                        this._sLastSelectedId = allRows[nTargetTrIndex].cells[nTargetTdIndex].id;
+                    }
+                }
+                // Anchor row is below target row
+                else {
+                    if(sMode == "cellrange") {
+                        // Select all cells from target cell to anchor cell,
+                        // including the target cell and anchor cell
+                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the target row, only select the target cell and after
+                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j>=nTargetTdIndex) {
+                                        this.selectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the anchor row, only select the anchor cell and before
+                                else if(currentRow.sectionRowIndex == nAnchorTrIndex) {
+                                    if(j<=nAnchorTdIndex) {
+                                        this.selectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Select all cells on this row
+                                else {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    else if(sMode == "cellblock") {
+                        // Select the cellblock from target cell to anchor cell
+                        // including the target cell and the anchor cell
+                        startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
+                        endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
+
+                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
+                            for(j=startIndex; j<=endIndex; j++) {
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+                        
+                        this._sLastSelectedId = allRows[nTargetTrIndex].cells[nTargetTdIndex].id;
+                    }
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._sSelectionAnchorId = elTargetCell.id;
+
+                // Select target only
+                this.selectCell(elTargetCell);
+            }
+        }
+        // Only CTRL
+        else if((sMode != "singlecell") && bCTRL) {
+            // Set anchor
+            this._sSelectionAnchorId = elTargetCell.id;
+
+            // Toggle selection of target
+            if(this.isSelected(elTargetCell)) {
+                this.unselectCell(elTargetCell);
+            }
+            else {
+                this.selectCell(elTargetCell);
+            }
+        }
+        // Neither SHIFT nor CTRL, or multi-selection has been disabled
+        else {
+            // Set anchor
+            this._sSelectionAnchorId = elTargetCell.id;
+
+            // Select only target
+            this.unselectAllCells();
+            this.selectCell(elTargetCell);
+        }
+
+        YAHOO.util.Event.stopEvent(evt);
+
+        // Clear any selections that are a byproduct of the click or dblclick
+        var sel;
+        if(window.getSelection) {
+               sel = window.getSelection();
+        }
+        else if(document.getSelection) {
+               sel = document.getSelection();
+        }
+        else if(document.selection) {
+               sel = document.selection;
+        }
+        if(sel) {
+            if(sel.empty) {
+                sel.empty();
+            }
+            else if (sel.removeAllRanges) {
+                sel.removeAllRanges();
+            }
+            else if(sel.collapse) {
+                sel.collapse();
+            }
+        }
+    }
+    else {
+        YAHOO.log("Could not select cell " + elTarget, "warn", this.toString());
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+/**
+ * Overridable custom event handler to highlight row.
+ *
+ * @method onEventHighlightRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventHighlightRow = function(oArgs) {
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+    this.highlightRow(elTarget);
+};
+
+/**
+ * Overridable custom event handler to unhighlight row.
+ *
+ * @method onEventUnhighlightRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventUnhighlightRow = function(oArgs) {
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+    this.unhighlightRow(elTarget);
+};
+
+/**
+ * Overridable custom event handler to highlight cell.
+ *
+ * @method onEventHighlightCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventHighlightCell = function(oArgs) {
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+    this.highlightCell(elTarget);
+};
+
+/**
+ * Overridable custom event handler to unhighlight cell.
+ *
+ * @method onEventUnhighlightCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventUnhighlightCell = function(oArgs) {
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+    this.unhighlightCell(elTarget);
+};
+
+/**
+ * Overridable custom event handler to format cell.
+ *
+ * @method onEventFormatCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventFormatCell = function(oArgs) {
+    var evt = oArgs.event;
+    var target = oArgs.target;
+    var elTag = target.tagName.toLowerCase();
+
+    var elCell = this.getTdEl(target);
+    if(elCell && YAHOO.lang.isNumber(elCell.yuiColumnId)) {
+        var oColumn = this._oColumnSet.getColumn(elCell.yuiColumnId);
+        this.formatCell(elCell, this.getRecord(elCell), oColumn);
+    }
+    else {
+        YAHOO.log("Could not format cell " + target, "warn", this.toString());
+    }
+};
+
+/**
+ * Overridable custom event handler to edit cell.
+ *
+ * @method onEventShowCellEditor
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventShowCellEditor = function(oArgs) {
+    var evt = oArgs.event;
+    var target = oArgs.target;
+    var elTag = target.tagName.toLowerCase();
+
+    var elCell = this.getTdEl(target);
+    if(elCell) {
+        this.showCellEditor(elCell);
+    }
+    else {
+        YAHOO.log("Could not edit cell " + target, "warn", this.toString());
+    }
+};
+// Backward compatibility
+YAHOO.widget.DataTable.prototype.onEventEditCell = function(oArgs) {
+    YAHOO.log("The method onEventEditCell() has been deprecated" +
+        " in favor of onEventShowCellEditor()", "warn", this.toString());
+    this.onEventShowCellEditor(oArgs);
+};
+
+/**
+ * Overridable custom event handler to save Cell Editor input.
+ *
+ * @method onEventSaveCellEditor
+ * @param oArgs.editor {Object} Cell Editor object literal.
+ */
+YAHOO.widget.DataTable.prototype.onEventSaveCellEditor = function(oArgs) {
+    this.saveCellEditor();
+};
+
+/**
+ * Callback function for creating a progressively enhanced DataTable first
+ * receives data from DataSource and populates the RecordSet, then initializes
+ * DOM elements.
+ *
+ * @method _onDataReturnEnhanceTable
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param bError {Boolean} (optional) True if there was a data error.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onDataReturnEnhanceTable = function(sRequest, oResponse) {
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse);
+
+    // Data ok to populate
+    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
+        // Update RecordSet
+        this._oRecordSet.addRecords(oResponse.results);
+
+        // Initialize DOM elements
+        this._initTableEl();
+        if(!this._elTable || !this._elThead || !this._elTbody) {
+            YAHOO.log("Could not instantiate DataTable due to an invalid DOM elements", "error", this.toString());
+            return;
+        }
+
+        // Call Element's constructor after DOM elements are created
+        // but *before* UI is updated with data
+        YAHOO.widget.DataTable.superclass.constructor.call(this, this._elContainer, this._oConfigs);
+
+        //HACK: Set the Paginator values
+        if(this._oConfigs.paginator) {
+            this.updatePaginator(this._oConfigs.paginator);
+        }
+
+        // Update the UI
+        this.refreshView();
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
+    }
+    // Empty
+    else if(ok){
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
+    }
+};
+    
+/**
+ * Callback function receives data from DataSource and populates an entire
+ * DataTable with Records and TR elements, clearing previous Records, if any.
+ *
+ * @method onDataReturnInitializeTable
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param bError {Boolean} (optional) True if there was a data error.
+ */
+YAHOO.widget.DataTable.prototype.onDataReturnInitializeTable = function(sRequest, oResponse) {
+    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
+
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse);
+
+    // Data ok to populate
+    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
+        this.initializeTable(oResponse.results);
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
+    }
+    // Empty
+    else if(ok){
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
+    }
+};
+// Backward compatibility
+YAHOO.widget.DataTable.prototype.onDataReturnReplaceRows = function(sRequest, oResponse) {
+    YAHOO.log("The method onDataReturnReplaceRows() has been deprecated" +
+            " in favor of onDataReturnInitializeTable()", "warn", this.toString());
+    this.onDataReturnInitializeTable(sRequest, oResponse);
+};
+
+/**
+ * Callback function receives data from DataSource and appends to an existing
+ * DataTable new Records and, if applicable, creates or updates
+ * corresponding TR elements.
+ *
+ * @method onDataReturnAppendRows
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param bError {Boolean} (optional) True if there was a data error.
+ */
+YAHOO.widget.DataTable.prototype.onDataReturnAppendRows = function(sRequest, oResponse) {
+    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
+    
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse);
+    
+    // Data ok to append
+    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
+        this.addRows(oResponse.results);
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
+    }
+};
+
+/**
+ * Callback function receives data from DataSource and inserts into top of an
+ * existing DataTable new Records and, if applicable, creates or updates
+ * corresponding TR elements.
+ *
+ * @method onDataReturnInsertRows
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param bError {Boolean} (optional) True if there was a data error.
+ */
+YAHOO.widget.DataTable.prototype.onDataReturnInsertRows = function(sRequest, oResponse) {
+    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
+    
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse);
+    
+    // Data ok to append
+    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
+        this.addRows(oResponse.results, 0);
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Custom Events
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Fired when the DataTable instance's initialization is complete.
+     *
+     * @event initEvent
+     */
+
+    /**
+     * Fired when the DataTable's view is refreshed.
+     *
+     * @event refreshEvent
+     */
+
+    /**
+     * Fired when data is returned from DataSource.
+     *
+     * @event dataReturnEvent
+     * @param oArgs.request {String} Original request.
+     * @param oArgs.response {Object} Response object.
+     */
+
+    /**
+     * Fired when the DataTable has a focus.
+     *
+     * @event tableFocusEvent
+     */
+
+    /**
+     * Fired when the DataTable has a blur.
+     *
+     * @event tableBlurEvent
+     */
+
+    /**
+     * Fired when the DataTable has a mouseover.
+     *
+     * @event tableMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a mouseout.
+     *
+     * @event tableMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a mousedown.
+     *
+     * @event tableMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a click.
+     *
+     * @event tableClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a dblclick.
+     *
+     * @event tableDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when a fixed scrolling DataTable has a scroll.
+     *
+     * @event tableScrollEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's CONTAINER element (in IE)
+     * or the DataTable's TBODY element (everyone else).
+     *
+     */
+
+    /**
+     * Fired when a message is shown in the DataTable's message element.
+     *
+     * @event tableMsgShowEvent
+     * @param oArgs.html {String} The HTML displayed.
+     * @param oArgs.className {String} The className assigned.
+     *
+     */
+
+    /**
+     * Fired when the DataTable's message element is hidden.
+     *
+     * @event tableMsgHideEvent
+     */
+
+    /**
+     * Fired when a header row has a mouseover.
+     *
+     * @event headerRowMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a header row has a mouseout.
+     *
+     * @event headerRowMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a header row has a mousedown.
+     *
+     * @event headerRowMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a header row has a click.
+     *
+     * @event headerRowClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a header row has a dblclick.
+     *
+     * @event headerRowDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a header cell has a mouseover.
+     *
+     * @event headerCellMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     *
+     */
+
+    /**
+     * Fired when a header cell has a mouseout.
+     *
+     * @event headerCellMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     *
+     */
+
+    /**
+     * Fired when a header cell has a mousedown.
+     *
+     * @event headerCellMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a header cell has a click.
+     *
+     * @event headerCellClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a header cell has a dblclick.
+     *
+     * @event headerCellDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a header label has a mouseover.
+     *
+     * @event headerLabelMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     *
+     */
+
+    /**
+     * Fired when a header label has a mouseout.
+     *
+     * @event headerLabelMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     *
+     */
+
+    /**
+     * Fired when a header label has a mousedown.
+     *
+     * @event headerLabelMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
+
+    /**
+     * Fired when a header label has a click.
+     *
+     * @event headerLabelClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
+
+    /**
+     * Fired when a header label has a dblclick.
+     *
+     * @event headerLabelDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
+
+    /**
+     * Fired when a column is sorted.
+     *
+     * @event columnSortEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.dir {String} Sort direction "asc" or "desc".
+     */
+
+    /**
+     * Fired when a column is resized.
+     *
+     * @event columnResizeEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a row has a mouseover.
+     *
+     * @event rowMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a mouseout.
+     *
+     * @event rowMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a mousedown.
+     *
+     * @event rowMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a click.
+     *
+     * @event rowClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a dblclick.
+     *
+     * @event rowDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row is added.
+     *
+     * @event rowAddEvent
+     * @param oArgs.record {YAHOO.widget.Record} The added Record.
+     */
+
+    /**
+     * Fired when a row is updated.
+     *
+     * @event rowUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The updated Record.
+     * @param oArgs.oldData {Object} Object literal of the old data.
+     */
+
+    /**
+     * Fired when a row is deleted.
+     *
+     * @event rowDeleteEvent
+     * @param oArgs.oldData {Object} Object literal of the deleted data.
+     * @param oArgs.recordIndex {Number} Index of the deleted Record.
+     * @param oArgs.trElIndex {Number} Index of the deleted TR element, if in view.
+     */
+
+    /**
+     * Fired when a row is selected.
+     *
+     * @event rowSelectEvent
+     * @param oArgs.el {HTMLElement} The selected TR element, if applicable.
+     * @param oArgs.record {YAHOO.widget.Record} The selected Record.
+     */
+
+    /**
+     * Fired when a row is unselected.
+     *
+     * @event rowUnselectEvent
+     * @param oArgs.el {HTMLElement} The unselected TR element, if applicable.
+     * @param oArgs.record {YAHOO.widget.Record} The unselected Record.
+     */
+
+    /*TODO: delete and use rowUnselectEvent?
+     * Fired when all row selections are cleared.
+     *
+     * @event unselectAllRowsEvent
+     */
+
+    /*
+     * Fired when a row is highlighted.
+     *
+     * @event rowHighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TR element.
+     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
+     */
+
+    /*
+     * Fired when a row is unhighlighted.
+     *
+     * @event rowUnhighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TR element.
+     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
+     */
+
+    /**
+     * Fired when a cell has a mouseover.
+     *
+     * @event cellMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a mouseout.
+     *
+     * @event cellMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a mousedown.
+     *
+     * @event cellMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a click.
+     *
+     * @event cellClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a dblclick.
+     *
+     * @event cellDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell is formatted.
+     *
+     * @event cellFormatEvent
+     * @param oArgs.el {HTMLElement} The formatted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The formatted Record.
+     * @param oArgs.key {String} The key of the formatted cell.
+     */
+
+    /**
+     * Fired when a cell is selected.
+     *
+     * @event cellSelectEvent
+     * @param oArgs.el {HTMLElement} The selected TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The selected Record.
+     * @param oArgs.key {String} The key of the selected cell.
+     */
+
+    /**
+     * Fired when a cell is unselected.
+     *
+     * @event cellUnselectEvent
+     * @param oArgs.el {HTMLElement} The unselected TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The unselected Record.
+     * @param oArgs.key {String} The key of the unselected cell.
+     */
+
+    /**
+     * Fired when a cell is highlighted.
+     *
+     * @event cellHighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
+     * @param oArgs.key {String} The key of the highlighted cell.
+     */
+
+    /**
+     * Fired when a cell is unhighlighted.
+     *
+     * @event cellUnhighlightEvent
+     * @param oArgs.el {HTMLElement} The unhighlighted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The unhighlighted Record.
+     * @param oArgs.key {String} The key of the unhighlighted cell.
+     */
+
+    /*TODO: hide from doc and use cellUnselectEvent
+     * Fired when all cell selections are cleared.
+     *
+     * @event unselectAllCellsEvent
+     */
+
+    /*TODO: implement
+     * Fired when DataTable paginator is updated.
+     *
+     * @event paginatorUpdateEvent
+     * @param paginator {Object} Object literal of Paginator values.
+     */
+
+    /**
+     * Fired when an Editor is activated.
+     *
+     * @event editorShowEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     */
+
+    /**
+     * Fired when an active Editor has a keydown.
+     *
+     * @event editorKeydownEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.event {HTMLEvent} The event object.
+     */
+
+    /**
+     * Fired when Editor input is reverted.
+     *
+     * @event editorRevertEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.newData {Object} New data value.
+     * @param oArgs.oldData {Object} Old data value.
+     */
+
+    /**
+     * Fired when Editor input is saved.
+     *
+     * @event editorSaveEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.newData {Object} New data value.
+     * @param oArgs.oldData {Object} Old data value.
+     */
+
+    /**
+     * Fired when Editor input is canceled.
+     *
+     * @event editorCancelEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     */
+
+    /**
+     * Fired when an active Editor has a blur.
+     *
+     * @event editorBlurEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     */
+
+
+
+
+
+
+
+    /**
+     * Fired when a link is clicked.
+     *
+     * @event linkClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The A element.
+     */
+
+    /**
+     * Fired when a BUTTON element is clicked.
+     *
+     * @event buttonClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The BUTTON element.
+     */
+
+    /**
+     * Fired when a CHECKBOX element is clicked.
+     *
+     * @event checkboxClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The CHECKBOX element.
+     */
+
+    /*TODO
+     * Fired when a SELECT element is changed.
+     *
+     * @event dropdownChangeEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SELECT element.
+     */
+
+    /**
+     * Fired when a RADIO element is clicked.
+     *
+     * @event radioClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The RADIO element.
+     */
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The ColumnSet class defines and manages a DataTable's Columns,
+ * including nested hierarchies and access to individual Column instances.
+ *
+ * @namespace YAHOO.widget
+ * @class ColumnSet
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param aHeaders {Object[]} Array of object literals that define header cells.
+ */
+YAHOO.widget.ColumnSet = function(aHeaders) {
+    this._sName = "instance" + YAHOO.widget.ColumnSet._nCount;
+
+    // DOM tree representation of all Columns
+    var tree = [];
+    // Flat representation of all Columns
+    var flat = [];
+    // Flat representation of only Columns that are meant to display data
+    var keys = [];
+    // Array of HEADERS attribute values for all keys in the "keys" array
+    var headers = [];
+
+    // Tracks current node list depth being tracked
+    var nodeDepth = -1;
+
+    // Internal recursive function to defined Column instances
+    var parseColumns = function(nodeList, parent) {
+        // One level down
+        nodeDepth++;
+
+        // Create corresponding tree node if not already there for this depth
+        if(!tree[nodeDepth]) {
+            tree[nodeDepth] = [];
+        }
+
+
+        // Parse each node at this depth for attributes and any children
+        for(var j=0; j<nodeList.length; j++) {
+            var currentNode = nodeList[j];
+
+            // Instantiate a new Column for each node
+            var oColumn = new YAHOO.widget.Column(currentNode);
+
+            // Add the new Column to the flat list
+            flat.push(oColumn);
+
+            // Assign its parent as an attribute, if applicable
+            if(parent) {
+                oColumn.parent = parent;
+            }
+
+            // The Column has descendants
+            if(YAHOO.lang.isArray(currentNode.children)) {
+                oColumn.children = currentNode.children;
+
+                // Determine COLSPAN value for this Column
+                var terminalChildNodes = 0;
+                var countTerminalChildNodes = function(ancestor) {
+                    var descendants = ancestor.children;
+                    // Drill down each branch and count terminal nodes
+                    for(var k=0; k<descendants.length; k++) {
+                        // Keep drilling down
+                        if(YAHOO.lang.isArray(descendants[k].children)) {
+                            countTerminalChildNodes(descendants[k]);
+                        }
+                        // Reached branch terminus
+                        else {
+                            terminalChildNodes++;
+                        }
+                    }
+                };
+                countTerminalChildNodes(currentNode);
+                oColumn._colspan = terminalChildNodes;
+
+                // Cascade certain properties to children if not defined on their own
+                var currentChildren = currentNode.children;
+                for(var k=0; k<currentChildren.length; k++) {
+                    var child = currentChildren[k];
+                    if(oColumn.className && (child.className === undefined)) {
+                        child.className = oColumn.className;
+                    }
+                    if(oColumn.editor && (child.editor === undefined)) {
+                        child.editor = oColumn.editor;
+                    }
+                    if(oColumn.editorOptions && (child.editorOptions === undefined)) {
+                        child.editorOptions = oColumn.editorOptions;
+                    }
+                    if(oColumn.formatter && (child.formatter === undefined)) {
+                        child.formatter = oColumn.formatter;
+                    }
+                    if(oColumn.resizeable && (child.resizeable === undefined)) {
+                        child.resizeable = oColumn.resizeable;
+                    }
+                    if(oColumn.sortable && (child.sortable === undefined)) {
+                        child.sortable = oColumn.sortable;
+                    }
+                    if(oColumn.width && (child.width === undefined)) {
+                        child.width = oColumn.width;
+                    }
+                    // Backward compatibility
+                    if(oColumn.type && (child.type === undefined)) {
+                        child.type = oColumn.type;
+                    }
+                    if(oColumn.type && !oColumn.formatter) {
+                        YAHOO.log("The property type has been" +
+                        " deprecated in favor of formatter", "warn", oColumn.toString());
+                        oColumn.formatter = oColumn.type;
+                    }
+                    if(oColumn.text && !YAHOO.lang.isValue(oColumn.label)) {
+                        YAHOO.log("The property text has been" +
+                        " deprecated in favor of label", "warn", oColumn.toString());
+                        oColumn.label = oColumn.text;
+                    }
+                    if(oColumn.parser) {
+                        YAHOO.log("The property parser is no longer supported",
+                        "warn", this.toString());
+                    }
+                    if(oColumn.sortOptions && ((oColumn.sortOptions.ascFunction) ||
+                            (oColumn.sortOptions.descFunction))) {
+                        YAHOO.log("The properties sortOptions.ascFunction and " +
+                        " sortOptions.descFunction have been deprecated in favor " +
+                        " of sortOptions.sortFunction", "warn", this.toString());
+                    }
+                }
+
+                // The children themselves must also be parsed for Column instances
+                if(!tree[nodeDepth+1]) {
+                    tree[nodeDepth+1] = [];
+                }
+                parseColumns(currentChildren, oColumn);
+            }
+            // This Column does not have any children
+            else {
+                oColumn._nKeyIndex = keys.length;
+                oColumn._colspan = 1;
+                keys.push(oColumn);
+            }
+
+            // Add the Column to the top-down tree
+            tree[nodeDepth].push(oColumn);
+        }
+        nodeDepth--;
+    };
+
+    // Parse out Column instances from the array of object literals
+    if(YAHOO.lang.isArray(aHeaders)) {
+        parseColumns(aHeaders);
+    }
+
+    // Determine ROWSPAN value for each Column in the tree
+    var parseTreeForRowspan = function(tree) {
+        var maxRowDepth = 1;
+        var currentRow;
+        var currentColumn;
+
+        // Calculate the max depth of descendants for this row
+        var countMaxRowDepth = function(row, tmpRowDepth) {
+            tmpRowDepth = tmpRowDepth || 1;
+
+            for(var n=0; n<row.length; n++) {
+                var col = row[n];
+                // Column has children, so keep counting
+                if(YAHOO.lang.isArray(col.children)) {
+                    tmpRowDepth++;
+                    countMaxRowDepth(col.children, tmpRowDepth);
+                    tmpRowDepth--;
+                }
+                // No children, is it the max depth?
+                else {
+                    if(tmpRowDepth > maxRowDepth) {
+                        maxRowDepth = tmpRowDepth;
+                    }
+                }
+
+            }
+        };
+
+        // Count max row depth for each row
+        for(var m=0; m<tree.length; m++) {
+            currentRow = tree[m];
+            countMaxRowDepth(currentRow);
+
+            // Assign the right ROWSPAN values to each Column in the row
+            for(var p=0; p<currentRow.length; p++) {
+                currentColumn = currentRow[p];
+                if(!YAHOO.lang.isArray(currentColumn.children)) {
+                    currentColumn._rowspan = maxRowDepth;
+                }
+                else {
+                    currentColumn._rowspan = 1;
+                }
+            }
+
+            // Reset counter for next row
+            maxRowDepth = 1;
+        }
+    };
+    parseTreeForRowspan(tree);
+
+
+
+
+
+    // Store header relationships in an array for HEADERS attribute
+    var recurseAncestorsForHeaders = function(i, oColumn) {
+        headers[i].push(oColumn._nId);
+        if(oColumn.parent) {
+            recurseAncestorsForHeaders(i, oColumn.parent);
+        }
+    };
+    for(var i=0; i<keys.length; i++) {
+        headers[i] = [];
+        recurseAncestorsForHeaders(i, keys[i]);
+        headers[i] = headers[i].reverse();
+        headers[i] = headers[i].join(" ");
+    }
+
+    // Save to the ColumnSet instance
+    this.tree = tree;
+    this.flat = flat;
+    this.keys = keys;
+    this.headers = headers;
+
+    YAHOO.widget.ColumnSet._nCount++;
+    YAHOO.log("ColumnSet initialized", "info", this.toString());
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class variable to index multiple data table instances.
+ *
+ * @property ColumnSet._nCount
+ * @type number
+ * @private
+ * @static
+ */
+YAHOO.widget.ColumnSet._nCount = 0;
+
+/**
+ * Unique instance name.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.ColumnSet.prototype._sName = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Top-down tree representation of Column hierarchy.
+ *
+ * @property tree
+ * @type YAHOO.widget.Column[]
+ */
+YAHOO.widget.ColumnSet.prototype.tree = null;
+
+/**
+ * Flattened representation of all Columns.
+ *
+ * @property flat
+ * @type YAHOO.widget.Column[]
+ * @default []
+ */
+YAHOO.widget.ColumnSet.prototype.flat = null;
+
+/**
+ * Array of Columns that map one-to-one to a table column.
+ *
+ * @property keys
+ * @type YAHOO.widget.Column[]
+ * @default []
+ */
+YAHOO.widget.ColumnSet.prototype.keys = null;
+
+/**
+ * ID index of nested parent hierarchies for HEADERS accessibility attribute.
+ *
+ * @property headers
+ * @type String[]
+ * @default []
+ */
+YAHOO.widget.ColumnSet.prototype.headers = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Public accessor to the unique name of the ColumnSet instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the ColumnSet instance.
+ */
+
+YAHOO.widget.ColumnSet.prototype.toString = function() {
+    return "ColumnSet " + this._sName;
+};
+
+/**
+ * Returns Column instance with given ID number or key.
+ *
+ * @method getColumn
+ * @param column {Number | String} ID number or unique key.
+ * @return {YAHOO.widget.Column} Column instance.
+ */
+
+YAHOO.widget.ColumnSet.prototype.getColumn = function(column) {
+    var allColumns = this.flat;
+    if(YAHOO.lang.isNumber(column)) {
+        for(var i=0; i<allColumns.length; i++) {
+            if(allColumns[i]._nId === column) {
+                return allColumns[i];
+            }
+        }
+    }
+    else if(YAHOO.lang.isString(column)) {
+        for(i=0; i<allColumns.length; i++) {
+            if(allColumns[i].key === column) {
+                return allColumns[i];
+            }
+        }
+    }
+    return null;
+};
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The Column class defines and manages attributes of DataTable Columns
+ *
+ * @namespace YAHOO.widget
+ * @class Column
+ * @constructor
+ * @param oConfigs {Object} Object literal of configuration values.
+ */
+YAHOO.widget.Column = function(oConfigs) {
+    // Internal variables
+    this._nId = YAHOO.widget.Column._nCount;
+    this._sName = "Column instance" + this._nId;
+
+    // Object literal defines Column attributes
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            if(sConfig) {
+                this[sConfig] = oConfigs[sConfig];
+            }
+        }
+    }
+
+    if(!YAHOO.lang.isValue(this.key)) {
+        this.key = "yui-dt-column"+this._nId;
+    }
+    YAHOO.widget.Column._nCount++;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal instance counter.
+ *
+ * @property Column._nCount
+ * @type Number
+ * @private
+ * @static
+ * @default 0
+ */
+YAHOO.widget.Column._nCount = 0;
+
+/**
+ * Unique instance name.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.Column.prototype._sName = null;
+
+
+/**
+ * Unique number assigned at instantiation, indicates original order within
+ * ColumnSet.
+ *
+ * @property _nId
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._nId = null;
+
+/**
+ * Reference to Column's index within its ColumnSet's keys array, or null if not applicable.
+ *
+ * @property _nKeyIndex
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._nKeyIndex = null;
+
+/**
+ * Number of table cells the Column spans.
+ *
+ * @property _colspan
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._colspan = 1;
+
+/**
+ * Number of table rows the Column spans.
+ *
+ * @property _rowspan
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._rowspan = 1;
+
+/**
+ * Column's parent Column instance, or null.
+ *
+ * @property _parent
+ * @type YAHOO.widget.Column
+ * @private
+ */
+YAHOO.widget.Column.prototype._parent = null;
+
+/**
+ * Current offsetWidth of the Column (in pixels).
+ *
+ * @property _width
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._width = null;
+
+/**
+ * Minimum width the Column can support (in pixels). Value is populated only if table
+ * is fixedWidth, null otherwise.
+ *
+ * @property _minWidth
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._minWidth = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Associated database field, or null.
+ *
+ * @property key
+ * @type String
+ */
+YAHOO.widget.Column.prototype.key = null;
+
+/**
+ * Text or HTML for display as Column's label in the TH element.
+ *
+ * @property label
+ * @type String
+ */
+YAHOO.widget.Column.prototype.label = null;
+
+/**
+ * Column head cell ABBR for accessibility.
+ *
+ * @property abbr
+ * @type String
+ */
+YAHOO.widget.Column.prototype.abbr = null;
+
+/**
+ * Array of object literals that define children (nested headers) of a Column.
+ *
+ * @property children
+ * @type Object[]
+ */
+YAHOO.widget.Column.prototype.children = null;
+
+/**
+ * Column width.
+ *
+ * @property width
+ * @type String
+ */
+YAHOO.widget.Column.prototype.width = null;
+
+/**
+ * Custom CSS class or array of classes to be applied to every cell in the Column.
+ *
+ * @property className
+ * @type String || String[]
+ */
+YAHOO.widget.Column.prototype.className = null;
+
+/**
+ * Defines a format function.
+ *
+ * @property formatter
+ * @type String || HTMLFunction
+ */
+YAHOO.widget.Column.prototype.formatter = null;
+
+/**
+ * Defines an editor function, otherwise Column is not editable.
+ *
+ * @property editor
+ * @type String || HTMLFunction
+ */
+YAHOO.widget.Column.prototype.editor = null;
+
+/**
+ * Defines editor options for Column in an object literal of param:value pairs.
+ *
+ * @property editorOptions
+ * @type Object
+ */
+YAHOO.widget.Column.prototype.editorOptions = null;
+
+/**
+ * True if Column is resizeable, false otherwise.
+ *
+ * @property resizeable
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.Column.prototype.resizeable = false;
+
+/**
+ * True if Column is sortable, false otherwise.
+ *
+ * @property sortable
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.Column.prototype.sortable = false;
+
+/**
+ * Default sort order for Column: "asc" or "desc".
+ *
+ * @property sortOptions.defaultOrder
+ * @type String
+ * @default null
+ */
+/**
+ * Custom sort handler.
+ *
+ * @property sortOptions.sortFunction
+ * @type Function
+ * @default null
+ */
+YAHOO.widget.Column.prototype.sortOptions = null;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Public accessor to the unique name of the Column instance.
+ *
+ * @method toString
+ * @return {String} Column's unique name.
+ */
+YAHOO.widget.Column.prototype.toString = function() {
+    return this._sName;
+};
+
+/**
+ * Returns unique number assigned at instantiation, indicates original order
+ * within ColumnSet.
+ *
+ * @method getId
+ * @return {Number} Column's unique ID number.
+ */
+YAHOO.widget.Column.prototype.getId = function() {
+    return this._nId;
+};
+
+/**
+ * Public accessor returns Column's key index within its ColumnSet's keys array, or
+ * null if not applicable.
+ *
+ * @method getKeyIndex
+ * @return {Number} Column's key index within its ColumnSet keys array, if applicable.
+ */
+YAHOO.widget.Column.prototype.getKeyIndex = function() {
+    return this._nKeyIndex;
+};
+
+/**
+ * Public accessor returns Column's parent instance if any, or null otherwise.
+ *
+ * @method getParent
+ * @return {YAHOO.widget.Column} Column's parent instance.
+ */
+YAHOO.widget.Column.prototype.getParent = function() {
+    return this._parent;
+};
+
+/**
+ * Public accessor returns Column's calculated COLSPAN value.
+ *
+ * @method getColspan
+ * @return {Number} Column's COLSPAN value.
+ */
+YAHOO.widget.Column.prototype.getColspan = function() {
+    return this._colspan;
+};
+// Backward compatibility
+YAHOO.widget.Column.prototype.getColSpan = function() {
+    YAHOO.log("The method getColSpan() has been" +
+    " deprecated in favor of getColspan()", "warn", this.toString());
+    return this.getColspan();
+};
+
+/**
+ * Public accessor returns Column's calculated ROWSPAN value.
+ *
+ * @method getRowspan
+ * @return {Number} Column's ROWSPAN value.
+ */
+YAHOO.widget.Column.prototype.getRowspan = function() {
+    return this._rowspan;
+};
+
+// Backward compatibility
+YAHOO.widget.Column.prototype.getIndex = function() {
+    YAHOO.log("The method getIndex() has been" +
+    " deprecated in favor of getKeyIndex()", "warn",
+    this.toString());
+    return this.getKeyIndex();
+};
+YAHOO.widget.Column.prototype.format = function() {
+    YAHOO.log("The method format() has been deprecated in favor of the " +
+    "DataTable method formatCell()", "error", this.toString());
+};
+YAHOO.widget.Column.formatCheckbox = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.log("The method YAHOO.widget.Column.formatCheckbox() has been" +
+    " deprecated in favor of YAHOO.widget.DataTable.formatCheckbox()", "warn",
+    "YAHOO.widget.Column.formatCheckbox");
+    YAHOO.widget.DataTable.formatCheckbox(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatCurrency = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.log("The method YAHOO.widget.Column.formatCurrency() has been" +
+    " deprecated in favor of YAHOO.widget.DataTable.formatCurrency()", "warn",
+    "YAHOO.widget.Column.formatCurrency");
+    YAHOO.widget.DataTable.formatCurrency(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatDate = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.log("The method YAHOO.widget.Column.formatDate() has been" +
+    " deprecated in favor of YAHOO.widget.DataTable.formatDate()", "warn",
+    "YAHOO.widget.Column.formatDate");
+    YAHOO.widget.DataTable.formatDate(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatEmail = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.log("The method YAHOO.widget.Column.formatEmail() has been" +
+    " deprecated in favor of YAHOO.widget.DataTable.formatEmail()", "warn",
+    "YAHOO.widget.Column.formatEmail");
+    YAHOO.widget.DataTable.formatEmail(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatLink = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.log("The method YAHOO.widget.Column.formatLink() has been" +
+    " deprecated in favor of YAHOO.widget.DataTable.formatLink()", "warn",
+    "YAHOO.widget.Column.formatLink");
+    YAHOO.widget.DataTable.formatLink(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatNumber = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.log("The method YAHOO.widget.Column.formatNumber() has been" +
+    " deprecated in favor of YAHOO.widget.DataTable.formatNumber()", "warn",
+    "YAHOO.widget.Column.formatNumber");
+    YAHOO.widget.DataTable.formatNumber(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatSelect = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.log("The method YAHOO.widget.Column.formatSelect() has been" +
+    " deprecated in favor of YAHOO.widget.DataTable.formatDropdown()", "warn",
+    "YAHOO.widget.Column.formatSelect");
+    YAHOO.widget.DataTable.formatDropdown(elCell, oRecord, oColumn, oData);
+};
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * Sort static utility to support Column sorting.
+ *
+ * @namespace YAHOO.util
+ * @class Sort
+ * @static
+ */
+YAHOO.util.Sort = {
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Comparator function for simple case-insensitive string sorting.
+     *
+     * @method compare
+     * @param a {Object} First sort argument.
+     * @param b {Object} Second sort argument.
+     * @param desc {Boolean} True if sort direction is descending, false if
+     * sort direction is ascending.
+     */
+    compare: function(a, b, desc) {
+        if((a === null) || (typeof a == "undefined")) {
+            if((b === null) || (typeof b == "undefined")) {
+                return 0;
+            }
+            else {
+                return 1;
+            }
+        }
+        else if((b === null) || (typeof b == "undefined")) {
+            return -1;
+        }
+
+        if(a.constructor == String) {
+            a = a.toLowerCase();
+        }
+        if(b.constructor == String) {
+            b = b.toLowerCase();
+        }
+        if(a < b) {
+            return (desc) ? 1 : -1;
+        }
+        else if (a > b) {
+            return (desc) ? -1 : 1;
+        }
+        else {
+            return 0;
+        }
+    }
+};
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * ColumnResizer subclasses DragDrop to support resizeable Columns.
+ *
+ * @namespace YAHOO.util
+ * @class ColumnResizer
+ * @extends YAHOO.util.DragDrop
+ * @constructor
+ * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param elThead {HTMLElement} TH element reference.
+ * @param sHandleElId {String} DOM ID of the handle element that causes the resize.
+ * @param sGroup {String} Group name of related DragDrop items.
+ * @param oConfig {Object} (Optional) Object literal of config values.
+ */
+YAHOO.util.ColumnResizer = function(oDataTable, oColumn, elThead, sHandleId, sGroup, oConfig) {
+    if(oDataTable && oColumn && elThead && sHandleId) {
+        this.datatable = oDataTable;
+        this.column = oColumn;
+        this.cell = elThead;
+        this.init(sHandleId, sGroup, oConfig);
+        //this.initFrame();
+        this.setYConstraint(0,0);
+    }
+    else {
+        YAHOO.log("Column resizer could not be created due to invalid colElId","warn");
+    }
+};
+
+if(YAHOO.util.DD) {
+    YAHOO.extend(YAHOO.util.ColumnResizer, YAHOO.util.DD);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public DOM event handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Handles mousedown events on the Column resizer.
+ *
+ * @method onMouseDown
+ * @param e {string} The mousedown event
+ */
+YAHOO.util.ColumnResizer.prototype.onMouseDown = function(e) {
+    this.startWidth = this.cell.offsetWidth;
+    this.startPos = YAHOO.util.Dom.getX(this.getDragEl());
+
+    if(this.datatable.fixedWidth) {
+        var cellLabel = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",this.cell)[0];
+        this.minWidth = cellLabel.offsetWidth + 6;
+        var sib = this.cell.nextSibling;
+        var sibCellLabel = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",sib)[0];
+        this.sibMinWidth = sibCellLabel.offsetWidth + 6;
+//!!
+        var left = ((this.startWidth - this.minWidth) < 0) ? 0 : (this.startWidth - this.minWidth);
+        var right = ((sib.offsetWidth - this.sibMinWidth) < 0) ? 0 : (sib.offsetWidth - this.sibMinWidth);
+        this.setXConstraint(left, right);
+        YAHOO.log("cellstartwidth:" + this.startWidth,"time");
+        YAHOO.log("cellminwidth:" + this.minWidth,"time");
+        YAHOO.log("sibstartwidth:" + sib.offsetWidth,"time");
+        YAHOO.log("sibminwidth:" + this.sibMinWidth,"time");
+        YAHOO.log("l:" + left + " AND r:" + right,"time");
+    }
+
+};
+
+/**
+ * Handles mouseup events on the Column resizer.
+ *
+ * @method onMouseUp
+ * @param e {string} The mouseup event
+ */
+YAHOO.util.ColumnResizer.prototype.onMouseUp = function(e) {
+    //TODO: replace the resizer where it belongs:
+    var resizeStyle = YAHOO.util.Dom.get(this.handleElId).style;
+    resizeStyle.left = "auto";
+    resizeStyle.right = 0;
+    resizeStyle.marginRight = "-6px";
+    resizeStyle.width = "6px";
+    //.yui-dt-headresizer {position:absolute;margin-right:-6px;right:0;bottom:0;width:6px;height:100%;cursor:w-resize;cursor:col-resize;}
+
+
+    //var cells = this.datatable._elTable.tHead.rows[this.datatable._elTable.tHead.rows.length-1].cells;
+    //for(var i=0; i<cells.length; i++) {
+        //cells[i].style.width = "5px";
+    //}
+
+    //TODO: set new ColumnSet width values
+    this.datatable.fireEvent("columnResizeEvent", {column:this.column,target:this.cell});
+};
+
+/**
+ * Handles drag events on the Column resizer.
+ *
+ * @method onDrag
+ * @param e {string} The drag event
+ */
+YAHOO.util.ColumnResizer.prototype.onDrag = function(e) {
+    var newPos = YAHOO.util.Dom.getX(this.getDragEl());
+    //YAHOO.log("newpos:"+newPos,"warn");//YAHOO.util.Event.getPageX(e);
+    var offsetX = newPos - this.startPos;
+    //YAHOO.log("offset:"+offsetX,"warn");
+    //YAHOO.log("startwidth:"+this.startWidth + " and offset:"+offsetX,"warn");
+    var newWidth = this.startWidth + offsetX;
+    //YAHOO.log("newwidth:"+newWidth,"warn");
+
+    if(newWidth < this.minWidth) {
+        newWidth = this.minWidth;
+    }
+
+    // Resize the Column
+    var oDataTable = this.datatable;
+    var elCell = this.cell;
+
+    //YAHOO.log("newwidth" + newWidth,"warn");
+    //YAHOO.log(newWidth + " AND "+ elColumn.offsetWidth + " AND " + elColumn.id,"warn");
+
+    // Resize the other Columns
+    if(oDataTable.fixedWidth) {
+        // Moving right or left?
+        var sib = elCell.nextSibling;
+        //var sibIndex = elCell.index + 1;
+        var sibnewwidth = sib.offsetWidth - offsetX;
+        if(sibnewwidth < this.sibMinWidth) {
+            sibnewwidth = this.sibMinWidth;
+        }
+
+        //TODO: how else to cycle through all the Columns without having to use an index property?
+        for(var i=0; i<oDataTable._oColumnSet.length; i++) {
+            //if((i != elCell.index) &&  (i!=sibIndex)) {
+            //    YAHOO.util.Dom.get(oDataTable._oColumnSet.keys[i].id).style.width = oDataTable._oColumnSet.keys[i].width + "px";
+            //}
+        }
+        sib.style.width = sibnewwidth;
+        elCell.style.width = newWidth + "px";
+        //oDataTable._oColumnSet.flat[sibIndex].width = sibnewwidth;
+        //oDataTable._oColumnSet.flat[elCell.index].width = newWidth;
+
+    }
+    else {
+        elCell.style.width = newWidth + "px";
+    }
+};
+
+
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * A RecordSet defines and manages a set of Records.
+ *
+ * @namespace YAHOO.widget
+ * @class RecordSet
+ * @param data {Object || Object[]} An object literal or an array of data.
+ * @constructor
+ */
+YAHOO.widget.RecordSet = function(data) {
+    // Internal variables
+    this._sName = "RecordSet instance" + YAHOO.widget.RecordSet._nCount;
+    YAHOO.widget.RecordSet._nCount++;
+    this._records = [];
+    this._length = 0;
+    
+    if(data) {
+        if(YAHOO.lang.isArray(data)) {
+            this.addRecords(data);
+        }
+        else if(data.constructor == Object) {
+            this.addRecord(data);
+        }
+    }
+
+    /**
+     * Fired when a new Record is added to the RecordSet.
+     *
+     * @event recordAddEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.data {Object} Data added.
+     */
+    this.createEvent("recordAddEvent");
+
+    /**
+     * Fired when multiple Records are added to the RecordSet at once.
+     *
+     * @event recordsAddEvent
+     * @param oArgs.records {YAHOO.widget.Record[]} An array of Record instances.
+     * @param oArgs.data {Object[]} Data added.
+     */
+    this.createEvent("recordsAddEvent");
+
+    /**
+     * Fired when a Record is updated with new data.
+     *
+     * @event recordUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.newData {Object} New data.
+     * @param oArgs.oldData {Object} Old data.
+     */
+    this.createEvent("recordUpdateEvent");
+    
+    /**
+     * Fired when a Record is deleted from the RecordSet.
+     *
+     * @event recordDeleteEvent
+     * @param oArgs.data {Object} A copy of the data held by the Record,
+     * or an array of data object literals if multiple Records were deleted at once.
+     * @param oArgs.index {Object} Index of the deleted Record.
+     */
+    this.createEvent("recordDeleteEvent");
+
+    /**
+     * Fired when multiple Records are deleted from the RecordSet at once.
+     *
+     * @event recordsDeleteEvent
+     * @param oArgs.data {Object[]} An array of data object literals copied
+     * from the Records.
+     * @param oArgs.index {Object} Index of the first deleted Record.
+     */
+    this.createEvent("recordsDeleteEvent");
+    
+    /**
+     * Fired when all Records are deleted from the RecordSet at once.
+     *
+     * @event resetEvent
+     */
+    this.createEvent("resetEvent");
+
+    /**
+     * Fired when a Record Key is updated with new data.
+     *
+     * @event keyUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.key {String} The updated key.
+     * @param oArgs.newData {Object} New data.
+     * @param oArgs.oldData {Object} Old data.
+     *
+     */
+    this.createEvent("keyUpdateEvent");
+
+    YAHOO.log("RecordSet initialized", "info", this.toString());
+};
+
+if(YAHOO.util.EventProvider) {
+    YAHOO.augment(YAHOO.widget.RecordSet, YAHOO.util.EventProvider);
+}
+else {
+    YAHOO.log("Missing dependency: YAHOO.util.EventProvider","error",this.toString());
+}
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+/**
+ * Internal class variable to name multiple Recordset instances.
+ *
+ * @property RecordSet._nCount
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.widget.RecordSet._nCount = 0;
+
+/**
+ * Unique instance name.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.RecordSet.prototype._sName = null;
+
+/**
+ * Internal variable to give unique indexes to Record instances.
+ *
+ * @property _nCount
+ * @type Number
+ * @private
+ */
+YAHOO.widget.RecordSet.prototype._nRecordCount = 0;
+
+/**
+ * Internal counter of how many Records are in the RecordSet.
+ *
+ * @property _length
+ * @type Number
+ * @private
+ */
+YAHOO.widget.RecordSet.prototype._length = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Adds one Record to the RecordSet at the given index. If index is null,
+ * then adds the Record to the end of the RecordSet.
+ *
+ * @method _addRecord
+ * @param oData {Object} An object literal of data.
+ * @param index {Number} (optional) Position index.
+ * @return {YAHOO.widget.Record} A Record instance.
+ * @private
+ */
+YAHOO.widget.RecordSet.prototype._addRecord = function(oData, index) {
+    var oRecord = new YAHOO.widget.Record(oData);
+    oRecord._nId = this._nRecordCount;
+    this._nRecordCount++;
+    
+    if(YAHOO.lang.isNumber(index) && (index > -1)) {
+        this._records.splice(index,0,oRecord);
+    }
+    else {
+        index = this.getLength();
+        this._records.push(oRecord);
+    }
+    this._length++;
+    return oRecord;
+};
+
+/**
+ * Deletes Records from the RecordSet at the given index. If range is null,
+ * then only one Record is deleted.
+ *
+ * @method _deleteRecord
+ * @param index {Number} Position index.
+ * @param range {Number} (optional) How many Records to delete
+ * @private
+ */
+YAHOO.widget.RecordSet.prototype._deleteRecord = function(index, range) {
+    if(!YAHOO.lang.isNumber(range) || (range < 0)) {
+        range = 1;
+    }
+    this._records.splice(index, range);
+    this._length = this._length - range;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Public accessor to the unique name of the RecordSet instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the RecordSet instance.
+ */
+YAHOO.widget.RecordSet.prototype.toString = function() {
+    return this._sName;
+};
+
+/**
+ * Returns the number of Records held in the RecordSet.
+ *
+ * @method getLength
+ * @return {Number} Number of records in the RecordSet.
+ */
+YAHOO.widget.RecordSet.prototype.getLength = function() {
+        return this._length;
+};
+
+/**
+ * Returns Record at given position index.
+ *
+ * @method getRecord
+ * @param index {Number} Record's Recordset position index.
+ * @return {YAHOO.widget.Record} Record object.
+ */
+YAHOO.widget.RecordSet.prototype.getRecord = function(index) {
+    if(YAHOO.lang.isNumber(index)) {
+        return this._records[index];
+    }
+    /*else if(YAHOO.lang.isString(identifier)) {
+        for(var i=0; i<this._records.length; i++) {
+            if(this._records[i].yuiRecordId == identifier) {
+                return this._records[i];
+            }
+        }
+    }*/
+    return null;
+
+};
+
+/*
+ * Returns an array of Records from the RecordSet.
+ *
+ * @method getRecords
+ * @param index {Number} (optional) Recordset position index of which Record to
+ * start at.
+ * @param range {Number} (optional) Number of Records to get.
+ * @return {YAHOO.widget.Record[]} Array of Records starting at given index and
+ * length equal to given range. If index is not given, all Records are returned.
+ */
+YAHOO.widget.RecordSet.prototype.getRecords = function(index, range) {
+    if(!YAHOO.lang.isNumber(index)) {
+        return this._records;
+    }
+    if(!YAHOO.lang.isNumber(range)) {
+        return this._records.slice(index);
+    }
+    return this._records.slice(index, index+range);
+};
+
+/**
+ * Returns position index for the given Record.
+ *
+ * @method getRecordIndex
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @return {Number} Record's RecordSet position index.
+ */
+
+YAHOO.widget.RecordSet.prototype.getRecordIndex = function(oRecord) {
+    for(var i=this._records.length-1; i>-1; i--) {
+        if(oRecord.getId() === this._records[i].getId()) {
+            return i;
+        }
+    }
+    return null;
+
+};
+
+/**
+ * Adds one Record to the RecordSet at the given index. If index is null,
+ * then adds the Record to the end of the RecordSet.
+ *
+ * @method addRecord
+ * @param oData {Object} An object literal of data.
+ * @param index {Number} (optional) Position index.
+ * @return {YAHOO.widget.Record} A Record instance.
+ */
+YAHOO.widget.RecordSet.prototype.addRecord = function(oData, index) {
+    if(oData && (oData.constructor == Object)) {
+        var oRecord = this._addRecord(oData, index);
+        this.fireEvent("recordAddEvent",{record:oRecord,data:oData});
+        YAHOO.log("Added Record at index " + index +
+                " with data " + YAHOO.lang.dump(oData), "info", this.toString());
+        return oRecord;
+    }
+    else {
+        YAHOO.log("Could not add Record with data" +
+                YAHOO.lang.dump(oData), "info", this.toString());
+        return null;
+    }
+};
+
+/**
+ * Adds multiple Records at once to the RecordSet at the given index with the
+ * given data. If index is null, then the new Records are added to the end of
+ * the RecordSet.
+ *
+ * @method addRecords
+ * @param aData {Object[]} An array of object literal data.
+ * @param index {Number} (optional) Position index.
+ * @return {YAHOO.widget.Record[]} An array of Record instances.
+ */
+YAHOO.widget.RecordSet.prototype.addRecords = function(aData, index) {
+    if(YAHOO.lang.isArray(aData)) {
+        var newRecords = [];
+        // Can't go backwards bc we need to preserve order
+        for(var i=0; i<aData.length; i++) {
+            if(aData[i] && (aData[i].constructor == Object)) {
+                var record = this._addRecord(aData[i], index);
+                newRecords.push(record);
+            }
+       }
+        this.fireEvent("recordsAddEvent",{records:newRecords,data:aData});
+        YAHOO.log("Added " + newRecords.length + " Record(s) at index " + index +
+                " with data " + YAHOO.lang.dump(aData), "info", this.toString());
+       return newRecords;
+    }
+    else if(aData && (aData.constructor == Object)) {
+        var oRecord = this._addRecord(aData);
+        this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData});
+        YAHOO.log("Added 1 Record at index " + index +
+                " with data " + YAHOO.lang.dump(aData), "info", this.toString());
+        return oRecord;
+    }
+    else {
+        YAHOO.log("Could not add Records with data " +
+                YAHOO.lang.dump(aData), "info", this.toString());
+    }
+};
+
+/**
+ * Updates given Record with given data.
+ *
+ * @method updateRecord
+ * @param record {YAHOO.widget.Record | Number} A Record instance, or Record's
+ * RecordSet position index.
+ * @param oData {Object) Object literal of new data.
+ * @return {YAHOO.widget.Record} Updated Record, or null.
+ */
+YAHOO.widget.RecordSet.prototype.updateRecord = function(record, oData) {
+    var oRecord = null;
+    if(YAHOO.lang.isNumber(record)) {
+        oRecord = this._records[record];
+    }
+    else if(record instanceof YAHOO.widget.Record) {
+        oRecord = record;
+    }
+    if(oRecord && oData && (oData.constructor == Object)) {
+        // Copy data from the Record for the event that gets fired later
+        var oldData = {};
+        for(var key in oRecord._oData) {
+            oldData[key] = oRecord._oData[key];
+        }
+        oRecord._oData = oData;
+        this.fireEvent("recordUpdateEvent",{record:oRecord,newData:oData,oldData:oldData});
+        YAHOO.log("Record at index " + this.getRecordIndex(oRecord) +
+                " updated with data " + YAHOO.lang.dump(oData), "info", this.toString());
+        return oRecord;
+    }
+    else {
+        YAHOO.log("Could not update Record " + record, "error", this.toString());
+        return null;
+    }
+};
+
+/**
+ * Updates given Record at given key with given data.
+ *
+ * @method updateKey
+ * @param record {YAHOO.widget.Record | Number} A Record instance, or Record's
+ * RecordSet position index.
+ * @param sKey {String} Key name.
+ * @param oData {Object) New data.
+ */
+YAHOO.widget.RecordSet.prototype.updateKey = function(record, sKey, oData) {
+    var oRecord;
+    
+    if(YAHOO.lang.isNumber(record)) {
+        oRecord = this._records[record];
+    }
+    if(record instanceof YAHOO.widget.Record) {
+        oRecord = record;
+
+        var oldData = null;
+        var keyValue = oRecord._oData[sKey];
+        // Copy data from the Record for the event that gets fired later
+        if(keyValue && keyValue.constructor == Object) {
+            oldData = {};
+            for(var key in keyValue) {
+                oldData[key] = keyValue[key];
+            }
+        }
+        // Copy by value
+        else {
+            oldData = keyValue;
+        }
+
+        oRecord._oData[sKey] = oData;
+        this.fireEvent("keyUpdateEvent",{record:oRecord,key:sKey,newData:oData,oldData:oldData});
+        YAHOO.log("Key \"" + sKey +
+                "\" for Record at index " + this.getRecordIndex(oRecord) +
+                " updated to \"" + YAHOO.lang.dump(oData) + "\"", "info", this.toString());
+    }
+    else {
+        YAHOO.log("Could not update key " + sKey + " for Record " + record, "error", this.toString());
+    }
+};
+
+/**
+ * Replaces all Records in RecordSet with new data.
+ *
+ * @method replaceRecords
+ * @param data {Object || Object[]} An object literal of data or an array of
+ * object literal data.
+ * @return {YAHOO.widget.Record || YAHOO.widget.Record[]} A Record instance or
+ * an array of Records.
+ */
+YAHOO.widget.RecordSet.prototype.replaceRecords = function(data) {
+    this.reset();
+    return this.addRecords(data);
+};
+
+/**
+ * Sorts all Records by given function.
+ *
+ * @method sortRecords
+ * @param fnSort {Function} Reference to a sort function.
+ * @param desc {Boolean} True if sort direction is descending, false if sort
+ * direction is ascending.
+ * @return {YAHOO.widget.Record[]} Sorted array of Records.
+ */
+YAHOO.widget.RecordSet.prototype.sortRecords = function(fnSort, desc) {
+    return this._records.sort(function(a, b) {return fnSort(a, b, desc);});
+};
+
+
+/**
+ * Removes the Record at the given position index from the RecordSet. If a range
+ * is also provided, removes that many Records, starting from the index. Length
+ * of RecordSet is correspondingly shortened.
+ *
+ * @method deleteRecord
+ * @param index {Number} Record's RecordSet position index.
+ * @param range {Number} (optional) How many Records to delete.
+ * @return {Object} A copy of the data held by the deleted Record.
+ */
+YAHOO.widget.RecordSet.prototype.deleteRecord = function(index) {
+    if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
+        // Copy data from the Record for the event that gets fired later
+        var oRecordData = this.getRecord(index).getData();
+        var oData = {};
+        for(var key in oRecordData) {
+            oData[key] = oRecordData[key];
+        }
+        
+        this._deleteRecord(index);
+        this.fireEvent("recordDeleteEvent",{data:oData,index:index});
+        YAHOO.log("Record deleted at index " + index +
+                " and containing data " + YAHOO.lang.dump(oData), "info", this.toString());
+        return oData;
+    }
+    else {
+        YAHOO.log("Could not delete Record at index " + index, "error", this.toString());
+        return null;
+    }
+};
+
+/**
+ * Removes the Record at the given position index from the RecordSet. If a range
+ * is also provided, removes that many Records, starting from the index. Length
+ * of RecordSet is correspondingly shortened.
+ *
+ * @method deleteRecords
+ * @param index {Number} Record's RecordSet position index.
+ * @param range {Number} (optional) How many Records to delete.
+ */
+YAHOO.widget.RecordSet.prototype.deleteRecords = function(index, range) {
+    if(!YAHOO.lang.isNumber(range)) {
+        range = 1;
+    }
+    if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
+        var recordsToDelete = this.getRecords(index, range);
+        // Copy data from each Record for the event that gets fired later
+        var deletedData = [];
+        for(var i=0; i<recordsToDelete.length; i++) {
+            var oData = {};
+            for(var key in recordsToDelete[i]) {
+                oData[key] = recordsToDelete[i][key];
+            }
+            deletedData.push(oData);
+        }
+        this._deleteRecord(index, range);
+
+        this.fireEvent("recordsDeleteEvent",{data:deletedData,index:index});
+        YAHOO.log(range + "Record(s) deleted at index " + index +
+                " and containing data " + YAHOO.lang.dump(deletedData), "info", this.toString());
+
+    }
+    else {
+        YAHOO.log("Could not delete Records at index " + index, "error", this.toString());
+    }
+};
+
+/**
+ * Deletes all Records from the RecordSet.
+ *
+ * @method reset
+ */
+YAHOO.widget.RecordSet.prototype.reset = function() {
+    this._records = [];
+    this._length = 0;
+    this.fireEvent("resetEvent");
+    YAHOO.log("All Records deleted from RecordSet", "info", this.toString());
+};
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The Record class defines a DataTable record.
+ *
+ * @namespace YAHOO.widget
+ * @class Record
+ * @constructor
+ * @param oConfigs {Object} (optional) Object literal of key/value pairs.
+ */
+YAHOO.widget.Record = function(oLiteral) {
+    this._oData = {};
+    if(oLiteral && (oLiteral.constructor == Object)) {
+        for(var sKey in oLiteral) {
+            this._oData[sKey] = oLiteral[sKey];
+        }
+    }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+/**
+ * Unique number assigned at instantiation, indicates original order within
+ * RecordSet.
+ *
+ * @property _nId
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Record.prototype._nId = null;
+
+/**
+ * Holds data for the Record in an object literal.
+ *
+ * @property _oData
+ * @type Object
+ * @private
+ */
+YAHOO.widget.Record.prototype._oData = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Returns unique number assigned at instantiation, indicates original order
+ * within RecordSet.
+ *
+ * @method getId
+ * @return Number
+ */
+YAHOO.widget.Record.prototype.getId = function() {
+    return this._nId;
+};
+
+/**
+ * Returns data for the Record for a key if given, or the entire object
+ * literal otherwise.
+ *
+ * @method getData
+ * @param sKey {String} (Optional) The key to retrieve a single data value.
+ * @return Object
+ */
+YAHOO.widget.Record.prototype.getData = function(sKey) {
+    if(YAHOO.lang.isString(sKey)) {
+        return this._oData[sKey];
+    }
+    else {
+        return this._oData;
+    }
+};
+
+
+YAHOO.register("datatable", YAHOO.widget.DataTable, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/datatable/datatable-beta-min.js b/lib/yui/datatable/datatable-beta-min.js
new file mode 100755 (executable)
index 0000000..eddaa48
--- /dev/null
@@ -0,0 +1,486 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
+YAHOO.widget.DataTable=function(elContainer,aColumnDefs,oDataSource,oConfigs){this._nIndex=YAHOO.widget.DataTable._nCount;this._sName="instance"+this._nIndex;this.id="yui-dt"+this._nIndex;this._initContainerEl(elContainer);if(!this._elContainer){return;}
+this._initConfigs(oConfigs);this._initColumnSet(aColumnDefs);if(!this._oColumnSet){return;}
+this._initRecordSet();if(!this._oRecordSet){return;}
+this._initDataSource(oDataSource);if(!this._oDataSource){return;}
+if(this._oDataSource.dataType==YAHOO.util.DataSource.TYPE_HTMLTABLE){this._oDataSource.sendRequest(this.get("initialRequest"),this._onDataReturnEnhanceTable,this);}
+else{this._initTableEl();if(!this._elTable||!this._elThead||!this._elTbody){return;}
+YAHOO.widget.DataTable.superclass.constructor.call(this,this._elContainer,this._oConfigs);if(this._oConfigs&&this._oConfigs.paginator){this.updatePaginator(this._oConfigs.paginator);}
+this._oDataSource.sendRequest(this.get("initialRequest"),this.onDataReturnInitializeTable,this);}
+this._initCellEditorEl();this._initColumnSort();this._initDomEvents();YAHOO.widget.DataTable._nCount++;};if(YAHOO.util.Element){YAHOO.lang.extend(YAHOO.widget.DataTable,YAHOO.util.Element);}
+else{}
+YAHOO.widget.DataTable.prototype.initAttributes=function(oConfigs){oConfigs=oConfigs||{};YAHOO.widget.DataTable.superclass.initAttributes.call(this,oConfigs);this.setAttributeConfig("summary",{value:null,validator:YAHOO.lang.isString,method:function(sSummary){this._elTable.summary=sSummary;}});this.setAttributeConfig("selectionMode",{value:"standard",validator:YAHOO.lang.isString});this.setAttributeConfig("initialRequest",{value:"",validator:YAHOO.lang.isString});this.setAttributeConfig("sortedBy",{value:null,validator:function(oNewSortedBy){return(oNewSortedBy&&(oNewSortedBy.constructor==Object)&&oNewSortedBy.key);},method:function(oNewSortedBy){var oOldSortedBy=this.get("sortedBy");if(oOldSortedBy&&(oOldSortedBy.constructor==Object)&&oOldSortedBy.key){var oldColumn=this._oColumnSet.getColumn(oOldSortedBy.key);var oldThEl=this.getThEl(oldColumn);YAHOO.util.Dom.removeClass(oldThEl,YAHOO.widget.DataTable.CLASS_ASC);YAHOO.util.Dom.removeClass(oldThEl,YAHOO.widget.DataTable.CLASS_DESC);}
+var column=(oNewSortedBy.column)?oNewSortedBy.column:this._oColumnSet.getColumn(oNewSortedBy.key);if(column){var newClass=(oNewSortedBy.dir&&(oNewSortedBy.dir!="asc"))?YAHOO.widget.DataTable.CLASS_DESC:YAHOO.widget.DataTable.CLASS_ASC;YAHOO.util.Dom.addClass(this.id+"-col"+column.getId(),newClass);}}});this.setAttributeConfig("paginator",{value:{rowsPerPage:500,currentPage:1,startRecordIndex:0,totalRecords:0,totalPages:0,rowsThisPage:0,pageLinks:0,pageLinksStart:1,dropdownOptions:null,containers:[],dropdowns:[],links:[]},validator:function(oNewPaginator){if(oNewPaginator&&(oNewPaginator.constructor==Object)){if((oNewPaginator.rowsPerPage!==undefined)&&(oNewPaginator.currentPage!==undefined)&&(oNewPaginator.startRecordIndex!==undefined)&&(oNewPaginator.totalRecords!==undefined)&&(oNewPaginator.totalPages!==undefined)&&(oNewPaginator.rowsThisPage!==undefined)&&(oNewPaginator.pageLinks!==undefined)&&(oNewPaginator.pageLinksStart!==undefined)&&(oNewPaginator.dropdownOptions!==undefined)&&(oNewPaginator.containers!==undefined)&&(oNewPaginator.dropdowns!==undefined)&&(oNewPaginator.links!==undefined)){if(YAHOO.lang.isNumber(oNewPaginator.rowsPerPage)&&YAHOO.lang.isNumber(oNewPaginator.currentPage)&&YAHOO.lang.isNumber(oNewPaginator.startRecordIndex)&&YAHOO.lang.isNumber(oNewPaginator.totalRecords)&&YAHOO.lang.isNumber(oNewPaginator.totalPages)&&YAHOO.lang.isNumber(oNewPaginator.rowsThisPage)&&YAHOO.lang.isNumber(oNewPaginator.pageLinks)&&YAHOO.lang.isNumber(oNewPaginator.pageLinksStart)&&YAHOO.lang.isArray(oNewPaginator.dropdownOptions)&&YAHOO.lang.isArray(oNewPaginator.containers)&&YAHOO.lang.isArray(oNewPaginator.dropdowns)&&YAHOO.lang.isArray(oNewPaginator.links)){return true;}}}
+return false;}});this.setAttributeConfig("paginated",{value:false,validator:YAHOO.lang.isBoolean,method:function(oParam){var oPaginator=this.get("paginator");var aContainerEls=oPaginator.containers;if(oParam){if(aContainerEls.length===0){var pag0=document.createElement("span");pag0.id=this.id+"-paginator0";YAHOO.util.Dom.addClass(pag0,YAHOO.widget.DataTable.CLASS_PAGINATOR);pag0=this._elContainer.insertBefore(pag0,this._elTable);aContainerEls.push(pag0);var pag1=document.createElement("span");pag1.id=this.id+"-paginator1";YAHOO.util.Dom.addClass(pag1,YAHOO.widget.DataTable.CLASS_PAGINATOR);pag1=this._elContainer.insertBefore(pag1,this._elTable.nextSibling);aContainerEls.push(pag1);this._configs.paginator.value.containers=[pag0,pag1];}
+else{for(var i=0;i<aContainerEls.length;i++){aContainerEls[i].style.display="";}}
+if(oPaginator.pageLinks>-1){var aLinkEls=oPaginator.links;if(aLinkEls.length===0){for(i=0;i<aContainerEls.length;i++){var linkEl=document.createElement("span");linkEl.id="yui-dt-pagselect"+i;linkEl=aContainerEls[i].appendChild(linkEl);YAHOO.util.Event.addListener(linkEl,"click",this._onPaginatorLinkClick,this);this._configs.paginator.value.links.push(linkEl);}}}
+var dropdownOptions=oPaginator.dropdownOptions||[];for(i=0;i<aContainerEls.length;i++){var selectEl=document.createElement("select");YAHOO.util.Dom.addClass(selectEl,YAHOO.widget.DataTable.CLASS_DROPDOWN);selectEl=aContainerEls[i].appendChild(selectEl);selectEl.id="yui-dt-pagselect"+i;YAHOO.util.Event.addListener(selectEl,"change",this._onPaginatorDropdownChange,this);this._configs.paginator.value.dropdowns.push(selectEl);if(!oPaginator.dropdownOptions){selectEl.style.display="none";}}}
+else{if(aContainerEls.length>0){for(i=0;i<aContainerEls.length;i++){aContainerEls[i].style.display="none";}}}}});this.setAttributeConfig("caption",{value:null,validator:YAHOO.lang.isString,method:function(sCaption){if(!this._elCaption){if(!this._elTable.firstChild){this._elCaption=this._elTable.appendChild(document.createElement("caption"));}
+else{this._elCaption=this._elTable.insertBefore(document.createElement("caption"),this._elTable.firstChild);}}
+this._elCaption.innerHTML=sCaption;}});this.setAttributeConfig("scrollable",{value:false,validator:function(oParam){return(YAHOO.lang.isBoolean(oParam)&&!YAHOO.lang.isString(this.get("caption")));},method:function(oParam){if(oParam){YAHOO.util.Dom.addClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);}
+else{YAHOO.util.Dom.removeClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);YAHOO.util.Dom.removeClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);}}});};YAHOO.widget.DataTable.CLASS_TABLE="yui-dt-table";YAHOO.widget.DataTable.CLASS_HEADER="yui-dt-header";YAHOO.widget.DataTable.CLASS_BODY="yui-dt-body";YAHOO.widget.DataTable.CLASS_SCROLLBODY="yui-dt-scrollbody";YAHOO.widget.DataTable.CLASS_LABEL="yui-dt-label";YAHOO.widget.DataTable.CLASS_RESIZER="yui-dt-resizer";YAHOO.widget.DataTable.CLASS_EDITOR="yui-dt-editor";YAHOO.widget.DataTable.CLASS_PAGINATOR="yui-dt-paginator";YAHOO.widget.DataTable.CLASS_PAGE="yui-dt-page";YAHOO.widget.DataTable.CLASS_DEFAULT="yui-dt-default";YAHOO.widget.DataTable.CLASS_PREVIOUS="yui-dt-previous";YAHOO.widget.DataTable.CLASS_NEXT="yui-dt-next";YAHOO.widget.DataTable.CLASS_FIRST="yui-dt-first";YAHOO.widget.DataTable.CLASS_LAST="yui-dt-last";YAHOO.widget.DataTable.CLASS_EVEN="yui-dt-even";YAHOO.widget.DataTable.CLASS_ODD="yui-dt-odd";YAHOO.widget.DataTable.CLASS_SELECTED="yui-dt-selected";YAHOO.widget.DataTable.CLASS_HIGHLIGHTED="yui-dt-highlighted";YAHOO.widget.DataTable.CLASS_DISABLED="yui-dt-disabled";YAHOO.widget.DataTable.CLASS_EMPTY="yui-dt-empty";YAHOO.widget.DataTable.CLASS_LOADING="yui-dt-loading";YAHOO.widget.DataTable.CLASS_ERROR="yui-dt-error";YAHOO.widget.DataTable.CLASS_EDITABLE="yui-dt-editable";YAHOO.widget.DataTable.CLASS_SCROLLABLE="yui-dt-scrollable";YAHOO.widget.DataTable.CLASS_SORTABLE="yui-dt-sortable";YAHOO.widget.DataTable.CLASS_ASC="yui-dt-asc";YAHOO.widget.DataTable.CLASS_DESC="yui-dt-desc";YAHOO.widget.DataTable.CLASS_BUTTON="yui-dt-button";YAHOO.widget.DataTable.CLASS_DROPDOWN="yui-dt-dropdown";YAHOO.widget.DataTable.CLASS_CHECKBOX="yui-dt-checkbox";YAHOO.widget.DataTable.MSG_EMPTY="No records found.";YAHOO.widget.DataTable.MSG_LOADING="Loading data...";YAHOO.widget.DataTable.MSG_ERROR="Data error.";YAHOO.widget.DataTable._nCount=0;YAHOO.widget.DataTable.prototype._nIndex=null;YAHOO.widget.DataTable.prototype._nTrCount=0;YAHOO.widget.DataTable.prototype._sName=null;YAHOO.widget.DataTable.prototype._elContainer=null;YAHOO.widget.DataTable.prototype._elCaption=null;YAHOO.widget.DataTable.prototype._elTable=null;YAHOO.widget.DataTable.prototype._elThead=null;YAHOO.widget.DataTable.prototype._elTbody=null;YAHOO.widget.DataTable.prototype._elMsgTbody=null;YAHOO.widget.DataTable.prototype._elMsgTbodyRow=null;YAHOO.widget.DataTable.prototype._elMsgTbodyCell=null;YAHOO.widget.DataTable.prototype._oDataSource=null;YAHOO.widget.DataTable.prototype._oColumnSet=null;YAHOO.widget.DataTable.prototype._oRecordSet=null;YAHOO.widget.DataTable.prototype._sFirstLabelLinkId=null;YAHOO.widget.DataTable.prototype._sFirstTrId=null;YAHOO.widget.DataTable.prototype._sLastTrId=null;YAHOO.widget.DataTable.prototype._focusEl=function(el){el=el||this._elTable;setTimeout(function(){el.focus();},0);};YAHOO.widget.DataTable.prototype._initContainerEl=function(elContainer){this._elContainer=null;elContainer=YAHOO.util.Dom.get(elContainer);if(elContainer&&elContainer.tagName&&(elContainer.tagName.toLowerCase()=="div")){this._elContainer=elContainer;}};YAHOO.widget.DataTable.prototype._initConfigs=function(oConfigs){if(oConfigs){if(oConfigs.constructor!=Object){oConfigs=null;}
+else if(YAHOO.lang.isBoolean(oConfigs.paginator)){}
+this._oConfigs=oConfigs;}};YAHOO.widget.DataTable.prototype._initColumnSet=function(aColumnDefs){this._oColumnSet=null;if(YAHOO.lang.isArray(aColumnDefs)){this._oColumnSet=new YAHOO.widget.ColumnSet(aColumnDefs);}
+else if(aColumnDefs instanceof YAHOO.widget.ColumnSet){this._oColumnSet=aColumnDefs;}};YAHOO.widget.DataTable.prototype._initDataSource=function(oDataSource){this._oDataSource=null;if(oDataSource&&(oDataSource instanceof YAHOO.util.DataSource)){this._oDataSource=oDataSource;}
+else{var tmpTable=null;var tmpContainer=this._elContainer;if(tmpContainer.hasChildNodes()){var tmpChildren=tmpContainer.childNodes;for(i=0;i<tmpChildren.length;i++){if(tmpChildren[i].tagName&&tmpChildren[i].tagName.toLowerCase()=="table"){tmpTable=tmpChildren[i];break;}}
+if(tmpTable){var tmpFieldsArray=[];for(i=0;i<this._oColumnSet.keys.length;i++){tmpFieldsArray.push({key:this._oColumnSet.keys[i].key});}
+this._oDataSource=new YAHOO.util.DataSource(tmpTable);this._oDataSource.responseType=YAHOO.util.DataSource.TYPE_HTMLTABLE;this._oDataSource.responseSchema={fields:tmpFieldsArray};}}}};YAHOO.widget.DataTable.prototype._initRecordSet=function(){if(this._oRecordSet){this._oRecordSet.reset();}
+else{this._oRecordSet=new YAHOO.widget.RecordSet();}};YAHOO.widget.DataTable.prototype._initTableEl=function(){YAHOO.util.Event.purgeElement(this._elContainer,true);this._elContainer.innerHTML="";this._elTable=this._elContainer.appendChild(document.createElement("table"));var elTable=this._elTable;elTable.tabIndex=0;elTable.id=this.id+"-table";YAHOO.util.Dom.addClass(elTable,YAHOO.widget.DataTable.CLASS_TABLE);this._initTheadEl(elTable,this._oColumnSet);var elMsgTbody=document.createElement("tbody");var elMsgRow=elMsgTbody.appendChild(document.createElement("tr"));YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_FIRST);YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_LAST);this._elMsgRow=elMsgRow;var elMsgCell=elMsgRow.appendChild(document.createElement("td"));elMsgCell.colSpan=this._oColumnSet.keys.length;YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_FIRST);YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_LAST);this._elMsgTd=elMsgCell;this._elMsgTbody=elTable.appendChild(elMsgTbody);this.showTableMessage(YAHOO.widget.DataTable.MSG_LOADING,YAHOO.widget.DataTable.CLASS_LOADING);this._elTbody=elTable.appendChild(document.createElement("tbody"));YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_BODY);};YAHOO.widget.DataTable.prototype._initTheadEl=function(){var i,oColumn,colId;var oColumnSet=this._oColumnSet;this._sFirstLabelLinkId=null;var elThead=document.createElement("thead");var colTree=oColumnSet.tree;for(i=0;i<colTree.length;i++){var elTheadRow=elThead.appendChild(document.createElement("tr"));elTheadRow.id=this.id+"-hdrow"+i;var elTheadCell;for(var j=0;j<colTree[i].length;j++){oColumn=colTree[i][j];colId=oColumn.getId();elTheadCell=elTheadRow.appendChild(document.createElement("th"));elTheadCell.id=this.id+"-col"+colId;this._initThEl(elTheadCell,oColumn,i,j);}
+if(i===0){YAHOO.util.Dom.addClass(elTheadRow,YAHOO.widget.DataTable.CLASS_FIRST);}
+if(i===(colTree.length-1)){YAHOO.util.Dom.addClass(elTheadRow,YAHOO.widget.DataTable.CLASS_LAST);}}
+this._elThead=this._elTable.appendChild(elThead);var aFirstHeaders=oColumnSet.headers[0].split(" ");var aLastHeaders=oColumnSet.headers[oColumnSet.headers.length-1].split(" ");for(i=0;i<aFirstHeaders.length;i++){YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aFirstHeaders[i]),YAHOO.widget.DataTable.CLASS_FIRST);}
+for(i=0;i<aLastHeaders.length;i++){YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aLastHeaders[i]),YAHOO.widget.DataTable.CLASS_LAST);}
+var foundDD=(YAHOO.util.DD)?true:false;var needDD=false;for(i=0;i<this._oColumnSet.keys.length;i++){oColumn=this._oColumnSet.keys[i];colId=oColumn.getId();var elTheadCellId=YAHOO.util.Dom.get(this.id+"-col"+colId);if(oColumn.resizeable){if(foundDD){if(!this.fixedWidth||(this.fixedWidth&&(oColumn.getKeyIndex()!=this._oColumnSet.keys.length-1))){var elThContainer=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_HEADER,"div",elTheadCellId)[0];var elThResizer=elThContainer.appendChild(document.createElement("span"));elThResizer.id=this.id+"-resizer"+colId;YAHOO.util.Dom.addClass(elThResizer,YAHOO.widget.DataTable.CLASS_RESIZER);oColumn.ddResizer=new YAHOO.util.ColumnResizer(this,oColumn,elTheadCellId,elThResizer.id,elThResizer.id);var cancelClick=function(e){YAHOO.util.Event.stopPropagation(e);};YAHOO.util.Event.addListener(elThResizer,"click",cancelClick);}
+if(this.fixedWidth){var elThLabel=(YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",elTheadCellId))[0];elThLabel.style.overflow="hidden";}}
+else{needDD=true;}}}
+if(needDD){}};YAHOO.widget.DataTable.prototype._initThEl=function(elTheadCell,oColumn,row,col){var index=this._nIndex;var colId=oColumn.getId();elTheadCell.yuiColumnId=colId;if(oColumn.abbr){elTheadCell.abbr=oColumn.abbr;}
+if(oColumn.width){elTheadCell.style.width=oColumn.width;}
+var aCustomClasses;if(YAHOO.lang.isString(oColumn.className)){aCustomClasses=[oColumn.className];}
+else if(YAHOO.lang.isArray(oColumn.className)){aCustomClasses=oColumn.className;}
+if(aCustomClasses){for(var i=0;i<aCustomClasses.length;i++){YAHOO.util.Dom.addClass(elTheadCell,aCustomClasses[i]);}}
+YAHOO.util.Dom.addClass(elTheadCell,"yui-dt-col-"+oColumn.key);elTheadCell.innerHTML="";elTheadCell.rowSpan=oColumn.getRowspan();elTheadCell.colSpan=oColumn.getColspan();var elTheadContainer=elTheadCell.appendChild(document.createElement("div"));elTheadContainer.id=this.id+"-container"+colId;YAHOO.util.Dom.addClass(elTheadContainer,YAHOO.widget.DataTable.CLASS_HEADER);var elTheadLabel=elTheadContainer.appendChild(document.createElement("span"));elTheadLabel.id=this.id+"-label"+colId;YAHOO.util.Dom.addClass(elTheadLabel,YAHOO.widget.DataTable.CLASS_LABEL);var sLabel=YAHOO.lang.isValue(oColumn.label)?oColumn.label:oColumn.key;if(oColumn.sortable){YAHOO.util.Dom.addClass(elTheadCell,YAHOO.widget.DataTable.CLASS_SORTABLE);var sLabelLinkId=this.id+"-labellink"+colId;var sortLink="?key="+oColumn.key;elTheadLabel.innerHTML="<a id=\""+sLabelLinkId+"\" href=\""+sortLink+"\" title=\"Click to sort\" class=\""+YAHOO.widget.DataTable.CLASS_SORTABLE+"\">"+sLabel+"</a>";if(!this._sFirstLabelLinkId){this._sFirstLabelLinkId=sLabelLinkId;}}
+else{elTheadLabel.innerHTML=sLabel;}};YAHOO.widget.DataTable.prototype._initCellEditorEl=function(){var elCellEditor=document.createElement("div");elCellEditor.id=this.id+"-celleditor";elCellEditor.style.display="none";YAHOO.util.Dom.addClass(elCellEditor,YAHOO.widget.DataTable.CLASS_EDITOR);elCellEditor=document.body.appendChild(elCellEditor);var oCellEditor={};oCellEditor.container=elCellEditor;oCellEditor.value=null;oCellEditor.isActive=false;this._oCellEditor=oCellEditor;this.subscribe("editorKeydownEvent",function(oArgs){var e=oArgs.event;var elTarget=YAHOO.util.Event.getTarget(e);if((e.keyCode==27)){this.cancelCellEditor();}});};YAHOO.widget.DataTable.prototype._initColumnSort=function(){this.subscribe("headerCellClickEvent",this.onEventSortColumn);};YAHOO.widget.DataTable.prototype._initDomEvents=function(){var elTable=this._elTable;var elThead=this._elThead;var elTbody=this._elTbody;var elContainer=this._elContainer;YAHOO.util.Event.addListener(document,"click",this._onDocumentClick,this);YAHOO.util.Event.addListener(document,"keydown",this._onDocumentKeydown,this);YAHOO.util.Event.addListener(elTable,"focus",this._onTableFocus,this);YAHOO.util.Event.addListener(elTable,"mouseover",this._onTableMouseover,this);YAHOO.util.Event.addListener(elTable,"mouseout",this._onTableMouseout,this);YAHOO.util.Event.addListener(elTable,"mousedown",this._onTableMousedown,this);YAHOO.util.Event.addListener(elTable,"keydown",this._onTableKeydown,this);YAHOO.util.Event.addListener(elTable,"keypress",this._onTableKeypress,this);YAHOO.util.Event.addListener(elTable,"dblclick",this._onTableDblclick,this);YAHOO.util.Event.addListener(elThead,"click",this._onTheadClick,this);YAHOO.util.Event.addListener(elTbody,"click",this._onTbodyClick,this);YAHOO.util.Event.addListener(elContainer,"scroll",this._onScroll,this);YAHOO.util.Event.addListener(elTbody,"scroll",this._onScroll,this);};YAHOO.widget.DataTable.prototype._addTrEl=function(oRecord,index){this.hideTableMessage();var append=(!YAHOO.lang.isNumber(index)||(index<0)||(index>=(this._elTbody.rows.length)))?true:false;var oColumnSet=this._oColumnSet;var oRecordSet=this._oRecordSet;var isSortedBy=this.get("sortedBy");var sortedColKeyIndex=null;var sortedDir,newClass;if(isSortedBy){sortedColKeyIndex=(isSortedBy.column)?isSortedBy.column.getKeyIndex():this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();sortedDir=isSortedBy.dir;newClass=(sortedDir==="desc")?YAHOO.widget.DataTable.CLASS_DESC:YAHOO.widget.DataTable.CLASS_ASC;}
+var elRow=(append)?this._elTbody.appendChild(document.createElement("tr")):this._elTbody.insertBefore(document.createElement("tr"),this._elTbody.rows[index]);elRow.id=this.id+"-bdrow"+this._nTrCount;this._nTrCount++;elRow.yuiRecordId=oRecord.getId();for(var j=0;j<oColumnSet.keys.length;j++){var oColumn=oColumnSet.keys[j];var elCell=elRow.appendChild(document.createElement("td"));elCell.id=elRow.id+"-cell"+j;elCell.yuiColumnId=oColumn.getId();elCell.headers=oColumnSet.headers[j];elCell.yuiCellIndex=j;this.formatCell(elCell,oRecord,oColumn);if(j===0){YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_FIRST);}
+else if(j===this._oColumnSet.keys.length-1){YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_LAST);}
+YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_ASC);YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_DESC);if(j===sortedColKeyIndex){newClass=(sortedDir==="desc")?YAHOO.widget.DataTable.CLASS_DESC:YAHOO.widget.DataTable.CLASS_ASC;YAHOO.util.Dom.addClass(elCell,newClass);}
+if(this.fixedWidth){elCell.style.overflow="hidden";}}
+return elRow.id;};YAHOO.widget.DataTable.prototype._updateTrEl=function(elRow,oRecord){this.hideTableMessage();var isSortedBy=this.get("sortedBy");var sortedColKeyIndex=null;var sortedDir,newClass;if(isSortedBy){sortedColKeyIndex=(isSortedBy.column)?isSortedBy.column.getKeyIndex():this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();sortedDir=isSortedBy.dir;newClass=(sortedDir==="desc")?YAHOO.widget.DataTable.CLASS_DESC:YAHOO.widget.DataTable.CLASS_ASC;}
+for(var j=0;j<elRow.cells.length;j++){var oColumn=this._oColumnSet.keys[j];var elCell=elRow.cells[j];this.formatCell(elCell,oRecord,oColumn);YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_ASC);YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_DESC);if(j===sortedColKeyIndex){YAHOO.util.Dom.addClass(elCell,newClass);}}
+elRow.yuiRecordId=oRecord.getId();return elRow.id;};YAHOO.widget.DataTable.prototype._deleteTrEl=function(row){var rowIndex;if(!YAHOO.lang.isNumber(row)){rowIndex=YAHOO.util.Dom.get(row).sectionRowIndex;}
+else{rowIndex=row;}
+if(YAHOO.lang.isNumber(rowIndex)&&(rowIndex>-2)&&(rowIndex<this._elTbody.rows.length)){this._elTbody.deleteRow(rowIndex);return true;}
+else{return false;}};YAHOO.widget.DataTable.prototype._setFirstRow=function(){var rowEl=this.getFirstTrEl();if(rowEl){if(this._sFirstTrId){YAHOO.util.Dom.removeClass(this._sFirstTrId,YAHOO.widget.DataTable.CLASS_FIRST);}
+YAHOO.util.Dom.addClass(rowEl,YAHOO.widget.DataTable.CLASS_FIRST);this._sFirstTrId=rowEl.id;}
+else{this._sFirstTrId=null;}};YAHOO.widget.DataTable.prototype._setLastRow=function(){var rowEl=this.getLastTrEl();if(rowEl){if(this._sLastTrId){YAHOO.util.Dom.removeClass(this._sLastTrId,YAHOO.widget.DataTable.CLASS_LAST);}
+YAHOO.util.Dom.addClass(rowEl,YAHOO.widget.DataTable.CLASS_LAST);this._sLastTrId=rowEl.id;}
+else{this._sLastTrId=null;}};YAHOO.widget.DataTable.prototype._setRowStripes=function(row,range){var allRows=this._elTbody.rows;var nStartIndex=0;var nEndIndex=allRows.length;if((row!==null)&&(row!==undefined)){var elStartRow=this.getTrEl(row);if(elStartRow){nStartIndex=elStartRow.sectionRowIndex;if(YAHOO.lang.isNumber(range)&&(range>1)){nEndIndex=nStartIndex+range;}}}
+for(var i=nStartIndex;i<nEndIndex;i++){if(i%2){YAHOO.util.Dom.removeClass(allRows[i],YAHOO.widget.DataTable.CLASS_EVEN);YAHOO.util.Dom.addClass(allRows[i],YAHOO.widget.DataTable.CLASS_ODD);}
+else{YAHOO.util.Dom.removeClass(allRows[i],YAHOO.widget.DataTable.CLASS_ODD);YAHOO.util.Dom.addClass(allRows[i],YAHOO.widget.DataTable.CLASS_EVEN);}}};YAHOO.widget.DataTable.prototype._onScroll=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(oSelf._oCellEditor.isActive){oSelf.fireEvent("editorBlurEvent",{editor:oSelf._oCellEditor});oSelf.cancelCellEditor();}
+oSelf.fireEvent("tableScrollEvent",{event:e,target:elTarget});};YAHOO.widget.DataTable.prototype._onDocumentClick=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(!YAHOO.util.Dom.isAncestor(oSelf._elTable,elTarget)){oSelf.fireEvent("tableBlurEvent");if(oSelf._oCellEditor&&oSelf._oCellEditor.isActive){if(!YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container,elTarget)&&(oSelf._oCellEditor.container.id!==elTarget.id)){oSelf.fireEvent("editorBlurEvent",{editor:oSelf._oCellEditor});}}}};YAHOO.widget.DataTable.prototype._onDocumentKeydown=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(oSelf._oCellEditor&&oSelf._oCellEditor.isActive&&YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container,elTarget)){oSelf.fireEvent("editorKeydownEvent",{editor:oSelf._oCellEditor,event:e});}};YAHOO.widget.DataTable.prototype._onTableMouseover=function(e,oSelf){oSelf.fireEvent("tableFocusEvent");};YAHOO.widget.DataTable.prototype._onTableMouseover=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();while(elTarget&&(elTag!="table")){switch(elTag){case"body":break;case"a":break;case"td":oSelf.fireEvent("cellMouseoverEvent",{target:elTarget,event:e});break;case"span":if(YAHOO.util.Dom.hasClass(elTarget,YAHOO.widget.DataTable.CLASS_LABEL)){oSelf.fireEvent("headerLabelMouseoverEvent",{target:elTarget,event:e});}
+break;case"th":oSelf.fireEvent("headerCellMouseoverEvent",{target:elTarget,event:e});break;case"tr":if(elTarget.parentNode.tagName.toLowerCase()=="thead"){oSelf.fireEvent("headerRowMouseoverEvent",{target:elTarget,event:e});}
+else{oSelf.fireEvent("rowMouseoverEvent",{target:elTarget,event:e});}
+break;default:break;}
+elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
+oSelf.fireEvent("tableMouseoverEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onTableMouseout=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();while(elTarget&&(elTag!="table")){switch(elTag){case"body":break;case"a":break;case"td":oSelf.fireEvent("cellMouseoutEvent",{target:elTarget,event:e});break;case"span":if(YAHOO.util.Dom.hasClass(elTarget,YAHOO.widget.DataTable.CLASS_LABEL)){oSelf.fireEvent("headerLabelMouseoutEvent",{target:elTarget,event:e});}
+break;case"th":oSelf.fireEvent("headerCellMouseoutEvent",{target:elTarget,event:e});break;case"tr":if(elTarget.parentNode.tagName.toLowerCase()=="thead"){oSelf.fireEvent("headerRowMouseoutEvent",{target:elTarget,event:e});}
+else{oSelf.fireEvent("rowMouseoutEvent",{target:elTarget,event:e});}
+break;default:break;}
+elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
+oSelf.fireEvent("tableMouseoutEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onTableMousedown=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();while(elTarget&&(elTag!="table")){switch(elTag){case"body":break;case"a":break;case"td":oSelf.fireEvent("cellMousedownEvent",{target:elTarget,event:e});break;case"span":if(YAHOO.util.Dom.hasClass(elTarget,YAHOO.widget.DataTable.CLASS_LABEL)){oSelf.fireEvent("headerLabelMousedownEvent",{target:elTarget,event:e});}
+break;case"th":oSelf.fireEvent("headerCellMousedownEvent",{target:elTarget,event:e});break;case"tr":if(elTarget.parentNode.tagName.toLowerCase()=="thead"){oSelf.fireEvent("headerRowMousedownEvent",{target:elTarget,event:e});}
+else{oSelf.fireEvent("rowMousedownEvent",{target:elTarget,event:e});}
+break;default:break;}
+elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
+oSelf.fireEvent("tableMousedownEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onTableDblclick=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();while(elTarget&&(elTag!="table")){switch(elTag){case"body":break;case"td":oSelf.fireEvent("cellDblclickEvent",{target:elTarget,event:e});break;case"span":if(YAHOO.util.Dom.hasClass(elTarget,YAHOO.widget.DataTable.CLASS_LABEL)){oSelf.fireEvent("headerLabelDblclickEvent",{target:elTarget,event:e});}
+break;case"th":oSelf.fireEvent("headerCellDblclickEvent",{target:elTarget,event:e});break;case"tr":if(elTarget.parentNode.tagName.toLowerCase()=="thead"){oSelf.fireEvent("headerRowDblclickEvent",{target:elTarget,event:e});}
+else{oSelf.fireEvent("rowDblclickEvent",{target:elTarget,event:e});}
+break;default:break;}
+elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
+oSelf.fireEvent("tableDblclickEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onTableKeydown=function(e,oSelf){var bSHIFT=e.shiftKey;var elTarget=YAHOO.util.Event.getTarget(e);if(YAHOO.util.Dom.isAncestor(oSelf._elThead,elTarget)){return;}
+var nKey=YAHOO.util.Event.getCharCode(e);if(nKey===9&&!bSHIFT&&(elTarget.id===oSelf._elTable.id)){if(oSelf._sFirstLabelLinkId){YAHOO.util.Event.stopEvent(e);oSelf._focusEl(YAHOO.util.Dom.get(oSelf._sFirstLabelLinkId));}
+return;}
+var lastSelectedId=oSelf._sLastSelectedId;var lastSelectedEl=YAHOO.util.Dom.get(lastSelectedId);if(lastSelectedEl&&oSelf.isSelected(lastSelectedEl)){if((nKey>36)&&(nKey<41)){YAHOO.util.Event.stopEvent(e);}
+else{return;}
+var sMode=oSelf.get("selectionMode");var allRows=oSelf._elTbody.rows;var anchorId=oSelf._sSelectionAnchorId;var anchorEl=YAHOO.util.Dom.get(anchorId);var newSelectedEl,trIndex,tdIndex,startIndex,endIndex,i,anchorPos;if(bSHIFT&&(sMode=="cellblock")){trIndex=lastSelectedEl.parentNode.sectionRowIndex;tdIndex=lastSelectedEl.yuiCellIndex;if(nKey==40){if(anchorEl.parentNode.sectionRowIndex>trIndex){anchorPos=1;}
+else if(anchorEl.parentNode.sectionRowIndex<trIndex){anchorPos=-1;}
+else{anchorPos=0;}
+startIndex=Math.min(anchorEl.yuiCellIndex,tdIndex);endIndex=Math.max(anchorEl.yuiCellIndex,tdIndex);if(anchorPos<=0){if(trIndex<allRows.length-1){for(i=startIndex;i<=endIndex;i++){newSelectedEl=allRows[trIndex+1].cells[i];oSelf.selectCell(newSelectedEl);}
+oSelf._sLastSelectedId=allRows[trIndex+1].cells[tdIndex].id;}}
+else{for(i=startIndex;i<=endIndex;i++){oSelf.unselectCell(allRows[trIndex].cells[i]);}
+oSelf._sLastSelectedId=allRows[trIndex+1].cells[tdIndex].id;}}
+else if(nKey==38){if(anchorEl.parentNode.sectionRowIndex>trIndex){anchorPos=1;}
+else if(anchorEl.parentNode.sectionRowIndex<trIndex){anchorPos=-1;}
+else{anchorPos=0;}
+startIndex=Math.min(anchorEl.yuiCellIndex,tdIndex);endIndex=Math.max(anchorEl.yuiCellIndex,tdIndex);if(anchorPos>=0){if(trIndex>0){for(i=startIndex;i<=endIndex;i++){newSelectedEl=allRows[trIndex-1].cells[i];oSelf.selectCell(newSelectedEl);}
+oSelf._sLastSelectedId=allRows[trIndex-1].cells[tdIndex].id;}}
+else{for(i=startIndex;i<=endIndex;i++){oSelf.unselectCell(allRows[trIndex].cells[i]);}
+oSelf._sLastSelectedId=allRows[trIndex-1].cells[tdIndex].id;}}
+else if(nKey==39){if(anchorEl.yuiCellIndex>tdIndex){anchorPos=1;}
+else if(anchorEl.yuiCellIndex<tdIndex){anchorPos=-1;}
+else{anchorPos=0;}
+if(anchorPos<=0){if(tdIndex<allRows[trIndex].cells.length-1){startIndex=Math.min(anchorEl.parentNode.sectionRowIndex,trIndex);endIndex=Math.max(anchorEl.parentNode.sectionRowIndex,trIndex);for(i=startIndex;i<=endIndex;i++){newSelectedEl=allRows[i].cells[tdIndex+1];oSelf.selectCell(newSelectedEl);}
+oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex+1].id;}}
+else{startIndex=Math.min(anchorEl.parentNode.sectionRowIndex,trIndex);endIndex=Math.max(anchorEl.parentNode.sectionRowIndex,trIndex);for(i=startIndex;i<=endIndex;i++){oSelf.unselectCell(allRows[i].cells[tdIndex]);}
+oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex+1].id;}}
+else if(nKey==37){if(anchorEl.yuiCellIndex>tdIndex){anchorPos=1;}
+else if(anchorEl.yuiCellIndex<tdIndex){anchorPos=-1;}
+else{anchorPos=0;}
+if(anchorPos>=0){if(tdIndex>0){startIndex=Math.min(anchorEl.parentNode.sectionRowIndex,trIndex);endIndex=Math.max(anchorEl.parentNode.sectionRowIndex,trIndex);for(i=startIndex;i<=endIndex;i++){newSelectedEl=allRows[i].cells[tdIndex-1];oSelf.selectCell(newSelectedEl);}
+oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex-1].id;}}
+else{startIndex=Math.min(anchorEl.parentNode.sectionRowIndex,trIndex);endIndex=Math.max(anchorEl.parentNode.sectionRowIndex,trIndex);for(i=startIndex;i<=endIndex;i++){oSelf.unselectCell(allRows[i].cells[tdIndex]);}
+oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex-1].id;}}}
+else if(bSHIFT&&(sMode=="cellrange")){trIndex=lastSelectedEl.parentNode.sectionRowIndex;tdIndex=lastSelectedEl.yuiCellIndex;if(anchorEl.parentNode.sectionRowIndex>trIndex){anchorPos=1;}
+else if(anchorEl.parentNode.sectionRowIndex<trIndex){anchorPos=-1;}
+else{anchorPos=0;}
+if(nKey==40){if(anchorPos<=0){for(i=tdIndex+1;i<allRows[trIndex].cells.length;i++){newSelectedEl=allRows[trIndex].cells[i];oSelf.selectCell(newSelectedEl);}
+if(trIndex<allRows.length-1){for(i=0;i<=tdIndex;i++){newSelectedEl=allRows[trIndex+1].cells[i];oSelf.selectCell(newSelectedEl);}}}
+else{for(i=tdIndex;i<allRows[trIndex].cells.length;i++){oSelf.unselectCell(allRows[trIndex].cells[i]);}
+for(i=0;i<tdIndex;i++){oSelf.unselectCell(allRows[trIndex+1].cells[i]);}
+oSelf._sLastSelectedId=allRows[trIndex+1].cells[tdIndex].id;}}
+else if(nKey==38){if(anchorPos>=0){for(i=tdIndex-1;i>-1;i--){newSelectedEl=allRows[trIndex].cells[i];oSelf.selectCell(newSelectedEl);}
+if(trIndex>0){for(i=allRows[trIndex].cells.length-1;i>=tdIndex;i--){newSelectedEl=allRows[trIndex-1].cells[i];oSelf.selectCell(newSelectedEl);}}}
+else{for(i=tdIndex;i>-1;i--){oSelf.unselectCell(allRows[trIndex].cells[i]);}
+for(i=allRows[trIndex].cells.length-1;i>tdIndex;i--){oSelf.unselectCell(allRows[trIndex-1].cells[i]);}
+oSelf._sLastSelectedId=allRows[trIndex-1].cells[tdIndex].id;}}
+else if(nKey==39){if(anchorPos<0){if(tdIndex<allRows[trIndex].cells.length-1){newSelectedEl=allRows[trIndex].cells[tdIndex+1];oSelf.selectCell(newSelectedEl);}
+else if(trIndex<allRows.length-1){newSelectedEl=allRows[trIndex+1].cells[0];oSelf.selectCell(newSelectedEl);}}
+else if(anchorPos>0){oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);if(tdIndex<allRows[trIndex].cells.length-1){oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex+1].id;}
+else{oSelf._sLastSelectedId=allRows[trIndex+1].cells[0].id;}}
+else{if(anchorEl.yuiCellIndex<=tdIndex){if(tdIndex<allRows[trIndex].cells.length-1){newSelectedEl=allRows[trIndex].cells[tdIndex+1];oSelf.selectCell(newSelectedEl);}
+else if(trIndex<allRows.length-1){newSelectedEl=allRows[trIndex+1].cells[0];oSelf.selectCell(newSelectedEl);}}
+else{oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex+1].id;}}}
+else if(nKey==37){if(anchorPos<0){oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);if(tdIndex>0){oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex-1].id;}
+else{oSelf._sLastSelectedId=allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;}}
+else if(anchorPos>0){if(tdIndex>0){newSelectedEl=allRows[trIndex].cells[tdIndex-1];oSelf.selectCell(newSelectedEl);}
+else if(trIndex>0){newSelectedEl=allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];oSelf.selectCell(newSelectedEl);}}
+else{if(anchorEl.yuiCellIndex>=tdIndex){if(tdIndex>0){newSelectedEl=allRows[trIndex].cells[tdIndex-1];oSelf.selectCell(newSelectedEl);}
+else if(trIndex>0){newSelectedEl=allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];oSelf.selectCell(newSelectedEl);}}
+else{oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);if(tdIndex>0){oSelf._sLastSelectedId=allRows[trIndex].cells[tdIndex-1].id;}
+else{oSelf._sLastSelectedId=allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;}}}}}
+else if((sMode=="cellblock")||(sMode=="cellrange")||(sMode=="singlecell")){trIndex=lastSelectedEl.parentNode.sectionRowIndex;tdIndex=lastSelectedEl.yuiCellIndex;if(nKey==40){oSelf.unselectAllCells();if(trIndex<allRows.length-1){newSelectedEl=allRows[trIndex+1].cells[tdIndex];oSelf.selectCell(newSelectedEl);}
+else{newSelectedEl=lastSelectedEl;oSelf.selectCell(newSelectedEl);}
+oSelf._sSelectionAnchorId=newSelectedEl.id;}
+else if(nKey==38){oSelf.unselectAllCells();if(trIndex>0){newSelectedEl=allRows[trIndex-1].cells[tdIndex];oSelf.selectCell(newSelectedEl);}
+else{newSelectedEl=lastSelectedEl;oSelf.selectCell(newSelectedEl);}
+oSelf._sSelectionAnchorId=newSelectedEl.id;}
+else if(nKey==39){oSelf.unselectAllCells();if(tdIndex<lastSelectedEl.parentNode.cells.length-1){newSelectedEl=lastSelectedEl.parentNode.cells[tdIndex+1];oSelf.selectCell(newSelectedEl);}
+else{newSelectedEl=lastSelectedEl;oSelf.selectCell(newSelectedEl);}
+oSelf._sSelectionAnchorId=newSelectedEl.id;}
+else if(nKey==37){oSelf.unselectAllCells();if(tdIndex>0){newSelectedEl=lastSelectedEl.parentNode.cells[tdIndex-1];oSelf.selectCell(newSelectedEl);}
+else{newSelectedEl=lastSelectedEl;oSelf.selectCell(newSelectedEl);}
+oSelf._sSelectionAnchorId=newSelectedEl.id;}}
+else if(bSHIFT&&(sMode!="single")){trIndex=lastSelectedEl.sectionRowIndex;if(anchorEl.sectionRowIndex>trIndex){anchorPos=1;}
+else if(anchorEl.sectionRowIndex<trIndex){anchorPos=-1;}
+else{anchorPos=0;}
+if(nKey==40){if(anchorPos<=0){if(trIndex<allRows.length-1){oSelf.selectRow(trIndex+1);}}
+else{oSelf.unselectRow(lastSelectedEl);oSelf._sLastSelectedId=allRows[trIndex+1].id;}}
+else if(nKey==38){if(anchorPos>=0){if(trIndex>0){oSelf.selectRow(trIndex-1);}}
+else{oSelf.unselectRow(lastSelectedEl);oSelf._sLastSelectedId=allRows[trIndex-1].id;}}
+else if(nKey==39){}
+else if(nKey==37){}}
+else{trIndex=lastSelectedEl.sectionRowIndex;if(nKey==40){oSelf.unselectAllRows();if(trIndex<allRows.length-1){newSelectedEl=allRows[trIndex+1];oSelf.selectRow(newSelectedEl);}
+else{newSelectedEl=lastSelectedEl;oSelf.selectRow(lastSelectedEl);}
+oSelf._sSelectionAnchorId=newSelectedEl.id;}
+else if(nKey==38){oSelf.unselectAllRows();if(trIndex>0){newSelectedEl=allRows[trIndex-1];oSelf.selectRow(newSelectedEl);}
+else{newSelectedEl=lastSelectedEl;oSelf.selectRow(newSelectedEl);}
+oSelf._sSelectionAnchorId=newSelectedEl.id;}
+else if(nKey==39){}
+else if(nKey==37){}}}};YAHOO.widget.DataTable.prototype._onTableKeypress=function(e,oSelf){var isMac=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);if(isMac){var nKey=YAHOO.util.Event.getCharCode(e);if(nKey==40){YAHOO.util.Event.stopEvent(e);}
+else if(nKey==38){YAHOO.util.Event.stopEvent(e);}}};YAHOO.widget.DataTable.prototype._onTheadClick=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(oSelf._oCellEditor&&oSelf._oCellEditor.isActive){oSelf.fireEvent("editorBlurEvent",{editor:oSelf._oCellEditor});}
+while(elTarget&&(elTag!="thead")){switch(elTag){case"body":break;case"span":if(YAHOO.util.Dom.hasClass(elTarget,YAHOO.widget.DataTable.CLASS_LABEL)){oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});}
+break;case"th":oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});break;case"tr":oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});break;default:break;}
+elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
+oSelf.fireEvent("tableClickEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onTbodyClick=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(oSelf._oCellEditor&&oSelf._oCellEditor.isActive){oSelf.fireEvent("editorBlurEvent",{editor:oSelf._oCellEditor});}
+while(elTarget&&(elTag!="table")){switch(elTag){case"body":break;case"input":if(elTarget.type.toLowerCase()=="checkbox"){oSelf.fireEvent("checkboxClickEvent",{target:elTarget,event:e});}
+else if(elTarget.type.toLowerCase()=="radio"){oSelf.fireEvent("radioClickEvent",{target:elTarget,event:e});}
+break;case"a":oSelf.fireEvent("linkClickEvent",{target:elTarget,event:e});break;case"button":oSelf.fireEvent("buttonClickEvent",{target:elTarget,event:e});break;case"td":oSelf.fireEvent("cellClickEvent",{target:elTarget,event:e});break;case"tr":oSelf.fireEvent("rowClickEvent",{target:elTarget,event:e});break;default:break;}
+elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}}
+oSelf.fireEvent("tableClickEvent",{target:(elTarget||oSelf._elTable),event:e});};YAHOO.widget.DataTable.prototype._onPaginatorLinkClick=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var elTag=elTarget.tagName.toLowerCase();if(oSelf._oCellEditor&&oSelf._oCellEditor.isActive){oSelf.fireEvent("editorBlurEvent",{editor:oSelf._oCellEditor});}
+while(elTarget&&(elTag!="table")){switch(elTag){case"body":return;case"a":YAHOO.util.Event.stopEvent(e);switch(elTarget.className){case YAHOO.widget.DataTable.CLASS_PAGE:oSelf.showPage(parseInt(elTarget.innerHTML,10));return;case YAHOO.widget.DataTable.CLASS_FIRST:oSelf.showPage(1);return;case YAHOO.widget.DataTable.CLASS_LAST:oSelf.showPage(oSelf.get("paginator").totalPages);return;case YAHOO.widget.DataTable.CLASS_PREVIOUS:oSelf.showPage(oSelf.get("paginator").currentPage-1);return;case YAHOO.widget.DataTable.CLASS_NEXT:oSelf.showPage(oSelf.get("paginator").currentPage+1);return;}
+break;default:return;}
+elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.tagName.toLowerCase();}
+else{return;}}};YAHOO.widget.DataTable.prototype._onPaginatorDropdownChange=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);var newValue=elTarget[elTarget.selectedIndex].value;var newRowsPerPage=YAHOO.lang.isValue(parseInt(newValue,10))?parseInt(newValue,10):null;if(newRowsPerPage!==null){var newStartRecordIndex=(oSelf.get("paginator").currentPage-1)*newRowsPerPage;oSelf.updatePaginator({rowsPerPage:newRowsPerPage,startRecordIndex:newStartRecordIndex});oSelf.refreshView();}
+else{}};YAHOO.widget.DataTable.prototype._onDropdownChange=function(e,oSelf){var elTarget=YAHOO.util.Event.getTarget(e);oSelf.fireEvent("dropdownChangeEvent",{event:e,target:elTarget});};YAHOO.widget.DataTable.prototype.toString=function(){return"DataTable "+this._sName;};YAHOO.widget.DataTable.prototype.getDataSource=function(){return this._oDataSource;};YAHOO.widget.DataTable.prototype.getColumnSet=function(){return this._oColumnSet;};YAHOO.widget.DataTable.prototype.getRecordSet=function(){return this._oRecordSet;};YAHOO.widget.DataTable.prototype.getCellEditor=function(){return this._oCellEditor;};YAHOO.widget.DataTable.prototype.getTableEl=function(){return this._elTable;};YAHOO.widget.DataTable.prototype.getTheadEl=function(){return this._elThead;};YAHOO.widget.DataTable.prototype.getTbodyEl=function(){return this._elTbody;};YAHOO.widget.DataTable.prototype.getBody=function(){return this.getTbodyEl();};YAHOO.widget.DataTable.prototype.getMsgTbodyEl=function(){return this._elMsgTbody;};YAHOO.widget.DataTable.prototype.getMsgTdEl=function(){return this._elMsgTd;};YAHOO.widget.DataTable.prototype.getTrEl=function(row){var allRows=this._elTbody.rows;if(row instanceof YAHOO.widget.Record){var nTrIndex=this.getTrIndex(row);return allRows[nTrIndex];}
+else if(YAHOO.lang.isNumber(row)&&(row>-1)&&(row<allRows.length)){return allRows[row];}
+else{var elRow;var el=YAHOO.util.Dom.get(row);if(el&&(el.ownerDocument==document)){if(el.tagName.toLowerCase()!="tr"){elRow=YAHOO.util.Dom.getAncestorByTagName(el,"tr");}
+else{elRow=el;}
+if(elRow&&(elRow.parentNode==this._elTbody)){return elRow;}}}
+return null;};YAHOO.widget.DataTable.prototype.getRow=function(index){return this.getTrEl(index);};YAHOO.widget.DataTable.prototype.getFirstTrEl=function(){return this._elTbody.rows[0]||null;};YAHOO.widget.DataTable.prototype.getLastTrEl=function(){var allRows=this._elTbody.rows;if(allRows.length>0){return allRows[allRows.length-1]||null;}};YAHOO.widget.DataTable.prototype.getTdEl=function(cell){var elCell;var el=YAHOO.util.Dom.get(cell);if(el&&(el.ownerDocument==document)){if(el.tagName.toLowerCase()!="td"){elCell=YAHOO.util.Dom.getAncestorByTagName(el,"td");}
+else{elCell=el;}
+if(elCell&&(elCell.parentNode.parentNode==this._elTbody)){return elCell;}}
+return null;};YAHOO.widget.DataTable.prototype.getThEl=function(header){var elHeader;if(header instanceof YAHOO.widget.Column){var oColumn=header;elHeader=YAHOO.util.Dom.get(this.id+"-col"+oColumn.getId());if(elHeader){return elHeader;}}
+else{var el=YAHOO.util.Dom.get(header);if(el&&(el.ownerDocument==document)){if(el.tagName.toLowerCase()!="th"){elHeader=YAHOO.util.Dom.getAncestorByTagName(el,"th");}
+else{elHeader=el;}
+if(elHeader&&(elHeader.parentNode.parentNode==this._elThead)){return elHeader;}}}
+return null;};YAHOO.widget.DataTable.prototype.getTrIndex=function(row){var nRecordIndex;if(row instanceof YAHOO.widget.Record){nRecordIndex=this._oRecordSet.getRecordIndex(row);}
+else if(YAHOO.lang.isNumber(row)){nRecordIndex=row;}
+if(YAHOO.lang.isNumber(nRecordIndex)){if(this.get("paginated")){var startRecordIndex=this.get("paginator").startRecordIndex;var endRecordIndex=startRecordIndex+this.get("paginator").rowsPerPage-1;if((nRecordIndex>=startRecordIndex)&&(nRecordIndex<=endRecordIndex)){return nRecordIndex-startRecordIndex;}
+else{return null;}}
+else{return nRecordIndex;}}
+else{elRow=this.getTrEl(row);if(elRow&&(elRow.ownerDocument==document)&&(elRow.parentNode==this._elTbody)){return elRow.sectionRowIndex;}}
+return null;};YAHOO.widget.DataTable.prototype.initializeTable=function(oData){this._oRecordSet.reset();var records=this._oRecordSet.addRecords(oData);this._unselectAllTrEls();this._unselectAllTdEls();this._aSelections=null;this._sLastSelectedId=null;this._sSelectionAnchorId=null;this.refreshView();this.fireEvent("initEvent");};YAHOO.widget.DataTable.prototype.refreshView=function(){var i,j,k,l,aRecords;var oPaginator=this.updatePaginator();if(this.get("paginated")){var rowsPerPage=oPaginator.rowsPerPage;var startRecordIndex=(oPaginator.currentPage-1)*rowsPerPage;aRecords=this._oRecordSet.getRecords(startRecordIndex,rowsPerPage);this.formatPaginators();}
+else{aRecords=this._oRecordSet.getRecords();}
+var elTbody=this._elTbody;var elRows=elTbody.rows;if(YAHOO.lang.isArray(aRecords)&&(aRecords.length>0)){this.hideTableMessage();var aSelectedRows=this.getSelectedRows();var aSelectedCells=this.getSelectedCells();var bReselect=(aSelectedRows.length>0)||(aSelectedCells.length>0);while(elTbody.hasChildNodes()&&(elRows.length>aRecords.length)){elTbody.deleteRow(-1);}
+if(bReselect){this._unselectAllTrEls();this._unselectAllTdEls();}
+for(i=0;i<elRows.length;i++){this._updateTrEl(elRows[i],aRecords[i]);}
+for(i=elRows.length;i<aRecords.length;i++){this._addTrEl(aRecords[i]);}
+var allRows=elTbody.rows;if(bReselect){for(j=0;j<allRows.length;j++){var thisRow=allRows[j];var sMode=this.get("selectionMode");if((sMode=="standard")||(sMode=="single")){for(k=0;k<aSelectedRows.length;k++){if(aSelectedRows[k]===thisRow.yuiRecordId){YAHOO.util.Dom.addClass(thisRow,YAHOO.widget.DataTable.CLASS_SELECTED);if(j===allRows.length-1){this._sLastSelectedId=thisRow.id;this._sSelectionAnchorId=thisRow.id;}}}}
+else{for(k=0;k<thisRow.cells.length;k++){var thisCell=thisRow.cells[k];for(l=0;l<aSelectedCells.length;l++){if((aSelectedCells[l].recordId===thisRow.yuiRecordId)&&(aSelectedCells[l].columnId===thisCell.yuiColumnId)){YAHOO.util.Dom.addClass(thisCell,YAHOO.widget.DataTable.CLASS_SELECTED);if(k===thisRow.cells.length-1){this._sLastSelectedId=thisCell.id;this._sSelectionAnchorId=thisCell.id;}}}}}}}
+this._setFirstRow();this._setLastRow();this._setRowStripes();this.fireEvent("refreshEvent");}
+else{while(elTbody.hasChildNodes()){elTbody.deleteRow(-1);}
+this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY,YAHOO.widget.DataTable.CLASS_EMPTY);}};YAHOO.widget.DataTable.prototype.destroy=function(){YAHOO.util.Event.purgeElement(this._oCellEditor.container,true);document.body.removeChild(this._oCellEditor.container);var instanceName=this.toString();var elContainer=this._elContainer;this._oRecordSet.unsubscribeAll();this.unsubscribeAll();YAHOO.util.Event.purgeElement(elContainer,true);elContainer.innerHTML="";for(var param in this){if(this.hasOwnProperty(param)){this[param]=null;}}};YAHOO.widget.DataTable.prototype.showTableMessage=function(sHTML,sClassName){var elCell=this._elMsgTd;if(YAHOO.lang.isString(sHTML)){elCell.innerHTML=sHTML;}
+if(YAHOO.lang.isString(sClassName)){YAHOO.util.Dom.addClass(elCell,sClassName);}
+this._elMsgTbody.style.display="";this.fireEvent("tableMsgShowEvent",{html:sHTML,className:sClassName});};YAHOO.widget.DataTable.prototype.hideTableMessage=function(){if(this._elMsgTbody.style.display!="none"){this._elMsgTbody.style.display="none";this.fireEvent("tableMsgHideEvent");}};YAHOO.widget.DataTable.prototype.focus=function(){this._focusEl(this._elTable);};YAHOO.widget.DataTable.prototype.getRecordIndex=function(row){var nTrIndex;if(!YAHOO.lang.isNumber(row)){if(row instanceof YAHOO.widget.Record){return this._oRecordSet.getRecordIndex(row);}
+else{var el=this.getTrEl(row);if(el){nTrIndex=el.sectionRowIndex;}}}
+else{nTrIndex=row;}
+if(YAHOO.lang.isNumber(nTrIndex)){if(this.get("paginated")){return this.get("paginator").startRecordIndex+nTrIndex;}
+else{return nTrIndex;}}
+return null;};YAHOO.widget.DataTable.prototype.getRecord=function(row){var nRecordIndex=row;if(!YAHOO.lang.isNumber(nRecordIndex)){var elRow=this.getTrEl(row);if(elRow){nRecordIndex=this.getRecordIndex(row);}}
+if(YAHOO.lang.isNumber(nRecordIndex)){return this._oRecordSet.getRecord(nRecordIndex);}
+return null;};YAHOO.widget.DataTable.prototype.getColumn=function(column){var nColumnIndex=column;if(!YAHOO.lang.isNumber(nColumnIndex)){var elCell=this.getTdEl(column);if(elCell){nColumnIndex=elCell.yuiColumnId;}
+else{elCell=this.getThEl(column);if(elCell){nColumnIndex=elCell.yuiColumnId;}}}
+if(YAHOO.lang.isNumber(nColumnIndex)){return this._oColumnSet.getColumn(nColumnIndex);}
+return null;};YAHOO.widget.DataTable.prototype.sortColumn=function(oColumn){if(!oColumn){return;}
+if(!oColumn instanceof YAHOO.widget.Column){return;}
+if(oColumn.sortable){var sortDir=(oColumn.sortOptions&&oColumn.sortOptions.defaultOrder)?oColumn.sortOptions.defaultOrder:"asc";var oSortedBy=this.get("sortedBy");if(oSortedBy&&(oSortedBy.key===oColumn.key)){if(oSortedBy.dir){sortDir=(oSortedBy.dir=="asc")?"desc":"asc";}
+else{sortDir=(sortDir=="asc")?"desc":"asc";}}
+var sortFnc=(oColumn.sortOptions&&YAHOO.lang.isFunction(oColumn.sortOptions.sortFunction))?oColumn.sortOptions.sortFunction:function(a,b,desc){var sorted=YAHOO.util.Sort.compare(a.getData(oColumn.key),b.getData(oColumn.key),desc);if(sorted===0){return YAHOO.util.Sort.compare(a.getId(),b.getId(),desc);}
+else{return sorted;}};var desc=(sortDir=="desc")?true:false;this._oRecordSet.sortRecords(sortFnc,desc);this.set("sortedBy",{key:oColumn.key,dir:sortDir,column:oColumn});this.updatePaginator({currentPage:1});this.refreshView();this.fireEvent("columnSortEvent",{column:oColumn,dir:sortDir});}
+else{}};YAHOO.widget.DataTable.prototype.addRow=function(oData,index){if(oData&&(oData.constructor==Object)){var oRecord=this._oRecordSet.addRecord(oData,index);if(oRecord){var nTrIndex=this.getTrIndex(oRecord);if(YAHOO.lang.isNumber(nTrIndex)){if(this.get("paginated")){this.refreshView();}
+else{var newTrId=this._addTrEl(oRecord,nTrIndex);if(newTrId){var append=(YAHOO.lang.isNumber(nTrIndex)&&(nTrIndex==this._elTbody.rows.length-1))?true:false;if(append){if((this._elTbody.rows.length-1)%2){YAHOO.util.Dom.addClass(newTrId,YAHOO.widget.DataTable.CLASS_ODD);}
+else{YAHOO.util.Dom.addClass(newTrId,YAHOO.widget.DataTable.CLASS_EVEN);}}
+else{this._setRowStripes(nTrIndex);}
+if(append){this._setLastRow();}
+else if(YAHOO.lang.isNumber(index)&&(nTrIndex===0)){this._setFirstRow();}}}}
+else{this.updatePaginator();}
+this.fireEvent("rowAddEvent",{record:oRecord});nTrIndex=(YAHOO.lang.isValue(nTrIndex))?nTrIndex:"n/a";return;}}};YAHOO.widget.DataTable.prototype.addRows=function(aData,index){if(YAHOO.lang.isArray(aData)){var i;if(YAHOO.lang.isNumber(index)){for(i=aData.length-1;i>-1;i--){this.addRow(aData[i],index);}}
+else{for(i=0;i<aData.length;i++){this.addRow(aData[i]);}}}
+else{}};YAHOO.widget.DataTable.prototype.updateRow=function(row,oData){var oldRecord,updatedRecord,elRow;if((row instanceof YAHOO.widget.Record)||(YAHOO.lang.isNumber(row))){oldRecord=this._oRecordSet.getRecord(row);elRow=this.getTrEl(oldRecord);}
+else{elRow=this.getTrEl(row);if(elRow){oldRecord=this._oRecordSet.getRecord(this.getRecordIndex(elRow));}}
+if(oldRecord){var oRecordData=oldRecord.getData();var oldData={};for(var param in oRecordData){oldData[param]=oRecordData[param];}
+updatedRecord=this._oRecordSet.updateRecord(oldRecord,oData);}
+else{return;}
+if(elRow){this._updateTrEl(elRow,updatedRecord);}
+this.fireEvent("rowUpdateEvent",{record:updatedRecord,oldData:oldData});};YAHOO.widget.DataTable.prototype.deleteRow=function(row){var nRecordIndex=null;if(YAHOO.lang.isNumber(row)){nRecordIndex=row;}
+else{var elRow=YAHOO.util.Dom.get(row);elRow=this.getTrEl(elRow);if(elRow){nRecordIndex=this.getRecordIndex(elRow);}}
+if(nRecordIndex!==null){var oRecord=this._oRecordSet.getRecord(nRecordIndex);if(oRecord){var nRecordId=oRecord.getId();var tracker=this._aSelections||[];for(var j=0;j<tracker.length;j++){if((YAHOO.lang.isNumber(tracker[j])&&(tracker[j]===nRecordId))||((tracker[j].constructor==Object)&&(tracker[j].recordId===nRecordId))){tracker.splice(j,1);}}
+var oRecordData=oRecord.getData();var oData={};for(var param in oRecordData){oData[param]=oRecordData[param];}
+this._oRecordSet.deleteRecord(nRecordIndex);var nTrIndex=this.getTrIndex(nRecordIndex);if(YAHOO.lang.isNumber(nTrIndex)){var isLast=(nTrIndex==this.getLastTrEl().sectionRowIndex)?true:false;this._deleteTrEl(nTrIndex);if(this._elTbody.rows.length===0){this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY,YAHOO.widget.DataTable.CLASS_EMPTY);}
+else{if(nTrIndex===0){this._setFirstRow();}
+if(isLast){this._setLastRow();}
+if(nTrIndex!=this._elTbody.rows.length){this._setRowStripes(nTrIndex);}}}
+this.fireEvent("rowDeleteEvent",{recordIndex:nRecordIndex,oldData:oData,trElIndex:nTrIndex});}}
+else{}};YAHOO.widget.DataTable.prototype.deleteRows=function(row,count){var nRecordIndex=null;if(YAHOO.lang.isNumber(row)){nRecordIndex=row;}
+else{var elRow=YAHOO.util.Dom.get(row);elRow=this.getTrEl(elRow);if(elRow){nRecordIndex=this.getRecordIndex(elRow);}}
+if(nRecordIndex!==null){if(count&&YAHOO.lang.isNumber(count)){var startIndex=(count>0)?nRecordIndex+count-1:nRecordIndex;var endIndex=(count>0)?nRecordIndex:nRecordIndex+count+1;for(var i=startIndex;i>endIndex-1;i--){this.deleteRow(i);}}
+else{this.deleteRow(nRecordIndex);}}
+else{}};YAHOO.widget.DataTable.prototype.formatCell=function(elCell,oRecord,oColumn){if(!(oRecord instanceof YAHOO.widget.Record)){oRecord=this.getRecord(elCell);}
+if(!(oColumn instanceof YAHOO.widget.Column)){oColumn=this._oColumnSet.getColumn(elCell.yuiColumnId);}
+if(oRecord&&oColumn){var oData=oRecord.getData(oColumn.key);var fnFormatter;if(YAHOO.lang.isString(oColumn.formatter)){switch(oColumn.formatter){case"button":fnFormatter=YAHOO.widget.DataTable.formatButton;break;case"checkbox":fnFormatter=YAHOO.widget.DataTable.formatCheckbox;break;case"currency":fnFormatter=YAHOO.widget.DataTable.formatCurrency;break;case"date":fnFormatter=YAHOO.widget.DataTable.formatDate;break;case"dropdown":fnFormatter=YAHOO.widget.DataTable.formatDropdown;break;case"email":fnFormatter=YAHOO.widget.DataTable.formatEmail;break;case"link":fnFormatter=YAHOO.widget.DataTable.formatLink;break;case"number":fnFormatter=YAHOO.widget.DataTable.formatNumber;break;case"radio":fnFormatter=YAHOO.widget.DataTable.formatRadio;break;case"text":fnFormatter=YAHOO.widget.DataTable.formatText;break;case"textarea":fnFormatter=YAHOO.widget.DataTable.formatTextarea;break;case"textbox":fnFormatter=YAHOO.widget.DataTable.formatTextbox;break;case"html":break;default:fnFormatter=null;}}
+else if(YAHOO.lang.isFunction(oColumn.formatter)){fnFormatter=oColumn.formatter;}
+if(fnFormatter){fnFormatter.call(this,elCell,oRecord,oColumn,oData);}
+else{elCell.innerHTML=(YAHOO.lang.isValue(oData))?oData.toString():"";}
+var aCustomClasses=null;if(YAHOO.lang.isString(oColumn.className)){aCustomClasses=[oColumn.className];}
+else if(YAHOO.lang.isArray(oColumn.className)){aCustomClasses=oColumn.className;}
+if(aCustomClasses){for(var i=0;i<aCustomClasses.length;i++){YAHOO.util.Dom.addClass(elCell,aCustomClasses[i]);}}
+YAHOO.util.Dom.addClass(elCell,"yui-dt-col-"+oColumn.key);if(oColumn.editor){YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_EDITABLE);}
+this.fireEvent("cellFormatEvent",{record:oRecord,key:oColumn.key,el:elCell});}
+else{}};YAHOO.widget.DataTable.formatButton=function(el,oRecord,oColumn,oData){var sValue=YAHOO.lang.isValue(oData)?oData:"Click";el.innerHTML="<button type=\"button\" class=\""+
+YAHOO.widget.DataTable.CLASS_BUTTON+"\">"+sValue+"</button>";};YAHOO.widget.DataTable.formatCheckbox=function(el,oRecord,oColumn,oData){var bChecked=oData;bChecked=(bChecked)?" checked":"";el.innerHTML="<input type=\"checkbox\""+bChecked+" class=\""+YAHOO.widget.DataTable.CLASS_CHECKBOX+"\">";};YAHOO.widget.DataTable.formatCurrency=function(el,oRecord,oColumn,oData){if(YAHOO.lang.isNumber(oData)){var nAmount=oData;var markup;nAmount=Math.round(nAmount*100)/100;markup="$"+nAmount;var dotIndex=markup.indexOf(".");if(dotIndex<0){markup+=".00";}
+else{while(dotIndex>markup.length-3){markup+="0";}}
+el.innerHTML=markup;}
+else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatDate=function(el,oRecord,oColumn,oData){var oDate=oData;if(oDate instanceof Date){el.innerHTML=(oDate.getMonth()+1)+"/"+oDate.getDate()+"/"+oDate.getFullYear();}
+else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatDropdown=function(el,oRecord,oColumn,oData){var selectedValue=(YAHOO.lang.isValue(oData))?oData:oRecord.getData(oColumn.key);var options=(YAHOO.lang.isArray(oColumn.dropdownOptions))?oColumn.dropdownOptions:null;var selectEl;var collection=el.getElementsByTagName("select");if(collection.length===0){selectEl=document.createElement("select");YAHOO.util.Dom.addClass(selectEl,YAHOO.widget.DataTable.CLASS_DROPDOWN);selectEl=el.appendChild(selectEl);YAHOO.util.Event.addListener(selectEl,"change",oDataTable._onDropdownChange,oDataTable);}
+selectEl=collection[0];if(selectEl){selectEl.innerHTML="";if(options){for(var i=0;i<options.length;i++){var option=options[i];var optionEl=document.createElement("option");optionEl.value=(YAHOO.lang.isValue(option.value))?option.value:option;optionEl.innerHTML=(YAHOO.lang.isValue(option.text))?option.text:option;optionEl=selectEl.appendChild(optionEl);}}
+else{selectEl.innerHTML="<option value=\""+selectedValue+"\">"+selectedValue+"</option>";}}
+else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatEmail=function(el,oRecord,oColumn,oData){if(YAHOO.lang.isString(oData)){el.innerHTML="<a href=\"mailto:"+oData+"\">"+oData+"</a>";}
+else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatLink=function(el,oRecord,oColumn,oData){if(YAHOO.lang.isString(oData)){el.innerHTML="<a href=\""+oData+"\">"+oData+"</a>";}
+else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatNumber=function(el,oRecord,oColumn,oData){if(YAHOO.lang.isNumber(oData)){el.innerHTML=oData;}
+else{el.innerHTML=YAHOO.lang.isValue(oData)?oData:"";}};YAHOO.widget.DataTable.formatRadio=function(el,oRecord,oColumn,oData){var bChecked=oData;bChecked=(bChecked)?" checked":"";el.innerHTML="<input type=\"radio\""+bChecked+" name=\""+oColumn.getId()+"-radio\""+" class=\""+YAHOO.widget.DataTable.CLASS_CHECKBOX+"\">";};YAHOO.widget.DataTable.formatText=function(el,oRecord,oColumn,oData){var value=(YAHOO.lang.isValue(oRecord.getData(oColumn.key)))?oRecord.getData(oColumn.key):"";el.innerHTML=value.toString().replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");};YAHOO.widget.DataTable.formatTextarea=function(el,oRecord,oColumn,oData){var value=(YAHOO.lang.isValue(oRecord.getData(oColumn.key)))?oRecord.getData(oColumn.key):"";var markup="<textarea>"+value+"</textarea>";el.innerHTML=markup;};YAHOO.widget.DataTable.formatTextbox=function(el,oRecord,oColumn,oData){var value=(YAHOO.lang.isValue(oRecord.getData(oColumn.key)))?oRecord.getData(oColumn.key):"";var markup="<input type=\"text\" value=\""+value+"\">";el.innerHTML=markup;};YAHOO.widget.DataTable.prototype.updatePaginator=function(oNewValues){var oValidPaginator=this.get("paginator");for(var param in oNewValues){if(oValidPaginator.hasOwnProperty(param)){oValidPaginator[param]=oNewValues[param];}}
+oValidPaginator.totalRecords=this._oRecordSet.getLength();oValidPaginator.rowsThisPage=Math.min(oValidPaginator.rowsPerPage,oValidPaginator.totalRecords);oValidPaginator.totalPages=Math.ceil(oValidPaginator.totalRecords/oValidPaginator.rowsThisPage);if(isNaN(oValidPaginator.totalPages)){oValidPaginator.totalPages=0;}
+this.set("paginator",oValidPaginator);return this.get("paginator");};YAHOO.widget.DataTable.prototype.showPage=function(nPage){if(!YAHOO.lang.isNumber(nPage)||(nPage<1)||(nPage>this.get("paginator").totalPages)){nPage=1;}
+this.updatePaginator({currentPage:nPage});this.refreshView();};YAHOO.widget.DataTable.prototype.formatPaginators=function(){var pag=this.get("paginator");var dropdownEnabled=false;if(pag.pageLinks>-1){for(var i=0;i<pag.links.length;i++){this.formatPaginatorLinks(pag.links[i],pag.currentPage,pag.pageLinksStart,pag.pageLinks,pag.totalPages);}}
+for(i=0;i<pag.dropdowns.length;i++){if(pag.dropdownOptions){dropdownEnabled=true;this.formatPaginatorDropdown(pag.dropdowns[i],pag.dropdownOptions);}
+else{pag.dropdowns[i].style.display="none";}}
+if(dropdownEnabled&&navigator.userAgent.toLowerCase().indexOf("opera")!=-1){document.body.style+='';}};YAHOO.widget.DataTable.prototype.formatPaginatorDropdown=function(elDropdown,dropdownOptions){if(elDropdown&&(elDropdown.ownerDocument==document)){while(elDropdown.firstChild){elDropdown.removeChild(elDropdown.firstChild);}
+for(var j=0;j<dropdownOptions.length;j++){var dropdownOption=dropdownOptions[j];var optionEl=document.createElement("option");optionEl.value=(YAHOO.lang.isValue(dropdownOption.value))?dropdownOption.value:dropdownOption;optionEl.innerHTML=(YAHOO.lang.isValue(dropdownOption.text))?dropdownOption.text:dropdownOption;optionEl=elDropdown.appendChild(optionEl);}
+var options=elDropdown.options;if(options.length){for(var i=options.length-1;i>-1;i--){if((this.get("paginator").rowsPerPage+"")===options[i].value){options[i].selected=true;}}}
+elDropdown.style.display="";return;}};YAHOO.widget.DataTable.prototype.formatPaginatorLinks=function(elContainer,nCurrentPage,nPageLinksStart,nPageLinksLength,nTotalPages){if(elContainer&&(elContainer.ownerDocument==document)&&YAHOO.lang.isNumber(nCurrentPage)&&YAHOO.lang.isNumber(nPageLinksStart)&&YAHOO.lang.isNumber(nTotalPages)){var bIsFirstPage=(nCurrentPage==1)?true:false;var bIsLastPage=(nCurrentPage==nTotalPages)?true:false;var sFirstLinkMarkup=(bIsFirstPage)?" <span class=\""+YAHOO.widget.DataTable.CLASS_DISABLED+" "+YAHOO.widget.DataTable.CLASS_FIRST+"\">&lt;&lt;</span> ":" <a href=\"#\" class=\""+YAHOO.widget.DataTable.CLASS_FIRST+"\">&lt;&lt;</a> ";var sPrevLinkMarkup=(bIsFirstPage)?" <span class=\""+YAHOO.widget.DataTable.CLASS_DISABLED+" "+YAHOO.widget.DataTable.CLASS_PREVIOUS+"\">&lt;</span> ":" <a href=\"#\" class=\""+YAHOO.widget.DataTable.CLASS_PREVIOUS+"\">&lt;</a> ";var sNextLinkMarkup=(bIsLastPage)?" <span class=\""+YAHOO.widget.DataTable.CLASS_DISABLED+" "+YAHOO.widget.DataTable.CLASS_NEXT+"\">&gt;</span> ":" <a href=\"#\" class=\""+YAHOO.widget.DataTable.CLASS_NEXT+"\">&gt;</a> ";var sLastLinkMarkup=(bIsLastPage)?" <span class=\""+YAHOO.widget.DataTable.CLASS_DISABLED+" "+YAHOO.widget.DataTable.CLASS_LAST+"\">&gt;&gt;</span> ":" <a href=\"#\" class=\""+YAHOO.widget.DataTable.CLASS_LAST+"\">&gt;&gt;</a> ";var sMarkup=sFirstLinkMarkup+sPrevLinkMarkup;var nMaxLinks=nTotalPages;var nFirstLink=1;var nLastLink=nTotalPages;if(nPageLinksLength>0){nMaxLinks=(nPageLinksStart+nPageLinksLength<nTotalPages)?nPageLinksStart+nPageLinksLength-1:nTotalPages;nFirstLink=(nCurrentPage-Math.floor(nMaxLinks/2)>0)?nCurrentPage-Math.floor(nMaxLinks/2):1;nLastLink=(nCurrentPage+Math.floor(nMaxLinks/2)<=nTotalPages)?nCurrentPage+Math.floor(nMaxLinks/2):nTotalPages;if(nFirstLink===1){nLastLink=nMaxLinks;}
+else if(nLastLink===nTotalPages){nFirstLink=nTotalPages-nMaxLinks+1;}
+if(nLastLink-nFirstLink===nMaxLinks){nLastLink--;}}
+for(var i=nFirstLink;i<=nLastLink;i++){if(i!=nCurrentPage){sMarkup+=" <a href=\"#\" class=\""+YAHOO.widget.DataTable.CLASS_PAGE+"\">"+i+"</a> ";}
+else{sMarkup+=" <span class=\""+YAHOO.widget.DataTable.CLASS_SELECTED+"\">"+i+"</span>";}}
+sMarkup+=sNextLinkMarkup+sLastLinkMarkup;elContainer.innerHTML=sMarkup;return;}};YAHOO.widget.DataTable.prototype._sLastHighlightedCellId=null;YAHOO.widget.DataTable.prototype._sLastHighlightedRowId=null;YAHOO.widget.DataTable.prototype._aSelections=null;YAHOO.widget.DataTable.prototype._sLastSelectedId=null;YAHOO.widget.DataTable.prototype._sSelectionAnchorId=null;YAHOO.widget.DataTable.prototype._unselectAllTrEls=function(){var selectedRows=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);YAHOO.util.Dom.removeClass(selectedRows,YAHOO.widget.DataTable.CLASS_SELECTED);};YAHOO.widget.DataTable.prototype.getSelectedTrEls=function(){return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);};YAHOO.widget.DataTable.prototype.selectRow=function(row){var elRow=this.getTrEl(row);if(elRow){var oRecord=this.getRecord(elRow);if(oRecord){var tracker=this._aSelections||[];var nRecordId=oRecord.getId();if(tracker.indexOf&&(tracker.indexOf(nRecordId)>-1)){tracker.splice(tracker.indexOf(nRecordId),1);}
+else{for(var j=0;j<tracker.length;j++){if(tracker[j]===nRecordId){tracker.splice(j,1);}}}
+tracker.push(nRecordId);this._sLastSelectedId=elRow.id;if(!this._sSelectionAnchorId){this._sSelectionAnchorId=elRow.id;}
+this._aSelections=tracker;YAHOO.util.Dom.addClass(elRow,YAHOO.widget.DataTable.CLASS_SELECTED);this.fireEvent("rowSelectEvent",{record:oRecord,el:elRow});return;}}};YAHOO.widget.DataTable.prototype.select=function(els){if(!YAHOO.lang.isArray(els)){els=[els];}
+for(var i=0;i<els.length;i++){this.selectRow(els[i]);}};YAHOO.widget.DataTable.prototype.unselectRow=function(row){var elRow=this.getTrEl(row);if(elRow){var oRecord=this.getRecord(elRow);if(oRecord){var tracker=this._aSelections||[];var nRecordId=oRecord.getId();var bFound=false;if(tracker.indexOf&&(tracker.indexOf(nRecordId)>-1)){tracker.splice(tracker.indexOf(nRecordId),1);bFound=true;}
+else{for(var j=0;j<tracker.length;j++){if(tracker[j]===nRecordId){tracker.splice(j,1);bFound=true;}}}
+if(bFound){this._aSelections=tracker;YAHOO.util.Dom.removeClass(elRow,YAHOO.widget.DataTable.CLASS_SELECTED);this.fireEvent("rowUnselectEvent",{record:oRecord,el:elRow});return;}}}};YAHOO.widget.DataTable.prototype.unselectAllRows=function(){var tracker=this._aSelections||[];for(var j=0;j<tracker.length;j++){if(YAHOO.lang.isNumber(tracker[j])){tracker.splice(j,1);}}
+this._aSelections=tracker;this._unselectAllTrEls();this.fireEvent("unselectAllRowsEvent");};YAHOO.widget.DataTable.prototype._unselectAllTdEls=function(){var selectedCells=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);YAHOO.util.Dom.removeClass(selectedCells,YAHOO.widget.DataTable.CLASS_SELECTED);};YAHOO.widget.DataTable.prototype.getSelectedTdEls=function(){return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);};YAHOO.widget.DataTable.prototype.selectCell=function(cell){var elCell=this.getTdEl(cell);if(elCell){var oRecord=this.getRecord(elCell);var nColumnId=elCell.yuiColumnId;if(oRecord&&YAHOO.lang.isNumber(nColumnId)){var tracker=this._aSelections||[];var nRecordId=oRecord.getId();for(var j=0;j<tracker.length;j++){if((tracker[j].recordId===nRecordId)&&(tracker[j].columnId===nColumnId)){tracker.splice(j,1);}}
+tracker.push({recordId:nRecordId,columnId:nColumnId});this._aSelections=tracker;this._sLastSelectedId=elCell.id;if(!this._sSelectionAnchorId){this._sSelectionAnchorId=elCell.id;}
+YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_SELECTED);this.fireEvent("cellSelectEvent",{record:oRecord,key:this._oColumnSet.getColumn(nColumnId).key,el:elCell});return;}}};YAHOO.widget.DataTable.prototype.unselectCell=function(cell){var elCell=this.getTdEl(cell);if(elCell){var oRecord=this.getRecord(elCell);var nColumnId=elCell.yuiColumnId;if(oRecord&&YAHOO.lang.isNumber(nColumnId)){var tracker=this._aSelections||[];var id=oRecord.getId();for(var j=0;j<tracker.length;j++){if((tracker[j].recordId===id)&&(tracker[j].columnId===nColumnId)){tracker.splice(j,1);this._aSelections=tracker;YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_SELECTED);this.fireEvent("cellUnselectEvent",{record:oRecord,key:this._oColumnSet.getColumn(nColumnId).key,el:elCell});return;}}}}};YAHOO.widget.DataTable.prototype.unselectAllCells=function(){var tracker=this._aSelections||[];for(var j=0;j<tracker.length;j++){if(tracker[j].constructor==Object){tracker.splice(j,1);}}
+this._aSelections=tracker;this._unselectAllTdEls();this.fireEvent("unselectAllCellsEvent");};YAHOO.widget.DataTable.prototype.isSelected=function(el){return YAHOO.util.Dom.hasClass(el,YAHOO.widget.DataTable.CLASS_SELECTED);};YAHOO.widget.DataTable.prototype.getSelectedRows=function(){var aSelectedRows=[];var tracker=this._aSelections||[];for(var j=0;j<tracker.length;j++){if(YAHOO.lang.isNumber(tracker[j])){aSelectedRows.push(tracker[j]);}}
+return aSelectedRows;};YAHOO.widget.DataTable.prototype.getSelectedCells=function(){var aSelectedCells=[];var tracker=this._aSelections||[];for(var j=0;j<tracker.length;j++){if(tracker[j]&&(tracker[j].constructor==Object)){aSelectedCells.push({recordId:tracker[j].recordId,columnId:tracker[j].columnId});}}
+return aSelectedCells;};YAHOO.widget.DataTable.prototype.highlightRow=function(row){var elRow=this.getTrEl(row);if(elRow){if(this._sLastHighlightedRowId){YAHOO.util.Dom.removeClass(this._sLastHighlightedRowId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);}
+var oRecord=this.getRecord(elRow);YAHOO.util.Dom.addClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);this._sLastHighlightedRowId=elRow.id;this.fireEvent("rowHighlightEvent",{record:oRecord,el:elRow});return;}};YAHOO.widget.DataTable.prototype.unhighlightRow=function(row){var elRow=this.getTrEl(row);if(elRow){var oRecord=this.getRecord(elRow);YAHOO.util.Dom.removeClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);this.fireEvent("rowUnhighlightEvent",{record:oRecord,el:elRow});return;}};YAHOO.widget.DataTable.prototype.highlightCell=function(cell){var elCell=this.getTdEl(cell);if(elCell){if(this._sLastHighlightedCellId){YAHOO.util.Dom.removeClass(this._sLastHighlightedCellId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);}
+var oRecord=this.getRecord(elCell);YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);this._sLastHighlightedCellId=elCell.id;this.fireEvent("cellHighlightEvent",{record:oRecord,key:this._oColumnSet.getColumn(elCell.yuiColumnId).key,el:elCell});return;}};YAHOO.widget.DataTable.prototype.unhighlightCell=function(cell){var elCell=this.getTdEl(cell);if(elCell){var oRecord=this.getRecord(elCell);YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);this.fireEvent("cellUnhighlightEvent",{record:oRecord,key:this._oColumnSet.getColumn(elCell.yuiColumnId).key,el:elCell});return;}};YAHOO.widget.DataTable.prototype.showCellEditor=function(elCell,oRecord,oColumn){elCell=YAHOO.util.Dom.get(elCell);if(elCell&&(elCell.ownerDocument===document)){if(!oRecord||!(oRecord instanceof YAHOO.widget.Record)){oRecord=this.getRecord(elCell);}
+if(!oColumn||!(oColumn instanceof YAHOO.widget.Column)){oColumn=this.getColumn(elCell);}
+if(oRecord&&oColumn){var oCellEditor=this._oCellEditor;if(oCellEditor.isActive){this.cancelCellEditor();}
+if(!oColumn.editor){return;}
+oCellEditor.cell=elCell;oCellEditor.record=oRecord;oCellEditor.column=oColumn;oCellEditor.validator=(oColumn.editorOptions&&YAHOO.lang.isFunction(oColumn.editorOptions.validator))?oColumn.editorOptions.validator:null;oCellEditor.value=oRecord.getData(oColumn.key);var elContainer=oCellEditor.container;var x=YAHOO.util.Dom.getX(elCell);var y=YAHOO.util.Dom.getY(elCell);if(isNaN(x)||isNaN(y)){x=elCell.offsetLeft+
+YAHOO.util.Dom.getX(this._elTable)-
+this._elTbody.scrollLeft;y=elCell.offsetTop+
+YAHOO.util.Dom.getY(this._elTable)-
+this._elTbody.scrollTop+
+this._elThead.offsetHeight;}
+elContainer.style.left=x+"px";elContainer.style.top=y+"px";elContainer.style.display="";var fnEditor;if(YAHOO.lang.isString(oColumn.editor)){switch(oColumn.editor){case"checkbox":fnEditor=YAHOO.widget.DataTable.editCheckbox;break;case"date":fnEditor=YAHOO.widget.DataTable.editDate;break;case"dropdown":fnEditor=YAHOO.widget.DataTable.editDropdown;break;case"radio":fnEditor=YAHOO.widget.DataTable.editRadio;break;case"textarea":fnEditor=YAHOO.widget.DataTable.editTextarea;break;case"textbox":fnEditor=YAHOO.widget.DataTable.editTextbox;break;default:fnEditor=null;}}
+else if(YAHOO.lang.isFunction(oColumn.editor)){fnEditor=oColumn.editor;}
+if(fnEditor){fnEditor(this._oCellEditor,this);if(!oColumn.editorOptions||!oColumn.editorOptions.disableBtns){this.showCellEditorBtns(elContainer);}
+this.doBeforeShowCellEditor(this._oCellEditor);oCellEditor.isActive=true;this.fireEvent("editorShowEvent",{editor:oCellEditor});return;}}}};YAHOO.widget.DataTable.prototype.doBeforeShowCellEditor=function(oCellEditor){};YAHOO.widget.DataTable.prototype.showCellEditorBtns=function(elContainer){var elBtnsDiv=elContainer.appendChild(document.createElement("div"));YAHOO.util.Dom.addClass(elBtnsDiv,YAHOO.widget.DataTable.CLASS_BUTTON);var elSaveBtn=elBtnsDiv.appendChild(document.createElement("button"));YAHOO.util.Dom.addClass(elSaveBtn,YAHOO.widget.DataTable.CLASS_DEFAULT);elSaveBtn.innerHTML="OK";YAHOO.util.Event.addListener(elSaveBtn,"click",this.saveCellEditor,this,true);var elCancelBtn=elBtnsDiv.appendChild(document.createElement("button"));elCancelBtn.innerHTML="Cancel";YAHOO.util.Event.addListener(elCancelBtn,"click",this.cancelCellEditor,this,true);};YAHOO.widget.DataTable.prototype.resetCellEditor=function(){var elContainer=this._oCellEditor.container;elContainer.style.display="none";YAHOO.util.Event.purgeElement(elContainer,true);elContainer.innerHTML="";this._oCellEditor.value=null;this._oCellEditor.isActive=false;};YAHOO.widget.DataTable.prototype.saveCellEditor=function(){if(this._oCellEditor.isActive){var newData=this._oCellEditor.value;var oldData=this._oCellEditor.record.getData(this._oCellEditor.column.key);if(this._oCellEditor.validator){this._oCellEditor.value=this._oCellEditor.validator.call(this,newData,oldData);if(this._oCellEditor.value===null){this.resetCellEditor();this.fireEvent("editorRevertEvent",{editor:this._oCellEditor,oldData:oldData,newData:newData});return;}}
+this._oRecordSet.updateKey(this._oCellEditor.record,this._oCellEditor.column.key,this._oCellEditor.value);this.formatCell(this._oCellEditor.cell);this.resetCellEditor();this.fireEvent("editorSaveEvent",{editor:this._oCellEditor,oldData:oldData,newData:newData});}
+else{}};YAHOO.widget.DataTable.prototype.cancelCellEditor=function(){if(this._oCellEditor.isActive){this.resetCellEditor();this.fireEvent("editorCancelEvent",{editor:this._oCellEditor});}
+else{}};YAHOO.widget.DataTable.editCheckbox=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var aCheckedValues=oRecord.getData(oColumn.key);if(!YAHOO.lang.isArray(aCheckedValues)){aCheckedValues=[aCheckedValues];}
+if(oColumn.editorOptions&&YAHOO.lang.isArray(oColumn.editorOptions.checkboxOptions)){var checkboxOptions=oColumn.editorOptions.checkboxOptions;var checkboxValue,checkboxId,elLabel,j,k;for(j=0;j<checkboxOptions.length;j++){checkboxValue=YAHOO.lang.isValue(checkboxOptions[j].label)?checkboxOptions[j].label:checkboxOptions[j];checkboxId=oSelf.id+"-editor-checkbox"+j;elContainer.innerHTML+="<input type=\"checkbox\""+" name=\""+oSelf.id+"-editor-checkbox\""+" value=\""+checkboxValue+"\""+" id=\""+checkboxId+"\">";elLabel=elContainer.appendChild(document.createElement("label"));elLabel.htmlFor=checkboxId;elLabel.innerHTML=checkboxValue;}
+var aCheckboxEls=[];var checkboxEl;for(j=0;j<checkboxOptions.length;j++){checkboxEl=YAHOO.util.Dom.get(oSelf.id+"-editor-checkbox"+j);aCheckboxEls.push(checkboxEl);for(k=0;k<aCheckedValues.length;k++){if(checkboxEl.value===aCheckedValues[k]){checkboxEl.checked=true;}}
+if(j===0){oSelf._focusEl(checkboxEl);}}
+for(j=0;j<checkboxOptions.length;j++){checkboxEl=YAHOO.util.Dom.get(oSelf.id+"-editor-checkbox"+j);YAHOO.util.Event.addListener(checkboxEl,"click",function(){var aNewValues=[];for(var m=0;m<aCheckboxEls.length;m++){if(aCheckboxEls[m].checked){aNewValues.push(aCheckboxEls[m].value);}}
+oSelf._oCellEditor.value=aNewValues;oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});});}}};YAHOO.widget.DataTable.editDate=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var value=oRecord.getData(oColumn.key);if(YAHOO.widget.Calendar){var selectedValue=(value.getMonth()+1)+"/"+value.getDate()+"/"+value.getFullYear();var calContainer=elContainer.appendChild(document.createElement("div"));calContainer.id="yui-dt-"+oSelf._nIndex+"-col"+oColumn.getKeyIndex()+"-dateContainer";var calendar=new YAHOO.widget.Calendar("yui-dt-"+oSelf._nIndex+"-col"+oColumn.getKeyIndex()+"-date",calContainer.id,{selected:selectedValue,pagedate:value});calendar.render();calContainer.style.cssFloat="none";calendar.selectEvent.subscribe(function(type,args,obj){oSelf._oCellEditor.value=new Date(args[0][0][0],args[0][0][1]-1,args[0][0][2]);});oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});}
+else{}};YAHOO.widget.DataTable.editDropdown=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var value=oRecord.getData(oColumn.key);var elDropdown=elContainer.appendChild(document.createElement("select"));var dropdownOptions=(oColumn.editorOptions&&YAHOO.lang.isArray(oColumn.editorOptions.dropdownOptions))?oColumn.editorOptions.dropdownOptions:[];for(var j=0;j<dropdownOptions.length;j++){var dropdownOption=dropdownOptions[j];var elOption=document.createElement("option");elOption.value=(YAHOO.lang.isValue(dropdownOption.value))?dropdownOption.value:dropdownOption;elOption.innerHTML=(YAHOO.lang.isValue(dropdownOption.text))?dropdownOption.text:dropdownOption;elOption=elDropdown.appendChild(elOption);if(value===elDropdown.options[j].value){elDropdown.options[j].selected=true;}}
+YAHOO.util.Event.addListener(elDropdown,"change",function(){oSelf._oCellEditor.value=elDropdown[elDropdown.selectedIndex].value;oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});});oSelf._focusEl(elDropdown);};YAHOO.widget.DataTable.editRadio=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var value=oRecord.getData(oColumn.key);if(oColumn.editorOptions&&YAHOO.lang.isArray(oColumn.editorOptions.radioOptions)){var radioOptions=oColumn.editorOptions.radioOptions;var radioValue,radioId,elLabel,j;for(j=0;j<radioOptions.length;j++){radioValue=YAHOO.lang.isValue(radioOptions[j].label)?radioOptions[j].label:radioOptions[j];radioId=oSelf.id+"-editor-radio"+j;elContainer.innerHTML+="<input type=\"radio\""+" name=\""+oSelf.id+"-editor-radio\""+" value=\""+radioValue+"\""+" id=\""+radioId+"\">";elLabel=elContainer.appendChild(document.createElement("label"));elLabel.htmlFor=radioId;elLabel.innerHTML=radioValue;}
+for(j=0;j<radioOptions.length;j++){var radioEl=YAHOO.util.Dom.get(oSelf.id+"-editor-radio"+j);if(value===radioEl.value){radioEl.checked=true;oSelf._focusEl(radioEl);}
+YAHOO.util.Event.addListener(radioEl,"click",function(){oSelf._oCellEditor.value=this.value;oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});});}}};YAHOO.widget.DataTable.editTextarea=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var value=oRecord.getData(oColumn.key);var elTextarea=elContainer.appendChild(document.createElement("textarea"));elTextarea.style.width=elCell.offsetWidth+"px";elTextarea.style.height="3em";elTextarea.value=YAHOO.lang.isValue(value)?value:"";YAHOO.util.Event.addListener(elTextarea,"keyup",function(){oSelf._oCellEditor.value=elTextarea.value;oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});});elTextarea.focus();elTextarea.select();};YAHOO.widget.DataTable.editTextbox=function(oEditor,oSelf){var elCell=oEditor.cell;var oRecord=oEditor.record;var oColumn=oEditor.column;var elContainer=oEditor.container;var value=YAHOO.lang.isValue(oRecord.getData(oColumn.key))?oRecord.getData(oColumn.key):"";var elTextbox=elContainer.appendChild(document.createElement("input"));elTextbox.type="text";elTextbox.style.width=elCell.offsetWidth+"px";elTextbox.value=value;YAHOO.util.Event.addListener(elTextbox,"keyup",function(){oSelf._oCellEditor.value=elTextbox.value;oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});});elTextbox.focus();elTextbox.select();};YAHOO.widget.DataTable.validateNumber=function(oData){var number=oData*1;if(YAHOO.lang.isNumber(number)){return number;}
+else{return null;}};YAHOO.widget.DataTable.prototype.doBeforeLoadData=function(sRequest,oResponse){return true;};YAHOO.widget.DataTable.prototype.onEventSortColumn=function(oArgs){var evt=oArgs.event;var target=oArgs.target;YAHOO.util.Event.stopEvent(evt);var el=this.getThEl(target)||this.getTdEl(target);if(el&&YAHOO.lang.isNumber(el.yuiColumnId)){this.sortColumn(this._oColumnSet.getColumn(el.yuiColumnId));}
+else{}};YAHOO.widget.DataTable.prototype.onEventSelectRow=function(oArgs){var sMode=this.get("selectionMode");if((sMode=="singlecell")||(sMode=="cellblock")||(sMode=="cellrange")){return;}
+var evt=oArgs.event;var elTarget=oArgs.target;var bSHIFT=evt.shiftKey;var bCTRL=evt.ctrlKey;var i,nAnchorTrIndex;var elTargetRow=this.getTrEl(elTarget);if(elTargetRow){var allRows=this._elTbody.rows;var nTargetTrIndex=elTargetRow.sectionRowIndex;var elAnchorRow=YAHOO.util.Dom.get(this._sSelectionAnchorId);if((sMode!="single")&&bSHIFT&&bCTRL){if(elAnchorRow&&YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)){nAnchorTrIndex=elAnchorRow.sectionRowIndex;if(this.isSelected(elAnchorRow)){if(nAnchorTrIndex<nTargetTrIndex){for(i=nAnchorTrIndex+1;i<=nTargetTrIndex;i++){if(!this.isSelected(allRows[i])){this.selectRow(allRows[i]);}}}
+else{for(i=nAnchorTrIndex-1;i>=nTargetTrIndex;i--){if(!this.isSelected(allRows[i])){this.selectRow(allRows[i]);}}}}
+else{if(nAnchorTrIndex<nTargetTrIndex){for(i=nAnchorTrIndex+1;i<=nTargetTrIndex-1;i++){if(this.isSelected(allRows[i])){this.unselectRow(allRows[i]);}}}
+else{for(i=nTargetTrIndex+1;i<=nAnchorTrIndex-1;i++){if(this.isSelected(allRows[i])){this.unselectRow(allRows[i]);}}}
+this.selectRow(elTargetRow);}}
+else{this._sSelectionAnchorId=elTargetRow.id;if(this.isSelected(elTargetRow)){this.unselectRow(elTargetRow);}
+else{this.selectRow(elTargetRow);}}}
+else if((sMode!="single")&&bSHIFT){this.unselectAllRows();if(elAnchorRow&&YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)){nAnchorTrIndex=elAnchorRow.sectionRowIndex;if(nAnchorTrIndex<nTargetTrIndex){for(i=nAnchorTrIndex;i<=nTargetTrIndex;i++){this.selectRow(allRows[i]);}}
+else{for(i=nAnchorTrIndex;i>=nTargetTrIndex;i--){this.selectRow(allRows[i]);}}}
+else{this._sSelectionAnchorId=elTargetRow.id;this.selectRow(elTargetRow);}}
+else if((sMode!="single")&&bCTRL){this._sSelectionAnchorId=elTargetRow.id;if(this.isSelected(elTargetRow)){this.unselectRow(elTargetRow);}
+else{this.selectRow(elTargetRow);}}
+else if(sMode=="single"){this.unselectAllRows();this.selectRow(elTargetRow);}
+else{this._sSelectionAnchorId=elTargetRow.id;this.unselectAllRows();this.selectRow(elTargetRow);}
+YAHOO.util.Event.stopEvent(evt);var sel;if(window.getSelection){sel=window.getSelection();}
+else if(document.getSelection){sel=document.getSelection();}
+else if(document.selection){sel=document.selection;}
+if(sel){if(sel.empty){sel.empty();}
+else if(sel.removeAllRanges){sel.removeAllRanges();}
+else if(sel.collapse){sel.collapse();}}}
+else{}};YAHOO.widget.DataTable.prototype.onEventSelectCell=function(oArgs){var sMode=this.get("selectionMode");if((sMode=="standard")||(sMode=="single")){return;}
+var evt=oArgs.event;var elTarget=oArgs.target;var bSHIFT=evt.shiftKey;var bCTRL=evt.ctrlKey;var i,j,nAnchorTrIndex,nAnchorTdIndex,currentRow,startIndex,endIndex;var elTargetCell=this.getTdEl(elTarget);if(elTargetCell){var elTargetRow=this.getTrEl(elTargetCell);var allRows=this._elTbody.rows;var nTargetTrIndex=elTargetRow.sectionRowIndex;var nTargetTdIndex=elTarget.yuiCellIndex;var elAnchorCell=YAHOO.util.Dom.get(this._sSelectionAnchorId);if((sMode!="singlecell")&&bSHIFT&&bCTRL){if(elAnchorCell&&YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)){nAnchorTrIndex=elAnchorCell.parentNode.sectionRowIndex;nAnchorTdIndex=elAnchorCell.yuiCellIndex;if(this.isSelected(elAnchorCell)){if(nAnchorTrIndex==nTargetTrIndex){if(nAnchorTdIndex<nTargetTdIndex){for(i=nAnchorTdIndex+1;i<=nTargetTdIndex;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}}
+else if(nTargetTdIndex<nAnchorTdIndex){for(i=nTargetTdIndex;i<nAnchorTdIndex;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}}}
+else if(nAnchorTrIndex<nTargetTrIndex){if(sMode=="cellrange"){for(i=nAnchorTdIndex+1;i<allRows[nAnchorTrIndex].cells.length;i++){this.selectCell(allRows[nAnchorTrIndex].cells[i]);}
+for(i=nAnchorTrIndex+1;i<nTargetTrIndex;i++){for(j=0;j<allRows[i].cells.length;j++){this.selectCell(allRows[i].cells[j]);}}
+for(i=0;i<=nTargetTdIndex;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}}
+else if(sMode=="cellblock"){startIndex=Math.min(nAnchorTdIndex,nTargetTdIndex);endIndex=Math.max(nAnchorTdIndex,nTargetTdIndex);for(i=nAnchorTrIndex;i<=nTargetTrIndex;i++){for(j=startIndex;j<=endIndex;j++){this.selectCell(allRows[i].cells[j]);}}}}
+else{if(sMode=="cellrange"){for(i=nTargetTdIndex;i<allRows[nTargetTrIndex].cells.length;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}
+for(i=nTargetTrIndex+1;i<nAnchorTrIndex;i++){for(j=0;j<allRows[i].cells.length;j++){this.selectCell(allRows[i].cells[j]);}}
+for(i=0;i<nAnchorTdIndex;i++){this.selectCell(allRows[nAnchorTrIndex].cells[i]);}}
+else if(sMode=="cellblock"){startIndex=Math.min(nAnchorTdIndex,nTargetTdIndex);endIndex=Math.max(nAnchorTdIndex,nTargetTdIndex);for(i=nAnchorTrIndex;i>=nTargetTrIndex;i--){for(j=endIndex;j>=startIndex;j--){this.selectCell(allRows[i].cells[j]);}}}}}
+else{if(nAnchorTrIndex==nTargetTrIndex){if(nAnchorTdIndex<nTargetTdIndex){for(i=nAnchorTdIndex+1;i<nTargetTdIndex;i++){this.unselectCell(allRows[nTargetTrIndex].cells[i]);}}
+else if(nTargetTdIndex<nAnchorTdIndex){for(i=nTargetTdIndex+1;i<nAnchorTdIndex;i++){this.unselectCell(allRows[nTargetTrIndex].cells[i]);}}}
+if(nAnchorTrIndex<nTargetTrIndex){for(i=nAnchorTrIndex;i<=nTargetTrIndex;i++){currentRow=allRows[i];for(j=0;j<currentRow.cells.length;j++){if(currentRow.sectionRowIndex==nAnchorTrIndex){if(j>nAnchorTdIndex){this.unselectCell(currentRow.cells[j]);}}
+else if(currentRow.sectionRowIndex==nTargetTrIndex){if(j<nTargetTdIndex){this.unselectCell(currentRow.cells[j]);}}
+else{this.unselectCell(currentRow.cells[j]);}}}}
+else{for(i=nTargetTrIndex;i<=nAnchorTrIndex;i++){currentRow=allRows[i];for(j=0;j<currentRow.cells.length;j++){if(currentRow.sectionRowIndex==nTargetTrIndex){if(j>nTargetTdIndex){this.unselectCell(currentRow.cells[j]);}}
+else if(currentRow.sectionRowIndex==nAnchorTrIndex){if(j<nAnchorTdIndex){this.unselectCell(currentRow.cells[j]);}}
+else{this.unselectCell(currentRow.cells[j]);}}}}
+this.selectCell(elTargetCell);}}
+else{this._sSelectionAnchorId=elTargetCell.id;if(this.isSelected(elTargetCell)){this.unselectCell(elTargetCell);}
+else{this.selectCell(elTargetCell);}}}
+else if((sMode!="singlecell")&&bSHIFT){this.unselectAllCells();if(elAnchorCell&&YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)){nAnchorTrIndex=elAnchorCell.parentNode.sectionRowIndex;nAnchorTdIndex=elAnchorCell.yuiCellIndex;if(nAnchorTrIndex==nTargetTrIndex){if(nAnchorTdIndex<nTargetTdIndex){for(i=nAnchorTdIndex;i<=nTargetTdIndex;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}}
+else if(nTargetTdIndex<nAnchorTdIndex){for(i=nTargetTdIndex;i<=nAnchorTdIndex;i++){this.selectCell(allRows[nTargetTrIndex].cells[i]);}}}
+else if(nAnchorTrIndex<nTargetTrIndex){if(sMode=="cellrange"){for(i=nAnchorTrIndex;i<=nTargetTrIndex;i++){currentRow=allRows[i];for(j=0;j<currentRow.cells.length;j++){if(currentRow.sectionRowIndex==nAnchorTrIndex){if(j>=nAnchorTdIndex){this.selectCell(currentRow.cells[j]);}}
+else if(currentRow.sectionRowIndex==nTargetTrIndex){if(j<=nTargetTdIndex){this.selectCell(currentRow.cells[j]);}}
+else{this.selectCell(currentRow.cells[j]);}}}}
+else if(sMode=="cellblock"){startIndex=Math.min(nAnchorTdIndex,nTargetTdIndex);endIndex=Math.max(nAnchorTdIndex,nTargetTdIndex);for(i=nAnchorTrIndex;i<=nTargetTrIndex;i++){for(j=startIndex;j<=endIndex;j++){this.selectCell(allRows[i].cells[j]);}}
+this._sLastSelectedId=allRows[nTargetTrIndex].cells[nTargetTdIndex].id;}}
+else{if(sMode=="cellrange"){for(i=nTargetTrIndex;i<=nAnchorTrIndex;i++){currentRow=allRows[i];for(j=0;j<currentRow.cells.length;j++){if(currentRow.sectionRowIndex==nTargetTrIndex){if(j>=nTargetTdIndex){this.selectCell(currentRow.cells[j]);}}
+else if(currentRow.sectionRowIndex==nAnchorTrIndex){if(j<=nAnchorTdIndex){this.selectCell(currentRow.cells[j]);}}
+else{this.selectCell(currentRow.cells[j]);}}}}
+else if(sMode=="cellblock"){startIndex=Math.min(nAnchorTdIndex,nTargetTdIndex);endIndex=Math.max(nAnchorTdIndex,nTargetTdIndex);for(i=nTargetTrIndex;i<=nAnchorTrIndex;i++){for(j=startIndex;j<=endIndex;j++){this.selectCell(allRows[i].cells[j]);}}
+this._sLastSelectedId=allRows[nTargetTrIndex].cells[nTargetTdIndex].id;}}}
+else{this._sSelectionAnchorId=elTargetCell.id;this.selectCell(elTargetCell);}}
+else if((sMode!="singlecell")&&bCTRL){this._sSelectionAnchorId=elTargetCell.id;if(this.isSelected(elTargetCell)){this.unselectCell(elTargetCell);}
+else{this.selectCell(elTargetCell);}}
+else{this._sSelectionAnchorId=elTargetCell.id;this.unselectAllCells();this.selectCell(elTargetCell);}
+YAHOO.util.Event.stopEvent(evt);var sel;if(window.getSelection){sel=window.getSelection();}
+else if(document.getSelection){sel=document.getSelection();}
+else if(document.selection){sel=document.selection;}
+if(sel){if(sel.empty){sel.empty();}
+else if(sel.removeAllRanges){sel.removeAllRanges();}
+else if(sel.collapse){sel.collapse();}}}
+else{}};YAHOO.widget.DataTable.prototype.onEventHighlightRow=function(oArgs){var evt=oArgs.event;var elTarget=oArgs.target;this.highlightRow(elTarget);};YAHOO.widget.DataTable.prototype.onEventUnhighlightRow=function(oArgs){var evt=oArgs.event;var elTarget=oArgs.target;this.unhighlightRow(elTarget);};YAHOO.widget.DataTable.prototype.onEventHighlightCell=function(oArgs){var evt=oArgs.event;var elTarget=oArgs.target;this.highlightCell(elTarget);};YAHOO.widget.DataTable.prototype.onEventUnhighlightCell=function(oArgs){var evt=oArgs.event;var elTarget=oArgs.target;this.unhighlightCell(elTarget);};YAHOO.widget.DataTable.prototype.onEventFormatCell=function(oArgs){var evt=oArgs.event;var target=oArgs.target;var elTag=target.tagName.toLowerCase();var elCell=this.getTdEl(target);if(elCell&&YAHOO.lang.isNumber(elCell.yuiColumnId)){var oColumn=this._oColumnSet.getColumn(elCell.yuiColumnId);this.formatCell(elCell,this.getRecord(elCell),oColumn);}
+else{}};YAHOO.widget.DataTable.prototype.onEventShowCellEditor=function(oArgs){var evt=oArgs.event;var target=oArgs.target;var elTag=target.tagName.toLowerCase();var elCell=this.getTdEl(target);if(elCell){this.showCellEditor(elCell);}
+else{}};YAHOO.widget.DataTable.prototype.onEventEditCell=function(oArgs){this.onEventShowCellEditor(oArgs);};YAHOO.widget.DataTable.prototype.onEventSaveCellEditor=function(oArgs){this.saveCellEditor();};YAHOO.widget.DataTable.prototype._onDataReturnEnhanceTable=function(sRequest,oResponse){var ok=this.doBeforeLoadData(sRequest,oResponse);if(ok&&oResponse&&!oResponse.error&&YAHOO.lang.isArray(oResponse.results)){this._oRecordSet.addRecords(oResponse.results);this._initTableEl();if(!this._elTable||!this._elThead||!this._elTbody){return;}
+YAHOO.widget.DataTable.superclass.constructor.call(this,this._elContainer,this._oConfigs);if(this._oConfigs.paginator){this.updatePaginator(this._oConfigs.paginator);}
+this.refreshView();}
+else if(ok&&oResponse.error){this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR,YAHOO.widget.DataTable.CLASS_ERROR);}
+else if(ok){this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY,YAHOO.widget.DataTable.CLASS_EMPTY);}};YAHOO.widget.DataTable.prototype.onDataReturnInitializeTable=function(sRequest,oResponse){this.fireEvent("dataReturnEvent",{request:sRequest,response:oResponse});var ok=this.doBeforeLoadData(sRequest,oResponse);if(ok&&oResponse&&!oResponse.error&&YAHOO.lang.isArray(oResponse.results)){this.initializeTable(oResponse.results);}
+else if(ok&&oResponse.error){this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR,YAHOO.widget.DataTable.CLASS_ERROR);}
+else if(ok){this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY,YAHOO.widget.DataTable.CLASS_EMPTY);}};YAHOO.widget.DataTable.prototype.onDataReturnReplaceRows=function(sRequest,oResponse){this.onDataReturnInitializeTable(sRequest,oResponse);};YAHOO.widget.DataTable.prototype.onDataReturnAppendRows=function(sRequest,oResponse){this.fireEvent("dataReturnEvent",{request:sRequest,response:oResponse});var ok=this.doBeforeLoadData(sRequest,oResponse);if(ok&&oResponse&&!oResponse.error&&YAHOO.lang.isArray(oResponse.results)){this.addRows(oResponse.results);}
+else if(ok&&oResponse.error){this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR,YAHOO.widget.DataTable.CLASS_ERROR);}};YAHOO.widget.DataTable.prototype.onDataReturnInsertRows=function(sRequest,oResponse){this.fireEvent("dataReturnEvent",{request:sRequest,response:oResponse});var ok=this.doBeforeLoadData(sRequest,oResponse);if(ok&&oResponse&&!oResponse.error&&YAHOO.lang.isArray(oResponse.results)){this.addRows(oResponse.results,0);}
+else if(ok&&oResponse.error){this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR,YAHOO.widget.DataTable.CLASS_ERROR);}};YAHOO.widget.ColumnSet=function(aHeaders){this._sName="instance"+YAHOO.widget.ColumnSet._nCount;var tree=[];var flat=[];var keys=[];var headers=[];var nodeDepth=-1;var parseColumns=function(nodeList,parent){nodeDepth++;if(!tree[nodeDepth]){tree[nodeDepth]=[];}
+for(var j=0;j<nodeList.length;j++){var currentNode=nodeList[j];var oColumn=new YAHOO.widget.Column(currentNode);flat.push(oColumn);if(parent){oColumn.parent=parent;}
+if(YAHOO.lang.isArray(currentNode.children)){oColumn.children=currentNode.children;var terminalChildNodes=0;var countTerminalChildNodes=function(ancestor){var descendants=ancestor.children;for(var k=0;k<descendants.length;k++){if(YAHOO.lang.isArray(descendants[k].children)){countTerminalChildNodes(descendants[k]);}
+else{terminalChildNodes++;}}};countTerminalChildNodes(currentNode);oColumn._colspan=terminalChildNodes;var currentChildren=currentNode.children;for(var k=0;k<currentChildren.length;k++){var child=currentChildren[k];if(oColumn.className&&(child.className===undefined)){child.className=oColumn.className;}
+if(oColumn.editor&&(child.editor===undefined)){child.editor=oColumn.editor;}
+if(oColumn.editorOptions&&(child.editorOptions===undefined)){child.editorOptions=oColumn.editorOptions;}
+if(oColumn.formatter&&(child.formatter===undefined)){child.formatter=oColumn.formatter;}
+if(oColumn.resizeable&&(child.resizeable===undefined)){child.resizeable=oColumn.resizeable;}
+if(oColumn.sortable&&(child.sortable===undefined)){child.sortable=oColumn.sortable;}
+if(oColumn.width&&(child.width===undefined)){child.width=oColumn.width;}
+if(oColumn.type&&(child.type===undefined)){child.type=oColumn.type;}
+if(oColumn.type&&!oColumn.formatter){oColumn.formatter=oColumn.type;}
+if(oColumn.text&&!YAHOO.lang.isValue(oColumn.label)){oColumn.label=oColumn.text;}
+if(oColumn.parser){}
+if(oColumn.sortOptions&&((oColumn.sortOptions.ascFunction)||(oColumn.sortOptions.descFunction))){}}
+if(!tree[nodeDepth+1]){tree[nodeDepth+1]=[];}
+parseColumns(currentChildren,oColumn);}
+else{oColumn._nKeyIndex=keys.length;oColumn._colspan=1;keys.push(oColumn);}
+tree[nodeDepth].push(oColumn);}
+nodeDepth--;};if(YAHOO.lang.isArray(aHeaders)){parseColumns(aHeaders);}
+var parseTreeForRowspan=function(tree){var maxRowDepth=1;var currentRow;var currentColumn;var countMaxRowDepth=function(row,tmpRowDepth){tmpRowDepth=tmpRowDepth||1;for(var n=0;n<row.length;n++){var col=row[n];if(YAHOO.lang.isArray(col.children)){tmpRowDepth++;countMaxRowDepth(col.children,tmpRowDepth);tmpRowDepth--;}
+else{if(tmpRowDepth>maxRowDepth){maxRowDepth=tmpRowDepth;}}}};for(var m=0;m<tree.length;m++){currentRow=tree[m];countMaxRowDepth(currentRow);for(var p=0;p<currentRow.length;p++){currentColumn=currentRow[p];if(!YAHOO.lang.isArray(currentColumn.children)){currentColumn._rowspan=maxRowDepth;}
+else{currentColumn._rowspan=1;}}
+maxRowDepth=1;}};parseTreeForRowspan(tree);var recurseAncestorsForHeaders=function(i,oColumn){headers[i].push(oColumn._nId);if(oColumn.parent){recurseAncestorsForHeaders(i,oColumn.parent);}};for(var i=0;i<keys.length;i++){headers[i]=[];recurseAncestorsForHeaders(i,keys[i]);headers[i]=headers[i].reverse();headers[i]=headers[i].join(" ");}
+this.tree=tree;this.flat=flat;this.keys=keys;this.headers=headers;YAHOO.widget.ColumnSet._nCount++;};YAHOO.widget.ColumnSet._nCount=0;YAHOO.widget.ColumnSet.prototype._sName=null;YAHOO.widget.ColumnSet.prototype.tree=null;YAHOO.widget.ColumnSet.prototype.flat=null;YAHOO.widget.ColumnSet.prototype.keys=null;YAHOO.widget.ColumnSet.prototype.headers=null;YAHOO.widget.ColumnSet.prototype.toString=function(){return"ColumnSet "+this._sName;};YAHOO.widget.ColumnSet.prototype.getColumn=function(column){var allColumns=this.flat;if(YAHOO.lang.isNumber(column)){for(var i=0;i<allColumns.length;i++){if(allColumns[i]._nId===column){return allColumns[i];}}}
+else if(YAHOO.lang.isString(column)){for(i=0;i<allColumns.length;i++){if(allColumns[i].key===column){return allColumns[i];}}}
+return null;};YAHOO.widget.Column=function(oConfigs){this._nId=YAHOO.widget.Column._nCount;this._sName="Column instance"+this._nId;if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}
+if(!YAHOO.lang.isValue(this.key)){this.key="yui-dt-column"+this._nId;}
+YAHOO.widget.Column._nCount++;};YAHOO.widget.Column._nCount=0;YAHOO.widget.Column.prototype._sName=null;YAHOO.widget.Column.prototype._nId=null;YAHOO.widget.Column.prototype._nKeyIndex=null;YAHOO.widget.Column.prototype._colspan=1;YAHOO.widget.Column.prototype._rowspan=1;YAHOO.widget.Column.prototype._parent=null;YAHOO.widget.Column.prototype._width=null;YAHOO.widget.Column.prototype._minWidth=null;YAHOO.widget.Column.prototype.key=null;YAHOO.widget.Column.prototype.label=null;YAHOO.widget.Column.prototype.abbr=null;YAHOO.widget.Column.prototype.children=null;YAHOO.widget.Column.prototype.width=null;YAHOO.widget.Column.prototype.className=null;YAHOO.widget.Column.prototype.formatter=null;YAHOO.widget.Column.prototype.editor=null;YAHOO.widget.Column.prototype.editorOptions=null;YAHOO.widget.Column.prototype.resizeable=false;YAHOO.widget.Column.prototype.sortable=false;YAHOO.widget.Column.prototype.sortOptions=null;YAHOO.widget.Column.prototype.toString=function(){return this._sName;};YAHOO.widget.Column.prototype.getId=function(){return this._nId;};YAHOO.widget.Column.prototype.getKeyIndex=function(){return this._nKeyIndex;};YAHOO.widget.Column.prototype.getParent=function(){return this._parent;};YAHOO.widget.Column.prototype.getColspan=function(){return this._colspan;};YAHOO.widget.Column.prototype.getColSpan=function(){return this.getColspan();};YAHOO.widget.Column.prototype.getRowspan=function(){return this._rowspan;};YAHOO.widget.Column.prototype.getIndex=function(){return this.getKeyIndex();};YAHOO.widget.Column.prototype.format=function(){};YAHOO.widget.Column.formatCheckbox=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatCheckbox(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatCurrency=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatCurrency(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatDate=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatDate(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatEmail=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatEmail(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatLink=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatLink(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatNumber=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatNumber(elCell,oRecord,oColumn,oData);};YAHOO.widget.Column.formatSelect=function(elCell,oRecord,oColumn,oData){YAHOO.widget.DataTable.formatDropdown(elCell,oRecord,oColumn,oData);};YAHOO.util.Sort={compare:function(a,b,desc){if((a===null)||(typeof a=="undefined")){if((b===null)||(typeof b=="undefined")){return 0;}
+else{return 1;}}
+else if((b===null)||(typeof b=="undefined")){return-1;}
+if(a.constructor==String){a=a.toLowerCase();}
+if(b.constructor==String){b=b.toLowerCase();}
+if(a<b){return(desc)?1:-1;}
+else if(a>b){return(desc)?-1:1;}
+else{return 0;}}};YAHOO.util.ColumnResizer=function(oDataTable,oColumn,elThead,sHandleId,sGroup,oConfig){if(oDataTable&&oColumn&&elThead&&sHandleId){this.datatable=oDataTable;this.column=oColumn;this.cell=elThead;this.init(sHandleId,sGroup,oConfig);this.setYConstraint(0,0);}
+else{}};if(YAHOO.util.DD){YAHOO.extend(YAHOO.util.ColumnResizer,YAHOO.util.DD);}
+YAHOO.util.ColumnResizer.prototype.onMouseDown=function(e){this.startWidth=this.cell.offsetWidth;this.startPos=YAHOO.util.Dom.getX(this.getDragEl());if(this.datatable.fixedWidth){var cellLabel=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",this.cell)[0];this.minWidth=cellLabel.offsetWidth+6;var sib=this.cell.nextSibling;var sibCellLabel=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",sib)[0];this.sibMinWidth=sibCellLabel.offsetWidth+6;var left=((this.startWidth-this.minWidth)<0)?0:(this.startWidth-this.minWidth);var right=((sib.offsetWidth-this.sibMinWidth)<0)?0:(sib.offsetWidth-this.sibMinWidth);this.setXConstraint(left,right);}};YAHOO.util.ColumnResizer.prototype.onMouseUp=function(e){var resizeStyle=YAHOO.util.Dom.get(this.handleElId).style;resizeStyle.left="auto";resizeStyle.right=0;resizeStyle.marginRight="-6px";resizeStyle.width="6px";this.datatable.fireEvent("columnResizeEvent",{column:this.column,target:this.cell});};YAHOO.util.ColumnResizer.prototype.onDrag=function(e){var newPos=YAHOO.util.Dom.getX(this.getDragEl());var offsetX=newPos-this.startPos;var newWidth=this.startWidth+offsetX;if(newWidth<this.minWidth){newWidth=this.minWidth;}
+var oDataTable=this.datatable;var elCell=this.cell;if(oDataTable.fixedWidth){var sib=elCell.nextSibling;var sibnewwidth=sib.offsetWidth-offsetX;if(sibnewwidth<this.sibMinWidth){sibnewwidth=this.sibMinWidth;}
+for(var i=0;i<oDataTable._oColumnSet.length;i++){}
+sib.style.width=sibnewwidth;elCell.style.width=newWidth+"px";}
+else{elCell.style.width=newWidth+"px";}};YAHOO.widget.RecordSet=function(data){this._sName="RecordSet instance"+YAHOO.widget.RecordSet._nCount;YAHOO.widget.RecordSet._nCount++;this._records=[];this._length=0;if(data){if(YAHOO.lang.isArray(data)){this.addRecords(data);}
+else if(data.constructor==Object){this.addRecord(data);}}
+this.createEvent("recordAddEvent");this.createEvent("recordsAddEvent");this.createEvent("recordUpdateEvent");this.createEvent("recordDeleteEvent");this.createEvent("recordsDeleteEvent");this.createEvent("resetEvent");this.createEvent("keyUpdateEvent");};if(YAHOO.util.EventProvider){YAHOO.augment(YAHOO.widget.RecordSet,YAHOO.util.EventProvider);}
+else{}
+YAHOO.widget.RecordSet._nCount=0;YAHOO.widget.RecordSet.prototype._sName=null;YAHOO.widget.RecordSet.prototype._nRecordCount=0;YAHOO.widget.RecordSet.prototype._length=null;YAHOO.widget.RecordSet.prototype._addRecord=function(oData,index){var oRecord=new YAHOO.widget.Record(oData);oRecord._nId=this._nRecordCount;this._nRecordCount++;if(YAHOO.lang.isNumber(index)&&(index>-1)){this._records.splice(index,0,oRecord);}
+else{index=this.getLength();this._records.push(oRecord);}
+this._length++;return oRecord;};YAHOO.widget.RecordSet.prototype._deleteRecord=function(index,range){if(!YAHOO.lang.isNumber(range)||(range<0)){range=1;}
+this._records.splice(index,range);this._length=this._length-range;};YAHOO.widget.RecordSet.prototype.toString=function(){return this._sName;};YAHOO.widget.RecordSet.prototype.getLength=function(){return this._length;};YAHOO.widget.RecordSet.prototype.getRecord=function(index){if(YAHOO.lang.isNumber(index)){return this._records[index];}
+return null;};YAHOO.widget.RecordSet.prototype.getRecords=function(index,range){if(!YAHOO.lang.isNumber(index)){return this._records;}
+if(!YAHOO.lang.isNumber(range)){return this._records.slice(index);}
+return this._records.slice(index,index+range);};YAHOO.widget.RecordSet.prototype.getRecordIndex=function(oRecord){for(var i=this._records.length-1;i>-1;i--){if(oRecord.getId()===this._records[i].getId()){return i;}}
+return null;};YAHOO.widget.RecordSet.prototype.addRecord=function(oData,index){if(oData&&(oData.constructor==Object)){var oRecord=this._addRecord(oData,index);this.fireEvent("recordAddEvent",{record:oRecord,data:oData});return oRecord;}
+else{return null;}};YAHOO.widget.RecordSet.prototype.addRecords=function(aData,index){if(YAHOO.lang.isArray(aData)){var newRecords=[];for(var i=0;i<aData.length;i++){if(aData[i]&&(aData[i].constructor==Object)){var record=this._addRecord(aData[i],index);newRecords.push(record);}}
+this.fireEvent("recordsAddEvent",{records:newRecords,data:aData});return newRecords;}
+else if(aData&&(aData.constructor==Object)){var oRecord=this._addRecord(aData);this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData});return oRecord;}
+else{}};YAHOO.widget.RecordSet.prototype.updateRecord=function(record,oData){var oRecord=null;if(YAHOO.lang.isNumber(record)){oRecord=this._records[record];}
+else if(record instanceof YAHOO.widget.Record){oRecord=record;}
+if(oRecord&&oData&&(oData.constructor==Object)){var oldData={};for(var key in oRecord._oData){oldData[key]=oRecord._oData[key];}
+oRecord._oData=oData;this.fireEvent("recordUpdateEvent",{record:oRecord,newData:oData,oldData:oldData});return oRecord;}
+else{return null;}};YAHOO.widget.RecordSet.prototype.updateKey=function(record,sKey,oData){var oRecord;if(YAHOO.lang.isNumber(record)){oRecord=this._records[record];}
+if(record instanceof YAHOO.widget.Record){oRecord=record;var oldData=null;var keyValue=oRecord._oData[sKey];if(keyValue&&keyValue.constructor==Object){oldData={};for(var key in keyValue){oldData[key]=keyValue[key];}}
+else{oldData=keyValue;}
+oRecord._oData[sKey]=oData;this.fireEvent("keyUpdateEvent",{record:oRecord,key:sKey,newData:oData,oldData:oldData});}
+else{}};YAHOO.widget.RecordSet.prototype.replaceRecords=function(data){this.reset();return this.addRecords(data);};YAHOO.widget.RecordSet.prototype.sortRecords=function(fnSort,desc){return this._records.sort(function(a,b){return fnSort(a,b,desc);});};YAHOO.widget.RecordSet.prototype.deleteRecord=function(index){if(YAHOO.lang.isNumber(index)&&(index>-1)&&(index<this.getLength())){var oRecordData=this.getRecord(index).getData();var oData={};for(var key in oRecordData){oData[key]=oRecordData[key];}
+this._deleteRecord(index);this.fireEvent("recordDeleteEvent",{data:oData,index:index});return oData;}
+else{return null;}};YAHOO.widget.RecordSet.prototype.deleteRecords=function(index,range){if(!YAHOO.lang.isNumber(range)){range=1;}
+if(YAHOO.lang.isNumber(index)&&(index>-1)&&(index<this.getLength())){var recordsToDelete=this.getRecords(index,range);var deletedData=[];for(var i=0;i<recordsToDelete.length;i++){var oData={};for(var key in recordsToDelete[i]){oData[key]=recordsToDelete[i][key];}
+deletedData.push(oData);}
+this._deleteRecord(index,range);this.fireEvent("recordsDeleteEvent",{data:deletedData,index:index});}
+else{}};YAHOO.widget.RecordSet.prototype.reset=function(){this._records=[];this._length=0;this.fireEvent("resetEvent");};YAHOO.widget.Record=function(oLiteral){this._oData={};if(oLiteral&&(oLiteral.constructor==Object)){for(var sKey in oLiteral){this._oData[sKey]=oLiteral[sKey];}}};YAHOO.widget.Record.prototype._nId=null;YAHOO.widget.Record.prototype._oData=null;YAHOO.widget.Record.prototype.getId=function(){return this._nId;};YAHOO.widget.Record.prototype.getData=function(sKey){if(YAHOO.lang.isString(sKey)){return this._oData[sKey];}
+else{return this._oData;}};YAHOO.register("datatable",YAHOO.widget.DataTable,{version:"2.3.0",build:"442"});
\ No newline at end of file
diff --git a/lib/yui/datatable/datatable-beta.js b/lib/yui/datatable/datatable-beta.js
new file mode 100755 (executable)
index 0000000..b56afe4
--- /dev/null
@@ -0,0 +1,8943 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * The DataTable widget provides a progressively enhanced DHTML control for
+ * displaying tabular data across A-grade browsers.
+ *
+ * @module datatable
+ * @requires yahoo, dom, event, datasource
+ * @optional dragdrop
+ * @title DataTable Widget
+ * @beta
+ */
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * DataTable class for the YUI DataTable widget.
+ *
+ * @namespace YAHOO.widget
+ * @class DataTable
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param elContainer {HTMLElement} Container element for the TABLE.
+ * @param aColumnDefs {Object[]} Array of object literal Column definitions.
+ * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
+ * @param oConfigs {object} (optional) Object literal of configuration values.
+ */
+YAHOO.widget.DataTable = function(elContainer,aColumnDefs,oDataSource,oConfigs) {
+    // Internal vars
+    this._nIndex = YAHOO.widget.DataTable._nCount;
+    this._sName = "instance" + this._nIndex;
+    this.id = "yui-dt"+this._nIndex;
+
+    // Initialize container element
+    this._initContainerEl(elContainer);
+    if(!this._elContainer) {
+        return;
+    }
+
+    // Initialize configs
+    this._initConfigs(oConfigs);
+
+    // Initialize ColumnSet
+    this._initColumnSet(aColumnDefs);
+    if(!this._oColumnSet) {
+        return;
+    }
+    
+    // Initialize RecordSet
+    this._initRecordSet();
+    if(!this._oRecordSet) {
+        return;
+    }
+
+    // Initialize DataSource
+    this._initDataSource(oDataSource);
+    if(!this._oDataSource) {
+        return;
+    }
+
+    // Progressive enhancement special case
+    if(this._oDataSource.dataType == YAHOO.util.DataSource.TYPE_HTMLTABLE) {
+        this._oDataSource.sendRequest(this.get("initialRequest"), this._onDataReturnEnhanceTable, this);
+    }
+    else {
+        // Initialize DOM elements
+        this._initTableEl();
+        if(!this._elTable || !this._elThead || !this._elTbody) {
+            return;
+        }
+
+        // Call Element's constructor after DOM elements are created
+        // but *before* table is populated with data
+        YAHOO.widget.DataTable.superclass.constructor.call(this, this._elContainer, this._oConfigs);
+        
+        //HACK: Set the Paginator values here via updatePaginator
+        if(this._oConfigs && this._oConfigs.paginator) {
+            this.updatePaginator(this._oConfigs.paginator);
+        }
+
+        // Send out for data in an asynchronous request
+        this._oDataSource.sendRequest(this.get("initialRequest"), this.onDataReturnInitializeTable, this);
+    }
+
+    // Initialize inline Cell editing
+    this._initCellEditorEl();
+
+    // Initialize Column sort
+    this._initColumnSort();
+
+    // Initialize DOM event listeners
+    this._initDomEvents();
+
+    YAHOO.widget.DataTable._nCount++;
+};
+
+if(YAHOO.util.Element) {
+    YAHOO.lang.extend(YAHOO.widget.DataTable, YAHOO.util.Element);
+}
+else {
+}
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Superclass methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Implementation of Element's abstract method. Sets up config values.
+ *
+ * @method initAttributes
+ * @param oConfigs {Object} (Optional) Object literal definition of configuration values.
+ * @private
+ */
+
+YAHOO.widget.DataTable.prototype.initAttributes = function(oConfigs) {
+    oConfigs = oConfigs || {};
+    YAHOO.widget.DataTable.superclass.initAttributes.call(this, oConfigs);
+
+    /**
+    * @config summary
+    * @description Value for the SUMMARY attribute.
+    * @type String
+    */
+    this.setAttributeConfig("summary", {
+        value: null,
+        validator: YAHOO.lang.isString,
+        method: function(sSummary) {
+            this._elTable.summary = sSummary;
+        }
+    });
+
+    /**
+    * @config selectionMode
+    * @description Specifies row or cell selection mode. Accepts the following strings:
+    *    <dl>
+    *      <dt>"standard"</dt>
+    *      <dd>Standard row selection with support for modifier keys to enable
+    *      multiple selections.</dd>
+    *
+    *      <dt>"single"</dt>
+    *      <dd>Row selection with modifier keys disabled to not allow
+    *      multiple selections.</dd>
+    *
+    *      <dt>"singlecell"</dt>
+    *      <dd>Cell selection with modifier keys disabled to not allow
+    *      multiple selections.</dd>
+    *
+    *      <dt>"cellblock"</dt>
+    *      <dd>Cell selection with support for modifier keys to enable multiple
+    *      selections in a block-fashion, like a spreadsheet.</dd>
+    *
+    *      <dt>"cellrange"</dt>
+    *      <dd>Cell selection with support for modifier keys to enable multiple
+    *      selections in a range-fashion, like a calendar.</dd>
+    *    </dl>
+    *
+    * @default "standard"
+    * @type String
+    */
+    this.setAttributeConfig("selectionMode", {
+        value: "standard",
+        validator: YAHOO.lang.isString
+    });
+
+    /**
+    * @config initialRequest
+    * @description Defines the initial request that gets sent to the DataSource.
+    * @type String
+    */
+    this.setAttributeConfig("initialRequest", {
+        value: "",
+        validator: YAHOO.lang.isString
+    });
+
+    /**
+    * @config sortedBy
+    * @description Object literal provides metadata for initial sort values if
+    * data will arrive pre-sorted:
+    * <dl>
+    *     <dt>sortedBy.key</dt>
+    *     <dd>Key of sorted Column</dd>
+    *     <dt>sortedBy.dir</dt>
+    *     <dd>Initial sort direction, either "asc" or "desc"</dd>
+    * </dl>
+    * @type Object
+    */
+    this.setAttributeConfig("sortedBy", {
+        value: null,
+        // TODO: accepted array for nested sorts
+        validator: function(oNewSortedBy) {
+            return (oNewSortedBy && (oNewSortedBy.constructor == Object) && oNewSortedBy.key);
+        },
+        method: function(oNewSortedBy) {
+            // Remove ASC/DESC from TH
+            var oOldSortedBy = this.get("sortedBy");
+            if(oOldSortedBy && (oOldSortedBy.constructor == Object) && oOldSortedBy.key) {
+                var oldColumn = this._oColumnSet.getColumn(oOldSortedBy.key);
+                var oldThEl = this.getThEl(oldColumn);
+                YAHOO.util.Dom.removeClass(oldThEl, YAHOO.widget.DataTable.CLASS_ASC);
+                YAHOO.util.Dom.removeClass(oldThEl, YAHOO.widget.DataTable.CLASS_DESC);
+            }
+            
+            // Set ASC/DESC on TH
+            var column = (oNewSortedBy.column) ? oNewSortedBy.column : this._oColumnSet.getColumn(oNewSortedBy.key);
+            if(column) {
+                var newClass = (oNewSortedBy.dir && (oNewSortedBy.dir != "asc")) ?
+                        YAHOO.widget.DataTable.CLASS_DESC :
+                        YAHOO.widget.DataTable.CLASS_ASC;
+                YAHOO.util.Dom.addClass(this.id + "-col" + column.getId(), newClass);
+            }
+        }
+    });
+
+    /**
+    * @config paginator
+    * @description Object literal of pagination values.
+    * @default <br>
+    *   { containers:[], // UI container elements <br>
+    *   rowsPerPage:500, // 500 rows <br>
+    *   currentPage:1,  // page one <br>
+    *   pageLinks:0,    // show all links <br>
+    *   pageLinksStart:1, // first link is page 1 <br>
+    *   dropdownOptions:null, // no dropdown <br>
+    *   links: [], // links elements <br>
+    *   dropdowns: [] } //dropdown elements
+    * 
+    * @type Object
+    */
+    this.setAttributeConfig("paginator", {
+        value: {
+            rowsPerPage:500, // 500 rows per page
+            currentPage:1,  // show page one
+            startRecordIndex:0, // start with first Record
+            totalRecords:0, // how many Records total
+            totalPages:0, // how many pages total
+            rowsThisPage:0, // how many rows this page
+            pageLinks:0,    // show all links
+            pageLinksStart:1, // first link is page 1
+            dropdownOptions: null, //no dropdown
+            containers:[], // Paginator container element references
+            dropdowns: [], //dropdown element references,
+            links: [] // links elements
+        },
+        validator: function(oNewPaginator) {
+            if(oNewPaginator && (oNewPaginator.constructor == Object)) {
+                // Check for incomplete set of values
+                if((oNewPaginator.rowsPerPage !== undefined) &&
+                        (oNewPaginator.currentPage !== undefined) &&
+                        (oNewPaginator.startRecordIndex !== undefined) &&
+                        (oNewPaginator.totalRecords !== undefined) &&
+                        (oNewPaginator.totalPages !== undefined) &&
+                        (oNewPaginator.rowsThisPage !== undefined) &&
+                        (oNewPaginator.pageLinks !== undefined) &&
+                        (oNewPaginator.pageLinksStart !== undefined) &&
+                        (oNewPaginator.dropdownOptions !== undefined) &&
+                        (oNewPaginator.containers !== undefined) &&
+                        (oNewPaginator.dropdowns !== undefined) &&
+                        (oNewPaginator.links !== undefined)) {
+
+                    // Validate each value
+                    if(YAHOO.lang.isNumber(oNewPaginator.rowsPerPage) &&
+                            YAHOO.lang.isNumber(oNewPaginator.currentPage) &&
+                            YAHOO.lang.isNumber(oNewPaginator.startRecordIndex) &&
+                            YAHOO.lang.isNumber(oNewPaginator.totalRecords) &&
+                            YAHOO.lang.isNumber(oNewPaginator.totalPages) &&
+                            YAHOO.lang.isNumber(oNewPaginator.rowsThisPage) &&
+                            YAHOO.lang.isNumber(oNewPaginator.pageLinks) &&
+                            YAHOO.lang.isNumber(oNewPaginator.pageLinksStart) &&
+                            YAHOO.lang.isArray(oNewPaginator.dropdownOptions) &&
+                            YAHOO.lang.isArray(oNewPaginator.containers) &&
+                            YAHOO.lang.isArray(oNewPaginator.dropdowns) &&
+                            YAHOO.lang.isArray(oNewPaginator.links)) {
+                        return true;
+                    }
+                }
+            }
+            return false;
+        }
+    });
+
+    /**
+    * @config paginated
+    * @description True if built-in client-side pagination is enabled
+    * @default false
+    * @type Boolean
+    */
+    this.setAttributeConfig("paginated", {
+        value: false,
+        validator: YAHOO.lang.isBoolean,
+        method: function(oParam) {
+            var oPaginator = this.get("paginator");
+            var aContainerEls = oPaginator.containers;
+            
+            // Paginator is enabled
+            if(oParam) {
+                // No containers found, create two from scratch
+                if(aContainerEls.length === 0) {
+                    // One before TABLE
+                    var pag0 = document.createElement("span");
+                    pag0.id = this.id + "-paginator0";
+                    YAHOO.util.Dom.addClass(pag0, YAHOO.widget.DataTable.CLASS_PAGINATOR);
+                    pag0 = this._elContainer.insertBefore(pag0, this._elTable);
+                    aContainerEls.push(pag0);
+
+                    // One after TABLE
+                    var pag1 = document.createElement("span");
+                    pag1.id = this.id + "-paginator1";
+                    YAHOO.util.Dom.addClass(pag1, YAHOO.widget.DataTable.CLASS_PAGINATOR);
+                    pag1 = this._elContainer.insertBefore(pag1, this._elTable.nextSibling);
+                    aContainerEls.push(pag1);
+
+                    // Add containers directly to tracker
+                    this._configs.paginator.value.containers = [pag0, pag1];
+
+                }
+                else {
+                    // Show each container
+                    for(var i=0; i<aContainerEls.length; i++) {
+                        aContainerEls[i].style.display = "";
+                    }
+                }
+
+                // Links are enabled
+                if(oPaginator.pageLinks > -1) {
+                    var aLinkEls = oPaginator.links;
+                    // No links containers found, create from scratch
+                    if(aLinkEls.length === 0) {
+                        for(i=0; i<aContainerEls.length; i++) {
+                            // Create one links container per Paginator container
+                            var linkEl = document.createElement("span");
+                            linkEl.id = "yui-dt-pagselect"+i;
+                            linkEl = aContainerEls[i].appendChild(linkEl);
+
+                            // Add event listener
+                            //TODO: anon fnc
+                            YAHOO.util.Event.addListener(linkEl,"click",this._onPaginatorLinkClick,this);
+
+                             // Add directly to tracker
+                            this._configs.paginator.value.links.push(linkEl);
+                       }
+                   }
+                }
+
+                // Show these options in the dropdown
+                var dropdownOptions = oPaginator.dropdownOptions || [];
+
+                for(i=0; i<aContainerEls.length; i++) {
+                    // Create one SELECT element per Paginator container
+                    var selectEl = document.createElement("select");
+                    YAHOO.util.Dom.addClass(selectEl, YAHOO.widget.DataTable.CLASS_DROPDOWN);
+                    selectEl = aContainerEls[i].appendChild(selectEl);
+                    selectEl.id = "yui-dt-pagselect"+i;
+
+                    // Add event listener
+                    //TODO: anon fnc
+                    YAHOO.util.Event.addListener(selectEl,"change",this._onPaginatorDropdownChange,this);
+
+                    // Add DOM reference directly to tracker
+                   this._configs.paginator.value.dropdowns.push(selectEl);
+
+                    // Hide dropdown
+                    if(!oPaginator.dropdownOptions) {
+                        selectEl.style.display = "none";
+                    }
+                }
+
+                //TODO: fire paginatorDisabledEvent & add to api doc
+            }
+            // Pagination is disabled
+            else {
+                // Containers found
+                if(aContainerEls.length > 0) {
+                    // Destroy or just hide?
+                    
+                    // Hide each container
+                    for(i=0; i<aContainerEls.length; i++) {
+                        aContainerEls[i].style.display = "none";
+                    }
+
+                    /*TODO?
+                    // Destroy each container
+                    for(i=0; i<aContainerEls.length; i++) {
+                        YAHOO.util.Event.purgeElement(aContainerEls[i], true);
+                        aContainerEls.innerHTML = null;
+                        //TODO: remove container?
+                        // aContainerEls[i].parentNode.removeChild(aContainerEls[i]);
+                    }
+                    */
+                }
+                //TODO: fire paginatorDisabledEvent & add to api doc
+            }
+        }
+    });
+
+    /**
+    * @config caption
+    * @description Value for the CAPTION element.
+    * @type String
+    */
+    this.setAttributeConfig("caption", {
+        value: null,
+        validator: YAHOO.lang.isString,
+        method: function(sCaption) {
+            // Create CAPTION element
+            if(!this._elCaption) {
+                if(!this._elTable.firstChild) {
+                    this._elCaption = this._elTable.appendChild(document.createElement("caption"));
+                }
+                else {
+                    this._elCaption = this._elTable.insertBefore(document.createElement("caption"), this._elTable.firstChild);
+                }
+            }
+            // Set CAPTION value
+            this._elCaption.innerHTML = sCaption;
+        }
+    });
+
+    /**
+    * @config scrollable
+    * @description True if primary TBODY should scroll while THEAD remains fixed.
+    * When enabling this feature, captions cannot be used, and the following
+    * features are not recommended: inline editing, resizeable columns.
+    * @default false
+    * @type Boolean
+    */
+    this.setAttributeConfig("scrollable", {
+        value: false,
+        validator: function(oParam) {
+            //TODO: validate agnst resizeable
+            return (YAHOO.lang.isBoolean(oParam) &&
+                    // Not compatible with caption
+                    !YAHOO.lang.isString(this.get("caption")));
+        },
+        method: function(oParam) {
+            if(oParam) {
+                //TODO: conf height
+                YAHOO.util.Dom.addClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);
+                YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);
+            }
+            else {
+                YAHOO.util.Dom.removeClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);
+                YAHOO.util.Dom.removeClass(this._elTbody,YAHOO.widget.DataTable.CLASS_SCROLLBODY);
+
+            }
+        }
+    });
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public constants
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Class name assigned to TABLE element.
+ *
+ * @property DataTable.CLASS_TABLE
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-table"
+ */
+YAHOO.widget.DataTable.CLASS_TABLE = "yui-dt-table";
+
+/**
+ * Class name assigned to header container elements within each TH element.
+ *
+ * @property DataTable.CLASS_HEADER
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-header"
+ */
+YAHOO.widget.DataTable.CLASS_HEADER = "yui-dt-header";
+
+/**
+ * Class name assigned to the primary TBODY element.
+ *
+ * @property DataTable.CLASS_BODY
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-body"
+ */
+YAHOO.widget.DataTable.CLASS_BODY = "yui-dt-body";
+
+/**
+ * Class name assigned to the scrolling TBODY element of a fixed scrolling DataTable.
+ *
+ * @property DataTable.CLASS_SCROLLBODY
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-scrollbody"
+ */
+YAHOO.widget.DataTable.CLASS_SCROLLBODY = "yui-dt-scrollbody";
+
+/**
+ * Class name assigned to display label elements.
+ *
+ * @property DataTable.CLASS_LABEL
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-label"
+ */
+YAHOO.widget.DataTable.CLASS_LABEL = "yui-dt-label";
+
+/**
+ * Class name assigned to resizer handle elements.
+ *
+ * @property DataTable.CLASS_RESIZER
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-resizer"
+ */
+YAHOO.widget.DataTable.CLASS_RESIZER = "yui-dt-resizer";
+
+/**
+ * Class name assigned to Editor container elements.
+ *
+ * @property DataTable.CLASS_EDITOR
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-editor"
+ */
+YAHOO.widget.DataTable.CLASS_EDITOR = "yui-dt-editor";
+
+/**
+ * Class name assigned to paginator container elements.
+ *
+ * @property DataTable.CLASS_PAGINATOR
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-paginator"
+ */
+YAHOO.widget.DataTable.CLASS_PAGINATOR = "yui-dt-paginator";
+
+/**
+ * Class name assigned to page number indicators.
+ *
+ * @property DataTable.CLASS_PAGE
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-page"
+ */
+YAHOO.widget.DataTable.CLASS_PAGE = "yui-dt-page";
+
+/**
+ * Class name assigned to default indicators.
+ *
+ * @property DataTable.CLASS_DEFAULT
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-default"
+ */
+YAHOO.widget.DataTable.CLASS_DEFAULT = "yui-dt-default";
+
+/**
+ * Class name assigned to previous indicators.
+ *
+ * @property DataTable.CLASS_PREVIOUS
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-previous"
+ */
+YAHOO.widget.DataTable.CLASS_PREVIOUS = "yui-dt-previous";
+
+/**
+ * Class name assigned next indicators.
+ *
+ * @property DataTable.CLASS_NEXT
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-next"
+ */
+YAHOO.widget.DataTable.CLASS_NEXT = "yui-dt-next";
+
+/**
+ * Class name assigned to first elements.
+ *
+ * @property DataTable.CLASS_FIRST
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-first"
+ */
+YAHOO.widget.DataTable.CLASS_FIRST = "yui-dt-first";
+
+/**
+ * Class name assigned to last elements.
+ *
+ * @property DataTable.CLASS_LAST
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-last"
+ */
+YAHOO.widget.DataTable.CLASS_LAST = "yui-dt-last";
+
+/**
+ * Class name assigned to even elements.
+ *
+ * @property DataTable.CLASS_EVEN
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-even"
+ */
+YAHOO.widget.DataTable.CLASS_EVEN = "yui-dt-even";
+
+/**
+ * Class name assigned to odd elements.
+ *
+ * @property DataTable.CLASS_ODD
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-odd"
+ */
+YAHOO.widget.DataTable.CLASS_ODD = "yui-dt-odd";
+
+/**
+ * Class name assigned to selected elements.
+ *
+ * @property DataTable.CLASS_SELECTED
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-selected"
+ */
+YAHOO.widget.DataTable.CLASS_SELECTED = "yui-dt-selected";
+
+/**
+ * Class name assigned to highlighted elements.
+ *
+ * @property DataTable.CLASS_HIGHLIGHTED
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-highlighted"
+ */
+YAHOO.widget.DataTable.CLASS_HIGHLIGHTED = "yui-dt-highlighted";
+
+/**
+ * Class name assigned to disabled elements.
+ *
+ * @property DataTable.CLASS_DISABLED
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-disabled"
+ */
+YAHOO.widget.DataTable.CLASS_DISABLED = "yui-dt-disabled";
+
+/**
+ * Class name assigned to empty indicators.
+ *
+ * @property DataTable.CLASS_EMPTY
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-empty"
+ */
+YAHOO.widget.DataTable.CLASS_EMPTY = "yui-dt-empty";
+
+/**
+ * Class name assigned to loading indicatorx.
+ *
+ * @property DataTable.CLASS_LOADING
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-loading"
+ */
+YAHOO.widget.DataTable.CLASS_LOADING = "yui-dt-loading";
+
+/**
+ * Class name assigned to error indicators.
+ *
+ * @property DataTable.CLASS_ERROR
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-error"
+ */
+YAHOO.widget.DataTable.CLASS_ERROR = "yui-dt-error";
+
+/**
+ * Class name assigned to editable elements.
+ *
+ * @property DataTable.CLASS_EDITABLE
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-editable"
+ */
+YAHOO.widget.DataTable.CLASS_EDITABLE = "yui-dt-editable";
+
+/**
+ * Class name assigned to scrollable elements.
+ *
+ * @property DataTable.CLASS_SCROLLABLE
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-scrollable"
+ */
+YAHOO.widget.DataTable.CLASS_SCROLLABLE = "yui-dt-scrollable";
+
+/**
+ * Class name assigned to sortable elements.
+ *
+ * @property DataTable.CLASS_SORTABLE
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-sortable"
+ */
+YAHOO.widget.DataTable.CLASS_SORTABLE = "yui-dt-sortable";
+
+/**
+ * Class name assigned to ascending elements.
+ *
+ * @property DataTable.CLASS_ASC
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-asc"
+ */
+YAHOO.widget.DataTable.CLASS_ASC = "yui-dt-asc";
+
+/**
+ * Class name assigned to descending elements.
+ *
+ * @property DataTable.CLASS_DESC
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-desc"
+ */
+YAHOO.widget.DataTable.CLASS_DESC = "yui-dt-desc";
+
+/**
+ * Class name assigned to BUTTON container elements.
+ *
+ * @property DataTable.CLASS_BUTTON
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-button"
+ */
+YAHOO.widget.DataTable.CLASS_BUTTON = "yui-dt-button";
+
+/**
+ * Class name assigned to SELECT container elements.
+ *
+ * @property DataTable.CLASS_DROPDOWN
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-dropdown"
+ */
+YAHOO.widget.DataTable.CLASS_DROPDOWN = "yui-dt-dropdown";
+
+/**
+ * Class name assigned to INPUT TYPE=CHECKBOX container elements.
+ *
+ * @property DataTable.CLASS_CHECKBOX
+ * @type String
+ * @static
+ * @final
+ * @default "yui-dt-checkbox"
+ */
+YAHOO.widget.DataTable.CLASS_CHECKBOX = "yui-dt-checkbox";
+
+/**
+ * Message to display if DataTable has no data.
+ *
+ * @property DataTable.MSG_EMPTY
+ * @type String
+ * @static
+ * @final
+ * @default "No records found."
+ */
+YAHOO.widget.DataTable.MSG_EMPTY = "No records found.";
+
+/**
+ * Message to display while DataTable is loading data.
+ *
+ * @property DataTable.MSG_LOADING
+ * @type String
+ * @static
+ * @final
+ * @default "Loading data..."
+ */
+YAHOO.widget.DataTable.MSG_LOADING = "Loading data...";
+
+/**
+ * Message to display while DataTable has data error.
+ *
+ * @property DataTable.MSG_ERROR
+ * @type String
+ * @static
+ * @final
+ * @default "Data error."
+ */
+YAHOO.widget.DataTable.MSG_ERROR = "Data error.";
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class variable for indexing multiple DataTable instances.
+ *
+ * @property DataTable._nCount
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.widget.DataTable._nCount = 0;
+
+/**
+ * Index assigned to instance.
+ *
+ * @property _nIndex
+ * @type Number
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._nIndex = null;
+
+/**
+ * Counter for IDs assigned to TR elements.
+ *
+ * @property _nTrCount
+ * @type Number
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._nTrCount = 0;
+
+/**
+ * Unique name assigned to instance.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sName = null;
+
+/**
+ * DOM reference to the container element for the DataTable instance into which
+ * the TABLE element gets created.
+ *
+ * @property _elContainer
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elContainer = null;
+
+/**
+ * DOM reference to the CAPTION element for the DataTable instance.
+ *
+ * @property _elCaption
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elCaption = null;
+
+/**
+ * DOM reference to the TABLE element for the DataTable instance.
+ *
+ * @property _elTable
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elTable = null;
+
+/**
+ * DOM reference to the THEAD element for the DataTable instance.
+ *
+ * @property _elThead
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elThead = null;
+
+/**
+ * DOM reference to the primary TBODY element for the DataTable instance.
+ *
+ * @property _elTbody
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elTbody = null;
+
+/**
+ * DOM reference to the secondary TBODY element used to display DataTable messages.
+ *
+ * @property _elMsgTbody
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elMsgTbody = null;
+
+/**
+ * DOM reference to the secondary TBODY element's single TR element used to display DataTable messages.
+ *
+ * @property _elMsgTbodyRow
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elMsgTbodyRow = null;
+
+/**
+ * DOM reference to the secondary TBODY element's single TD element used to display DataTable messages.
+ *
+ * @property _elMsgTbodyCell
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._elMsgTbodyCell = null;
+
+/**
+ * DataSource instance for the DataTable instance.
+ *
+ * @property _oDataSource
+ * @type YAHOO.util.DataSource
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._oDataSource = null;
+
+/**
+ * ColumnSet instance for the DataTable instance.
+ *
+ * @property _oColumnSet
+ * @type YAHOO.widget.ColumnSet
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._oColumnSet = null;
+
+/**
+ * RecordSet instance for the DataTable instance.
+ *
+ * @property _oRecordSet
+ * @type YAHOO.widget.RecordSet
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._oRecordSet = null;
+
+/**
+ * ID string of first label link element of the current DataTable page, if any.
+ * Used for focusing sortable Columns with TAB.
+ *
+ * @property _sFirstLabelLinkId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sFirstLabelLinkId = null;
+
+/**
+ * ID string of first TR element of the current DataTable page.
+ *
+ * @property _sFirstTrId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sFirstTrId = null;
+
+/**
+ * ID string of the last TR element of the current DataTable page.
+ *
+ * @property _sLastTrId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sLastTrId = null;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Sets focus on the given element.
+ *
+ * @method _focusEl
+ * @param el {HTMLElement} Element.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._focusEl = function(el) {
+    el = el || this._elTable;
+    // http://developer.mozilla.org/en/docs/index.php?title=Key-navigable_custom_DHTML_widgets
+    // The timeout is necessary in both IE and Firefox 1.5, to prevent scripts from doing
+    // strange unexpected things as the user clicks on buttons and other controls.
+    setTimeout(function() { el.focus(); },0);
+};
+
+
+
+
+
+// INIT FUNCTIONS
+
+/**
+ * Initializes container element.
+ *
+ * @method _initContainerEl
+ * @param elContainer {HTMLElement | String} HTML DIV element by reference or ID.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initContainerEl = function(elContainer) {
+    this._elContainer = null;
+    elContainer = YAHOO.util.Dom.get(elContainer);
+    if(elContainer && elContainer.tagName && (elContainer.tagName.toLowerCase() == "div")) {
+        this._elContainer = elContainer;
+    }
+};
+
+/**
+ * Initializes object literal of config values.
+ *
+ * @method _initConfigs
+ * @param oConfig {Object} Object literal of config values.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initConfigs = function(oConfigs) {
+    if(oConfigs) {
+        if(oConfigs.constructor != Object) {
+            oConfigs = null;
+        }
+        // Backward compatibility
+        else if(YAHOO.lang.isBoolean(oConfigs.paginator)) {
+        }
+        this._oConfigs = oConfigs;
+    }
+};
+
+/**
+ * Initializes ColumnSet.
+ *
+ * @method _initColumnSet
+ * @param aColumnDefs {Object[]} Array of object literal Column definitions.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initColumnSet = function(aColumnDefs) {
+    this._oColumnSet = null;
+    if(YAHOO.lang.isArray(aColumnDefs)) {
+        this._oColumnSet =  new YAHOO.widget.ColumnSet(aColumnDefs);
+    }
+    // Backward compatibility
+    else if(aColumnDefs instanceof YAHOO.widget.ColumnSet) {
+        this._oColumnSet =  aColumnDefs;
+    }
+};
+
+/**
+ * Initializes DataSource.
+ *
+ * @method _initDataSource
+ * @param oDataSource {YAHOO.util.DataSource} DataSource instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initDataSource = function(oDataSource) {
+    this._oDataSource = null;
+    if(oDataSource && (oDataSource instanceof YAHOO.util.DataSource)) {
+        this._oDataSource = oDataSource;
+    }
+    // Backward compatibility
+    else {
+        var tmpTable = null;
+        var tmpContainer = this._elContainer;
+        // Peek in container child nodes to see if TABLE already exists
+        if(tmpContainer.hasChildNodes()) {
+            var tmpChildren = tmpContainer.childNodes;
+            for(i=0; i<tmpChildren.length; i++) {
+                if(tmpChildren[i].tagName && tmpChildren[i].tagName.toLowerCase() == "table") {
+                    tmpTable = tmpChildren[i];
+                    break;
+                }
+            }
+            if(tmpTable) {
+                var tmpFieldsArray = [];
+                for(i=0; i<this._oColumnSet.keys.length; i++) {
+                    tmpFieldsArray.push({key:this._oColumnSet.keys[i].key});
+                }
+
+                this._oDataSource = new YAHOO.util.DataSource(tmpTable);
+                this._oDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
+                this._oDataSource.responseSchema = {fields: tmpFieldsArray};
+            }
+        }
+    }
+};
+
+/**
+ * Initializes RecordSet.
+ *
+ * @method _initRecordSet
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initRecordSet = function() {
+    if(this._oRecordSet) {
+        this._oRecordSet.reset();
+    }
+    else {
+        this._oRecordSet = new YAHOO.widget.RecordSet();
+    }
+};
+
+/**
+ * Creates HTML markup for TABLE, THEAD and TBODY elements.
+ *
+ * @method _initTableEl
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initTableEl = function() {
+    // Clear the container
+    YAHOO.util.Event.purgeElement(this._elContainer, true);
+    this._elContainer.innerHTML = "";
+
+    // Create TABLE
+    this._elTable = this._elContainer.appendChild(document.createElement("table"));
+    var elTable = this._elTable;
+    elTable.tabIndex = 0;
+    elTable.id = this.id + "-table";
+    YAHOO.util.Dom.addClass(elTable, YAHOO.widget.DataTable.CLASS_TABLE);
+
+    // Create THEAD
+    this._initTheadEl(elTable, this._oColumnSet);
+
+
+    // Create TBODY for messages
+    var elMsgTbody = document.createElement("tbody");
+    var elMsgRow = elMsgTbody.appendChild(document.createElement("tr"));
+    YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_FIRST);
+    YAHOO.util.Dom.addClass(elMsgRow,YAHOO.widget.DataTable.CLASS_LAST);
+    this._elMsgRow = elMsgRow;
+    var elMsgCell = elMsgRow.appendChild(document.createElement("td"));
+    elMsgCell.colSpan = this._oColumnSet.keys.length;
+    YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_FIRST);
+    YAHOO.util.Dom.addClass(elMsgCell,YAHOO.widget.DataTable.CLASS_LAST);
+    this._elMsgTd = elMsgCell;
+    this._elMsgTbody = elTable.appendChild(elMsgTbody);
+    this.showTableMessage(YAHOO.widget.DataTable.MSG_LOADING, YAHOO.widget.DataTable.CLASS_LOADING);
+
+    // Create TBODY for data
+    this._elTbody = elTable.appendChild(document.createElement("tbody"));
+    YAHOO.util.Dom.addClass(this._elTbody,YAHOO.widget.DataTable.CLASS_BODY);
+};
+
+/**
+ * Populates THEAD element with TH cells as defined by ColumnSet.
+ *
+ * @method _initTheadEl
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initTheadEl = function() {
+    var i,oColumn, colId;
+    var oColumnSet = this._oColumnSet;
+    this._sFirstLabelLinkId = null;
+    
+    // Create THEAD
+    var elThead = document.createElement("thead");
+
+    // Iterate through each row of Column headers...
+    var colTree = oColumnSet.tree;
+    for(i=0; i<colTree.length; i++) {
+        var elTheadRow = elThead.appendChild(document.createElement("tr"));
+        elTheadRow.id = this.id+"-hdrow"+i;
+
+        var elTheadCell;
+        // ...and create THEAD cells
+        for(var j=0; j<colTree[i].length; j++) {
+            oColumn = colTree[i][j];
+            colId = oColumn.getId();
+            elTheadCell = elTheadRow.appendChild(document.createElement("th"));
+            elTheadCell.id = this.id + "-col" + colId;
+            this._initThEl(elTheadCell,oColumn,i,j);
+        }
+
+        // Set FIRST/LAST on THEAD rows
+        if(i === 0) {
+            YAHOO.util.Dom.addClass(elTheadRow, YAHOO.widget.DataTable.CLASS_FIRST);
+        }
+        if(i === (colTree.length-1)) {
+            YAHOO.util.Dom.addClass(elTheadRow, YAHOO.widget.DataTable.CLASS_LAST);
+        }
+    }
+
+    this._elThead = this._elTable.appendChild(elThead);
+
+    // Set FIRST/LAST on THEAD cells using the values in ColumnSet headers array
+    var aFirstHeaders = oColumnSet.headers[0].split(" ");
+    var aLastHeaders = oColumnSet.headers[oColumnSet.headers.length-1].split(" ");
+    for(i=0; i<aFirstHeaders.length; i++) {
+        YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aFirstHeaders[i]), YAHOO.widget.DataTable.CLASS_FIRST);
+    }
+    for(i=0; i<aLastHeaders.length; i++) {
+        YAHOO.util.Dom.addClass(YAHOO.util.Dom.get(this.id+"-col"+aLastHeaders[i]), YAHOO.widget.DataTable.CLASS_LAST);
+    }
+    
+    // Add Resizer only after DOM has been updated
+    var foundDD = (YAHOO.util.DD) ? true : false;
+    var needDD = false;
+    for(i=0; i<this._oColumnSet.keys.length; i++) {
+        oColumn = this._oColumnSet.keys[i];
+        colId = oColumn.getId();
+        var elTheadCellId = YAHOO.util.Dom.get(this.id + "-col" + colId);
+        if(oColumn.resizeable) {
+            if(foundDD) {
+                //TODO: fix fixed width tables
+                // Skip the last column for fixed-width tables
+                if(!this.fixedWidth || (this.fixedWidth &&
+                        (oColumn.getKeyIndex() != this._oColumnSet.keys.length-1))) {
+                    // TODO: better way to get elTheadContainer
+                    var elThContainer = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_HEADER,"div",elTheadCellId)[0];
+                    var elThResizer = elThContainer.appendChild(document.createElement("span"));
+                    elThResizer.id = this.id + "-resizer" + colId;
+                    YAHOO.util.Dom.addClass(elThResizer,YAHOO.widget.DataTable.CLASS_RESIZER);
+                    oColumn.ddResizer = new YAHOO.util.ColumnResizer(
+                            this, oColumn, elTheadCellId, elThResizer.id, elThResizer.id);
+                    var cancelClick = function(e) {
+                        YAHOO.util.Event.stopPropagation(e);
+                    };
+                    YAHOO.util.Event.addListener(elThResizer,"click",cancelClick);
+                }
+                if(this.fixedWidth) {
+                    //TODO: fix fixedWidth
+                    //elThContainer.style.overflow = "hidden";
+                    //TODO: better way to get elTheadText
+                    var elThLabel = (YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",elTheadCellId))[0];
+                    elThLabel.style.overflow = "hidden";
+                }
+            }
+            else {
+                needDD = true;
+            }
+        }
+    }
+    if(needDD) {
+    }
+
+};
+
+/**
+ * Populates TH cell as defined by Column.
+ *
+ * @method _initThEl
+ * @param elTheadCell {HTMLElement} TH cell element reference.
+ * @param oColumn {YAHOO.widget.Column} Column object.
+ * @param row {number} Row index.
+ * @param col {number} Column index.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initThEl = function(elTheadCell,oColumn,row,col) {
+    // Clear out the cell of prior content
+    // TODO: purgeListeners and other validation-related things
+    var index = this._nIndex;
+    var colId = oColumn.getId();
+    elTheadCell.yuiColumnId = colId;
+    if(oColumn.abbr) {
+        elTheadCell.abbr = oColumn.abbr;
+    }
+    if(oColumn.width) {
+        elTheadCell.style.width = oColumn.width;
+    }
+
+    var aCustomClasses;
+    if(YAHOO.lang.isString(oColumn.className)) {
+        aCustomClasses = [oColumn.className];
+    }
+    else if(YAHOO.lang.isArray(oColumn.className)) {
+        aCustomClasses = oColumn.className;
+    }
+    if(aCustomClasses) {
+        for(var i=0; i<aCustomClasses.length; i++) {
+            YAHOO.util.Dom.addClass(elTheadCell,aCustomClasses[i]);
+        }
+    }
+    
+    YAHOO.util.Dom.addClass(elTheadCell, "yui-dt-col-"+oColumn.key);
+    
+    elTheadCell.innerHTML = "";
+    elTheadCell.rowSpan = oColumn.getRowspan();
+    elTheadCell.colSpan = oColumn.getColspan();
+
+    var elTheadContainer = elTheadCell.appendChild(document.createElement("div"));
+    elTheadContainer.id = this.id + "-container" + colId;
+    YAHOO.util.Dom.addClass(elTheadContainer,YAHOO.widget.DataTable.CLASS_HEADER);
+    var elTheadLabel = elTheadContainer.appendChild(document.createElement("span"));
+    elTheadLabel.id = this.id + "-label" + colId;
+    YAHOO.util.Dom.addClass(elTheadLabel,YAHOO.widget.DataTable.CLASS_LABEL);
+
+    var sLabel = YAHOO.lang.isValue(oColumn.label) ? oColumn.label : oColumn.key;
+    if(oColumn.sortable) {
+        YAHOO.util.Dom.addClass(elTheadCell,YAHOO.widget.DataTable.CLASS_SORTABLE);
+        //TODO: Make sortLink customizeable
+        //TODO: Make title configurable
+        //TODO: Separate label from an accessibility link that says
+        // "Click to sort ascending" and push it offscreen
+        var sLabelLinkId = this.id + "-labellink" + colId;
+        var sortLink = "?key=" + oColumn.key;
+        elTheadLabel.innerHTML = "<a id=\"" + sLabelLinkId + "\" href=\"" + sortLink + "\" title=\"Click to sort\" class=\"" + YAHOO.widget.DataTable.CLASS_SORTABLE + "\">" + sLabel + "</a>";
+        if(!this._sFirstLabelLinkId) {
+            this._sFirstLabelLinkId = sLabelLinkId;
+        }
+    }
+    else {
+        elTheadLabel.innerHTML = sLabel;
+    }
+};
+
+/**
+ * Creates HTML markup for Cell Editor.
+ *
+ * @method _initCellEditorEl
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initCellEditorEl = function() {
+    // Attach Cell Editor container element to body
+    var elCellEditor = document.createElement("div");
+    elCellEditor.id = this.id + "-celleditor";
+    elCellEditor.style.display = "none";
+    YAHOO.util.Dom.addClass(elCellEditor, YAHOO.widget.DataTable.CLASS_EDITOR);
+    elCellEditor = document.body.appendChild(elCellEditor);
+
+    // Internal tracker of Cell Editor values
+    var oCellEditor = {};
+    oCellEditor.container = elCellEditor;
+    oCellEditor.value = null;
+    oCellEditor.isActive = false;
+    this._oCellEditor = oCellEditor;
+
+    // Handle ESC key
+    this.subscribe("editorKeydownEvent", function(oArgs) {
+        var e = oArgs.event;
+        var elTarget = YAHOO.util.Event.getTarget(e);
+
+        // ESC hides Cell Editor
+        if((e.keyCode == 27)) {
+            this.cancelCellEditor();
+        }
+    });
+};
+
+/**
+ * Initializes Column sorting.
+ *
+ * @method _initColumnSort
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initColumnSort = function() {
+    this.subscribe("headerCellClickEvent", this.onEventSortColumn);
+};
+
+/**
+ * Initializes DOM event listeners.
+ *
+ * @method _initDomEvents
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._initDomEvents = function() {
+    var elTable = this._elTable;
+    var elThead = this._elThead;
+    var elTbody = this._elTbody;
+    var elContainer = this._elContainer;
+
+    YAHOO.util.Event.addListener(document, "click", this._onDocumentClick, this);
+    YAHOO.util.Event.addListener(document, "keydown", this._onDocumentKeydown, this);
+
+    YAHOO.util.Event.addListener(elTable, "focus", this._onTableFocus, this);
+    YAHOO.util.Event.addListener(elTable, "mouseover", this._onTableMouseover, this);
+    YAHOO.util.Event.addListener(elTable, "mouseout", this._onTableMouseout, this);
+    YAHOO.util.Event.addListener(elTable, "mousedown", this._onTableMousedown, this);
+    YAHOO.util.Event.addListener(elTable, "keydown", this._onTableKeydown, this);
+    YAHOO.util.Event.addListener(elTable, "keypress", this._onTableKeypress, this);
+
+    // Since we can't listen for click and dblclick on the same element...
+    YAHOO.util.Event.addListener(elTable, "dblclick", this._onTableDblclick, this);
+    YAHOO.util.Event.addListener(elThead, "click", this._onTheadClick, this);
+    YAHOO.util.Event.addListener(elTbody, "click", this._onTbodyClick, this);
+
+    YAHOO.util.Event.addListener(elContainer, "scroll", this._onScroll, this); // for IE
+    YAHOO.util.Event.addListener(elTbody, "scroll", this._onScroll, this); // for everyone else
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// DOM MUTATION FUNCTIONS
+
+
+
+
+/**
+ * Adds a TR element to the primary TBODY at the page row index if given, otherwise
+ * at the end of the page. Formats TD elements within the TR element using data
+ * from the given Record.
+ *
+ * @method _addTrEl
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param index {Number} (optional) The page row index at which to add the TR
+ * element.
+ * @return {String} ID of the added TR element, or null.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._addTrEl = function(oRecord, index) {
+    this.hideTableMessage();
+
+    // It's an append if no index provided, or index is negative or too big
+    var append = (!YAHOO.lang.isNumber(index) || (index < 0) ||
+            (index >= (this._elTbody.rows.length))) ? true : false;
+            
+    var oColumnSet = this._oColumnSet;
+    var oRecordSet = this._oRecordSet;
+    var isSortedBy = this.get("sortedBy");
+    var sortedColKeyIndex  = null;
+    var sortedDir, newClass;
+    if(isSortedBy) {
+        sortedColKeyIndex = (isSortedBy.column) ?
+                isSortedBy.column.getKeyIndex() :
+                this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();
+        sortedDir = isSortedBy.dir;
+        newClass = (sortedDir === "desc") ? YAHOO.widget.DataTable.CLASS_DESC :
+                YAHOO.widget.DataTable.CLASS_ASC;
+
+    }
+
+
+    var elRow = (append) ? this._elTbody.appendChild(document.createElement("tr")) :
+        this._elTbody.insertBefore(document.createElement("tr"),this._elTbody.rows[index]);
+
+    elRow.id = this.id+"-bdrow"+this._nTrCount;
+    this._nTrCount++;
+    elRow.yuiRecordId = oRecord.getId();
+
+    // Create TD cells
+    for(var j=0; j<oColumnSet.keys.length; j++) {
+        var oColumn = oColumnSet.keys[j];
+        var elCell = elRow.appendChild(document.createElement("td"));
+        elCell.id = elRow.id+"-cell"+j;
+        elCell.yuiColumnId = oColumn.getId();
+        elCell.headers = oColumnSet.headers[j];
+        // For SF2 cellIndex bug: http://www.webreference.com/programming/javascript/ppk2/3.html
+        elCell.yuiCellIndex = j;
+
+        // Update UI
+        this.formatCell(elCell, oRecord, oColumn);
+
+        // Set FIRST/LAST on TD
+        if (j === 0) {
+            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_FIRST);
+        }
+        else if (j === this._oColumnSet.keys.length-1) {
+            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_LAST);
+        }
+        
+        // Remove ASC/DESC
+        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_ASC);
+        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_DESC);
+        
+        // Set ASC/DESC on TD
+        if(j === sortedColKeyIndex) {
+            newClass = (sortedDir === "desc") ?
+                    YAHOO.widget.DataTable.CLASS_DESC :
+                    YAHOO.widget.DataTable.CLASS_ASC;
+            YAHOO.util.Dom.addClass(elCell, newClass);
+        }
+
+
+        /*p.abx {word-wrap:break-word;}
+ought to solve the problem for Safari (the long words will wrap in your
+tds, instead of overflowing to the next td.
+(this is supported by IE win as well, so hide it if needed).
+
+One thing, though: it doesn't work in combination with
+'white-space:nowrap'.*/
+
+// need a div wrapper for safari?
+        //TODO: fix fixedWidth
+        if(this.fixedWidth) {
+            elCell.style.overflow = "hidden";
+            //elCell.style.width = "20px";
+        }
+    }
+
+    return elRow.id;
+};
+
+/**
+ * Formats all TD elements of given TR element with data from the given Record.
+ *
+ * @method _updateTrEl
+ * @param elRow {HTMLElement} The TR element to update.
+ * @param oRecord {YAHOO.widget.Record} The associated Record instance.
+ * @return {String} ID of the updated TR element, or null.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._updateTrEl = function(elRow, oRecord) {
+    this.hideTableMessage();
+
+    var isSortedBy = this.get("sortedBy");
+    var sortedColKeyIndex  = null;
+    var sortedDir, newClass;
+    if(isSortedBy) {
+        sortedColKeyIndex = (isSortedBy.column) ?
+                isSortedBy.column.getKeyIndex() :
+                this._oColumnSet.getColumn(isSortedBy.key).getKeyIndex();
+        sortedDir = isSortedBy.dir;
+        newClass = (sortedDir === "desc") ? YAHOO.widget.DataTable.CLASS_DESC :
+                YAHOO.widget.DataTable.CLASS_ASC;
+    }
+
+    // Update TD elements with new data
+    for(var j=0; j<elRow.cells.length; j++) {
+        var oColumn = this._oColumnSet.keys[j];
+        var elCell = elRow.cells[j];
+        this.formatCell(elCell, oRecord, oColumn);
+
+        // Remove ASC/DESC
+        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_ASC);
+        YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_DESC);
+
+        // Set ASC/DESC on TD
+        if(j === sortedColKeyIndex) {
+            YAHOO.util.Dom.addClass(elCell, newClass);
+        }
+    }
+
+    // Update Record ID
+    elRow.yuiRecordId = oRecord.getId();
+    
+    return elRow.id;
+};
+
+
+/**
+ * Deletes TR element by DOM reference or by DataTable page row index.
+ *
+ * @method _deleteTrEl
+ * @param row {HTMLElement | Number} TR element reference or Datatable page row index.
+ * @return {Boolean} Returns true if successful, else returns false.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._deleteTrEl = function(row) {
+    var rowIndex;
+    
+    // Get page row index for the element
+    if(!YAHOO.lang.isNumber(row)) {
+        rowIndex = YAHOO.util.Dom.get(row).sectionRowIndex;
+    }
+    else {
+        rowIndex = row;
+    }
+    if(YAHOO.lang.isNumber(rowIndex) && (rowIndex > -2) && (rowIndex < this._elTbody.rows.length)) {
+        this._elTbody.deleteRow(rowIndex);
+        return true;
+    }
+    else {
+        return false;
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// CSS/STATE FUNCTIONS
+
+
+
+
+/**
+ * Assigns the class YAHOO.widget.DataTable.CLASS_FIRST to the first TR element
+ * of the DataTable page and updates internal tracker.
+ *
+ * @method _setFirstRow
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._setFirstRow = function() {
+    var rowEl = this.getFirstTrEl();
+    if(rowEl) {
+        // Remove FIRST
+        if(this._sFirstTrId) {
+            YAHOO.util.Dom.removeClass(this._sFirstTrId, YAHOO.widget.DataTable.CLASS_FIRST);
+        }
+        // Set FIRST
+        YAHOO.util.Dom.addClass(rowEl, YAHOO.widget.DataTable.CLASS_FIRST);
+        this._sFirstTrId = rowEl.id;
+    }
+    else {
+        this._sFirstTrId = null;
+    }
+};
+
+/**
+ * Assigns the class YAHOO.widget.DataTable.CLASS_LAST to the last TR element
+ * of the DataTable page and updates internal tracker.
+ *
+ * @method _setLastRow
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._setLastRow = function() {
+    var rowEl = this.getLastTrEl();
+    if(rowEl) {
+        // Unassign previous class
+        if(this._sLastTrId) {
+            YAHOO.util.Dom.removeClass(this._sLastTrId, YAHOO.widget.DataTable.CLASS_LAST);
+        }
+        // Assign class
+        YAHOO.util.Dom.addClass(rowEl, YAHOO.widget.DataTable.CLASS_LAST);
+        this._sLastTrId = rowEl.id;
+    }
+    else {
+        this._sLastTrId = null;
+    }
+};
+
+/**
+ * Assigns the classes YAHOO.widget.DataTable.CLASS_EVEN and
+ * YAHOO.widget.DataTable.CLASS_ODD to alternating TR elements of the DataTable
+ * page. For performance, a subset of rows may be specified.
+ *
+ * @method _setRowStripes
+ * @param row {HTMLElement | String | Number} (optional) HTML TR element reference
+ * or string ID, or page row index of where to start striping.
+ * @param range {Number} (optional) If given, how many rows to stripe, otherwise
+ * stripe all the rows until the end.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._setRowStripes = function(row, range) {
+    // Default values stripe all rows
+    var allRows = this._elTbody.rows;
+    var nStartIndex = 0;
+    var nEndIndex = allRows.length;
+    
+    // Stripe a subset
+    if((row !== null) && (row !== undefined)) {
+        // Validate given start row
+        var elStartRow = this.getTrEl(row);
+        if(elStartRow) {
+            nStartIndex = elStartRow.sectionRowIndex;
+            
+            // Validate given range
+            if(YAHOO.lang.isNumber(range) && (range > 1)) {
+                nEndIndex = nStartIndex + range;
+            }
+        }
+    }
+
+    for(var i=nStartIndex; i<nEndIndex; i++) {
+        if(i%2) {
+            YAHOO.util.Dom.removeClass(allRows[i], YAHOO.widget.DataTable.CLASS_EVEN);
+            YAHOO.util.Dom.addClass(allRows[i], YAHOO.widget.DataTable.CLASS_ODD);
+        }
+        else {
+            YAHOO.util.Dom.removeClass(allRows[i], YAHOO.widget.DataTable.CLASS_ODD);
+            YAHOO.util.Dom.addClass(allRows[i], YAHOO.widget.DataTable.CLASS_EVEN);
+        }
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private DOM Event Handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Handles scroll events on the CONTAINER (for IE) and TBODY elements (for everyone else).
+ *
+ * @method _onScroll
+ * @param e {HTMLEvent} The scroll event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onScroll = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+    
+    if(oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+        oSelf.cancelCellEditor();
+    }
+
+    oSelf.fireEvent("tableScrollEvent", {event:e, target:elTarget});
+};
+
+/**
+ * Handles click events on the DOCUMENT.
+ *
+ * @method _onDocumentClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onDocumentClick = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    if(!YAHOO.util.Dom.isAncestor(oSelf._elTable, elTarget)) {
+        oSelf.fireEvent("tableBlurEvent");
+
+        // Fires editorBlurEvent when click is not within the TABLE.
+        // For cases when click is within the TABLE, due to timing issues,
+        // the editorBlurEvent needs to get fired by the lower-level DOM click
+        // handlers below rather than by the TABLE click handler directly.
+        if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+            // Only if the click was not within the Cell Editor container
+            if(!YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container, elTarget) &&
+                    (oSelf._oCellEditor.container.id !== elTarget.id)) {
+                oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+            }
+        }
+    }
+};
+
+/**
+ * Handles keydown events on the DOCUMENT.
+ *
+ * @method _onDocumentKeydown
+ * @param e {HTMLEvent} The keydown event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onDocumentKeydown = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive &&
+            YAHOO.util.Dom.isAncestor(oSelf._oCellEditor.container, elTarget)) {
+        oSelf.fireEvent("editorKeydownEvent", {editor:oSelf._oCellEditor, event:e});
+    }
+};
+
+/**
+ * Handles focus events on the TABLE element.
+ *
+ * @method _onTableFocus
+ * @param e {HTMLEvent} The focus event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableMouseover = function(e, oSelf) {
+    oSelf.fireEvent("tableFocusEvent");
+};
+
+/**
+ * Handles mouseover events on the TABLE element.
+ *
+ * @method _onTableMouseover
+ * @param e {HTMLEvent} The mouseover event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableMouseover = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                 break;
+            case "a":
+                break;
+            case "td":
+                oSelf.fireEvent("cellMouseoverEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
+                    oSelf.fireEvent("headerLabelMouseoverEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                oSelf.fireEvent("headerCellMouseoverEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
+                    oSelf.fireEvent("headerRowMouseoverEvent",{target:elTarget,event:e});
+                }
+                else {
+                    oSelf.fireEvent("rowMouseoverEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+    }
+    oSelf.fireEvent("tableMouseoverEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/**
+ * Handles mouseout events on the TABLE element.
+ *
+ * @method _onTableMouseout
+ * @param e {HTMLEvent} The mouseout event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableMouseout = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                break;
+            case "a":
+                break;
+            case "td":
+                oSelf.fireEvent("cellMouseoutEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
+                    oSelf.fireEvent("headerLabelMouseoutEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                oSelf.fireEvent("headerCellMouseoutEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
+                    oSelf.fireEvent("headerRowMouseoutEvent",{target:elTarget,event:e});
+                }
+                else {
+                    oSelf.fireEvent("rowMouseoutEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+    }
+    oSelf.fireEvent("tableMouseoutEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/**
+ * Handles mousedown events on the TABLE element.
+ *
+ * @method _onTableMousedown
+ * @param e {HTMLEvent} The mousedown event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableMousedown = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                break;
+            case "a":
+                break;
+            case "td":
+                oSelf.fireEvent("cellMousedownEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
+                    oSelf.fireEvent("headerLabelMousedownEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                oSelf.fireEvent("headerCellMousedownEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
+                    oSelf.fireEvent("headerRowMousedownEvent",{target:elTarget,event:e});
+                }
+                else {
+                    oSelf.fireEvent("rowMousedownEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+    }
+    oSelf.fireEvent("tableMousedownEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/**
+ * Handles dblclick events on the TABLE element.
+ *
+ * @method _onTableDblclick
+ * @param e {HTMLEvent} The dblclick event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableDblclick = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                break;
+            case "td":
+                oSelf.fireEvent("cellDblclickEvent",{target:elTarget,event:e});
+                break;
+            case "span":
+                if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
+                    oSelf.fireEvent("headerLabelDblclickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "th":
+                oSelf.fireEvent("headerCellDblclickEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                if(elTarget.parentNode.tagName.toLowerCase() == "thead") {
+                    oSelf.fireEvent("headerRowDblclickEvent",{target:elTarget,event:e});
+                }
+                else {
+                    oSelf.fireEvent("rowDblclickEvent",{target:elTarget,event:e});
+                }
+                break;
+            default:
+                break;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+    }
+    oSelf.fireEvent("tableDblclickEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/**
+ * Handles keydown events on the TABLE element. Handles arrow selection.
+ *
+ * @method _onTableKeydown
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableKeydown = function(e, oSelf) {
+    var bSHIFT = e.shiftKey;
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    
+    // Ignore actions in the THEAD
+    if(YAHOO.util.Dom.isAncestor(oSelf._elThead, elTarget)) {
+        return;
+    }
+    
+    var nKey = YAHOO.util.Event.getCharCode(e);
+    
+    // TAB to first label link if any
+    if(nKey === 9 && !bSHIFT && (elTarget.id === oSelf._elTable.id)) {
+        if(oSelf._sFirstLabelLinkId) {
+            YAHOO.util.Event.stopEvent(e);
+            oSelf._focusEl(YAHOO.util.Dom.get(oSelf._sFirstLabelLinkId));
+        }
+        return;
+    }
+
+    // Something is currently selected
+    var lastSelectedId = oSelf._sLastSelectedId;
+    var lastSelectedEl = YAHOO.util.Dom.get(lastSelectedId);
+    if(lastSelectedEl && oSelf.isSelected(lastSelectedEl)) {
+        //TODO: handle tab, backspace, delete
+        
+        // Handle arrow selection
+        if((nKey > 36) && (nKey < 41)) {
+            YAHOO.util.Event.stopEvent(e);
+        }
+        else {
+            return;
+        }
+
+        var sMode = oSelf.get("selectionMode");
+        var allRows = oSelf._elTbody.rows;
+        var anchorId = oSelf._sSelectionAnchorId;
+        var anchorEl = YAHOO.util.Dom.get(anchorId);
+        var newSelectedEl, trIndex, tdIndex, startIndex, endIndex, i, anchorPos;
+
+        ////////////////////////////////////////////////////////////////////////
+        //
+        // SHIFT cell block selection
+        //
+        ////////////////////////////////////////////////////////////////////////
+        if(bSHIFT && (sMode == "cellblock")) {
+            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
+            tdIndex = lastSelectedEl.yuiCellIndex;
+
+            // Arrow DOWN
+            if(nKey == 40) {
+                // Is the anchor cell above, below, or same row
+                if(anchorEl.parentNode.sectionRowIndex > trIndex) {
+                    anchorPos = 1;
+                }
+                else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
+                    anchorPos = -1;
+                }
+                else {
+                    anchorPos = 0;
+                }
+
+                // Is the anchor cell left or right
+                startIndex = Math.min(anchorEl.yuiCellIndex, tdIndex);
+                endIndex = Math.max(anchorEl.yuiCellIndex, tdIndex);
+
+                // Selecting away from anchor cell
+                if(anchorPos <= 0) {
+                    // Select the horiz block on the next row
+                    if(trIndex < allRows.length-1) {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            newSelectedEl = allRows[trIndex+1].cells[i];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect the horiz block on this row towards the next row
+                    for(i=startIndex; i<=endIndex; i++) {
+                        oSelf.unselectCell(allRows[trIndex].cells[i]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
+                }
+            }
+            // Arrow up
+            else if(nKey == 38) {
+                // Is the anchor cell above, below, or same row
+                if(anchorEl.parentNode.sectionRowIndex > trIndex) {
+                    anchorPos = 1;
+                }
+                else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
+                    anchorPos = -1;
+                }
+                else {
+                    anchorPos = 0;
+                }
+
+                // Is the anchor cell left or right?
+                startIndex = Math.min(anchorEl.yuiCellIndex, tdIndex);
+                endIndex = Math.max(anchorEl.yuiCellIndex, tdIndex);
+
+                // Selecting away from anchor cell
+                if(anchorPos >= 0) {
+                    // Select the horiz block on the previous row
+                    if(trIndex > 0) {
+                        for(i=startIndex; i<=endIndex; i++) {
+                            newSelectedEl = allRows[trIndex-1].cells[i];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect the horiz block on this row towards the previous row
+                    for(i=startIndex; i<=endIndex; i++) {
+                        oSelf.unselectCell(allRows[trIndex].cells[i]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
+                }
+            }
+            // Arrow right
+            else if(nKey == 39) {
+                // Is the anchor cell left, right, or same column
+                if(anchorEl.yuiCellIndex > tdIndex) {
+                    anchorPos = 1;
+                }
+                else if(anchorEl.yuiCellIndex < tdIndex) {
+                    anchorPos = -1;
+                }
+                else {
+                    anchorPos = 0;
+                }
+
+                // Selecting away from anchor cell
+                if(anchorPos <= 0) {
+                    //Select the next vert block to the right
+                    if(tdIndex < allRows[trIndex].cells.length-1) {
+                        startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
+                        endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
+                        for(i=startIndex; i<=endIndex; i++) {
+                            newSelectedEl = allRows[i].cells[tdIndex+1];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect the vert block on this column towards the right
+                    startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
+                    endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
+                    for(i=startIndex; i<=endIndex; i++) {
+                        oSelf.unselectCell(allRows[i].cells[tdIndex]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
+                }
+            }
+            // Arrow left
+            else if(nKey == 37) {
+                // Is the anchor cell left, right, or same column
+                if(anchorEl.yuiCellIndex > tdIndex) {
+                    anchorPos = 1;
+                }
+                else if(anchorEl.yuiCellIndex < tdIndex) {
+                    anchorPos = -1;
+                }
+                else {
+                    anchorPos = 0;
+                }
+
+                // Selecting away from anchor cell
+                if(anchorPos >= 0) {
+                    //Select the previous vert block to the left
+                    if(tdIndex > 0) {
+                        startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
+                        endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
+                        for(i=startIndex; i<=endIndex; i++) {
+                            newSelectedEl = allRows[i].cells[tdIndex-1];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect the vert block on this column towards the left
+                    startIndex = Math.min(anchorEl.parentNode.sectionRowIndex, trIndex);
+                    endIndex = Math.max(anchorEl.parentNode.sectionRowIndex, trIndex);
+                    for(i=startIndex; i<=endIndex; i++) {
+                        oSelf.unselectCell(allRows[i].cells[tdIndex]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
+                }
+            }
+        }
+        ////////////////////////////////////////////////////////////////////////
+        //
+        // SHIFT cell range selection
+        //
+        ////////////////////////////////////////////////////////////////////////
+        else if(bSHIFT && (sMode == "cellrange")) {
+            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
+            tdIndex = lastSelectedEl.yuiCellIndex;
+
+            // Is the anchor cell above, below, or same row
+            if(anchorEl.parentNode.sectionRowIndex > trIndex) {
+                anchorPos = 1;
+            }
+            else if(anchorEl.parentNode.sectionRowIndex < trIndex) {
+                anchorPos = -1;
+            }
+            else {
+                anchorPos = 0;
+            }
+
+            // Arrow down
+            if(nKey == 40) {
+                // Selecting away from anchor cell
+                if(anchorPos <= 0) {
+                    // Select all cells to the end of this row
+                    for(i=tdIndex+1; i<allRows[trIndex].cells.length; i++){
+                        newSelectedEl = allRows[trIndex].cells[i];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+
+                    // Select some of the cells on the next row down
+                    if(trIndex < allRows.length-1) {
+                        for(i=0; i<=tdIndex; i++){
+                            newSelectedEl = allRows[trIndex+1].cells[i];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect all cells to the end of this row
+                    for(i=tdIndex; i<allRows[trIndex].cells.length; i++){
+                        oSelf.unselectCell(allRows[trIndex].cells[i]);
+                    }
+
+                    // Unselect some of the cells on the next row down
+                    for(i=0; i<tdIndex; i++){
+                        oSelf.unselectCell(allRows[trIndex+1].cells[i]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex+1].cells[tdIndex].id;
+                }
+            }
+            // Arrow up
+            else if(nKey == 38) {
+                // Selecting away from anchor cell
+                if(anchorPos >= 0) {
+                    // Select all the cells to the beginning of this row
+                    for(i=tdIndex-1; i>-1; i--){
+                        newSelectedEl = allRows[trIndex].cells[i];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+
+                    // Select some of the cells from the end of the previous row
+                    if(trIndex > 0) {
+                        for(i=allRows[trIndex].cells.length-1; i>=tdIndex; i--){
+                            newSelectedEl = allRows[trIndex-1].cells[i];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                    }
+                }
+                // Unselecting towards anchor cell
+                else {
+                    // Unselect all the cells to the beginning of this row
+                    for(i=tdIndex; i>-1; i--){
+                        oSelf.unselectCell(allRows[trIndex].cells[i]);
+                    }
+
+                    // Unselect some of the cells from the end of the previous row
+                    for(i=allRows[trIndex].cells.length-1; i>tdIndex; i--){
+                        oSelf.unselectCell(allRows[trIndex-1].cells[i]);
+                    }
+                    oSelf._sLastSelectedId = allRows[trIndex-1].cells[tdIndex].id;
+                }
+            }
+            // Arrow right
+            else if(nKey == 39) {
+                // Selecting away from anchor cell
+                if(anchorPos < 0) {
+                    // Select the next cell to the right
+                    if(tdIndex < allRows[trIndex].cells.length-1) {
+                        newSelectedEl = allRows[trIndex].cells[tdIndex+1];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+                    // Select the first cell of the next row
+                    else if(trIndex < allRows.length-1) {
+                        newSelectedEl = allRows[trIndex+1].cells[0];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+                }
+                // Unselecting towards anchor cell
+                else if(anchorPos > 0) {
+                    oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+
+                    // Unselect this cell towards the right
+                    if(tdIndex < allRows[trIndex].cells.length-1) {
+                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
+                    }
+                    // Unselect this cells towards the first cell of the next row
+                    else {
+                        oSelf._sLastSelectedId = allRows[trIndex+1].cells[0].id;
+                    }
+                }
+                // Anchor is on this row
+                else {
+                    // Selecting away from anchor
+                    if(anchorEl.yuiCellIndex <= tdIndex) {
+                        // Select the next cell to the right
+                        if(tdIndex < allRows[trIndex].cells.length-1) {
+                            newSelectedEl = allRows[trIndex].cells[tdIndex+1];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        // Select the first cell on the next row
+                        else if(trIndex < allRows.length-1){
+                            newSelectedEl = allRows[trIndex+1].cells[0];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                    }
+                    // Unselecting towards anchor
+                    else {
+                        // Unselect this cell towards the right
+                        oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex+1].id;
+                    }
+                }
+            }
+            // Arrow left
+            else if(nKey == 37) {
+                // Unselecting towards the anchor
+                if(anchorPos < 0) {
+                    oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+
+                    // Unselect this cell towards the left
+                    if(tdIndex > 0) {
+                        oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
+                    }
+                    // Unselect this cell towards the last cell of the previous row
+                    else {
+                        oSelf._sLastSelectedId = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;
+                    }
+                }
+                // Selecting towards the anchor
+                else if(anchorPos > 0) {
+                    // Select the next cell to the left
+                    if(tdIndex > 0) {
+                        newSelectedEl = allRows[trIndex].cells[tdIndex-1];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+                    // Select the last cell of the previous row
+                    else if(trIndex > 0){
+                        newSelectedEl = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];
+                        oSelf.selectCell(newSelectedEl);
+                    }
+                }
+                // Anchor is on this row
+                else {
+                    // Selecting away from anchor cell
+                    if(anchorEl.yuiCellIndex >= tdIndex) {
+                        // Select the next cell to the left
+                        if(tdIndex > 0) {
+                            newSelectedEl = allRows[trIndex].cells[tdIndex-1];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                        // Select the last cell of the previous row
+                        else if(trIndex > 0){
+                            newSelectedEl = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1];
+                            oSelf.selectCell(newSelectedEl);
+                        }
+                    }
+                    // Unselecting towards anchor cell
+                    else {
+                        oSelf.unselectCell(allRows[trIndex].cells[tdIndex]);
+
+                        // Unselect this cell towards the left
+                        if(tdIndex > 0) {
+                            oSelf._sLastSelectedId = allRows[trIndex].cells[tdIndex-1].id;
+                        }
+                        // Unselect this cell towards the last cell of the previous row
+                        else {
+                            oSelf._sLastSelectedId = allRows[trIndex-1].cells[allRows[trIndex-1].cells.length-1].id;
+                        }
+                    }
+                }
+            }
+        }
+        ////////////////////////////////////////////////////////////////////////
+        //
+        // Simple single cell selection
+        //
+        ////////////////////////////////////////////////////////////////////////
+        else if((sMode == "cellblock") || (sMode == "cellrange") || (sMode == "singlecell")) {
+            trIndex = lastSelectedEl.parentNode.sectionRowIndex;
+            tdIndex = lastSelectedEl.yuiCellIndex;
+
+            // Arrow down
+            if(nKey == 40) {
+                oSelf.unselectAllCells();
+
+                // Select the next cell down
+                if(trIndex < allRows.length-1) {
+                    newSelectedEl = allRows[trIndex+1].cells[tdIndex];
+                    oSelf.selectCell(newSelectedEl);
+                }
+                // Select only the bottom cell
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectCell(newSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+            // Arrow up
+            else if(nKey == 38) {
+                oSelf.unselectAllCells();
+
+                // Select the next cell up
+                if(trIndex > 0) {
+                    newSelectedEl = allRows[trIndex-1].cells[tdIndex];
+                    oSelf.selectCell(newSelectedEl);
+                }
+                // Select only the top cell
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectCell(newSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+            // Arrow right
+            else if(nKey == 39) {
+                oSelf.unselectAllCells();
+
+                // Select the next cell to the right
+                if(tdIndex < lastSelectedEl.parentNode.cells.length-1) {
+                    newSelectedEl = lastSelectedEl.parentNode.cells[tdIndex+1];
+                    oSelf.selectCell(newSelectedEl);
+                }
+                // Select only the right cell
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectCell(newSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+            // Arrow left
+            else if(nKey == 37) {
+                oSelf.unselectAllCells();
+
+                // Select the next cell to the left
+                if(tdIndex > 0) {
+                    newSelectedEl = lastSelectedEl.parentNode.cells[tdIndex-1];
+                    oSelf.selectCell(newSelectedEl);
+                }
+                // Select only the left cell
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectCell(newSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+        }
+        ////////////////////////////////////////////////////////////////////////
+        //
+        // SHIFT row selection
+        //
+        ////////////////////////////////////////////////////////////////////////
+        else if(bSHIFT && (sMode != "single")) {
+            trIndex = lastSelectedEl.sectionRowIndex;
+
+            if(anchorEl.sectionRowIndex > trIndex) {
+                anchorPos = 1;
+            }
+            else if(anchorEl.sectionRowIndex < trIndex) {
+                anchorPos = -1;
+            }
+            else {
+                anchorPos = 0;
+            }
+
+            // Arrow down
+            if(nKey == 40) {
+                // Selecting away from anchor row
+                if(anchorPos <= 0) {
+                    // Select the next row down
+                    if(trIndex < allRows.length-1) {
+                        oSelf.selectRow(trIndex+1);
+                    }
+                }
+                // Unselecting toward anchor row
+                else {
+                    // Unselect this row towards the anchor row down
+                    oSelf.unselectRow(lastSelectedEl);
+                    oSelf._sLastSelectedId = allRows[trIndex+1].id;
+                }
+
+            }
+            // Arrow up
+            else if(nKey == 38) {
+                // Selecting away from anchor row
+                if(anchorPos >= 0) {
+                    // Select the next row up
+                    if(trIndex > 0) {
+                        oSelf.selectRow(trIndex-1);
+                    }
+                }
+                // Unselect this row towards the anchor row up
+                else {
+                    oSelf.unselectRow(lastSelectedEl);
+                    oSelf._sLastSelectedId = allRows[trIndex-1].id;
+                }
+            }
+            // Arrow right
+            else if(nKey == 39) {
+                // Do nothing
+            }
+            // Arrow left
+            else if(nKey == 37) {
+                // Do nothing
+            }
+        }
+        ////////////////////////////////////////////////////////////////////////
+        //
+        // Simple single row selection
+        //
+        ////////////////////////////////////////////////////////////////////////
+        else {
+            trIndex = lastSelectedEl.sectionRowIndex;
+
+            // Arrow down
+            if(nKey == 40) {
+                oSelf.unselectAllRows();
+
+                // Select the next row
+                if(trIndex < allRows.length-1) {
+                    newSelectedEl = allRows[trIndex+1];
+                    oSelf.selectRow(newSelectedEl);
+                }
+                // Select only the last row
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectRow(lastSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+            // Arrow up
+            else if(nKey == 38) {
+                oSelf.unselectAllRows();
+
+                // Select the previous row
+                if(trIndex > 0) {
+                    newSelectedEl = allRows[trIndex-1];
+                    oSelf.selectRow(newSelectedEl);
+                }
+                // Select only the first row
+                else {
+                    newSelectedEl = lastSelectedEl;
+                    oSelf.selectRow(newSelectedEl);
+                }
+
+                oSelf._sSelectionAnchorId = newSelectedEl.id;
+            }
+            // Arrow right
+            else if(nKey == 39) {
+                // Do nothing
+            }
+            // Arrow left
+            else if(nKey == 37) {
+                // Do nothing
+            }
+        }
+    }
+};
+
+/**
+ * Handles keypress events on the TABLE. Mainly to support stopEvent on Mac.
+ *
+ * @method _onTableKeypress
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTableKeypress = function(e, oSelf) {
+    var isMac = (navigator.userAgent.toLowerCase().indexOf("mac") != -1);
+    if(isMac) {
+        var nKey = YAHOO.util.Event.getCharCode(e);
+        // arrow down
+        if(nKey == 40) {
+            YAHOO.util.Event.stopEvent(e);
+        }
+        // arrow up
+        else if(nKey == 38) {
+            YAHOO.util.Event.stopEvent(e);
+        }
+    }
+};
+
+/**
+ * Handles click events on the THEAD element.
+ *
+ * @method _onTheadClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTheadClick = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+    }
+
+    while(elTarget && (elTag != "thead")) {
+            switch(elTag) {
+                case "body":
+                    break;
+                case "span":
+                    if(YAHOO.util.Dom.hasClass(elTarget, YAHOO.widget.DataTable.CLASS_LABEL)) {
+                        oSelf.fireEvent("headerLabelClickEvent",{target:elTarget,event:e});
+                    }
+                    break;
+                case "th":
+                    oSelf.fireEvent("headerCellClickEvent",{target:elTarget,event:e});
+                    break;
+                case "tr":
+                    oSelf.fireEvent("headerRowClickEvent",{target:elTarget,event:e});
+                    break;
+                default:
+                    break;
+            }
+            elTarget = elTarget.parentNode;
+            if(elTarget) {
+                elTag = elTarget.tagName.toLowerCase();
+            }
+    }
+    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/**
+ * Handles click events on the primary TBODY element.
+ *
+ * @method _onTbodyClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onTbodyClick = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+    }
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                break;
+            case "input":
+                if(elTarget.type.toLowerCase() == "checkbox") {
+                    oSelf.fireEvent("checkboxClickEvent",{target:elTarget,event:e});
+                }
+                else if(elTarget.type.toLowerCase() == "radio") {
+                    oSelf.fireEvent("radioClickEvent",{target:elTarget,event:e});
+                }
+                break;
+            case "a":
+                oSelf.fireEvent("linkClickEvent",{target:elTarget,event:e});
+                break;
+            case "button":
+                oSelf.fireEvent("buttonClickEvent",{target:elTarget,event:e});
+                break;
+            case "td":
+                oSelf.fireEvent("cellClickEvent",{target:elTarget,event:e});
+                break;
+            case "tr":
+                oSelf.fireEvent("rowClickEvent",{target:elTarget,event:e});
+                break;
+            default:
+                break;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+    }
+    oSelf.fireEvent("tableClickEvent",{target:(elTarget || oSelf._elTable),event:e});
+};
+
+/*TODO: delete
+ * Handles keyup events on the TBODY. Executes deletion.
+ *
+ * @method _onTbodyKeyup
+ * @param e {HTMLEvent} The key event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+/*YAHOO.widget.DataTable.prototype._onTbodyKeyup = function(e, oSelf) {
+   var nKey = YAHOO.util.Event.getCharCode(e);
+    // delete
+    if(nKey == 46) {//TODO: if something is selected
+        //TODO: delete row
+    }
+};*/
+
+/**
+ * Handles click events on paginator links.
+ *
+ * @method _onPaginatorLinkClick
+ * @param e {HTMLEvent} The click event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onPaginatorLinkClick = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var elTag = elTarget.tagName.toLowerCase();
+
+    if(oSelf._oCellEditor && oSelf._oCellEditor.isActive) {
+        oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
+    }
+
+    while(elTarget && (elTag != "table")) {
+        switch(elTag) {
+            case "body":
+                return;
+            case "a":
+                YAHOO.util.Event.stopEvent(e);
+                //TODO: after the showPage call, figure out which link
+                //TODO: was clicked and reset focus to the new version of it
+                switch(elTarget.className) {
+                    case YAHOO.widget.DataTable.CLASS_PAGE:
+                        oSelf.showPage(parseInt(elTarget.innerHTML,10));
+                        return;
+                    case YAHOO.widget.DataTable.CLASS_FIRST:
+                        oSelf.showPage(1);
+                        return;
+                    case YAHOO.widget.DataTable.CLASS_LAST:
+                        oSelf.showPage(oSelf.get("paginator").totalPages);
+                        return;
+                    case YAHOO.widget.DataTable.CLASS_PREVIOUS:
+                        oSelf.showPage(oSelf.get("paginator").currentPage - 1);
+                        return;
+                    case YAHOO.widget.DataTable.CLASS_NEXT:
+                        oSelf.showPage(oSelf.get("paginator").currentPage + 1);
+                        return;
+                }
+                break;
+            default:
+                return;
+        }
+        elTarget = elTarget.parentNode;
+        if(elTarget) {
+            elTag = elTarget.tagName.toLowerCase();
+        }
+        else {
+            return;
+        }
+    }
+};
+
+/**
+ * Handles change events on paginator SELECT element.
+ *
+ * @method _onPaginatorDropdownChange
+ * @param e {HTMLEvent} The change event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onPaginatorDropdownChange = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    var newValue = elTarget[elTarget.selectedIndex].value;
+
+    var newRowsPerPage = YAHOO.lang.isValue(parseInt(newValue,10)) ? parseInt(newValue,10) : null;
+    if(newRowsPerPage !== null) {
+        var newStartRecordIndex = (oSelf.get("paginator").currentPage-1) * newRowsPerPage;
+        oSelf.updatePaginator({rowsPerPage:newRowsPerPage, startRecordIndex:newStartRecordIndex});
+        oSelf.refreshView();
+    }
+    else {
+    }
+};
+
+/**
+ * Handles change events on SELECT elements within DataTable.
+ *
+ * @method _onDropdownChange
+ * @param e {HTMLEvent} The change event.
+ * @param oSelf {YAHOO.widget.DataTable} DataTable instance.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onDropdownChange = function(e, oSelf) {
+    var elTarget = YAHOO.util.Event.getTarget(e);
+    //TODO: pass what args?
+    //var value = elTarget[elTarget.selectedIndex].value;
+    oSelf.fireEvent("dropdownChangeEvent", {event:e, target:elTarget});
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+// OBJECT ACCESSORS
+
+/**
+ * Public accessor to the unique name of the DataSource instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the DataSource instance.
+ */
+
+YAHOO.widget.DataTable.prototype.toString = function() {
+    return "DataTable " + this._sName;
+};
+
+/**
+ * Returns the DataTable instance's DataSource instance.
+ *
+ * @method getDataSource
+ * @return {YAHOO.util.DataSource} DataSource instance.
+ */
+YAHOO.widget.DataTable.prototype.getDataSource = function() {
+    return this._oDataSource;
+};
+
+/**
+ * Returns the DataTable instance's ColumnSet instance.
+ *
+ * @method getColumnSet
+ * @return {YAHOO.widget.ColumnSet} ColumnSet instance.
+ */
+YAHOO.widget.DataTable.prototype.getColumnSet = function() {
+    return this._oColumnSet;
+};
+
+/**
+ * Returns the DataTable instance's RecordSet instance.
+ *
+ * @method getRecordSet
+ * @return {YAHOO.widget.RecordSet} RecordSet instance.
+ */
+YAHOO.widget.DataTable.prototype.getRecordSet = function() {
+    return this._oRecordSet;
+};
+
+/**
+ * Returns the DataTable instance's Cell Editor as an object literal with the
+ * following properties:
+ * <dl>
+ * <dt>cell</dt>
+ * <dd>Cell element being edited</dd>
+ *
+ * <dt>column</dt>
+ * <dd>Associated Column instance</dd>
+ *
+ * <dt>container</dt>
+ * <dd>Reference to editor's container DIV element</dd>
+ *
+ * <dt>isActive</dt>
+ * <dd>True if cell is currently being edited</dd>
+ *
+ * <dt>record</dt>
+ * <dd>Associated Record instance</dd>
+ *
+ * <dt>validator</dt>
+ * <dd>Associated validator function</dd>
+ *
+ * <dt>value</dt>
+ * <dd>Current input value</dd>
+ * </dl>
+ *
+ *
+ *
+ *
+ *
+ *
+ * @method getCellEditor
+ * @return {Object} Cell Editor object literal values.
+ */
+YAHOO.widget.DataTable.prototype.getCellEditor = function() {
+    return this._oCellEditor;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// DOM ACCESSORS
+
+/**
+ * Returns DOM reference to the DataTable's TABLE element.
+ *
+ * @method getTableEl
+ * @return {HTMLElement} Reference to TABLE element.
+ */
+YAHOO.widget.DataTable.prototype.getTableEl = function() {
+    return this._elTable;
+};
+
+/**
+ * Returns DOM reference to the DataTable's THEAD element.
+ *
+ * @method getTheadEl
+ * @return {HTMLElement} Reference to THEAD element.
+ */
+YAHOO.widget.DataTable.prototype.getTheadEl = function() {
+    return this._elThead;
+};
+
+/**
+ * Returns DOM reference to the DataTable's primary TBODY element.
+ *
+ * @method getTbodyEl
+ * @return {HTMLElement} Reference to TBODY element.
+ */
+YAHOO.widget.DataTable.prototype.getTbodyEl = function() {
+    return this._elTbody;
+};
+// Backward compatibility
+YAHOO.widget.DataTable.prototype.getBody = function() {
+    return this.getTbodyEl();
+};
+
+/**
+ * Returns DOM reference to the DataTable's secondary TBODY element that is
+ * used to display messages.
+ *
+ * @method getMsgTbodyEl
+ * @return {HTMLElement} Reference to TBODY element.
+ */
+YAHOO.widget.DataTable.prototype.getMsgTbodyEl = function() {
+    return this._elMsgTbody;
+};
+
+/**
+ * Returns DOM reference to the TD element within the secondary TBODY that is
+ * used to display messages.
+ *
+ * @method getMsgTdEl
+ * @return {HTMLElement} Reference to TD element.
+ */
+YAHOO.widget.DataTable.prototype.getMsgTdEl = function() {
+    return this._elMsgTd;
+};
+
+/**
+ * Returns the corresponding TR reference for a given DOM element, ID string or
+ * directly page row index. If the given identifier is a child of a TR element,
+ * then DOM tree is traversed until a parent TR element is returned, otherwise
+ * null.
+ *
+ * @method getTrEl
+ * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Which row to
+ * get: by element reference, ID string, page row index, or Record.
+ * @return {HTMLElement} Reference to TR element, or null.
+ */
+YAHOO.widget.DataTable.prototype.getTrEl = function(row) {
+    var allRows = this._elTbody.rows;
+    
+    // By Record
+    if(row instanceof YAHOO.widget.Record) {
+        var nTrIndex = this.getTrIndex(row);
+        return allRows[nTrIndex];
+    }
+    // By page row index
+    else if(YAHOO.lang.isNumber(row) && (row > -1) && (row < allRows.length)) {
+        return allRows[row];
+    }
+    // By ID string or element reference
+    else {
+        var elRow;
+        var el = YAHOO.util.Dom.get(row);
+        
+        // Validate HTML element
+        if(el && (el.ownerDocument == document)) {
+            // Validate TR element
+            if(el.tagName.toLowerCase() != "tr") {
+                // Traverse up the DOM to find the corresponding TR element
+                elRow = YAHOO.util.Dom.getAncestorByTagName(el,"tr");
+            }
+            else {
+                elRow = el;
+            }
+
+            // Make sure the TR is in this TBODY
+            if(elRow && (elRow.parentNode == this._elTbody)) {
+                // Now we can return the TR element
+                return elRow;
+            }
+        }
+    }
+    
+    return null;
+};
+// Backward compatibility
+YAHOO.widget.DataTable.prototype.getRow = function(index) {
+    return this.getTrEl(index);
+};
+
+/**
+ * Returns DOM reference to the first TR element in the DataTable page, or null.
+ *
+ * @method getFirstTrEl
+ * @return {HTMLElement} Reference to TR element.
+ */
+YAHOO.widget.DataTable.prototype.getFirstTrEl = function() {
+    return this._elTbody.rows[0] || null;
+};
+
+/**
+ * Returns DOM reference to the last TR element in the DataTable page, or null.
+ *
+ * @method getLastTrEl
+ * @return {HTMLElement} Reference to last TR element.
+ */
+YAHOO.widget.DataTable.prototype.getLastTrEl = function() {
+    var allRows = this._elTbody.rows;
+        if(allRows.length > 0) {
+            return allRows[allRows.length-1] || null;
+        }
+};
+
+/**
+ * Returns DOM reference to the given TD element.
+ *
+ * @method getTdEl
+ * @param cell {HTMLElement | String} DOM element reference or string ID.
+ * @return {HTMLElement} Reference to TD element.
+ */
+YAHOO.widget.DataTable.prototype.getTdEl = function(cell) {
+    var elCell;
+    var el = YAHOO.util.Dom.get(cell);
+
+    // Validate HTML element
+    if(el && (el.ownerDocument == document)) {
+        // Validate TD element
+        if(el.tagName.toLowerCase() != "td") {
+            // Traverse up the DOM to find the corresponding TR element
+            elCell = YAHOO.util.Dom.getAncestorByTagName(el, "td");
+        }
+        else {
+            elCell = el;
+        }
+
+        // Make sure the TD is in this TBODY
+        if(elCell && (elCell.parentNode.parentNode == this._elTbody)) {
+            // Now we can return the TD element
+            return elCell;
+        }
+    }
+    
+    return null;
+};
+
+/**
+ * Returns DOM reference to the TH element at given DataTable page coordinates, or null.
+ *
+ * @method getThEl
+ * @param header {HTMLElement | String | YAHOO.widget.Column} DOM element
+ * reference or string ID, or Column instance.
+ * @return {HTMLElement} Reference to TH element.
+ */
+YAHOO.widget.DataTable.prototype.getThEl = function(header) {
+    var elHeader;
+        
+    // Validate Column instance
+    if(header instanceof YAHOO.widget.Column) {
+        var oColumn = header;
+        elHeader = YAHOO.util.Dom.get(this.id + "-col" + oColumn.getId());
+        if(elHeader) {
+            return elHeader;
+        }
+    }
+    // Validate HTML element
+    else {
+        var el = YAHOO.util.Dom.get(header);
+
+        if(el && (el.ownerDocument == document)) {
+            // Validate TH element
+            if(el.tagName.toLowerCase() != "th") {
+                // Traverse up the DOM to find the corresponding TR element
+                elHeader = YAHOO.util.Dom.getAncestorByTagName(el,"th");
+            }
+            else {
+                elHeader = el;
+            }
+
+            // Make sure the TH is in this THEAD
+            if(elHeader && (elHeader.parentNode.parentNode == this._elThead)) {
+                // Now we can return the TD element
+                return elHeader;
+            }
+        }
+    }
+
+    return null;
+};
+
+/**
+ * Returns the page row index of given row. Returns null if the row is not in
+ * view on the current DataTable page.
+ *
+ * @method getTrIndex
+ * @param row {HTMLElement | String | YAHOO.widget.Record | Number} DOM or ID
+ * string reference to an element within the DataTable page, a Record instance,
+ * or a Record's RecordSet index.
+ * @return {Number} Page row index, or null if row does not exist or is not in view.
+ */
+YAHOO.widget.DataTable.prototype.getTrIndex = function(row) {
+    var nRecordIndex;
+    
+    // By Record
+    if(row instanceof YAHOO.widget.Record) {
+        nRecordIndex = this._oRecordSet.getRecordIndex(row);
+    }
+    // Calculate page row index from Record index
+    else if(YAHOO.lang.isNumber(row)) {
+        nRecordIndex = row;
+    }
+    if(YAHOO.lang.isNumber(nRecordIndex)) {
+        // DataTable is paginated
+        if(this.get("paginated")) {
+            // Get the first and last Record on this page
+            var startRecordIndex = this.get("paginator").startRecordIndex;
+            var endRecordIndex = startRecordIndex + this.get("paginator").rowsPerPage - 1;
+            // This Record is in view
+            if((nRecordIndex >= startRecordIndex) && (nRecordIndex <= endRecordIndex)) {
+                return nRecordIndex - startRecordIndex;
+            }
+            // This Record is not in view
+            else {
+                return null;
+            }
+        }
+        // Not paginated, just return the Record index
+        else {
+            return nRecordIndex;
+        }
+
+    }
+    // By element reference or ID string
+    else {
+        // Validate TR element
+        elRow = this.getTrEl(row);
+        if(elRow && (elRow.ownerDocument == document) &&
+                (elRow.parentNode == this._elTbody)) {
+            return elRow.sectionRowIndex;
+        }
+    }
+    
+    return null;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// TABLE FUNCTIONS
+
+/**
+ * Resets a RecordSet with the given data and populates the page view
+ * with the new data. Any previous data and selection states are cleared.
+ * However, sort states are not cleared, so if the given data is in a particular
+ * sort order, implementers should take care to reset the sortedBy property. If
+ * pagination is enabled, the currentPage is shown and Paginator UI updated,
+ * otherwise all rows are displayed as a single page. For performance, existing
+ * DOM elements are reused when possible.
+ *
+ * @method initializeTable
+ * @param oData {Object | Object[]} An object literal of data or an array of
+ * object literals containing data.
+ */
+YAHOO.widget.DataTable.prototype.initializeTable = function(oData) {
+    // Clear the RecordSet
+    this._oRecordSet.reset();
+
+    // Add data to RecordSet
+    var records = this._oRecordSet.addRecords(oData);
+
+    // Clear selections
+    this._unselectAllTrEls();
+    this._unselectAllTdEls();
+    this._aSelections = null;
+    this._sLastSelectedId = null;
+    this._sSelectionAnchorId = null;
+
+    // Refresh the view
+    this.refreshView();
+    this.fireEvent("initEvent");
+};
+
+/**
+ * Refreshes the view with existing Records from the RecordSet while
+ * maintaining sort, pagination, and selection states. For performance, reuses
+ * existing DOM elements when possible while deleting extraneous elements.
+ *
+ * @method refreshView
+ */
+YAHOO.widget.DataTable.prototype.refreshView = function() {
+    var i, j, k, l, aRecords;
+    var oPaginator = this.updatePaginator();
+
+    // Paginator is enabled, show a subset of Records and update Paginator UI
+    if(this.get("paginated")) {
+        var rowsPerPage = oPaginator.rowsPerPage;
+        var startRecordIndex = (oPaginator.currentPage - 1) * rowsPerPage;
+        aRecords = this._oRecordSet.getRecords(startRecordIndex, rowsPerPage);
+        this.formatPaginators();
+    }
+    // Show all records
+    else {
+        aRecords = this._oRecordSet.getRecords();
+    }
+
+    var elTbody = this._elTbody;
+    var elRows = elTbody.rows;
+
+    // Has rows
+    if(YAHOO.lang.isArray(aRecords) && (aRecords.length > 0)) {
+        this.hideTableMessage();
+
+        // Keep track of selected rows
+        var aSelectedRows = this.getSelectedRows();
+        // Keep track of selected cells
+        var aSelectedCells = this.getSelectedCells();
+        // Anything to reinstate?
+        var bReselect = (aSelectedRows.length>0) || (aSelectedCells.length > 0);
+
+        // Remove extra rows from the bottom so as to preserve ID order
+        while(elTbody.hasChildNodes() && (elRows.length > aRecords.length)) {
+            elTbody.deleteRow(-1);
+        }
+
+        // Unselect all TR and TD elements in the UI
+        if(bReselect) {
+            this._unselectAllTrEls();
+            this._unselectAllTdEls();
+        }
+
+        // From the top, update in-place existing rows
+        for(i=0; i<elRows.length; i++) {
+            this._updateTrEl(elRows[i], aRecords[i]);
+        }
+
+        // Add TR elements as necessary
+        for(i=elRows.length; i<aRecords.length; i++) {
+            this._addTrEl(aRecords[i]);
+        }
+
+        // Reinstate selected and sorted classes
+        var allRows = elTbody.rows;
+        if(bReselect) {
+            // Loop over each row
+            for(j=0; j<allRows.length; j++) {
+                var thisRow = allRows[j];
+                var sMode = this.get("selectionMode");
+                if ((sMode == "standard") || (sMode == "single")) {
+                    // Set SELECTED
+                    for(k=0; k<aSelectedRows.length; k++) {
+                        if(aSelectedRows[k] === thisRow.yuiRecordId) {
+                            YAHOO.util.Dom.addClass(thisRow, YAHOO.widget.DataTable.CLASS_SELECTED);
+                            if(j === allRows.length-1) {
+                                this._sLastSelectedId = thisRow.id;
+                                this._sSelectionAnchorId = thisRow.id;
+                            }
+                        }
+                    }
+                }
+                else {
+                    // Loop over each cell
+                    for(k=0; k<thisRow.cells.length; k++) {
+                        var thisCell = thisRow.cells[k];
+                        // Set SELECTED
+                        for(l=0; l<aSelectedCells.length; l++) {
+                            if((aSelectedCells[l].recordId === thisRow.yuiRecordId) &&
+                                    (aSelectedCells[l].columnId === thisCell.yuiColumnId)) {
+                                YAHOO.util.Dom.addClass(thisCell, YAHOO.widget.DataTable.CLASS_SELECTED);
+                                if(k === thisRow.cells.length-1) {
+                                    this._sLastSelectedId = thisCell.id;
+                                    this._sSelectionAnchorId = thisCell.id;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        
+        // Set FIRST/LAST, EVEN/ODD
+        this._setFirstRow();
+        this._setLastRow();
+        this._setRowStripes();
+
+        this.fireEvent("refreshEvent");
+    }
+    // Empty
+    else {
+        // Remove all rows
+        while(elTbody.hasChildNodes()) {
+            elTbody.deleteRow(-1);
+        }
+
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
+    }
+};
+
+/**
+ * Nulls out the entire DataTable instance and related objects, removes attached
+ * event listeners, and clears out DOM elements inside the container. After
+ * calling this method, the instance reference should be expliclitly nulled by
+ * implementer, as in myDataTable = null. Use with caution!
+ *
+ * @method destroy
+ */
+YAHOO.widget.DataTable.prototype.destroy = function() {
+    // Destroy Cell Editor
+    YAHOO.util.Event.purgeElement(this._oCellEditor.container, true);
+    document.body.removeChild(this._oCellEditor.container);
+    
+    var instanceName = this.toString();
+    var elContainer = this._elContainer;
+
+    // Unhook custom events
+    this._oRecordSet.unsubscribeAll();
+    this.unsubscribeAll();
+
+    // Unhook DOM events
+    YAHOO.util.Event.purgeElement(elContainer, true);
+
+    // Remove DOM elements
+    elContainer.innerHTML = "";
+
+    // Null out objects
+    for(var param in this) {
+        if(this.hasOwnProperty(param)) {
+            this[param] = null;
+        }
+    }
+
+};
+
+/**
+ * Displays message within secondary TBODY.
+ *
+ * @method showTableMessage
+ * @param sHTML {String} (optional) Value for innerHTML.
+ * @param sClassName {String} (optional) Classname.
+ */
+YAHOO.widget.DataTable.prototype.showTableMessage = function(sHTML, sClassName) {
+    var elCell = this._elMsgTd;
+    if(YAHOO.lang.isString(sHTML)) {
+        elCell.innerHTML = sHTML;
+    }
+    if(YAHOO.lang.isString(sClassName)) {
+        YAHOO.util.Dom.addClass(elCell, sClassName);
+    }
+    this._elMsgTbody.style.display = "";
+    this.fireEvent("tableMsgShowEvent", {html:sHTML, className:sClassName});
+};
+
+/**
+ * Hides secondary TBODY.
+ *
+ * @method hideTableMessage
+ */
+YAHOO.widget.DataTable.prototype.hideTableMessage = function() {
+    if(this._elMsgTbody.style.display != "none") {
+        this._elMsgTbody.style.display = "none";
+        this.fireEvent("tableMsgHideEvent");
+    }
+};
+
+/**
+ * Brings focus to DataTable instance.
+ *
+ * @method focus
+ */
+YAHOO.widget.DataTable.prototype.focus = function() {
+    this._focusEl(this._elTable);
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// RECORDSET FUNCTIONS
+
+/**
+ * Returns Record index for given TR element or page row index.
+ *
+ * @method getRecordIndex
+ * @param row {YAHOO.widget.Record | HTMLElement | Number} Record instance, TR
+ * element reference or page row index.
+ * @return {Number} Record's RecordSet index, or null.
+ */
+YAHOO.widget.DataTable.prototype.getRecordIndex = function(row) {
+    var nTrIndex;
+
+    if(!YAHOO.lang.isNumber(row)) {
+        // By Record
+        if(row instanceof YAHOO.widget.Record) {
+            return this._oRecordSet.getRecordIndex(row);
+        }
+        // By element reference
+        else {
+            // Find the TR element
+            var el = this.getTrEl(row);
+            if(el) {
+                nTrIndex = el.sectionRowIndex;
+            }
+        }
+    }
+    // By page row index
+    else {
+        nTrIndex = row;
+    }
+
+    if(YAHOO.lang.isNumber(nTrIndex)) {
+        if(this.get("paginated")) {
+            return this.get("paginator").startRecordIndex + nTrIndex;
+        }
+        else {
+            return nTrIndex;
+        }
+    }
+
+    return null;
+};
+
+/**
+ * For the given identifier, returns the associated Record instance.
+ *
+ * @method getRecord
+ * @param row {HTMLElement | String | Number} RecordSet position index, DOM
+ * reference or ID string to an element within the DataTable page.
+ * @return {YAHOO.widget.Record} Record instance.
+ */
+YAHOO.widget.DataTable.prototype.getRecord = function(row) {
+    var nRecordIndex = row;
+    
+    // By element reference or ID string
+    if(!YAHOO.lang.isNumber(nRecordIndex)) {
+        // Validate TR element
+        var elRow = this.getTrEl(row);
+        if(elRow) {
+            nRecordIndex = this.getRecordIndex(row);
+        }
+    }
+    // By Record index
+    if(YAHOO.lang.isNumber(nRecordIndex)) {
+        return this._oRecordSet.getRecord(nRecordIndex);
+    }
+    
+    return null;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// COLUMN FUNCTIONS
+
+/**
+ * For the given identifier, returns the associated Column instance.
+ *
+ * @method getColumn
+ * @param column {HTMLElement | String | Number} ColumnSet.keys position index, DOM
+ * reference or ID string to an element within the DataTable page.
+ * @return {YAHOO.widget.Column} Column instance.
+ */
+ YAHOO.widget.DataTable.prototype.getColumn = function(column) {
+    var nColumnIndex = column;
+
+    // By element reference or ID string
+    if(!YAHOO.lang.isNumber(nColumnIndex)) {
+        // Validate TD element
+        var elCell = this.getTdEl(column);
+        if(elCell) {
+            nColumnIndex = elCell.yuiColumnId;
+        }
+        // Validate TH element
+        else {
+            elCell = this.getThEl(column);
+            if(elCell) {
+                nColumnIndex = elCell.yuiColumnId;
+            }
+        }
+    }
+    
+    // By Column index
+    if(YAHOO.lang.isNumber(nColumnIndex)) {
+        return this._oColumnSet.getColumn(nColumnIndex);
+    }
+
+    return null;
+ };
+
+/**
+ * Sorts given Column.
+ *
+ * @method sortColumn
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ */
+YAHOO.widget.DataTable.prototype.sortColumn = function(oColumn) {
+    if(!oColumn) {
+        return;
+    }
+    if(!oColumn instanceof YAHOO.widget.Column) {
+        //TODO: accept the TH or TH.key
+        //TODO: Get the column based on TH.yuiColumnId
+        return;
+    }
+    if(oColumn.sortable) {
+        // What is the default sort direction?
+        var sortDir = (oColumn.sortOptions && oColumn.sortOptions.defaultOrder) ? oColumn.sortOptions.defaultOrder : "asc";
+
+        // Already sorted?
+        var oSortedBy = this.get("sortedBy");
+        if(oSortedBy && (oSortedBy.key === oColumn.key)) {
+            if(oSortedBy.dir) {
+                sortDir = (oSortedBy.dir == "asc") ? "desc" : "asc";
+            }
+            else {
+                sortDir = (sortDir == "asc") ? "desc" : "asc";
+            }
+        }
+
+        // Is there a custom sort handler function defined?
+        var sortFnc = (oColumn.sortOptions && YAHOO.lang.isFunction(oColumn.sortOptions.sortFunction)) ?
+                oColumn.sortOptions.sortFunction : function(a, b, desc) {
+                    var sorted = YAHOO.util.Sort.compare(a.getData(oColumn.key),b.getData(oColumn.key), desc);
+                    if(sorted === 0) {
+                        return YAHOO.util.Sort.compare(a.getId(),b.getId(), desc);
+                    }
+                    else {
+                        return sorted;
+                    }
+        };
+
+        // Do the actual sort
+        var desc = (sortDir == "desc") ? true : false;
+        this._oRecordSet.sortRecords(sortFnc, desc);
+
+        // Update sortedBy tracker
+        this.set("sortedBy", {key:oColumn.key, dir:sortDir, column:oColumn});
+        
+        // Reset to first page
+        //TODO: Keep selection in view
+        this.updatePaginator({currentPage:1});
+
+        // Update the UI
+        this.refreshView();
+
+        this.fireEvent("columnSortEvent",{column:oColumn,dir:sortDir});
+    }
+    else {
+        //TODO
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// ROW FUNCTIONS
+
+
+/**
+ * Adds one new Record of data into the RecordSet at the index if given,
+ * otherwise at the end. If the new Record is in page view, the
+ * corresponding DOM elements are also updated.
+ *
+ * @method addRow
+ * @param oData {Object} Object literal of data for the row.
+ * @param index {Number} (optional) RecordSet position index at which to add data.
+ */
+YAHOO.widget.DataTable.prototype.addRow = function(oData, index) {
+    if(oData && (oData.constructor == Object)) {
+        var oRecord = this._oRecordSet.addRecord(oData, index);
+        if(oRecord) {
+            var nTrIndex = this.getTrIndex(oRecord);
+
+            // Row is in view
+            if(YAHOO.lang.isNumber(nTrIndex)) {
+                // Paginated so just refresh the view to keep pagination state
+                if(this.get("paginated")) {
+                    this.refreshView();
+                }
+                // Add the TR element
+                else {
+                    var newTrId = this._addTrEl(oRecord, nTrIndex);
+                    if(newTrId) {
+                        // Is this an insert or an append?
+                        var append = (YAHOO.lang.isNumber(nTrIndex) &&
+                                (nTrIndex == this._elTbody.rows.length-1)) ? true : false;
+
+                        // Stripe the one new row
+                        if(append) {
+                            if((this._elTbody.rows.length-1)%2) {
+                                YAHOO.util.Dom.addClass(newTrId, YAHOO.widget.DataTable.CLASS_ODD);
+                            }
+                            else {
+                                YAHOO.util.Dom.addClass(newTrId, YAHOO.widget.DataTable.CLASS_EVEN);
+                            }
+                        }
+                        // Restripe all the rows after the new one
+                        else {
+                            this._setRowStripes(nTrIndex);
+                        }
+
+                        // If new row is at the bottom
+                        if(append) {
+                            this._setLastRow();
+                        }
+                        // If new row is at the top
+                        else if(YAHOO.lang.isNumber(index) && (nTrIndex === 0)) {
+                            this._setFirstRow();
+                        }
+                    }
+                }
+            }
+            // Record is not in view so just update pagination UI
+            else {
+                this.updatePaginator();
+            }
+
+            // TODO: what args to pass?
+            this.fireEvent("rowAddEvent", {record:oRecord});
+
+            // For log message
+            nTrIndex = (YAHOO.lang.isValue(nTrIndex))? nTrIndex : "n/a";
+
+            return;
+        }
+    }
+};
+
+/**
+ * Convenience method to add multiple rows.
+ *
+ * @method addRows
+ * @param aData {Object[]} Array of object literal data for the rows.
+ * @param index {Number} (optional) RecordSet position index at which to add data.
+ */
+YAHOO.widget.DataTable.prototype.addRows = function(aData, index) {
+    if(YAHOO.lang.isArray(aData)) {
+        var i;
+        if(YAHOO.lang.isNumber(index)) {
+            for(i=aData.length-1; i>-1; i--) {
+                this.addRow(aData[i], index);
+            }
+        }
+        else {
+            for(i=0; i<aData.length; i++) {
+                this.addRow(aData[i]);
+            }
+        }
+    }
+    else {
+    }
+};
+
+/**
+ * For the given row, updates the associated Record with the given data. If the
+ * row is in view, the corresponding DOM elements are also updated.
+ *
+ * @method updateRow
+ * @param row {YAHOO.widget.Record | Number | HTMLElement | String}
+ * Which row to update: By Record instance, by Record's RecordSet
+ * position index, by HTMLElement reference to the TR element, or by ID string
+ * of the TR element.
+ * @param oData {Object} Object literal of data for the row.
+ */
+YAHOO.widget.DataTable.prototype.updateRow = function(row, oData) {
+    var oldRecord, updatedRecord, elRow;
+
+    // Get the Record directly
+    if((row instanceof YAHOO.widget.Record) || (YAHOO.lang.isNumber(row))) {
+            // Get the Record directly
+            oldRecord = this._oRecordSet.getRecord(row);
+            
+            // Is this row in view?
+            elRow = this.getTrEl(oldRecord);
+    }
+    // Get the Record by TR element
+    else {
+        elRow = this.getTrEl(row);
+        if(elRow) {
+            oldRecord = this._oRecordSet.getRecord(this.getRecordIndex(elRow));
+        }
+    }
+
+    // Update the Record
+    if(oldRecord) {
+        // Copy data from the Record for the event that gets fired later
+        var oRecordData = oldRecord.getData();
+        var oldData = {};
+        for(var param in oRecordData) {
+            oldData[param] = oRecordData[param];
+        }
+
+        updatedRecord = this._oRecordSet.updateRecord(oldRecord, oData);
+    }
+    else {
+        return;
+
+    }
+    
+    // Update the TR only if row is in view
+    if(elRow) {
+        this._updateTrEl(elRow, updatedRecord);
+    }
+
+    this.fireEvent("rowUpdateEvent", {record:updatedRecord, oldData:oldData});
+};
+
+/**
+ * Deletes the given row's Record from the RecordSet. If the row is in view, the
+ * corresponding DOM elements are also deleted.
+ *
+ * @method deleteRow
+ * @param row {HTMLElement | String | Number} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ */
+YAHOO.widget.DataTable.prototype.deleteRow = function(row) {
+    // Get the Record index...
+    var nRecordIndex = null;
+    // ...by Record index
+    if(YAHOO.lang.isNumber(row)) {
+        nRecordIndex = row;
+    }
+    // ...by element reference
+    else {
+        var elRow = YAHOO.util.Dom.get(row);
+        elRow = this.getTrEl(elRow);
+        if(elRow) {
+            nRecordIndex = this.getRecordIndex(elRow);
+        }
+    }
+    if(nRecordIndex !== null) {
+        var oRecord = this._oRecordSet.getRecord(nRecordIndex);
+        if(oRecord) {
+            var nRecordId = oRecord.getId();
+            
+            // Remove from selection tracker if there
+            var tracker = this._aSelections || [];
+            for(var j=0; j<tracker.length; j++) {
+                if((YAHOO.lang.isNumber(tracker[j]) && (tracker[j] === nRecordId)) ||
+                        ((tracker[j].constructor == Object) && (tracker[j].recordId === nRecordId))) {
+                    tracker.splice(j,1);
+                }
+            }
+
+            // Copy data from the Record for the event that gets fired later
+            var oRecordData = oRecord.getData();
+            var oData = {};
+            for(var param in oRecordData) {
+                oData[param] = oRecordData[param];
+            }
+
+            // Delete Record from RecordSet
+            this._oRecordSet.deleteRecord(nRecordIndex);
+
+            // If row is in view, delete the TR element
+            var nTrIndex = this.getTrIndex(nRecordIndex);
+            if(YAHOO.lang.isNumber(nTrIndex)) {
+                var isLast = (nTrIndex == this.getLastTrEl().sectionRowIndex) ?
+                        true : false;
+                this._deleteTrEl(nTrIndex);
+
+                // Empty body
+                if(this._elTbody.rows.length === 0) {
+                    this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
+                }
+                // Update UI
+                else {
+                    // Set FIRST/LAST
+                    if(nTrIndex === 0) {
+                        this._setFirstRow();
+                    }
+                    if(isLast) {
+                        this._setLastRow();
+                    }
+                    // Set EVEN/ODD
+                    if(nTrIndex != this._elTbody.rows.length) {
+                        this._setRowStripes(nTrIndex);
+                    }
+                }
+            }
+
+            this.fireEvent("rowDeleteEvent", {recordIndex:nRecordIndex,
+                    oldData:oData, trElIndex:nTrIndex});
+        }
+    }
+    else {
+    }
+};
+
+/**
+ * Convenience method to delete multiple rows.
+ *
+ * @method deleteRows
+ * @param row {HTMLElement | String | Number} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ * @param count {Number} (optional) How many rows to delete. A negative value
+ * will delete towards the beginning.
+ */
+YAHOO.widget.DataTable.prototype.deleteRows = function(row, count) {
+    // Get the Record index...
+    var nRecordIndex = null;
+    // ...by Record index
+    if(YAHOO.lang.isNumber(row)) {
+        nRecordIndex = row;
+    }
+    // ...by element reference
+    else {
+        var elRow = YAHOO.util.Dom.get(row);
+        elRow = this.getTrEl(elRow);
+        if(elRow) {
+            nRecordIndex = this.getRecordIndex(elRow);
+        }
+    }
+    if(nRecordIndex !== null) {
+        if(count && YAHOO.lang.isNumber(count)) {
+            // Start with highest index and work down
+            var startIndex = (count > 0) ? nRecordIndex + count -1 : nRecordIndex;
+            var endIndex = (count > 0) ? nRecordIndex : nRecordIndex + count + 1;
+            for(var i=startIndex; i>endIndex-1; i--) {
+                this.deleteRow(i);
+            }
+        }
+        else {
+            this.deleteRow(nRecordIndex);
+        }
+    }
+    else {
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// CELL FUNCTIONS
+
+/**
+ * Outputs markup into the given TD based on given Record.
+ *
+ * @method formatCell
+ * @param elCell {HTMLElement} TD Element.
+ * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
+ * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
+ * @return {HTML} Markup.
+ */
+YAHOO.widget.DataTable.prototype.formatCell = function(elCell, oRecord, oColumn) {
+    if(!(oRecord instanceof YAHOO.widget.Record)) {
+        oRecord = this.getRecord(elCell);
+    }
+    if(!(oColumn instanceof YAHOO.widget.Column)) {
+        oColumn = this._oColumnSet.getColumn(elCell.yuiColumnId);
+    }
+    
+    if(oRecord && oColumn) {
+        var oData = oRecord.getData(oColumn.key);
+
+        var fnFormatter;
+        if(YAHOO.lang.isString(oColumn.formatter)) {
+            switch(oColumn.formatter) {
+                case "button":
+                    fnFormatter = YAHOO.widget.DataTable.formatButton;
+                    break;
+                case "checkbox":
+                    fnFormatter = YAHOO.widget.DataTable.formatCheckbox;
+                    break;
+                case "currency":
+                    fnFormatter = YAHOO.widget.DataTable.formatCurrency;
+                    break;
+                case "date":
+                    fnFormatter = YAHOO.widget.DataTable.formatDate;
+                    break;
+                case "dropdown":
+                    fnFormatter = YAHOO.widget.DataTable.formatDropdown;
+                    break;
+                case "email":
+                    fnFormatter = YAHOO.widget.DataTable.formatEmail;
+                    break;
+                case "link":
+                    fnFormatter = YAHOO.widget.DataTable.formatLink;
+                    break;
+                case "number":
+                    fnFormatter = YAHOO.widget.DataTable.formatNumber;
+                    break;
+                case "radio":
+                    fnFormatter = YAHOO.widget.DataTable.formatRadio;
+                    break;
+                case "text":
+                    fnFormatter = YAHOO.widget.DataTable.formatText;
+                    break;
+                case "textarea":
+                    fnFormatter = YAHOO.widget.DataTable.formatTextarea;
+                    break;
+                case "textbox":
+                    fnFormatter = YAHOO.widget.DataTable.formatTextbox;
+                    break;
+                case "html":
+                    // This is the default
+                    break;
+                default:
+                    fnFormatter = null;
+            }
+        }
+        else if(YAHOO.lang.isFunction(oColumn.formatter)) {
+            fnFormatter = oColumn.formatter;
+        }
+
+        // Apply special formatter
+        if(fnFormatter) {
+            fnFormatter.call(this, elCell, oRecord, oColumn, oData);
+        }
+        else {
+            elCell.innerHTML = (YAHOO.lang.isValue(oData)) ? oData.toString() : "";
+        }
+
+        // Add custom classNames
+        var aCustomClasses = null;
+        if(YAHOO.lang.isString(oColumn.className)) {
+            aCustomClasses = [oColumn.className];
+        }
+        else if(YAHOO.lang.isArray(oColumn.className)) {
+            aCustomClasses = oColumn.className;
+        }
+        if(aCustomClasses) {
+            for(var i=0; i<aCustomClasses.length; i++) {
+                YAHOO.util.Dom.addClass(elCell, aCustomClasses[i]);
+            }
+        }
+        
+        YAHOO.util.Dom.addClass(elCell, "yui-dt-col-"+oColumn.key);
+
+        // Is editable?
+        if(oColumn.editor) {
+            YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_EDITABLE);
+        }
+        
+        this.fireEvent("cellFormatEvent", {record:oRecord, key:oColumn.key, el:elCell});
+    }
+    else {
+    }
+};
+
+
+/**
+ * Formats a BUTTON element.
+ *
+ * @method DataTable.formatButton
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object | Boolean} Data value for the cell. By default, the value
+ * is what gets written to the BUTTON.
+ * @static
+ */
+YAHOO.widget.DataTable.formatButton= function(el, oRecord, oColumn, oData) {
+    var sValue = YAHOO.lang.isValue(oData) ? oData : "Click";
+    //TODO: support YAHOO.widget.Button
+    //if(YAHOO.widget.Button) {
+    
+    //}
+    //else {
+        el.innerHTML = "<button type=\"button\" class=\""+
+                YAHOO.widget.DataTable.CLASS_BUTTON + "\">" + sValue + "</button>";
+    //}
+};
+
+/**
+ * Formats a CHECKBOX element.
+ *
+ * @method DataTable.formatCheckbox
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object | Boolean} Data value for the cell. Can be a simple
+ * Boolean to indicate whether checkbox is checked or not. Can be object literal
+ * {checked:bBoolean, label:sLabel}. Other forms of oData require a custom
+ * formatter.
+ * @static
+ */
+YAHOO.widget.DataTable.formatCheckbox = function(el, oRecord, oColumn, oData) {
+    var bChecked = oData;
+    bChecked = (bChecked) ? " checked" : "";
+    el.innerHTML = "<input type=\"checkbox\"" + bChecked +
+            " class=\"" + YAHOO.widget.DataTable.CLASS_CHECKBOX + "\">";
+};
+
+/**
+ * Formats currency. Default unit is USD.
+ *
+ * @method DataTable.formatCurrency
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Number} Data value for the cell.
+ * @static
+ */
+YAHOO.widget.DataTable.formatCurrency = function(el, oRecord, oColumn, oData) {
+    if(YAHOO.lang.isNumber(oData)) {
+        var nAmount = oData;
+        var markup;
+
+        // Round to the penny
+        nAmount = Math.round(nAmount*100)/100;
+
+        // Default currency is USD
+        markup = "$"+nAmount;
+
+        // Normalize digits
+        var dotIndex = markup.indexOf(".");
+        if(dotIndex < 0) {
+            markup += ".00";
+        }
+        else {
+            while(dotIndex > markup.length-3) {
+                markup += "0";
+            }
+        }
+        el.innerHTML = markup;
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats JavaScript Dates.
+ *
+ * @method DataTable.formatDate
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} Data value for the cell, or null.
+ * @static
+ */
+YAHOO.widget.DataTable.formatDate = function(el, oRecord, oColumn, oData) {
+    var oDate = oData;
+    if(oDate instanceof Date) {
+        el.innerHTML = (oDate.getMonth()+1) + "/" + oDate.getDate()  + "/" + oDate.getFullYear();
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats SELECT elements.
+ *
+ * @method DataTable.formatDropdown
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} Data value for the cell, or null.
+ * @static
+ */
+YAHOO.widget.DataTable.formatDropdown = function(el, oRecord, oColumn, oData) {
+    var selectedValue = (YAHOO.lang.isValue(oData)) ? oData : oRecord.getData(oColumn.key);
+    var options = (YAHOO.lang.isArray(oColumn.dropdownOptions)) ?
+            oColumn.dropdownOptions : null;
+
+    var selectEl;
+    var collection = el.getElementsByTagName("select");
+    
+    // Create the form element only once, so we can attach the onChange listener
+    if(collection.length === 0) {
+        // Create SELECT element
+        selectEl = document.createElement("select");
+        YAHOO.util.Dom.addClass(selectEl, YAHOO.widget.DataTable.CLASS_DROPDOWN);
+        selectEl = el.appendChild(selectEl);
+
+        // Add event listener
+        //TODO: static method doesn't have access to the datatable instance...
+        YAHOO.util.Event.addListener(selectEl,"change",oDataTable._onDropdownChange,oDataTable);
+    }
+
+    selectEl = collection[0];
+
+    // Update the form element
+    if(selectEl) {
+        // Clear out previous options
+        selectEl.innerHTML = "";
+        
+        // We have options to populate
+        if(options) {
+            // Create OPTION elements
+            for(var i=0; i<options.length; i++) {
+                var option = options[i];
+                var optionEl = document.createElement("option");
+                optionEl.value = (YAHOO.lang.isValue(option.value)) ?
+                        option.value : option;
+                optionEl.innerHTML = (YAHOO.lang.isValue(option.text)) ?
+                        option.text : option;
+                optionEl = selectEl.appendChild(optionEl);
+            }
+        }
+        // Selected value is our only option
+        else {
+            selectEl.innerHTML = "<option value=\"" + selectedValue + "\">" + selectedValue + "</option>";
+        }
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats emails.
+ *
+ * @method DataTable.formatEmail
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} Data value for the cell, or null.
+ * @static
+ */
+YAHOO.widget.DataTable.formatEmail = function(el, oRecord, oColumn, oData) {
+    if(YAHOO.lang.isString(oData)) {
+        el.innerHTML = "<a href=\"mailto:" + oData + "\">" + oData + "</a>";
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats links.
+ *
+ * @method DataTable.formatLink
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} Data value for the cell, or null.
+ * @static
+ */
+YAHOO.widget.DataTable.formatLink = function(el, oRecord, oColumn, oData) {
+    if(YAHOO.lang.isString(oData)) {
+        el.innerHTML = "<a href=\"" + oData + "\">" + oData + "</a>";
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats numbers.
+ *
+ * @method DataTable.formatNumber
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} Data value for the cell, or null.
+ * @static
+ */
+YAHOO.widget.DataTable.formatNumber = function(el, oRecord, oColumn, oData) {
+    if(YAHOO.lang.isNumber(oData)) {
+        el.innerHTML = oData;
+    }
+    else {
+        el.innerHTML = YAHOO.lang.isValue(oData) ? oData : "";
+    }
+};
+
+/**
+ * Formats INPUT TYPE=RADIO elements.
+ *
+ * @method DataTable.formatRadio
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} (Optional) Data value for the cell.
+ * @static
+ */
+YAHOO.widget.DataTable.formatRadio = function(el, oRecord, oColumn, oData) {
+    var bChecked = oData;
+    bChecked = (bChecked) ? " checked" : "";
+    el.innerHTML = "<input type=\"radio\"" + bChecked +
+            " name=\"" + oColumn.getId() + "-radio\"" +
+            " class=\"" + YAHOO.widget.DataTable.CLASS_CHECKBOX + "\">";
+};
+
+/**
+ * Formats text strings.
+ *
+ * @method DataTable.formatText
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} (Optional) Data value for the cell.
+ * @static
+ */
+YAHOO.widget.DataTable.formatText = function(el, oRecord, oColumn, oData) {
+    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
+            oRecord.getData(oColumn.key) : "";
+    //TODO: move to util function
+    el.innerHTML = value.toString().replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");
+};
+
+/**
+ * Formats TEXTAREA elements.
+ *
+ * @method DataTable.formatTextarea
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} (Optional) Data value for the cell.
+ * @static
+ */
+YAHOO.widget.DataTable.formatTextarea = function(el, oRecord, oColumn, oData) {
+    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
+            oRecord.getData(oColumn.key) : "";
+    var markup = "<textarea>" + value + "</textarea>";
+    el.innerHTML = markup;
+};
+
+/**
+ * Formats INPUT TYPE=TEXT elements.
+ *
+ * @method DataTable.formatTextbox
+ * @param el {HTMLElement} The element to format with markup.
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param oData {Object} (Optional) Data value for the cell.
+ * @static
+ */
+YAHOO.widget.DataTable.formatTextbox = function(el, oRecord, oColumn, oData) {
+    var value = (YAHOO.lang.isValue(oRecord.getData(oColumn.key))) ?
+            oRecord.getData(oColumn.key) : "";
+    var markup = "<input type=\"text\" value=\"" + value + "\">";
+    el.innerHTML = markup;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// PAGINATION
+
+/**
+ * Updates Paginator values in response to RecordSet changes and/or DOM events.
+ * Pass in all, a subset, or no values.
+ *
+ * @method updatePaginator
+ * @param oNewValues {Object} (Optional) Object literal of Paginator values, or
+ * a subset of Paginator values.
+ * @param {Object} Object literal of all Paginator values.
+ */
+
+YAHOO.widget.DataTable.prototype.updatePaginator = function(oNewValues) {
+    // Complete the set
+    var oValidPaginator = this.get("paginator");
+    for(var param in oNewValues) {
+        if(oValidPaginator.hasOwnProperty(param)) {
+            oValidPaginator[param] = oNewValues[param];
+        }
+    }
+    
+    oValidPaginator.totalRecords = this._oRecordSet.getLength();
+    oValidPaginator.rowsThisPage = Math.min(oValidPaginator.rowsPerPage, oValidPaginator.totalRecords);
+    oValidPaginator.totalPages = Math.ceil(oValidPaginator.totalRecords / oValidPaginator.rowsThisPage);
+    if(isNaN(oValidPaginator.totalPages)) {
+        oValidPaginator.totalPages = 0;
+    }
+
+    this.set("paginator", oValidPaginator);
+    return this.get("paginator");
+};
+
+/**
+ * Displays given page of a paginated DataTable.
+ *
+ * @method showPage
+ * @param nPage {Number} Which page.
+ */
+YAHOO.widget.DataTable.prototype.showPage = function(nPage) {
+    // Validate input
+    if(!YAHOO.lang.isNumber(nPage) || (nPage < 1) || (nPage > this.get("paginator").totalPages)) {
+        nPage = 1;
+    }
+    this.updatePaginator({currentPage:nPage});
+    this.refreshView();
+};
+
+/**
+ * Updates Paginator containers with markup. Override this method to customize pagination UI.
+ *
+ * @method formatPaginators
+ */
+ YAHOO.widget.DataTable.prototype.formatPaginators = function() {
+    var pag = this.get("paginator");
+
+    // For Opera workaround
+    var dropdownEnabled = false;
+
+    // Links are enabled
+    if(pag.pageLinks > -1) {
+        for(var i=0; i<pag.links.length; i++) {
+            this.formatPaginatorLinks(pag.links[i], pag.currentPage, pag.pageLinksStart, pag.pageLinks, pag.totalPages);
+        }
+    }
+
+    // Dropdown is enabled
+    for(i=0; i<pag.dropdowns.length; i++) {
+         if(pag.dropdownOptions) {
+            dropdownEnabled = true;
+            this.formatPaginatorDropdown(pag.dropdowns[i], pag.dropdownOptions);
+        }
+        else {
+            pag.dropdowns[i].style.display = "none";
+        }
+    }
+
+    // For Opera artifacting in dropdowns
+    if(dropdownEnabled && navigator.userAgent.toLowerCase().indexOf("opera") != -1) {
+        document.body.style += '';
+    }
+};
+
+/**
+ * Updates Paginator dropdown. If dropdown doesn't exist, the markup is created.
+ * Sets dropdown elements's "selected" value.
+ *
+ * @method formatPaginatorDropdown
+ * @param elDropdown {HTMLElement} The SELECT element.
+ * @param dropdownOptions {Object[]} OPTION values for display in the SELECT element.
+ */
+YAHOO.widget.DataTable.prototype.formatPaginatorDropdown = function(elDropdown, dropdownOptions) {
+    if(elDropdown && (elDropdown.ownerDocument == document)) {
+        // Clear OPTION elements
+        while (elDropdown.firstChild) {
+            elDropdown.removeChild(elDropdown.firstChild);
+        }
+
+        // Create OPTION elements
+        for(var j=0; j<dropdownOptions.length; j++) {
+            var dropdownOption = dropdownOptions[j];
+            var optionEl = document.createElement("option");
+            optionEl.value = (YAHOO.lang.isValue(dropdownOption.value)) ?
+                    dropdownOption.value : dropdownOption;
+            optionEl.innerHTML = (YAHOO.lang.isValue(dropdownOption.text)) ?
+                    dropdownOption.text : dropdownOption;
+            optionEl = elDropdown.appendChild(optionEl);
+        }
+
+        var options = elDropdown.options;
+        // Update dropdown's "selected" value
+        if(options.length) {
+            for(var i=options.length-1; i>-1; i--) {
+                if((this.get("paginator").rowsPerPage + "") === options[i].value) {
+                    options[i].selected = true;
+                }
+            }
+        }
+
+        // Show the dropdown
+        elDropdown.style.display = "";
+        return;
+    }
+};
+
+/**
+ * Updates Paginator links container with markup.
+ *
+ * @method formatPaginatorLinks
+ * @param elContainer {HTMLElement} The link container element.
+ * @param nCurrentPage {Number} Current page.
+ * @param nPageLinksStart {Number} First page link to display.
+ * @param nPageLinksLength {Number} How many page links to display.
+ * @param nTotalPages {Number} Total number of pages.
+ */
+YAHOO.widget.DataTable.prototype.formatPaginatorLinks = function(elContainer, nCurrentPage, nPageLinksStart, nPageLinksLength, nTotalPages) {
+    if(elContainer && (elContainer.ownerDocument == document) &&
+            YAHOO.lang.isNumber(nCurrentPage) && YAHOO.lang.isNumber(nPageLinksStart) &&
+            YAHOO.lang.isNumber(nTotalPages)) {
+        // Set up markup for first/last/previous/next
+        var bIsFirstPage = (nCurrentPage == 1) ? true : false;
+        var bIsLastPage = (nCurrentPage == nTotalPages) ? true : false;
+        var sFirstLinkMarkup = (bIsFirstPage) ?
+                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
+                " " + YAHOO.widget.DataTable.CLASS_FIRST + "\">&lt;&lt;</span> " :
+                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_FIRST + "\">&lt;&lt;</a> ";
+        var sPrevLinkMarkup = (bIsFirstPage) ?
+                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
+                " " + YAHOO.widget.DataTable.CLASS_PREVIOUS + "\">&lt;</span> " :
+                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_PREVIOUS + "\">&lt;</a> " ;
+        var sNextLinkMarkup = (bIsLastPage) ?
+                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
+                " " + YAHOO.widget.DataTable.CLASS_NEXT + "\">&gt;</span> " :
+                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_NEXT + "\">&gt;</a> " ;
+        var sLastLinkMarkup = (bIsLastPage) ?
+                " <span class=\"" + YAHOO.widget.DataTable.CLASS_DISABLED +
+                " " + YAHOO.widget.DataTable.CLASS_LAST +  "\">&gt;&gt;</span> " :
+                " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_LAST + "\">&gt;&gt;</a> ";
+
+        // Start with first and previous
+        var sMarkup = sFirstLinkMarkup + sPrevLinkMarkup;
+        
+        // Ok to show all links
+        var nMaxLinks = nTotalPages;
+        var nFirstLink = 1;
+        var nLastLink = nTotalPages;
+
+        if(nPageLinksLength > 0) {
+        // Calculate how many links to show
+            nMaxLinks = (nPageLinksStart+nPageLinksLength < nTotalPages) ?
+                    nPageLinksStart+nPageLinksLength-1 : nTotalPages;
+
+            // Try to keep the current page in the middle
+            nFirstLink = (nCurrentPage - Math.floor(nMaxLinks/2) > 0) ? nCurrentPage - Math.floor(nMaxLinks/2) : 1;
+            nLastLink = (nCurrentPage + Math.floor(nMaxLinks/2) <= nTotalPages) ? nCurrentPage + Math.floor(nMaxLinks/2) : nTotalPages;
+
+            // Keep the last link in range
+            if(nFirstLink === 1) {
+                nLastLink = nMaxLinks;
+            }
+            // Keep the first link in range
+            else if(nLastLink === nTotalPages) {
+                nFirstLink = nTotalPages - nMaxLinks + 1;
+            }
+
+            // An even number of links can get funky
+            if(nLastLink - nFirstLink === nMaxLinks) {
+                nLastLink--;
+            }
+      }
+        
+        // Generate markup for each page
+        for(var i=nFirstLink; i<=nLastLink; i++) {
+            if(i != nCurrentPage) {
+                sMarkup += " <a href=\"#\" class=\"" + YAHOO.widget.DataTable.CLASS_PAGE + "\">" + i + "</a> ";
+            }
+            else {
+                sMarkup += " <span class=\"" + YAHOO.widget.DataTable.CLASS_SELECTED + "\">" + i + "</span>";
+            }
+        }
+        sMarkup += sNextLinkMarkup + sLastLinkMarkup;
+        elContainer.innerHTML = sMarkup;
+        return;
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// SELECTION/HIGHLIGHTING
+
+/**
+ * ID string of last highlighted cell element
+ *
+ * @property _sLastHighlightedCellId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sLastHighlightedCellId = null;
+
+/**
+ * ID string of last highlighted row element
+ *
+ * @property _sLastHighlightedRowId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sLastHighlightedRowId = null;
+
+/**
+ * Array of selections: {recordId:nRecordId, cellIndex:nCellIndex}
+ *
+ * @property _aSelections
+ * @type Object[]
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._aSelections = null;
+
+/**
+ * ID string of last selected element
+ *
+ * @property _sLastSelectedId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sLastSelectedId = null;
+
+/**
+ * ID string of the selection anchor element.
+ *
+ * @property _sSelectionAnchorId
+ * @type String
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._sSelectionAnchorId = null;
+
+/**
+ * Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED
+ * from all TR elements on the page.
+ *
+ * @method _unselectAllTrEls
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._unselectAllTrEls = function() {
+    var selectedRows = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);
+    YAHOO.util.Dom.removeClass(selectedRows, YAHOO.widget.DataTable.CLASS_SELECTED);
+};
+
+/**
+ * Returns array of selected TR elements on the page.
+ *
+ * @method getSelectedTrEls
+ * @return {HTMLElement[]} Array of selected TR elements.
+ */
+YAHOO.widget.DataTable.prototype.getSelectedTrEls = function() {
+    return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"tr",this._elTbody);
+};
+
+/**
+ * Sets given row to the selected state.
+ *
+ * @method selectRow
+ * @param row {HTMLElement | String} HTML element reference or ID.
+ */
+YAHOO.widget.DataTable.prototype.selectRow = function(row) {
+    // Validate the row
+    var elRow = this.getTrEl(row);
+    if(elRow) {
+        var oRecord = this.getRecord(elRow);
+        if(oRecord) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var nRecordId = oRecord.getId();
+            // Remove if already there
+
+            // Use Array.indexOf if available...
+            if(tracker.indexOf && (tracker.indexOf(nRecordId) >  -1)) {
+                tracker.splice(tracker.indexOf(nRecordId),1);
+            }
+            // ...or do it the old-fashioned way
+            else {
+                for(var j=0; j<tracker.length; j++) {
+                   if(tracker[j] === nRecordId){
+                        tracker.splice(j,1);
+                    }
+                }
+            }
+            // Add to the end
+            tracker.push(nRecordId);
+
+            // Update trackers
+            this._sLastSelectedId = elRow.id;
+            if(!this._sSelectionAnchorId) {
+                this._sSelectionAnchorId = elRow.id;
+            }
+            this._aSelections = tracker;
+        
+            // Update UI
+            YAHOO.util.Dom.addClass(elRow, YAHOO.widget.DataTable.CLASS_SELECTED);
+
+            this.fireEvent("rowSelectEvent", {record:oRecord, el:elRow});
+
+            return;
+        }
+    }
+};
+// Backward compatibility
+YAHOO.widget.DataTable.prototype.select = function(els) {
+    if(!YAHOO.lang.isArray(els)) {
+        els = [els];
+    }
+    for(var i=0; i<els.length; i++) {
+        this.selectRow(els[i]);
+    }
+};
+
+/**
+ * Sets given row to the unselected state.
+ *
+ * @method unselectRow
+ * @param row {HTMLElement | String} HTML TR element reference or ID.
+ */
+YAHOO.widget.DataTable.prototype.unselectRow = function(row) {
+    // Validate the row
+    var elRow = this.getTrEl(row);
+    if(elRow) {
+        var oRecord = this.getRecord(elRow);
+        if(oRecord) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var nRecordId = oRecord.getId();
+
+            // Remove if there
+            var bFound = false;
+            
+            // Use Array.indexOf if available...
+            if(tracker.indexOf && (tracker.indexOf(nRecordId) >  -1)) {
+                tracker.splice(tracker.indexOf(nRecordId),1);
+                bFound = true;
+            }
+            // ...or do it the old-fashioned way
+            else {
+                for(var j=0; j<tracker.length; j++) {
+                   if(tracker[j] === nRecordId){
+                        tracker.splice(j,1);
+                        bFound = true;
+                    }
+                }
+            }
+
+            if(bFound) {
+                // Update tracker
+                this._aSelections = tracker;
+
+                // Update the UI
+                YAHOO.util.Dom.removeClass(elRow, YAHOO.widget.DataTable.CLASS_SELECTED);
+
+                this.fireEvent("rowUnselectEvent", {record:oRecord, el:elRow});
+
+                return;
+            }
+        }
+    }
+};
+
+/**
+ * Clears out all row selections.
+ *
+ * @method unselectAllRows
+ */
+YAHOO.widget.DataTable.prototype.unselectAllRows = function() {
+    // Remove from tracker
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(YAHOO.lang.isNumber(tracker[j])){
+            tracker.splice(j,1);
+        }
+    }
+
+    // Update tracker
+    this._aSelections = tracker;
+
+    // Update UI
+    this._unselectAllTrEls();
+
+    //TODO: send an array of [{el:el,record:record}]
+    //TODO: or convert this to an unselectRows method
+    //TODO: that takes an array of rows or unselects all if none given
+    this.fireEvent("unselectAllRowsEvent");
+};
+
+/**
+ * Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED
+ * from all TD elements in the internal tracker.
+ *
+ * @method _unselectAllTdEls
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._unselectAllTdEls = function() {
+    var selectedCells = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);
+    YAHOO.util.Dom.removeClass(selectedCells, YAHOO.widget.DataTable.CLASS_SELECTED);
+};
+
+/**
+ * Returns array of selected TD elements on the page.
+ *
+ * @method getSelectedTdEls
+ * @return {HTMLElement[]} Array of selected TD elements.
+ */
+YAHOO.widget.DataTable.prototype.getSelectedTdEls = function() {
+    return YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_SELECTED,"td",this._elTbody);
+};
+
+/**
+ * Sets given cell to the selected state.
+ *
+ * @method selectCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ */
+YAHOO.widget.DataTable.prototype.selectCell = function(cell) {
+    var elCell = this.getTdEl(cell);
+    
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        var nColumnId = elCell.yuiColumnId;
+
+        if(oRecord && YAHOO.lang.isNumber(nColumnId)) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var nRecordId = oRecord.getId();
+
+            // Remove if there
+            for(var j=0; j<tracker.length; j++) {
+               if((tracker[j].recordId === nRecordId) && (tracker[j].columnId === nColumnId)){
+                    tracker.splice(j,1);
+                }
+            }
+
+            // Add to the end
+            tracker.push({recordId:nRecordId, columnId:nColumnId});
+
+            // Update trackers
+            this._aSelections = tracker;
+            this._sLastSelectedId = elCell.id;
+            if(!this._sSelectionAnchorId) {
+                this._sSelectionAnchorId = elCell.id;
+            }
+
+            // Update the UI
+            YAHOO.util.Dom.addClass(elCell, YAHOO.widget.DataTable.CLASS_SELECTED);
+
+            this.fireEvent("cellSelectEvent", {record:oRecord,
+                    key: this._oColumnSet.getColumn(nColumnId).key, el:elCell});
+            return;
+        }
+    }
+};
+
+/**
+ * Sets given cell to the unselected state.
+ *
+ * @method unselectCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string
+ * to DataTable page element or RecordSet index.
+ */
+YAHOO.widget.DataTable.prototype.unselectCell = function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        var nColumnId = elCell.yuiColumnId;
+
+        if(oRecord && YAHOO.lang.isNumber(nColumnId)) {
+            // Get Record ID
+            var tracker = this._aSelections || [];
+            var id = oRecord.getId();
+
+            // Is it selected?
+            for(var j=0; j<tracker.length; j++) {
+                if((tracker[j].recordId === id) && (tracker[j].columnId === nColumnId)){
+                    // Remove from tracker
+                    tracker.splice(j,1);
+                    
+                    // Update tracker
+                    this._aSelections = tracker;
+
+                    // Update the UI
+                    YAHOO.util.Dom.removeClass(elCell, YAHOO.widget.DataTable.CLASS_SELECTED);
+
+                    this.fireEvent("cellUnselectEvent", {record:oRecord,
+                            key:this._oColumnSet.getColumn(nColumnId).key, el:elCell});
+
+                    return;
+                }
+            }
+        }
+    }
+};
+
+/**
+ * Clears out all cell selections.
+ *
+ * @method unselectAllCells
+ */
+YAHOO.widget.DataTable.prototype.unselectAllCells= function() {
+    // Remove from tracker
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(tracker[j].constructor == Object){
+            tracker.splice(j,1);
+        }
+    }
+
+    // Update tracker
+    this._aSelections = tracker;
+
+    // Update UI
+    this._unselectAllTdEls();
+    
+    //TODO: send data
+    //TODO: or fire individual cellUnselectEvent
+    this.fireEvent("unselectAllCellsEvent");
+};
+
+/**
+ * Returns true if given TR or TD element is select, false otherwise.
+ *
+ * @method isSelected
+ * @param el {HTMLElement} HTML element reference or ID of a TR or TD.
+ * @return {Boolean} True if element is selected.
+ */
+YAHOO.widget.DataTable.prototype.isSelected = function(el) {
+    return YAHOO.util.Dom.hasClass(el,YAHOO.widget.DataTable.CLASS_SELECTED);
+};
+
+/**
+ * Returns selected rows as an array of Record IDs.
+ *
+ * @method getSelectedRows
+ * @return {HTMLElement[]} Array of selected rows by Record ID.
+ */
+YAHOO.widget.DataTable.prototype.getSelectedRows = function() {
+    var aSelectedRows = [];
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(YAHOO.lang.isNumber(tracker[j])){
+            aSelectedRows.push(tracker[j]);
+        }
+    }
+    return aSelectedRows;
+};
+
+/**
+ * Returns selected cells as an array of object literals:
+ *     {recordId:nRecordID, columnId:nColumnId}.
+ *
+ * @method getSelectedCells
+ * @return {HTMLElement[]} Array of selected cells by Record and Column IDs.
+ */
+YAHOO.widget.DataTable.prototype.getSelectedCells = function() {
+    var aSelectedCells = [];
+    var tracker = this._aSelections || [];
+    for(var j=0; j<tracker.length; j++) {
+       if(tracker[j] && (tracker[j].constructor == Object)){
+            aSelectedCells.push({recordId:tracker[j].recordId, columnId:tracker[j].columnId});
+        }
+    }
+    return aSelectedCells;
+};
+
+/**
+ * Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given row.
+ *
+ * @method highlightRow
+ * @param row {HTMLElement | String} DOM element reference or ID string.
+ */
+YAHOO.widget.DataTable.prototype.highlightRow = function(row) {
+    var elRow = this.getTrEl(row);
+
+    if(elRow) {
+        // Make sure previous row is unhighlighted
+        if(this._sLastHighlightedRowId) {
+            YAHOO.util.Dom.removeClass(this._sLastHighlightedRowId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        }
+        var oRecord = this.getRecord(elRow);
+        YAHOO.util.Dom.addClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        this._sLastHighlightedRowId = elRow.id;
+        this.fireEvent("rowHighlightEvent", {record:oRecord, el:elRow});
+        return;
+    }
+};
+
+/**
+ * Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED from the given row.
+ *
+ * @method unhighlightRow
+ * @param row {HTMLElement | String} DOM element reference or ID string.
+ */
+YAHOO.widget.DataTable.prototype.unhighlightRow = function(row) {
+    var elRow = this.getTrEl(row);
+
+    if(elRow) {
+        var oRecord = this.getRecord(elRow);
+        YAHOO.util.Dom.removeClass(elRow,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        this.fireEvent("rowUnhighlightEvent", {record:oRecord, el:elRow});
+        return;
+    }
+};
+
+/**
+ * Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given cell.
+ *
+ * @method highlightCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string.
+ */
+YAHOO.widget.DataTable.prototype.highlightCell = function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        // Make sure previous cell is unhighlighted
+        if(this._sLastHighlightedCellId) {
+            YAHOO.util.Dom.removeClass(this._sLastHighlightedCellId,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        }
+        
+        var oRecord = this.getRecord(elCell);
+        YAHOO.util.Dom.addClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        this._sLastHighlightedCellId = elCell.id;
+        this.fireEvent("cellHighlightEvent", {record:oRecord,
+                    key:this._oColumnSet.getColumn(elCell.yuiColumnId).key, el:elCell});
+        return;
+    }
+};
+
+/**
+ * Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED from the given cell.
+ *
+ * @method unhighlightCell
+ * @param cell {HTMLElement | String} DOM element reference or ID string.
+ */
+YAHOO.widget.DataTable.prototype.unhighlightCell = function(cell) {
+    var elCell = this.getTdEl(cell);
+
+    if(elCell) {
+        var oRecord = this.getRecord(elCell);
+        YAHOO.util.Dom.removeClass(elCell,YAHOO.widget.DataTable.CLASS_HIGHLIGHTED);
+        this.fireEvent("cellUnhighlightEvent", {record:oRecord,
+                    key:this._oColumnSet.getColumn(elCell.yuiColumnId).key, el:elCell});
+        return;
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// INLINE EDITING
+
+/*TODO: for TAB handling
+ * Shows Cell Editor for next cell.
+ *
+ * @method editNextCell
+ * @param elCell {HTMLElement} Cell element from which to edit next cell.
+ */
+//YAHOO.widget.DataTable.prototype.editNextCell = function(elCell) {
+//};
+
+/**
+ * Shows Cell Editor for given cell.
+ *
+ * @method showCellEditor
+ * @param elCell {HTMLElement | String} Cell element to edit.
+ * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.
+ * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.
+ */
+YAHOO.widget.DataTable.prototype.showCellEditor = function(elCell, oRecord, oColumn) {
+    elCell = YAHOO.util.Dom.get(elCell);
+    
+    if(elCell && (elCell.ownerDocument === document)) {
+        if(!oRecord || !(oRecord instanceof YAHOO.widget.Record)) {
+            oRecord = this.getRecord(elCell);
+        }
+        if(!oColumn || !(oColumn instanceof YAHOO.widget.Column)) {
+            oColumn = this.getColumn(elCell);
+        }
+        if(oRecord && oColumn) {
+            var oCellEditor = this._oCellEditor;
+            
+            // Clear previous Editor
+            if(oCellEditor.isActive) {
+                this.cancelCellEditor();
+            }
+
+            // Editor not defined
+            if(!oColumn.editor) {
+                return;
+            }
+            
+            // Update Editor values
+            oCellEditor.cell = elCell;
+            oCellEditor.record = oRecord;
+            oCellEditor.column = oColumn;
+            oCellEditor.validator = (oColumn.editorOptions &&
+                    YAHOO.lang.isFunction(oColumn.editorOptions.validator)) ?
+                    oColumn.editorOptions.validator : null;
+            oCellEditor.value = oRecord.getData(oColumn.key);
+
+            // Move Editor
+            var elContainer = oCellEditor.container;
+            var x = YAHOO.util.Dom.getX(elCell);
+            var y = YAHOO.util.Dom.getY(elCell);
+
+            // SF doesn't get xy for cells in scrolling table
+            // when tbody display is set to block
+            if(isNaN(x) || isNaN(y)) {
+                x = elCell.offsetLeft + // cell pos relative to table
+                        YAHOO.util.Dom.getX(this._elTable) - // plus table pos relative to document
+                        this._elTbody.scrollLeft; // minus tbody scroll
+                y = elCell.offsetTop + // cell pos relative to table
+                        YAHOO.util.Dom.getY(this._elTable) - // plus table pos relative to document
+                        this._elTbody.scrollTop + // minus tbody scroll
+                        this._elThead.offsetHeight; // account for fixed headers
+            }
+            
+            elContainer.style.left = x + "px";
+            elContainer.style.top = y + "px";
+
+            // Show Editor
+            elContainer.style.display = "";
+            
+            // Render Editor markup
+            var fnEditor;
+            if(YAHOO.lang.isString(oColumn.editor)) {
+                switch(oColumn.editor) {
+                    case "checkbox":
+                        fnEditor = YAHOO.widget.DataTable.editCheckbox;
+                        break;
+                    case "date":
+                        fnEditor = YAHOO.widget.DataTable.editDate;
+                        break;
+                    case "dropdown":
+                        fnEditor = YAHOO.widget.DataTable.editDropdown;
+                        break;
+                    case "radio":
+                        fnEditor = YAHOO.widget.DataTable.editRadio;
+                        break;
+                    case "textarea":
+                        fnEditor = YAHOO.widget.DataTable.editTextarea;
+                        break;
+                    case "textbox":
+                        fnEditor = YAHOO.widget.DataTable.editTextbox;
+                        break;
+                    default:
+                        fnEditor = null;
+                }
+            }
+            else if(YAHOO.lang.isFunction(oColumn.editor)) {
+                fnEditor = oColumn.editor;
+            }
+
+            if(fnEditor) {
+                // Create DOM input elements
+                fnEditor(this._oCellEditor, this);
+                
+                // Show Save/Cancel buttons
+                if(!oColumn.editorOptions || !oColumn.editorOptions.disableBtns) {
+                    this.showCellEditorBtns(elContainer);
+                }
+
+                // Hook to customize the UI
+                this.doBeforeShowCellEditor(this._oCellEditor);
+
+                oCellEditor.isActive = true;
+                
+                //TODO: verify which args to pass
+                this.fireEvent("editorShowEvent", {editor:oCellEditor});
+                return;
+            }
+        }
+    }
+};
+
+/**
+ * Overridable abstract method to customize Cell Editor UI.
+ *
+ * @method doBeforeShowCellEditor
+ * @param oCellEditor {Object} Cell Editor object literal.
+ */
+YAHOO.widget.DataTable.prototype.doBeforeShowCellEditor = function(oCellEditor) {
+};
+
+/**
+ * Adds Save/Cancel buttons to Cell Editor.
+ *
+ * @method showCellEditorBtns
+ * @param elContainer {HTMLElement} Cell Editor container.
+ */
+YAHOO.widget.DataTable.prototype.showCellEditorBtns = function(elContainer) {
+    // Buttons
+    var elBtnsDiv = elContainer.appendChild(document.createElement("div"));
+    YAHOO.util.Dom.addClass(elBtnsDiv, YAHOO.widget.DataTable.CLASS_BUTTON);
+
+    // Save button
+    var elSaveBtn = elBtnsDiv.appendChild(document.createElement("button"));
+    YAHOO.util.Dom.addClass(elSaveBtn, YAHOO.widget.DataTable.CLASS_DEFAULT);
+    elSaveBtn.innerHTML = "OK";
+    YAHOO.util.Event.addListener(elSaveBtn, "click", this.saveCellEditor, this, true);
+
+    // Cancel button
+    var elCancelBtn = elBtnsDiv.appendChild(document.createElement("button"));
+    elCancelBtn.innerHTML = "Cancel";
+    YAHOO.util.Event.addListener(elCancelBtn, "click", this.cancelCellEditor, this, true);
+};
+
+/**
+ * Clears Cell Editor of all state and UI.
+ *
+ * @method resetCellEditor
+ */
+
+YAHOO.widget.DataTable.prototype.resetCellEditor = function() {
+    var elContainer = this._oCellEditor.container;
+    elContainer.style.display = "none";
+    YAHOO.util.Event.purgeElement(elContainer, true);
+    elContainer.innerHTML = "";
+    this._oCellEditor.value = null;
+    this._oCellEditor.isActive = false;
+};
+
+/**
+ * Saves Cell Editor input to Record.
+ *
+ * @method saveCellEditor
+ */
+YAHOO.widget.DataTable.prototype.saveCellEditor = function() {
+    //TODO: Copy the editor's values to pass to the event
+    if(this._oCellEditor.isActive) {
+        var newData = this._oCellEditor.value;
+        var oldData = this._oCellEditor.record.getData(this._oCellEditor.column.key);
+
+        // Validate input data
+        if(this._oCellEditor.validator) {
+            this._oCellEditor.value = this._oCellEditor.validator.call(this, newData, oldData);
+            if(this._oCellEditor.value === null ) {
+                this.resetCellEditor();
+                this.fireEvent("editorRevertEvent",
+                        {editor:this._oCellEditor, oldData:oldData, newData:newData});
+                return;
+            }
+        }
+
+        // Update the Record
+        this._oRecordSet.updateKey(this._oCellEditor.record, this._oCellEditor.column.key, this._oCellEditor.value);
+
+        // Update the UI
+        this.formatCell(this._oCellEditor.cell);
+
+        // Clear out the Cell Editor
+        this.resetCellEditor();
+
+        this.fireEvent("editorSaveEvent",
+                {editor:this._oCellEditor, oldData:oldData, newData:newData});
+    }
+    else {
+    }
+};
+
+/**
+ * Cancels Cell Editor.
+ *
+ * @method cancelCellEditor
+ */
+YAHOO.widget.DataTable.prototype.cancelCellEditor = function() {
+    if(this._oCellEditor.isActive) {
+        this.resetCellEditor();
+        //TODO: preserve values for the event?
+        this.fireEvent("editorCancelEvent", {editor:this._oCellEditor});
+    }
+    else {
+    }
+};
+
+/**
+ * Enables CHECKBOX Editor.
+ *
+ * @method editCheckbox
+ */
+//YAHOO.widget.DataTable.editCheckbox = function(elContainer, oRecord, oColumn, oEditor, oSelf) {
+YAHOO.widget.DataTable.editCheckbox = function(oEditor, oSelf) {
+    var elCell = oEditor.cell;
+    var oRecord = oEditor.record;
+    var oColumn = oEditor.column;
+    var elContainer = oEditor.container;
+    var aCheckedValues = oRecord.getData(oColumn.key);
+    if(!YAHOO.lang.isArray(aCheckedValues)) {
+        aCheckedValues = [aCheckedValues];
+    }
+
+    // Checkboxes
+    if(oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.checkboxOptions)) {
+        var checkboxOptions = oColumn.editorOptions.checkboxOptions;
+        var checkboxValue, checkboxId, elLabel, j, k;
+        // First create the checkbox buttons in an IE-friendly way
+        for(j=0; j<checkboxOptions.length; j++) {
+            checkboxValue = YAHOO.lang.isValue(checkboxOptions[j].label) ?
+                    checkboxOptions[j].label : checkboxOptions[j];
+            checkboxId =  oSelf.id + "-editor-checkbox" + j;
+            elContainer.innerHTML += "<input type=\"checkbox\"" +
+                    " name=\"" + oSelf.id + "-editor-checkbox\"" +
+                    " value=\"" + checkboxValue + "\"" +
+                    " id=\"" +  checkboxId + "\">";
+            // Then create the labels in an IE-friendly way
+            elLabel = elContainer.appendChild(document.createElement("label"));
+            elLabel.htmlFor = checkboxId;
+            elLabel.innerHTML = checkboxValue;
+        }
+        var aCheckboxEls = [];
+        var checkboxEl;
+        // Loop through checkboxes to check them
+        for(j=0; j<checkboxOptions.length; j++) {
+            checkboxEl = YAHOO.util.Dom.get(oSelf.id + "-editor-checkbox" + j);
+            aCheckboxEls.push(checkboxEl);
+            for(k=0; k<aCheckedValues.length; k++) {
+                if(checkboxEl.value === aCheckedValues[k]) {
+                    checkboxEl.checked = true;
+                }
+            }
+            // Focus the first checkbox
+            if(j===0) {
+                oSelf._focusEl(checkboxEl);
+            }
+        }
+        // Loop through checkboxes to assign click handlers
+        for(j=0; j<checkboxOptions.length; j++) {
+            checkboxEl = YAHOO.util.Dom.get(oSelf.id + "-editor-checkbox" + j);
+            YAHOO.util.Event.addListener(checkboxEl, "click", function(){
+                var aNewValues = [];
+                for(var m=0; m<aCheckboxEls.length; m++) {
+                    if(aCheckboxEls[m].checked) {
+                        aNewValues.push(aCheckboxEls[m].value);
+                    }
+                }
+                oSelf._oCellEditor.value = aNewValues;
+                oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+            });
+        }
+    }
+};
+
+/**
+ * Enables Date Editor.
+ *
+ * @method editDate
+ */
+YAHOO.widget.DataTable.editDate = function(oEditor, oSelf) {
+    var elCell = oEditor.cell;
+    var oRecord = oEditor.record;
+    var oColumn = oEditor.column;
+    var elContainer = oEditor.container;
+    var value = oRecord.getData(oColumn.key);
+
+    // Calendar widget
+    if(YAHOO.widget.Calendar) {
+        var selectedValue = (value.getMonth()+1)+"/"+value.getDate()+"/"+value.getFullYear();
+        var calContainer = elContainer.appendChild(document.createElement("div"));
+        calContainer.id = "yui-dt-" + oSelf._nIndex + "-col" + oColumn.getKeyIndex() + "-dateContainer";
+        var calendar =
+                new YAHOO.widget.Calendar("yui-dt-" + oSelf._nIndex + "-col" + oColumn.getKeyIndex() + "-date",
+                calContainer.id,
+                {selected:selectedValue, pagedate:value});
+        calendar.render();
+        calContainer.style.cssFloat = "none";
+
+        //var calFloatClearer = elContainer.appendChild(document.createElement("br"));
+        //calFloatClearer.style.clear = "both";
+        
+        calendar.selectEvent.subscribe(function(type, args, obj) {
+            oSelf._oCellEditor.value = new Date(args[0][0][0], args[0][0][1]-1, args[0][0][2]);
+        });
+        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+    }
+    else {
+        //TODO;
+    }
+};
+
+/**
+ * Enables SELECT Editor.
+ *
+ * @method editDropdown
+ */
+YAHOO.widget.DataTable.editDropdown = function(oEditor, oSelf) {
+    var elCell = oEditor.cell;
+    var oRecord = oEditor.record;
+    var oColumn = oEditor.column;
+    var elContainer = oEditor.container;
+    var value = oRecord.getData(oColumn.key);
+
+    // Textbox
+    var elDropdown = elContainer.appendChild(document.createElement("select"));
+    var dropdownOptions = (oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.dropdownOptions)) ?
+            oColumn.editorOptions.dropdownOptions : [];
+    for(var j=0; j<dropdownOptions.length; j++) {
+        var dropdownOption = dropdownOptions[j];
+        var elOption = document.createElement("option");
+        elOption.value = (YAHOO.lang.isValue(dropdownOption.value)) ?
+                dropdownOption.value : dropdownOption;
+        elOption.innerHTML = (YAHOO.lang.isValue(dropdownOption.text)) ?
+                dropdownOption.text : dropdownOption;
+        elOption = elDropdown.appendChild(elOption);
+        if(value === elDropdown.options[j].value) {
+            elDropdown.options[j].selected = true;
+        }
+    }
+    
+    // Set up a listener on each check box to track the input value
+    YAHOO.util.Event.addListener(elDropdown, "change",
+        function(){
+            oSelf._oCellEditor.value = elDropdown[elDropdown.selectedIndex].value;
+            oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+    });
+            
+    // Focus the dropdown
+    oSelf._focusEl(elDropdown);
+};
+
+/**
+ * Enables INPUT TYPE=RADIO Editor.
+ *
+ * @method editRadio
+ */
+YAHOO.widget.DataTable.editRadio = function(oEditor, oSelf) {
+    var elCell = oEditor.cell;
+    var oRecord = oEditor.record;
+    var oColumn = oEditor.column;
+    var elContainer = oEditor.container;
+    var value = oRecord.getData(oColumn.key);
+
+    // Radios
+    if(oColumn.editorOptions && YAHOO.lang.isArray(oColumn.editorOptions.radioOptions)) {
+        var radioOptions = oColumn.editorOptions.radioOptions;
+        var radioValue, radioId, elLabel, j;
+        // First create the radio buttons in an IE-friendly way
+        for(j=0; j<radioOptions.length; j++) {
+            radioValue = YAHOO.lang.isValue(radioOptions[j].label) ?
+                    radioOptions[j].label : radioOptions[j];
+            radioId =  oSelf.id + "-editor-radio" + j;
+            elContainer.innerHTML += "<input type=\"radio\"" +
+                    " name=\"" + oSelf.id + "-editor-radio\"" +
+                    " value=\"" + radioValue + "\"" +
+                    " id=\"" +  radioId + "\">";
+            // Then create the labels in an IE-friendly way
+            elLabel = elContainer.appendChild(document.createElement("label"));
+            elLabel.htmlFor = radioId;
+            elLabel.innerHTML = radioValue;
+        }
+        // Then check one, and assign click handlers
+        for(j=0; j<radioOptions.length; j++) {
+            var radioEl = YAHOO.util.Dom.get(oSelf.id + "-editor-radio" + j);
+            if(value === radioEl.value) {
+                radioEl.checked = true;
+                oSelf._focusEl(radioEl);
+            }
+            YAHOO.util.Event.addListener(radioEl, "click",
+                function(){
+                    oSelf._oCellEditor.value = this.value;
+                    oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+            });
+        }
+    }
+};
+
+/**
+ * Enables TEXTAREA Editor.
+ *
+ * @method editTextarea
+ */
+YAHOO.widget.DataTable.editTextarea = function(oEditor, oSelf) {
+   var elCell = oEditor.cell;
+   var oRecord = oEditor.record;
+   var oColumn = oEditor.column;
+   var elContainer = oEditor.container;
+   var value = oRecord.getData(oColumn.key);
+
+    // Textarea
+    var elTextarea = elContainer.appendChild(document.createElement("textarea"));
+    elTextarea.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
+    elTextarea.style.height = "3em"; //(parseInt(elCell.offsetHeight,10)) + "px";
+    elTextarea.value = YAHOO.lang.isValue(value) ? value : "";
+    
+    // Set up a listener on each check box to track the input value
+    YAHOO.util.Event.addListener(elTextarea, "keyup", function(){
+        //TODO: set on a timeout
+        oSelf._oCellEditor.value = elTextarea.value;
+        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+    });
+    
+    // Select the text
+    elTextarea.focus();
+    elTextarea.select();
+};
+
+/**
+ * Enables INPUT TYPE=TEXT Editor.
+ *
+ * @method editTextbox
+ */
+YAHOO.widget.DataTable.editTextbox = function(oEditor, oSelf) {
+   var elCell = oEditor.cell;
+   var oRecord = oEditor.record;
+   var oColumn = oEditor.column;
+   var elContainer = oEditor.container;
+   var value = YAHOO.lang.isValue(oRecord.getData(oColumn.key)) ? oRecord.getData(oColumn.key) : "";
+
+    // Textbox
+    var elTextbox = elContainer.appendChild(document.createElement("input"));
+    elTextbox.type = "text";
+    elTextbox.style.width = elCell.offsetWidth + "px"; //(parseInt(elCell.offsetWidth,10)) + "px";
+    //elTextbox.style.height = "1em"; //(parseInt(elCell.offsetHeight,10)) + "px";
+    elTextbox.value = value;
+
+    // Set up a listener on each textbox to track the input value
+    YAHOO.util.Event.addListener(elTextbox, "keyup", function(){
+        //TODO: set on a timeout
+        oSelf._oCellEditor.value = elTextbox.value;
+        oSelf.fireEvent("editorUpdateEvent",{editor:oSelf._oCellEditor});
+    });
+
+    // Select the text
+    elTextbox.focus();
+    elTextbox.select();
+};
+
+/*
+ * Validates Editor input value to type Number, doing type conversion as
+ * necessary. A valid Number value is return, else the previous value is returned
+ * if input value does not validate.
+ * 
+ *
+ * @method validateNumber
+ * @static
+*/
+YAHOO.widget.DataTable.validateNumber = function(oData) {
+    //Convert to number
+    var number = oData * 1;
+
+    // Validate
+    if(YAHOO.lang.isNumber(number)) {
+        return number;
+    }
+    else {
+        return null;
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// ABSTRACT METHODS
+
+/**
+ * Overridable method gives implementers a hook to access data before
+ * it gets added to RecordSet and rendered to the TBODY.
+ *
+ * @method doBeforeLoadData
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @return {Boolean} Return true to continue loading data into RecordSet and
+ * updating DataTable with new Records, false to cancel.
+ */
+YAHOO.widget.DataTable.prototype.doBeforeLoadData = function(sRequest, oResponse) {
+    return true;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public Custom Event Handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Overridable custom event handler to sort Column.
+ *
+ * @method onEventSortColumn
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventSortColumn = function(oArgs) {
+//TODO: support nested header column sorting
+    var evt = oArgs.event;
+    var target = oArgs.target;
+    YAHOO.util.Event.stopEvent(evt);
+    
+    var el = this.getThEl(target) || this.getTdEl(target);
+    if(el && YAHOO.lang.isNumber(el.yuiColumnId)) {
+        this.sortColumn(this._oColumnSet.getColumn(el.yuiColumnId));
+    }
+    else {
+    }
+};
+
+/**
+ * Overridable custom event handler to manage selection according to desktop paradigm.
+ *
+ * @method onEventSelectRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventSelectRow = function(oArgs) {
+    var sMode = this.get("selectionMode");
+    if ((sMode == "singlecell") || (sMode == "cellblock") || (sMode == "cellrange")) {
+        return;
+    }
+
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+
+    var bSHIFT = evt.shiftKey;
+    var bCTRL = evt.ctrlKey;
+    var i, nAnchorTrIndex;
+
+    // Validate target row
+    var elTargetRow = this.getTrEl(elTarget);
+    if(elTargetRow) {
+        var allRows = this._elTbody.rows;
+        var nTargetTrIndex = elTargetRow.sectionRowIndex;
+        var elAnchorRow = YAHOO.util.Dom.get(this._sSelectionAnchorId);
+        
+        // Both SHIFT and CTRL
+        if((sMode != "single") && bSHIFT && bCTRL) {
+            // Validate anchor row
+            if(elAnchorRow && YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)) {
+                nAnchorTrIndex = elAnchorRow.sectionRowIndex;
+                if(this.isSelected(elAnchorRow)) {
+                    // Select all rows between anchor row and target row, including target row
+                    if(nAnchorTrIndex < nTargetTrIndex) {
+                        for(i=nAnchorTrIndex+1; i<=nTargetTrIndex; i++) {
+                            if(!this.isSelected(allRows[i])) {
+                                this.selectRow(allRows[i]);
+                            }
+                        }
+                    }
+                    // Select all rows between target row and anchor row, including target row
+                    else {
+                        for(i=nAnchorTrIndex-1; i>=nTargetTrIndex; i--) {
+                            if(!this.isSelected(allRows[i])) {
+                                this.selectRow(allRows[i]);
+                            }
+                        }
+                    }
+                }
+                else {
+                    // Unselect all rows between anchor row and target row
+                    if(nAnchorTrIndex < nTargetTrIndex) {
+                        for(i=nAnchorTrIndex+1; i<=nTargetTrIndex-1; i++) {
+                            if(this.isSelected(allRows[i])) {
+                                this.unselectRow(allRows[i]);
+                            }
+                        }
+                    }
+                    // Unselect all rows between target row and anchor row
+                    else {
+                        for(i=nTargetTrIndex+1; i<=nAnchorTrIndex-1; i++) {
+                            if(this.isSelected(allRows[i])) {
+                                this.unselectRow(allRows[i]);
+                            }
+                        }
+                    }
+                    // Select the target row
+                    this.selectRow(elTargetRow);
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._sSelectionAnchorId = elTargetRow.id;
+
+                // Toggle selection of target
+                if(this.isSelected(elTargetRow)) {
+                    this.unselectRow(elTargetRow);
+                }
+                else {
+                    this.selectRow(elTargetRow);
+                }
+            }
+        }
+        // Only SHIFT
+        else if((sMode != "single") && bSHIFT) {
+            this.unselectAllRows();
+
+            // Validate anchor
+            if(elAnchorRow && YAHOO.lang.isNumber(elAnchorRow.sectionRowIndex)) {
+                nAnchorTrIndex = elAnchorRow.sectionRowIndex;
+
+                // Select all rows between anchor row and target row,
+                // including the anchor row and target row
+                if(nAnchorTrIndex < nTargetTrIndex) {
+                    for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
+                        this.selectRow(allRows[i]);
+                    }
+                }
+                // Select all rows between target row and anchor row,
+                // including the target row and anchor row
+                else {
+                    for(i=nAnchorTrIndex; i>=nTargetTrIndex; i--) {
+                        this.selectRow(allRows[i]);
+                    }
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._sSelectionAnchorId = elTargetRow.id;
+
+                // Select target row only
+                this.selectRow(elTargetRow);
+            }
+        }
+        // Only CTRL
+        else if((sMode != "single") && bCTRL) {
+            // Set anchor
+            this._sSelectionAnchorId = elTargetRow.id;
+
+            // Toggle selection of target
+            if(this.isSelected(elTargetRow)) {
+                this.unselectRow(elTargetRow);
+            }
+            else {
+                this.selectRow(elTargetRow);
+            }
+        }
+        // Neither SHIFT nor CTRL
+        else if(sMode == "single") {
+            this.unselectAllRows();
+            this.selectRow(elTargetRow);
+        }
+        // Neither SHIFT nor CTRL
+        else {
+            // Set anchor
+            this._sSelectionAnchorId = elTargetRow.id;
+
+            // Select only target
+            this.unselectAllRows();
+            this.selectRow(elTargetRow);
+        }
+        YAHOO.util.Event.stopEvent(evt);
+
+        // Clear any selections that are a byproduct of the click or dblclick
+        var sel;
+        if(window.getSelection) {
+               sel = window.getSelection();
+        }
+        else if(document.getSelection) {
+               sel = document.getSelection();
+        }
+        else if(document.selection) {
+               sel = document.selection;
+        }
+        if(sel) {
+            if(sel.empty) {
+                sel.empty();
+            }
+            else if (sel.removeAllRanges) {
+                sel.removeAllRanges();
+            }
+            else if(sel.collapse) {
+                sel.collapse();
+            }
+        }
+    }
+    else {
+    }
+};
+
+/**
+ * Overridable custom event handler to select cell.
+ *
+ * @method onEventSelectCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventSelectCell = function(oArgs) {
+    var sMode = this.get("selectionMode");
+    if ((sMode == "standard") || (sMode == "single")) {
+        return;
+    }
+
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+
+    var bSHIFT = evt.shiftKey;
+    var bCTRL = evt.ctrlKey;
+    var i, j, nAnchorTrIndex, nAnchorTdIndex, currentRow, startIndex, endIndex;
+    
+    var elTargetCell = this.getTdEl(elTarget);
+    if(elTargetCell) {
+        var elTargetRow = this.getTrEl(elTargetCell);
+        var allRows = this._elTbody.rows;
+        var nTargetTrIndex = elTargetRow.sectionRowIndex;
+        var nTargetTdIndex = elTarget.yuiCellIndex;
+        var elAnchorCell = YAHOO.util.Dom.get(this._sSelectionAnchorId);
+
+        // Both SHIFT and CTRL
+        if((sMode != "singlecell") && bSHIFT && bCTRL) {
+            // Validate anchor
+            if(elAnchorCell && YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)) {
+                nAnchorTrIndex = elAnchorCell.parentNode.sectionRowIndex;
+                nAnchorTdIndex = elAnchorCell.yuiCellIndex;
+                
+                // Anchor is selected
+                if(this.isSelected(elAnchorCell)) {
+                    // All cells are on the same row
+                    if(nAnchorTrIndex == nTargetTrIndex) {
+                        // Select all cells between anchor cell and target cell, including target cell
+                        if(nAnchorTdIndex < nTargetTdIndex) {
+                            for(i=nAnchorTdIndex+1; i<=nTargetTdIndex; i++) {
+                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell, including target cell
+                        else if(nTargetTdIndex < nAnchorTdIndex) {
+                            for(i=nTargetTdIndex; i<nAnchorTdIndex; i++) {
+                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    else if(nAnchorTrIndex < nTargetTrIndex) {
+                        if(sMode == "cellrange") {
+                            // Select all cells on anchor row from anchor cell to the end of the row
+                            for(i=nAnchorTdIndex+1; i<allRows[nAnchorTrIndex].cells.length; i++) {
+                                this.selectCell(allRows[nAnchorTrIndex].cells[i]);
+                            }
+                            
+                            // Select all cells on all rows between anchor row and target row
+                            for(i=nAnchorTrIndex+1; i<nTargetTrIndex; i++) {
+                                for(j=0; j<allRows[i].cells.length; j++){
+                                    this.selectCell(allRows[i].cells[j]);
+                                }
+                            }
+
+                            // Select all cells on target row from first cell to the target cell
+                            for(i=0; i<=nTargetTdIndex; i++) {
+                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+                        }
+                        else if(sMode == "cellblock") {
+                            startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
+                            endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
+                            
+                            // Select all cells from startIndex to endIndex on rows between anchor row and target row
+                            for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
+                                for(j=startIndex; j<=endIndex; j++) {
+                                    this.selectCell(allRows[i].cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        if(sMode == "cellrange") {
+                            // Select all cells on target row from target cell to the end of the row
+                            for(i=nTargetTdIndex; i<allRows[nTargetTrIndex].cells.length; i++) {
+                                this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+
+                            // Select all cells on all rows between target row and anchor row
+                            for(i=nTargetTrIndex+1; i<nAnchorTrIndex; i++) {
+                                for(j=0; j<allRows[i].cells.length; j++){
+                                    this.selectCell(allRows[i].cells[j]);
+                                }
+                            }
+
+                            // Select all cells on anchor row from first cell to the anchor cell
+                            for(i=0; i<nAnchorTdIndex; i++) {
+                                this.selectCell(allRows[nAnchorTrIndex].cells[i]);
+                            }
+                        }
+                        else if(sMode == "cellblock") {
+                            startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
+                            endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
+
+                            // Select all cells from startIndex to endIndex on rows between target row and anchor row
+                            for(i=nAnchorTrIndex; i>=nTargetTrIndex; i--) {
+                                for(j=endIndex; j>=startIndex; j--) {
+                                    this.selectCell(allRows[i].cells[j]);
+                                }
+                            }
+                        }
+                    }
+                }
+                // Anchor cell is unselected
+                else {
+                    // All cells are on the same row
+                    if(nAnchorTrIndex == nTargetTrIndex) {
+                        // Unselect all cells between anchor cell and target cell
+                        if(nAnchorTdIndex < nTargetTdIndex) {
+                            for(i=nAnchorTdIndex+1; i<nTargetTdIndex; i++) {
+                                this.unselectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+                        }
+                        // Select all cells between target cell and anchor cell
+                        else if(nTargetTdIndex < nAnchorTdIndex) {
+                            for(i=nTargetTdIndex+1; i<nAnchorTdIndex; i++) {
+                                this.unselectCell(allRows[nTargetTrIndex].cells[i]);
+                            }
+                        }
+                    }
+                    // Anchor row is above target row
+                    if(nAnchorTrIndex < nTargetTrIndex) {
+                        // Unselect all cells from anchor cell to target cell
+                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the anchor row, only unselect cells after the anchor cell
+                                if(currentRow.sectionRowIndex == nAnchorTrIndex) {
+                                    if(j>nAnchorTdIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the target row, only unelect cells before the target cell
+                                else if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j<nTargetTdIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    // Anchor row is below target row
+                    else {
+                        // Unselect all cells from target cell to anchor cell
+                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the target row, only unselect cells after the target cell
+                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j>nTargetTdIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the anchor row, only unselect cells before the anchor cell
+                                else if(currentRow.sectionRowIndex == nAnchorTrIndex) {
+                                    if(j<nAnchorTdIndex) {
+                                        this.unselectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Unselect all cells on this row
+                                else {
+                                    this.unselectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+
+                    // Select the target cell
+                    this.selectCell(elTargetCell);
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._sSelectionAnchorId = elTargetCell.id;
+
+                // Toggle selection of target
+                if(this.isSelected(elTargetCell)) {
+                    this.unselectCell(elTargetCell);
+                }
+                else {
+                    this.selectCell(elTargetCell);
+                }
+            }
+        }
+        // Only SHIFT
+        else if((sMode != "singlecell") && bSHIFT) {
+            this.unselectAllCells();
+
+            // Validate anchor
+            if(elAnchorCell && YAHOO.lang.isNumber(elAnchorCell.yuiCellIndex)) {
+                nAnchorTrIndex = elAnchorCell.parentNode.sectionRowIndex;
+                nAnchorTdIndex = elAnchorCell.yuiCellIndex;
+                
+                // All cells are on the same row
+                if(nAnchorTrIndex == nTargetTrIndex) {
+                    // Select all cells between anchor cell and target cell,
+                    // including the anchor cell and target cell
+                    if(nAnchorTdIndex < nTargetTdIndex) {
+                        for(i=nAnchorTdIndex; i<=nTargetTdIndex; i++) {
+                            this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                        }
+                    }
+                    // Select all cells between target cell and anchor cell
+                    // including the target cell and anchor cell
+                    else if(nTargetTdIndex < nAnchorTdIndex) {
+                        for(i=nTargetTdIndex; i<=nAnchorTdIndex; i++) {
+                            this.selectCell(allRows[nTargetTrIndex].cells[i]);
+                        }
+                    }
+                }
+                // Anchor row is above target row
+                else if(nAnchorTrIndex < nTargetTrIndex) {
+                    if(sMode == "cellrange") {
+                        // Select all cells from anchor cell to target cell
+                        // including the anchor cell and target cell
+                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the anchor row, only select the anchor cell and after
+                                if(currentRow.sectionRowIndex == nAnchorTrIndex) {
+                                    if(j>=nAnchorTdIndex) {
+                                        this.selectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the target row, only select the target cell and before
+                                else if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j<=nTargetTdIndex) {
+                                        this.selectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Select all cells on this row
+                                else {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    else if(sMode == "cellblock") {
+                        // Select the cellblock from anchor cell to target cell
+                        // including the anchor cell and the target cell
+                        startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
+                        endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
+
+                        for(i=nAnchorTrIndex; i<=nTargetTrIndex; i++) {
+                            for(j=startIndex; j<=endIndex; j++) {
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+                        
+                        this._sLastSelectedId = allRows[nTargetTrIndex].cells[nTargetTdIndex].id;
+                    }
+                }
+                // Anchor row is below target row
+                else {
+                    if(sMode == "cellrange") {
+                        // Select all cells from target cell to anchor cell,
+                        // including the target cell and anchor cell
+                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
+                            currentRow = allRows[i];
+                            for(j=0; j<currentRow.cells.length; j++) {
+                                // This is the target row, only select the target cell and after
+                                if(currentRow.sectionRowIndex == nTargetTrIndex) {
+                                    if(j>=nTargetTdIndex) {
+                                        this.selectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // This is the anchor row, only select the anchor cell and before
+                                else if(currentRow.sectionRowIndex == nAnchorTrIndex) {
+                                    if(j<=nAnchorTdIndex) {
+                                        this.selectCell(currentRow.cells[j]);
+                                    }
+                                }
+                                // Select all cells on this row
+                                else {
+                                    this.selectCell(currentRow.cells[j]);
+                                }
+                            }
+                        }
+                    }
+                    else if(sMode == "cellblock") {
+                        // Select the cellblock from target cell to anchor cell
+                        // including the target cell and the anchor cell
+                        startIndex = Math.min(nAnchorTdIndex, nTargetTdIndex);
+                        endIndex = Math.max(nAnchorTdIndex, nTargetTdIndex);
+
+                        for(i=nTargetTrIndex; i<=nAnchorTrIndex; i++) {
+                            for(j=startIndex; j<=endIndex; j++) {
+                                this.selectCell(allRows[i].cells[j]);
+                            }
+                        }
+                        
+                        this._sLastSelectedId = allRows[nTargetTrIndex].cells[nTargetTdIndex].id;
+                    }
+                }
+            }
+            // Invalid anchor
+            else {
+                // Set anchor
+                this._sSelectionAnchorId = elTargetCell.id;
+
+                // Select target only
+                this.selectCell(elTargetCell);
+            }
+        }
+        // Only CTRL
+        else if((sMode != "singlecell") && bCTRL) {
+            // Set anchor
+            this._sSelectionAnchorId = elTargetCell.id;
+
+            // Toggle selection of target
+            if(this.isSelected(elTargetCell)) {
+                this.unselectCell(elTargetCell);
+            }
+            else {
+                this.selectCell(elTargetCell);
+            }
+        }
+        // Neither SHIFT nor CTRL, or multi-selection has been disabled
+        else {
+            // Set anchor
+            this._sSelectionAnchorId = elTargetCell.id;
+
+            // Select only target
+            this.unselectAllCells();
+            this.selectCell(elTargetCell);
+        }
+
+        YAHOO.util.Event.stopEvent(evt);
+
+        // Clear any selections that are a byproduct of the click or dblclick
+        var sel;
+        if(window.getSelection) {
+               sel = window.getSelection();
+        }
+        else if(document.getSelection) {
+               sel = document.getSelection();
+        }
+        else if(document.selection) {
+               sel = document.selection;
+        }
+        if(sel) {
+            if(sel.empty) {
+                sel.empty();
+            }
+            else if (sel.removeAllRanges) {
+                sel.removeAllRanges();
+            }
+            else if(sel.collapse) {
+                sel.collapse();
+            }
+        }
+    }
+    else {
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+/**
+ * Overridable custom event handler to highlight row.
+ *
+ * @method onEventHighlightRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventHighlightRow = function(oArgs) {
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+    this.highlightRow(elTarget);
+};
+
+/**
+ * Overridable custom event handler to unhighlight row.
+ *
+ * @method onEventUnhighlightRow
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventUnhighlightRow = function(oArgs) {
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+    this.unhighlightRow(elTarget);
+};
+
+/**
+ * Overridable custom event handler to highlight cell.
+ *
+ * @method onEventHighlightCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventHighlightCell = function(oArgs) {
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+    this.highlightCell(elTarget);
+};
+
+/**
+ * Overridable custom event handler to unhighlight cell.
+ *
+ * @method onEventUnhighlightCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventUnhighlightCell = function(oArgs) {
+    var evt = oArgs.event;
+    var elTarget = oArgs.target;
+    this.unhighlightCell(elTarget);
+};
+
+/**
+ * Overridable custom event handler to format cell.
+ *
+ * @method onEventFormatCell
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventFormatCell = function(oArgs) {
+    var evt = oArgs.event;
+    var target = oArgs.target;
+    var elTag = target.tagName.toLowerCase();
+
+    var elCell = this.getTdEl(target);
+    if(elCell && YAHOO.lang.isNumber(elCell.yuiColumnId)) {
+        var oColumn = this._oColumnSet.getColumn(elCell.yuiColumnId);
+        this.formatCell(elCell, this.getRecord(elCell), oColumn);
+    }
+    else {
+    }
+};
+
+/**
+ * Overridable custom event handler to edit cell.
+ *
+ * @method onEventShowCellEditor
+ * @param oArgs.event {HTMLEvent} Event object.
+ * @param oArgs.target {HTMLElement} Target element.
+ */
+YAHOO.widget.DataTable.prototype.onEventShowCellEditor = function(oArgs) {
+    var evt = oArgs.event;
+    var target = oArgs.target;
+    var elTag = target.tagName.toLowerCase();
+
+    var elCell = this.getTdEl(target);
+    if(elCell) {
+        this.showCellEditor(elCell);
+    }
+    else {
+    }
+};
+// Backward compatibility
+YAHOO.widget.DataTable.prototype.onEventEditCell = function(oArgs) {
+    this.onEventShowCellEditor(oArgs);
+};
+
+/**
+ * Overridable custom event handler to save Cell Editor input.
+ *
+ * @method onEventSaveCellEditor
+ * @param oArgs.editor {Object} Cell Editor object literal.
+ */
+YAHOO.widget.DataTable.prototype.onEventSaveCellEditor = function(oArgs) {
+    this.saveCellEditor();
+};
+
+/**
+ * Callback function for creating a progressively enhanced DataTable first
+ * receives data from DataSource and populates the RecordSet, then initializes
+ * DOM elements.
+ *
+ * @method _onDataReturnEnhanceTable
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param bError {Boolean} (optional) True if there was a data error.
+ * @private
+ */
+YAHOO.widget.DataTable.prototype._onDataReturnEnhanceTable = function(sRequest, oResponse) {
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse);
+
+    // Data ok to populate
+    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
+        // Update RecordSet
+        this._oRecordSet.addRecords(oResponse.results);
+
+        // Initialize DOM elements
+        this._initTableEl();
+        if(!this._elTable || !this._elThead || !this._elTbody) {
+            return;
+        }
+
+        // Call Element's constructor after DOM elements are created
+        // but *before* UI is updated with data
+        YAHOO.widget.DataTable.superclass.constructor.call(this, this._elContainer, this._oConfigs);
+
+        //HACK: Set the Paginator values
+        if(this._oConfigs.paginator) {
+            this.updatePaginator(this._oConfigs.paginator);
+        }
+
+        // Update the UI
+        this.refreshView();
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
+    }
+    // Empty
+    else if(ok){
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
+    }
+};
+    
+/**
+ * Callback function receives data from DataSource and populates an entire
+ * DataTable with Records and TR elements, clearing previous Records, if any.
+ *
+ * @method onDataReturnInitializeTable
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param bError {Boolean} (optional) True if there was a data error.
+ */
+YAHOO.widget.DataTable.prototype.onDataReturnInitializeTable = function(sRequest, oResponse) {
+    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
+
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse);
+
+    // Data ok to populate
+    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
+        this.initializeTable(oResponse.results);
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
+    }
+    // Empty
+    else if(ok){
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_EMPTY, YAHOO.widget.DataTable.CLASS_EMPTY);
+    }
+};
+// Backward compatibility
+YAHOO.widget.DataTable.prototype.onDataReturnReplaceRows = function(sRequest, oResponse) {
+    this.onDataReturnInitializeTable(sRequest, oResponse);
+};
+
+/**
+ * Callback function receives data from DataSource and appends to an existing
+ * DataTable new Records and, if applicable, creates or updates
+ * corresponding TR elements.
+ *
+ * @method onDataReturnAppendRows
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param bError {Boolean} (optional) True if there was a data error.
+ */
+YAHOO.widget.DataTable.prototype.onDataReturnAppendRows = function(sRequest, oResponse) {
+    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
+    
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse);
+    
+    // Data ok to append
+    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
+        this.addRows(oResponse.results);
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
+    }
+};
+
+/**
+ * Callback function receives data from DataSource and inserts into top of an
+ * existing DataTable new Records and, if applicable, creates or updates
+ * corresponding TR elements.
+ *
+ * @method onDataReturnInsertRows
+ * @param sRequest {String} Original request.
+ * @param oResponse {Object} Response object.
+ * @param bError {Boolean} (optional) True if there was a data error.
+ */
+YAHOO.widget.DataTable.prototype.onDataReturnInsertRows = function(sRequest, oResponse) {
+    this.fireEvent("dataReturnEvent", {request:sRequest,response:oResponse});
+    
+    // Pass data through abstract method for any transformations
+    var ok = this.doBeforeLoadData(sRequest, oResponse);
+    
+    // Data ok to append
+    if(ok && oResponse && !oResponse.error && YAHOO.lang.isArray(oResponse.results)) {
+        this.addRows(oResponse.results, 0);
+    }
+    // Error
+    else if(ok && oResponse.error) {
+        this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
+    }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Custom Events
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Fired when the DataTable instance's initialization is complete.
+     *
+     * @event initEvent
+     */
+
+    /**
+     * Fired when the DataTable's view is refreshed.
+     *
+     * @event refreshEvent
+     */
+
+    /**
+     * Fired when data is returned from DataSource.
+     *
+     * @event dataReturnEvent
+     * @param oArgs.request {String} Original request.
+     * @param oArgs.response {Object} Response object.
+     */
+
+    /**
+     * Fired when the DataTable has a focus.
+     *
+     * @event tableFocusEvent
+     */
+
+    /**
+     * Fired when the DataTable has a blur.
+     *
+     * @event tableBlurEvent
+     */
+
+    /**
+     * Fired when the DataTable has a mouseover.
+     *
+     * @event tableMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a mouseout.
+     *
+     * @event tableMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a mousedown.
+     *
+     * @event tableMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a click.
+     *
+     * @event tableClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when the DataTable has a dblclick.
+     *
+     * @event tableDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's TABLE element.
+     *
+     */
+
+    /**
+     * Fired when a fixed scrolling DataTable has a scroll.
+     *
+     * @event tableScrollEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The DataTable's CONTAINER element (in IE)
+     * or the DataTable's TBODY element (everyone else).
+     *
+     */
+
+    /**
+     * Fired when a message is shown in the DataTable's message element.
+     *
+     * @event tableMsgShowEvent
+     * @param oArgs.html {String} The HTML displayed.
+     * @param oArgs.className {String} The className assigned.
+     *
+     */
+
+    /**
+     * Fired when the DataTable's message element is hidden.
+     *
+     * @event tableMsgHideEvent
+     */
+
+    /**
+     * Fired when a header row has a mouseover.
+     *
+     * @event headerRowMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a header row has a mouseout.
+     *
+     * @event headerRowMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a header row has a mousedown.
+     *
+     * @event headerRowMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a header row has a click.
+     *
+     * @event headerRowClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a header row has a dblclick.
+     *
+     * @event headerRowDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a header cell has a mouseover.
+     *
+     * @event headerCellMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     *
+     */
+
+    /**
+     * Fired when a header cell has a mouseout.
+     *
+     * @event headerCellMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     *
+     */
+
+    /**
+     * Fired when a header cell has a mousedown.
+     *
+     * @event headerCellMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a header cell has a click.
+     *
+     * @event headerCellClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a header cell has a dblclick.
+     *
+     * @event headerCellDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a header label has a mouseover.
+     *
+     * @event headerLabelMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     *
+     */
+
+    /**
+     * Fired when a header label has a mouseout.
+     *
+     * @event headerLabelMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     *
+     */
+
+    /**
+     * Fired when a header label has a mousedown.
+     *
+     * @event headerLabelMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
+
+    /**
+     * Fired when a header label has a click.
+     *
+     * @event headerLabelClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
+
+    /**
+     * Fired when a header label has a dblclick.
+     *
+     * @event headerLabelDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SPAN element.
+     */
+
+    /**
+     * Fired when a column is sorted.
+     *
+     * @event columnSortEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.dir {String} Sort direction "asc" or "desc".
+     */
+
+    /**
+     * Fired when a column is resized.
+     *
+     * @event columnResizeEvent
+     * @param oArgs.column {YAHOO.widget.Column} The Column instance.
+     * @param oArgs.target {HTMLElement} The TH element.
+     */
+
+    /**
+     * Fired when a row has a mouseover.
+     *
+     * @event rowMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a mouseout.
+     *
+     * @event rowMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a mousedown.
+     *
+     * @event rowMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a click.
+     *
+     * @event rowClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row has a dblclick.
+     *
+     * @event rowDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TR element.
+     */
+
+    /**
+     * Fired when a row is added.
+     *
+     * @event rowAddEvent
+     * @param oArgs.record {YAHOO.widget.Record} The added Record.
+     */
+
+    /**
+     * Fired when a row is updated.
+     *
+     * @event rowUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The updated Record.
+     * @param oArgs.oldData {Object} Object literal of the old data.
+     */
+
+    /**
+     * Fired when a row is deleted.
+     *
+     * @event rowDeleteEvent
+     * @param oArgs.oldData {Object} Object literal of the deleted data.
+     * @param oArgs.recordIndex {Number} Index of the deleted Record.
+     * @param oArgs.trElIndex {Number} Index of the deleted TR element, if in view.
+     */
+
+    /**
+     * Fired when a row is selected.
+     *
+     * @event rowSelectEvent
+     * @param oArgs.el {HTMLElement} The selected TR element, if applicable.
+     * @param oArgs.record {YAHOO.widget.Record} The selected Record.
+     */
+
+    /**
+     * Fired when a row is unselected.
+     *
+     * @event rowUnselectEvent
+     * @param oArgs.el {HTMLElement} The unselected TR element, if applicable.
+     * @param oArgs.record {YAHOO.widget.Record} The unselected Record.
+     */
+
+    /*TODO: delete and use rowUnselectEvent?
+     * Fired when all row selections are cleared.
+     *
+     * @event unselectAllRowsEvent
+     */
+
+    /*
+     * Fired when a row is highlighted.
+     *
+     * @event rowHighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TR element.
+     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
+     */
+
+    /*
+     * Fired when a row is unhighlighted.
+     *
+     * @event rowUnhighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TR element.
+     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
+     */
+
+    /**
+     * Fired when a cell has a mouseover.
+     *
+     * @event cellMouseoverEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a mouseout.
+     *
+     * @event cellMouseoutEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a mousedown.
+     *
+     * @event cellMousedownEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a click.
+     *
+     * @event cellClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell has a dblclick.
+     *
+     * @event cellDblclickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The TD element.
+     */
+
+    /**
+     * Fired when a cell is formatted.
+     *
+     * @event cellFormatEvent
+     * @param oArgs.el {HTMLElement} The formatted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The formatted Record.
+     * @param oArgs.key {String} The key of the formatted cell.
+     */
+
+    /**
+     * Fired when a cell is selected.
+     *
+     * @event cellSelectEvent
+     * @param oArgs.el {HTMLElement} The selected TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The selected Record.
+     * @param oArgs.key {String} The key of the selected cell.
+     */
+
+    /**
+     * Fired when a cell is unselected.
+     *
+     * @event cellUnselectEvent
+     * @param oArgs.el {HTMLElement} The unselected TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The unselected Record.
+     * @param oArgs.key {String} The key of the unselected cell.
+     */
+
+    /**
+     * Fired when a cell is highlighted.
+     *
+     * @event cellHighlightEvent
+     * @param oArgs.el {HTMLElement} The highlighted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.
+     * @param oArgs.key {String} The key of the highlighted cell.
+     */
+
+    /**
+     * Fired when a cell is unhighlighted.
+     *
+     * @event cellUnhighlightEvent
+     * @param oArgs.el {HTMLElement} The unhighlighted TD element.
+     * @param oArgs.record {YAHOO.widget.Record} The unhighlighted Record.
+     * @param oArgs.key {String} The key of the unhighlighted cell.
+     */
+
+    /*TODO: hide from doc and use cellUnselectEvent
+     * Fired when all cell selections are cleared.
+     *
+     * @event unselectAllCellsEvent
+     */
+
+    /*TODO: implement
+     * Fired when DataTable paginator is updated.
+     *
+     * @event paginatorUpdateEvent
+     * @param paginator {Object} Object literal of Paginator values.
+     */
+
+    /**
+     * Fired when an Editor is activated.
+     *
+     * @event editorShowEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     */
+
+    /**
+     * Fired when an active Editor has a keydown.
+     *
+     * @event editorKeydownEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.event {HTMLEvent} The event object.
+     */
+
+    /**
+     * Fired when Editor input is reverted.
+     *
+     * @event editorRevertEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.newData {Object} New data value.
+     * @param oArgs.oldData {Object} Old data value.
+     */
+
+    /**
+     * Fired when Editor input is saved.
+     *
+     * @event editorSaveEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     * @param oArgs.newData {Object} New data value.
+     * @param oArgs.oldData {Object} Old data value.
+     */
+
+    /**
+     * Fired when Editor input is canceled.
+     *
+     * @event editorCancelEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     */
+
+    /**
+     * Fired when an active Editor has a blur.
+     *
+     * @event editorBlurEvent
+     * @param oArgs.editor {Object} The Editor object literal.
+     */
+
+
+
+
+
+
+
+    /**
+     * Fired when a link is clicked.
+     *
+     * @event linkClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The A element.
+     */
+
+    /**
+     * Fired when a BUTTON element is clicked.
+     *
+     * @event buttonClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The BUTTON element.
+     */
+
+    /**
+     * Fired when a CHECKBOX element is clicked.
+     *
+     * @event checkboxClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The CHECKBOX element.
+     */
+
+    /*TODO
+     * Fired when a SELECT element is changed.
+     *
+     * @event dropdownChangeEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The SELECT element.
+     */
+
+    /**
+     * Fired when a RADIO element is clicked.
+     *
+     * @event radioClickEvent
+     * @param oArgs.event {HTMLEvent} The event object.
+     * @param oArgs.target {HTMLElement} The RADIO element.
+     */
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The ColumnSet class defines and manages a DataTable's Columns,
+ * including nested hierarchies and access to individual Column instances.
+ *
+ * @namespace YAHOO.widget
+ * @class ColumnSet
+ * @uses YAHOO.util.EventProvider
+ * @constructor
+ * @param aHeaders {Object[]} Array of object literals that define header cells.
+ */
+YAHOO.widget.ColumnSet = function(aHeaders) {
+    this._sName = "instance" + YAHOO.widget.ColumnSet._nCount;
+
+    // DOM tree representation of all Columns
+    var tree = [];
+    // Flat representation of all Columns
+    var flat = [];
+    // Flat representation of only Columns that are meant to display data
+    var keys = [];
+    // Array of HEADERS attribute values for all keys in the "keys" array
+    var headers = [];
+
+    // Tracks current node list depth being tracked
+    var nodeDepth = -1;
+
+    // Internal recursive function to defined Column instances
+    var parseColumns = function(nodeList, parent) {
+        // One level down
+        nodeDepth++;
+
+        // Create corresponding tree node if not already there for this depth
+        if(!tree[nodeDepth]) {
+            tree[nodeDepth] = [];
+        }
+
+
+        // Parse each node at this depth for attributes and any children
+        for(var j=0; j<nodeList.length; j++) {
+            var currentNode = nodeList[j];
+
+            // Instantiate a new Column for each node
+            var oColumn = new YAHOO.widget.Column(currentNode);
+
+            // Add the new Column to the flat list
+            flat.push(oColumn);
+
+            // Assign its parent as an attribute, if applicable
+            if(parent) {
+                oColumn.parent = parent;
+            }
+
+            // The Column has descendants
+            if(YAHOO.lang.isArray(currentNode.children)) {
+                oColumn.children = currentNode.children;
+
+                // Determine COLSPAN value for this Column
+                var terminalChildNodes = 0;
+                var countTerminalChildNodes = function(ancestor) {
+                    var descendants = ancestor.children;
+                    // Drill down each branch and count terminal nodes
+                    for(var k=0; k<descendants.length; k++) {
+                        // Keep drilling down
+                        if(YAHOO.lang.isArray(descendants[k].children)) {
+                            countTerminalChildNodes(descendants[k]);
+                        }
+                        // Reached branch terminus
+                        else {
+                            terminalChildNodes++;
+                        }
+                    }
+                };
+                countTerminalChildNodes(currentNode);
+                oColumn._colspan = terminalChildNodes;
+
+                // Cascade certain properties to children if not defined on their own
+                var currentChildren = currentNode.children;
+                for(var k=0; k<currentChildren.length; k++) {
+                    var child = currentChildren[k];
+                    if(oColumn.className && (child.className === undefined)) {
+                        child.className = oColumn.className;
+                    }
+                    if(oColumn.editor && (child.editor === undefined)) {
+                        child.editor = oColumn.editor;
+                    }
+                    if(oColumn.editorOptions && (child.editorOptions === undefined)) {
+                        child.editorOptions = oColumn.editorOptions;
+                    }
+                    if(oColumn.formatter && (child.formatter === undefined)) {
+                        child.formatter = oColumn.formatter;
+                    }
+                    if(oColumn.resizeable && (child.resizeable === undefined)) {
+                        child.resizeable = oColumn.resizeable;
+                    }
+                    if(oColumn.sortable && (child.sortable === undefined)) {
+                        child.sortable = oColumn.sortable;
+                    }
+                    if(oColumn.width && (child.width === undefined)) {
+                        child.width = oColumn.width;
+                    }
+                    // Backward compatibility
+                    if(oColumn.type && (child.type === undefined)) {
+                        child.type = oColumn.type;
+                    }
+                    if(oColumn.type && !oColumn.formatter) {
+                        oColumn.formatter = oColumn.type;
+                    }
+                    if(oColumn.text && !YAHOO.lang.isValue(oColumn.label)) {
+                        oColumn.label = oColumn.text;
+                    }
+                    if(oColumn.parser) {
+                    }
+                    if(oColumn.sortOptions && ((oColumn.sortOptions.ascFunction) ||
+                            (oColumn.sortOptions.descFunction))) {
+                    }
+                }
+
+                // The children themselves must also be parsed for Column instances
+                if(!tree[nodeDepth+1]) {
+                    tree[nodeDepth+1] = [];
+                }
+                parseColumns(currentChildren, oColumn);
+            }
+            // This Column does not have any children
+            else {
+                oColumn._nKeyIndex = keys.length;
+                oColumn._colspan = 1;
+                keys.push(oColumn);
+            }
+
+            // Add the Column to the top-down tree
+            tree[nodeDepth].push(oColumn);
+        }
+        nodeDepth--;
+    };
+
+    // Parse out Column instances from the array of object literals
+    if(YAHOO.lang.isArray(aHeaders)) {
+        parseColumns(aHeaders);
+    }
+
+    // Determine ROWSPAN value for each Column in the tree
+    var parseTreeForRowspan = function(tree) {
+        var maxRowDepth = 1;
+        var currentRow;
+        var currentColumn;
+
+        // Calculate the max depth of descendants for this row
+        var countMaxRowDepth = function(row, tmpRowDepth) {
+            tmpRowDepth = tmpRowDepth || 1;
+
+            for(var n=0; n<row.length; n++) {
+                var col = row[n];
+                // Column has children, so keep counting
+                if(YAHOO.lang.isArray(col.children)) {
+                    tmpRowDepth++;
+                    countMaxRowDepth(col.children, tmpRowDepth);
+                    tmpRowDepth--;
+                }
+                // No children, is it the max depth?
+                else {
+                    if(tmpRowDepth > maxRowDepth) {
+                        maxRowDepth = tmpRowDepth;
+                    }
+                }
+
+            }
+        };
+
+        // Count max row depth for each row
+        for(var m=0; m<tree.length; m++) {
+            currentRow = tree[m];
+            countMaxRowDepth(currentRow);
+
+            // Assign the right ROWSPAN values to each Column in the row
+            for(var p=0; p<currentRow.length; p++) {
+                currentColumn = currentRow[p];
+                if(!YAHOO.lang.isArray(currentColumn.children)) {
+                    currentColumn._rowspan = maxRowDepth;
+                }
+                else {
+                    currentColumn._rowspan = 1;
+                }
+            }
+
+            // Reset counter for next row
+            maxRowDepth = 1;
+        }
+    };
+    parseTreeForRowspan(tree);
+
+
+
+
+
+    // Store header relationships in an array for HEADERS attribute
+    var recurseAncestorsForHeaders = function(i, oColumn) {
+        headers[i].push(oColumn._nId);
+        if(oColumn.parent) {
+            recurseAncestorsForHeaders(i, oColumn.parent);
+        }
+    };
+    for(var i=0; i<keys.length; i++) {
+        headers[i] = [];
+        recurseAncestorsForHeaders(i, keys[i]);
+        headers[i] = headers[i].reverse();
+        headers[i] = headers[i].join(" ");
+    }
+
+    // Save to the ColumnSet instance
+    this.tree = tree;
+    this.flat = flat;
+    this.keys = keys;
+    this.headers = headers;
+
+    YAHOO.widget.ColumnSet._nCount++;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class variable to index multiple data table instances.
+ *
+ * @property ColumnSet._nCount
+ * @type number
+ * @private
+ * @static
+ */
+YAHOO.widget.ColumnSet._nCount = 0;
+
+/**
+ * Unique instance name.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.ColumnSet.prototype._sName = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Top-down tree representation of Column hierarchy.
+ *
+ * @property tree
+ * @type YAHOO.widget.Column[]
+ */
+YAHOO.widget.ColumnSet.prototype.tree = null;
+
+/**
+ * Flattened representation of all Columns.
+ *
+ * @property flat
+ * @type YAHOO.widget.Column[]
+ * @default []
+ */
+YAHOO.widget.ColumnSet.prototype.flat = null;
+
+/**
+ * Array of Columns that map one-to-one to a table column.
+ *
+ * @property keys
+ * @type YAHOO.widget.Column[]
+ * @default []
+ */
+YAHOO.widget.ColumnSet.prototype.keys = null;
+
+/**
+ * ID index of nested parent hierarchies for HEADERS accessibility attribute.
+ *
+ * @property headers
+ * @type String[]
+ * @default []
+ */
+YAHOO.widget.ColumnSet.prototype.headers = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Public accessor to the unique name of the ColumnSet instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the ColumnSet instance.
+ */
+
+YAHOO.widget.ColumnSet.prototype.toString = function() {
+    return "ColumnSet " + this._sName;
+};
+
+/**
+ * Returns Column instance with given ID number or key.
+ *
+ * @method getColumn
+ * @param column {Number | String} ID number or unique key.
+ * @return {YAHOO.widget.Column} Column instance.
+ */
+
+YAHOO.widget.ColumnSet.prototype.getColumn = function(column) {
+    var allColumns = this.flat;
+    if(YAHOO.lang.isNumber(column)) {
+        for(var i=0; i<allColumns.length; i++) {
+            if(allColumns[i]._nId === column) {
+                return allColumns[i];
+            }
+        }
+    }
+    else if(YAHOO.lang.isString(column)) {
+        for(i=0; i<allColumns.length; i++) {
+            if(allColumns[i].key === column) {
+                return allColumns[i];
+            }
+        }
+    }
+    return null;
+};
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The Column class defines and manages attributes of DataTable Columns
+ *
+ * @namespace YAHOO.widget
+ * @class Column
+ * @constructor
+ * @param oConfigs {Object} Object literal of configuration values.
+ */
+YAHOO.widget.Column = function(oConfigs) {
+    // Internal variables
+    this._nId = YAHOO.widget.Column._nCount;
+    this._sName = "Column instance" + this._nId;
+
+    // Object literal defines Column attributes
+    if(oConfigs && (oConfigs.constructor == Object)) {
+        for(var sConfig in oConfigs) {
+            if(sConfig) {
+                this[sConfig] = oConfigs[sConfig];
+            }
+        }
+    }
+
+    if(!YAHOO.lang.isValue(this.key)) {
+        this.key = "yui-dt-column"+this._nId;
+    }
+    YAHOO.widget.Column._nCount++;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal instance counter.
+ *
+ * @property Column._nCount
+ * @type Number
+ * @private
+ * @static
+ * @default 0
+ */
+YAHOO.widget.Column._nCount = 0;
+
+/**
+ * Unique instance name.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.Column.prototype._sName = null;
+
+
+/**
+ * Unique number assigned at instantiation, indicates original order within
+ * ColumnSet.
+ *
+ * @property _nId
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._nId = null;
+
+/**
+ * Reference to Column's index within its ColumnSet's keys array, or null if not applicable.
+ *
+ * @property _nKeyIndex
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._nKeyIndex = null;
+
+/**
+ * Number of table cells the Column spans.
+ *
+ * @property _colspan
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._colspan = 1;
+
+/**
+ * Number of table rows the Column spans.
+ *
+ * @property _rowspan
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._rowspan = 1;
+
+/**
+ * Column's parent Column instance, or null.
+ *
+ * @property _parent
+ * @type YAHOO.widget.Column
+ * @private
+ */
+YAHOO.widget.Column.prototype._parent = null;
+
+/**
+ * Current offsetWidth of the Column (in pixels).
+ *
+ * @property _width
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._width = null;
+
+/**
+ * Minimum width the Column can support (in pixels). Value is populated only if table
+ * is fixedWidth, null otherwise.
+ *
+ * @property _minWidth
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Column.prototype._minWidth = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Associated database field, or null.
+ *
+ * @property key
+ * @type String
+ */
+YAHOO.widget.Column.prototype.key = null;
+
+/**
+ * Text or HTML for display as Column's label in the TH element.
+ *
+ * @property label
+ * @type String
+ */
+YAHOO.widget.Column.prototype.label = null;
+
+/**
+ * Column head cell ABBR for accessibility.
+ *
+ * @property abbr
+ * @type String
+ */
+YAHOO.widget.Column.prototype.abbr = null;
+
+/**
+ * Array of object literals that define children (nested headers) of a Column.
+ *
+ * @property children
+ * @type Object[]
+ */
+YAHOO.widget.Column.prototype.children = null;
+
+/**
+ * Column width.
+ *
+ * @property width
+ * @type String
+ */
+YAHOO.widget.Column.prototype.width = null;
+
+/**
+ * Custom CSS class or array of classes to be applied to every cell in the Column.
+ *
+ * @property className
+ * @type String || String[]
+ */
+YAHOO.widget.Column.prototype.className = null;
+
+/**
+ * Defines a format function.
+ *
+ * @property formatter
+ * @type String || HTMLFunction
+ */
+YAHOO.widget.Column.prototype.formatter = null;
+
+/**
+ * Defines an editor function, otherwise Column is not editable.
+ *
+ * @property editor
+ * @type String || HTMLFunction
+ */
+YAHOO.widget.Column.prototype.editor = null;
+
+/**
+ * Defines editor options for Column in an object literal of param:value pairs.
+ *
+ * @property editorOptions
+ * @type Object
+ */
+YAHOO.widget.Column.prototype.editorOptions = null;
+
+/**
+ * True if Column is resizeable, false otherwise.
+ *
+ * @property resizeable
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.Column.prototype.resizeable = false;
+
+/**
+ * True if Column is sortable, false otherwise.
+ *
+ * @property sortable
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.Column.prototype.sortable = false;
+
+/**
+ * Default sort order for Column: "asc" or "desc".
+ *
+ * @property sortOptions.defaultOrder
+ * @type String
+ * @default null
+ */
+/**
+ * Custom sort handler.
+ *
+ * @property sortOptions.sortFunction
+ * @type Function
+ * @default null
+ */
+YAHOO.widget.Column.prototype.sortOptions = null;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Public accessor to the unique name of the Column instance.
+ *
+ * @method toString
+ * @return {String} Column's unique name.
+ */
+YAHOO.widget.Column.prototype.toString = function() {
+    return this._sName;
+};
+
+/**
+ * Returns unique number assigned at instantiation, indicates original order
+ * within ColumnSet.
+ *
+ * @method getId
+ * @return {Number} Column's unique ID number.
+ */
+YAHOO.widget.Column.prototype.getId = function() {
+    return this._nId;
+};
+
+/**
+ * Public accessor returns Column's key index within its ColumnSet's keys array, or
+ * null if not applicable.
+ *
+ * @method getKeyIndex
+ * @return {Number} Column's key index within its ColumnSet keys array, if applicable.
+ */
+YAHOO.widget.Column.prototype.getKeyIndex = function() {
+    return this._nKeyIndex;
+};
+
+/**
+ * Public accessor returns Column's parent instance if any, or null otherwise.
+ *
+ * @method getParent
+ * @return {YAHOO.widget.Column} Column's parent instance.
+ */
+YAHOO.widget.Column.prototype.getParent = function() {
+    return this._parent;
+};
+
+/**
+ * Public accessor returns Column's calculated COLSPAN value.
+ *
+ * @method getColspan
+ * @return {Number} Column's COLSPAN value.
+ */
+YAHOO.widget.Column.prototype.getColspan = function() {
+    return this._colspan;
+};
+// Backward compatibility
+YAHOO.widget.Column.prototype.getColSpan = function() {
+    return this.getColspan();
+};
+
+/**
+ * Public accessor returns Column's calculated ROWSPAN value.
+ *
+ * @method getRowspan
+ * @return {Number} Column's ROWSPAN value.
+ */
+YAHOO.widget.Column.prototype.getRowspan = function() {
+    return this._rowspan;
+};
+
+// Backward compatibility
+YAHOO.widget.Column.prototype.getIndex = function() {
+    return this.getKeyIndex();
+};
+YAHOO.widget.Column.prototype.format = function() {
+};
+YAHOO.widget.Column.formatCheckbox = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.widget.DataTable.formatCheckbox(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatCurrency = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.widget.DataTable.formatCurrency(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatDate = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.widget.DataTable.formatDate(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatEmail = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.widget.DataTable.formatEmail(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatLink = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.widget.DataTable.formatLink(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatNumber = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.widget.DataTable.formatNumber(elCell, oRecord, oColumn, oData);
+};
+YAHOO.widget.Column.formatSelect = function(elCell, oRecord, oColumn, oData) {
+    YAHOO.widget.DataTable.formatDropdown(elCell, oRecord, oColumn, oData);
+};
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * Sort static utility to support Column sorting.
+ *
+ * @namespace YAHOO.util
+ * @class Sort
+ * @static
+ */
+YAHOO.util.Sort = {
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Comparator function for simple case-insensitive string sorting.
+     *
+     * @method compare
+     * @param a {Object} First sort argument.
+     * @param b {Object} Second sort argument.
+     * @param desc {Boolean} True if sort direction is descending, false if
+     * sort direction is ascending.
+     */
+    compare: function(a, b, desc) {
+        if((a === null) || (typeof a == "undefined")) {
+            if((b === null) || (typeof b == "undefined")) {
+                return 0;
+            }
+            else {
+                return 1;
+            }
+        }
+        else if((b === null) || (typeof b == "undefined")) {
+            return -1;
+        }
+
+        if(a.constructor == String) {
+            a = a.toLowerCase();
+        }
+        if(b.constructor == String) {
+            b = b.toLowerCase();
+        }
+        if(a < b) {
+            return (desc) ? 1 : -1;
+        }
+        else if (a > b) {
+            return (desc) ? -1 : 1;
+        }
+        else {
+            return 0;
+        }
+    }
+};
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * ColumnResizer subclasses DragDrop to support resizeable Columns.
+ *
+ * @namespace YAHOO.util
+ * @class ColumnResizer
+ * @extends YAHOO.util.DragDrop
+ * @constructor
+ * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.
+ * @param oColumn {YAHOO.widget.Column} Column instance.
+ * @param elThead {HTMLElement} TH element reference.
+ * @param sHandleElId {String} DOM ID of the handle element that causes the resize.
+ * @param sGroup {String} Group name of related DragDrop items.
+ * @param oConfig {Object} (Optional) Object literal of config values.
+ */
+YAHOO.util.ColumnResizer = function(oDataTable, oColumn, elThead, sHandleId, sGroup, oConfig) {
+    if(oDataTable && oColumn && elThead && sHandleId) {
+        this.datatable = oDataTable;
+        this.column = oColumn;
+        this.cell = elThead;
+        this.init(sHandleId, sGroup, oConfig);
+        //this.initFrame();
+        this.setYConstraint(0,0);
+    }
+    else {
+    }
+};
+
+if(YAHOO.util.DD) {
+    YAHOO.extend(YAHOO.util.ColumnResizer, YAHOO.util.DD);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public DOM event handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Handles mousedown events on the Column resizer.
+ *
+ * @method onMouseDown
+ * @param e {string} The mousedown event
+ */
+YAHOO.util.ColumnResizer.prototype.onMouseDown = function(e) {
+    this.startWidth = this.cell.offsetWidth;
+    this.startPos = YAHOO.util.Dom.getX(this.getDragEl());
+
+    if(this.datatable.fixedWidth) {
+        var cellLabel = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",this.cell)[0];
+        this.minWidth = cellLabel.offsetWidth + 6;
+        var sib = this.cell.nextSibling;
+        var sibCellLabel = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.DataTable.CLASS_LABEL,"span",sib)[0];
+        this.sibMinWidth = sibCellLabel.offsetWidth + 6;
+//!!
+        var left = ((this.startWidth - this.minWidth) < 0) ? 0 : (this.startWidth - this.minWidth);
+        var right = ((sib.offsetWidth - this.sibMinWidth) < 0) ? 0 : (sib.offsetWidth - this.sibMinWidth);
+        this.setXConstraint(left, right);
+    }
+
+};
+
+/**
+ * Handles mouseup events on the Column resizer.
+ *
+ * @method onMouseUp
+ * @param e {string} The mouseup event
+ */
+YAHOO.util.ColumnResizer.prototype.onMouseUp = function(e) {
+    //TODO: replace the resizer where it belongs:
+    var resizeStyle = YAHOO.util.Dom.get(this.handleElId).style;
+    resizeStyle.left = "auto";
+    resizeStyle.right = 0;
+    resizeStyle.marginRight = "-6px";
+    resizeStyle.width = "6px";
+    //.yui-dt-headresizer {position:absolute;margin-right:-6px;right:0;bottom:0;width:6px;height:100%;cursor:w-resize;cursor:col-resize;}
+
+
+    //var cells = this.datatable._elTable.tHead.rows[this.datatable._elTable.tHead.rows.length-1].cells;
+    //for(var i=0; i<cells.length; i++) {
+        //cells[i].style.width = "5px";
+    //}
+
+    //TODO: set new ColumnSet width values
+    this.datatable.fireEvent("columnResizeEvent", {column:this.column,target:this.cell});
+};
+
+/**
+ * Handles drag events on the Column resizer.
+ *
+ * @method onDrag
+ * @param e {string} The drag event
+ */
+YAHOO.util.ColumnResizer.prototype.onDrag = function(e) {
+    var newPos = YAHOO.util.Dom.getX(this.getDragEl());
+    var offsetX = newPos - this.startPos;
+    var newWidth = this.startWidth + offsetX;
+
+    if(newWidth < this.minWidth) {
+        newWidth = this.minWidth;
+    }
+
+    // Resize the Column
+    var oDataTable = this.datatable;
+    var elCell = this.cell;
+
+
+    // Resize the other Columns
+    if(oDataTable.fixedWidth) {
+        // Moving right or left?
+        var sib = elCell.nextSibling;
+        //var sibIndex = elCell.index + 1;
+        var sibnewwidth = sib.offsetWidth - offsetX;
+        if(sibnewwidth < this.sibMinWidth) {
+            sibnewwidth = this.sibMinWidth;
+        }
+
+        //TODO: how else to cycle through all the Columns without having to use an index property?
+        for(var i=0; i<oDataTable._oColumnSet.length; i++) {
+            //if((i != elCell.index) &&  (i!=sibIndex)) {
+            //    YAHOO.util.Dom.get(oDataTable._oColumnSet.keys[i].id).style.width = oDataTable._oColumnSet.keys[i].width + "px";
+            //}
+        }
+        sib.style.width = sibnewwidth;
+        elCell.style.width = newWidth + "px";
+        //oDataTable._oColumnSet.flat[sibIndex].width = sibnewwidth;
+        //oDataTable._oColumnSet.flat[elCell.index].width = newWidth;
+
+    }
+    else {
+        elCell.style.width = newWidth + "px";
+    }
+};
+
+
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * A RecordSet defines and manages a set of Records.
+ *
+ * @namespace YAHOO.widget
+ * @class RecordSet
+ * @param data {Object || Object[]} An object literal or an array of data.
+ * @constructor
+ */
+YAHOO.widget.RecordSet = function(data) {
+    // Internal variables
+    this._sName = "RecordSet instance" + YAHOO.widget.RecordSet._nCount;
+    YAHOO.widget.RecordSet._nCount++;
+    this._records = [];
+    this._length = 0;
+    
+    if(data) {
+        if(YAHOO.lang.isArray(data)) {
+            this.addRecords(data);
+        }
+        else if(data.constructor == Object) {
+            this.addRecord(data);
+        }
+    }
+
+    /**
+     * Fired when a new Record is added to the RecordSet.
+     *
+     * @event recordAddEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.data {Object} Data added.
+     */
+    this.createEvent("recordAddEvent");
+
+    /**
+     * Fired when multiple Records are added to the RecordSet at once.
+     *
+     * @event recordsAddEvent
+     * @param oArgs.records {YAHOO.widget.Record[]} An array of Record instances.
+     * @param oArgs.data {Object[]} Data added.
+     */
+    this.createEvent("recordsAddEvent");
+
+    /**
+     * Fired when a Record is updated with new data.
+     *
+     * @event recordUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.newData {Object} New data.
+     * @param oArgs.oldData {Object} Old data.
+     */
+    this.createEvent("recordUpdateEvent");
+    
+    /**
+     * Fired when a Record is deleted from the RecordSet.
+     *
+     * @event recordDeleteEvent
+     * @param oArgs.data {Object} A copy of the data held by the Record,
+     * or an array of data object literals if multiple Records were deleted at once.
+     * @param oArgs.index {Object} Index of the deleted Record.
+     */
+    this.createEvent("recordDeleteEvent");
+
+    /**
+     * Fired when multiple Records are deleted from the RecordSet at once.
+     *
+     * @event recordsDeleteEvent
+     * @param oArgs.data {Object[]} An array of data object literals copied
+     * from the Records.
+     * @param oArgs.index {Object} Index of the first deleted Record.
+     */
+    this.createEvent("recordsDeleteEvent");
+    
+    /**
+     * Fired when all Records are deleted from the RecordSet at once.
+     *
+     * @event resetEvent
+     */
+    this.createEvent("resetEvent");
+
+    /**
+     * Fired when a Record Key is updated with new data.
+     *
+     * @event keyUpdateEvent
+     * @param oArgs.record {YAHOO.widget.Record} The Record instance.
+     * @param oArgs.key {String} The updated key.
+     * @param oArgs.newData {Object} New data.
+     * @param oArgs.oldData {Object} Old data.
+     *
+     */
+    this.createEvent("keyUpdateEvent");
+
+};
+
+if(YAHOO.util.EventProvider) {
+    YAHOO.augment(YAHOO.widget.RecordSet, YAHOO.util.EventProvider);
+}
+else {
+}
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+/**
+ * Internal class variable to name multiple Recordset instances.
+ *
+ * @property RecordSet._nCount
+ * @type Number
+ * @private
+ * @static
+ */
+YAHOO.widget.RecordSet._nCount = 0;
+
+/**
+ * Unique instance name.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.RecordSet.prototype._sName = null;
+
+/**
+ * Internal variable to give unique indexes to Record instances.
+ *
+ * @property _nCount
+ * @type Number
+ * @private
+ */
+YAHOO.widget.RecordSet.prototype._nRecordCount = 0;
+
+/**
+ * Internal counter of how many Records are in the RecordSet.
+ *
+ * @property _length
+ * @type Number
+ * @private
+ */
+YAHOO.widget.RecordSet.prototype._length = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Adds one Record to the RecordSet at the given index. If index is null,
+ * then adds the Record to the end of the RecordSet.
+ *
+ * @method _addRecord
+ * @param oData {Object} An object literal of data.
+ * @param index {Number} (optional) Position index.
+ * @return {YAHOO.widget.Record} A Record instance.
+ * @private
+ */
+YAHOO.widget.RecordSet.prototype._addRecord = function(oData, index) {
+    var oRecord = new YAHOO.widget.Record(oData);
+    oRecord._nId = this._nRecordCount;
+    this._nRecordCount++;
+    
+    if(YAHOO.lang.isNumber(index) && (index > -1)) {
+        this._records.splice(index,0,oRecord);
+    }
+    else {
+        index = this.getLength();
+        this._records.push(oRecord);
+    }
+    this._length++;
+    return oRecord;
+};
+
+/**
+ * Deletes Records from the RecordSet at the given index. If range is null,
+ * then only one Record is deleted.
+ *
+ * @method _deleteRecord
+ * @param index {Number} Position index.
+ * @param range {Number} (optional) How many Records to delete
+ * @private
+ */
+YAHOO.widget.RecordSet.prototype._deleteRecord = function(index, range) {
+    if(!YAHOO.lang.isNumber(range) || (range < 0)) {
+        range = 1;
+    }
+    this._records.splice(index, range);
+    this._length = this._length - range;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Public accessor to the unique name of the RecordSet instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the RecordSet instance.
+ */
+YAHOO.widget.RecordSet.prototype.toString = function() {
+    return this._sName;
+};
+
+/**
+ * Returns the number of Records held in the RecordSet.
+ *
+ * @method getLength
+ * @return {Number} Number of records in the RecordSet.
+ */
+YAHOO.widget.RecordSet.prototype.getLength = function() {
+        return this._length;
+};
+
+/**
+ * Returns Record at given position index.
+ *
+ * @method getRecord
+ * @param index {Number} Record's Recordset position index.
+ * @return {YAHOO.widget.Record} Record object.
+ */
+YAHOO.widget.RecordSet.prototype.getRecord = function(index) {
+    if(YAHOO.lang.isNumber(index)) {
+        return this._records[index];
+    }
+    /*else if(YAHOO.lang.isString(identifier)) {
+        for(var i=0; i<this._records.length; i++) {
+            if(this._records[i].yuiRecordId == identifier) {
+                return this._records[i];
+            }
+        }
+    }*/
+    return null;
+
+};
+
+/*
+ * Returns an array of Records from the RecordSet.
+ *
+ * @method getRecords
+ * @param index {Number} (optional) Recordset position index of which Record to
+ * start at.
+ * @param range {Number} (optional) Number of Records to get.
+ * @return {YAHOO.widget.Record[]} Array of Records starting at given index and
+ * length equal to given range. If index is not given, all Records are returned.
+ */
+YAHOO.widget.RecordSet.prototype.getRecords = function(index, range) {
+    if(!YAHOO.lang.isNumber(index)) {
+        return this._records;
+    }
+    if(!YAHOO.lang.isNumber(range)) {
+        return this._records.slice(index);
+    }
+    return this._records.slice(index, index+range);
+};
+
+/**
+ * Returns position index for the given Record.
+ *
+ * @method getRecordIndex
+ * @param oRecord {YAHOO.widget.Record} Record instance.
+ * @return {Number} Record's RecordSet position index.
+ */
+
+YAHOO.widget.RecordSet.prototype.getRecordIndex = function(oRecord) {
+    for(var i=this._records.length-1; i>-1; i--) {
+        if(oRecord.getId() === this._records[i].getId()) {
+            return i;
+        }
+    }
+    return null;
+
+};
+
+/**
+ * Adds one Record to the RecordSet at the given index. If index is null,
+ * then adds the Record to the end of the RecordSet.
+ *
+ * @method addRecord
+ * @param oData {Object} An object literal of data.
+ * @param index {Number} (optional) Position index.
+ * @return {YAHOO.widget.Record} A Record instance.
+ */
+YAHOO.widget.RecordSet.prototype.addRecord = function(oData, index) {
+    if(oData && (oData.constructor == Object)) {
+        var oRecord = this._addRecord(oData, index);
+        this.fireEvent("recordAddEvent",{record:oRecord,data:oData});
+        return oRecord;
+    }
+    else {
+        return null;
+    }
+};
+
+/**
+ * Adds multiple Records at once to the RecordSet at the given index with the
+ * given data. If index is null, then the new Records are added to the end of
+ * the RecordSet.
+ *
+ * @method addRecords
+ * @param aData {Object[]} An array of object literal data.
+ * @param index {Number} (optional) Position index.
+ * @return {YAHOO.widget.Record[]} An array of Record instances.
+ */
+YAHOO.widget.RecordSet.prototype.addRecords = function(aData, index) {
+    if(YAHOO.lang.isArray(aData)) {
+        var newRecords = [];
+        // Can't go backwards bc we need to preserve order
+        for(var i=0; i<aData.length; i++) {
+            if(aData[i] && (aData[i].constructor == Object)) {
+                var record = this._addRecord(aData[i], index);
+                newRecords.push(record);
+            }
+       }
+        this.fireEvent("recordsAddEvent",{records:newRecords,data:aData});
+       return newRecords;
+    }
+    else if(aData && (aData.constructor == Object)) {
+        var oRecord = this._addRecord(aData);
+        this.fireEvent("recordsAddEvent",{records:[oRecord],data:aData});
+        return oRecord;
+    }
+    else {
+    }
+};
+
+/**
+ * Updates given Record with given data.
+ *
+ * @method updateRecord
+ * @param record {YAHOO.widget.Record | Number} A Record instance, or Record's
+ * RecordSet position index.
+ * @param oData {Object) Object literal of new data.
+ * @return {YAHOO.widget.Record} Updated Record, or null.
+ */
+YAHOO.widget.RecordSet.prototype.updateRecord = function(record, oData) {
+    var oRecord = null;
+    if(YAHOO.lang.isNumber(record)) {
+        oRecord = this._records[record];
+    }
+    else if(record instanceof YAHOO.widget.Record) {
+        oRecord = record;
+    }
+    if(oRecord && oData && (oData.constructor == Object)) {
+        // Copy data from the Record for the event that gets fired later
+        var oldData = {};
+        for(var key in oRecord._oData) {
+            oldData[key] = oRecord._oData[key];
+        }
+        oRecord._oData = oData;
+        this.fireEvent("recordUpdateEvent",{record:oRecord,newData:oData,oldData:oldData});
+        return oRecord;
+    }
+    else {
+        return null;
+    }
+};
+
+/**
+ * Updates given Record at given key with given data.
+ *
+ * @method updateKey
+ * @param record {YAHOO.widget.Record | Number} A Record instance, or Record's
+ * RecordSet position index.
+ * @param sKey {String} Key name.
+ * @param oData {Object) New data.
+ */
+YAHOO.widget.RecordSet.prototype.updateKey = function(record, sKey, oData) {
+    var oRecord;
+    
+    if(YAHOO.lang.isNumber(record)) {
+        oRecord = this._records[record];
+    }
+    if(record instanceof YAHOO.widget.Record) {
+        oRecord = record;
+
+        var oldData = null;
+        var keyValue = oRecord._oData[sKey];
+        // Copy data from the Record for the event that gets fired later
+        if(keyValue && keyValue.constructor == Object) {
+            oldData = {};
+            for(var key in keyValue) {
+                oldData[key] = keyValue[key];
+            }
+        }
+        // Copy by value
+        else {
+            oldData = keyValue;
+        }
+
+        oRecord._oData[sKey] = oData;
+        this.fireEvent("keyUpdateEvent",{record:oRecord,key:sKey,newData:oData,oldData:oldData});
+    }
+    else {
+    }
+};
+
+/**
+ * Replaces all Records in RecordSet with new data.
+ *
+ * @method replaceRecords
+ * @param data {Object || Object[]} An object literal of data or an array of
+ * object literal data.
+ * @return {YAHOO.widget.Record || YAHOO.widget.Record[]} A Record instance or
+ * an array of Records.
+ */
+YAHOO.widget.RecordSet.prototype.replaceRecords = function(data) {
+    this.reset();
+    return this.addRecords(data);
+};
+
+/**
+ * Sorts all Records by given function.
+ *
+ * @method sortRecords
+ * @param fnSort {Function} Reference to a sort function.
+ * @param desc {Boolean} True if sort direction is descending, false if sort
+ * direction is ascending.
+ * @return {YAHOO.widget.Record[]} Sorted array of Records.
+ */
+YAHOO.widget.RecordSet.prototype.sortRecords = function(fnSort, desc) {
+    return this._records.sort(function(a, b) {return fnSort(a, b, desc);});
+};
+
+
+/**
+ * Removes the Record at the given position index from the RecordSet. If a range
+ * is also provided, removes that many Records, starting from the index. Length
+ * of RecordSet is correspondingly shortened.
+ *
+ * @method deleteRecord
+ * @param index {Number} Record's RecordSet position index.
+ * @param range {Number} (optional) How many Records to delete.
+ * @return {Object} A copy of the data held by the deleted Record.
+ */
+YAHOO.widget.RecordSet.prototype.deleteRecord = function(index) {
+    if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
+        // Copy data from the Record for the event that gets fired later
+        var oRecordData = this.getRecord(index).getData();
+        var oData = {};
+        for(var key in oRecordData) {
+            oData[key] = oRecordData[key];
+        }
+        
+        this._deleteRecord(index);
+        this.fireEvent("recordDeleteEvent",{data:oData,index:index});
+        return oData;
+    }
+    else {
+        return null;
+    }
+};
+
+/**
+ * Removes the Record at the given position index from the RecordSet. If a range
+ * is also provided, removes that many Records, starting from the index. Length
+ * of RecordSet is correspondingly shortened.
+ *
+ * @method deleteRecords
+ * @param index {Number} Record's RecordSet position index.
+ * @param range {Number} (optional) How many Records to delete.
+ */
+YAHOO.widget.RecordSet.prototype.deleteRecords = function(index, range) {
+    if(!YAHOO.lang.isNumber(range)) {
+        range = 1;
+    }
+    if(YAHOO.lang.isNumber(index) && (index > -1) && (index < this.getLength())) {
+        var recordsToDelete = this.getRecords(index, range);
+        // Copy data from each Record for the event that gets fired later
+        var deletedData = [];
+        for(var i=0; i<recordsToDelete.length; i++) {
+            var oData = {};
+            for(var key in recordsToDelete[i]) {
+                oData[key] = recordsToDelete[i][key];
+            }
+            deletedData.push(oData);
+        }
+        this._deleteRecord(index, range);
+
+        this.fireEvent("recordsDeleteEvent",{data:deletedData,index:index});
+
+    }
+    else {
+    }
+};
+
+/**
+ * Deletes all Records from the RecordSet.
+ *
+ * @method reset
+ */
+YAHOO.widget.RecordSet.prototype.reset = function() {
+    this._records = [];
+    this._length = 0;
+    this.fireEvent("resetEvent");
+};
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The Record class defines a DataTable record.
+ *
+ * @namespace YAHOO.widget
+ * @class Record
+ * @constructor
+ * @param oConfigs {Object} (optional) Object literal of key/value pairs.
+ */
+YAHOO.widget.Record = function(oLiteral) {
+    this._oData = {};
+    if(oLiteral && (oLiteral.constructor == Object)) {
+        for(var sKey in oLiteral) {
+            this._oData[sKey] = oLiteral[sKey];
+        }
+    }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+/**
+ * Unique number assigned at instantiation, indicates original order within
+ * RecordSet.
+ *
+ * @property _nId
+ * @type Number
+ * @private
+ */
+YAHOO.widget.Record.prototype._nId = null;
+
+/**
+ * Holds data for the Record in an object literal.
+ *
+ * @property _oData
+ * @type Object
+ * @private
+ */
+YAHOO.widget.Record.prototype._oData = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Returns unique number assigned at instantiation, indicates original order
+ * within RecordSet.
+ *
+ * @method getId
+ * @return Number
+ */
+YAHOO.widget.Record.prototype.getId = function() {
+    return this._nId;
+};
+
+/**
+ * Returns data for the Record for a key if given, or the entire object
+ * literal otherwise.
+ *
+ * @method getData
+ * @param sKey {String} (Optional) The key to retrieve a single data value.
+ * @return Object
+ */
+YAHOO.widget.Record.prototype.getData = function(sKey) {
+    if(YAHOO.lang.isString(sKey)) {
+        return this._oData[sKey];
+    }
+    else {
+        return this._oData;
+    }
+};
+
+
+YAHOO.register("datatable", YAHOO.widget.DataTable, {version: "2.3.0", build: "442"});
index 966543f589c5071faf0e591bfb24b514cf7939a9..777503c0896dc442475bec8b35248f77a8ca4fd4 100755 (executable)
@@ -1,5 +1,33 @@
 Dom Release Notes
 
+*** version 2.3.0 ***
+* added getAncestorBy methods
+* added getChildren methods
+* added getSibling methods
+* trimming added for class mgmt methods
+* fixed getXY inside table for Opera 
+
+** Known Issues **
+* margin/padding/borders on HTML element cause getXY to misreport
+* margin on BODY causes Safari to misreport getXY
+* Fixed postioning causes getXY to misreport in some cases
+
+*** version 2.2.2 ***
+
+* fixed getXY scroll regression
+
+*** version 2.2.1 ***
+* fixed toCamel propertyCache used by set/getStyle
+* added set/getStyle support for float property
+* optimized get() for common use case
+* fixed getXY for safari when el has absolute ancestors
+* using className property instead of string literal for class mgmt methods
+* added getXY/getRegion support for body element
+
+*** version 2.2.0 ***
+* no change
+
+
 *** version 0.12.2 ***
 * no change
 
index e9368d90fb255509b1a97c6e788ba438a73a02bb..b0e2283c53f6bfda0078ae10ea2b001f75c07f52 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 /**
  * The dom module provides helper methods for manipulating Dom elements.
@@ -15,23 +15,21 @@ version: 0.12.2
         getStyle,           // for load time browser branching
         setStyle,           // ditto
         id_counter = 0,     // for use with generateId
-        propertyCache = {}; // for faster hyphen converts
+        propertyCache = {}, // for faster hyphen converts
+        reClassNameCache = {}; // cache regexes for className
     
     // brower detection
-    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 isOpera = YAHOO.env.ua.opera,
+        isSafari = YAHOO.env.ua.webkit, 
+        isGecko = YAHOO.env.ua.gecko,
+        isIE = YAHOO.env.ua.ie; 
     
     // regex cache
     var patterns = {
-        HYPHEN: /(-[a-z])/i
+        HYPHEN: /(-[a-z])/i, // to normalize get/setStyle
+        ROOT_TAG: /^body|html$/i // body for quirks mode, html for standards
     };
 
-    var logger = {};
-    logger.log = function() { YAHOO.log.apply(window, arguments); };
-    
     var toCamel = function(property) {
         if ( !patterns.HYPHEN.test(property) ) {
             return property; // no hyphens
@@ -40,22 +38,37 @@ version: 0.12.2
         if (propertyCache[property]) { // already converted
             return propertyCache[property];
         }
-        
-        while( patterns.HYPHEN.exec(property) ) {
-            property = property.replace(RegExp.$1,
+       
+        var converted = property;
+        while( patterns.HYPHEN.exec(converted) ) {
+            converted = converted.replace(RegExp.$1,
                     RegExp.$1.substr(1).toUpperCase());
         }
         
-        propertyCache[property] = property;
-        return property;
+        propertyCache[property] = converted;
+        return converted;
         //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug
     };
     
+    var getClassRegEx = function(className) {
+        var re = reClassNameCache[className];
+        if (!re) {
+            re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
+            reClassNameCache[className] = re;
+        }
+        return re;
+    };
+
     // branching at load instead of runtime
     if (document.defaultView && document.defaultView.getComputedStyle) { // W3C DOM method
         getStyle = function(el, property) {
             var value = null;
             
+            if (property == 'float') { // fix reserved word
+                property = 'cssFloat';
+            }
+
             var computed = document.defaultView.getComputedStyle(el, '');
             if (computed) { // test computed before touching for safari
                 value = computed[toCamel(property)];
@@ -75,12 +88,13 @@ version: 0.12.2
                         try { // make sure its in the document
                             val = el.filters('alpha').opacity;
                         } catch(e) {
-                            logger.log('getStyle: IE filter failed',
+                            YAHOO.log('getStyle: IE filter failed',
                                     'error', 'Dom');
                         }
                     }
                     return val / 100;
-                    break;
+                case 'float': // fix reserved word
+                    property = 'styleFloat'; // fall through
                 default: 
                     // test currentStyle before touching
                     var value = el.currentStyle ? el.currentStyle[property] : null;
@@ -95,7 +109,7 @@ version: 0.12.2
         setStyle = function(el, property, val) {
             switch (property) {
                 case 'opacity':
-                    if ( typeof el.style.filter == 'string' ) { // in case not appended
+                    if ( YAHOO.lang.isString(el.style.filter) ) { // in case not appended
                         el.style.filter = 'alpha(opacity=' + val * 100 + ')';
                         
                         if (!el.currentStyle || !el.currentStyle.hasLayout) {
@@ -103,16 +117,25 @@ version: 0.12.2
                         }
                     }
                     break;
+                case 'float':
+                    property = 'styleFloat';
                 default:
                 el.style[property] = val;
             }
         };
     } else {
         setStyle = function(el, property, val) {
+            if (property == 'float') {
+                property = 'cssFloat';
+            }
             el.style[property] = val;
         };
     }
     
+    var testElement = function(node, method) {
+        return node && node.nodeType == 1 && ( !method || method(node) );
+    };
+
     /**
      * Provides helper methods for DOM elements.
      * @namespace YAHOO.util
@@ -126,29 +149,24 @@ version: 0.12.2
          * @return {HTMLElement | Array} A DOM reference to an HTML element or an array of HTMLElements.
          */
         get: function(el) {
-            if (!el) { return null; } // nothing to work with
-            
-            if (typeof el != 'string' && !(el instanceof Array) ) { // assuming HTMLElement or HTMLCollection, so pass back as is
-                logger.log('get(' + el + ') returning ' + el, 'info', 'Dom');
+            if (!el || el.tagName || el.item) { // null, HTMLElement, or HTMLCollection
                 return el;
             }
-            
-            if (typeof el == 'string') { // ID
-                logger.log('get("' + el + '") returning ' + document.getElementById(el), 'info', 'Dom');
+
+            if (YAHOO.lang.isString(el)) { // HTMLElement or null
                 return document.getElementById(el);
             }
-            else { // array of ID's and/or elements
-                var collection = [];
+            
+            if (el.splice) { // Array of HTMLElements/IDs
+                var c = [];
                 for (var i = 0, len = el.length; i < len; ++i) {
-                    collection[collection.length] = Y.Dom.get(el[i]);
+                    c[c.length] = Y.Dom.get(el[i]);
                 }
                 
-                logger.log('get("' + el + '") returning ' + collection, 'info', 'Dom');
-                return collection;
+                return c;
             }
 
-            logger.log('element ' + el + ' not found', 'error', 'Dom');
-            return null; // safety, should never happen
+            return el; // some other object, just pass it back
         },
     
         /**
@@ -180,7 +198,7 @@ version: 0.12.2
             
             var f = function(element) {
                 setStyle(element, property, val);
-                logger.log('setStyle setting ' + property + ' to ' + val, 'info', 'Dom');
+                YAHOO.log('setStyle setting ' + property + ' to ' + val, 'info', 'Dom');
                 
             };
             
@@ -197,66 +215,61 @@ version: 0.12.2
             var f = function(el) {
     
             // has to be part of document to have pageXY
-                if (el.parentNode === null || el.offsetParent === null ||
-                        this.getStyle(el, 'display') == 'none') {
-                    logger.log('getXY failed: element not available', 'error', 'Dom');
+                if ( (el.parentNode === null || el.offsetParent === null ||
+                        this.getStyle(el, 'display') == 'none') && el != document.body) {
+                    YAHOO.log('getXY failed: element not available', 'error', 'Dom');
                     return false;
                 }
                 
                 var parentNode = null;
                 var pos = [];
                 var box;
-                
+                var doc = el.ownerDocument; 
+
                 if (el.getBoundingClientRect) { // IE
                     box = el.getBoundingClientRect();
-                    var doc = document;
-                    if ( !this.inDocument(el) && parent.document != document) {// might be in a frame, need to get its scroll
-                        doc = parent.document;
-
-                        if ( !this.isAncestor(doc.documentElement, el) ) {
-                            logger.log('getXY failed: element not available', 'error', 'Dom');
-                            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];
+                    return [box.left + Y.Dom.getDocumentScrollLeft(el.ownerDocument), box.top + Y.Dom.getDocumentScrollTop(el.ownerDocument)];
                 }
                 else { // safari, opera, & gecko
                     pos = [el.offsetLeft, el.offsetTop];
                     parentNode = el.offsetParent;
+
+                    // safari: if el is abs or any parent is abs, subtract body offsets
+                    var hasAbs = this.getStyle(el, 'position') == 'absolute';
+
                     if (parentNode != el) {
                         while (parentNode) {
                             pos[0] += parentNode.offsetLeft;
                             pos[1] += parentNode.offsetTop;
+                            if (isSafari && !hasAbs && 
+                                    this.getStyle(parentNode,'position') == 'absolute' ) {
+                                hasAbs = true; // we need to offset if any parent is absolutely positioned
+                            }
                             parentNode = parentNode.offsetParent;
                         }
                     }
-                    if (isSafari && this.getStyle(el, 'position') == 'absolute' ) { // safari doubles in some cases
-                        pos[0] -= document.body.offsetLeft;
-                        pos[1] -= document.body.offsetTop;
+
+                    if (isSafari && hasAbs) { //safari doubles in this case
+                        pos[0] -= el.ownerDocument.body.offsetLeft;
+                        pos[1] -= el.ownerDocument.body.offsetTop;
                     } 
                 }
                 
-                if (el.parentNode) { parentNode = el.parentNode; }
-                else { parentNode = null; }
-        
-                while (parentNode && parentNode.tagName.toUpperCase() != 'BODY' && parentNode.tagName.toUpperCase() != 'HTML') 
-                { // account for any scrolled ancestors
-                    if (Y.Dom.getStyle(parentNode, 'display') != 'inline') { // work around opera inline scrollLeft/Top bug
+                parentNode = el.parentNode;
+
+                // account for any scrolled ancestors
+                while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) ) 
+                {
+                   // work around opera inline/table scrollLeft/Top bug
+                   if (Y.Dom.getStyle(parentNode, 'display').search(/^inline|table-row.*$/i)) { 
                         pos[0] -= parentNode.scrollLeft;
                         pos[1] -= parentNode.scrollTop;
                     }
                     
-                    if (parentNode.parentNode) {
-                        parentNode = parentNode.parentNode; 
-                    } else { parentNode = null; }
+                    parentNode = parentNode.parentNode; 
                 }
-        
-                logger.log('getXY returning ' + pos, 'info', 'Dom');
+       
+                YAHOO.log('getXY returning ' + pos, 'info', 'Dom');
                 
                 return pos;
             };
@@ -268,7 +281,7 @@ version: 0.12.2
          * 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).
          * @method getX
          * @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
-         * @return {String | Array} The X position of the element(s)
+         * @return {Number | Array} The X position of the element(s)
          */
         getX: function(el) {
             var f = function(el) {
@@ -282,7 +295,7 @@ version: 0.12.2
          * 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).
          * @method getY
          * @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
-         * @return {String | Array} The Y position of the element(s)
+         * @return {Number | Array} The Y position of the element(s)
          */
         getY: function(el) {
             var f = function(el) {
@@ -310,7 +323,7 @@ version: 0.12.2
 
                 var pageXY = this.getXY(el);
                 if (pageXY === false) { // has to be part of doc to have pageXY
-                    logger.log('setXY failed: element not available', 'error', 'Dom');
+                    YAHOO.log('setXY failed: element not available', 'error', 'Dom');
                     return false; 
                 }
                 
@@ -339,7 +352,7 @@ version: 0.12.2
                    }
                 }        
         
-                logger.log('setXY setting position to ' + pos, 'info', 'Dom');
+                YAHOO.log('setXY setting position to ' + pos, 'info', 'Dom');
             };
             
             Y.Dom.batch(el, f, Y.Dom, true);
@@ -376,8 +389,14 @@ version: 0.12.2
          */
         getRegion: function(el) {
             var f = function(el) {
-                var region = new Y.Region.getRegion(el);
-                logger.log('getRegion returning ' + region, 'info', 'Dom');
+                if ( (el.parentNode === null || el.offsetParent === null ||
+                        this.getStyle(el, 'display') == 'none') && el != document.body) {
+                    YAHOO.log('getRegion failed: element not available', 'error', 'Dom');
+                    return false;
+                }
+
+                var region = Y.Region.getRegion(el);
+                YAHOO.log('getRegion returning ' + region, 'info', 'Dom');
                 return region;
             };
             
@@ -411,11 +430,30 @@ version: 0.12.2
          * @param {String} className The class name to match against
          * @param {String} tag (optional) The tag name of the elements being collected
          * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
+         * @param {Function} apply (optional) A function to apply to each element when found 
          * @return {Array} An array of elements that have the given class name
          */
-        getElementsByClassName: function(className, tag, root) {
-            var method = function(el) { return Y.Dom.hasClass(el, className); };
-            return Y.Dom.getElementsBy(method, tag, root);
+        getElementsByClassName: function(className, tag, root, apply) {
+            tag = tag || '*';
+            root = (root) ? Y.Dom.get(root) : null || document; 
+            if (!root) {
+                return [];
+            }
+
+            var nodes = [],
+                elements = root.getElementsByTagName(tag),
+                re = getClassRegEx(className);
+
+            for (var i = 0, len = elements.length; i < len; ++i) {
+                if ( re.test(elements[i].className) ) {
+                    nodes[nodes.length] = elements[i];
+                    if (apply) {
+                        apply.call(elements[i], elements[i]);
+                    }
+                }
+            }
+            
+            return nodes;
         },
 
         /**
@@ -426,11 +464,11 @@ version: 0.12.2
          * @return {Boolean | Array} A boolean value or array of boolean values
          */
         hasClass: function(el, className) {
-            var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
-            
+            var re = getClassRegEx(className);
+
             var f = function(el) {
-                logger.log('hasClass returning ' + re.test(el['className']), 'info', 'Dom');
-                return re.test(el['className']);
+                YAHOO.log('hasClass returning ' + re.test(el.className), 'info', 'Dom');
+                return re.test(el.className);
             };
             
             return Y.Dom.batch(el, f, Y.Dom, true);
@@ -444,14 +482,17 @@ version: 0.12.2
          */
         addClass: function(el, className) {
             var f = function(el) {
-                if (this.hasClass(el, className)) { return; } // already present
+                if (this.hasClass(el, className)) {
+                    return false; // already present
+                }
                 
-                logger.log('addClass adding ' + className, 'info', 'Dom');
+                YAHOO.log('addClass adding ' + className, 'info', 'Dom');
                 
-                el['className'] = [el['className'], className].join(' ');
+                el.className = YAHOO.lang.trim([el.className, className].join(' '));
+                return true;
             };
             
-            Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, f, Y.Dom, true);
         },
     
         /**
@@ -461,22 +502,26 @@ version: 0.12.2
          * @param {String} className the class name to remove from the class attribute
          */
         removeClass: function(el, className) {
-            var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)', 'g');
-
+            var re = getClassRegEx(className);
+            
             var f = function(el) {
-                if (!this.hasClass(el, className)) { return; } // not present
-                
-                logger.log('removeClass removing ' + className, 'info', 'Dom');
+                if (!this.hasClass(el, className)) {
+                    return false; // not present
+                }                 
+
+                YAHOO.log('removeClass removing ' + className, 'info', 'Dom');
                 
-                var c = el['className'];
-                el['className'] = c.replace(re, ' ');
+                var c = el.className;
+                el.className = c.replace(re, ' ');
                 if ( this.hasClass(el, className) ) { // in case of multiple adjacent
                     this.removeClass(el, className);
                 }
-                
+
+                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
+                return true;
             };
             
-            Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, f, Y.Dom, true);
         },
         
         /**
@@ -488,32 +533,35 @@ version: 0.12.2
          * @param {String} newClassName the class name that will be replacing the old class name
          */
         replaceClass: function(el, oldClassName, newClassName) {
-            if (oldClassName === newClassName) { // avoid infinite loop
+            if (!newClassName || oldClassName === newClassName) { // avoid infinite loop
                 return false;
             }
             
-            var re = new RegExp('(?:^|\\s+)' + oldClassName + '(?:\\s+|$)', 'g');
+            var re = getClassRegEx(oldClassName);
 
             var f = function(el) {
-                logger.log('replaceClass replacing ' + oldClassName + ' with ' + newClassName, 'info', 'Dom');
+                YAHOO.log('replaceClass replacing ' + oldClassName + ' with ' + newClassName, 'info', 'Dom');
             
                 if ( !this.hasClass(el, oldClassName) ) {
                     this.addClass(el, newClassName); // just add it if nothing to replace
-                    return; // note return
+                    return true; // NOTE: return
                 }
             
-                el['className'] = el['className'].replace(re, ' ' + newClassName + ' ');
+                el.className = el.className.replace(re, ' ' + newClassName + ' ');
 
                 if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent
                     this.replaceClass(el, oldClassName, newClassName);
                 }
+
+                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
+                return true;
             };
             
-            Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, f, Y.Dom, true);
         },
         
         /**
-         * Generates a unique ID
+         * Returns an ID and applies it to the element "el", if provided.
          * @method generateId  
          * @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).
          * @param {String} prefix (optional) an optional prefix to use (defaults to "yui-gen").
@@ -521,26 +569,25 @@ version: 0.12.2
          */
         generateId: function(el, prefix) {
             prefix = prefix || 'yui-gen';
-            el = el || {};
-            
+
             var f = function(el) {
+                if (el && el.id) { // do not override existing ID
+                    YAHOO.log('generateId returning existing id ' + el.id, 'info', 'Dom');
+                    return el.id;
+                } 
+
+                var id = prefix + id_counter++;
+                YAHOO.log('generateId generating ' + id, 'info', 'Dom');
+
                 if (el) {
-                    el = Y.Dom.get(el);
-                } else {
-                    el = {}; // just generating ID in this case
+                    el.id = id;
                 }
                 
-                if (!el.id) {
-                    el.id = prefix + id_counter++; 
-                    logger.log('generateId generating ' + el.id, 'info', 'Dom');
-                } // dont override existing
-                
-                logger.log('generateId returning ' + el.id, 'info', 'Dom');
-                
-                return el.id;
+                return id;
             };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+
+            // batch fails when no element, so just generate and return single ID
+            return Y.Dom.batch(el, f, Y.Dom, true) || f.apply(Y.Dom, arguments);
         },
         
         /**
@@ -554,33 +601,22 @@ version: 0.12.2
             haystack = Y.Dom.get(haystack);
             if (!haystack || !needle) { return false; }
             
-            var f = function(needle) {
-                if (haystack.contains && !isSafari) { // safari "contains" is broken
-                    logger.log('isAncestor returning ' + haystack.contains(needle), 'info', 'Dom');
-                    return haystack.contains(needle);
+            var f = function(node) {
+                if (haystack.contains && node.nodeType && !isSafari) { // safari contains is broken
+                    YAHOO.log('isAncestor returning ' + haystack.contains(node), 'info', 'Dom');
+                    return haystack.contains(node);
                 }
-                else if ( haystack.compareDocumentPosition ) {
-                    logger.log('isAncestor returning ' + !!(haystack.compareDocumentPosition(needle) & 16), 'info', 'Dom');
-                    return !!(haystack.compareDocumentPosition(needle) & 16);
+                else if ( haystack.compareDocumentPosition && node.nodeType ) {
+                    YAHOO.log('isAncestor returning ' + !!(haystack.compareDocumentPosition(node) & 16), 'info', 'Dom');
+                    return !!(haystack.compareDocumentPosition(node) & 16);
+                } else if (node.nodeType) {
+                    // fallback to crawling up (safari)
+                    return !!this.getAncestorBy(node, function(el) {
+                        return el == haystack; 
+                    }); 
                 }
-                else { // loop up and test each parent
-                    var parent = needle.parentNode;
-                    
-                    while (parent) {
-                        if (parent == haystack) {
-                            logger.log('isAncestor returning true', 'info', 'Dom');
-                            return true;
-                        }
-                        else if (!parent.tagName || parent.tagName.toUpperCase() == 'HTML') {
-                            logger.log('isAncestor returning false', 'info', 'Dom');
-                            return false;
-                        }
-                        
-                        parent = parent.parentNode;
-                    }
-                    logger.log('isAncestor returning false', 'info', 'Dom');
-                    return false;
-                }     
+                YAHOO.log('isAncestor failed; most likely needle is not an HTMLElement', 'error', 'Dom');
+                return false;
             };
             
             return Y.Dom.batch(needle, f, Y.Dom, true);      
@@ -593,7 +629,15 @@ version: 0.12.2
          * @return {Boolean} Whether or not the element is present in the current document
          */
         inDocument: function(el) {
-            var f = function(el) {
+            var f = function(el) { // safari contains fails for body so crawl up
+                if (isSafari) {
+                    while (el = el.parentNode) { // note assignment
+                        if (el == document.documentElement) {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
                 return this.isAncestor(document.documentElement, el);
             };
             
@@ -605,70 +649,62 @@ version: 0.12.2
          * For optimized performance, include a tag and/or root node when possible.
          * @method getElementsBy
          * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
-
          * @param {String} tag (optional) The tag name of the elements being collected
          * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
+         * @param {Function} apply (optional) A function to apply to each element when found 
+         * @return {Array} Array of HTMLElements
          */
-        getElementsBy: function(method, tag, root) {
+        getElementsBy: function(method, tag, root, apply) {
             tag = tag || '*';
-            
-            var nodes = [];
-            
-            if (root) {
-                root = Y.Dom.get(root);
-                if (!root) { // if no root node, then no children
-                    return nodes;
-                }
-            } else {
-                root = document;
-            }
-            
-            var elements = root.getElementsByTagName(tag);
-            
-            if ( !elements.length && (tag == '*' && root.all) ) {
-                elements = root.all; // IE < 6
+            root = (root) ? Y.Dom.get(root) : null || document; 
+
+            if (!root) {
+                return [];
             }
+
+            var nodes = [],
+                elements = root.getElementsByTagName(tag);
             
             for (var i = 0, len = elements.length; i < len; ++i) {
-                if ( method(elements[i]) ) { nodes[nodes.length] = elements[i]; }
+                if ( method(elements[i]) ) {
+                    nodes[nodes.length] = elements[i];
+                    if (apply) {
+                        apply(elements[i]);
+                    }
+                }
             }
 
-            logger.log('getElementsBy returning ' + nodes, 'info', 'Dom');
+            YAHOO.log('getElementsBy returning ' + nodes, 'info', 'Dom');
             
             return nodes;
         },
         
         /**
-         * Returns an array of elements that have had the supplied method applied.
+         * Returns an the method(s) return value(s).
          * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) ).
          * @method batch
          * @param {String | HTMLElement | Array} el (optional) An element or array of elements to apply the method to
          * @param {Function} method The method to apply to the element(s)
          * @param {Any} o (optional) An optional arg that is passed to the supplied method
          * @param {Boolean} override (optional) Whether or not to override the scope of "method" with "o"
-         * @return {HTMLElement | Array} The element(s) with the method applied
+         * @return {Any | Array} The return value(s) from the supplied methods
          */
         batch: function(el, method, o, override) {
-            var id = el;
-            el = Y.Dom.get(el);
-            
+            el = (el && el.tagName) ? el : Y.Dom.get(el); // skip get() when possible
+
+            if (!el || !method) {
+                YAHOO.log('batch failed: invalid arguments', 'error', 'Dom');
+                return false;
+            } 
             var scope = (override) ? o : window;
             
-            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)
-                if (!el) {
-                    logger.log(id + ' not available', 'error', 'Dom');
-                    return false;
-                }
+            if (el.tagName || (!el.item && !el.slice)) { // not a collection or array, just run the method
                 return method.call(scope, el, o);
             } 
-            
+
             var collection = [];
             
             for (var i = 0, len = el.length; i < len; ++i) {
-                if (!el[i]) {
-                    id = el[i];
-                    logger.log(id + ' not available', 'error', 'Dom');
-                }
                 collection[collection.length] = method.call(scope, el[i], o);
             }
             
@@ -684,7 +720,7 @@ version: 0.12.2
             var scrollHeight = (document.compatMode != 'CSS1Compat') ? document.body.scrollHeight : document.documentElement.scrollHeight;
 
             var h = Math.max(scrollHeight, Y.Dom.getViewportHeight());
-            logger.log('getDocumentHeight returning ' + h, 'info', 'Dom');
+            YAHOO.log('getDocumentHeight returning ' + h, 'info', 'Dom');
             return h;
         },
         
@@ -696,7 +732,7 @@ version: 0.12.2
         getDocumentWidth: function() {
             var scrollWidth = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth;
             var w = Math.max(scrollWidth, Y.Dom.getViewportWidth());
-            logger.log('getDocumentWidth returning ' + w, 'info', 'Dom');
+            YAHOO.log('getDocumentWidth returning ' + w, 'info', 'Dom');
             return w;
         },
 
@@ -715,7 +751,7 @@ version: 0.12.2
                         document.body.clientHeight; // Quirks
             }
         
-            logger.log('getViewportHeight returning ' + height, 'info', 'Dom');
+            YAHOO.log('getViewportHeight returning ' + height, 'info', 'Dom');
             return height;
         },
         
@@ -734,8 +770,294 @@ version: 0.12.2
                         document.documentElement.clientWidth : // Standards
                         document.body.clientWidth; // Quirks
             }
-            logger.log('getViewportWidth returning ' + width, 'info', 'Dom');
+            YAHOO.log('getViewportWidth returning ' + width, 'info', 'Dom');
             return width;
+        },
+
+       /**
+         * Returns the nearest ancestor that passes the test applied by supplied boolean method.
+         * For performance reasons, IDs are not accepted and argument validation omitted.
+         * @method getAncestorBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
+         * @return {Object} HTMLElement or null if not found
+         */
+        getAncestorBy: function(node, method) {
+            while (node = node.parentNode) { // NOTE: assignment
+                if ( testElement(node, method) ) {
+                    YAHOO.log('getAncestorBy returning ' + node, 'info', 'Dom');
+                    return node;
+                }
+            } 
+
+            YAHOO.log('getAncestorBy returning null (no ancestor passed test)', 'error', 'Dom');
+            return null;
+        },
+        
+        /**
+         * Returns the nearest ancestor with the given className.
+         * @method getAncestorByClassName
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @param {String} className
+         * @return {Object} HTMLElement
+         */
+        getAncestorByClassName: function(node, className) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                YAHOO.log('getAncestorByClassName failed: invalid node argument', 'error', 'Dom');
+                return null;
+            }
+            var method = function(el) { return Y.Dom.hasClass(el, className); };
+            return Y.Dom.getAncestorBy(node, method);
+        },
+
+        /**
+         * Returns the nearest ancestor with the given tagName.
+         * @method getAncestorByTagName
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @param {String} tagName
+         * @return {Object} HTMLElement
+         */
+        getAncestorByTagName: function(node, tagName) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                YAHOO.log('getAncestorByTagName failed: invalid node argument', 'error', 'Dom');
+                return null;
+            }
+            var method = function(el) {
+                 return el.tagName && el.tagName.toUpperCase() == tagName.toUpperCase();
+            };
+
+            return Y.Dom.getAncestorBy(node, method);
+        },
+
+        /**
+         * Returns the previous sibling that is an HTMLElement. 
+         * For performance reasons, IDs are not accepted and argument validation omitted.
+         * Returns the nearest HTMLElement sibling if no method provided.
+         * @method getPreviousSiblingBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test siblings
+         * that receives the sibling node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getPreviousSiblingBy: function(node, method) {
+            while (node) {
+                node = node.previousSibling;
+                if ( testElement(node, method) ) {
+                    return node;
+                }
+            }
+            return null;
+        }, 
+
+        /**
+         * Returns the previous sibling that is an HTMLElement 
+         * @method getPreviousSibling
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getPreviousSibling: function(node) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                YAHOO.log('getPreviousSibling failed: invalid node argument', 'error', 'Dom');
+                return null;
+            }
+
+            return Y.Dom.getPreviousSiblingBy(node);
+        }, 
+
+        /**
+         * Returns the next HTMLElement sibling that passes the boolean method. 
+         * For performance reasons, IDs are not accepted and argument validation omitted.
+         * Returns the nearest HTMLElement sibling if no method provided.
+         * @method getNextSiblingBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test siblings
+         * that receives the sibling node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getNextSiblingBy: function(node, method) {
+            while (node) {
+                node = node.nextSibling;
+                if ( testElement(node, method) ) {
+                    return node;
+                }
+            }
+            return null;
+        }, 
+
+        /**
+         * Returns the next sibling that is an HTMLElement 
+         * @method getNextSibling
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getNextSibling: function(node) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                YAHOO.log('getNextSibling failed: invalid node argument', 'error', 'Dom');
+                return null;
+            }
+
+            return Y.Dom.getNextSiblingBy(node);
+        }, 
+
+        /**
+         * Returns the first HTMLElement child that passes the test method. 
+         * @method getFirstChildBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test children
+         * that receives the node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getFirstChildBy: function(node, method) {
+            var child = ( testElement(node.firstChild, method) ) ? node.firstChild : null;
+            return child || Y.Dom.getNextSiblingBy(node.firstChild, method);
+        }, 
+
+        /**
+         * Returns the first HTMLElement child. 
+         * @method getFirstChild
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getFirstChild: function(node, method) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                YAHOO.log('getFirstChild failed: invalid node argument', 'error', 'Dom');
+                return null;
+            }
+            return Y.Dom.getFirstChildBy(node);
+        }, 
+
+        /**
+         * Returns the last HTMLElement child that passes the test method. 
+         * @method getLastChildBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test children
+         * that receives the node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getLastChildBy: function(node, method) {
+            if (!node) {
+                YAHOO.log('getLastChild failed: invalid node argument', 'error', 'Dom');
+                return null;
+            }
+            var child = ( testElement(node.lastChild, method) ) ? node.lastChild : null;
+            return child || Y.Dom.getPreviousSiblingBy(node.lastChild, method);
+        }, 
+
+        /**
+         * Returns the last HTMLElement child. 
+         * @method getLastChild
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getLastChild: function(node) {
+            node = Y.Dom.get(node);
+            return Y.Dom.getLastChildBy(node);
+        }, 
+
+        /**
+         * Returns an array of HTMLElement childNodes that pass the test method. 
+         * @method getChildrenBy
+         * @param {HTMLElement} node The HTMLElement to start from
+         * @param {Function} method A boolean function used to test children
+         * that receives the node being tested as its only argument
+         * @return {Array} A static array of HTMLElements
+         */
+        getChildrenBy: function(node, method) {
+            var child = Y.Dom.getFirstChildBy(node, method);
+            var children = child ? [child] : [];
+
+            Y.Dom.getNextSiblingBy(child, function(node) {
+                if ( !method || method(node) ) {
+                    children[children.length] = node;
+                }
+                return false; // fail test to collect all children
+            });
+
+            return children;
+        },
+        /**
+         * Returns an array of HTMLElement childNodes. 
+         * @method getChildren
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Array} A static array of HTMLElements
+         */
+        getChildren: function(node) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                YAHOO.log('getChildren failed: invalid node argument', 'error', 'Dom');
+            }
+
+            return Y.Dom.getChildrenBy(node);
+        },
+        /**
+         * Returns the left scroll value of the document 
+         * @method getDocumentScrollLeft
+         * @param {HTMLDocument} document (optional) The document to get the scroll value of
+         * @return {Int}  The amount that the document is scrolled to the left
+         */
+        getDocumentScrollLeft: function(doc) {
+            doc = doc || document;
+            return Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
+        }, 
+
+        /**
+         * Returns the top scroll value of the document 
+         * @method getDocumentScrollTop
+         * @param {HTMLDocument} document (optional) The document to get the scroll value of
+         * @return {Int}  The amount that the document is scrolled to the top
+         */
+        getDocumentScrollTop: function(doc) {
+            doc = doc || document;
+            return Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
+        },
+
+        /**
+         * Inserts the new node as the previous sibling of the reference node 
+         * @method insertBefore
+         * @param {String | HTMLElement} newNode The node to be inserted
+         * @param {String | HTMLElement} referenceNode The node to insert the new node before 
+         * @return {HTMLElement} The node that was inserted (or null if insert fails) 
+         */
+        insertBefore: function(newNode, referenceNode) {
+            newNode = Y.Dom.get(newNode); 
+            referenceNode = Y.Dom.get(referenceNode); 
+            
+            if (!newNode || !referenceNode || !referenceNode.parentNode) {
+                YAHOO.log('insertAfter failed: missing or invalid arg(s)', 'error', 'Dom');
+                return null;
+            }       
+
+            return referenceNode.parentNode.insertBefore(newNode, referenceNode); 
+        },
+
+        /**
+         * Inserts the new node as the next sibling of the reference node 
+         * @method insertAfter
+         * @param {String | HTMLElement} newNode The node to be inserted
+         * @param {String | HTMLElement} referenceNode The node to insert the new node after 
+         * @return {HTMLElement} The node that was inserted (or null if insert fails) 
+         */
+        insertAfter: function(newNode, referenceNode) {
+            newNode = Y.Dom.get(newNode); 
+            referenceNode = Y.Dom.get(referenceNode); 
+            
+            if (!newNode || !referenceNode || !referenceNode.parentNode) {
+                YAHOO.log('insertAfter failed: missing or invalid arg(s)', 'error', 'Dom');
+                return null;
+            }       
+
+            if (referenceNode.nextSibling) {
+                return referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); 
+            } else {
+                return referenceNode.parentNode.appendChild(newNode);
+            }
         }
     };
 })();
@@ -902,8 +1224,8 @@ YAHOO.util.Region.getRegion = function(el) {
  * @extends YAHOO.util.Region
  */
 YAHOO.util.Point = function(x, y) {
-   if (x instanceof Array) { // accept output from Dom.getXY
-      y = x[1];
+   if (YAHOO.lang.isArray(x)) { // accept input from Dom.getXY, Event.getXY, etc.
+      y = x[1]; // dont blow away x yet
       x = x[0];
    }
    
@@ -925,3 +1247,4 @@ YAHOO.util.Point = function(x, y) {
 
 YAHOO.util.Point.prototype = new YAHOO.util.Region();
 
+YAHOO.register("dom", YAHOO.util.Dom, {version: "2.3.0", build: "442"});
index 36e62f93a3e8b998914301ba5614bc2a01913399..ecece476d4165a34576515994f2735230bba8289 100755 (executable)
@@ -1,59 +1,74 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.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;}
+(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={},reClassNameCache={};var isOpera=YAHOO.env.ua.opera,isSafari=YAHOO.env.ua.webkit,isGecko=YAHOO.env.ua.gecko,isIE=YAHOO.env.ua.ie;var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}
 if(propertyCache[property]){return propertyCache[property];}
-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)];}
+var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}
+propertyCache[property]=converted;return converted;};var getClassRegEx=function(className){var re=reClassNameCache[className];if(!re){re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');reClassNameCache[className]=re;}
+return re;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';}
+var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}
 return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}
-return val/100;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 val/100;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}
+if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}
+break;case'float':property='styleFloat';default:el.style[property]=val;}};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';}
+el.style[property]=val;};}
+var testElement=function(node,method){return node&&node.nodeType==1&&(!method||method(node));};YAHOO.util.Dom={get:function(el){if(!el||el.tagName||el.item){return el;}
+if(YAHOO.lang.isString(el)){return document.getElementById(el);}
+if(el.splice){var c=[];for(var i=0,len=el.length;i<len;++i){c[c.length]=Y.Dom.get(el[i]);}
+return c;}
+return el;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
+var parentNode=null;var pos=[];var box;var doc=el.ownerDocument;if(el.getBoundingClientRect){box=el.getBoundingClientRect();return[box.left+Y.Dom.getDocumentScrollLeft(el.ownerDocument),box.top+Y.Dom.getDocumentScrollTop(el.ownerDocument)];}
+else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;var hasAbs=this.getStyle(el,'position')=='absolute';if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;if(isSafari&&!hasAbs&&this.getStyle(parentNode,'position')=='absolute'){hasAbs=true;}
+parentNode=parentNode.offsetParent;}}
+if(isSafari&&hasAbs){pos[0]-=el.ownerDocument.body.offsetLeft;pos[1]-=el.ownerDocument.body.offsetTop;}}
+parentNode=el.parentNode;while(parentNode.tagName&&!patterns.ROOT_TAG.test(parentNode.tagName))
+{if(Y.Dom.getStyle(parentNode,'display').search(/^inline|table-row.*$/i)){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}
+parentNode=parentNode.parentNode;}
 return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}
 var pageXY=this.getXY(el);if(pageXY===false){return false;}
 var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}
 if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}
 if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
 if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
-if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){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||'*';var nodes=[];if(root){root=Y.Dom.get(root);if(!root){return nodes;}}else{root=document;}
-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);}
+if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
+var region=Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
+var nodes=[],elements=root.getElementsByTagName(tag),re=getClassRegEx(className);for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i].className)){nodes[nodes.length]=elements[i];if(apply){apply.call(elements[i],elements[i]);}}}
+return nodes;},hasClass:function(el,className){var re=getClassRegEx(className);var f=function(el){return re.test(el.className);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return false;}
+el.className=YAHOO.lang.trim([el.className,className].join(' '));return true;};return Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=getClassRegEx(className);var f=function(el){if(!this.hasClass(el,className)){return false;}
+var c=el.className;el.className=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}
+el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(!newClassName||oldClassName===newClassName){return false;}
+var re=getClassRegEx(oldClassName);var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return true;}
+el.className=el.className.replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}
+el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';var f=function(el){if(el&&el.id){return el.id;}
+var id=prefix+id_counter++;if(el){el.id=id;}
+return id;};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}
+var f=function(node){if(haystack.contains&&node.nodeType&&!isSafari){return haystack.contains(node);}
+else if(haystack.compareDocumentPosition&&node.nodeType){return!!(haystack.compareDocumentPosition(node)&16);}else if(node.nodeType){return!!this.getAncestorBy(node,function(el){return el==haystack;});}
+return false;};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){if(isSafari){while(el=el.parentNode){if(el==document.documentElement){return true;}}
+return false;}
+return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
+var nodes=[],elements=root.getElementsByTagName(tag);for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];if(apply){apply(elements[i]);}}}
+return nodes;},batch:function(el,method,o,override){el=(el&&el.tagName)?el:Y.Dom.get(el);if(!el||!method){return false;}
+var scope=(override)?o:window;if(el.tagName||(!el.item&&!el.slice)){return method.call(scope,el,o);}
+var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=method.call(scope,el[i],o);}
 return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}
 return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}
-return width;}};})();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
+return width;},getAncestorBy:function(node,method){while(node=node.parentNode){if(testElement(node,method)){return node;}}
+return null;},getAncestorByClassName:function(node,className){node=Y.Dom.get(node);if(!node){return null;}
+var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getAncestorBy(node,method);},getAncestorByTagName:function(node,tagName){node=Y.Dom.get(node);if(!node){return null;}
+var method=function(el){return el.tagName&&el.tagName.toUpperCase()==tagName.toUpperCase();};return Y.Dom.getAncestorBy(node,method);},getPreviousSiblingBy:function(node,method){while(node){node=node.previousSibling;if(testElement(node,method)){return node;}}
+return null;},getPreviousSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
+return Y.Dom.getPreviousSiblingBy(node);},getNextSiblingBy:function(node,method){while(node){node=node.nextSibling;if(testElement(node,method)){return node;}}
+return null;},getNextSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
+return Y.Dom.getNextSiblingBy(node);},getFirstChildBy:function(node,method){var child=(testElement(node.firstChild,method))?node.firstChild:null;return child||Y.Dom.getNextSiblingBy(node.firstChild,method);},getFirstChild:function(node,method){node=Y.Dom.get(node);if(!node){return null;}
+return Y.Dom.getFirstChildBy(node);},getLastChildBy:function(node,method){if(!node){return null;}
+var child=(testElement(node.lastChild,method))?node.lastChild:null;return child||Y.Dom.getPreviousSiblingBy(node.lastChild,method);},getLastChild:function(node){node=Y.Dom.get(node);return Y.Dom.getLastChildBy(node);},getChildrenBy:function(node,method){var child=Y.Dom.getFirstChildBy(node,method);var children=child?[child]:[];Y.Dom.getNextSiblingBy(child,function(node){if(!method||method(node)){children[children.length]=node;}
+return false;});return children;},getChildren:function(node){node=Y.Dom.get(node);if(!node){}
+return Y.Dom.getChildrenBy(node);},getDocumentScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);},getDocumentScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);},insertBefore:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
+return referenceNode.parentNode.insertBefore(newNode,referenceNode);},insertAfter:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
+if(referenceNode.nextSibling){return referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);}else{return referenceNode.parentNode.appendChild(newNode);}}};})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(YAHOO.lang.isArray(x)){y=x[1];x=x[0];}
+this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.3.0",build:"442"});
\ No newline at end of file
index c37bd1b04e46985ffb27c8edf4cb63cc6d6912d5..19b54650ae7ccd0613e43561fef7adaed3637136 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 /**
  * The dom module provides helper methods for manipulating Dom elements.
@@ -15,21 +15,21 @@ version: 0.12.2
         getStyle,           // for load time browser branching
         setStyle,           // ditto
         id_counter = 0,     // for use with generateId
-        propertyCache = {}; // for faster hyphen converts
+        propertyCache = {}, // for faster hyphen converts
+        reClassNameCache = {}; // cache regexes for className
     
     // brower detection
-    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 isOpera = YAHOO.env.ua.opera,
+        isSafari = YAHOO.env.ua.webkit, 
+        isGecko = YAHOO.env.ua.gecko,
+        isIE = YAHOO.env.ua.ie; 
     
     // regex cache
     var patterns = {
-        HYPHEN: /(-[a-z])/i
+        HYPHEN: /(-[a-z])/i, // to normalize get/setStyle
+        ROOT_TAG: /^body|html$/i // body for quirks mode, html for standards
     };
 
-    
     var toCamel = function(property) {
         if ( !patterns.HYPHEN.test(property) ) {
             return property; // no hyphens
@@ -38,22 +38,37 @@ version: 0.12.2
         if (propertyCache[property]) { // already converted
             return propertyCache[property];
         }
-        
-        while( patterns.HYPHEN.exec(property) ) {
-            property = property.replace(RegExp.$1,
+       
+        var converted = property;
+        while( patterns.HYPHEN.exec(converted) ) {
+            converted = converted.replace(RegExp.$1,
                     RegExp.$1.substr(1).toUpperCase());
         }
         
-        propertyCache[property] = property;
-        return property;
+        propertyCache[property] = converted;
+        return converted;
         //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug
     };
     
+    var getClassRegEx = function(className) {
+        var re = reClassNameCache[className];
+        if (!re) {
+            re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
+            reClassNameCache[className] = re;
+        }
+        return re;
+    };
+
     // branching at load instead of runtime
     if (document.defaultView && document.defaultView.getComputedStyle) { // W3C DOM method
         getStyle = function(el, property) {
             var value = null;
             
+            if (property == 'float') { // fix reserved word
+                property = 'cssFloat';
+            }
+
             var computed = document.defaultView.getComputedStyle(el, '');
             if (computed) { // test computed before touching for safari
                 value = computed[toCamel(property)];
@@ -76,7 +91,8 @@ version: 0.12.2
                         }
                     }
                     return val / 100;
-                    break;
+                case 'float': // fix reserved word
+                    property = 'styleFloat'; // fall through
                 default: 
                     // test currentStyle before touching
                     var value = el.currentStyle ? el.currentStyle[property] : null;
@@ -91,7 +107,7 @@ version: 0.12.2
         setStyle = function(el, property, val) {
             switch (property) {
                 case 'opacity':
-                    if ( typeof el.style.filter == 'string' ) { // in case not appended
+                    if ( YAHOO.lang.isString(el.style.filter) ) { // in case not appended
                         el.style.filter = 'alpha(opacity=' + val * 100 + ')';
                         
                         if (!el.currentStyle || !el.currentStyle.hasLayout) {
@@ -99,16 +115,25 @@ version: 0.12.2
                         }
                     }
                     break;
+                case 'float':
+                    property = 'styleFloat';
                 default:
                 el.style[property] = val;
             }
         };
     } else {
         setStyle = function(el, property, val) {
+            if (property == 'float') {
+                property = 'cssFloat';
+            }
             el.style[property] = val;
         };
     }
     
+    var testElement = function(node, method) {
+        return node && node.nodeType == 1 && ( !method || method(node) );
+    };
+
     /**
      * Provides helper methods for DOM elements.
      * @namespace YAHOO.util
@@ -122,25 +147,24 @@ version: 0.12.2
          * @return {HTMLElement | Array} A DOM reference to an HTML element or an array of HTMLElements.
          */
         get: function(el) {
-            if (!el) { return null; } // nothing to work with
-            
-            if (typeof el != 'string' && !(el instanceof Array) ) { // assuming HTMLElement or HTMLCollection, so pass back as is
+            if (!el || el.tagName || el.item) { // null, HTMLElement, or HTMLCollection
                 return el;
             }
-            
-            if (typeof el == 'string') { // ID
+
+            if (YAHOO.lang.isString(el)) { // HTMLElement or null
                 return document.getElementById(el);
             }
-            else { // array of ID's and/or elements
-                var collection = [];
+            
+            if (el.splice) { // Array of HTMLElements/IDs
+                var c = [];
                 for (var i = 0, len = el.length; i < len; ++i) {
-                    collection[collection.length] = Y.Dom.get(el[i]);
+                    c[c.length] = Y.Dom.get(el[i]);
                 }
                 
-                return collection;
+                return c;
             }
 
-            return null; // safety, should never happen
+            return el; // some other object, just pass it back
         },
     
         /**
@@ -188,63 +212,59 @@ version: 0.12.2
             var f = function(el) {
     
             // has to be part of document to have pageXY
-                if (el.parentNode === null || el.offsetParent === null ||
-                        this.getStyle(el, 'display') == 'none') {
+                if ( (el.parentNode === null || el.offsetParent === null ||
+                        this.getStyle(el, 'display') == 'none') && el != document.body) {
                     return false;
                 }
                 
                 var parentNode = null;
                 var pos = [];
                 var box;
-                
+                var doc = el.ownerDocument; 
+
                 if (el.getBoundingClientRect) { // IE
                     box = el.getBoundingClientRect();
-                    var doc = document;
-                    if ( !this.inDocument(el) && parent.document != document) {// might be in a frame, need to get its scroll
-                        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];
+                    return [box.left + Y.Dom.getDocumentScrollLeft(el.ownerDocument), box.top + Y.Dom.getDocumentScrollTop(el.ownerDocument)];
                 }
                 else { // safari, opera, & gecko
                     pos = [el.offsetLeft, el.offsetTop];
                     parentNode = el.offsetParent;
+
+                    // safari: if el is abs or any parent is abs, subtract body offsets
+                    var hasAbs = this.getStyle(el, 'position') == 'absolute';
+
                     if (parentNode != el) {
                         while (parentNode) {
                             pos[0] += parentNode.offsetLeft;
                             pos[1] += parentNode.offsetTop;
+                            if (isSafari && !hasAbs && 
+                                    this.getStyle(parentNode,'position') == 'absolute' ) {
+                                hasAbs = true; // we need to offset if any parent is absolutely positioned
+                            }
                             parentNode = parentNode.offsetParent;
                         }
                     }
-                    if (isSafari && this.getStyle(el, 'position') == 'absolute' ) { // safari doubles in some cases
-                        pos[0] -= document.body.offsetLeft;
-                        pos[1] -= document.body.offsetTop;
+
+                    if (isSafari && hasAbs) { //safari doubles in this case
+                        pos[0] -= el.ownerDocument.body.offsetLeft;
+                        pos[1] -= el.ownerDocument.body.offsetTop;
                     } 
                 }
                 
-                if (el.parentNode) { parentNode = el.parentNode; }
-                else { parentNode = null; }
-        
-                while (parentNode && parentNode.tagName.toUpperCase() != 'BODY' && parentNode.tagName.toUpperCase() != 'HTML') 
-                { // account for any scrolled ancestors
-                    if (Y.Dom.getStyle(parentNode, 'display') != 'inline') { // work around opera inline scrollLeft/Top bug
+                parentNode = el.parentNode;
+
+                // account for any scrolled ancestors
+                while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) ) 
+                {
+                   // work around opera inline/table scrollLeft/Top bug
+                   if (Y.Dom.getStyle(parentNode, 'display').search(/^inline|table-row.*$/i)) { 
                         pos[0] -= parentNode.scrollLeft;
                         pos[1] -= parentNode.scrollTop;
                     }
                     
-                    if (parentNode.parentNode) {
-                        parentNode = parentNode.parentNode; 
-                    } else { parentNode = null; }
+                    parentNode = parentNode.parentNode; 
                 }
-        
+       
                 
                 return pos;
             };
@@ -256,7 +276,7 @@ version: 0.12.2
          * 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).
          * @method getX
          * @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
-         * @return {String | Array} The X position of the element(s)
+         * @return {Number | Array} The X position of the element(s)
          */
         getX: function(el) {
             var f = function(el) {
@@ -270,7 +290,7 @@ version: 0.12.2
          * 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).
          * @method getY
          * @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
-         * @return {String | Array} The Y position of the element(s)
+         * @return {Number | Array} The Y position of the element(s)
          */
         getY: function(el) {
             var f = function(el) {
@@ -362,7 +382,12 @@ version: 0.12.2
          */
         getRegion: function(el) {
             var f = function(el) {
-                var region = new Y.Region.getRegion(el);
+                if ( (el.parentNode === null || el.offsetParent === null ||
+                        this.getStyle(el, 'display') == 'none') && el != document.body) {
+                    return false;
+                }
+
+                var region = Y.Region.getRegion(el);
                 return region;
             };
             
@@ -396,11 +421,30 @@ version: 0.12.2
          * @param {String} className The class name to match against
          * @param {String} tag (optional) The tag name of the elements being collected
          * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
+         * @param {Function} apply (optional) A function to apply to each element when found 
          * @return {Array} An array of elements that have the given class name
          */
-        getElementsByClassName: function(className, tag, root) {
-            var method = function(el) { return Y.Dom.hasClass(el, className); };
-            return Y.Dom.getElementsBy(method, tag, root);
+        getElementsByClassName: function(className, tag, root, apply) {
+            tag = tag || '*';
+            root = (root) ? Y.Dom.get(root) : null || document; 
+            if (!root) {
+                return [];
+            }
+
+            var nodes = [],
+                elements = root.getElementsByTagName(tag),
+                re = getClassRegEx(className);
+
+            for (var i = 0, len = elements.length; i < len; ++i) {
+                if ( re.test(elements[i].className) ) {
+                    nodes[nodes.length] = elements[i];
+                    if (apply) {
+                        apply.call(elements[i], elements[i]);
+                    }
+                }
+            }
+            
+            return nodes;
         },
 
         /**
@@ -411,10 +455,10 @@ version: 0.12.2
          * @return {Boolean | Array} A boolean value or array of boolean values
          */
         hasClass: function(el, className) {
-            var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
-            
+            var re = getClassRegEx(className);
+
             var f = function(el) {
-                return re.test(el['className']);
+                return re.test(el.className);
             };
             
             return Y.Dom.batch(el, f, Y.Dom, true);
@@ -428,13 +472,16 @@ version: 0.12.2
          */
         addClass: function(el, className) {
             var f = function(el) {
-                if (this.hasClass(el, className)) { return; } // already present
+                if (this.hasClass(el, className)) {
+                    return false; // already present
+                }
                 
                 
-                el['className'] = [el['className'], className].join(' ');
+                el.className = YAHOO.lang.trim([el.className, className].join(' '));
+                return true;
             };
             
-            Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, f, Y.Dom, true);
         },
     
         /**
@@ -444,21 +491,25 @@ version: 0.12.2
          * @param {String} className the class name to remove from the class attribute
          */
         removeClass: function(el, className) {
-            var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)', 'g');
-
+            var re = getClassRegEx(className);
+            
             var f = function(el) {
-                if (!this.hasClass(el, className)) { return; } // not present
-                
+                if (!this.hasClass(el, className)) {
+                    return false; // not present
+                }                 
+
                 
-                var c = el['className'];
-                el['className'] = c.replace(re, ' ');
+                var c = el.className;
+                el.className = c.replace(re, ' ');
                 if ( this.hasClass(el, className) ) { // in case of multiple adjacent
                     this.removeClass(el, className);
                 }
-                
+
+                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
+                return true;
             };
             
-            Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, f, Y.Dom, true);
         },
         
         /**
@@ -470,31 +521,34 @@ version: 0.12.2
          * @param {String} newClassName the class name that will be replacing the old class name
          */
         replaceClass: function(el, oldClassName, newClassName) {
-            if (oldClassName === newClassName) { // avoid infinite loop
+            if (!newClassName || oldClassName === newClassName) { // avoid infinite loop
                 return false;
             }
             
-            var re = new RegExp('(?:^|\\s+)' + oldClassName + '(?:\\s+|$)', 'g');
+            var re = getClassRegEx(oldClassName);
 
             var f = function(el) {
             
                 if ( !this.hasClass(el, oldClassName) ) {
                     this.addClass(el, newClassName); // just add it if nothing to replace
-                    return; // note return
+                    return true; // NOTE: return
                 }
             
-                el['className'] = el['className'].replace(re, ' ' + newClassName + ' ');
+                el.className = el.className.replace(re, ' ' + newClassName + ' ');
 
                 if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent
                     this.replaceClass(el, oldClassName, newClassName);
                 }
+
+                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
+                return true;
             };
             
-            Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, f, Y.Dom, true);
         },
         
         /**
-         * Generates a unique ID
+         * Returns an ID and applies it to the element "el", if provided.
          * @method generateId  
          * @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).
          * @param {String} prefix (optional) an optional prefix to use (defaults to "yui-gen").
@@ -502,24 +556,23 @@ version: 0.12.2
          */
         generateId: function(el, prefix) {
             prefix = prefix || 'yui-gen';
-            el = el || {};
-            
+
             var f = function(el) {
+                if (el && el.id) { // do not override existing ID
+                    return el.id;
+                } 
+
+                var id = prefix + id_counter++;
+
                 if (el) {
-                    el = Y.Dom.get(el);
-                } else {
-                    el = {}; // just generating ID in this case
+                    el.id = id;
                 }
                 
-                if (!el.id) {
-                    el.id = prefix + id_counter++; 
-                } // dont override existing
-                
-                
-                return el.id;
+                return id;
             };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+
+            // batch fails when no element, so just generate and return single ID
+            return Y.Dom.batch(el, f, Y.Dom, true) || f.apply(Y.Dom, arguments);
         },
         
         /**
@@ -533,28 +586,19 @@ version: 0.12.2
             haystack = Y.Dom.get(haystack);
             if (!haystack || !needle) { return false; }
             
-            var f = function(needle) {
-                if (haystack.contains && !isSafari) { // safari "contains" is broken
-                    return haystack.contains(needle);
+            var f = function(node) {
+                if (haystack.contains && node.nodeType && !isSafari) { // safari contains is broken
+                    return haystack.contains(node);
                 }
-                else if ( haystack.compareDocumentPosition ) {
-                    return !!(haystack.compareDocumentPosition(needle) & 16);
+                else if ( haystack.compareDocumentPosition && node.nodeType ) {
+                    return !!(haystack.compareDocumentPosition(node) & 16);
+                } else if (node.nodeType) {
+                    // fallback to crawling up (safari)
+                    return !!this.getAncestorBy(node, function(el) {
+                        return el == haystack; 
+                    }); 
                 }
-                else { // loop up and test each parent
-                    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 false;
             };
             
             return Y.Dom.batch(needle, f, Y.Dom, true);      
@@ -567,7 +611,15 @@ version: 0.12.2
          * @return {Boolean} Whether or not the element is present in the current document
          */
         inDocument: function(el) {
-            var f = function(el) {
+            var f = function(el) { // safari contains fails for body so crawl up
+                if (isSafari) {
+                    while (el = el.parentNode) { // note assignment
+                        if (el == document.documentElement) {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
                 return this.isAncestor(document.documentElement, el);
             };
             
@@ -579,32 +631,29 @@ version: 0.12.2
          * For optimized performance, include a tag and/or root node when possible.
          * @method getElementsBy
          * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
-
          * @param {String} tag (optional) The tag name of the elements being collected
          * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
+         * @param {Function} apply (optional) A function to apply to each element when found 
+         * @return {Array} Array of HTMLElements
          */
-        getElementsBy: function(method, tag, root) {
+        getElementsBy: function(method, tag, root, apply) {
             tag = tag || '*';
-            
-            var nodes = [];
-            
-            if (root) {
-                root = Y.Dom.get(root);
-                if (!root) { // if no root node, then no children
-                    return nodes;
-                }
-            } else {
-                root = document;
-            }
-            
-            var elements = root.getElementsByTagName(tag);
-            
-            if ( !elements.length && (tag == '*' && root.all) ) {
-                elements = root.all; // IE < 6
+            root = (root) ? Y.Dom.get(root) : null || document; 
+
+            if (!root) {
+                return [];
             }
+
+            var nodes = [],
+                elements = root.getElementsByTagName(tag);
             
             for (var i = 0, len = elements.length; i < len; ++i) {
-                if ( method(elements[i]) ) { nodes[nodes.length] = elements[i]; }
+                if ( method(elements[i]) ) {
+                    nodes[nodes.length] = elements[i];
+                    if (apply) {
+                        apply(elements[i]);
+                    }
+                }
             }
 
             
@@ -612,34 +661,30 @@ version: 0.12.2
         },
         
         /**
-         * Returns an array of elements that have had the supplied method applied.
+         * Returns an the method(s) return value(s).
          * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) ).
          * @method batch
          * @param {String | HTMLElement | Array} el (optional) An element or array of elements to apply the method to
          * @param {Function} method The method to apply to the element(s)
          * @param {Any} o (optional) An optional arg that is passed to the supplied method
          * @param {Boolean} override (optional) Whether or not to override the scope of "method" with "o"
-         * @return {HTMLElement | Array} The element(s) with the method applied
+         * @return {Any | Array} The return value(s) from the supplied methods
          */
         batch: function(el, method, o, override) {
-            var id = el;
-            el = Y.Dom.get(el);
-            
+            el = (el && el.tagName) ? el : Y.Dom.get(el); // skip get() when possible
+
+            if (!el || !method) {
+                return false;
+            } 
             var scope = (override) ? o : window;
             
-            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)
-                if (!el) {
-                    return false;
-                }
+            if (el.tagName || (!el.item && !el.slice)) { // not a collection or array, just run the method
                 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);
             }
             
@@ -703,6 +748,281 @@ version: 0.12.2
                         document.body.clientWidth; // Quirks
             }
             return width;
+        },
+
+       /**
+         * Returns the nearest ancestor that passes the test applied by supplied boolean method.
+         * For performance reasons, IDs are not accepted and argument validation omitted.
+         * @method getAncestorBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
+         * @return {Object} HTMLElement or null if not found
+         */
+        getAncestorBy: function(node, method) {
+            while (node = node.parentNode) { // NOTE: assignment
+                if ( testElement(node, method) ) {
+                    return node;
+                }
+            } 
+
+            return null;
+        },
+        
+        /**
+         * Returns the nearest ancestor with the given className.
+         * @method getAncestorByClassName
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @param {String} className
+         * @return {Object} HTMLElement
+         */
+        getAncestorByClassName: function(node, className) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                return null;
+            }
+            var method = function(el) { return Y.Dom.hasClass(el, className); };
+            return Y.Dom.getAncestorBy(node, method);
+        },
+
+        /**
+         * Returns the nearest ancestor with the given tagName.
+         * @method getAncestorByTagName
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @param {String} tagName
+         * @return {Object} HTMLElement
+         */
+        getAncestorByTagName: function(node, tagName) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                return null;
+            }
+            var method = function(el) {
+                 return el.tagName && el.tagName.toUpperCase() == tagName.toUpperCase();
+            };
+
+            return Y.Dom.getAncestorBy(node, method);
+        },
+
+        /**
+         * Returns the previous sibling that is an HTMLElement. 
+         * For performance reasons, IDs are not accepted and argument validation omitted.
+         * Returns the nearest HTMLElement sibling if no method provided.
+         * @method getPreviousSiblingBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test siblings
+         * that receives the sibling node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getPreviousSiblingBy: function(node, method) {
+            while (node) {
+                node = node.previousSibling;
+                if ( testElement(node, method) ) {
+                    return node;
+                }
+            }
+            return null;
+        }, 
+
+        /**
+         * Returns the previous sibling that is an HTMLElement 
+         * @method getPreviousSibling
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getPreviousSibling: function(node) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                return null;
+            }
+
+            return Y.Dom.getPreviousSiblingBy(node);
+        }, 
+
+        /**
+         * Returns the next HTMLElement sibling that passes the boolean method. 
+         * For performance reasons, IDs are not accepted and argument validation omitted.
+         * Returns the nearest HTMLElement sibling if no method provided.
+         * @method getNextSiblingBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test siblings
+         * that receives the sibling node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getNextSiblingBy: function(node, method) {
+            while (node) {
+                node = node.nextSibling;
+                if ( testElement(node, method) ) {
+                    return node;
+                }
+            }
+            return null;
+        }, 
+
+        /**
+         * Returns the next sibling that is an HTMLElement 
+         * @method getNextSibling
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getNextSibling: function(node) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                return null;
+            }
+
+            return Y.Dom.getNextSiblingBy(node);
+        }, 
+
+        /**
+         * Returns the first HTMLElement child that passes the test method. 
+         * @method getFirstChildBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test children
+         * that receives the node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getFirstChildBy: function(node, method) {
+            var child = ( testElement(node.firstChild, method) ) ? node.firstChild : null;
+            return child || Y.Dom.getNextSiblingBy(node.firstChild, method);
+        }, 
+
+        /**
+         * Returns the first HTMLElement child. 
+         * @method getFirstChild
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getFirstChild: function(node, method) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                return null;
+            }
+            return Y.Dom.getFirstChildBy(node);
+        }, 
+
+        /**
+         * Returns the last HTMLElement child that passes the test method. 
+         * @method getLastChildBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test children
+         * that receives the node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getLastChildBy: function(node, method) {
+            if (!node) {
+                return null;
+            }
+            var child = ( testElement(node.lastChild, method) ) ? node.lastChild : null;
+            return child || Y.Dom.getPreviousSiblingBy(node.lastChild, method);
+        }, 
+
+        /**
+         * Returns the last HTMLElement child. 
+         * @method getLastChild
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getLastChild: function(node) {
+            node = Y.Dom.get(node);
+            return Y.Dom.getLastChildBy(node);
+        }, 
+
+        /**
+         * Returns an array of HTMLElement childNodes that pass the test method. 
+         * @method getChildrenBy
+         * @param {HTMLElement} node The HTMLElement to start from
+         * @param {Function} method A boolean function used to test children
+         * that receives the node being tested as its only argument
+         * @return {Array} A static array of HTMLElements
+         */
+        getChildrenBy: function(node, method) {
+            var child = Y.Dom.getFirstChildBy(node, method);
+            var children = child ? [child] : [];
+
+            Y.Dom.getNextSiblingBy(child, function(node) {
+                if ( !method || method(node) ) {
+                    children[children.length] = node;
+                }
+                return false; // fail test to collect all children
+            });
+
+            return children;
+        },
+        /**
+         * Returns an array of HTMLElement childNodes. 
+         * @method getChildren
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Array} A static array of HTMLElements
+         */
+        getChildren: function(node) {
+            node = Y.Dom.get(node);
+            if (!node) {
+            }
+
+            return Y.Dom.getChildrenBy(node);
+        },
+        /**
+         * Returns the left scroll value of the document 
+         * @method getDocumentScrollLeft
+         * @param {HTMLDocument} document (optional) The document to get the scroll value of
+         * @return {Int}  The amount that the document is scrolled to the left
+         */
+        getDocumentScrollLeft: function(doc) {
+            doc = doc || document;
+            return Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
+        }, 
+
+        /**
+         * Returns the top scroll value of the document 
+         * @method getDocumentScrollTop
+         * @param {HTMLDocument} document (optional) The document to get the scroll value of
+         * @return {Int}  The amount that the document is scrolled to the top
+         */
+        getDocumentScrollTop: function(doc) {
+            doc = doc || document;
+            return Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
+        },
+
+        /**
+         * Inserts the new node as the previous sibling of the reference node 
+         * @method insertBefore
+         * @param {String | HTMLElement} newNode The node to be inserted
+         * @param {String | HTMLElement} referenceNode The node to insert the new node before 
+         * @return {HTMLElement} The node that was inserted (or null if insert fails) 
+         */
+        insertBefore: function(newNode, referenceNode) {
+            newNode = Y.Dom.get(newNode); 
+            referenceNode = Y.Dom.get(referenceNode); 
+            
+            if (!newNode || !referenceNode || !referenceNode.parentNode) {
+                return null;
+            }       
+
+            return referenceNode.parentNode.insertBefore(newNode, referenceNode); 
+        },
+
+        /**
+         * Inserts the new node as the next sibling of the reference node 
+         * @method insertAfter
+         * @param {String | HTMLElement} newNode The node to be inserted
+         * @param {String | HTMLElement} referenceNode The node to insert the new node after 
+         * @return {HTMLElement} The node that was inserted (or null if insert fails) 
+         */
+        insertAfter: function(newNode, referenceNode) {
+            newNode = Y.Dom.get(newNode); 
+            referenceNode = Y.Dom.get(referenceNode); 
+            
+            if (!newNode || !referenceNode || !referenceNode.parentNode) {
+                return null;
+            }       
+
+            if (referenceNode.nextSibling) {
+                return referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); 
+            } else {
+                return referenceNode.parentNode.appendChild(newNode);
+            }
         }
     };
 })();
@@ -856,6 +1176,7 @@ YAHOO.util.Region.getRegion = function(el) {
 
 /////////////////////////////////////////////////////////////////////////////
 
+
 /**
  * A point is a region that is special in that it represents a single point on 
  * the grid.
@@ -867,8 +1188,8 @@ YAHOO.util.Region.getRegion = function(el) {
  * @extends YAHOO.util.Region
  */
 YAHOO.util.Point = function(x, y) {
-   if (x instanceof Array) { // accept output from Dom.getXY
-      y = x[1];
+   if (YAHOO.lang.isArray(x)) { // accept input from Dom.getXY, Event.getXY, etc.
+      y = x[1]; // dont blow away x yet
       x = x[0];
    }
    
@@ -890,3 +1211,4 @@ YAHOO.util.Point = function(x, y) {
 
 YAHOO.util.Point.prototype = new YAHOO.util.Region();
 
+YAHOO.register("dom", YAHOO.util.Dom, {version: "2.3.0", build: "442"});
index 255ead55131f83e20a6af1d390c1fc1468464a53..1f5c7becc76c35c5d479f544fb538e933e4935e9 100755 (executable)
@@ -1,5 +1,40 @@
 Drag and Drop Release Notes
 
+2.3.0
+  * YAHOO.util.DragDropMgr.stopDrag is now public, and can be used to cancel
+    a drag in progress.  An optional "silent" flag was added to skip the
+    onMouseUp and endDrag functions when needed (eliminating the need to
+    supply mouseup page coordinates to these functions).
+  * DDProxy: the position of the proxy is not set before the drag is confirmed,
+    preventing auto-scroll from distrupting the user experience.
+  * Modified the default proxy so that IE properly registers the proxy as
+    the event target during the drag.
+  * If a dd instance is created using a dom reference rather than an id, that
+    reference is stored and used throughout making it possible to control
+    instances outside the current window.
+  * The document mousemove listener no longer returns true.
+
+2.2.2
+  * No change
+
+2.2.1
+
+  * Added YAHOO.util.DragDropMgr.interactionInfo, which is
+    a repository of interaction information accumulated during
+    the current event loop result, and accessible from the
+    handlers for the events.
+  * The region for the dragged element is now cached while
+    processing the drag and drop events
+  * List example supports moving an item to an empty list
+  * Fixed missing html tags in the examples
+  * The debug version now works when included before the logger is included.
+
+2.2.0
+
+  * onMouseDown event is executed before element positions are calculated
+  * refreshCache refreshes everything if groups array is not provided
+  * setX/setYConstraint doesn't fail when presented ints cast as strings
+
 0.12.2
 
   * No change
index 4254049ef94d8837b5867c6d97e0f6f51f89e85a..a969e143ba6c6413e98901344554c756f847dd08 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-
-(function() {
-
-var Event=YAHOO.util.Event; 
-var Dom=YAHOO.util.Dom;
-
 /**
- * Defines the interface and base operation of items that that can be 
- * dragged or can be drop targets.  It was designed to be extended, overriding
- * the event handlers for startDrag, onDrag, onDragOver, onDragOut.
- * Up to three html elements can be associated with a DragDrop instance:
- * <ul>
- * <li>linked element: the element that is passed into the constructor.
- * This is the element which defines the boundaries for interaction with 
- * other DragDrop objects.</li>
- * <li>handle element(s): The drag operation only occurs if the element that 
- * was clicked matches a handle element.  By default this is the linked 
- * element, but there are times that you will want only a portion of the 
- * linked element to initiate the drag operation, and the setHandleElId() 
- * method provides a way to define this.</li>
- * <li>drag element: this represents an the element that would be moved along
- * with the cursor during a drag operation.  By default, this is the linked
- * element itself as in {@link YAHOO.util.DD}.  setDragElId() lets you define
- * a separate element that would be moved, as in {@link YAHOO.util.DDProxy}
- * </li>
- * </ul>
- * This class should not be instantiated until the onload event to ensure that
- * the associated elements are available.
- * The following would define a DragDrop obj that would interact with any 
- * other DragDrop obj in the "group1" group:
- * <pre>
- *  dd = new YAHOO.util.DragDrop("div1", "group1");
- * </pre>
- * Since none of the event handlers have been implemented, nothing would 
- * actually happen if you were to run the code above.  Normally you would 
- * override this class or one of the default implementations, but you can 
- * also override the methods you want on an instance of the class...
- * <pre>
- *  dd.onDragDrop = function(e, id) {
- *  &nbsp;&nbsp;alert("dd was dropped on " + id);
- *  }
- * </pre>
+ * The drag and drop utility provides a framework for building drag and drop
+ * applications.  In addition to enabling drag and drop for specific elements,
+ * the drag and drop elements are tracked by the manager class, and the
+ * interactions between the various elements are tracked during the drag and
+ * the implementing code is notified about these important moments.
+ * @module dragdrop
+ * @title Drag and Drop
+ * @requires yahoo,dom,event
  * @namespace YAHOO.util
- * @class DragDrop
- * @constructor
- * @param {String} id of the element that is linked to this instance
- * @param {String} sGroup the group of related DragDrop objects
- * @param {object} config an object containing configurable attributes
- *                Valid properties for DragDrop: 
- *                    padding, isTarget, maintainOffset, primaryButtonOnly,
  */
-YAHOO.util.DragDrop = function(id, sGroup, config) {
-    if (id) {
-        this.init(id, sGroup, config); 
-    }
-};
 
-YAHOO.util.DragDrop.prototype = {
+// Only load the library once.  Rewriting the manager class would orphan 
+// existing drag and drop instances.
+if (!YAHOO.util.DragDropMgr) {
 
-    /**
-     * The id of the element associated with this object.  This is what we 
-     * refer to as the "linked element" because the size and position of 
-     * this element is used to determine when the drag and drop objects have 
    * interacted.
-     * @property id
-     * @type String
    */
-    id: null,
+/**
+ * DragDropMgr is a singleton that tracks the element interaction for 
+ * all DragDrop items in the window.  Generally, you will not call 
+ * this class directly, but it does have helper methods that could 
* be useful in your DragDrop implementations.
+ * @class DragDropMgr
+ * @static
+ */
+YAHOO.util.DragDropMgr = function() {
 
-    /**
-     * Configuration attributes passed into the constructor
-     * @property config
-     * @type object
-     */
-    config: null,
+    var Event = YAHOO.util.Event;
 
-    /**
-     * The id of the element that will be dragged.  By default this is same 
-     * as the linked element , but could be changed to another element. Ex: 
-     * YAHOO.util.DDProxy
-     * @property dragElId
-     * @type String
-     * @private
-     */
-    dragElId: null, 
+    return {
 
-    /**
-     * the id of the element that initiates the drag operation.  By defaul
-     * this is the linked element, but could be changed to be a child of this
-     * element.  This lets us do things like only starting the drag when the 
-     * header element within the linked html element is clicked.
-     * @property handleElId
-     * @type String
-     * @private
-     */
-    handleElId: null, 
+        /**
+         * Two dimensional Array of registered DragDrop objects.  The firs
+         * dimension is the DragDrop item group, the second the DragDrop 
+         * object.
+         * @property ids
+         * @type {string: string}
+         * @private
+         * @static
+         */
+        ids: {},
 
-    /**
-     * An associative array of HTML tags that will be ignored if clicked.
-     * @property invalidHandleTypes
-     * @type {string: string}
-     */
-    invalidHandleTypes: null, 
+        /**
+         * Array of element ids defined as drag handles.  Used to determine 
+         * if the element that generated the mousedown event is actually the 
+         * handle and not the html element itself.
+         * @property handleIds
+         * @type {string: string}
+         * @private
+         * @static
+         */
+        handleIds: {},
 
-    /**
-     * An associative array of ids for elements that will be ignored if clicked
-     * @property invalidHandleIds
-     * @type {string: string}
-     */
-    invalidHandleIds: null, 
+        /**
+         * the DragDrop object that is currently being dragged
+         * @property dragCurrent
+         * @type DragDrop
+         * @private
+         * @static
+         **/
+        dragCurrent: null,
 
-    /**
-     * An indexted array of css class names for elements that will be ignored
-     * if clicked.
-     * @property invalidHandleClasses
-     * @type string[]
-     */
-    invalidHandleClasses: null, 
+        /**
+         * the DragDrop object(s) that are being hovered over
+         * @property dragOvers
+         * @type Array
+         * @private
+         * @static
+         */
+        dragOvers: {},
 
-    /**
-     * The linked element's absolute X position at the time the drag was 
-     * started
-     * @property startPageX
-     * @type int
-     * @private
-     */
-    startPageX: 0,
+        /**
+         * the X distance between the cursor and the object being dragged
+         * @property deltaX
+         * @type int
+         * @private
+         * @static
+         */
+        deltaX: 0,
 
-    /**
-     * The linked element's absolute X position at the time the drag was 
-     * started
-     * @property startPageY
-     * @type int
-     * @private
-     */
-    startPageY: 0,
+        /**
+         * the Y distance between the cursor and the object being dragged
+         * @property deltaY
+         * @type int
+         * @private
+         * @static
+         */
+        deltaY: 0,
 
-    /**
-     * The group defines a logical collection of DragDrop objects that are 
-     * related.  Instances only get events when interacting with other 
-     * DragDrop object in the same group.  This lets us define multiple 
-     * groups using a single DragDrop subclass if we want.
-     * @property groups
-     * @type {string: string}
-     */
-    groups: null,
+        /**
+         * Flag to determine if we should prevent the default behavior of the
+         * events we define. By default this is true, but this can be set to 
+         * false if you need the default behavior (not recommended)
+         * @property preventDefault
+         * @type boolean
+         * @static
+         */
+        preventDefault: true,
 
-    /**
-     * Individual drag/drop instances can be locked.  This will prevent 
-     * onmousedown start drag.
-     * @property locked
-     * @type boolean
-     * @private
-     */
-    locked: false,
+        /**
+         * Flag to determine if we should stop the propagation of the events 
+         * we generate. This is true by default but you may want to set it to
+         * false if the html element contains other features that require the
+         * mouse click.
+         * @property stopPropagation
+         * @type boolean
+         * @static
+         */
+        stopPropagation: true,
 
-    /**
-     * Lock this instance
-     * @method lock
-     */
-    lock: function() { this.locked = true; },
+        /**
+         * Internal flag that is set to true when drag and drop has been
+         * initialized
+         * @property initialized
+         * @private
+         * @static
+         */
+        initialized: false,
 
-    /**
-     * Unlock this instace
-     * @method unlock
-     */
-    unlock: function() { this.locked = false; },
+        /**
+         * All drag and drop can be disabled.
+         * @property locked
+         * @private
+         * @static
+         */
+        locked: false,
 
-    /**
-     * By default, all insances can be a drop target.  This can be disabled by
-     * setting isTarget to false.
-     * @method isTarget
-     * @type boolean
-     */
-    isTarget: true,
-
-    /**
-     * The padding configured for this drag and drop object for calculating
-     * the drop zone intersection with this object.
-     * @method padding
-     * @type int[]
-     */
-    padding: null,
+        /**
+         * Provides additional information about the the current set of
+         * interactions.  Can be accessed from the event handlers. It
+         * contains the following properties:
+         *
+         *       out:       onDragOut interactions
+         *       enter:     onDragEnter interactions
+         *       over:      onDragOver interactions
+         *       drop:      onDragDrop interactions
+         *       point:     The location of the cursor
+         *       draggedRegion: The location of dragged element at the time
+         *                      of the interaction
+         *       sourceRegion: The location of the source elemtn at the time
+         *                     of the interaction
+         *       validDrop: boolean
+         * @property interactionInfo
+         * @type object
+         * @static
+         */
+        interactionInfo: null,
 
-    /**
-     * Cached reference to the linked element
-     * @property _domRef
-     * @private
-     */
-    _domRef: null,
+        /**
+         * Called the first time an element is registered.
+         * @method init
+         * @private
+         * @static
+         */
+        init: function() {
+            this.initialized = true;
+        },
 
-    /**
-     * Internal typeof flag
-     * @property __ygDragDrop
-     * @private
-     */
-    __ygDragDrop: true,
+        /**
+         * In point mode, drag and drop interaction is defined by the 
+         * location of the cursor during the drag/drop
+         * @property POINT
+         * @type int
+         * @static
+         * @final
+         */
+        POINT: 0,
 
-    /**
-     * Set to true when horizontal contraints are applied
-     * @property constrainX
-     * @type boolean
-     * @private
-     */
-    constrainX: false,
+        /**
+         * In intersect mode, drag and drop interaction is defined by the 
+         * cursor position or the amount of overlap of two or more drag and 
+         * drop objects.
+         * @property INTERSECT
+         * @type int
+         * @static
+         * @final
+         */
+        INTERSECT: 1,
 
-    /**
-     * Set to true when vertical contraints are applied
-     * @property constrainY
-     * @type boolean
-     * @private
-     */
-    constrainY: false,
+        /**
+         * In intersect mode, drag and drop interaction is defined only by the 
+         * overlap of two or more drag and drop objects.
+         * @property STRICT_INTERSECT
+         * @type int
+         * @static
+         * @final
+         */
+        STRICT_INTERSECT: 2,
 
-    /**
-     * The left constraint
-     * @property minX
-     * @type int
-     * @private
-     */
-    minX: 0,
+        /**
+         * The current drag and drop mode.  Default: POINT
+         * @property mode
+         * @type int
+         * @static
+         */
+        mode: 0,
 
-    /**
-     * The right constraint
-     * @property maxX
-     * @type int
-     * @private
-     */
-    maxX: 0,
+        /**
+         * Runs method on all drag and drop objects
+         * @method _execOnAll
+         * @private
+         * @static
+         */
+        _execOnAll: function(sMethod, args) {
+            for (var i in this.ids) {
+                for (var j in this.ids[i]) {
+                    var oDD = this.ids[i][j];
+                    if (! this.isTypeOfDD(oDD)) {
+                        continue;
+                    }
+                    oDD[sMethod].apply(oDD, args);
+                }
+            }
+        },
 
-    /**
-     * The up constraint 
-     * @property minY
-     * @type int
-     * @type int
-     * @private
-     */
-    minY: 0,
+        /**
+         * Drag and drop initialization.  Sets up the global event handlers
+         * @method _onLoad
+         * @private
+         * @static
+         */
+        _onLoad: function() {
 
-    /**
-     * The down constraint 
-     * @property maxY
-     * @type int
-     * @private
-     */
-    maxY: 0,
+            this.init();
 
-    /**
-     * Maintain offsets when we resetconstraints.  Set to true when you want
-     * the position of the element relative to its parent to stay the same
-     * when the page changes
-     *
-     * @property maintainOffset
-     * @type boolean
-     */
-    maintainOffset: false,
+            YAHOO.log("DragDropMgr onload", "info", "DragDropMgr");
 
-    /**
-     * Array of pixel locations the element will snap to if we specified a 
-     * horizontal graduation/interval.  This array is generated automatically
-     * when you define a tick interval.
-     * @property xTicks
-     * @type int[]
-     */
-    xTicks: null,
+            Event.on(document, "mouseup",   this.handleMouseUp, this, true);
+            Event.on(document, "mousemove", this.handleMouseMove, this, true);
+            Event.on(window,   "unload",    this._onUnload, this, true);
+            Event.on(window,   "resize",    this._onResize, this, true);
+            // Event.on(window,   "mouseout",    this._test);
 
-    /**
-     * Array of pixel locations the element will snap to if we specified a 
-     * vertical graduation/interval.  This array is generated automatically 
-     * when you define a tick interval.
-     * @property yTicks
-     * @type int[]
-     */
-    yTicks: null,
+        },
 
-    /**
-     * By default the drag and drop instance will only respond to the primary
-     * button click (left button for a right-handed mouse).  Set to true to
-     * allow drag and drop to start with any mouse click that is propogated
-     * by the browser
-     * @property primaryButtonOnly
-     * @type boolean
-     */
-    primaryButtonOnly: true,
+        /**
+         * Reset constraints on all drag and drop objs
+         * @method _onResize
+         * @private
+         * @static
+         */
+        _onResize: function(e) {
+            YAHOO.log("window resize", "info", "DragDropMgr");
+            this._execOnAll("resetConstraints", []);
+        },
 
-    /**
-     * The availabe property is false until the linked dom element is accessible.
-     * @property available
-     * @type boolean
-     */
-    available: false,
+        /**
+         * Lock all drag and drop functionality
+         * @method lock
+         * @static
+         */
+        lock: function() { this.locked = true; },
 
-    /**
-     * By default, drags can only be initiated if the mousedown occurs in the
-     * region the linked element is.  This is done in part to work around a
-     * bug in some browsers that mis-report the mousedown if the previous
-     * mouseup happened outside of the window.  This property is set to true
-     * if outer handles are defined.
-     *
-     * @property hasOuterHandles
-     * @type boolean
-     * @default false
-     */
-    hasOuterHandles: false,
+        /**
+         * Unlock all drag and drop functionality
+         * @method unlock
+         * @static
+         */
+        unlock: function() { this.locked = false; },
 
-    /**
-     * Code that executes immediately before the startDrag event
-     * @method b4StartDrag
-     * @private
-     */
-    b4StartDrag: function(x, y) { },
+        /**
+         * Is drag and drop locked?
+         * @method isLocked
+         * @return {boolean} True if drag and drop is locked, false otherwise.
+         * @static
+         */
+        isLocked: function() { return this.locked; },
 
-    /**
-     * Abstract method called after a drag/drop object is clicked
-     * and the drag or mousedown time thresholds have beeen met.
-     * @method startDrag
-     * @param {int} X click location
-     * @param {int} Y click location
-     */
-    startDrag: function(x, y) { /* override this */ },
+        /**
+         * Location cache that is set for all drag drop objects when a drag is
+         * initiated, cleared when the drag is finished.
+         * @property locationCache
+         * @private
+         * @static
+         */
+        locationCache: {},
 
-    /**
-     * Code that executes immediately before the onDrag event
-     * @method b4Drag
-     * @private
-     */
-    b4Drag: function(e) { },
+        /**
+         * Set useCache to false if you want to force object the lookup of each
+         * drag and drop linked element constantly during a drag.
+         * @property useCache
+         * @type boolean
+         * @static
+         */
+        useCache: true,
 
-    /**
-     * Abstract method called during the onMouseMove event while dragging an 
-     * object.
-     * @method onDrag
-     * @param {Event} e the mousemove event
-     */
-    onDrag: function(e) { /* override this */ },
+        /**
+         * The number of pixels that the mouse needs to move after the 
+         * mousedown before the drag is initiated.  Default=3;
+         * @property clickPixelThresh
+         * @type int
+         * @static
+         */
+        clickPixelThresh: 3,
 
-    /**
-     * Abstract method called when this element fist begins hovering over 
-     * another DragDrop obj
-     * @method onDragEnter
-     * @param {Event} e the mousemove event
-     * @param {String|DragDrop[]} id In POINT mode, the element
-     * id this is hovering over.  In INTERSECT mode, an array of one or more 
-     * dragdrop items being hovered over.
-     */
-    onDragEnter: function(e, id) { /* override this */ },
+        /**
+         * The number of milliseconds after the mousedown event to initiate the
+         * drag if we don't get a mouseup event. Default=1000
+         * @property clickTimeThresh
+         * @type int
+         * @static
+         */
+        clickTimeThresh: 1000,
 
-    /**
-     * Code that executes immediately before the onDragOver event
-     * @method b4DragOver
-     * @private
-     */
-    b4DragOver: function(e) { },
+        /**
+         * Flag that indicates that either the drag pixel threshold or the 
+         * mousdown time threshold has been met
+         * @property dragThreshMet
+         * @type boolean
+         * @private
+         * @static
+         */
+        dragThreshMet: false,
 
-    /**
-     * Abstract method called when this element is hovering over another 
-     * DragDrop obj
-     * @method onDragOver
-     * @param {Event} e the mousemove event
-     * @param {String|DragDrop[]} id In POINT mode, the element
-     * id this is hovering over.  In INTERSECT mode, an array of dd items 
-     * being hovered over.
-     */
-    onDragOver: function(e, id) { /* override this */ },
+        /**
+         * Timeout used for the click time threshold
+         * @property clickTimeout
+         * @type Object
+         * @private
+         * @static
+         */
+        clickTimeout: null,
 
-    /**
-     * Code that executes immediately before the onDragOut event
-     * @method b4DragOut
-     * @private
-     */
-    b4DragOut: function(e) { },
+        /**
+         * The X position of the mousedown event stored for later use when a 
+         * drag threshold is met.
+         * @property startX
+         * @type int
+         * @private
+         * @static
+         */
+        startX: 0,
 
-    /**
-     * Abstract method called when we are no longer hovering over an element
-     * @method onDragOut
-     * @param {Event} e the mousemove event
-     * @param {String|DragDrop[]} id In POINT mode, the element
-     * id this was hovering over.  In INTERSECT mode, an array of dd items 
-     * that the mouse is no longer over.
-     */
-    onDragOut: function(e, id) { /* override this */ },
+        /**
+         * The Y position of the mousedown event stored for later use when a 
+         * drag threshold is met.
+         * @property startY
+         * @type int
+         * @private
+         * @static
+         */
+        startY: 0,
 
-    /**
-     * Code that executes immediately before the onDragDrop event
-     * @method b4DragDrop
-     * @private
-     */
-    b4DragDrop: function(e) { },
+        /**
+         * Each DragDrop instance must be registered with the DragDropMgr.  
+         * This is executed in DragDrop.init()
+         * @method regDragDrop
+         * @param {DragDrop} oDD the DragDrop object to register
+         * @param {String} sGroup the name of the group this element belongs to
+         * @static
+         */
+        regDragDrop: function(oDD, sGroup) {
+            if (!this.initialized) { this.init(); }
+            
+            if (!this.ids[sGroup]) {
+                this.ids[sGroup] = {};
+            }
+            this.ids[sGroup][oDD.id] = oDD;
+        },
 
-    /**
-     * Abstract method called when this item is dropped on another DragDrop 
-     * obj
-     * @method onDragDrop
-     * @param {Event} e the mouseup event
-     * @param {String|DragDrop[]} id In POINT mode, the element
-     * id this was dropped on.  In INTERSECT mode, an array of dd items this 
-     * was dropped on.
-     */
-    onDragDrop: function(e, id) { /* override this */ },
+        /**
+         * Removes the supplied dd instance from the supplied group. Executed
+         * by DragDrop.removeFromGroup, so don't call this function directly.
+         * @method removeDDFromGroup
+         * @private
+         * @static
+         */
+        removeDDFromGroup: function(oDD, sGroup) {
+            if (!this.ids[sGroup]) {
+                this.ids[sGroup] = {};
+            }
 
-    /**
-     * Abstract method called when this item is dropped on an area with no
-     * drop target
-     * @method onInvalidDrop
-     * @param {Event} e the mouseup event
-     */
-    onInvalidDrop: function(e) { /* override this */ },
+            var obj = this.ids[sGroup];
+            if (obj && obj[oDD.id]) {
+                delete obj[oDD.id];
+            }
+        },
 
-    /**
-     * Code that executes immediately before the endDrag event
-     * @method b4EndDrag
-     * @private
-     */
-    b4EndDrag: function(e) { },
+        /**
+         * Unregisters a drag and drop item.  This is executed in 
+         * DragDrop.unreg, use that method instead of calling this directly.
+         * @method _remove
+         * @private
+         * @static
+         */
+        _remove: function(oDD) {
+            for (var g in oDD.groups) {
+                if (g && this.ids[g][oDD.id]) {
+                    delete this.ids[g][oDD.id];
+                    //YAHOO.log("NEW LEN " + this.ids.length, "warn");
+                }
+            }
+            delete this.handleIds[oDD.id];
+        },
 
-    /**
-     * Fired when we are done dragging the object
-     * @method endDrag
-     * @param {Event} e the mouseup event
-     */
-    endDrag: function(e) { /* override this */ },
+        /**
+         * Each DragDrop handle element must be registered.  This is done
+         * automatically when executing DragDrop.setHandleElId()
+         * @method regHandle
+         * @param {String} sDDId the DragDrop id this element is a handle for
+         * @param {String} sHandleId the id of the element that is the drag 
+         * handle
+         * @static
+         */
+        regHandle: function(sDDId, sHandleId) {
+            if (!this.handleIds[sDDId]) {
+                this.handleIds[sDDId] = {};
+            }
+            this.handleIds[sDDId][sHandleId] = sHandleId;
+        },
 
-    /**
-     * Code executed immediately before the onMouseDown event
-     * @method b4MouseDown
-     * @param {Event} e the mousedown event
-     * @private
-     */
-    b4MouseDown: function(e) {  },
+        /**
+         * Utility function to determine if a given element has been 
+         * registered as a drag drop item.
+         * @method isDragDrop
+         * @param {String} id the element id to check
+         * @return {boolean} true if this element is a DragDrop item, 
+         * false otherwise
+         * @static
+         */
+        isDragDrop: function(id) {
+            return ( this.getDDById(id) ) ? true : false;
+        },
 
-    /**
-     * Event handler that fires when a drag/drop obj gets a mousedown
-     * @method onMouseDown
-     * @param {Event} e the mousedown event
-     */
-    onMouseDown: function(e) { /* override this */ },
+        /**
+         * Returns the drag and drop instances that are in all groups the
+         * passed in instance belongs to.
+         * @method getRelated
+         * @param {DragDrop} p_oDD the obj to get related data for
+         * @param {boolean} bTargetsOnly if true, only return targetable objs
+         * @return {DragDrop[]} the related instances
+         * @static
+         */
+        getRelated: function(p_oDD, bTargetsOnly) {
+            var oDDs = [];
+            for (var i in p_oDD.groups) {
+                for (j in this.ids[i]) {
+                    var dd = this.ids[i][j];
+                    if (! this.isTypeOfDD(dd)) {
+                        continue;
+                    }
+                    if (!bTargetsOnly || dd.isTarget) {
+                        oDDs[oDDs.length] = dd;
+                    }
+                }
+            }
 
-    /**
-     * Event handler that fires when a drag/drop obj gets a mouseup
-     * @method onMouseUp
-     * @param {Event} e the mouseup event
-     */
-    onMouseUp: function(e) { /* override this */ },
-   
-    /**
-     * Override the onAvailable method to do what is needed after the initial
-     * position was determined.
-     * @method onAvailable
-     */
-    onAvailable: function () { 
-        this.logger.log("onAvailable (base)"); 
-    },
+            return oDDs;
+        },
 
-    /**
-     * Returns a reference to the linked element
-     * @method getEl
-     * @return {HTMLElement} the html element 
-     */
-    getEl: function() { 
-        if (!this._domRef) {
-            this._domRef = Dom.get(this.id); 
-        }
+        /**
+         * Returns true if the specified dd target is a legal target for 
+         * the specifice drag obj
+         * @method isLegalTarget
+         * @param {DragDrop} the drag obj
+         * @param {DragDrop} the target
+         * @return {boolean} true if the target is a legal target for the 
+         * dd obj
+         * @static
+         */
+        isLegalTarget: function (oDD, oTargetDD) {
+            var targets = this.getRelated(oDD, true);
+            for (var i=0, len=targets.length;i<len;++i) {
+                if (targets[i].id == oTargetDD.id) {
+                    return true;
+                }
+            }
 
-        return this._domRef;
-    },
+            return false;
+        },
 
-    /**
-     * Returns a reference to the actual element to drag.  By default this is
-     * the same as the html element, but it can be assigned to another 
-     * element. An example of this can be found in YAHOO.util.DDProxy
-     * @method getDragEl
-     * @return {HTMLElement} the html element 
-     */
-    getDragEl: function() {
-        return Dom.get(this.dragElId);
-    },
+        /**
+         * My goal is to be able to transparently determine if an object is
+         * typeof DragDrop, and the exact subclass of DragDrop.  typeof 
+         * returns "object", oDD.constructor.toString() always returns
+         * "DragDrop" and not the name of the subclass.  So for now it just
+         * evaluates a well-known variable in DragDrop.
+         * @method isTypeOfDD
+         * @param {Object} the object to evaluate
+         * @return {boolean} true if typeof oDD = DragDrop
+         * @static
+         */
+        isTypeOfDD: function (oDD) {
+            return (oDD && oDD.__ygDragDrop);
+        },
+
+        /**
+         * Utility function to determine if a given element has been 
+         * registered as a drag drop handle for the given Drag Drop object.
+         * @method isHandle
+         * @param {String} id the element id to check
+         * @return {boolean} true if this element is a DragDrop handle, false 
+         * otherwise
+         * @static
+         */
+        isHandle: function(sDDId, sHandleId) {
+            return ( this.handleIds[sDDId] && 
+                            this.handleIds[sDDId][sHandleId] );
+        },
+
+        /**
+         * Returns the DragDrop instance for a given id
+         * @method getDDById
+         * @param {String} id the id of the DragDrop object
+         * @return {DragDrop} the drag drop object, null if it is not found
+         * @static
+         */
+        getDDById: function(id) {
+            for (var i in this.ids) {
+                if (this.ids[i][id]) {
+                    return this.ids[i][id];
+                }
+            }
+            return null;
+        },
+
+        /**
+         * Fired after a registered DragDrop object gets the mousedown event.
+         * Sets up the events required to track the object being dragged
+         * @method handleMouseDown
+         * @param {Event} e the event
+         * @param oDD the DragDrop object being dragged
+         * @private
+         * @static
+         */
+        handleMouseDown: function(e, oDD) {
+
+            this.currentTarget = YAHOO.util.Event.getTarget(e);
+
+            this.dragCurrent = oDD;
+
+            var el = oDD.getEl();
+
+            // track start position
+            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 );
+        },
+
+        /**
+         * Fired when either the drag pixel threshol or the mousedown hold 
+         * time threshold has been met.
+         * @method startDrag
+         * @param x {int} the X position of the original mousedown
+         * @param y {int} the Y position of the original mousedown
+         * @static
+         */
+        startDrag: function(x, y) {
+            YAHOO.log("firing drag start events", "info", "DragDropMgr");
+            clearTimeout(this.clickTimeout);
+            var dc = this.dragCurrent;
+            if (dc) {
+                dc.b4StartDrag(x, y);
+            }
+            if (dc) {
+                dc.startDrag(x, y);
+            }
+            this.dragThreshMet = true;
+        },
 
-    /**
-     * Sets up the DragDrop object.  Must be called in the constructor of any
-     * YAHOO.util.DragDrop subclass
-     * @method init
-     * @param id the id of the linked element
-     * @param {String} sGroup the group of related items
-     * @param {object} config configuration attributes
-     */
-    init: function(id, sGroup, config) {
-        this.initTarget(id, sGroup, config);
-        Event.on(this.id, "mousedown", this.handleMouseDown, this, true);
-        // Event.on(this.id, "selectstart", Event.preventDefault);
-    },
+        /**
+         * Internal function to handle the mouseup event.  Will be invoked 
+         * from the context of the document.
+         * @method handleMouseUp
+         * @param {Event} e the event
+         * @private
+         * @static
+         */
+        handleMouseUp: function(e) {
+            if (this.dragCurrent) {
+                clearTimeout(this.clickTimeout);
 
-    /**
-     * Initializes Targeting functionality only... the object does not
-     * get a mousedown handler.
-     * @method initTarget
-     * @param id the id of the linked element
-     * @param {String} sGroup the group of related items
-     * @param {object} config configuration attributes
-     */
-    initTarget: function(id, sGroup, config) {
+                if (this.dragThreshMet) {
+                    YAHOO.log("mouseup detected - completing drag", "info", "DragDropMgr");
+                    this.fireEvents(e, true);
+                } else {
+                    YAHOO.log("drag threshold not met", "info", "DragDropMgr");
+                }
 
-        // configuration attributes 
-        this.config = config || {};
+                this.stopDrag(e);
 
-        // create a local reference to the drag and drop manager
-        this.DDM = YAHOO.util.DDM;
-        // initialize the groups array
-        this.groups = {};
+                this.stopEvent(e);
+            }
+        },
 
-        // assume that we have an element reference instead of an id if the
-        // parameter is not a string
-        if (typeof id !== "string") {
-            YAHOO.log("id is not a string, assuming it is an HTMLElement");
-            id = Dom.generateId(id);
-        }
+        /**
+         * Utility to stop event propagation and event default, if these 
+         * features are turned on.
+         * @method stopEvent
+         * @param {Event} e the event as returned by this.getEvent()
+         * @static
+         */
+        stopEvent: function(e) {
+            if (this.stopPropagation) {
+                YAHOO.util.Event.stopPropagation(e);
+            }
 
-        // set the id
-        this.id = id;
+            if (this.preventDefault) {
+                YAHOO.util.Event.preventDefault(e);
+            }
+        },
 
-        // add to an interaction group
-        this.addToGroup((sGroup) ? sGroup : "default");
+        /** 
+         * Ends the current drag, cleans up the state, and fires the endDrag
+         * and mouseUp events.  Called internally when a mouseup is detected
+         * during the drag.  Can be fired manually during the drag by passing
+         * either another event (such as the mousemove event received in onDrag)
+         * or a fake event with pageX and pageY defined (so that endDrag and
+         * onMouseUp have usable position data.).  Alternatively, pass true
+         * for the silent parameter so that the endDrag and onMouseUp events
+         * are skipped (so no event data is needed.)
+         *
+         * @method stopDrag
+         * @param {Event} e the mouseup event, another event (or a fake event) 
+         *                  with pageX and pageY defined, or nothing if the 
+         *                  silent parameter is true
+         * @param {boolean} silent skips the enddrag and mouseup events if true
+         * @static
+         */
+        stopDrag: function(e, silent) {
+            // YAHOO.log("mouseup - removing event handlers");
 
-        // We don't want to register this as the handle with the manager
-        // so we just set the id rather than calling the setter.
-        this.handleElId = id;
+            // Fire the drag end event for the item that was dragged
+            if (this.dragCurrent && !silent) {
+                if (this.dragThreshMet) {
+                    YAHOO.log("firing endDrag events", "info", "DragDropMgr");
+                    this.dragCurrent.b4EndDrag(e);
+                    this.dragCurrent.endDrag(e);
+                }
 
-        Event.onAvailable(id, this.handleOnAvailable, this, true);
+                YAHOO.log("firing dragdrop onMouseUp event", "info", "DragDropMgr");
+                this.dragCurrent.onMouseUp(e);
+            }
 
-        // create a logger instance
-        this.logger = (YAHOO.widget.LogWriter) ? 
-                new YAHOO.widget.LogWriter(this.toString()) : YAHOO;
+            this.dragCurrent = null;
+            this.dragOvers = {};
+        },
 
-        // the linked element is the element that gets dragged by default
-        this.setDragElId(id); 
+        /** 
+         * Internal function to handle the mousemove event.  Will be invoked 
+         * from the context of the html element.
+         *
+         * @TODO figure out what we can do about mouse events lost when the 
+         * user drags objects beyond the window boundary.  Currently we can 
+         * detect this in internet explorer by verifying that the mouse is 
+         * down during the mousemove event.  Firefox doesn't give us the 
+         * button state on the mousemove event.
+         * @method handleMouseMove
+         * @param {Event} e the event
+         * @private
+         * @static
+         */
+        handleMouseMove: function(e) {
+            //YAHOO.log("handlemousemove");
+            
+            var dc = this.dragCurrent;
+            if (dc) {
+                // YAHOO.log("no current drag obj");
 
-        // by default, clicked anchors will not start drag operations. 
-        // @TODO what else should be here?  Probably form fields.
-        this.invalidHandleTypes = { A: "A" };
-        this.invalidHandleIds = {};
-        this.invalidHandleClasses = [];
+                // var button = e.which || e.button;
+                // YAHOO.log("which: " + e.which + ", button: "+ e.button);
 
-        this.applyConfig();
-    },
+                // check for IE mouseup outside of page boundary
+                if (YAHOO.util.Event.isIE && !e.button) {
+                    YAHOO.log("button failure", "info", "DragDropMgr");
+                    this.stopEvent(e);
+                    return this.handleMouseUp(e);
+                }
 
-    /**
-     * Applies the configuration parameters that were passed into the constructor.
-     * This is supposed to happen at each level through the inheritance chain.  So
-     * a DDProxy implentation will execute apply config on DDProxy, DD, and 
-     * DragDrop in order to get all of the parameters that are available in
-     * each object.
-     * @method applyConfig
-     */
-    applyConfig: function() {
+                if (!this.dragThreshMet) {
+                    var diffX = Math.abs(this.startX - YAHOO.util.Event.getPageX(e));
+                    var diffY = Math.abs(this.startY - YAHOO.util.Event.getPageY(e));
+                    // YAHOO.log("diffX: " + diffX + "diffY: " + diffY);
+                    if (diffX > this.clickPixelThresh || 
+                                diffY > this.clickPixelThresh) {
+                        YAHOO.log("pixel threshold met", "info", "DragDropMgr");
+                        this.startDrag(this.startX, this.startY);
+                    }
+                }
 
-        // configurable properties: 
-        //    padding, isTarget, maintainOffset, primaryButtonOnly
-        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);
+                if (this.dragThreshMet) {
+                    dc.b4Drag(e);
+                    if (dc) {
+                        dc.onDrag(e);
+                    }
+                    if (dc) {
+                        this.fireEvents(e, false);
+                    }
+                }
 
-    },
+                this.stopEvent(e);
+            }
+        },
 
-    /**
-     * Executed when the linked element is available
-     * @method handleOnAvailable
-     * @private
-     */
-    handleOnAvailable: function() {
-        this.logger.log("handleOnAvailable");
-        this.available = true;
-        this.resetConstraints();
-        this.onAvailable();
-    },
+        /**
+         * Iterates over all of the DragDrop elements to find ones we are 
+         * hovering over or dropping on
+         * @method fireEvents
+         * @param {Event} e the event
+         * @param {boolean} isDrop is this a drop op or a mouseover op?
+         * @private
+         * @static
+         */
+        fireEvents: function(e, isDrop) {
+            var dc = this.dragCurrent;
 
-     /**
-     * Configures the padding for the target zone in px.  Effectively expands
-     * (or reduces) the virtual object size for targeting calculations.  
-     * Supports css-style shorthand; if only one parameter is passed, all sides
-     * will have that padding, and if only two are passed, the top and bottom
-     * will have the first param, the left and right the second.
-     * @method setPadding
-     * @param {int} iTop    Top pad
-     * @param {int} iRight  Right pad
-     * @param {int} iBot    Bot pad
-     * @param {int} iLeft   Left pad
-     */
-    setPadding: function(iTop, iRight, iBot, iLeft) {
-        // this.padding = [iLeft, iRight, iTop, iBot];
-        if (!iRight && 0 !== iRight) {
-            this.padding = [iTop, iTop, iTop, iTop];
-        } else if (!iBot && 0 !== iBot) {
-            this.padding = [iTop, iRight, iTop, iRight];
-        } else {
-            this.padding = [iTop, iRight, iBot, iLeft];
-        }
-    },
+            // If the user did the mouse up outside of the window, we could 
+            // get here even though we have ended the drag.
+            if (!dc || dc.isLocked()) {
+                return;
+            }
 
-    /**
-     * Stores the initial placement of the linked element.
-     * @method setInitialPosition
-     * @param {int} diffX   the X offset, default 0
-     * @param {int} diffY   the Y offset, default 0
-     */
-    setInitPosition: function(diffX, diffY) {
-        var el = this.getEl();
+            var x = YAHOO.util.Event.getPageX(e);
+            var y = YAHOO.util.Event.getPageY(e);
+            var pt = new YAHOO.util.Point(x,y);
+            var pos = dc.getTargetCoord(pt.x, pt.y);
+            var el = dc.getDragEl();
+            curRegion = new YAHOO.util.Region( pos.y, 
+                                               pos.x + el.offsetWidth,
+                                               pos.y + el.offsetHeight, 
+                                               pos.x );
+            // cache the previous dragOver array
+            var oldOvers = [];
 
-        if (!this.DDM.verifyEl(el)) {
-            this.logger.log(this.id + " element is broken");
-            return;
-        }
+            var outEvts   = [];
+            var overEvts  = [];
+            var dropEvts  = [];
+            var enterEvts = [];
 
-        var dx = diffX || 0;
-        var dy = diffY || 0;
 
-        var p = Dom.getXY( el );
+            // Check to see if the object(s) we were hovering over is no longer 
+            // being hovered over so we can fire the onDragOut event
+            for (var i in this.dragOvers) {
 
-        this.initPageX = p[0] - dx;
-        this.initPageY = p[1] - dy;
+                var ddo = this.dragOvers[i];
 
-        this.lastPageX = p[0];
-        this.lastPageY = p[1];
+                if (! this.isTypeOfDD(ddo)) {
+                    continue;
+                }
 
-        this.logger.log(this.id + " inital position: " + this.initPageX + 
-                ", " + this.initPageY);
+                if (! this.isOverTarget(pt, ddo, this.mode, curRegion)) {
+                    outEvts.push( ddo );
+                }
 
+                oldOvers[i] = true;
+                delete this.dragOvers[i];
+            }
 
-        this.setStartPosition(p);
-    },
+            for (var sGroup in dc.groups) {
+                // YAHOO.log("Processing group " + sGroup);
+                
+                if ("string" != typeof sGroup) {
+                    continue;
+                }
 
-    /**
-     * Sets the start position of the element.  This is set when the obj
-     * is initialized, the reset when a drag is started.
-     * @method setStartPosition
-     * @param pos current position (from previous lookup)
-     * @private
-     */
-    setStartPosition: function(pos) {
-        var p = pos || Dom.getXY( this.getEl() );
+                for (i in this.ids[sGroup]) {
+                    var oDD = this.ids[sGroup][i];
+                    if (! this.isTypeOfDD(oDD)) {
+                        continue;
+                    }
 
-        this.deltaSetXY = null;
+                    if (oDD.isTarget && !oDD.isLocked() && oDD != dc) {
+                        if (this.isOverTarget(pt, oDD, this.mode, curRegion)) {
+                            // look for drop interactions
+                            if (isDrop) {
+                                dropEvts.push( oDD );
+                            // look for drag enter and drag over interactions
+                            } else {
 
-        this.startPageX = p[0];
-        this.startPageY = p[1];
-    },
+                                // initial drag over: dragEnter fires
+                                if (!oldOvers[oDD.id]) {
+                                    enterEvts.push( oDD );
+                                // subsequent drag overs: dragOver fires
+                                } else {
+                                    overEvts.push( oDD );
+                                }
 
-    /**
-     * Add this instance to a group of related drag/drop objects.  All 
-     * instances belong to at least one group, and can belong to as many 
-     * groups as needed.
-     * @method addToGroup
-     * @param sGroup {string} the name of the group
-     */
-    addToGroup: function(sGroup) {
-        this.groups[sGroup] = true;
-        this.DDM.regDragDrop(this, sGroup);
-    },
+                                this.dragOvers[oDD.id] = oDD;
+                            }
+                        }
+                    }
+                }
+            }
 
-    /**
-     * Remove's this instance from the supplied interaction group
-     * @method removeFromGroup
-     * @param {string}  sGroup  The group to drop
-     */
-    removeFromGroup: function(sGroup) {
-        this.logger.log("Removing from group: " + sGroup);
-        if (this.groups[sGroup]) {
-            delete this.groups[sGroup];
-        }
+            this.interactionInfo = {
+                out:       outEvts,
+                enter:     enterEvts,
+                over:      overEvts,
+                drop:      dropEvts,
+                point:     pt,
+                draggedRegion:    curRegion,
+                sourceRegion: this.locationCache[dc.id],
+                validDrop: isDrop
+            };
 
-        this.DDM.removeDDFromGroup(this, sGroup);
-    },
+            // notify about a drop that did not find a target
+            if (isDrop && !dropEvts.length) {
+                YAHOO.log(dc.id + " dropped, but not on a target", "info", "DragDropMgr");
+                this.interactionInfo.validDrop = false;
+                dc.onInvalidDrop(e);
+            }
 
-    /**
-     * Allows you to specify that an element other than the linked element 
-     * will be moved with the cursor during a drag
-     * @method setDragElId
-     * @param id {string} the id of the element that will be used to initiate the drag
-     */
-    setDragElId: function(id) {
-        this.dragElId = id;
-    },
 
-    /**
-     * Allows you to specify a child of the linked element that should be 
-     * used to initiate the drag operation.  An example of this would be if 
-     * you have a content div with text and links.  Clicking anywhere in the 
-     * content area would normally start the drag operation.  Use this method
-     * to specify that an element inside of the content div is the element 
-     * that starts the drag operation.
-     * @method setHandleElId
-     * @param id {string} the id of the element that will be used to 
-     * initiate the drag.
-     */
-    setHandleElId: function(id) {
-        if (typeof id !== "string") {
-            YAHOO.log("id is not a string, assuming it is an HTMLElement");
-            id = Dom.generateId(id);
-        }
-        this.handleElId = id;
-        this.DDM.regHandle(this.id, id);
-    },
+            if (this.mode) {
+                if (outEvts.length) {
+                    YAHOO.log(dc.id+" onDragOut: " + outEvts, "info", "DragDropMgr");
+                    dc.b4DragOut(e, outEvts);
+                    if (dc) {
+                        dc.onDragOut(e, outEvts);
+                    }
+                }
 
-    /**
-     * Allows you to set an element outside of the linked element as a drag 
-     * handle
-     * @method setOuterHandleElId
-     * @param id the id of the element that will be used to initiate the drag
-     */
-    setOuterHandleElId: function(id) {
-        if (typeof id !== "string") {
-            YAHOO.log("id is not a string, assuming it is an HTMLElement");
-            id = Dom.generateId(id);
-        }
-        this.logger.log("Adding outer handle event: " + id);
-        Event.on(id, "mousedown", 
-                this.handleMouseDown, this, true);
-        this.setHandleElId(id);
+                if (enterEvts.length) {
+                    YAHOO.log(dc.id+" onDragEnter: " + enterEvts, "info", "DragDropMgr");
+                    if (dc) {
+                        dc.onDragEnter(e, enterEvts);
+                    }
+                }
 
-        this.hasOuterHandles = true;
-    },
+                if (overEvts.length) {
+                    YAHOO.log(dc.id+" onDragOver: " + overEvts, "info", "DragDropMgr");
+                    if (dc) {
+                        dc.b4DragOver(e, overEvts);
+                    }
 
-    /**
-     * Remove all drag and drop hooks for this element
-     * @method unreg
-     */
-    unreg: function() {
-        this.logger.log("DragDrop obj cleanup " + this.id);
-        Event.removeListener(this.id, "mousedown", 
-                this.handleMouseDown);
-        this._domRef = null;
-        this.DDM._remove(this);
-    },
+                    if (dc) {
+                        dc.onDragOver(e, overEvts);
+                    }
+                }
 
-    /**
-     * Returns true if this instance is locked, or the drag drop mgr is locked
-     * (meaning that all drag/drop is disabled on the page.)
-     * @method isLocked
-     * @return {boolean} true if this obj or all drag/drop is locked, else 
-     * false
-     */
-    isLocked: function() {
-        return (this.DDM.isLocked() || this.locked);
-    },
+                if (dropEvts.length) {
+                    YAHOO.log(dc.id+" onDragDrop: " + dropEvts, "info", "DragDropMgr");
+                    if (dc) {
+                        dc.b4DragDrop(e, dropEvts);
+                    }
+                    if (dc) {
+                        dc.onDragDrop(e, dropEvts);
+                    }
+                }
 
-    /**
-     * Fired when this object is clicked
-     * @method handleMouseDown
-     * @param {Event} e 
-     * @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj)
-     * @private
-     */
-    handleMouseDown: function(e, oDD) {
+            } else {
+                // fire dragout events
+                var len = 0;
+                for (i=0, len=outEvts.length; i<len; ++i) {
+                    YAHOO.log(dc.id+" onDragOut: " + outEvts[i].id, "info", "DragDropMgr");
+                    if (dc) {
+                        dc.b4DragOut(e, outEvts[i].id);
+                    }
+                    if (dc) {
+                        dc.onDragOut(e, outEvts[i].id);
+                    }
+                }
+                 
+                // fire enter events
+                for (i=0,len=enterEvts.length; i<len; ++i) {
+                    YAHOO.log(dc.id + " onDragEnter " + enterEvts[i].id, "info", "DragDropMgr");
+                    // dc.b4DragEnter(e, oDD.id);
 
-        var button = e.which || e.button;
-        this.logger.log("button: " + button);
+                    if (dc) {
+                        dc.onDragEnter(e, enterEvts[i].id);
+                    }
+                }
+         
+                // fire over events
+                for (i=0,len=overEvts.length; i<len; ++i) {
+                    YAHOO.log(dc.id + " onDragOver " + overEvts[i].id, "info", "DragDropMgr");
+                    if (dc) {
+                        dc.b4DragOver(e, overEvts[i].id);
+                    }
+                    if (dc) {
+                        dc.onDragOver(e, overEvts[i].id);
+                    }
+                }
 
-        if (this.primaryButtonOnly && button > 1) {
-            this.logger.log("Mousedown was not produced by the primary button");
-            return;
-        }
+                // fire drop events
+                for (i=0, len=dropEvts.length; i<len; ++i) {
+                    YAHOO.log(dc.id + " dropped on " + dropEvts[i].id, "info", "DragDropMgr");
+                    if (dc) {
+                        dc.b4DragDrop(e, dropEvts[i].id);
+                    }
+                    if (dc) {
+                        dc.onDragDrop(e, dropEvts[i].id);
+                    }
+                }
 
-        if (this.isLocked()) {
-            this.logger.log("Drag and drop is disabled, aborting");
-            return;
-        }
+            }
+        },
 
-        this.logger.log("mousedown " + this.id);
-        this.DDM.refreshCache(this.groups);
-        // var self = this;
-        // setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0);
+        /**
+         * Helper function for getting the best match from the list of drag 
+         * and drop objects returned by the drag and drop events when we are 
+         * in INTERSECT mode.  It returns either the first object that the 
+         * cursor is over, or the object that has the greatest overlap with 
+         * the dragged element.
+         * @method getBestMatch
+         * @param  {DragDrop[]} dds The array of drag and drop objects 
+         * targeted
+         * @return {DragDrop}       The best single match
+         * @static
+         */
+        getBestMatch: function(dds) {
+            var winner = null;
 
-        // Only process the event if we really clicked within the linked 
-        // element.  The reason we make this check is that in the case that 
-        // another element was moved between the clicked element and the 
-        // cursor in the time between the mousedown and mouseup events. When 
-        // this happens, the element gets the next mousedown event 
-        // regardless of where on the screen it happened.  
-        var pt = new YAHOO.util.Point(Event.getPageX(e), Event.getPageY(e));
-        if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) )  {
-                this.logger.log("Click was not over the element: " + this.id);
-        } else {
-            if (this.clickValidator(e)) {
+            var len = dds.length;
 
-                this.logger.log("click was a valid handle");
+            if (len == 1) {
+                winner = dds[0];
+            } else {
+                // Loop through the targeted items
+                for (var i=0; i<len; ++i) {
+                    var dd = dds[i];
+                    // If the cursor is over the object, it wins.  If the 
+                    // cursor is over multiple matches, the first one we come
+                    // to wins.
+                    if (this.mode == this.INTERSECT && dd.cursorIsOver) {
+                        winner = dd;
+                        break;
+                    // Otherwise the object with the most overlap wins
+                    } else {
+                        if (!winner || !winner.overlap || (dd.overlap &&
+                            winner.overlap.getArea() < dd.overlap.getArea())) {
+                            winner = dd;
+                        }
+                    }
+                }
+            }
 
-                // set the initial element position
-                this.setStartPosition();
+            return winner;
+        },
+
+        /**
+         * Refreshes the cache of the top-left and bottom-right points of the 
+         * drag and drop objects in the specified group(s).  This is in the
+         * format that is stored in the drag and drop instance, so typical 
+         * usage is:
+         * <code>
+         * YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups);
+         * </code>
+         * Alternatively:
+         * <code>
+         * YAHOO.util.DragDropMgr.refreshCache({group1:true, group2:true});
+         * </code>
+         * @TODO this really should be an indexed array.  Alternatively this
+         * method could accept both.
+         * @method refreshCache
+         * @param {Object} groups an associative array of groups to refresh
+         * @static
+         */
+        refreshCache: function(groups) {
+            YAHOO.log("refreshing element location cache", "info", "DragDropMgr");
 
-                this.logger.log("firing onMouseDown events");
+            // refresh everything if group array is not provided
+            var g = groups || this.ids;
 
-                this.b4MouseDown(e);
-                this.onMouseDown(e);
-                this.DDM.handleMouseDown(e, this);
+            for (var sGroup in g) {
+                if ("string" != typeof sGroup) {
+                    continue;
+                }
+                for (var i in this.ids[sGroup]) {
+                    var oDD = this.ids[sGroup][i];
 
-                this.DDM.stopEvent(e);
-            } else {
+                    if (this.isTypeOfDD(oDD)) {
+                        var loc = this.getLocation(oDD);
+                        if (loc) {
+                            this.locationCache[oDD.id] = loc;
+                        } else {
+                            delete this.locationCache[oDD.id];
+YAHOO.log("Could not get the loc for " + oDD.id, "warn", "DragDropMgr");
+                        }
+                    }
+                }
+            }
+        },
 
-this.logger.log("clickValidator returned false, drag not initiated");
+        /**
+         * This checks to make sure an element exists and is in the DOM.  The
+         * main purpose is to handle cases where innerHTML is used to remove
+         * drag and drop objects from the DOM.  IE provides an 'unspecified
+         * error' when trying to access the offsetParent of such an element
+         * @method verifyEl
+         * @param {HTMLElement} el the element to check
+         * @return {boolean} true if the element looks usable
+         * @static
+         */
+        verifyEl: function(el) {
+            try {
+                if (el) {
+                    var parent = el.offsetParent;
+                    if (parent) {
+                        return true;
+                    }
+                }
+            } catch(e) {
+                YAHOO.log("detected problem with an element", "info", "DragDropMgr");
+            }
 
+            return false;
+        },
+        
+        /**
+         * Returns a Region object containing the drag and drop element's position
+         * and size, including the padding configured for it
+         * @method getLocation
+         * @param {DragDrop} oDD the drag and drop object to get the 
+         *                       location for
+         * @return {YAHOO.util.Region} a Region object representing the total area
+         *                             the element occupies, including any padding
+         *                             the instance is configured for.
+         * @static
+         */
+        getLocation: function(oDD) {
+            if (! this.isTypeOfDD(oDD)) {
+                YAHOO.log(oDD + " is not a DD obj", "info", "DragDropMgr");
+                return null;
             }
-        }
-    },
 
-    clickValidator: function(e) {
-        var target = Event.getTarget(e);
-        return ( this.isValidHandleChild(target) &&
-                    (this.id == this.handleElId || 
-                        this.DDM.handleWasClicked(target, this.id)) );
-    },
+            var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;
 
-    /**
-     * Allows you to specify a tag name that should not start a drag operation
-     * when clicked.  This is designed to facilitate embedding links within a
-     * drag handle that do something other than start the drag.
-     * @method addInvalidHandleType
-     * @param {string} tagName the type of element to exclude
-     */
-    addInvalidHandleType: function(tagName) {
-        var type = tagName.toUpperCase();
-        this.invalidHandleTypes[type] = type;
-    },
+            try {
+                pos= YAHOO.util.Dom.getXY(el);
+            } catch (e) { }
 
-    /**
-     * Lets you to specify an element id for a child of a drag handle
-     * that should not initiate a drag
-     * @method addInvalidHandleId
-     * @param {string} id the element id of the element you wish to ignore
-     */
-    addInvalidHandleId: function(id) {
-        if (typeof id !== "string") {
-            YAHOO.log("id is not a string, assuming it is an HTMLElement");
-            id = Dom.generateId(id);
-        }
-        this.invalidHandleIds[id] = id;
-    },
+            if (!pos) {
+                YAHOO.log("getXY failed", "info", "DragDropMgr");
+                return null;
+            }
 
+            x1 = pos[0];
+            x2 = x1 + el.offsetWidth;
+            y1 = pos[1];
+            y2 = y1 + el.offsetHeight;
 
-    /**
-     * Lets you specify a css class of elements that will not initiate a drag
-     * @method addInvalidHandleClass
-     * @param {string} cssClass the class of the elements you wish to ignore
-     */
-    addInvalidHandleClass: function(cssClass) {
-        this.invalidHandleClasses.push(cssClass);
-    },
+            t = y1 - oDD.padding[0];
+            r = x2 + oDD.padding[1];
+            b = y2 + oDD.padding[2];
+            l = x1 - oDD.padding[3];
 
-    /**
-     * Unsets an excluded tag name set by addInvalidHandleType
-     * @method removeInvalidHandleType
-     * @param {string} tagName the type of element to unexclude
-     */
-    removeInvalidHandleType: function(tagName) {
-        var type = tagName.toUpperCase();
-        // this.invalidHandleTypes[type] = null;
-        delete this.invalidHandleTypes[type];
-    },
-    
-    /**
-     * Unsets an invalid handle id
-     * @method removeInvalidHandleId
-     * @param {string} id the id of the element to re-enable
-     */
-    removeInvalidHandleId: function(id) {
-        if (typeof id !== "string") {
-            YAHOO.log("id is not a string, assuming it is an HTMLElement");
-            id = Dom.generateId(id);
-        }
-        delete this.invalidHandleIds[id];
-    },
+            return new YAHOO.util.Region( t, r, b, l );
+        },
 
-    /**
-     * Unsets an invalid css class
-     * @method removeInvalidHandleClass
-     * @param {string} cssClass the class of the element(s) you wish to 
-     * re-enable
-     */
-    removeInvalidHandleClass: function(cssClass) {
-        for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) {
-            if (this.invalidHandleClasses[i] == cssClass) {
-                delete this.invalidHandleClasses[i];
-            }
-        }
-    },
+        /**
+         * Checks the cursor location to see if it over the target
+         * @method isOverTarget
+         * @param {YAHOO.util.Point} pt The point to evaluate
+         * @param {DragDrop} oTarget the DragDrop object we are inspecting
+         * @param {boolean} intersect true if we are in intersect mode
+         * @param {YAHOO.util.Region} pre-cached location of the dragged element
+         * @return {boolean} true if the mouse is over the target
+         * @private
+         * @static
+         */
+        isOverTarget: function(pt, oTarget, intersect, curRegion) {
+            // use cache if available
+            var loc = this.locationCache[oTarget.id];
+            if (!loc || !this.useCache) {
+                YAHOO.log("cache not populated", "info", "DragDropMgr");
+                loc = this.getLocation(oTarget);
+                this.locationCache[oTarget.id] = loc;
 
-    /**
-     * Checks the tag exclusion list to see if this click should be ignored
-     * @method isValidHandleChild
-     * @param {HTMLElement} node the HTMLElement to evaluate
-     * @return {boolean} true if this is a valid tag type, false if not
-     */
-    isValidHandleChild: function(node) {
+                YAHOO.log("cache: " + loc, "info", "DragDropMgr");
+            }
 
-        var valid = true;
-        // var n = (node.nodeName == "#text") ? node.parentNode : node;
-        var nodeName;
-        try {
-            nodeName = node.nodeName.toUpperCase();
-        } catch(e) {
-            nodeName = node.nodeName;
-        }
-        valid = valid && !this.invalidHandleTypes[nodeName];
-        valid = valid && !this.invalidHandleIds[node.id];
+            if (!loc) {
+                YAHOO.log("could not get the location of the element", "info", "DragDropMgr");
+                return false;
+            }
 
-        for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {
-            valid = !Dom.hasClass(node, this.invalidHandleClasses[i]);
-        }
+            //YAHOO.log("loc: " + loc + ", pt: " + pt);
+            oTarget.cursorIsOver = loc.contains( pt );
 
-        this.logger.log("Valid handle? ... " + valid);
+            // DragDrop is using this as a sanity check for the initial mousedown
+            // in this case we are done.  In POINT mode, if the drag obj has no
+            // contraints, we are done. Otherwise we need to evaluate the 
+            // region the target as occupies to determine if the dragged element
+            // overlaps with it.
+            
+            var dc = this.dragCurrent;
+            if (!dc || (!intersect && !dc.constrainX && !dc.constrainY)) {
 
-        return valid;
+                //if (oTarget.cursorIsOver) {
+                    //YAHOO.log("over " + oTarget + ", " + loc + ", " + pt, "warn");
+                //}
+                return oTarget.cursorIsOver;
+            }
 
-    },
+            oTarget.overlap = null;
 
-    /**
-     * Create the array of horizontal tick marks if an interval was specified
-     * in setXConstraint().
-     * @method setXTicks
-     * @private
-     */
-    setXTicks: function(iStartX, iTickSize) {
-        this.xTicks = [];
-        this.xTickSize = iTickSize;
-        
-        var tickMap = {};
+            // Get the current location of the drag element, this is the
+            // location of the mouse event less the delta that represents
+            // where the original mousedown happened on the element.  We
+            // need to consider constraints and ticks as well.
 
-        for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {
-            if (!tickMap[i]) {
-                this.xTicks[this.xTicks.length] = i;
-                tickMap[i] = true;
+            if (!curRegion) {
+                var pos = dc.getTargetCoord(pt.x, pt.y);
+                var el = dc.getDragEl();
+                curRegion = new YAHOO.util.Region( pos.y, 
+                                                   pos.x + el.offsetWidth,
+                                                   pos.y + el.offsetHeight, 
+                                                   pos.x );
             }
-        }
 
-        for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) {
-            if (!tickMap[i]) {
-                this.xTicks[this.xTicks.length] = i;
-                tickMap[i] = true;
+            var overlap = curRegion.intersect(loc);
+
+            if (overlap) {
+                oTarget.overlap = overlap;
+                return (intersect) ? true : oTarget.cursorIsOver;
+            } else {
+                return false;
             }
-        }
+        },
 
-        this.xTicks.sort(this.DDM.numericSort) ;
-        this.logger.log("xTicks: " + this.xTicks.join());
-    },
+        /**
+         * unload event handler
+         * @method _onUnload
+         * @private
+         * @static
+         */
+        _onUnload: function(e, me) {
+            this.unregAll();
+        },
 
-    /**
-     * Create the array of vertical tick marks if an interval was specified in 
-     * setYConstraint().
-     * @method setYTicks
-     * @private
-     */
-    setYTicks: function(iStartY, iTickSize) {
-        // this.logger.log("setYTicks: " + iStartY + ", " + iTickSize
-               // + ", " + this.initPageY + ", " + this.minY + ", " + this.maxY );
-        this.yTicks = [];
-        this.yTickSize = iTickSize;
+        /**
+         * Cleans up the drag and drop events and objects.
+         * @method unregAll
+         * @private
+         * @static
+         */
+        unregAll: function() {
+            YAHOO.log("unregister all", "info", "DragDropMgr");
 
-        var tickMap = {};
+            if (this.dragCurrent) {
+                this.stopDrag();
+                this.dragCurrent = null;
+            }
 
-        for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) {
-            if (!tickMap[i]) {
-                this.yTicks[this.yTicks.length] = i;
-                tickMap[i] = true;
+            this._execOnAll("unreg", []);
+
+            for (i in this.elementCache) {
+                delete this.elementCache[i];
             }
-        }
 
-        for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) {
-            if (!tickMap[i]) {
-                this.yTicks[this.yTicks.length] = i;
-                tickMap[i] = true;
+            this.elementCache = {};
+            this.ids = {};
+        },
+
+        /**
+         * A cache of DOM elements
+         * @property elementCache
+         * @private
+         * @static
+         */
+        elementCache: {},
+        
+        /**
+         * Get the wrapper for the DOM element specified
+         * @method getElWrapper
+         * @param {String} id the id of the element to get
+         * @return {YAHOO.util.DDM.ElementWrapper} the wrapped element
+         * @private
+         * @deprecated This wrapper isn't that useful
+         * @static
+         */
+        getElWrapper: function(id) {
+            var oWrapper = this.elementCache[id];
+            if (!oWrapper || !oWrapper.el) {
+                oWrapper = this.elementCache[id] = 
+                    new this.ElementWrapper(YAHOO.util.Dom.get(id));
             }
-        }
+            return oWrapper;
+        },
 
-        this.yTicks.sort(this.DDM.numericSort) ;
-        this.logger.log("yTicks: " + this.yTicks.join());
-    },
+        /**
+         * Returns the actual DOM element
+         * @method getElement
+         * @param {String} id the id of the elment to get
+         * @return {Object} The element
+         * @deprecated use YAHOO.util.Dom.get instead
+         * @static
+         */
+        getElement: function(id) {
+            return YAHOO.util.Dom.get(id);
+        },
+        
+        /**
+         * Returns the style property for the DOM element (i.e., 
+         * document.getElById(id).style)
+         * @method getCss
+         * @param {String} id the id of the elment to get
+         * @return {Object} The style property of the element
+         * @deprecated use YAHOO.util.Dom instead
+         * @static
+         */
+        getCss: function(id) {
+            var el = YAHOO.util.Dom.get(id);
+            return (el) ? el.style : null;
+        },
 
-    /**
-     * By default, the element can be dragged any place on the screen.  Use 
-     * this method to limit the horizontal travel of the element.  Pass in 
-     * 0,0 for the parameters if you want to lock the drag to the y axis.
-     * @method setXConstraint
-     * @param {int} iLeft the number of pixels the element can move to the left
-     * @param {int} iRight the number of pixels the element can move to the 
-     * right
-     * @param {int} iTickSize optional parameter for specifying that the 
-     * element
-     * should move iTickSize pixels at a time.
-     */
-    setXConstraint: function(iLeft, iRight, iTickSize) {
-        this.leftConstraint = iLeft;
-        this.rightConstraint = iRight;
+        /**
+         * Inner class for cached elements
+         * @class DragDropMgr.ElementWrapper
+         * @for DragDropMgr
+         * @private
+         * @deprecated
+         */
+        ElementWrapper: function(el) {
+                /**
+                 * The element
+                 * @property el
+                 */
+                this.el = el || null;
+                /**
+                 * The element id
+                 * @property id
+                 */
+                this.id = this.el && el.id;
+                /**
+                 * A reference to the style property
+                 * @property css
+                 */
+                this.css = this.el && el.style;
+            },
 
-        this.minX = this.initPageX - iLeft;
-        this.maxX = this.initPageX + iRight;
-        if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }
+        /**
+         * Returns the X position of an html element
+         * @method getPosX
+         * @param el the element for which to get the position
+         * @return {int} the X coordinate
+         * @for DragDropMgr
+         * @deprecated use YAHOO.util.Dom.getX instead
+         * @static
+         */
+        getPosX: function(el) {
+            return YAHOO.util.Dom.getX(el);
+        },
 
-        this.constrainX = true;
-        this.logger.log("initPageX:" + this.initPageX + " minX:" + this.minX + 
-                " maxX:" + this.maxX);
-    },
+        /**
+         * Returns the Y position of an html element
+         * @method getPosY
+         * @param el the element for which to get the position
+         * @return {int} the Y coordinate
+         * @deprecated use YAHOO.util.Dom.getY instead
+         * @static
+         */
+        getPosY: function(el) {
+            return YAHOO.util.Dom.getY(el); 
+        },
 
-    /**
-     * Clears any constraints applied to this instance.  Also clears ticks
-     * since they can't exist independent of a constraint at this time.
-     * @method clearConstraints
-     */
-    clearConstraints: function() {
-        this.logger.log("Clearing constraints");
-        this.constrainX = false;
-        this.constrainY = false;
-        this.clearTicks();
-    },
+        /**
+         * Swap two nodes.  In IE, we use the native method, for others we 
+         * emulate the IE behavior
+         * @method swapNode
+         * @param n1 the first node to swap
+         * @param n2 the other node to swap
+         * @static
+         */
+        swapNode: function(n1, n2) {
+            if (n1.swapNode) {
+                n1.swapNode(n2);
+            } else {
+                var p = n2.parentNode;
+                var s = n2.nextSibling;
 
-    /**
-     * Clears any tick interval defined for this instance
-     * @method clearTicks
-     */
-    clearTicks: function() {
-        this.logger.log("Clearing ticks");
-        this.xTicks = null;
-        this.yTicks = null;
-        this.xTickSize = 0;
-        this.yTickSize = 0;
-    },
+                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);
+                }
+            }
+        },
 
-    /**
-     * By default, the element can be dragged any place on the screen.  Set 
-     * this to limit the vertical travel of the element.  Pass in 0,0 for the
-     * parameters if you want to lock the drag to the x axis.
-     * @method setYConstraint
-     * @param {int} iUp the number of pixels the element can move up
-     * @param {int} iDown the number of pixels the element can move down
-     * @param {int} iTickSize optional parameter for specifying that the 
-     * element should move iTickSize pixels at a time.
-     */
-    setYConstraint: function(iUp, iDown, iTickSize) {
-        this.logger.log("setYConstraint: " + iUp + "," + iDown + "," + iTickSize);
-        this.topConstraint = iUp;
-        this.bottomConstraint = iDown;
+        /**
+         * Returns the current scroll position
+         * @method getScroll
+         * @private
+         * @static
+         */
+        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", "info", "DragDropMgr");
+            }
+            return { top: t, left: l };
+        },
 
-        this.minY = this.initPageY - iUp;
-        this.maxY = this.initPageY + iDown;
-        if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }
+        /**
+         * Returns the specified element style property
+         * @method getStyle
+         * @param {HTMLElement} el          the element
+         * @param {string}      styleProp   the style property
+         * @return {string} The value of the style property
+         * @deprecated use YAHOO.util.Dom.getStyle
+         * @static
+         */
+        getStyle: function(el, styleProp) {
+            return YAHOO.util.Dom.getStyle(el, styleProp);
+        },
 
-        this.constrainY = true;
-        
-        this.logger.log("initPageY:" + this.initPageY + " minY:" + this.minY + 
-                " maxY:" + this.maxY);
-    },
+        /**
+         * Gets the scrollTop
+         * @method getScrollTop
+         * @return {int} the document's scrollTop
+         * @static
+         */
+        getScrollTop: function () { return this.getScroll().top; },
 
-    /**
-     * resetConstraints must be called if you manually reposition a dd element.
-     * @method resetConstraints
-     * @param {boolean} maintainOffset
-     */
-    resetConstraints: function() {
+        /**
+         * Gets the scrollLeft
+         * @method getScrollLeft
+         * @return {int} the document's scrollTop
+         * @static
+         */
+        getScrollLeft: function () { return this.getScroll().left; },
 
-        this.logger.log("resetConstraints");
+        /**
+         * Sets the x/y position of an element to the location of the
+         * target element.
+         * @method moveToEl
+         * @param {HTMLElement} moveEl      The element to move
+         * @param {HTMLElement} targetEl    The position reference element
+         * @static
+         */
+        moveToEl: function (moveEl, targetEl) {
+            var aCoord = YAHOO.util.Dom.getXY(targetEl);
+            YAHOO.log("moveToEl: " + aCoord, "info", "DragDropMgr");
+            YAHOO.util.Dom.setXY(moveEl, aCoord);
+        },
 
-        // Maintain offsets if necessary
-        if (this.initPageX || this.initPageX === 0) {
-            this.logger.log("init pagexy: " + this.initPageX + ", " + 
-                               this.initPageY);
-            this.logger.log("last pagexy: " + this.lastPageX + ", " + 
-                               this.lastPageY);
-            // figure out how much this thing has moved
-            var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0;
-            var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0;
+        /**
+         * Gets the client height
+         * @method getClientHeight
+         * @return {int} client height in px
+         * @deprecated use YAHOO.util.Dom.getViewportHeight instead
+         * @static
+         */
+        getClientHeight: function() {
+            return YAHOO.util.Dom.getViewportHeight();
+        },
 
-            this.setInitPosition(dx, dy);
+        /**
+         * Gets the client width
+         * @method getClientWidth
+         * @return {int} client width in px
+         * @deprecated use YAHOO.util.Dom.getViewportWidth instead
+         * @static
+         */
+        getClientWidth: function() {
+            return YAHOO.util.Dom.getViewportWidth();
+        },
 
-        // This is the first time we have detected the element's position
-        } else {
-            this.setInitPosition();
-        }
+        /**
+         * Numeric array sort function
+         * @method numericSort
+         * @static
+         */
+        numericSort: function(a, b) { return (a - b); },
 
-        if (this.constrainX) {
-            this.setXConstraint( this.leftConstraint, 
-                                 this.rightConstraint, 
-                                 this.xTickSize        );
-        }
+        /**
+         * Internal counter
+         * @property _timeoutCount
+         * @private
+         * @static
+         */
+        _timeoutCount: 0,
 
-        if (this.constrainY) {
-            this.setYConstraint( this.topConstraint, 
-                                 this.bottomConstraint, 
-                                 this.yTickSize         );
-        }
-    },
+        /**
+         * Trying to make the load order less important.  Without this we get
+         * an error if this file is loaded before the Event Utility.
+         * @method _addListeners
+         * @private
+         * @static
+         */
+        _addListeners: function() {
+            var DDM = YAHOO.util.DDM;
+            if ( YAHOO.util.Event && document ) {
+                DDM._onLoad();
+            } else {
+                if (DDM._timeoutCount > 2000) {
+                    YAHOO.log("DragDrop requires the Event Utility", "error", "DragDropMgr");
+                } else {
+                    setTimeout(DDM._addListeners, 10);
+                    if (document && document.body) {
+                        DDM._timeoutCount += 1;
+                    }
+                }
+            }
+        },
 
-    /**
-     * Normally the drag element is moved pixel by pixel, but we can specify 
-     * that it move a number of pixels at a time.  This method resolves the 
-     * location when we have it set up like this.
-     * @method getTick
-     * @param {int} val where we want to place the object
-     * @param {int[]} tickArray sorted array of valid points
-     * @return {int} the closest tick
-     * @private
-     */
-    getTick: function(val, tickArray) {
+        /**
+         * Recursively searches the immediate parent and all child nodes for 
+         * the handle element in order to determine wheter or not it was 
+         * clicked.
+         * @method handleWasClicked
+         * @param node the html element to inspect
+         * @static
+         */
+        handleWasClicked: function(node, id) {
+            if (this.isHandle(id, node.id)) {
+                YAHOO.log("clicked node is a handle", "info", "DragDropMgr");
+                return true;
+            } else {
+                // check to see if this is a text node child of the one we want
+                var p = node.parentNode;
+                // YAHOO.log("p: " + p);
 
-        if (!tickArray) {
-            // If tick interval is not defined, it is effectively 1 pixel, 
-            // so we return the value passed to us.
-            return val; 
-        } else if (tickArray[0] >= val) {
-            // The value is lower than the first tick, so we return the first
-            // tick.
-            return tickArray[0];
-        } else {
-            for (var i=0, len=tickArray.length; i<len; ++i) {
-                var next = i + 1;
-                if (tickArray[next] && tickArray[next] >= val) {
-                    var diff1 = val - tickArray[i];
-                    var diff2 = tickArray[next] - val;
-                    return (diff2 > diff1) ? tickArray[i] : tickArray[next];
+                while (p) {
+                    if (this.isHandle(id, p.id)) {
+                        return true;
+                    } else {
+                        YAHOO.log(p.id + " is not a handle", "info", "DragDropMgr");
+                        p = p.parentNode;
+                    }
                 }
             }
 
-            // The value is larger than the last tick, so we return the last
-            // tick.
-            return tickArray[tickArray.length - 1];
+            return false;
         }
-    },
 
-    /**
-     * toString method
-     * @method toString
-     * @return {string} string representation of the dd obj
-     */
-    toString: function() {
-        return ("DragDrop " + this.id);
-    }
+    };
 
-};
+}();
 
-})();
-/**
- * The drag and drop utility provides a framework for building drag and drop
- * applications.  In addition to enabling drag and drop for specific elements,
- * the drag and drop elements are tracked by the manager class, and the
- * interactions between the various elements are tracked during the drag and
- * the implementing code is notified about these important moments.
- * @module dragdrop
- * @title Drag and Drop
- * @requires yahoo,dom,event
- * @namespace YAHOO.util
- */
+// shorter alias, save a few bytes
+YAHOO.util.DDM = YAHOO.util.DragDropMgr;
+YAHOO.util.DDM._addListeners();
 
-// Only load the library once.  Rewriting the manager class would orphan 
-// existing drag and drop instances.
-if (!YAHOO.util.DragDropMgr) {
+}
 
-/**
- * DragDropMgr is a singleton that tracks the element interaction for 
- * all DragDrop items in the window.  Generally, you will not call 
- * this class directly, but it does have helper methods that could 
- * be useful in your DragDrop implementations.
- * @class DragDropMgr
- * @static
- */
-YAHOO.util.DragDropMgr = function() {
+(function() {
 
-    var Event = YAHOO.util.Event;
+var Event=YAHOO.util.Event; 
+var Dom=YAHOO.util.Dom;
 
-    return {
+/**
+ * Defines the interface and base operation of items that that can be 
+ * dragged or can be drop targets.  It was designed to be extended, overriding
+ * the event handlers for startDrag, onDrag, onDragOver, onDragOut.
+ * Up to three html elements can be associated with a DragDrop instance:
+ * <ul>
+ * <li>linked element: the element that is passed into the constructor.
+ * This is the element which defines the boundaries for interaction with 
+ * other DragDrop objects.</li>
+ * <li>handle element(s): The drag operation only occurs if the element that 
+ * was clicked matches a handle element.  By default this is the linked 
+ * element, but there are times that you will want only a portion of the 
+ * linked element to initiate the drag operation, and the setHandleElId() 
+ * method provides a way to define this.</li>
+ * <li>drag element: this represents an the element that would be moved along
+ * with the cursor during a drag operation.  By default, this is the linked
+ * element itself as in {@link YAHOO.util.DD}.  setDragElId() lets you define
+ * a separate element that would be moved, as in {@link YAHOO.util.DDProxy}
+ * </li>
+ * </ul>
+ * This class should not be instantiated until the onload event to ensure that
+ * the associated elements are available.
+ * The following would define a DragDrop obj that would interact with any 
+ * other DragDrop obj in the "group1" group:
+ * <pre>
+ *  dd = new YAHOO.util.DragDrop("div1", "group1");
+ * </pre>
+ * Since none of the event handlers have been implemented, nothing would 
+ * actually happen if you were to run the code above.  Normally you would 
+ * override this class or one of the default implementations, but you can 
+ * also override the methods you want on an instance of the class...
+ * <pre>
+ *  dd.onDragDrop = function(e, id) {
+ *  &nbsp;&nbsp;alert("dd was dropped on " + id);
+ *  }
+ * </pre>
+ * @namespace YAHOO.util
+ * @class DragDrop
+ * @constructor
+ * @param {String} id of the element that is linked to this instance
+ * @param {String} sGroup the group of related DragDrop objects
+ * @param {object} config an object containing configurable attributes
+ *                Valid properties for DragDrop: 
+ *                    padding, isTarget, maintainOffset, primaryButtonOnly,
+ */
+YAHOO.util.DragDrop = function(id, sGroup, config) {
+    if (id) {
+        this.init(id, sGroup, config); 
+    }
+};
 
-        /**
-         * Two dimensional Array of registered DragDrop objects.  The first 
-         * dimension is the DragDrop item group, the second the DragDrop 
-         * object.
-         * @property ids
-         * @type {string: string}
-         * @private
-         * @static
-         */
-        ids: {},
+YAHOO.util.DragDrop.prototype = {
 
-        /**
-         * Array of element ids defined as drag handles.  Used to determine 
-         * if the element that generated the mousedown event is actually the 
-         * handle and not the html element itself.
-         * @property handleIds
-         * @type {string: string}
-         * @private
-         * @static
-         */
-        handleIds: {},
+    /**
+     * The id of the element associated with this object.  This is what we 
+     * refer to as the "linked element" because the size and position of 
+     * this element is used to determine when the drag and drop objects have 
+     * interacted.
+     * @property id
+     * @type String
+     */
+    id: null,
 
-        /**
-         * the DragDrop object that is currently being dragged
-         * @property dragCurrent
-         * @type DragDrop
-         * @private
-         * @static
-         **/
-        dragCurrent: null,
+    /**
+     * Configuration attributes passed into the constructor
+     * @property config
+     * @type object
+     */
+    config: null,
 
-        /**
-         * the DragDrop object(s) that are being hovered over
-         * @property dragOvers
-         * @type Array
-         * @private
-         * @static
-         */
-        dragOvers: {},
+    /**
+     * The id of the element that will be dragged.  By default this is same 
+     * as the linked element , but could be changed to another element. Ex: 
+     * YAHOO.util.DDProxy
+     * @property dragElId
+     * @type String
+     * @private
+     */
+    dragElId: null, 
 
-        /**
-         * the X distance between the cursor and the object being dragged
-         * @property deltaX
-         * @type int
-         * @private
-         * @static
-         */
-        deltaX: 0,
+    /**
+     * the id of the element that initiates the drag operation.  By default 
+     * this is the linked element, but could be changed to be a child of this
+     * element.  This lets us do things like only starting the drag when the 
+     * header element within the linked html element is clicked.
+     * @property handleElId
+     * @type String
+     * @private
+     */
+    handleElId: null, 
 
-        /**
-         * the Y distance between the cursor and the object being dragged
-         * @property deltaY
-         * @type int
-         * @private
-         * @static
-         */
-        deltaY: 0,
+    /**
+     * An associative array of HTML tags that will be ignored if clicked.
+     * @property invalidHandleTypes
+     * @type {string: string}
+     */
+    invalidHandleTypes: null, 
 
-        /**
-         * Flag to determine if we should prevent the default behavior of the
-         * events we define. By default this is true, but this can be set to 
-         * false if you need the default behavior (not recommended)
-         * @property preventDefault
-         * @type boolean
-         * @static
-         */
-        preventDefault: true,
+    /**
+     * An associative array of ids for elements that will be ignored if clicked
+     * @property invalidHandleIds
+     * @type {string: string}
+     */
+    invalidHandleIds: null, 
 
-        /**
-         * Flag to determine if we should stop the propagation of the events 
-         * we generate. This is true by default but you may want to set it to
-         * false if the html element contains other features that require the
-         * mouse click.
-         * @property stopPropagation
-         * @type boolean
-         * @static
-         */
-        stopPropagation: true,
+    /**
+     * An indexted array of css class names for elements that will be ignored
+     * if clicked.
+     * @property invalidHandleClasses
+     * @type string[]
+     */
+    invalidHandleClasses: null, 
 
-        /**
-         * Internal flag that is set to true when drag and drop has been
-         * intialized
-         * @property initialized
-         * @private
-         * @static
-         */
-        initalized: false,
+    /**
+     * The linked element's absolute X position at the time the drag was 
+     * started
+     * @property startPageX
+     * @type int
+     * @private
+     */
+    startPageX: 0,
 
-        /**
-         * All drag and drop can be disabled.
-         * @property locked
-         * @private
-         * @static
-         */
-        locked: false,
+    /**
+     * The linked element's absolute X position at the time the drag was 
+     * started
+     * @property startPageY
+     * @type int
+     * @private
+     */
+    startPageY: 0,
 
-        /**
-         * Called the first time an element is registered.
-         * @method init
-         * @private
-         * @static
-         */
-        init: function() {
-            this.logger = new YAHOO.widget.LogWriter("DragDropMgr");
-            this.initialized = true;
-        },
+    /**
+     * The group defines a logical collection of DragDrop objects that are 
+     * related.  Instances only get events when interacting with other 
+     * DragDrop object in the same group.  This lets us define multiple 
+     * groups using a single DragDrop subclass if we want.
+     * @property groups
+     * @type {string: string}
+     */
+    groups: null,
 
-        /**
-         * In point mode, drag and drop interaction is defined by the 
-         * location of the cursor during the drag/drop
-         * @property POINT
-         * @type int
-         * @static
-         * @final
-         */
-        POINT: 0,
+    /**
+     * Individual drag/drop instances can be locked.  This will prevent 
+     * onmousedown start drag.
+     * @property locked
+     * @type boolean
+     * @private
+     */
+    locked: false,
 
-        /**
-         * In intersect mode, drag and drop interaction is defined by the 
-         * cursor position or the amount of overlap of two or more drag and 
-         * drop objects.
-         * @property INTERSECT
-         * @type int
-         * @static
-         * @final
-         */
-        INTERSECT: 1,
+    /**
+     * Lock this instance
+     * @method lock
+     */
+    lock: function() { this.locked = true; },
 
-        /**
-         * In intersect mode, drag and drop interaction is defined only by the 
-         * overlap of two or more drag and drop objects.
-         * @property STRICT_INTERSECT
-         * @type int
-         * @static
-         * @final
-         */
-        STRICT_INTERSECT: 2,
+    /**
+     * Unlock this instace
+     * @method unlock
+     */
+    unlock: function() { this.locked = false; },
 
-        /**
-         * The current drag and drop mode.  Default: POINT
-         * @property mode
-         * @type int
-         * @static
-         */
-        mode: 0,
+    /**
+     * By default, all instances can be a drop target.  This can be disabled by
+     * setting isTarget to false.
+     * @method isTarget
+     * @type boolean
+     */
+    isTarget: true,
 
-        /**
-         * Runs method on all drag and drop objects
-         * @method _execOnAll
-         * @private
-         * @static
-         */
-        _execOnAll: function(sMethod, args) {
-            for (var i in this.ids) {
-                for (var j in this.ids[i]) {
-                    var oDD = this.ids[i][j];
-                    if (! this.isTypeOfDD(oDD)) {
-                        continue;
-                    }
-                    oDD[sMethod].apply(oDD, args);
-                }
-            }
-        },
+    /**
+     * The padding configured for this drag and drop object for calculating
+     * the drop zone intersection with this object.
+     * @method padding
+     * @type int[]
+     */
+    padding: null,
 
-        /**
-         * Drag and drop initialization.  Sets up the global event handlers
-         * @method _onLoad
-         * @private
-         * @static
-         */
-        _onLoad: function() {
+    /**
+     * Cached reference to the linked element
+     * @property _domRef
+     * @private
+     */
+    _domRef: null,
 
-            this.init();
+    /**
+     * Internal typeof flag
+     * @property __ygDragDrop
+     * @private
+     */
+    __ygDragDrop: true,
+
+    /**
+     * Set to true when horizontal contraints are applied
+     * @property constrainX
+     * @type boolean
+     * @private
+     */
+    constrainX: false,
 
-            this.logger.log("DDM onload");
+    /**
+     * Set to true when vertical contraints are applied
+     * @property constrainY
+     * @type boolean
+     * @private
+     */
+    constrainY: false,
 
-            Event.on(document, "mouseup",   this.handleMouseUp, this, true);
-            Event.on(document, "mousemove", this.handleMouseMove, this, true);
-            Event.on(window,   "unload",    this._onUnload, this, true);
-            Event.on(window,   "resize",    this._onResize, this, true);
-            // Event.on(window,   "mouseout",    this._test);
+    /**
+     * The left constraint
+     * @property minX
+     * @type int
+     * @private
+     */
+    minX: 0,
 
-        },
+    /**
+     * The right constraint
+     * @property maxX
+     * @type int
+     * @private
+     */
+    maxX: 0,
 
-        /**
-         * Reset constraints on all drag and drop objs
-         * @method _onResize
-         * @private
-         * @static
-         */
-        _onResize: function(e) {
-            this.logger.log("window resize");
-            this._execOnAll("resetConstraints", []);
-        },
+    /**
+     * The up constraint 
+     * @property minY
+     * @type int
+     * @type int
+     * @private
+     */
+    minY: 0,
 
-        /**
-         * Lock all drag and drop functionality
-         * @method lock
-         * @static
-         */
-        lock: function() { this.locked = true; },
+    /**
+     * The down constraint 
+     * @property maxY
+     * @type int
+     * @private
+     */
+    maxY: 0,
 
-        /**
-         * Unlock all drag and drop functionality
-         * @method unlock
-         * @static
-         */
-        unlock: function() { this.locked = false; },
+    /**
+     * The difference between the click position and the source element's location
+     * @property deltaX
+     * @type int
+     * @private
+     */
+    deltaX: 0,
 
-        /**
-         * Is drag and drop locked?
-         * @method isLocked
-         * @return {boolean} True if drag and drop is locked, false otherwise.
-         * @static
-         */
-        isLocked: function() { return this.locked; },
+    /**
+     * The difference between the click position and the source element's location
+     * @property deltaY
+     * @type int
+     * @private
+     */
+    deltaY: 0,
 
-        /**
-         * Location cache that is set for all drag drop objects when a drag is
-         * initiated, cleared when the drag is finished.
-         * @property locationCache
-         * @private
-         * @static
-         */
-        locationCache: {},
+    /**
+     * Maintain offsets when we resetconstraints.  Set to true when you want
+     * the position of the element relative to its parent to stay the same
+     * when the page changes
+     *
+     * @property maintainOffset
+     * @type boolean
+     */
+    maintainOffset: false,
 
-        /**
-         * Set useCache to false if you want to force object the lookup of each
-         * drag and drop linked element constantly during a drag.
-         * @property useCache
-         * @type boolean
-         * @static
-         */
-        useCache: true,
+    /**
+     * Array of pixel locations the element will snap to if we specified a 
+     * horizontal graduation/interval.  This array is generated automatically
+     * when you define a tick interval.
+     * @property xTicks
+     * @type int[]
+     */
+    xTicks: null,
 
-        /**
-         * The number of pixels that the mouse needs to move after the 
-         * mousedown before the drag is initiated.  Default=3;
-         * @property clickPixelThresh
-         * @type int
-         * @static
-         */
-        clickPixelThresh: 3,
+    /**
+     * Array of pixel locations the element will snap to if we specified a 
+     * vertical graduation/interval.  This array is generated automatically 
+     * when you define a tick interval.
+     * @property yTicks
+     * @type int[]
+     */
+    yTicks: null,
 
-        /**
-         * The number of milliseconds after the mousedown event to initiate the
-         * drag if we don't get a mouseup event. Default=1000
-         * @property clickTimeThresh
-         * @type int
-         * @static
-         */
-        clickTimeThresh: 1000,
+    /**
+     * By default the drag and drop instance will only respond to the primary
+     * button click (left button for a right-handed mouse).  Set to true to
+     * allow drag and drop to start with any mouse click that is propogated
+     * by the browser
+     * @property primaryButtonOnly
+     * @type boolean
+     */
+    primaryButtonOnly: true,
 
-        /**
-         * Flag that indicates that either the drag pixel threshold or the 
-         * mousdown time threshold has been met
-         * @property dragThreshMet
-         * @type boolean
-         * @private
-         * @static
-         */
-        dragThreshMet: false,
+    /**
+     * The availabe property is false until the linked dom element is accessible.
+     * @property available
+     * @type boolean
+     */
+    available: false,
 
-        /**
-         * Timeout used for the click time threshold
-         * @property clickTimeout
-         * @type Object
-         * @private
-         * @static
-         */
-        clickTimeout: null,
+    /**
+     * By default, drags can only be initiated if the mousedown occurs in the
+     * region the linked element is.  This is done in part to work around a
+     * bug in some browsers that mis-report the mousedown if the previous
+     * mouseup happened outside of the window.  This property is set to true
+     * if outer handles are defined.
+     *
+     * @property hasOuterHandles
+     * @type boolean
+     * @default false
+     */
+    hasOuterHandles: false,
 
-        /**
-         * The X position of the mousedown event stored for later use when a 
-         * drag threshold is met.
-         * @property startX
-         * @type int
-         * @private
-         * @static
-         */
-        startX: 0,
+    /**
+     * Property that is assigned to a drag and drop object when testing to
+     * see if it is being targeted by another dd object.  This property
+     * can be used in intersect mode to help determine the focus of
+     * the mouse interaction.  DDM.getBestMatch uses this property first to
+     * determine the closest match in INTERSECT mode when multiple targets
+     * are part of the same interaction.
+     * @property cursorIsOver
+     * @type boolean
+     */
+    cursorIsOver: false,
 
-        /**
-         * The Y position of the mousedown event stored for later use when a 
-         * drag threshold is met.
-         * @property startY
-         * @type int
-         * @private
-         * @static
-         */
-        startY: 0,
+    /**
+     * Property that is assigned to a drag and drop object when testing to
+     * see if it is being targeted by another dd object.  This is a region
+     * that represents the area the draggable element overlaps this target.
+     * DDM.getBestMatch uses this property to compare the size of the overlap
+     * to that of other targets in order to determine the closest match in
+     * INTERSECT mode when multiple targets are part of the same interaction.
+     * @property overlap 
+     * @type YAHOO.util.Region
+     */
+    overlap: null,
 
-        /**
-         * Each DragDrop instance must be registered with the DragDropMgr.  
-         * This is executed in DragDrop.init()
-         * @method regDragDrop
-         * @param {DragDrop} oDD the DragDrop object to register
-         * @param {String} sGroup the name of the group this element belongs to
-         * @static
-         */
-        regDragDrop: function(oDD, sGroup) {
-            if (!this.initialized) { this.init(); }
-            
-            if (!this.ids[sGroup]) {
-                this.ids[sGroup] = {};
-            }
-            this.ids[sGroup][oDD.id] = oDD;
-        },
+    /**
+     * Code that executes immediately before the startDrag event
+     * @method b4StartDrag
+     * @private
+     */
+    b4StartDrag: function(x, y) { },
 
-        /**
-         * Removes the supplied dd instance from the supplied group. Executed
-         * by DragDrop.removeFromGroup, so don't call this function directly.
-         * @method removeDDFromGroup
-         * @private
-         * @static
-         */
-        removeDDFromGroup: function(oDD, sGroup) {
-            if (!this.ids[sGroup]) {
-                this.ids[sGroup] = {};
-            }
+    /**
+     * Abstract method called after a drag/drop object is clicked
+     * and the drag or mousedown time thresholds have beeen met.
+     * @method startDrag
+     * @param {int} X click location
+     * @param {int} Y click location
+     */
+    startDrag: function(x, y) { /* override this */ },
 
-            var obj = this.ids[sGroup];
-            if (obj && obj[oDD.id]) {
-                delete obj[oDD.id];
-            }
-        },
+    /**
+     * Code that executes immediately before the onDrag event
+     * @method b4Drag
+     * @private
+     */
+    b4Drag: function(e) { },
 
-        /**
-         * Unregisters a drag and drop item.  This is executed in 
-         * DragDrop.unreg, use that method instead of calling this directly.
-         * @method _remove
-         * @private
-         * @static
-         */
-        _remove: function(oDD) {
-            for (var g in oDD.groups) {
-                if (g && this.ids[g][oDD.id]) {
-                    delete this.ids[g][oDD.id];
-                    //this.logger.log("NEW LEN " + this.ids.length, "warn");
-                }
-            }
-            delete this.handleIds[oDD.id];
-        },
+    /**
+     * Abstract method called during the onMouseMove event while dragging an 
+     * object.
+     * @method onDrag
+     * @param {Event} e the mousemove event
+     */
+    onDrag: function(e) { /* override this */ },
 
-        /**
-         * Each DragDrop handle element must be registered.  This is done
-         * automatically when executing DragDrop.setHandleElId()
-         * @method regHandle
-         * @param {String} sDDId the DragDrop id this element is a handle for
-         * @param {String} sHandleId the id of the element that is the drag 
-         * handle
-         * @static
-         */
-        regHandle: function(sDDId, sHandleId) {
-            if (!this.handleIds[sDDId]) {
-                this.handleIds[sDDId] = {};
-            }
-            this.handleIds[sDDId][sHandleId] = sHandleId;
-        },
+    /**
+     * Abstract method called when this element fist begins hovering over 
+     * another DragDrop obj
+     * @method onDragEnter
+     * @param {Event} e the mousemove event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this is hovering over.  In INTERSECT mode, an array of one or more 
+     * dragdrop items being hovered over.
+     */
+    onDragEnter: function(e, id) { /* override this */ },
 
-        /**
-         * Utility function to determine if a given element has been 
-         * registered as a drag drop item.
-         * @method isDragDrop
-         * @param {String} id the element id to check
-         * @return {boolean} true if this element is a DragDrop item, 
-         * false otherwise
-         * @static
-         */
-        isDragDrop: function(id) {
-            return ( this.getDDById(id) ) ? true : false;
-        },
+    /**
+     * Code that executes immediately before the onDragOver event
+     * @method b4DragOver
+     * @private
+     */
+    b4DragOver: function(e) { },
 
-        /**
-         * Returns the drag and drop instances that are in all groups the
-         * passed in instance belongs to.
-         * @method getRelated
-         * @param {DragDrop} p_oDD the obj to get related data for
-         * @param {boolean} bTargetsOnly if true, only return targetable objs
-         * @return {DragDrop[]} the related instances
-         * @static
-         */
-        getRelated: function(p_oDD, bTargetsOnly) {
-            var oDDs = [];
-            for (var i in p_oDD.groups) {
-                for (j in this.ids[i]) {
-                    var dd = this.ids[i][j];
-                    if (! this.isTypeOfDD(dd)) {
-                        continue;
-                    }
-                    if (!bTargetsOnly || dd.isTarget) {
-                        oDDs[oDDs.length] = dd;
-                    }
-                }
-            }
+    /**
+     * Abstract method called when this element is hovering over another 
+     * DragDrop obj
+     * @method onDragOver
+     * @param {Event} e the mousemove event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this is hovering over.  In INTERSECT mode, an array of dd items 
+     * being hovered over.
+     */
+    onDragOver: function(e, id) { /* override this */ },
 
-            return oDDs;
-        },
+    /**
+     * Code that executes immediately before the onDragOut event
+     * @method b4DragOut
+     * @private
+     */
+    b4DragOut: function(e) { },
 
-        /**
-         * Returns true if the specified dd target is a legal target for 
-         * the specifice drag obj
-         * @method isLegalTarget
-         * @param {DragDrop} the drag obj
-         * @param {DragDrop} the target
-         * @return {boolean} true if the target is a legal target for the 
-         * dd obj
-         * @static
-         */
-        isLegalTarget: function (oDD, oTargetDD) {
-            var targets = this.getRelated(oDD, true);
-            for (var i=0, len=targets.length;i<len;++i) {
-                if (targets[i].id == oTargetDD.id) {
-                    return true;
-                }
-            }
+    /**
+     * Abstract method called when we are no longer hovering over an element
+     * @method onDragOut
+     * @param {Event} e the mousemove event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this was hovering over.  In INTERSECT mode, an array of dd items 
+     * that the mouse is no longer over.
+     */
+    onDragOut: function(e, id) { /* override this */ },
 
-            return false;
-        },
+    /**
+     * Code that executes immediately before the onDragDrop event
+     * @method b4DragDrop
+     * @private
+     */
+    b4DragDrop: function(e) { },
 
-        /**
-         * My goal is to be able to transparently determine if an object is
-         * typeof DragDrop, and the exact subclass of DragDrop.  typeof 
-         * returns "object", oDD.constructor.toString() always returns
-         * "DragDrop" and not the name of the subclass.  So for now it just
-         * evaluates a well-known variable in DragDrop.
-         * @method isTypeOfDD
-         * @param {Object} the object to evaluate
-         * @return {boolean} true if typeof oDD = DragDrop
-         * @static
-         */
-        isTypeOfDD: function (oDD) {
-            return (oDD && oDD.__ygDragDrop);
-        },
+    /**
+     * Abstract method called when this item is dropped on another DragDrop 
+     * obj
+     * @method onDragDrop
+     * @param {Event} e the mouseup event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this was dropped on.  In INTERSECT mode, an array of dd items this 
+     * was dropped on.
+     */
+    onDragDrop: function(e, id) { /* override this */ },
 
-        /**
-         * Utility function to determine if a given element has been 
-         * registered as a drag drop handle for the given Drag Drop object.
-         * @method isHandle
-         * @param {String} id the element id to check
-         * @return {boolean} true if this element is a DragDrop handle, false 
-         * otherwise
-         * @static
-         */
-        isHandle: function(sDDId, sHandleId) {
-            return ( this.handleIds[sDDId] && 
-                            this.handleIds[sDDId][sHandleId] );
-        },
+    /**
+     * Abstract method called when this item is dropped on an area with no
+     * drop target
+     * @method onInvalidDrop
+     * @param {Event} e the mouseup event
+     */
+    onInvalidDrop: function(e) { /* override this */ },
 
-        /**
-         * Returns the DragDrop instance for a given id
-         * @method getDDById
-         * @param {String} id the id of the DragDrop object
-         * @return {DragDrop} the drag drop object, null if it is not found
-         * @static
-         */
-        getDDById: function(id) {
-            for (var i in this.ids) {
-                if (this.ids[i][id]) {
-                    return this.ids[i][id];
-                }
-            }
-            return null;
-        },
+    /**
+     * Code that executes immediately before the endDrag event
+     * @method b4EndDrag
+     * @private
+     */
+    b4EndDrag: function(e) { },
 
-        /**
-         * Fired after a registered DragDrop object gets the mousedown event.
-         * Sets up the events required to track the object being dragged
-         * @method handleMouseDown
-         * @param {Event} e the event
-         * @param oDD the DragDrop object being dragged
-         * @private
-         * @static
-         */
-        handleMouseDown: function(e, oDD) {
+    /**
+     * Fired when we are done dragging the object
+     * @method endDrag
+     * @param {Event} e the mouseup event
+     */
+    endDrag: function(e) { /* override this */ },
 
-            this.currentTarget = YAHOO.util.Event.getTarget(e);
+    /**
+     * Code executed immediately before the onMouseDown event
+     * @method b4MouseDown
+     * @param {Event} e the mousedown event
+     * @private
+     */
+    b4MouseDown: function(e) {  },
 
-            this.logger.log("mousedown - adding event handlers");
-            this.dragCurrent = oDD;
+    /**
+     * Event handler that fires when a drag/drop obj gets a mousedown
+     * @method onMouseDown
+     * @param {Event} e the mousedown event
+     */
+    onMouseDown: function(e) { /* override this */ },
 
-            var el = oDD.getEl();
+    /**
+     * Event handler that fires when a drag/drop obj gets a mouseup
+     * @method onMouseUp
+     * @param {Event} e the mouseup event
+     */
+    onMouseUp: function(e) { /* override this */ },
+   
+    /**
+     * Override the onAvailable method to do what is needed after the initial
+     * position was determined.
+     * @method onAvailable
+     */
+    onAvailable: function () { 
+        //this.logger.log("onAvailable (base)"); 
+    },
+
+    /**
+     * Returns a reference to the linked element
+     * @method getEl
+     * @return {HTMLElement} the html element 
+     */
+    getEl: function() { 
+        if (!this._domRef) {
+            this._domRef = Dom.get(this.id); 
+        }
 
-            // track start position
-            this.startX = YAHOO.util.Event.getPageX(e);
-            this.startY = YAHOO.util.Event.getPageY(e);
+        return this._domRef;
+    },
 
-            this.deltaX = this.startX - el.offsetLeft;
-            this.deltaY = this.startY - el.offsetTop;
+    /**
+     * Returns a reference to the actual element to drag.  By default this is
+     * the same as the html element, but it can be assigned to another 
+     * element. An example of this can be found in YAHOO.util.DDProxy
+     * @method getDragEl
+     * @return {HTMLElement} the html element 
+     */
+    getDragEl: function() {
+        return Dom.get(this.dragElId);
+    },
 
-            this.dragThreshMet = false;
+    /**
+     * Sets up the DragDrop object.  Must be called in the constructor of any
+     * YAHOO.util.DragDrop subclass
+     * @method init
+     * @param id the id of the linked element
+     * @param {String} sGroup the group of related items
+     * @param {object} config configuration attributes
+     */
+    init: function(id, sGroup, config) {
+        this.initTarget(id, sGroup, config);
+        Event.on(this._domRef || this.id, "mousedown", 
+                        this.handleMouseDown, this, true);
+        // Event.on(this.id, "selectstart", Event.preventDefault);
+    },
 
-            this.clickTimeout = setTimeout( 
-                    function() { 
-                        var DDM = YAHOO.util.DDM;
-                        DDM.startDrag(DDM.startX, DDM.startY); 
-                    }, 
-                    this.clickTimeThresh );
-        },
+    /**
+     * Initializes Targeting functionality only... the object does not
+     * get a mousedown handler.
+     * @method initTarget
+     * @param id the id of the linked element
+     * @param {String} sGroup the group of related items
+     * @param {object} config configuration attributes
+     */
+    initTarget: function(id, sGroup, config) {
 
-        /**
-         * Fired when either the drag pixel threshol or the mousedown hold 
-         * time threshold has been met.
-         * @method startDrag
-         * @param x {int} the X position of the original mousedown
-         * @param y {int} the Y position of the original mousedown
-         * @static
-         */
-        startDrag: function(x, y) {
-            this.logger.log("firing drag start events");
-            clearTimeout(this.clickTimeout);
-            if (this.dragCurrent) {
-                this.dragCurrent.b4StartDrag(x, y);
-                this.dragCurrent.startDrag(x, y);
-            }
-            this.dragThreshMet = true;
-        },
+        // configuration attributes 
+        this.config = config || {};
 
-        /**
-         * Internal function to handle the mouseup event.  Will be invoked 
-         * from the context of the document.
-         * @method handleMouseUp
-         * @param {Event} e the event
-         * @private
-         * @static
-         */
-        handleMouseUp: function(e) {
+        // create a local reference to the drag and drop manager
+        this.DDM = YAHOO.util.DDM;
 
-            if (! this.dragCurrent) {
-                return;
-            }
+        // initialize the groups object
+        this.groups = {};
 
-            clearTimeout(this.clickTimeout);
+        // assume that we have an element reference instead of an id if the
+        // parameter is not a string
+        if (typeof id !== "string") {
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");
+            this._domRef = id;
+            id = Dom.generateId(id);
+        }
 
-            if (this.dragThreshMet) {
-                this.logger.log("mouseup detected - completing drag");
-                this.fireEvents(e, true);
-            } else {
-                this.logger.log("drag threshold not met");
-            }
+        // set the id
+        this.id = id;
 
-            this.stopDrag(e);
+        // add to an interaction group
+        this.addToGroup((sGroup) ? sGroup : "default");
 
-            this.stopEvent(e);
-        },
+        // We don't want to register this as the handle with the manager
+        // so we just set the id rather than calling the setter.
+        this.handleElId = id;
 
-        /**
-         * Utility to stop event propagation and event default, if these 
-         * features are turned on.
-         * @method stopEvent
-         * @param {Event} e the event as returned by this.getEvent()
-         * @static
-         */
-        stopEvent: function(e) {
-            if (this.stopPropagation) {
-                YAHOO.util.Event.stopPropagation(e);
-            }
+        Event.onAvailable(id, this.handleOnAvailable, this, true);
 
-            if (this.preventDefault) {
-                YAHOO.util.Event.preventDefault(e);
-            }
-        },
+        // create a logger instance
+        this.logger = (YAHOO.widget.LogWriter) ? 
+                new YAHOO.widget.LogWriter(this.toString()) : YAHOO;
 
-        /** 
-         * Internal function to clean up event handlers after the drag 
-         * operation is complete
-         * @method stopDrag
-         * @param {Event} e the event
-         * @private
-         * @static
-         */
-        stopDrag: function(e) {
-            // this.logger.log("mouseup - removing event handlers");
+        // the linked element is the element that gets dragged by default
+        this.setDragElId(id); 
 
-            // Fire the drag end event for the item that was dragged
-            if (this.dragCurrent) {
-                if (this.dragThreshMet) {
-                    this.logger.log("firing endDrag events");
-                    this.dragCurrent.b4EndDrag(e);
-                    this.dragCurrent.endDrag(e);
-                }
+        // by default, clicked anchors will not start drag operations. 
+        // @TODO what else should be here?  Probably form fields.
+        this.invalidHandleTypes = { A: "A" };
+        this.invalidHandleIds = {};
+        this.invalidHandleClasses = [];
 
-                this.logger.log("firing mouseUp event");
-                this.dragCurrent.onMouseUp(e);
-            }
+        this.applyConfig();
+    },
 
-            this.dragCurrent = null;
-            this.dragOvers = {};
-        },
+    /**
+     * Applies the configuration parameters that were passed into the constructor.
+     * This is supposed to happen at each level through the inheritance chain.  So
+     * a DDProxy implentation will execute apply config on DDProxy, DD, and 
+     * DragDrop in order to get all of the parameters that are available in
+     * each object.
+     * @method applyConfig
+     */
+    applyConfig: function() {
 
+        // configurable properties: 
+        //    padding, isTarget, maintainOffset, primaryButtonOnly
+        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);
 
-        /** 
-         * Internal function to handle the mousemove event.  Will be invoked 
-         * from the context of the html element.
-         *
-         * @TODO figure out what we can do about mouse events lost when the 
-         * user drags objects beyond the window boundary.  Currently we can 
-         * detect this in internet explorer by verifying that the mouse is 
-         * down during the mousemove event.  Firefox doesn't give us the 
-         * button state on the mousemove event.
-         * @method handleMouseMove
-         * @param {Event} e the event
-         * @private
-         * @static
-         */
-        handleMouseMove: function(e) {
-            //this.logger.log("handlemousemove");
-            if (! this.dragCurrent) {
-                // this.logger.log("no current drag obj");
-                return true;
-            }
+    },
 
-            // var button = e.which || e.button;
-            // this.logger.log("which: " + e.which + ", button: "+ e.button);
+    /**
+     * Executed when the linked element is available
+     * @method handleOnAvailable
+     * @private
+     */
+    handleOnAvailable: function() {
+        //this.logger.log("handleOnAvailable");
+        this.available = true;
+        this.resetConstraints();
+        this.onAvailable();
+    },
 
-            // check for IE mouseup outside of page boundary
-            if (YAHOO.util.Event.isIE && !e.button) {
-                this.logger.log("button failure");
-                this.stopEvent(e);
-                return this.handleMouseUp(e);
-            }
+     /**
+     * Configures the padding for the target zone in px.  Effectively expands
+     * (or reduces) the virtual object size for targeting calculations.  
+     * Supports css-style shorthand; if only one parameter is passed, all sides
+     * will have that padding, and if only two are passed, the top and bottom
+     * will have the first param, the left and right the second.
+     * @method setPadding
+     * @param {int} iTop    Top pad
+     * @param {int} iRight  Right pad
+     * @param {int} iBot    Bot pad
+     * @param {int} iLeft   Left pad
+     */
+    setPadding: function(iTop, iRight, iBot, iLeft) {
+        // this.padding = [iLeft, iRight, iTop, iBot];
+        if (!iRight && 0 !== iRight) {
+            this.padding = [iTop, iTop, iTop, iTop];
+        } else if (!iBot && 0 !== iBot) {
+            this.padding = [iTop, iRight, iTop, iRight];
+        } else {
+            this.padding = [iTop, iRight, iBot, iLeft];
+        }
+    },
 
-            if (!this.dragThreshMet) {
-                var diffX = Math.abs(this.startX - YAHOO.util.Event.getPageX(e));
-                var diffY = Math.abs(this.startY - YAHOO.util.Event.getPageY(e));
-                // this.logger.log("diffX: " + diffX + "diffY: " + diffY);
-                if (diffX > this.clickPixelThresh || 
-                            diffY > this.clickPixelThresh) {
-                    this.logger.log("pixel threshold met");
-                    this.startDrag(this.startX, this.startY);
-                }
-            }
+    /**
+     * Stores the initial placement of the linked element.
+     * @method setInitialPosition
+     * @param {int} diffX   the X offset, default 0
+     * @param {int} diffY   the Y offset, default 0
+     * @private
+     */
+    setInitPosition: function(diffX, diffY) {
+        var el = this.getEl();
 
-            if (this.dragThreshMet) {
-                this.dragCurrent.b4Drag(e);
-                this.dragCurrent.onDrag(e);
-                this.fireEvents(e, false);
-            }
+        if (!this.DDM.verifyEl(el)) {
+            this.logger.log(this.id + " element is broken");
+            return;
+        }
 
-            this.stopEvent(e);
+        var dx = diffX || 0;
+        var dy = diffY || 0;
 
-            return true;
-        },
+        var p = Dom.getXY( el );
 
-        /**
-         * Iterates over all of the DragDrop elements to find ones we are 
-         * hovering over or dropping on
-         * @method fireEvents
-         * @param {Event} e the event
-         * @param {boolean} isDrop is this a drop op or a mouseover op?
-         * @private
-         * @static
-         */
-        fireEvents: function(e, isDrop) {
-            var dc = this.dragCurrent;
+        this.initPageX = p[0] - dx;
+        this.initPageY = p[1] - dy;
 
-            // If the user did the mouse up outside of the window, we could 
-            // get here even though we have ended the drag.
-            if (!dc || dc.isLocked()) {
-                return;
-            }
+        this.lastPageX = p[0];
+        this.lastPageY = p[1];
 
-            var x = YAHOO.util.Event.getPageX(e);
-            var y = YAHOO.util.Event.getPageY(e);
-            var pt = new YAHOO.util.Point(x,y);
+        this.logger.log(this.id + " initial position: " + this.initPageX + 
+                ", " + this.initPageY);
 
-            // cache the previous dragOver array
-            var oldOvers = [];
 
-            var outEvts   = [];
-            var overEvts  = [];
-            var dropEvts  = [];
-            var enterEvts = [];
+        this.setStartPosition(p);
+    },
 
-            // Check to see if the object(s) we were hovering over is no longer 
-            // being hovered over so we can fire the onDragOut event
-            for (var i in this.dragOvers) {
+    /**
+     * Sets the start position of the element.  This is set when the obj
+     * is initialized, the reset when a drag is started.
+     * @method setStartPosition
+     * @param pos current position (from previous lookup)
+     * @private
+     */
+    setStartPosition: function(pos) {
+        var p = pos || Dom.getXY(this.getEl());
 
-                var ddo = this.dragOvers[i];
+        this.deltaSetXY = null;
 
-                if (! this.isTypeOfDD(ddo)) {
-                    continue;
-                }
+        this.startPageX = p[0];
+        this.startPageY = p[1];
+    },
 
-                if (! this.isOverTarget(pt, ddo, this.mode)) {
-                    outEvts.push( ddo );
-                }
+    /**
+     * Add this instance to a group of related drag/drop objects.  All 
+     * instances belong to at least one group, and can belong to as many 
+     * groups as needed.
+     * @method addToGroup
+     * @param sGroup {string} the name of the group
+     */
+    addToGroup: function(sGroup) {
+        this.groups[sGroup] = true;
+        this.DDM.regDragDrop(this, sGroup);
+    },
 
-                oldOvers[i] = true;
-                delete this.dragOvers[i];
-            }
+    /**
+     * Remove's this instance from the supplied interaction group
+     * @method removeFromGroup
+     * @param {string}  sGroup  The group to drop
+     */
+    removeFromGroup: function(sGroup) {
+        this.logger.log("Removing from group: " + sGroup);
+        if (this.groups[sGroup]) {
+            delete this.groups[sGroup];
+        }
 
-            for (var sGroup in dc.groups) {
-                // this.logger.log("Processing group " + sGroup);
-                
-                if ("string" != typeof sGroup) {
-                    continue;
-                }
+        this.DDM.removeDDFromGroup(this, sGroup);
+    },
 
-                for (i in this.ids[sGroup]) {
-                    var oDD = this.ids[sGroup][i];
-                    if (! this.isTypeOfDD(oDD)) {
-                        continue;
-                    }
+    /**
+     * Allows you to specify that an element other than the linked element 
+     * will be moved with the cursor during a drag
+     * @method setDragElId
+     * @param id {string} the id of the element that will be used to initiate the drag
+     */
+    setDragElId: function(id) {
+        this.dragElId = id;
+    },
 
-                    if (oDD.isTarget && !oDD.isLocked() && oDD != dc) {
-                        if (this.isOverTarget(pt, oDD, this.mode)) {
-                            // look for drop interactions
-                            if (isDrop) {
-                                dropEvts.push( oDD );
-                            // look for drag enter and drag over interactions
-                            } else {
+    /**
+     * Allows you to specify a child of the linked element that should be 
+     * used to initiate the drag operation.  An example of this would be if 
+     * you have a content div with text and links.  Clicking anywhere in the 
+     * content area would normally start the drag operation.  Use this method
+     * to specify that an element inside of the content div is the element 
+     * that starts the drag operation.
+     * @method setHandleElId
+     * @param id {string} the id of the element that will be used to 
+     * initiate the drag.
+     */
+    setHandleElId: function(id) {
+        if (typeof id !== "string") {
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");
+            id = Dom.generateId(id);
+        }
+        this.handleElId = id;
+        this.DDM.regHandle(this.id, id);
+    },
 
-                                // initial drag over: dragEnter fires
-                                if (!oldOvers[oDD.id]) {
-                                    enterEvts.push( oDD );
-                                // subsequent drag overs: dragOver fires
-                                } else {
-                                    overEvts.push( oDD );
-                                }
+    /**
+     * Allows you to set an element outside of the linked element as a drag 
+     * handle
+     * @method setOuterHandleElId
+     * @param id the id of the element that will be used to initiate the drag
+     */
+    setOuterHandleElId: function(id) {
+        if (typeof id !== "string") {
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");
+            id = Dom.generateId(id);
+        }
+        this.logger.log("Adding outer handle event: " + id);
+        Event.on(id, "mousedown", 
+                this.handleMouseDown, this, true);
+        this.setHandleElId(id);
 
-                                this.dragOvers[oDD.id] = oDD;
-                            }
-                        }
-                    }
-                }
-            }
+        this.hasOuterHandles = true;
+    },
 
-            if (this.mode) {
-                if (outEvts.length) {
-                    this.logger.log(dc.id+" onDragOut: " + outEvts);
-                    dc.b4DragOut(e, outEvts);
-                    dc.onDragOut(e, outEvts);
-                }
+    /**
+     * Remove all drag and drop hooks for this element
+     * @method unreg
+     */
+    unreg: function() {
+        this.logger.log("DragDrop obj cleanup " + this.id);
+        Event.removeListener(this.id, "mousedown", 
+                this.handleMouseDown);
+        this._domRef = null;
+        this.DDM._remove(this);
+    },
 
-                if (enterEvts.length) {
-                    this.logger.log(dc.id+" onDragEnter: " + enterEvts);
-                    dc.onDragEnter(e, enterEvts);
-                }
+    /**
+     * Returns true if this instance is locked, or the drag drop mgr is locked
+     * (meaning that all drag/drop is disabled on the page.)
+     * @method isLocked
+     * @return {boolean} true if this obj or all drag/drop is locked, else 
+     * false
+     */
+    isLocked: function() {
+        return (this.DDM.isLocked() || this.locked);
+    },
 
-                if (overEvts.length) {
-                    this.logger.log(dc.id+" onDragOver: " + overEvts);
-                    dc.b4DragOver(e, overEvts);
-                    dc.onDragOver(e, overEvts);
-                }
+    /**
+     * Fired when this object is clicked
+     * @method handleMouseDown
+     * @param {Event} e 
+     * @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj)
+     * @private
+     */
+    handleMouseDown: function(e, oDD) {
 
-                if (dropEvts.length) {
-                    this.logger.log(dc.id+" onDragDrop: " + dropEvts);
-                    dc.b4DragDrop(e, dropEvts);
-                    dc.onDragDrop(e, dropEvts);
-                }
+        var button = e.which || e.button;
+        this.logger.log("button: " + button);
 
-            } else {
-                // fire dragout events
-                var len = 0;
-                for (i=0, len=outEvts.length; i<len; ++i) {
-                    this.logger.log(dc.id+" onDragOut: " + outEvts[i].id);
-                    dc.b4DragOut(e, outEvts[i].id);
-                    dc.onDragOut(e, outEvts[i].id);
-                }
-                 
-                // fire enter events
-                for (i=0,len=enterEvts.length; i<len; ++i) {
-                    this.logger.log(dc.id + " onDragEnter " + enterEvts[i].id);
-                    // dc.b4DragEnter(e, oDD.id);
-                    dc.onDragEnter(e, enterEvts[i].id);
-                }
-         
-                // fire over events
-                for (i=0,len=overEvts.length; i<len; ++i) {
-                    this.logger.log(dc.id + " onDragOver " + overEvts[i].id);
-                    dc.b4DragOver(e, overEvts[i].id);
-                    dc.onDragOver(e, overEvts[i].id);
-                }
+        if (this.primaryButtonOnly && button > 1) {
+            this.logger.log("Mousedown was not produced by the primary button");
+            return;
+        }
 
-                // fire drop events
-                for (i=0, len=dropEvts.length; i<len; ++i) {
-                    this.logger.log(dc.id + " dropped on " + dropEvts[i].id);
-                    dc.b4DragDrop(e, dropEvts[i].id);
-                    dc.onDragDrop(e, dropEvts[i].id);
-                }
+        if (this.isLocked()) {
+            this.logger.log("Drag and drop is disabled, aborting");
+            return;
+        }
 
-            }
+        this.logger.log("mousedown " + this.id);
 
-            // notify about a drop that did not find a target
-            if (isDrop && !dropEvts.length) {
-                this.logger.log(dc.id + " dropped, but not on a target");
-                dc.onInvalidDrop(e);
-            }
+        this.logger.log("firing onMouseDown events");
 
-        },
+        // firing the mousedown events prior to calculating positions
+        this.b4MouseDown(e);
+        this.onMouseDown(e);
 
-        /**
-         * Helper function for getting the best match from the list of drag 
-         * and drop objects returned by the drag and drop events when we are 
-         * in INTERSECT mode.  It returns either the first object that the 
-         * cursor is over, or the object that has the greatest overlap with 
-         * the dragged element.
-         * @method getBestMatch
-         * @param  {DragDrop[]} dds The array of drag and drop objects 
-         * targeted
-         * @return {DragDrop}       The best single match
-         * @static
-         */
-        getBestMatch: function(dds) {
-            var winner = null;
+        this.DDM.refreshCache(this.groups);
+        // var self = this;
+        // setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0);
 
-            var len = dds.length;
+        // Only process the event if we really clicked within the linked 
+        // element.  The reason we make this check is that in the case that 
+        // another element was moved between the clicked element and the 
+        // cursor in the time between the mousedown and mouseup events. When 
+        // this happens, the element gets the next mousedown event 
+        // regardless of where on the screen it happened.  
+        var pt = new YAHOO.util.Point(Event.getPageX(e), Event.getPageY(e));
+        if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) )  {
+                this.logger.log("Click was not over the element: " + this.id);
+        } else {
+            if (this.clickValidator(e)) {
 
-            if (len == 1) {
-                winner = dds[0];
-            } else {
-                // Loop through the targeted items
-                for (var i=0; i<len; ++i) {
-                    var dd = dds[i];
-                    // If the cursor is over the object, it wins.  If the 
-                    // cursor is over multiple matches, the first one we come
-                    // to wins.
-                    if (this.mode == this.INTERSECT && dd.cursorIsOver) {
-                        winner = dd;
-                        break;
-                    // Otherwise the object with the most overlap wins
-                    } else {
-                        if (!winner || !winner.overlap || (dd.overlap &&
-                            winner.overlap.getArea() < dd.overlap.getArea())) {
-                            winner = dd;
-                        }
-                    }
-                }
-            }
+                this.logger.log("click was a valid handle");
+
+                // set the initial element position
+                this.setStartPosition();
 
-            return winner;
-        },
+                // start tracking mousemove distance and mousedown time to
+                // determine when to start the actual drag
+                this.DDM.handleMouseDown(e, this);
 
-        /**
-         * Refreshes the cache of the top-left and bottom-right points of the 
-         * drag and drop objects in the specified group(s).  This is in the
-         * format that is stored in the drag and drop instance, so typical 
-         * usage is:
-         * <code>
-         * YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups);
-         * </code>
-         * Alternatively:
-         * <code>
-         * YAHOO.util.DragDropMgr.refreshCache({group1:true, group2:true});
-         * </code>
-         * @TODO this really should be an indexed array.  Alternatively this
-         * method could accept both.
-         * @method refreshCache
-         * @param {Object} groups an associative array of groups to refresh
-         * @static
-         */
-        refreshCache: function(groups) {
-            this.logger.log("refreshing element location cache");
-            for (var sGroup in groups) {
-                if ("string" != typeof sGroup) {
-                    continue;
-                }
-                for (var i in this.ids[sGroup]) {
-                    var oDD = this.ids[sGroup][i];
+                // this mousedown is mine
+                this.DDM.stopEvent(e);
+            } else {
 
-                    if (this.isTypeOfDD(oDD)) {
-                    // if (this.isTypeOfDD(oDD) && oDD.isTarget) {
-                        var loc = this.getLocation(oDD);
-                        if (loc) {
-                            this.locationCache[oDD.id] = loc;
-                        } else {
-                            delete this.locationCache[oDD.id];
-                            this.logger.log("Could not get the loc for " + oDD.id,
-                                    "warn");
-                            // this will unregister the drag and drop object if
-                            // the element is not in a usable state
-                            // oDD.unreg();
-                        }
-                    }
-                }
-            }
-        },
+this.logger.log("clickValidator returned false, drag not initiated");
 
-        /**
-         * This checks to make sure an element exists and is in the DOM.  The
-         * main purpose is to handle cases where innerHTML is used to remove
-         * drag and drop objects from the DOM.  IE provides an 'unspecified
-         * error' when trying to access the offsetParent of such an element
-         * @method verifyEl
-         * @param {HTMLElement} el the element to check
-         * @return {boolean} true if the element looks usable
-         * @static
-         */
-        verifyEl: function(el) {
-            try {
-                if (el) {
-                    var parent = el.offsetParent;
-                    if (parent) {
-                        return true;
-                    }
-                }
-            } catch(e) {
-                this.logger.log("detected problem with an element");
             }
+        }
+    },
 
-            return false;
-        },
-        
-        /**
-         * Returns a Region object containing the drag and drop element's position
-         * and size, including the padding configured for it
-         * @method getLocation
-         * @param {DragDrop} oDD the drag and drop object to get the 
-         *                       location for
-         * @return {YAHOO.util.Region} a Region object representing the total area
-         *                             the element occupies, including any padding
-         *                             the instance is configured for.
-         * @static
-         */
-        getLocation: function(oDD) {
-            if (! this.isTypeOfDD(oDD)) {
-                this.logger.log(oDD + " is not a DD obj");
-                return null;
-            }
+    clickValidator: function(e) {
+        var target = Event.getTarget(e);
+        return ( this.isValidHandleChild(target) &&
+                    (this.id == this.handleElId || 
+                        this.DDM.handleWasClicked(target, this.id)) );
+    },
 
-            var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;
+    /**
+     * Finds the location the element should be placed if we want to move
+     * it to where the mouse location less the click offset would place us.
+     * @method getTargetCoord
+     * @param {int} iPageX the X coordinate of the click
+     * @param {int} iPageY the Y coordinate of the click
+     * @return an object that contains the coordinates (Object.x and Object.y)
+     * @private
+     */
+    getTargetCoord: function(iPageX, iPageY) {
 
-            try {
-                pos= YAHOO.util.Dom.getXY(el);
-            } catch (e) { }
+        // this.logger.log("getTargetCoord: " + iPageX + ", " + iPageY);
 
-            if (!pos) {
-                this.logger.log("getXY failed");
-                return null;
-            }
+        var x = iPageX - this.deltaX;
+        var y = iPageY - this.deltaY;
 
-            x1 = pos[0];
-            x2 = x1 + el.offsetWidth;
-            y1 = pos[1];
-            y2 = y1 + el.offsetHeight;
+        if (this.constrainX) {
+            if (x < this.minX) { x = this.minX; }
+            if (x > this.maxX) { x = this.maxX; }
+        }
 
-            t = y1 - oDD.padding[0];
-            r = x2 + oDD.padding[1];
-            b = y2 + oDD.padding[2];
-            l = x1 - oDD.padding[3];
+        if (this.constrainY) {
+            if (y < this.minY) { y = this.minY; }
+            if (y > this.maxY) { y = this.maxY; }
+        }
 
-            return new YAHOO.util.Region( t, r, b, l );
-        },
+        x = this.getTick(x, this.xTicks);
+        y = this.getTick(y, this.yTicks);
 
-        /**
-         * Checks the cursor location to see if it over the target
-         * @method isOverTarget
-         * @param {YAHOO.util.Point} pt The point to evaluate
-         * @param {DragDrop} oTarget the DragDrop object we are inspecting
-         * @return {boolean} true if the mouse is over the target
-         * @private
-         * @static
-         */
-        isOverTarget: function(pt, oTarget, intersect) {
-            // use cache if available
-            var loc = this.locationCache[oTarget.id];
-            if (!loc || !this.useCache) {
-                this.logger.log("cache not populated");
-                loc = this.getLocation(oTarget);
-                this.locationCache[oTarget.id] = loc;
+        // this.logger.log("getTargetCoord " + 
+                // " iPageX: " + iPageX +
+                // " iPageY: " + iPageY +
+                // " x: " + x + ", y: " + y);
 
-                this.logger.log("cache: " + loc);
-            }
+        return {x:x, y:y};
+    },
 
-            if (!loc) {
-                this.logger.log("could not get the location of the element");
-                return false;
-            }
+    /**
+     * Allows you to specify a tag name that should not start a drag operation
+     * when clicked.  This is designed to facilitate embedding links within a
+     * drag handle that do something other than start the drag.
+     * @method addInvalidHandleType
+     * @param {string} tagName the type of element to exclude
+     */
+    addInvalidHandleType: function(tagName) {
+        var type = tagName.toUpperCase();
+        this.invalidHandleTypes[type] = type;
+    },
 
-            //this.logger.log("loc: " + loc + ", pt: " + pt);
-            oTarget.cursorIsOver = loc.contains( pt );
+    /**
+     * Lets you to specify an element id for a child of a drag handle
+     * that should not initiate a drag
+     * @method addInvalidHandleId
+     * @param {string} id the element id of the element you wish to ignore
+     */
+    addInvalidHandleId: function(id) {
+        if (typeof id !== "string") {
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");
+            id = Dom.generateId(id);
+        }
+        this.invalidHandleIds[id] = id;
+    },
 
-            // DragDrop is using this as a sanity check for the initial mousedown
-            // in this case we are done.  In POINT mode, if the drag obj has no
-            // contraints, we are also done. Otherwise we need to evaluate the 
-            // location of the target as related to the actual location of the
-            // dragged element.
-            var dc = this.dragCurrent;
-            if (!dc || !dc.getTargetCoord || 
-                    (!intersect && !dc.constrainX && !dc.constrainY)) {
-                return oTarget.cursorIsOver;
+
+    /**
+     * Lets you specify a css class of elements that will not initiate a drag
+     * @method addInvalidHandleClass
+     * @param {string} cssClass the class of the elements you wish to ignore
+     */
+    addInvalidHandleClass: function(cssClass) {
+        this.invalidHandleClasses.push(cssClass);
+    },
+
+    /**
+     * Unsets an excluded tag name set by addInvalidHandleType
+     * @method removeInvalidHandleType
+     * @param {string} tagName the type of element to unexclude
+     */
+    removeInvalidHandleType: function(tagName) {
+        var type = tagName.toUpperCase();
+        // this.invalidHandleTypes[type] = null;
+        delete this.invalidHandleTypes[type];
+    },
+    
+    /**
+     * Unsets an invalid handle id
+     * @method removeInvalidHandleId
+     * @param {string} id the id of the element to re-enable
+     */
+    removeInvalidHandleId: function(id) {
+        if (typeof id !== "string") {
+            YAHOO.log("id is not a string, assuming it is an HTMLElement");
+            id = Dom.generateId(id);
+        }
+        delete this.invalidHandleIds[id];
+    },
+
+    /**
+     * Unsets an invalid css class
+     * @method removeInvalidHandleClass
+     * @param {string} cssClass the class of the element(s) you wish to 
+     * re-enable
+     */
+    removeInvalidHandleClass: function(cssClass) {
+        for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) {
+            if (this.invalidHandleClasses[i] == cssClass) {
+                delete this.invalidHandleClasses[i];
             }
+        }
+    },
 
-            oTarget.overlap = null;
+    /**
+     * Checks the tag exclusion list to see if this click should be ignored
+     * @method isValidHandleChild
+     * @param {HTMLElement} node the HTMLElement to evaluate
+     * @return {boolean} true if this is a valid tag type, false if not
+     */
+    isValidHandleChild: function(node) {
 
-            // Get the current location of the drag element, this is the
-            // location of the mouse event less the delta that represents
-            // where the original mousedown happened on the element.  We
-            // need to consider constraints and ticks as well.
-            var pos = dc.getTargetCoord(pt.x, pt.y);
+        var valid = true;
+        // var n = (node.nodeName == "#text") ? node.parentNode : node;
+        var nodeName;
+        try {
+            nodeName = node.nodeName.toUpperCase();
+        } catch(e) {
+            nodeName = node.nodeName;
+        }
+        valid = valid && !this.invalidHandleTypes[nodeName];
+        valid = valid && !this.invalidHandleIds[node.id];
 
-            var el = dc.getDragEl();
-            var curRegion = new YAHOO.util.Region( pos.y, 
-                                                   pos.x + el.offsetWidth,
-                                                   pos.y + el.offsetHeight, 
-                                                   pos.x );
+        for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {
+            valid = !Dom.hasClass(node, this.invalidHandleClasses[i]);
+        }
+
+        this.logger.log("Valid handle? ... " + valid);
 
-            var overlap = curRegion.intersect(loc);
+        return valid;
 
-            if (overlap) {
-                oTarget.overlap = overlap;
-                return (intersect) ? true : oTarget.cursorIsOver;
-            } else {
-                return false;
-            }
-        },
+    },
 
-        /**
-         * unload event handler
-         * @method _onUnload
-         * @private
-         * @static
-         */
-        _onUnload: function(e, me) {
-            this.unregAll();
-        },
+    /**
+     * Create the array of horizontal tick marks if an interval was specified
+     * in setXConstraint().
+     * @method setXTicks
+     * @private
+     */
+    setXTicks: function(iStartX, iTickSize) {
+        this.xTicks = [];
+        this.xTickSize = iTickSize;
+        
+        var tickMap = {};
 
-        /**
-         * Cleans up the drag and drop events and objects.
-         * @method unregAll
-         * @private
-         * @static
-         */
-        unregAll: function() {
-            this.logger.log("unregister all");
+        for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {
+            if (!tickMap[i]) {
+                this.xTicks[this.xTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
 
-            if (this.dragCurrent) {
-                this.stopDrag();
-                this.dragCurrent = null;
+        for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) {
+            if (!tickMap[i]) {
+                this.xTicks[this.xTicks.length] = i;
+                tickMap[i] = true;
             }
+        }
 
-            this._execOnAll("unreg", []);
+        this.xTicks.sort(this.DDM.numericSort) ;
+        this.logger.log("xTicks: " + this.xTicks.join());
+    },
 
-            for (i in this.elementCache) {
-                delete this.elementCache[i];
-            }
+    /**
+     * Create the array of vertical tick marks if an interval was specified in 
+     * setYConstraint().
+     * @method setYTicks
+     * @private
+     */
+    setYTicks: function(iStartY, iTickSize) {
+        // this.logger.log("setYTicks: " + iStartY + ", " + iTickSize
+               // + ", " + this.initPageY + ", " + this.minY + ", " + this.maxY );
+        this.yTicks = [];
+        this.yTickSize = iTickSize;
 
-            this.elementCache = {};
-            this.ids = {};
-        },
+        var tickMap = {};
 
-        /**
-         * A cache of DOM elements
-         * @property elementCache
-         * @private
-         * @static
-         */
-        elementCache: {},
-        
-        /**
-         * Get the wrapper for the DOM element specified
-         * @method getElWrapper
-         * @param {String} id the id of the element to get
-         * @return {YAHOO.util.DDM.ElementWrapper} the wrapped element
-         * @private
-         * @deprecated This wrapper isn't that useful
-         * @static
-         */
-        getElWrapper: function(id) {
-            var oWrapper = this.elementCache[id];
-            if (!oWrapper || !oWrapper.el) {
-                oWrapper = this.elementCache[id] = 
-                    new this.ElementWrapper(YAHOO.util.Dom.get(id));
+        for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) {
+            if (!tickMap[i]) {
+                this.yTicks[this.yTicks.length] = i;
+                tickMap[i] = true;
             }
-            return oWrapper;
-        },
-
-        /**
-         * Returns the actual DOM element
-         * @method getElement
-         * @param {String} id the id of the elment to get
-         * @return {Object} The element
-         * @deprecated use YAHOO.util.Dom.get instead
-         * @static
-         */
-        getElement: function(id) {
-            return YAHOO.util.Dom.get(id);
-        },
-        
-        /**
-         * Returns the style property for the DOM element (i.e., 
-         * document.getElById(id).style)
-         * @method getCss
-         * @param {String} id the id of the elment to get
-         * @return {Object} The style property of the element
-         * @deprecated use YAHOO.util.Dom instead
-         * @static
-         */
-        getCss: function(id) {
-            var el = YAHOO.util.Dom.get(id);
-            return (el) ? el.style : null;
-        },
+        }
 
-        /**
-         * Inner class for cached elements
-         * @class DragDropMgr.ElementWrapper
-         * @for DragDropMgr
-         * @private
-         * @deprecated
-         */
-        ElementWrapper: function(el) {
-                /**
-                 * The element
-                 * @property el
-                 */
-                this.el = el || null;
-                /**
-                 * The element id
-                 * @property id
-                 */
-                this.id = this.el && el.id;
-                /**
-                 * A reference to the style property
-                 * @property css
-                 */
-                this.css = this.el && el.style;
-            },
+        for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) {
+            if (!tickMap[i]) {
+                this.yTicks[this.yTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
 
-        /**
-         * Returns the X position of an html element
-         * @method getPosX
-         * @param el the element for which to get the position
-         * @return {int} the X coordinate
-         * @for DragDropMgr
-         * @deprecated use YAHOO.util.Dom.getX instead
-         * @static
-         */
-        getPosX: function(el) {
-            return YAHOO.util.Dom.getX(el);
-        },
+        this.yTicks.sort(this.DDM.numericSort) ;
+        this.logger.log("yTicks: " + this.yTicks.join());
+    },
 
-        /**
-         * Returns the Y position of an html element
-         * @method getPosY
-         * @param el the element for which to get the position
-         * @return {int} the Y coordinate
-         * @deprecated use YAHOO.util.Dom.getY instead
-         * @static
-         */
-        getPosY: function(el) {
-            return YAHOO.util.Dom.getY(el); 
-        },
+    /**
+     * By default, the element can be dragged any place on the screen.  Use 
+     * this method to limit the horizontal travel of the element.  Pass in 
+     * 0,0 for the parameters if you want to lock the drag to the y axis.
+     * @method setXConstraint
+     * @param {int} iLeft the number of pixels the element can move to the left
+     * @param {int} iRight the number of pixels the element can move to the 
+     * right
+     * @param {int} iTickSize optional parameter for specifying that the 
+     * element
+     * should move iTickSize pixels at a time.
+     */
+    setXConstraint: function(iLeft, iRight, iTickSize) {
+        this.leftConstraint = parseInt(iLeft, 10);
+        this.rightConstraint = parseInt(iRight, 10);
 
-        /**
-         * Swap two nodes.  In IE, we use the native method, for others we 
-         * emulate the IE behavior
-         * @method swapNode
-         * @param n1 the first node to swap
-         * @param n2 the other node to swap
-         * @static
-         */
-        swapNode: function(n1, n2) {
-            if (n1.swapNode) {
-                n1.swapNode(n2);
-            } else {
-                var p = n2.parentNode;
-                var s = n2.nextSibling;
+        this.minX = this.initPageX - this.leftConstraint;
+        this.maxX = this.initPageX + this.rightConstraint;
+        if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }
 
-                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);
-                }
-            }
-        },
+        this.constrainX = true;
+        this.logger.log("initPageX:" + this.initPageX + " minX:" + this.minX + 
+                " maxX:" + this.maxX);
+    },
 
-        /**
-         * Returns the current scroll position
-         * @method getScroll
-         * @private
-         * @static
-         */
-        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 };
-        },
+    /**
+     * Clears any constraints applied to this instance.  Also clears ticks
+     * since they can't exist independent of a constraint at this time.
+     * @method clearConstraints
+     */
+    clearConstraints: function() {
+        this.logger.log("Clearing constraints");
+        this.constrainX = false;
+        this.constrainY = false;
+        this.clearTicks();
+    },
 
-        /**
-         * Returns the specified element style property
-         * @method getStyle
-         * @param {HTMLElement} el          the element
-         * @param {string}      styleProp   the style property
-         * @return {string} The value of the style property
-         * @deprecated use YAHOO.util.Dom.getStyle
-         * @static
-         */
-        getStyle: function(el, styleProp) {
-            return YAHOO.util.Dom.getStyle(el, styleProp);
-        },
+    /**
+     * Clears any tick interval defined for this instance
+     * @method clearTicks
+     */
+    clearTicks: function() {
+        this.logger.log("Clearing ticks");
+        this.xTicks = null;
+        this.yTicks = null;
+        this.xTickSize = 0;
+        this.yTickSize = 0;
+    },
 
-        /**
-         * Gets the scrollTop
-         * @method getScrollTop
-         * @return {int} the document's scrollTop
-         * @static
-         */
-        getScrollTop: function () { return this.getScroll().top; },
+    /**
+     * By default, the element can be dragged any place on the screen.  Set 
+     * this to limit the vertical travel of the element.  Pass in 0,0 for the
+     * parameters if you want to lock the drag to the x axis.
+     * @method setYConstraint
+     * @param {int} iUp the number of pixels the element can move up
+     * @param {int} iDown the number of pixels the element can move down
+     * @param {int} iTickSize optional parameter for specifying that the 
+     * element should move iTickSize pixels at a time.
+     */
+    setYConstraint: function(iUp, iDown, iTickSize) {
+        this.logger.log("setYConstraint: " + iUp + "," + iDown + "," + iTickSize);
+        this.topConstraint = parseInt(iUp, 10);
+        this.bottomConstraint = parseInt(iDown, 10);
 
-        /**
-         * Gets the scrollLeft
-         * @method getScrollLeft
-         * @return {int} the document's scrollTop
-         * @static
-         */
-        getScrollLeft: function () { return this.getScroll().left; },
+        this.minY = this.initPageY - this.topConstraint;
+        this.maxY = this.initPageY + this.bottomConstraint;
+        if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }
 
-        /**
-         * Sets the x/y position of an element to the location of the
-         * target element.
-         * @method moveToEl
-         * @param {HTMLElement} moveEl      The element to move
-         * @param {HTMLElement} targetEl    The position reference element
-         * @static
-         */
-        moveToEl: function (moveEl, targetEl) {
-            var aCoord = YAHOO.util.Dom.getXY(targetEl);
-            this.logger.log("moveToEl: " + aCoord);
-            YAHOO.util.Dom.setXY(moveEl, aCoord);
-        },
+        this.constrainY = true;
+        
+        this.logger.log("initPageY:" + this.initPageY + " minY:" + this.minY + 
+                " maxY:" + this.maxY);
+    },
 
-        /**
-         * Gets the client height
-         * @method getClientHeight
-         * @return {int} client height in px
-         * @deprecated use YAHOO.util.Dom.getViewportHeight instead
-         * @static
-         */
-        getClientHeight: function() {
-            return YAHOO.util.Dom.getViewportHeight();
-        },
+    /**
+     * resetConstraints must be called if you manually reposition a dd element.
+     * @method resetConstraints
+     */
+    resetConstraints: function() {
 
-        /**
-         * Gets the client width
-         * @method getClientWidth
-         * @return {int} client width in px
-         * @deprecated use YAHOO.util.Dom.getViewportWidth instead
-         * @static
-         */
-        getClientWidth: function() {
-            return YAHOO.util.Dom.getViewportWidth();
-        },
+        //this.logger.log("resetConstraints");
 
-        /**
-         * Numeric array sort function
-         * @method numericSort
-         * @static
-         */
-        numericSort: function(a, b) { return (a - b); },
+        // Maintain offsets if necessary
+        if (this.initPageX || this.initPageX === 0) {
+            //this.logger.log("init pagexy: " + this.initPageX + ", " + 
+                               //this.initPageY);
+            //this.logger.log("last pagexy: " + this.lastPageX + ", " + 
+                               //this.lastPageY);
+            // figure out how much this thing has moved
+            var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0;
+            var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0;
 
-        /**
-         * Internal counter
-         * @property _timeoutCount
-         * @private
-         * @static
-         */
-        _timeoutCount: 0,
+            this.setInitPosition(dx, dy);
 
-        /**
-         * Trying to make the load order less important.  Without this we get
-         * an error if this file is loaded before the Event Utility.
-         * @method _addListeners
-         * @private
-         * @static
-         */
-        _addListeners: function() {
-            var DDM = YAHOO.util.DDM;
-            if ( YAHOO.util.Event && document ) {
-                DDM._onLoad();
-            } else {
-                if (DDM._timeoutCount > 2000) {
-                    DDM.logger.log("DragDrop requires the Event Utility");
-                } else {
-                    setTimeout(DDM._addListeners, 10);
-                    if (document && document.body) {
-                        DDM._timeoutCount += 1;
-                    }
-                }
-            }
-        },
+        // This is the first time we have detected the element's position
+        } else {
+            this.setInitPosition();
+        }
 
-        /**
-         * Recursively searches the immediate parent and all child nodes for 
-         * the handle element in order to determine wheter or not it was 
-         * clicked.
-         * @method handleWasClicked
-         * @param node the html element to inspect
-         * @static
-         */
-        handleWasClicked: function(node, id) {
-            if (this.isHandle(id, node.id)) {
-                this.logger.log("clicked node is a handle");
-                return true;
-            } else {
-                // check to see if this is a text node child of the one we want
-                var p = node.parentNode;
-                // this.logger.log("p: " + p);
+        if (this.constrainX) {
+            this.setXConstraint( this.leftConstraint, 
+                                 this.rightConstraint, 
+                                 this.xTickSize        );
+        }
 
-                while (p) {
-                    if (this.isHandle(id, p.id)) {
-                        return true;
-                    } else {
-                        this.logger.log(p.id + " is not a handle");
-                        p = p.parentNode;
-                    }
+        if (this.constrainY) {
+            this.setYConstraint( this.topConstraint, 
+                                 this.bottomConstraint, 
+                                 this.yTickSize         );
+        }
+    },
+
+    /**
+     * Normally the drag element is moved pixel by pixel, but we can specify 
+     * that it move a number of pixels at a time.  This method resolves the 
+     * location when we have it set up like this.
+     * @method getTick
+     * @param {int} val where we want to place the object
+     * @param {int[]} tickArray sorted array of valid points
+     * @return {int} the closest tick
+     * @private
+     */
+    getTick: function(val, tickArray) {
+
+        if (!tickArray) {
+            // If tick interval is not defined, it is effectively 1 pixel, 
+            // so we return the value passed to us.
+            return val; 
+        } else if (tickArray[0] >= val) {
+            // The value is lower than the first tick, so we return the first
+            // tick.
+            return tickArray[0];
+        } else {
+            for (var i=0, len=tickArray.length; i<len; ++i) {
+                var next = i + 1;
+                if (tickArray[next] && tickArray[next] >= val) {
+                    var diff1 = val - tickArray[i];
+                    var diff2 = tickArray[next] - val;
+                    return (diff2 > diff1) ? tickArray[i] : tickArray[next];
                 }
             }
 
-            return false;
+            // The value is larger than the last tick, so we return the last
+            // tick.
+            return tickArray[tickArray.length - 1];
         }
+    },
 
-    };
-
-}();
-
-// shorter alias, save a few bytes
-YAHOO.util.DDM = YAHOO.util.DragDropMgr;
-YAHOO.util.DDM._addListeners();
+    /**
+     * toString method
+     * @method toString
+     * @return {string} string representation of the dd obj
+     */
+    toString: function() {
+        return ("DragDrop " + this.id);
+    }
 
-}
+};
 
+})();
 /**
  * A DragDrop implementation where the linked element follows the 
  * mouse cursor during a drag.
@@ -2707,43 +2875,6 @@ YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, {
         }
     },
 
-    /**
-     * Finds the location the element should be placed if we want to move
-     * it to where the mouse location less the click offset would place us.
-     * @method getTargetCoord
-     * @param {int} iPageX the X coordinate of the click
-     * @param {int} iPageY the Y coordinate of the click
-     * @return an object that contains the coordinates (Object.x and Object.y)
-     * @private
-     */
-    getTargetCoord: function(iPageX, iPageY) {
-
-        // this.logger.log("getTargetCoord: " + iPageX + ", " + iPageY);
-
-        var x = iPageX - this.deltaX;
-        var y = iPageY - this.deltaY;
-
-        if (this.constrainX) {
-            if (x < this.minX) { x = this.minX; }
-            if (x > this.maxX) { x = this.maxX; }
-        }
-
-        if (this.constrainY) {
-            if (y < this.minY) { y = this.minY; }
-            if (y > this.maxY) { y = this.maxY; }
-        }
-
-        x = this.getTick(x, this.xTicks);
-        y = this.getTick(y, this.yTicks);
-
-        // this.logger.log("getTargetCoord " + 
-                // " iPageX: " + iPageX +
-                // " iPageY: " + iPageY +
-                // " x: " + x + ", y: " + y);
-
-        return {x:x, y:y};
-    },
-
     /*
      * Sets up config options specific to this class. Overrides
      * YAHOO.util.DragDrop, but all versions of this method through the 
@@ -2759,6 +2890,7 @@ YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, {
      * YAHOO.util.DragDrop.
      */
     b4MouseDown: function(e) {
+        this.setStartPosition();
         // this.resetConstraints();
         this.autoOffset(YAHOO.util.Event.getPageX(e), 
                             YAHOO.util.Event.getPageY(e));
@@ -2872,15 +3004,14 @@ YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {
      * @method createFrame
      */
     createFrame: function() {
-        var self = this;
-        var body = document.body;
+        var self=this, body=document.body;
 
         if (!body || !body.firstChild) {
             setTimeout( function() { self.createFrame(); }, 50 );
             return;
         }
 
-        var div = this.getDragEl();
+        var div=this.getDragEl(), Dom=YAHOO.util.Dom;
 
         if (!div) {
             div    = document.createElement("div");
@@ -2892,6 +3023,21 @@ YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {
             s.cursor     = "move";
             s.border     = "2px solid #aaa";
             s.zIndex     = 999;
+            s.height     = "25px";
+            s.width      = "25px";
+
+            var _data = document.createElement('div');
+            Dom.setStyle(_data, 'height', '100%');
+            Dom.setStyle(_data, 'width', '100%');
+            /**
+            * If the proxy element has no background-color, then it is considered to the "transparent" by Internet Explorer.
+            * Since it is "transparent" then the events pass through it to the iframe below.
+            * So creating a "fake" div inside the proxy element and giving it a background-color, then setting it to an
+            * opacity of 0, it appears to not be there, however IE still thinks that it is so the events never pass through.
+            */
+            Dom.setStyle(_data, 'background-color', '#ccc');
+            Dom.setStyle(_data, 'opacity', '0');
+            div.appendChild(_data);
 
             // appendChild can blow up IE if invoked prior to the window load event
             // while rendering a table.  It is possible there are other scenarios 
@@ -2910,7 +3056,7 @@ YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {
     },
 
     applyConfig: function() {
-        this.logger.log("DDProxy applyConfig");
+        //this.logger.log("DDProxy applyConfig");
         YAHOO.util.DDProxy.superclass.applyConfig.call(this);
 
         this.resizeFrame = (this.config.resizeFrame !== false);
@@ -2979,10 +3125,14 @@ YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {
 
     // overrides YAHOO.util.DragDrop
     b4MouseDown: function(e) {
+        this.setStartPosition();
         var x = YAHOO.util.Event.getPageX(e);
         var y = YAHOO.util.Event.getPageY(e);
         this.autoOffset(x, y);
-        this.setDragElPos(x, y);
+
+        // This causes the autoscroll code to kick off, which means autoscroll can
+        // happen prior to the check for a valid drag handle.
+        // this.setDragElPos(x, y);
     },
 
     // overrides YAHOO.util.DragDrop
@@ -3054,3 +3204,4 @@ YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop, {
         return ("DDTarget " + this.id);
     }
 });
+YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.3.0", build: "442"});
index 26e0ba284b9949e8b13ab4ff4346dc543a9c3c9b..d28b4d621393b27f12db81323a18d2e2615dfbdb 100755 (executable)
@@ -1,33 +1,11 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 
-
-(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,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=Dom.get(this.id);}
-return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}
-this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}
-var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}
-this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.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=Dom.generateId(id);}
-Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;}
-if(this.isLocked()){return;}
-this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}
-this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}
-delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
-valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Dom.hasClass(node,this.invalidHandleClasses[i]);}
-return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
-for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
-this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
-for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
-this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=iLeft;this.rightConstraint=iRight;this.minX=this.initPageX-iLeft;this.maxX=this.initPageX+iRight;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
-this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=iUp;this.bottomConstraint=iDown;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+iDown;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
-this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}
-if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}
-if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}
-return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};})();if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var Event=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}
+if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var Event=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}
 oDD[sMethod].apply(oDD,args);}}},_onLoad:function(){this.init();Event.on(document,"mouseup",this.handleMouseUp,this,true);Event.on(document,"mousemove",this.handleMouseMove,this,true);Event.on(window,"unload",this._onUnload,this,true);Event.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,sGroup){if(!this.initialized){this.init();}
 if(!this.ids[sGroup]){this.ids[sGroup]={};}
 this.ids[sGroup][oDD.id]=oDD;},removeDDFromGroup:function(oDD,sGroup){if(!this.ids[sGroup]){this.ids[sGroup]={};}
@@ -37,58 +15,85 @@ this.handleIds[sDDId][sHandleId]=sHandleId;},isDragDrop:function(id){return(this
 if(!bTargetsOnly||dd.isTarget){oDDs[oDDs.length]=dd;}}}
 return oDDs;},isLegalTarget:function(oDD,oTargetDD){var targets=this.getRelated(oDD,true);for(var i=0,len=targets.length;i<len;++i){if(targets[i].id==oTargetDD.id){return true;}}
 return false;},isTypeOfDD:function(oDD){return(oDD&&oDD.__ygDragDrop);},isHandle:function(sDDId,sHandleId){return(this.handleIds[sDDId]&&this.handleIds[sDDId][sHandleId]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}
-return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);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);}
+return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);var dc=this.dragCurrent;if(dc){dc.b4StartDrag(x,y);}
+if(dc){dc.startDrag(x,y);}
+this.dragThreshMet=true;},handleMouseUp:function(e){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}
+this.stopDrag(e);this.stopEvent(e);}},stopEvent:function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}
+if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e,silent){if(this.dragCurrent&&!silent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}
 this.dragCurrent.onMouseUp(e);}
-this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){if(!this.dragCurrent){return true;}
-if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}
+this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){var dc=this.dragCurrent;if(dc){if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}
 if(!this.dragThreshMet){var diffX=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var diffY=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(diffX>this.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}
-if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}
-this.stopEvent(e);return true;},fireEvents:function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}
-var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}
-if(!this.isOverTarget(pt,ddo,this.mode)){outEvts.push(ddo);}
+if(this.dragThreshMet){dc.b4Drag(e);if(dc){dc.onDrag(e);}
+if(dc){this.fireEvents(e,false);}}
+this.stopEvent(e);}},fireEvents:function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}
+var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}
+if(!this.isOverTarget(pt,ddo,this.mode,curRegion)){outEvts.push(ddo);}
 oldOvers[i]=true;delete this.dragOvers[i];}
 for(var sGroup in dc.groups){if("string"!=typeof sGroup){continue;}
 for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD)){continue;}
-if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);}
+if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode,curRegion)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);}
 this.dragOvers[oDD.id]=oDD;}}}}}
-if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);dc.onDragOut(e,outEvts);}
-if(enterEvts.length){dc.onDragEnter(e,enterEvts);}
-if(overEvts.length){dc.b4DragOver(e,overEvts);dc.onDragOver(e,overEvts);}
-if(dropEvts.length){dc.b4DragDrop(e,dropEvts);dc.onDragDrop(e,dropEvts);}}else{var len=0;for(i=0,len=outEvts.length;i<len;++i){dc.b4DragOut(e,outEvts[i].id);dc.onDragOut(e,outEvts[i].id);}
-for(i=0,len=enterEvts.length;i<len;++i){dc.onDragEnter(e,enterEvts[i].id);}
-for(i=0,len=overEvts.length;i<len;++i){dc.b4DragOver(e,overEvts[i].id);dc.onDragOver(e,overEvts[i].id);}
-for(i=0,len=dropEvts.length;i<len;++i){dc.b4DragDrop(e,dropEvts[i].id);dc.onDragDrop(e,dropEvts[i].id);}}
-if(isDrop&&!dropEvts.length){dc.onInvalidDrop(e);}},getBestMatch:function(dds){var winner=null;var len=dds.length;if(len==1){winner=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(this.mode==this.INTERSECT&&dd.cursorIsOver){winner=dd;break;}else{if(!winner||!winner.overlap||(dd.overlap&&winner.overlap.getArea()<dd.overlap.getArea())){winner=dd;}}}}
-return winner;},refreshCache:function(groups){for(var sGroup in groups){if("string"!=typeof sGroup){continue;}
+this.interactionInfo={out:outEvts,enter:enterEvts,over:overEvts,drop:dropEvts,point:pt,draggedRegion:curRegion,sourceRegion:this.locationCache[dc.id],validDrop:isDrop};if(isDrop&&!dropEvts.length){this.interactionInfo.validDrop=false;dc.onInvalidDrop(e);}
+if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);if(dc){dc.onDragOut(e,outEvts);}}
+if(enterEvts.length){if(dc){dc.onDragEnter(e,enterEvts);}}
+if(overEvts.length){if(dc){dc.b4DragOver(e,overEvts);}
+if(dc){dc.onDragOver(e,overEvts);}}
+if(dropEvts.length){if(dc){dc.b4DragDrop(e,dropEvts);}
+if(dc){dc.onDragDrop(e,dropEvts);}}}else{var len=0;for(i=0,len=outEvts.length;i<len;++i){if(dc){dc.b4DragOut(e,outEvts[i].id);}
+if(dc){dc.onDragOut(e,outEvts[i].id);}}
+for(i=0,len=enterEvts.length;i<len;++i){if(dc){dc.onDragEnter(e,enterEvts[i].id);}}
+for(i=0,len=overEvts.length;i<len;++i){if(dc){dc.b4DragOver(e,overEvts[i].id);}
+if(dc){dc.onDragOver(e,overEvts[i].id);}}
+for(i=0,len=dropEvts.length;i<len;++i){if(dc){dc.b4DragDrop(e,dropEvts[i].id);}
+if(dc){dc.onDragDrop(e,dropEvts[i].id);}}}},getBestMatch:function(dds){var winner=null;var len=dds.length;if(len==1){winner=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(this.mode==this.INTERSECT&&dd.cursorIsOver){winner=dd;break;}else{if(!winner||!winner.overlap||(dd.overlap&&winner.overlap.getArea()<dd.overlap.getArea())){winner=dd;}}}}
+return winner;},refreshCache:function(groups){var g=groups||this.ids;for(var sGroup in g){if("string"!=typeof sGroup){continue;}
 for(var i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var parent=el.offsetParent;if(parent){return true;}}}catch(e){}
 return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}
 var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=YAHOO.util.Dom.getXY(el);}catch(e){}
 if(!pos){return null;}
-x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect){var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}
+x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect,curRegion){var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}
 if(!loc){return false;}
-oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}
-oTarget.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}
+oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}
+oTarget.overlap=null;if(!curRegion){var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);}
+var overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}
 this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}
 this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var oWrapper=this.elementCache[id];if(!oWrapper||!oWrapper.el){oWrapper=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}
-return oWrapper;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else{YAHOO.log("could not get scroll property");}
+return oWrapper;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else{}
 return{top:t,left:l};},getStyle:function(el,styleProp){return YAHOO.util.Dom.getStyle(el,styleProp);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(moveEl,targetEl){var aCoord=YAHOO.util.Dom.getXY(targetEl);YAHOO.util.Dom.setXY(moveEl,aCoord);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return(a-b);},_timeoutCount:0,_addListeners:function(){var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}
 return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}
-YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");}
-this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}
-if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}
-if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
-if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}
+(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=Dom.get(this.id);}
+return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){this._domRef=id;id=Dom.generateId(id);}
+this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}
+var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}
+this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
+this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
+Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;}
+if(this.isLocked()){return;}
+this.b4MouseDown(e);this.onMouseDown(e);this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}
 if(x>this.maxX){x=this.maxX;}}
 if(this.constrainY){if(y<this.minY){y=this.minY;}
 if(y>this.maxY){y=this.maxY;}}
-x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},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,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this;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(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
+x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
+this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
+delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
+valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Dom.hasClass(node,this.invalidHandleClasses[i]);}
+return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
+for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
+this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
+for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
+this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=parseInt(iLeft,10);this.rightConstraint=parseInt(iRight,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
+this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=parseInt(iUp,10);this.bottomConstraint=parseInt(iDown,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
+this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}
+if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}
+if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}
+return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};})();YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");}
+this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}
+if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}
+if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
+if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this,body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}
+var div=this.getDragEl(),Dom=YAHOO.util.Dom;if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;s.height="25px";s.width="25px";var _data=document.createElement('div');Dom.setStyle(_data,'height','100%');Dom.setStyle(_data,'width','100%');Dom.setStyle(_data,'background-color','#ccc');Dom.setStyle(_data,'opacity','0');div.appendChild(_data);body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
 this.setDragElPos(iPageX,iPageY);YAHOO.util.Dom.setStyle(dragEl,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var dragEl=this.getDragEl();var bt=parseInt(DOM.getStyle(dragEl,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(dragEl,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(dragEl,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(dragEl,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}
 if(isNaN(br)){br=0;}
 if(isNaN(bb)){bb=0;}
 if(isNaN(bl)){bl=0;}
-var newWidth=Math.max(0,el.offsetWidth-br-bl);var newHeight=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");}},b4MouseDown:function(e){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,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});
\ No newline at end of file
+var newWidth=Math.max(0,el.offsetWidth-br-bl);var newHeight=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");}},b4MouseDown:function(e){this.setStartPosition();var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.3.0",build:"442"});
\ No newline at end of file
index 88ad3b7c95593c1e715a33e43ef4d3eef3dd8278..1cb2857fa2cb7e9b1c427785f2b26c1a9e6c0b77 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-(function() {
-
-var Event=YAHOO.util.Event; 
-var Dom=YAHOO.util.Dom;
-
 /**
- * Defines the interface and base operation of items that that can be 
- * dragged or can be drop targets.  It was designed to be extended, overriding
- * the event handlers for startDrag, onDrag, onDragOver, onDragOut.
- * Up to three html elements can be associated with a DragDrop instance:
- * <ul>
- * <li>linked element: the element that is passed into the constructor.
- * This is the element which defines the boundaries for interaction with 
- * other DragDrop objects.</li>
- * <li>handle element(s): The drag operation only occurs if the element that 
- * was clicked matches a handle element.  By default this is the linked 
- * element, but there are times that you will want only a portion of the 
- * linked element to initiate the drag operation, and the setHandleElId() 
- * method provides a way to define this.</li>
- * <li>drag element: this represents an the element that would be moved along
- * with the cursor during a drag operation.  By default, this is the linked
- * element itself as in {@link YAHOO.util.DD}.  setDragElId() lets you define
- * a separate element that would be moved, as in {@link YAHOO.util.DDProxy}
- * </li>
- * </ul>
- * This class should not be instantiated until the onload event to ensure that
- * the associated elements are available.
- * The following would define a DragDrop obj that would interact with any 
- * other DragDrop obj in the "group1" group:
- * <pre>
- *  dd = new YAHOO.util.DragDrop("div1", "group1");
- * </pre>
- * Since none of the event handlers have been implemented, nothing would 
- * actually happen if you were to run the code above.  Normally you would 
- * override this class or one of the default implementations, but you can 
- * also override the methods you want on an instance of the class...
- * <pre>
- *  dd.onDragDrop = function(e, id) {
- *  &nbsp;&nbsp;alert("dd was dropped on " + id);
- *  }
- * </pre>
+ * The drag and drop utility provides a framework for building drag and drop
+ * applications.  In addition to enabling drag and drop for specific elements,
+ * the drag and drop elements are tracked by the manager class, and the
+ * interactions between the various elements are tracked during the drag and
+ * the implementing code is notified about these important moments.
+ * @module dragdrop
+ * @title Drag and Drop
+ * @requires yahoo,dom,event
  * @namespace YAHOO.util
- * @class DragDrop
- * @constructor
- * @param {String} id of the element that is linked to this instance
- * @param {String} sGroup the group of related DragDrop objects
- * @param {object} config an object containing configurable attributes
- *                Valid properties for DragDrop: 
- *                    padding, isTarget, maintainOffset, primaryButtonOnly,
  */
-YAHOO.util.DragDrop = function(id, sGroup, config) {
-    if (id) {
-        this.init(id, sGroup, config); 
-    }
-};
 
-YAHOO.util.DragDrop.prototype = {
+// Only load the library once.  Rewriting the manager class would orphan 
+// existing drag and drop instances.
+if (!YAHOO.util.DragDropMgr) {
 
-    /**
-     * The id of the element associated with this object.  This is what we 
-     * refer to as the "linked element" because the size and position of 
-     * this element is used to determine when the drag and drop objects have 
    * interacted.
-     * @property id
-     * @type String
    */
-    id: null,
+/**
+ * DragDropMgr is a singleton that tracks the element interaction for 
+ * all DragDrop items in the window.  Generally, you will not call 
+ * this class directly, but it does have helper methods that could 
* be useful in your DragDrop implementations.
+ * @class DragDropMgr
+ * @static
+ */
+YAHOO.util.DragDropMgr = function() {
 
-    /**
-     * Configuration attributes passed into the constructor
-     * @property config
-     * @type object
-     */
-    config: null,
+    var Event = YAHOO.util.Event;
 
-    /**
-     * The id of the element that will be dragged.  By default this is same 
-     * as the linked element , but could be changed to another element. Ex: 
-     * YAHOO.util.DDProxy
-     * @property dragElId
-     * @type String
-     * @private
-     */
-    dragElId: null, 
+    return {
 
-    /**
-     * the id of the element that initiates the drag operation.  By defaul
-     * this is the linked element, but could be changed to be a child of this
-     * element.  This lets us do things like only starting the drag when the 
-     * header element within the linked html element is clicked.
-     * @property handleElId
-     * @type String
-     * @private
-     */
-    handleElId: null, 
+        /**
+         * Two dimensional Array of registered DragDrop objects.  The firs
+         * dimension is the DragDrop item group, the second the DragDrop 
+         * object.
+         * @property ids
+         * @type {string: string}
+         * @private
+         * @static
+         */
+        ids: {},
 
-    /**
-     * An associative array of HTML tags that will be ignored if clicked.
-     * @property invalidHandleTypes
-     * @type {string: string}
-     */
-    invalidHandleTypes: null, 
+        /**
+         * Array of element ids defined as drag handles.  Used to determine 
+         * if the element that generated the mousedown event is actually the 
+         * handle and not the html element itself.
+         * @property handleIds
+         * @type {string: string}
+         * @private
+         * @static
+         */
+        handleIds: {},
 
-    /**
-     * An associative array of ids for elements that will be ignored if clicked
-     * @property invalidHandleIds
-     * @type {string: string}
-     */
-    invalidHandleIds: null, 
+        /**
+         * the DragDrop object that is currently being dragged
+         * @property dragCurrent
+         * @type DragDrop
+         * @private
+         * @static
+         **/
+        dragCurrent: null,
 
-    /**
-     * An indexted array of css class names for elements that will be ignored
-     * if clicked.
-     * @property invalidHandleClasses
-     * @type string[]
-     */
-    invalidHandleClasses: null, 
+        /**
+         * the DragDrop object(s) that are being hovered over
+         * @property dragOvers
+         * @type Array
+         * @private
+         * @static
+         */
+        dragOvers: {},
 
-    /**
-     * The linked element's absolute X position at the time the drag was 
-     * started
-     * @property startPageX
-     * @type int
-     * @private
-     */
-    startPageX: 0,
+        /**
+         * the X distance between the cursor and the object being dragged
+         * @property deltaX
+         * @type int
+         * @private
+         * @static
+         */
+        deltaX: 0,
 
-    /**
-     * The linked element's absolute X position at the time the drag was 
-     * started
-     * @property startPageY
-     * @type int
-     * @private
-     */
-    startPageY: 0,
+        /**
+         * the Y distance between the cursor and the object being dragged
+         * @property deltaY
+         * @type int
+         * @private
+         * @static
+         */
+        deltaY: 0,
 
-    /**
-     * The group defines a logical collection of DragDrop objects that are 
-     * related.  Instances only get events when interacting with other 
-     * DragDrop object in the same group.  This lets us define multiple 
-     * groups using a single DragDrop subclass if we want.
-     * @property groups
-     * @type {string: string}
-     */
-    groups: null,
+        /**
+         * Flag to determine if we should prevent the default behavior of the
+         * events we define. By default this is true, but this can be set to 
+         * false if you need the default behavior (not recommended)
+         * @property preventDefault
+         * @type boolean
+         * @static
+         */
+        preventDefault: true,
 
-    /**
-     * Individual drag/drop instances can be locked.  This will prevent 
-     * onmousedown start drag.
-     * @property locked
-     * @type boolean
-     * @private
-     */
-    locked: false,
+        /**
+         * Flag to determine if we should stop the propagation of the events 
+         * we generate. This is true by default but you may want to set it to
+         * false if the html element contains other features that require the
+         * mouse click.
+         * @property stopPropagation
+         * @type boolean
+         * @static
+         */
+        stopPropagation: true,
 
-    /**
-     * Lock this instance
-     * @method lock
-     */
-    lock: function() { this.locked = true; },
+        /**
+         * Internal flag that is set to true when drag and drop has been
+         * initialized
+         * @property initialized
+         * @private
+         * @static
+         */
+        initialized: false,
 
-    /**
-     * Unlock this instace
-     * @method unlock
-     */
-    unlock: function() { this.locked = false; },
+        /**
+         * All drag and drop can be disabled.
+         * @property locked
+         * @private
+         * @static
+         */
+        locked: false,
 
-    /**
-     * By default, all insances can be a drop target.  This can be disabled by
-     * setting isTarget to false.
-     * @method isTarget
-     * @type boolean
-     */
-    isTarget: true,
+        /**
+         * Provides additional information about the the current set of
+         * interactions.  Can be accessed from the event handlers. It
+         * contains the following properties:
+         *
+         *       out:       onDragOut interactions
+         *       enter:     onDragEnter interactions
+         *       over:      onDragOver interactions
+         *       drop:      onDragDrop interactions
+         *       point:     The location of the cursor
+         *       draggedRegion: The location of dragged element at the time
+         *                      of the interaction
+         *       sourceRegion: The location of the source elemtn at the time
+         *                     of the interaction
+         *       validDrop: boolean
+         * @property interactionInfo
+         * @type object
+         * @static
+         */
+        interactionInfo: null,
 
-    /**
-     * The padding configured for this drag and drop object for calculating
-     * the drop zone intersection with this object.
-     * @method padding
-     * @type int[]
-     */
-    padding: null,
+        /**
+         * Called the first time an element is registered.
+         * @method init
+         * @private
+         * @static
+         */
+        init: function() {
+            this.initialized = true;
+        },
 
-    /**
-     * Cached reference to the linked element
-     * @property _domRef
-     * @private
-     */
-    _domRef: null,
+        /**
+         * In point mode, drag and drop interaction is defined by the 
+         * location of the cursor during the drag/drop
+         * @property POINT
+         * @type int
+         * @static
+         * @final
+         */
+        POINT: 0,
 
-    /**
-     * Internal typeof flag
-     * @property __ygDragDrop
-     * @private
-     */
-    __ygDragDrop: true,
+        /**
+         * In intersect mode, drag and drop interaction is defined by the 
+         * cursor position or the amount of overlap of two or more drag and 
+         * drop objects.
+         * @property INTERSECT
+         * @type int
+         * @static
+         * @final
+         */
+        INTERSECT: 1,
 
-    /**
-     * Set to true when horizontal contraints are applied
-     * @property constrainX
-     * @type boolean
-     * @private
-     */
-    constrainX: false,
+        /**
+         * In intersect mode, drag and drop interaction is defined only by the 
+         * overlap of two or more drag and drop objects.
+         * @property STRICT_INTERSECT
+         * @type int
+         * @static
+         * @final
+         */
+        STRICT_INTERSECT: 2,
 
-    /**
-     * Set to true when vertical contraints are applied
-     * @property constrainY
-     * @type boolean
-     * @private
-     */
-    constrainY: false,
+        /**
+         * The current drag and drop mode.  Default: POINT
+         * @property mode
+         * @type int
+         * @static
+         */
+        mode: 0,
 
-    /**
-     * The left constraint
-     * @property minX
-     * @type int
-     * @private
-     */
-    minX: 0,
+        /**
+         * Runs method on all drag and drop objects
+         * @method _execOnAll
+         * @private
+         * @static
+         */
+        _execOnAll: function(sMethod, args) {
+            for (var i in this.ids) {
+                for (var j in this.ids[i]) {
+                    var oDD = this.ids[i][j];
+                    if (! this.isTypeOfDD(oDD)) {
+                        continue;
+                    }
+                    oDD[sMethod].apply(oDD, args);
+                }
+            }
+        },
 
-    /**
-     * The right constraint
-     * @property maxX
-     * @type int
-     * @private
-     */
-    maxX: 0,
+        /**
+         * Drag and drop initialization.  Sets up the global event handlers
+         * @method _onLoad
+         * @private
+         * @static
+         */
+        _onLoad: function() {
 
-    /**
-     * The up constraint 
-     * @property minY
-     * @type int
-     * @type int
-     * @private
-     */
-    minY: 0,
+            this.init();
 
-    /**
-     * The down constraint 
-     * @property maxY
-     * @type int
-     * @private
-     */
-    maxY: 0,
 
-    /**
-     * Maintain offsets when we resetconstraints.  Set to true when you want
-     * the position of the element relative to its parent to stay the same
-     * when the page changes
-     *
-     * @property maintainOffset
-     * @type boolean
-     */
-    maintainOffset: false,
+            Event.on(document, "mouseup",   this.handleMouseUp, this, true);
+            Event.on(document, "mousemove", this.handleMouseMove, this, true);
+            Event.on(window,   "unload",    this._onUnload, this, true);
+            Event.on(window,   "resize",    this._onResize, this, true);
+            // Event.on(window,   "mouseout",    this._test);
 
-    /**
-     * Array of pixel locations the element will snap to if we specified a 
-     * horizontal graduation/interval.  This array is generated automatically
-     * when you define a tick interval.
-     * @property xTicks
-     * @type int[]
-     */
-    xTicks: null,
+        },
 
-    /**
-     * Array of pixel locations the element will snap to if we specified a 
-     * vertical graduation/interval.  This array is generated automatically 
-     * when you define a tick interval.
-     * @property yTicks
-     * @type int[]
-     */
-    yTicks: null,
+        /**
+         * Reset constraints on all drag and drop objs
+         * @method _onResize
+         * @private
+         * @static
+         */
+        _onResize: function(e) {
+            this._execOnAll("resetConstraints", []);
+        },
 
-    /**
-     * By default the drag and drop instance will only respond to the primary
-     * button click (left button for a right-handed mouse).  Set to true to
-     * allow drag and drop to start with any mouse click that is propogated
-     * by the browser
-     * @property primaryButtonOnly
-     * @type boolean
-     */
-    primaryButtonOnly: true,
+        /**
+         * Lock all drag and drop functionality
+         * @method lock
+         * @static
+         */
+        lock: function() { this.locked = true; },
 
-    /**
-     * The availabe property is false until the linked dom element is accessible.
-     * @property available
-     * @type boolean
-     */
-    available: false,
+        /**
+         * Unlock all drag and drop functionality
+         * @method unlock
+         * @static
+         */
+        unlock: function() { this.locked = false; },
 
-    /**
-     * By default, drags can only be initiated if the mousedown occurs in the
-     * region the linked element is.  This is done in part to work around a
-     * bug in some browsers that mis-report the mousedown if the previous
-     * mouseup happened outside of the window.  This property is set to true
-     * if outer handles are defined.
-     *
-     * @property hasOuterHandles
-     * @type boolean
-     * @default false
-     */
-    hasOuterHandles: false,
+        /**
+         * Is drag and drop locked?
+         * @method isLocked
+         * @return {boolean} True if drag and drop is locked, false otherwise.
+         * @static
+         */
+        isLocked: function() { return this.locked; },
 
-    /**
-     * Code that executes immediately before the startDrag event
-     * @method b4StartDrag
-     * @private
-     */
-    b4StartDrag: function(x, y) { },
+        /**
+         * Location cache that is set for all drag drop objects when a drag is
+         * initiated, cleared when the drag is finished.
+         * @property locationCache
+         * @private
+         * @static
+         */
+        locationCache: {},
 
-    /**
-     * Abstract method called after a drag/drop object is clicked
-     * and the drag or mousedown time thresholds have beeen met.
-     * @method startDrag
-     * @param {int} X click location
-     * @param {int} Y click location
-     */
-    startDrag: function(x, y) { /* override this */ },
+        /**
+         * Set useCache to false if you want to force object the lookup of each
+         * drag and drop linked element constantly during a drag.
+         * @property useCache
+         * @type boolean
+         * @static
+         */
+        useCache: true,
 
-    /**
-     * Code that executes immediately before the onDrag event
-     * @method b4Drag
-     * @private
-     */
-    b4Drag: function(e) { },
+        /**
+         * The number of pixels that the mouse needs to move after the 
+         * mousedown before the drag is initiated.  Default=3;
+         * @property clickPixelThresh
+         * @type int
+         * @static
+         */
+        clickPixelThresh: 3,
 
-    /**
-     * Abstract method called during the onMouseMove event while dragging an 
-     * object.
-     * @method onDrag
-     * @param {Event} e the mousemove event
-     */
-    onDrag: function(e) { /* override this */ },
+        /**
+         * The number of milliseconds after the mousedown event to initiate the
+         * drag if we don't get a mouseup event. Default=1000
+         * @property clickTimeThresh
+         * @type int
+         * @static
+         */
+        clickTimeThresh: 1000,
 
-    /**
-     * Abstract method called when this element fist begins hovering over 
-     * another DragDrop obj
-     * @method onDragEnter
-     * @param {Event} e the mousemove event
-     * @param {String|DragDrop[]} id In POINT mode, the element
-     * id this is hovering over.  In INTERSECT mode, an array of one or more 
-     * dragdrop items being hovered over.
-     */
-    onDragEnter: function(e, id) { /* override this */ },
+        /**
+         * Flag that indicates that either the drag pixel threshold or the 
+         * mousdown time threshold has been met
+         * @property dragThreshMet
+         * @type boolean
+         * @private
+         * @static
+         */
+        dragThreshMet: false,
 
-    /**
-     * Code that executes immediately before the onDragOver event
-     * @method b4DragOver
-     * @private
-     */
-    b4DragOver: function(e) { },
+        /**
+         * Timeout used for the click time threshold
+         * @property clickTimeout
+         * @type Object
+         * @private
+         * @static
+         */
+        clickTimeout: null,
 
-    /**
-     * Abstract method called when this element is hovering over another 
-     * DragDrop obj
-     * @method onDragOver
-     * @param {Event} e the mousemove event
-     * @param {String|DragDrop[]} id In POINT mode, the element
-     * id this is hovering over.  In INTERSECT mode, an array of dd items 
-     * being hovered over.
-     */
-    onDragOver: function(e, id) { /* override this */ },
+        /**
+         * The X position of the mousedown event stored for later use when a 
+         * drag threshold is met.
+         * @property startX
+         * @type int
+         * @private
+         * @static
+         */
+        startX: 0,
 
-    /**
-     * Code that executes immediately before the onDragOut event
-     * @method b4DragOut
-     * @private
-     */
-    b4DragOut: function(e) { },
+        /**
+         * The Y position of the mousedown event stored for later use when a 
+         * drag threshold is met.
+         * @property startY
+         * @type int
+         * @private
+         * @static
+         */
+        startY: 0,
 
-    /**
-     * Abstract method called when we are no longer hovering over an element
-     * @method onDragOut
-     * @param {Event} e the mousemove event
-     * @param {String|DragDrop[]} id In POINT mode, the element
-     * id this was hovering over.  In INTERSECT mode, an array of dd items 
-     * that the mouse is no longer over.
-     */
-    onDragOut: function(e, id) { /* override this */ },
+        /**
+         * Each DragDrop instance must be registered with the DragDropMgr.  
+         * This is executed in DragDrop.init()
+         * @method regDragDrop
+         * @param {DragDrop} oDD the DragDrop object to register
+         * @param {String} sGroup the name of the group this element belongs to
+         * @static
+         */
+        regDragDrop: function(oDD, sGroup) {
+            if (!this.initialized) { this.init(); }
+            
+            if (!this.ids[sGroup]) {
+                this.ids[sGroup] = {};
+            }
+            this.ids[sGroup][oDD.id] = oDD;
+        },
 
-    /**
-     * Code that executes immediately before the onDragDrop event
-     * @method b4DragDrop
-     * @private
-     */
-    b4DragDrop: function(e) { },
+        /**
+         * Removes the supplied dd instance from the supplied group. Executed
+         * by DragDrop.removeFromGroup, so don't call this function directly.
+         * @method removeDDFromGroup
+         * @private
+         * @static
+         */
+        removeDDFromGroup: function(oDD, sGroup) {
+            if (!this.ids[sGroup]) {
+                this.ids[sGroup] = {};
+            }
 
-    /**
-     * Abstract method called when this item is dropped on another DragDrop 
-     * obj
-     * @method onDragDrop
-     * @param {Event} e the mouseup event
-     * @param {String|DragDrop[]} id In POINT mode, the element
-     * id this was dropped on.  In INTERSECT mode, an array of dd items this 
-     * was dropped on.
-     */
-    onDragDrop: function(e, id) { /* override this */ },
+            var obj = this.ids[sGroup];
+            if (obj && obj[oDD.id]) {
+                delete obj[oDD.id];
+            }
+        },
 
-    /**
-     * Abstract method called when this item is dropped on an area with no
-     * drop target
-     * @method onInvalidDrop
-     * @param {Event} e the mouseup event
-     */
-    onInvalidDrop: function(e) { /* override this */ },
+        /**
+         * Unregisters a drag and drop item.  This is executed in 
+         * DragDrop.unreg, use that method instead of calling this directly.
+         * @method _remove
+         * @private
+         * @static
+         */
+        _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];
+        },
 
-    /**
-     * Code that executes immediately before the endDrag event
-     * @method b4EndDrag
-     * @private
-     */
-    b4EndDrag: function(e) { },
+        /**
+         * Each DragDrop handle element must be registered.  This is done
+         * automatically when executing DragDrop.setHandleElId()
+         * @method regHandle
+         * @param {String} sDDId the DragDrop id this element is a handle for
+         * @param {String} sHandleId the id of the element that is the drag 
+         * handle
+         * @static
+         */
+        regHandle: function(sDDId, sHandleId) {
+            if (!this.handleIds[sDDId]) {
+                this.handleIds[sDDId] = {};
+            }
+            this.handleIds[sDDId][sHandleId] = sHandleId;
+        },
 
-    /**
-     * Fired when we are done dragging the object
-     * @method endDrag
-     * @param {Event} e the mouseup event
-     */
-    endDrag: function(e) { /* override this */ },
+        /**
+         * Utility function to determine if a given element has been 
+         * registered as a drag drop item.
+         * @method isDragDrop
+         * @param {String} id the element id to check
+         * @return {boolean} true if this element is a DragDrop item, 
+         * false otherwise
+         * @static
+         */
+        isDragDrop: function(id) {
+            return ( this.getDDById(id) ) ? true : false;
+        },
 
-    /**
-     * Code executed immediately before the onMouseDown event
-     * @method b4MouseDown
-     * @param {Event} e the mousedown event
-     * @private
-     */
-    b4MouseDown: function(e) {  },
+        /**
+         * Returns the drag and drop instances that are in all groups the
+         * passed in instance belongs to.
+         * @method getRelated
+         * @param {DragDrop} p_oDD the obj to get related data for
+         * @param {boolean} bTargetsOnly if true, only return targetable objs
+         * @return {DragDrop[]} the related instances
+         * @static
+         */
+        getRelated: function(p_oDD, bTargetsOnly) {
+            var oDDs = [];
+            for (var i in p_oDD.groups) {
+                for (j in this.ids[i]) {
+                    var dd = this.ids[i][j];
+                    if (! this.isTypeOfDD(dd)) {
+                        continue;
+                    }
+                    if (!bTargetsOnly || dd.isTarget) {
+                        oDDs[oDDs.length] = dd;
+                    }
+                }
+            }
 
-    /**
-     * Event handler that fires when a drag/drop obj gets a mousedown
-     * @method onMouseDown
-     * @param {Event} e the mousedown event
-     */
-    onMouseDown: function(e) { /* override this */ },
+            return oDDs;
+        },
 
-    /**
-     * Event handler that fires when a drag/drop obj gets a mouseup
-     * @method onMouseUp
-     * @param {Event} e the mouseup event
-     */
-    onMouseUp: function(e) { /* override this */ },
-   
-    /**
-     * Override the onAvailable method to do what is needed after the initial
-     * position was determined.
-     * @method onAvailable
-     */
-    onAvailable: function () { 
-    },
+        /**
+         * Returns true if the specified dd target is a legal target for 
+         * the specifice drag obj
+         * @method isLegalTarget
+         * @param {DragDrop} the drag obj
+         * @param {DragDrop} the target
+         * @return {boolean} true if the target is a legal target for the 
+         * dd obj
+         * @static
+         */
+        isLegalTarget: function (oDD, oTargetDD) {
+            var targets = this.getRelated(oDD, true);
+            for (var i=0, len=targets.length;i<len;++i) {
+                if (targets[i].id == oTargetDD.id) {
+                    return true;
+                }
+            }
 
-    /**
-     * Returns a reference to the linked element
-     * @method getEl
-     * @return {HTMLElement} the html element 
-     */
-    getEl: function() { 
-        if (!this._domRef) {
-            this._domRef = Dom.get(this.id); 
-        }
+            return false;
+        },
 
-        return this._domRef;
-    },
+        /**
+         * My goal is to be able to transparently determine if an object is
+         * typeof DragDrop, and the exact subclass of DragDrop.  typeof 
+         * returns "object", oDD.constructor.toString() always returns
+         * "DragDrop" and not the name of the subclass.  So for now it just
+         * evaluates a well-known variable in DragDrop.
+         * @method isTypeOfDD
+         * @param {Object} the object to evaluate
+         * @return {boolean} true if typeof oDD = DragDrop
+         * @static
+         */
+        isTypeOfDD: function (oDD) {
+            return (oDD && oDD.__ygDragDrop);
+        },
 
-    /**
-     * Returns a reference to the actual element to drag.  By default this is
-     * the same as the html element, but it can be assigned to another 
-     * element. An example of this can be found in YAHOO.util.DDProxy
-     * @method getDragEl
-     * @return {HTMLElement} the html element 
-     */
-    getDragEl: function() {
-        return Dom.get(this.dragElId);
-    },
+        /**
+         * Utility function to determine if a given element has been 
+         * registered as a drag drop handle for the given Drag Drop object.
+         * @method isHandle
+         * @param {String} id the element id to check
+         * @return {boolean} true if this element is a DragDrop handle, false 
+         * otherwise
+         * @static
+         */
+        isHandle: function(sDDId, sHandleId) {
+            return ( this.handleIds[sDDId] && 
+                            this.handleIds[sDDId][sHandleId] );
+        },
 
-    /**
-     * Sets up the DragDrop object.  Must be called in the constructor of any
-     * YAHOO.util.DragDrop subclass
-     * @method init
-     * @param id the id of the linked element
-     * @param {String} sGroup the group of related items
-     * @param {object} config configuration attributes
-     */
-    init: function(id, sGroup, config) {
-        this.initTarget(id, sGroup, config);
-        Event.on(this.id, "mousedown", this.handleMouseDown, this, true);
-        // Event.on(this.id, "selectstart", Event.preventDefault);
-    },
+        /**
+         * Returns the DragDrop instance for a given id
+         * @method getDDById
+         * @param {String} id the id of the DragDrop object
+         * @return {DragDrop} the drag drop object, null if it is not found
+         * @static
+         */
+        getDDById: function(id) {
+            for (var i in this.ids) {
+                if (this.ids[i][id]) {
+                    return this.ids[i][id];
+                }
+            }
+            return null;
+        },
 
-    /**
-     * Initializes Targeting functionality only... the object does not
-     * get a mousedown handler.
-     * @method initTarget
-     * @param id the id of the linked element
-     * @param {String} sGroup the group of related items
-     * @param {object} config configuration attributes
-     */
-    initTarget: function(id, sGroup, config) {
+        /**
+         * Fired after a registered DragDrop object gets the mousedown event.
+         * Sets up the events required to track the object being dragged
+         * @method handleMouseDown
+         * @param {Event} e the event
+         * @param oDD the DragDrop object being dragged
+         * @private
+         * @static
+         */
+        handleMouseDown: function(e, oDD) {
 
-        // configuration attributes 
-        this.config = config || {};
+            this.currentTarget = YAHOO.util.Event.getTarget(e);
 
-        // create a local reference to the drag and drop manager
-        this.DDM = YAHOO.util.DDM;
-        // initialize the groups array
-        this.groups = {};
+            this.dragCurrent = oDD;
 
-        // assume that we have an element reference instead of an id if the
-        // parameter is not a string
-        if (typeof id !== "string") {
-            YAHOO.log("id is not a string, assuming it is an HTMLElement");
-            id = Dom.generateId(id);
-        }
+            var el = oDD.getEl();
 
-        // set the id
-        this.id = id;
+            // track start position
+            this.startX = YAHOO.util.Event.getPageX(e);
+            this.startY = YAHOO.util.Event.getPageY(e);
 
-        // add to an interaction group
-        this.addToGroup((sGroup) ? sGroup : "default");
+            this.deltaX = this.startX - el.offsetLeft;
+            this.deltaY = this.startY - el.offsetTop;
 
-        // We don't want to register this as the handle with the manager
-        // so we just set the id rather than calling the setter.
-        this.handleElId = id;
+            this.dragThreshMet = false;
 
-        Event.onAvailable(id, this.handleOnAvailable, this, true);
+            this.clickTimeout = setTimeout( 
+                    function() { 
+                        var DDM = YAHOO.util.DDM;
+                        DDM.startDrag(DDM.startX, DDM.startY); 
+                    }, 
+                    this.clickTimeThresh );
+        },
 
+        /**
+         * Fired when either the drag pixel threshol or the mousedown hold 
+         * time threshold has been met.
+         * @method startDrag
+         * @param x {int} the X position of the original mousedown
+         * @param y {int} the Y position of the original mousedown
+         * @static
+         */
+        startDrag: function(x, y) {
+            clearTimeout(this.clickTimeout);
+            var dc = this.dragCurrent;
+            if (dc) {
+                dc.b4StartDrag(x, y);
+            }
+            if (dc) {
+                dc.startDrag(x, y);
+            }
+            this.dragThreshMet = true;
+        },
 
-        // the linked element is the element that gets dragged by default
-        this.setDragElId(id); 
+        /**
+         * Internal function to handle the mouseup event.  Will be invoked 
+         * from the context of the document.
+         * @method handleMouseUp
+         * @param {Event} e the event
+         * @private
+         * @static
+         */
+        handleMouseUp: function(e) {
+            if (this.dragCurrent) {
+                clearTimeout(this.clickTimeout);
 
-        // by default, clicked anchors will not start drag operations. 
-        // @TODO what else should be here?  Probably form fields.
-        this.invalidHandleTypes = { A: "A" };
-        this.invalidHandleIds = {};
-        this.invalidHandleClasses = [];
+                if (this.dragThreshMet) {
+                    this.fireEvents(e, true);
+                } else {
+                }
 
-        this.applyConfig();
-    },
+                this.stopDrag(e);
 
-    /**
-     * Applies the configuration parameters that were passed into the constructor.
-     * This is supposed to happen at each level through the inheritance chain.  So
-     * a DDProxy implentation will execute apply config on DDProxy, DD, and 
-     * DragDrop in order to get all of the parameters that are available in
-     * each object.
-     * @method applyConfig
-     */
-    applyConfig: function() {
+                this.stopEvent(e);
+            }
+        },
 
-        // configurable properties: 
-        //    padding, isTarget, maintainOffset, primaryButtonOnly
-        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);
+        /**
+         * Utility to stop event propagation and event default, if these 
+         * features are turned on.
+         * @method stopEvent
+         * @param {Event} e the event as returned by this.getEvent()
+         * @static
+         */
+        stopEvent: function(e) {
+            if (this.stopPropagation) {
+                YAHOO.util.Event.stopPropagation(e);
+            }
 
-    },
+            if (this.preventDefault) {
+                YAHOO.util.Event.preventDefault(e);
+            }
+        },
 
-    /**
-     * Executed when the linked element is available
-     * @method handleOnAvailable
-     * @private
-     */
-    handleOnAvailable: function() {
-        this.available = true;
-        this.resetConstraints();
-        this.onAvailable();
-    },
+        /** 
+         * Ends the current drag, cleans up the state, and fires the endDrag
+         * and mouseUp events.  Called internally when a mouseup is detected
+         * during the drag.  Can be fired manually during the drag by passing
+         * either another event (such as the mousemove event received in onDrag)
+         * or a fake event with pageX and pageY defined (so that endDrag and
+         * onMouseUp have usable position data.).  Alternatively, pass true
+         * for the silent parameter so that the endDrag and onMouseUp events
+         * are skipped (so no event data is needed.)
+         *
+         * @method stopDrag
+         * @param {Event} e the mouseup event, another event (or a fake event) 
+         *                  with pageX and pageY defined, or nothing if the 
+         *                  silent parameter is true
+         * @param {boolean} silent skips the enddrag and mouseup events if true
+         * @static
+         */
+        stopDrag: function(e, silent) {
 
-     /**
-     * Configures the padding for the target zone in px.  Effectively expands
-     * (or reduces) the virtual object size for targeting calculations.  
-     * Supports css-style shorthand; if only one parameter is passed, all sides
-     * will have that padding, and if only two are passed, the top and bottom
-     * will have the first param, the left and right the second.
-     * @method setPadding
-     * @param {int} iTop    Top pad
-     * @param {int} iRight  Right pad
-     * @param {int} iBot    Bot pad
-     * @param {int} iLeft   Left pad
-     */
-    setPadding: function(iTop, iRight, iBot, iLeft) {
-        // this.padding = [iLeft, iRight, iTop, iBot];
-        if (!iRight && 0 !== iRight) {
-            this.padding = [iTop, iTop, iTop, iTop];
-        } else if (!iBot && 0 !== iBot) {
-            this.padding = [iTop, iRight, iTop, iRight];
-        } else {
-            this.padding = [iTop, iRight, iBot, iLeft];
-        }
-    },
+            // Fire the drag end event for the item that was dragged
+            if (this.dragCurrent && !silent) {
+                if (this.dragThreshMet) {
+                    this.dragCurrent.b4EndDrag(e);
+                    this.dragCurrent.endDrag(e);
+                }
 
-    /**
-     * Stores the initial placement of the linked element.
-     * @method setInitialPosition
-     * @param {int} diffX   the X offset, default 0
-     * @param {int} diffY   the Y offset, default 0
-     */
-    setInitPosition: function(diffX, diffY) {
-        var el = this.getEl();
+                this.dragCurrent.onMouseUp(e);
+            }
 
-        if (!this.DDM.verifyEl(el)) {
-            return;
-        }
+            this.dragCurrent = null;
+            this.dragOvers = {};
+        },
 
-        var dx = diffX || 0;
-        var dy = diffY || 0;
+        /** 
+         * Internal function to handle the mousemove event.  Will be invoked 
+         * from the context of the html element.
+         *
+         * @TODO figure out what we can do about mouse events lost when the 
+         * user drags objects beyond the window boundary.  Currently we can 
+         * detect this in internet explorer by verifying that the mouse is 
+         * down during the mousemove event.  Firefox doesn't give us the 
+         * button state on the mousemove event.
+         * @method handleMouseMove
+         * @param {Event} e the event
+         * @private
+         * @static
+         */
+        handleMouseMove: function(e) {
+            
+            var dc = this.dragCurrent;
+            if (dc) {
 
-        var p = Dom.getXY( el );
+                // var button = e.which || e.button;
 
-        this.initPageX = p[0] - dx;
-        this.initPageY = p[1] - dy;
+                // check for IE mouseup outside of page boundary
+                if (YAHOO.util.Event.isIE && !e.button) {
+                    this.stopEvent(e);
+                    return this.handleMouseUp(e);
+                }
 
-        this.lastPageX = p[0];
-        this.lastPageY = p[1];
+                if (!this.dragThreshMet) {
+                    var diffX = Math.abs(this.startX - YAHOO.util.Event.getPageX(e));
+                    var diffY = Math.abs(this.startY - YAHOO.util.Event.getPageY(e));
+                    if (diffX > this.clickPixelThresh || 
+                                diffY > this.clickPixelThresh) {
+                        this.startDrag(this.startX, this.startY);
+                    }
+                }
 
+                if (this.dragThreshMet) {
+                    dc.b4Drag(e);
+                    if (dc) {
+                        dc.onDrag(e);
+                    }
+                    if (dc) {
+                        this.fireEvents(e, false);
+                    }
+                }
 
-        this.setStartPosition(p);
-    },
+                this.stopEvent(e);
+            }
+        },
 
-    /**
-     * Sets the start position of the element.  This is set when the obj
-     * is initialized, the reset when a drag is started.
-     * @method setStartPosition
-     * @param pos current position (from previous lookup)
-     * @private
-     */
-    setStartPosition: function(pos) {
-        var p = pos || Dom.getXY( this.getEl() );
+        /**
+         * Iterates over all of the DragDrop elements to find ones we are 
+         * hovering over or dropping on
+         * @method fireEvents
+         * @param {Event} e the event
+         * @param {boolean} isDrop is this a drop op or a mouseover op?
+         * @private
+         * @static
+         */
+        fireEvents: function(e, isDrop) {
+            var dc = this.dragCurrent;
 
-        this.deltaSetXY = null;
+            // If the user did the mouse up outside of the window, we could 
+            // get here even though we have ended the drag.
+            if (!dc || dc.isLocked()) {
+                return;
+            }
 
-        this.startPageX = p[0];
-        this.startPageY = p[1];
-    },
+            var x = YAHOO.util.Event.getPageX(e);
+            var y = YAHOO.util.Event.getPageY(e);
+            var pt = new YAHOO.util.Point(x,y);
+            var pos = dc.getTargetCoord(pt.x, pt.y);
+            var el = dc.getDragEl();
+            curRegion = new YAHOO.util.Region( pos.y, 
+                                               pos.x + el.offsetWidth,
+                                               pos.y + el.offsetHeight, 
+                                               pos.x );
+            // cache the previous dragOver array
+            var oldOvers = [];
 
-    /**
-     * Add this instance to a group of related drag/drop objects.  All 
-     * instances belong to at least one group, and can belong to as many 
-     * groups as needed.
-     * @method addToGroup
-     * @param sGroup {string} the name of the group
-     */
-    addToGroup: function(sGroup) {
-        this.groups[sGroup] = true;
-        this.DDM.regDragDrop(this, sGroup);
-    },
+            var outEvts   = [];
+            var overEvts  = [];
+            var dropEvts  = [];
+            var enterEvts = [];
 
-    /**
-     * Remove's this instance from the supplied interaction group
-     * @method removeFromGroup
-     * @param {string}  sGroup  The group to drop
-     */
-    removeFromGroup: function(sGroup) {
-        if (this.groups[sGroup]) {
-            delete this.groups[sGroup];
-        }
 
-        this.DDM.removeDDFromGroup(this, sGroup);
-    },
+            // Check to see if the object(s) we were hovering over is no longer 
+            // being hovered over so we can fire the onDragOut event
+            for (var i in this.dragOvers) {
 
-    /**
-     * Allows you to specify that an element other than the linked element 
-     * will be moved with the cursor during a drag
-     * @method setDragElId
-     * @param id {string} the id of the element that will be used to initiate the drag
-     */
-    setDragElId: function(id) {
-        this.dragElId = id;
-    },
+                var ddo = this.dragOvers[i];
 
-    /**
-     * Allows you to specify a child of the linked element that should be 
-     * used to initiate the drag operation.  An example of this would be if 
-     * you have a content div with text and links.  Clicking anywhere in the 
-     * content area would normally start the drag operation.  Use this method
-     * to specify that an element inside of the content div is the element 
-     * that starts the drag operation.
-     * @method setHandleElId
-     * @param id {string} the id of the element that will be used to 
-     * initiate the drag.
-     */
-    setHandleElId: function(id) {
-        if (typeof id !== "string") {
-            YAHOO.log("id is not a string, assuming it is an HTMLElement");
-            id = Dom.generateId(id);
-        }
-        this.handleElId = id;
-        this.DDM.regHandle(this.id, id);
-    },
+                if (! this.isTypeOfDD(ddo)) {
+                    continue;
+                }
 
-    /**
-     * Allows you to set an element outside of the linked element as a drag 
-     * handle
-     * @method setOuterHandleElId
-     * @param id the id of the element that will be used to initiate the drag
-     */
-    setOuterHandleElId: function(id) {
-        if (typeof id !== "string") {
-            YAHOO.log("id is not a string, assuming it is an HTMLElement");
-            id = Dom.generateId(id);
-        }
-        Event.on(id, "mousedown", 
-                this.handleMouseDown, this, true);
-        this.setHandleElId(id);
+                if (! this.isOverTarget(pt, ddo, this.mode, curRegion)) {
+                    outEvts.push( ddo );
+                }
 
-        this.hasOuterHandles = true;
-    },
+                oldOvers[i] = true;
+                delete this.dragOvers[i];
+            }
 
-    /**
-     * Remove all drag and drop hooks for this element
-     * @method unreg
-     */
-    unreg: function() {
-        Event.removeListener(this.id, "mousedown", 
-                this.handleMouseDown);
-        this._domRef = null;
-        this.DDM._remove(this);
-    },
+            for (var sGroup in dc.groups) {
+                
+                if ("string" != typeof sGroup) {
+                    continue;
+                }
 
-    /**
-     * Returns true if this instance is locked, or the drag drop mgr is locked
-     * (meaning that all drag/drop is disabled on the page.)
-     * @method isLocked
-     * @return {boolean} true if this obj or all drag/drop is locked, else 
-     * false
-     */
-    isLocked: function() {
-        return (this.DDM.isLocked() || this.locked);
-    },
+                for (i in this.ids[sGroup]) {
+                    var oDD = this.ids[sGroup][i];
+                    if (! this.isTypeOfDD(oDD)) {
+                        continue;
+                    }
 
-    /**
-     * Fired when this object is clicked
-     * @method handleMouseDown
-     * @param {Event} e 
-     * @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj)
-     * @private
-     */
-    handleMouseDown: function(e, oDD) {
+                    if (oDD.isTarget && !oDD.isLocked() && oDD != dc) {
+                        if (this.isOverTarget(pt, oDD, this.mode, curRegion)) {
+                            // look for drop interactions
+                            if (isDrop) {
+                                dropEvts.push( oDD );
+                            // look for drag enter and drag over interactions
+                            } else {
 
-        var button = e.which || e.button;
+                                // initial drag over: dragEnter fires
+                                if (!oldOvers[oDD.id]) {
+                                    enterEvts.push( oDD );
+                                // subsequent drag overs: dragOver fires
+                                } else {
+                                    overEvts.push( oDD );
+                                }
 
-        if (this.primaryButtonOnly && button > 1) {
-            return;
-        }
+                                this.dragOvers[oDD.id] = oDD;
+                            }
+                        }
+                    }
+                }
+            }
 
-        if (this.isLocked()) {
-            return;
-        }
+            this.interactionInfo = {
+                out:       outEvts,
+                enter:     enterEvts,
+                over:      overEvts,
+                drop:      dropEvts,
+                point:     pt,
+                draggedRegion:    curRegion,
+                sourceRegion: this.locationCache[dc.id],
+                validDrop: isDrop
+            };
 
-        this.DDM.refreshCache(this.groups);
-        // var self = this;
-        // setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0);
-
-        // Only process the event if we really clicked within the linked 
-        // element.  The reason we make this check is that in the case that 
-        // another element was moved between the clicked element and the 
-        // cursor in the time between the mousedown and mouseup events. When 
-        // this happens, the element gets the next mousedown event 
-        // regardless of where on the screen it happened.  
-        var pt = new YAHOO.util.Point(Event.getPageX(e), Event.getPageY(e));
-        if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) )  {
-        } else {
-            if (this.clickValidator(e)) {
+            // notify about a drop that did not find a target
+            if (isDrop && !dropEvts.length) {
+                this.interactionInfo.validDrop = false;
+                dc.onInvalidDrop(e);
+            }
 
 
-                // set the initial element position
-                this.setStartPosition();
+            if (this.mode) {
+                if (outEvts.length) {
+                    dc.b4DragOut(e, outEvts);
+                    if (dc) {
+                        dc.onDragOut(e, outEvts);
+                    }
+                }
 
+                if (enterEvts.length) {
+                    if (dc) {
+                        dc.onDragEnter(e, enterEvts);
+                    }
+                }
 
-                this.b4MouseDown(e);
-                this.onMouseDown(e);
-                this.DDM.handleMouseDown(e, this);
+                if (overEvts.length) {
+                    if (dc) {
+                        dc.b4DragOver(e, overEvts);
+                    }
 
-                this.DDM.stopEvent(e);
-            } else {
+                    if (dc) {
+                        dc.onDragOver(e, overEvts);
+                    }
+                }
 
+                if (dropEvts.length) {
+                    if (dc) {
+                        dc.b4DragDrop(e, dropEvts);
+                    }
+                    if (dc) {
+                        dc.onDragDrop(e, dropEvts);
+                    }
+                }
 
-            }
-        }
-    },
+            } else {
+                // fire dragout events
+                var len = 0;
+                for (i=0, len=outEvts.length; i<len; ++i) {
+                    if (dc) {
+                        dc.b4DragOut(e, outEvts[i].id);
+                    }
+                    if (dc) {
+                        dc.onDragOut(e, outEvts[i].id);
+                    }
+                }
+                 
+                // fire enter events
+                for (i=0,len=enterEvts.length; i<len; ++i) {
+                    // dc.b4DragEnter(e, oDD.id);
 
-    clickValidator: function(e) {
-        var target = Event.getTarget(e);
-        return ( this.isValidHandleChild(target) &&
-                    (this.id == this.handleElId || 
-                        this.DDM.handleWasClicked(target, this.id)) );
-    },
+                    if (dc) {
+                        dc.onDragEnter(e, enterEvts[i].id);
+                    }
+                }
+         
+                // fire over events
+                for (i=0,len=overEvts.length; i<len; ++i) {
+                    if (dc) {
+                        dc.b4DragOver(e, overEvts[i].id);
+                    }
+                    if (dc) {
+                        dc.onDragOver(e, overEvts[i].id);
+                    }
+                }
 
-    /**
-     * Allows you to specify a tag name that should not start a drag operation
-     * when clicked.  This is designed to facilitate embedding links within a
-     * drag handle that do something other than start the drag.
-     * @method addInvalidHandleType
-     * @param {string} tagName the type of element to exclude
-     */
-    addInvalidHandleType: function(tagName) {
-        var type = tagName.toUpperCase();
-        this.invalidHandleTypes[type] = type;
-    },
+                // fire drop events
+                for (i=0, len=dropEvts.length; i<len; ++i) {
+                    if (dc) {
+                        dc.b4DragDrop(e, dropEvts[i].id);
+                    }
+                    if (dc) {
+                        dc.onDragDrop(e, dropEvts[i].id);
+                    }
+                }
 
-    /**
-     * Lets you to specify an element id for a child of a drag handle
-     * that should not initiate a drag
-     * @method addInvalidHandleId
-     * @param {string} id the element id of the element you wish to ignore
-     */
-    addInvalidHandleId: function(id) {
-        if (typeof id !== "string") {
-            YAHOO.log("id is not a string, assuming it is an HTMLElement");
-            id = Dom.generateId(id);
-        }
-        this.invalidHandleIds[id] = id;
-    },
+            }
+        },
 
-    /**
-     * Lets you specify a css class of elements that will not initiate a drag
-     * @method addInvalidHandleClass
-     * @param {string} cssClass the class of the elements you wish to ignore
-     */
-    addInvalidHandleClass: function(cssClass) {
-        this.invalidHandleClasses.push(cssClass);
-    },
+        /**
+         * Helper function for getting the best match from the list of drag 
+         * and drop objects returned by the drag and drop events when we are 
+         * in INTERSECT mode.  It returns either the first object that the 
+         * cursor is over, or the object that has the greatest overlap with 
+         * the dragged element.
+         * @method getBestMatch
+         * @param  {DragDrop[]} dds The array of drag and drop objects 
+         * targeted
+         * @return {DragDrop}       The best single match
+         * @static
+         */
+        getBestMatch: function(dds) {
+            var winner = null;
 
-    /**
-     * Unsets an excluded tag name set by addInvalidHandleType
-     * @method removeInvalidHandleType
-     * @param {string} tagName the type of element to unexclude
-     */
-    removeInvalidHandleType: function(tagName) {
-        var type = tagName.toUpperCase();
-        // this.invalidHandleTypes[type] = null;
-        delete this.invalidHandleTypes[type];
-    },
-    
-    /**
-     * Unsets an invalid handle id
-     * @method removeInvalidHandleId
-     * @param {string} id the id of the element to re-enable
-     */
-    removeInvalidHandleId: function(id) {
-        if (typeof id !== "string") {
-            YAHOO.log("id is not a string, assuming it is an HTMLElement");
-            id = Dom.generateId(id);
-        }
-        delete this.invalidHandleIds[id];
-    },
+            var len = dds.length;
 
-    /**
-     * Unsets an invalid css class
-     * @method removeInvalidHandleClass
-     * @param {string} cssClass the class of the element(s) you wish to 
-     * re-enable
-     */
-    removeInvalidHandleClass: function(cssClass) {
-        for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) {
-            if (this.invalidHandleClasses[i] == cssClass) {
-                delete this.invalidHandleClasses[i];
+            if (len == 1) {
+                winner = dds[0];
+            } else {
+                // Loop through the targeted items
+                for (var i=0; i<len; ++i) {
+                    var dd = dds[i];
+                    // If the cursor is over the object, it wins.  If the 
+                    // cursor is over multiple matches, the first one we come
+                    // to wins.
+                    if (this.mode == this.INTERSECT && dd.cursorIsOver) {
+                        winner = dd;
+                        break;
+                    // Otherwise the object with the most overlap wins
+                    } else {
+                        if (!winner || !winner.overlap || (dd.overlap &&
+                            winner.overlap.getArea() < dd.overlap.getArea())) {
+                            winner = dd;
+                        }
+                    }
+                }
             }
-        }
-    },
 
-    /**
-     * Checks the tag exclusion list to see if this click should be ignored
-     * @method isValidHandleChild
-     * @param {HTMLElement} node the HTMLElement to evaluate
-     * @return {boolean} true if this is a valid tag type, false if not
-     */
-    isValidHandleChild: function(node) {
+            return winner;
+        },
 
-        var valid = true;
-        // var n = (node.nodeName == "#text") ? node.parentNode : node;
-        var nodeName;
-        try {
-            nodeName = node.nodeName.toUpperCase();
-        } catch(e) {
-            nodeName = node.nodeName;
-        }
-        valid = valid && !this.invalidHandleTypes[nodeName];
-        valid = valid && !this.invalidHandleIds[node.id];
+        /**
+         * Refreshes the cache of the top-left and bottom-right points of the 
+         * drag and drop objects in the specified group(s).  This is in the
+         * format that is stored in the drag and drop instance, so typical 
+         * usage is:
+         * <code>
+         * YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups);
+         * </code>
+         * Alternatively:
+         * <code>
+         * YAHOO.util.DragDropMgr.refreshCache({group1:true, group2:true});
+         * </code>
+         * @TODO this really should be an indexed array.  Alternatively this
+         * method could accept both.
+         * @method refreshCache
+         * @param {Object} groups an associative array of groups to refresh
+         * @static
+         */
+        refreshCache: function(groups) {
 
-        for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {
-            valid = !Dom.hasClass(node, this.invalidHandleClasses[i]);
-        }
+            // refresh everything if group array is not provided
+            var g = groups || this.ids;
 
+            for (var sGroup in g) {
+                if ("string" != typeof sGroup) {
+                    continue;
+                }
+                for (var i in this.ids[sGroup]) {
+                    var oDD = this.ids[sGroup][i];
 
-        return valid;
+                    if (this.isTypeOfDD(oDD)) {
+                        var loc = this.getLocation(oDD);
+                        if (loc) {
+                            this.locationCache[oDD.id] = loc;
+                        } else {
+                            delete this.locationCache[oDD.id];
+                        }
+                    }
+                }
+            }
+        },
 
-    },
+        /**
+         * This checks to make sure an element exists and is in the DOM.  The
+         * main purpose is to handle cases where innerHTML is used to remove
+         * drag and drop objects from the DOM.  IE provides an 'unspecified
+         * error' when trying to access the offsetParent of such an element
+         * @method verifyEl
+         * @param {HTMLElement} el the element to check
+         * @return {boolean} true if the element looks usable
+         * @static
+         */
+        verifyEl: function(el) {
+            try {
+                if (el) {
+                    var parent = el.offsetParent;
+                    if (parent) {
+                        return true;
+                    }
+                }
+            } catch(e) {
+            }
 
-    /**
-     * Create the array of horizontal tick marks if an interval was specified
-     * in setXConstraint().
-     * @method setXTicks
-     * @private
-     */
-    setXTicks: function(iStartX, iTickSize) {
-        this.xTicks = [];
-        this.xTickSize = iTickSize;
+            return false;
+        },
         
-        var tickMap = {};
-
-        for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {
-            if (!tickMap[i]) {
-                this.xTicks[this.xTicks.length] = i;
-                tickMap[i] = true;
-            }
-        }
-
-        for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) {
-            if (!tickMap[i]) {
-                this.xTicks[this.xTicks.length] = i;
-                tickMap[i] = true;
+        /**
+         * Returns a Region object containing the drag and drop element's position
+         * and size, including the padding configured for it
+         * @method getLocation
+         * @param {DragDrop} oDD the drag and drop object to get the 
+         *                       location for
+         * @return {YAHOO.util.Region} a Region object representing the total area
+         *                             the element occupies, including any padding
+         *                             the instance is configured for.
+         * @static
+         */
+        getLocation: function(oDD) {
+            if (! this.isTypeOfDD(oDD)) {
+                return null;
             }
-        }
-
-        this.xTicks.sort(this.DDM.numericSort) ;
-    },
-
-    /**
-     * Create the array of vertical tick marks if an interval was specified in 
-     * setYConstraint().
-     * @method setYTicks
-     * @private
-     */
-    setYTicks: function(iStartY, iTickSize) {
-        this.yTicks = [];
-        this.yTickSize = iTickSize;
 
-        var tickMap = {};
+            var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;
 
-        for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) {
-            if (!tickMap[i]) {
-                this.yTicks[this.yTicks.length] = i;
-                tickMap[i] = true;
-            }
-        }
+            try {
+                pos= YAHOO.util.Dom.getXY(el);
+            } catch (e) { }
 
-        for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) {
-            if (!tickMap[i]) {
-                this.yTicks[this.yTicks.length] = i;
-                tickMap[i] = true;
+            if (!pos) {
+                return null;
             }
-        }
-
-        this.yTicks.sort(this.DDM.numericSort) ;
-    },
 
-    /**
-     * By default, the element can be dragged any place on the screen.  Use 
-     * this method to limit the horizontal travel of the element.  Pass in 
-     * 0,0 for the parameters if you want to lock the drag to the y axis.
-     * @method setXConstraint
-     * @param {int} iLeft the number of pixels the element can move to the left
-     * @param {int} iRight the number of pixels the element can move to the 
-     * right
-     * @param {int} iTickSize optional parameter for specifying that the 
-     * element
-     * should move iTickSize pixels at a time.
-     */
-    setXConstraint: function(iLeft, iRight, iTickSize) {
-        this.leftConstraint = iLeft;
-        this.rightConstraint = iRight;
+            x1 = pos[0];
+            x2 = x1 + el.offsetWidth;
+            y1 = pos[1];
+            y2 = y1 + el.offsetHeight;
 
-        this.minX = this.initPageX - iLeft;
-        this.maxX = this.initPageX + iRight;
-        if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }
+            t = y1 - oDD.padding[0];
+            r = x2 + oDD.padding[1];
+            b = y2 + oDD.padding[2];
+            l = x1 - oDD.padding[3];
 
-        this.constrainX = true;
-    },
+            return new YAHOO.util.Region( t, r, b, l );
+        },
 
-    /**
-     * Clears any constraints applied to this instance.  Also clears ticks
-     * since they can't exist independent of a constraint at this time.
-     * @method clearConstraints
-     */
-    clearConstraints: function() {
-        this.constrainX = false;
-        this.constrainY = false;
-        this.clearTicks();
-    },
+        /**
+         * Checks the cursor location to see if it over the target
+         * @method isOverTarget
+         * @param {YAHOO.util.Point} pt The point to evaluate
+         * @param {DragDrop} oTarget the DragDrop object we are inspecting
+         * @param {boolean} intersect true if we are in intersect mode
+         * @param {YAHOO.util.Region} pre-cached location of the dragged element
+         * @return {boolean} true if the mouse is over the target
+         * @private
+         * @static
+         */
+        isOverTarget: function(pt, oTarget, intersect, curRegion) {
+            // use cache if available
+            var loc = this.locationCache[oTarget.id];
+            if (!loc || !this.useCache) {
+                loc = this.getLocation(oTarget);
+                this.locationCache[oTarget.id] = loc;
 
-    /**
-     * Clears any tick interval defined for this instance
-     * @method clearTicks
-     */
-    clearTicks: function() {
-        this.xTicks = null;
-        this.yTicks = null;
-        this.xTickSize = 0;
-        this.yTickSize = 0;
-    },
+            }
 
-    /**
-     * By default, the element can be dragged any place on the screen.  Set 
-     * this to limit the vertical travel of the element.  Pass in 0,0 for the
-     * parameters if you want to lock the drag to the x axis.
-     * @method setYConstraint
-     * @param {int} iUp the number of pixels the element can move up
-     * @param {int} iDown the number of pixels the element can move down
-     * @param {int} iTickSize optional parameter for specifying that the 
-     * element should move iTickSize pixels at a time.
-     */
-    setYConstraint: function(iUp, iDown, iTickSize) {
-        this.topConstraint = iUp;
-        this.bottomConstraint = iDown;
+            if (!loc) {
+                return false;
+            }
 
-        this.minY = this.initPageY - iUp;
-        this.maxY = this.initPageY + iDown;
-        if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }
+            oTarget.cursorIsOver = loc.contains( pt );
 
-        this.constrainY = true;
-        
-    },
+            // DragDrop is using this as a sanity check for the initial mousedown
+            // in this case we are done.  In POINT mode, if the drag obj has no
+            // contraints, we are done. Otherwise we need to evaluate the 
+            // region the target as occupies to determine if the dragged element
+            // overlaps with it.
+            
+            var dc = this.dragCurrent;
+            if (!dc || (!intersect && !dc.constrainX && !dc.constrainY)) {
 
-    /**
-     * resetConstraints must be called if you manually reposition a dd element.
-     * @method resetConstraints
-     * @param {boolean} maintainOffset
-     */
-    resetConstraints: function() {
+                //if (oTarget.cursorIsOver) {
+                //}
+                return oTarget.cursorIsOver;
+            }
 
+            oTarget.overlap = null;
 
-        // Maintain offsets if necessary
-        if (this.initPageX || this.initPageX === 0) {
-            // figure out how much this thing has moved
-            var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0;
-            var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0;
+            // Get the current location of the drag element, this is the
+            // location of the mouse event less the delta that represents
+            // where the original mousedown happened on the element.  We
+            // need to consider constraints and ticks as well.
 
-            this.setInitPosition(dx, dy);
+            if (!curRegion) {
+                var pos = dc.getTargetCoord(pt.x, pt.y);
+                var el = dc.getDragEl();
+                curRegion = new YAHOO.util.Region( pos.y, 
+                                                   pos.x + el.offsetWidth,
+                                                   pos.y + el.offsetHeight, 
+                                                   pos.x );
+            }
 
-        // This is the first time we have detected the element's position
-        } else {
-            this.setInitPosition();
-        }
+            var overlap = curRegion.intersect(loc);
 
-        if (this.constrainX) {
-            this.setXConstraint( this.leftConstraint, 
-                                 this.rightConstraint, 
-                                 this.xTickSize        );
-        }
+            if (overlap) {
+                oTarget.overlap = overlap;
+                return (intersect) ? true : oTarget.cursorIsOver;
+            } else {
+                return false;
+            }
+        },
 
-        if (this.constrainY) {
-            this.setYConstraint( this.topConstraint, 
-                                 this.bottomConstraint, 
-                                 this.yTickSize         );
-        }
-    },
+        /**
+         * unload event handler
+         * @method _onUnload
+         * @private
+         * @static
+         */
+        _onUnload: function(e, me) {
+            this.unregAll();
+        },
 
-    /**
-     * Normally the drag element is moved pixel by pixel, but we can specify 
-     * that it move a number of pixels at a time.  This method resolves the 
-     * location when we have it set up like this.
-     * @method getTick
-     * @param {int} val where we want to place the object
-     * @param {int[]} tickArray sorted array of valid points
-     * @return {int} the closest tick
-     * @private
-     */
-    getTick: function(val, tickArray) {
+        /**
+         * Cleans up the drag and drop events and objects.
+         * @method unregAll
+         * @private
+         * @static
+         */
+        unregAll: function() {
 
-        if (!tickArray) {
-            // If tick interval is not defined, it is effectively 1 pixel, 
-            // so we return the value passed to us.
-            return val; 
-        } else if (tickArray[0] >= val) {
-            // The value is lower than the first tick, so we return the first
-            // tick.
-            return tickArray[0];
-        } else {
-            for (var i=0, len=tickArray.length; i<len; ++i) {
-                var next = i + 1;
-                if (tickArray[next] && tickArray[next] >= val) {
-                    var diff1 = val - tickArray[i];
-                    var diff2 = tickArray[next] - val;
-                    return (diff2 > diff1) ? tickArray[i] : tickArray[next];
-                }
+            if (this.dragCurrent) {
+                this.stopDrag();
+                this.dragCurrent = null;
             }
 
-            // The value is larger than the last tick, so we return the last
-            // tick.
-            return tickArray[tickArray.length - 1];
-        }
-    },
+            this._execOnAll("unreg", []);
 
-    /**
-     * toString method
-     * @method toString
-     * @return {string} string representation of the dd obj
-     */
-    toString: function() {
-        return ("DragDrop " + this.id);
-    }
+            for (i in this.elementCache) {
+                delete this.elementCache[i];
+            }
 
-};
-
-})();
-/**
- * The drag and drop utility provides a framework for building drag and drop
- * applications.  In addition to enabling drag and drop for specific elements,
- * the drag and drop elements are tracked by the manager class, and the
- * interactions between the various elements are tracked during the drag and
- * the implementing code is notified about these important moments.
- * @module dragdrop
- * @title Drag and Drop
- * @requires yahoo,dom,event
- * @namespace YAHOO.util
- */
-
-// Only load the library once.  Rewriting the manager class would orphan 
-// existing drag and drop instances.
-if (!YAHOO.util.DragDropMgr) {
-
-/**
- * DragDropMgr is a singleton that tracks the element interaction for 
- * all DragDrop items in the window.  Generally, you will not call 
- * this class directly, but it does have helper methods that could 
- * be useful in your DragDrop implementations.
- * @class DragDropMgr
- * @static
- */
-YAHOO.util.DragDropMgr = function() {
-
-    var Event = YAHOO.util.Event;
-
-    return {
+            this.elementCache = {};
+            this.ids = {};
+        },
 
         /**
-         * Two dimensional Array of registered DragDrop objects.  The first 
-         * dimension is the DragDrop item group, the second the DragDrop 
-         * object.
-         * @property ids
-         * @type {string: string}
+         * A cache of DOM elements
+         * @property elementCache
          * @private
          * @static
          */
-        ids: {},
-
+        elementCache: {},
+        
         /**
-         * Array of element ids defined as drag handles.  Used to determine 
-         * if the element that generated the mousedown event is actually the 
-         * handle and not the html element itself.
-         * @property handleIds
-         * @type {string: string}
+         * Get the wrapper for the DOM element specified
+         * @method getElWrapper
+         * @param {String} id the id of the element to get
+         * @return {YAHOO.util.DDM.ElementWrapper} the wrapped element
          * @private
+         * @deprecated This wrapper isn't that useful
          * @static
          */
-        handleIds: {},
-
-        /**
-         * the DragDrop object that is currently being dragged
-         * @property dragCurrent
-         * @type DragDrop
-         * @private
-         * @static
-         **/
-        dragCurrent: null,
+        getElWrapper: function(id) {
+            var oWrapper = this.elementCache[id];
+            if (!oWrapper || !oWrapper.el) {
+                oWrapper = this.elementCache[id] = 
+                    new this.ElementWrapper(YAHOO.util.Dom.get(id));
+            }
+            return oWrapper;
+        },
 
         /**
-         * the DragDrop object(s) that are being hovered over
-         * @property dragOvers
-         * @type Array
-         * @private
+         * Returns the actual DOM element
+         * @method getElement
+         * @param {String} id the id of the elment to get
+         * @return {Object} The element
+         * @deprecated use YAHOO.util.Dom.get instead
          * @static
          */
-        dragOvers: {},
-
+        getElement: function(id) {
+            return YAHOO.util.Dom.get(id);
+        },
+        
         /**
-         * the X distance between the cursor and the object being dragged
-         * @property deltaX
-         * @type int
-         * @private
+         * Returns the style property for the DOM element (i.e., 
+         * document.getElById(id).style)
+         * @method getCss
+         * @param {String} id the id of the elment to get
+         * @return {Object} The style property of the element
+         * @deprecated use YAHOO.util.Dom instead
          * @static
          */
-        deltaX: 0,
+        getCss: function(id) {
+            var el = YAHOO.util.Dom.get(id);
+            return (el) ? el.style : null;
+        },
 
         /**
-         * the Y distance between the cursor and the object being dragged
-         * @property deltaY
-         * @type int
+         * Inner class for cached elements
+         * @class DragDropMgr.ElementWrapper
+         * @for DragDropMgr
          * @private
-         * @static
+         * @deprecated
          */
-        deltaY: 0,
+        ElementWrapper: function(el) {
+                /**
+                 * The element
+                 * @property el
+                 */
+                this.el = el || null;
+                /**
+                 * The element id
+                 * @property id
+                 */
+                this.id = this.el && el.id;
+                /**
+                 * A reference to the style property
+                 * @property css
+                 */
+                this.css = this.el && el.style;
+            },
 
         /**
-         * Flag to determine if we should prevent the default behavior of the
-         * events we define. By default this is true, but this can be set to 
-         * false if you need the default behavior (not recommended)
-         * @property preventDefault
-         * @type boolean
+         * Returns the X position of an html element
+         * @method getPosX
+         * @param el the element for which to get the position
+         * @return {int} the X coordinate
+         * @for DragDropMgr
+         * @deprecated use YAHOO.util.Dom.getX instead
          * @static
          */
-        preventDefault: true,
+        getPosX: function(el) {
+            return YAHOO.util.Dom.getX(el);
+        },
 
         /**
-         * Flag to determine if we should stop the propagation of the events 
-         * we generate. This is true by default but you may want to set it to
-         * false if the html element contains other features that require the
-         * mouse click.
-         * @property stopPropagation
-         * @type boolean
+         * Returns the Y position of an html element
+         * @method getPosY
+         * @param el the element for which to get the position
+         * @return {int} the Y coordinate
+         * @deprecated use YAHOO.util.Dom.getY instead
          * @static
          */
-        stopPropagation: true,
+        getPosY: function(el) {
+            return YAHOO.util.Dom.getY(el); 
+        },
 
         /**
-         * Internal flag that is set to true when drag and drop has been
-         * intialized
-         * @property initialized
-         * @private
+         * Swap two nodes.  In IE, we use the native method, for others we 
+         * emulate the IE behavior
+         * @method swapNode
+         * @param n1 the first node to swap
+         * @param n2 the other node to swap
          * @static
          */
-        initalized: false,
+        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);
+                }
+            }
+        },
 
         /**
-         * All drag and drop can be disabled.
-         * @property locked
+         * Returns the current scroll position
+         * @method getScroll
          * @private
          * @static
          */
-        locked: false,
+        getScroll: function () {
+            var t, l, dde=document.documentElement, db=document.body;
+            if (dde && (dde.scrollTop || dde.scrollLeft)) {
+                t = dde.scrollTop;
+                l = dde.scrollLeft;
+            } else if (db) {
+                t = db.scrollTop;
+                l = db.scrollLeft;
+            } else {
+            }
+            return { top: t, left: l };
+        },
 
         /**
-         * Called the first time an element is registered.
-         * @method init
-         * @private
+         * Returns the specified element style property
+         * @method getStyle
+         * @param {HTMLElement} el          the element
+         * @param {string}      styleProp   the style property
+         * @return {string} The value of the style property
+         * @deprecated use YAHOO.util.Dom.getStyle
          * @static
          */
-        init: function() {
-            this.initialized = true;
+        getStyle: function(el, styleProp) {
+            return YAHOO.util.Dom.getStyle(el, styleProp);
         },
 
         /**
-         * In point mode, drag and drop interaction is defined by the 
-         * location of the cursor during the drag/drop
-         * @property POINT
-         * @type int
+         * Gets the scrollTop
+         * @method getScrollTop
+         * @return {int} the document's scrollTop
          * @static
-         * @final
          */
-        POINT: 0,
+        getScrollTop: function () { return this.getScroll().top; },
 
         /**
-         * In intersect mode, drag and drop interaction is defined by the 
-         * cursor position or the amount of overlap of two or more drag and 
-         * drop objects.
-         * @property INTERSECT
-         * @type int
+         * Gets the scrollLeft
+         * @method getScrollLeft
+         * @return {int} the document's scrollTop
          * @static
-         * @final
          */
-        INTERSECT: 1,
+        getScrollLeft: function () { return this.getScroll().left; },
 
         /**
-         * In intersect mode, drag and drop interaction is defined only by the 
-         * overlap of two or more drag and drop objects.
-         * @property STRICT_INTERSECT
-         * @type int
+         * Sets the x/y position of an element to the location of the
+         * target element.
+         * @method moveToEl
+         * @param {HTMLElement} moveEl      The element to move
+         * @param {HTMLElement} targetEl    The position reference element
          * @static
-         * @final
          */
-        STRICT_INTERSECT: 2,
+        moveToEl: function (moveEl, targetEl) {
+            var aCoord = YAHOO.util.Dom.getXY(targetEl);
+            YAHOO.util.Dom.setXY(moveEl, aCoord);
+        },
 
         /**
-         * The current drag and drop mode.  Default: POINT
-         * @property mode
-         * @type int
+         * Gets the client height
+         * @method getClientHeight
+         * @return {int} client height in px
+         * @deprecated use YAHOO.util.Dom.getViewportHeight instead
          * @static
          */
-        mode: 0,
+        getClientHeight: function() {
+            return YAHOO.util.Dom.getViewportHeight();
+        },
 
         /**
-         * Runs method on all drag and drop objects
-         * @method _execOnAll
-         * @private
+         * Gets the client width
+         * @method getClientWidth
+         * @return {int} client width in px
+         * @deprecated use YAHOO.util.Dom.getViewportWidth instead
          * @static
          */
-        _execOnAll: function(sMethod, args) {
-            for (var i in this.ids) {
-                for (var j in this.ids[i]) {
-                    var oDD = this.ids[i][j];
-                    if (! this.isTypeOfDD(oDD)) {
-                        continue;
-                    }
-                    oDD[sMethod].apply(oDD, args);
-                }
-            }
+        getClientWidth: function() {
+            return YAHOO.util.Dom.getViewportWidth();
         },
 
         /**
-         * Drag and drop initialization.  Sets up the global event handlers
-         * @method _onLoad
-         * @private
+         * Numeric array sort function
+         * @method numericSort
          * @static
          */
-        _onLoad: function() {
-
-            this.init();
-
-
-            Event.on(document, "mouseup",   this.handleMouseUp, this, true);
-            Event.on(document, "mousemove", this.handleMouseMove, this, true);
-            Event.on(window,   "unload",    this._onUnload, this, true);
-            Event.on(window,   "resize",    this._onResize, this, true);
-            // Event.on(window,   "mouseout",    this._test);
-
-        },
+        numericSort: function(a, b) { return (a - b); },
 
         /**
-         * Reset constraints on all drag and drop objs
-         * @method _onResize
+         * Internal counter
+         * @property _timeoutCount
          * @private
          * @static
          */
-        _onResize: function(e) {
-            this._execOnAll("resetConstraints", []);
-        },
-
-        /**
-         * Lock all drag and drop functionality
-         * @method lock
-         * @static
-         */
-        lock: function() { this.locked = true; },
-
-        /**
-         * Unlock all drag and drop functionality
-         * @method unlock
-         * @static
-         */
-        unlock: function() { this.locked = false; },
-
-        /**
-         * Is drag and drop locked?
-         * @method isLocked
-         * @return {boolean} True if drag and drop is locked, false otherwise.
-         * @static
-         */
-        isLocked: function() { return this.locked; },
+        _timeoutCount: 0,
 
         /**
-         * Location cache that is set for all drag drop objects when a drag is
-         * initiated, cleared when the drag is finished.
-         * @property locationCache
+         * Trying to make the load order less important.  Without this we get
+         * an error if this file is loaded before the Event Utility.
+         * @method _addListeners
          * @private
          * @static
          */
-        locationCache: {},
+        _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;
+                    }
+                }
+            }
+        },
 
         /**
-         * Set useCache to false if you want to force object the lookup of each
-         * drag and drop linked element constantly during a drag.
-         * @property useCache
-         * @type boolean
+         * Recursively searches the immediate parent and all child nodes for 
+         * the handle element in order to determine wheter or not it was 
+         * clicked.
+         * @method handleWasClicked
+         * @param node the html element to inspect
          * @static
          */
-        useCache: true,
+        handleWasClicked: function(node, id) {
+            if (this.isHandle(id, node.id)) {
+                return true;
+            } else {
+                // check to see if this is a text node child of the one we want
+                var p = node.parentNode;
 
-        /**
-         * The number of pixels that the mouse needs to move after the 
-         * mousedown before the drag is initiated.  Default=3;
-         * @property clickPixelThresh
-         * @type int
-         * @static
-         */
-        clickPixelThresh: 3,
+                while (p) {
+                    if (this.isHandle(id, p.id)) {
+                        return true;
+                    } else {
+                        p = p.parentNode;
+                    }
+                }
+            }
 
-        /**
-         * The number of milliseconds after the mousedown event to initiate the
-         * drag if we don't get a mouseup event. Default=1000
-         * @property clickTimeThresh
-         * @type int
-         * @static
-         */
-        clickTimeThresh: 1000,
+            return false;
+        }
 
-        /**
-         * Flag that indicates that either the drag pixel threshold or the 
-         * mousdown time threshold has been met
-         * @property dragThreshMet
-         * @type boolean
-         * @private
-         * @static
-         */
-        dragThreshMet: false,
+    };
 
-        /**
-         * Timeout used for the click time threshold
-         * @property clickTimeout
-         * @type Object
-         * @private
-         * @static
-         */
-        clickTimeout: null,
+}();
 
-        /**
-         * The X position of the mousedown event stored for later use when a 
-         * drag threshold is met.
-         * @property startX
-         * @type int
-         * @private
-         * @static
-         */
-        startX: 0,
+// shorter alias, save a few bytes
+YAHOO.util.DDM = YAHOO.util.DragDropMgr;
+YAHOO.util.DDM._addListeners();
 
-        /**
-         * The Y position of the mousedown event stored for later use when a 
-         * drag threshold is met.
-         * @property startY
-         * @type int
-         * @private
-         * @static
-         */
-        startY: 0,
+}
 
-        /**
-         * Each DragDrop instance must be registered with the DragDropMgr.  
-         * This is executed in DragDrop.init()
-         * @method regDragDrop
-         * @param {DragDrop} oDD the DragDrop object to register
-         * @param {String} sGroup the name of the group this element belongs to
-         * @static
-         */
-        regDragDrop: function(oDD, sGroup) {
-            if (!this.initialized) { this.init(); }
-            
-            if (!this.ids[sGroup]) {
-                this.ids[sGroup] = {};
-            }
-            this.ids[sGroup][oDD.id] = oDD;
-        },
+(function() {
 
-        /**
-         * Removes the supplied dd instance from the supplied group. Executed
-         * by DragDrop.removeFromGroup, so don't call this function directly.
-         * @method removeDDFromGroup
-         * @private
-         * @static
-         */
-        removeDDFromGroup: function(oDD, sGroup) {
-            if (!this.ids[sGroup]) {
-                this.ids[sGroup] = {};
-            }
+var Event=YAHOO.util.Event; 
+var Dom=YAHOO.util.Dom;
 
-            var obj = this.ids[sGroup];
-            if (obj && obj[oDD.id]) {
-                delete obj[oDD.id];
-            }
-        },
+/**
+ * Defines the interface and base operation of items that that can be 
+ * dragged or can be drop targets.  It was designed to be extended, overriding
+ * the event handlers for startDrag, onDrag, onDragOver, onDragOut.
+ * Up to three html elements can be associated with a DragDrop instance:
+ * <ul>
+ * <li>linked element: the element that is passed into the constructor.
+ * This is the element which defines the boundaries for interaction with 
+ * other DragDrop objects.</li>
+ * <li>handle element(s): The drag operation only occurs if the element that 
+ * was clicked matches a handle element.  By default this is the linked 
+ * element, but there are times that you will want only a portion of the 
+ * linked element to initiate the drag operation, and the setHandleElId() 
+ * method provides a way to define this.</li>
+ * <li>drag element: this represents an the element that would be moved along
+ * with the cursor during a drag operation.  By default, this is the linked
+ * element itself as in {@link YAHOO.util.DD}.  setDragElId() lets you define
+ * a separate element that would be moved, as in {@link YAHOO.util.DDProxy}
+ * </li>
+ * </ul>
+ * This class should not be instantiated until the onload event to ensure that
+ * the associated elements are available.
+ * The following would define a DragDrop obj that would interact with any 
+ * other DragDrop obj in the "group1" group:
+ * <pre>
+ *  dd = new YAHOO.util.DragDrop("div1", "group1");
+ * </pre>
+ * Since none of the event handlers have been implemented, nothing would 
+ * actually happen if you were to run the code above.  Normally you would 
+ * override this class or one of the default implementations, but you can 
+ * also override the methods you want on an instance of the class...
+ * <pre>
+ *  dd.onDragDrop = function(e, id) {
+ *  &nbsp;&nbsp;alert("dd was dropped on " + id);
+ *  }
+ * </pre>
+ * @namespace YAHOO.util
+ * @class DragDrop
+ * @constructor
+ * @param {String} id of the element that is linked to this instance
+ * @param {String} sGroup the group of related DragDrop objects
+ * @param {object} config an object containing configurable attributes
+ *                Valid properties for DragDrop: 
+ *                    padding, isTarget, maintainOffset, primaryButtonOnly,
+ */
+YAHOO.util.DragDrop = function(id, sGroup, config) {
+    if (id) {
+        this.init(id, sGroup, config); 
+    }
+};
 
-        /**
-         * Unregisters a drag and drop item.  This is executed in 
-         * DragDrop.unreg, use that method instead of calling this directly.
-         * @method _remove
-         * @private
-         * @static
-         */
-        _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];
-        },
+YAHOO.util.DragDrop.prototype = {
 
-        /**
-         * Each DragDrop handle element must be registered.  This is done
-         * automatically when executing DragDrop.setHandleElId()
-         * @method regHandle
-         * @param {String} sDDId the DragDrop id this element is a handle for
-         * @param {String} sHandleId the id of the element that is the drag 
-         * handle
-         * @static
-         */
-        regHandle: function(sDDId, sHandleId) {
-            if (!this.handleIds[sDDId]) {
-                this.handleIds[sDDId] = {};
-            }
-            this.handleIds[sDDId][sHandleId] = sHandleId;
-        },
+    /**
+     * The id of the element associated with this object.  This is what we 
+     * refer to as the "linked element" because the size and position of 
+     * this element is used to determine when the drag and drop objects have 
+     * interacted.
+     * @property id
+     * @type String
+     */
+    id: null,
 
-        /**
-         * Utility function to determine if a given element has been 
-         * registered as a drag drop item.
-         * @method isDragDrop
-         * @param {String} id the element id to check
-         * @return {boolean} true if this element is a DragDrop item, 
-         * false otherwise
-         * @static
-         */
-        isDragDrop: function(id) {
-            return ( this.getDDById(id) ) ? true : false;
-        },
+    /**
+     * Configuration attributes passed into the constructor
+     * @property config
+     * @type object
+     */
+    config: null,
 
-        /**
-         * Returns the drag and drop instances that are in all groups the
-         * passed in instance belongs to.
-         * @method getRelated
-         * @param {DragDrop} p_oDD the obj to get related data for
-         * @param {boolean} bTargetsOnly if true, only return targetable objs
-         * @return {DragDrop[]} the related instances
-         * @static
-         */
-        getRelated: function(p_oDD, bTargetsOnly) {
-            var oDDs = [];
-            for (var i in p_oDD.groups) {
-                for (j in this.ids[i]) {
-                    var dd = this.ids[i][j];
-                    if (! this.isTypeOfDD(dd)) {
-                        continue;
-                    }
-                    if (!bTargetsOnly || dd.isTarget) {
-                        oDDs[oDDs.length] = dd;
-                    }
-                }
-            }
+    /**
+     * The id of the element that will be dragged.  By default this is same 
+     * as the linked element , but could be changed to another element. Ex: 
+     * YAHOO.util.DDProxy
+     * @property dragElId
+     * @type String
+     * @private
+     */
+    dragElId: null, 
 
-            return oDDs;
-        },
+    /**
+     * the id of the element that initiates the drag operation.  By default 
+     * this is the linked element, but could be changed to be a child of this
+     * element.  This lets us do things like only starting the drag when the 
+     * header element within the linked html element is clicked.
+     * @property handleElId
+     * @type String
+     * @private
+     */
+    handleElId: null, 
 
-        /**
-         * Returns true if the specified dd target is a legal target for 
-         * the specifice drag obj
-         * @method isLegalTarget
-         * @param {DragDrop} the drag obj
-         * @param {DragDrop} the target
-         * @return {boolean} true if the target is a legal target for the 
-         * dd obj
-         * @static
-         */
-        isLegalTarget: function (oDD, oTargetDD) {
-            var targets = this.getRelated(oDD, true);
-            for (var i=0, len=targets.length;i<len;++i) {
-                if (targets[i].id == oTargetDD.id) {
-                    return true;
-                }
-            }
+    /**
+     * An associative array of HTML tags that will be ignored if clicked.
+     * @property invalidHandleTypes
+     * @type {string: string}
+     */
+    invalidHandleTypes: null, 
 
-            return false;
-        },
+    /**
+     * An associative array of ids for elements that will be ignored if clicked
+     * @property invalidHandleIds
+     * @type {string: string}
+     */
+    invalidHandleIds: null, 
 
-        /**
-         * My goal is to be able to transparently determine if an object is
-         * typeof DragDrop, and the exact subclass of DragDrop.  typeof 
-         * returns "object", oDD.constructor.toString() always returns
-         * "DragDrop" and not the name of the subclass.  So for now it just
-         * evaluates a well-known variable in DragDrop.
-         * @method isTypeOfDD
-         * @param {Object} the object to evaluate
-         * @return {boolean} true if typeof oDD = DragDrop
-         * @static
-         */
-        isTypeOfDD: function (oDD) {
-            return (oDD && oDD.__ygDragDrop);
-        },
+    /**
+     * An indexted array of css class names for elements that will be ignored
+     * if clicked.
+     * @property invalidHandleClasses
+     * @type string[]
+     */
+    invalidHandleClasses: null, 
 
-        /**
-         * Utility function to determine if a given element has been 
-         * registered as a drag drop handle for the given Drag Drop object.
-         * @method isHandle
-         * @param {String} id the element id to check
-         * @return {boolean} true if this element is a DragDrop handle, false 
-         * otherwise
-         * @static
-         */
-        isHandle: function(sDDId, sHandleId) {
-            return ( this.handleIds[sDDId] && 
-                            this.handleIds[sDDId][sHandleId] );
-        },
+    /**
+     * The linked element's absolute X position at the time the drag was 
+     * started
+     * @property startPageX
+     * @type int
+     * @private
+     */
+    startPageX: 0,
 
-        /**
-         * Returns the DragDrop instance for a given id
-         * @method getDDById
-         * @param {String} id the id of the DragDrop object
-         * @return {DragDrop} the drag drop object, null if it is not found
-         * @static
-         */
-        getDDById: function(id) {
-            for (var i in this.ids) {
-                if (this.ids[i][id]) {
-                    return this.ids[i][id];
-                }
-            }
-            return null;
-        },
+    /**
+     * The linked element's absolute X position at the time the drag was 
+     * started
+     * @property startPageY
+     * @type int
+     * @private
+     */
+    startPageY: 0,
+
+    /**
+     * The group defines a logical collection of DragDrop objects that are 
+     * related.  Instances only get events when interacting with other 
+     * DragDrop object in the same group.  This lets us define multiple 
+     * groups using a single DragDrop subclass if we want.
+     * @property groups
+     * @type {string: string}
+     */
+    groups: null,
+
+    /**
+     * Individual drag/drop instances can be locked.  This will prevent 
+     * onmousedown start drag.
+     * @property locked
+     * @type boolean
+     * @private
+     */
+    locked: false,
+
+    /**
+     * Lock this instance
+     * @method lock
+     */
+    lock: function() { this.locked = true; },
+
+    /**
+     * Unlock this instace
+     * @method unlock
+     */
+    unlock: function() { this.locked = false; },
+
+    /**
+     * By default, all instances can be a drop target.  This can be disabled by
+     * setting isTarget to false.
+     * @method isTarget
+     * @type boolean
+     */
+    isTarget: true,
+
+    /**
+     * The padding configured for this drag and drop object for calculating
+     * the drop zone intersection with this object.
+     * @method padding
+     * @type int[]
+     */
+    padding: null,
+
+    /**
+     * Cached reference to the linked element
+     * @property _domRef
+     * @private
+     */
+    _domRef: null,
+
+    /**
+     * Internal typeof flag
+     * @property __ygDragDrop
+     * @private
+     */
+    __ygDragDrop: true,
+
+    /**
+     * Set to true when horizontal contraints are applied
+     * @property constrainX
+     * @type boolean
+     * @private
+     */
+    constrainX: false,
+
+    /**
+     * Set to true when vertical contraints are applied
+     * @property constrainY
+     * @type boolean
+     * @private
+     */
+    constrainY: false,
+
+    /**
+     * The left constraint
+     * @property minX
+     * @type int
+     * @private
+     */
+    minX: 0,
+
+    /**
+     * The right constraint
+     * @property maxX
+     * @type int
+     * @private
+     */
+    maxX: 0,
+
+    /**
+     * The up constraint 
+     * @property minY
+     * @type int
+     * @type int
+     * @private
+     */
+    minY: 0,
+
+    /**
+     * The down constraint 
+     * @property maxY
+     * @type int
+     * @private
+     */
+    maxY: 0,
+
+    /**
+     * The difference between the click position and the source element's location
+     * @property deltaX
+     * @type int
+     * @private
+     */
+    deltaX: 0,
+
+    /**
+     * The difference between the click position and the source element's location
+     * @property deltaY
+     * @type int
+     * @private
+     */
+    deltaY: 0,
+
+    /**
+     * Maintain offsets when we resetconstraints.  Set to true when you want
+     * the position of the element relative to its parent to stay the same
+     * when the page changes
+     *
+     * @property maintainOffset
+     * @type boolean
+     */
+    maintainOffset: false,
+
+    /**
+     * Array of pixel locations the element will snap to if we specified a 
+     * horizontal graduation/interval.  This array is generated automatically
+     * when you define a tick interval.
+     * @property xTicks
+     * @type int[]
+     */
+    xTicks: null,
+
+    /**
+     * Array of pixel locations the element will snap to if we specified a 
+     * vertical graduation/interval.  This array is generated automatically 
+     * when you define a tick interval.
+     * @property yTicks
+     * @type int[]
+     */
+    yTicks: null,
+
+    /**
+     * By default the drag and drop instance will only respond to the primary
+     * button click (left button for a right-handed mouse).  Set to true to
+     * allow drag and drop to start with any mouse click that is propogated
+     * by the browser
+     * @property primaryButtonOnly
+     * @type boolean
+     */
+    primaryButtonOnly: true,
+
+    /**
+     * The availabe property is false until the linked dom element is accessible.
+     * @property available
+     * @type boolean
+     */
+    available: false,
+
+    /**
+     * By default, drags can only be initiated if the mousedown occurs in the
+     * region the linked element is.  This is done in part to work around a
+     * bug in some browsers that mis-report the mousedown if the previous
+     * mouseup happened outside of the window.  This property is set to true
+     * if outer handles are defined.
+     *
+     * @property hasOuterHandles
+     * @type boolean
+     * @default false
+     */
+    hasOuterHandles: false,
+
+    /**
+     * Property that is assigned to a drag and drop object when testing to
+     * see if it is being targeted by another dd object.  This property
+     * can be used in intersect mode to help determine the focus of
+     * the mouse interaction.  DDM.getBestMatch uses this property first to
+     * determine the closest match in INTERSECT mode when multiple targets
+     * are part of the same interaction.
+     * @property cursorIsOver
+     * @type boolean
+     */
+    cursorIsOver: false,
+
+    /**
+     * Property that is assigned to a drag and drop object when testing to
+     * see if it is being targeted by another dd object.  This is a region
+     * that represents the area the draggable element overlaps this target.
+     * DDM.getBestMatch uses this property to compare the size of the overlap
+     * to that of other targets in order to determine the closest match in
+     * INTERSECT mode when multiple targets are part of the same interaction.
+     * @property overlap 
+     * @type YAHOO.util.Region
+     */
+    overlap: null,
+
+    /**
+     * Code that executes immediately before the startDrag event
+     * @method b4StartDrag
+     * @private
+     */
+    b4StartDrag: function(x, y) { },
+
+    /**
+     * Abstract method called after a drag/drop object is clicked
+     * and the drag or mousedown time thresholds have beeen met.
+     * @method startDrag
+     * @param {int} X click location
+     * @param {int} Y click location
+     */
+    startDrag: function(x, y) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDrag event
+     * @method b4Drag
+     * @private
+     */
+    b4Drag: function(e) { },
+
+    /**
+     * Abstract method called during the onMouseMove event while dragging an 
+     * object.
+     * @method onDrag
+     * @param {Event} e the mousemove event
+     */
+    onDrag: function(e) { /* override this */ },
+
+    /**
+     * Abstract method called when this element fist begins hovering over 
+     * another DragDrop obj
+     * @method onDragEnter
+     * @param {Event} e the mousemove event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this is hovering over.  In INTERSECT mode, an array of one or more 
+     * dragdrop items being hovered over.
+     */
+    onDragEnter: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragOver event
+     * @method b4DragOver
+     * @private
+     */
+    b4DragOver: function(e) { },
+
+    /**
+     * Abstract method called when this element is hovering over another 
+     * DragDrop obj
+     * @method onDragOver
+     * @param {Event} e the mousemove event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this is hovering over.  In INTERSECT mode, an array of dd items 
+     * being hovered over.
+     */
+    onDragOver: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragOut event
+     * @method b4DragOut
+     * @private
+     */
+    b4DragOut: function(e) { },
+
+    /**
+     * Abstract method called when we are no longer hovering over an element
+     * @method onDragOut
+     * @param {Event} e the mousemove event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this was hovering over.  In INTERSECT mode, an array of dd items 
+     * that the mouse is no longer over.
+     */
+    onDragOut: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragDrop event
+     * @method b4DragDrop
+     * @private
+     */
+    b4DragDrop: function(e) { },
+
+    /**
+     * Abstract method called when this item is dropped on another DragDrop 
+     * obj
+     * @method onDragDrop
+     * @param {Event} e the mouseup event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this was dropped on.  In INTERSECT mode, an array of dd items this 
+     * was dropped on.
+     */
+    onDragDrop: function(e, id) { /* override this */ },
+
+    /**
+     * Abstract method called when this item is dropped on an area with no
+     * drop target
+     * @method onInvalidDrop
+     * @param {Event} e the mouseup event
+     */
+    onInvalidDrop: function(e) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the endDrag event
+     * @method b4EndDrag
+     * @private
+     */
+    b4EndDrag: function(e) { },
+
+    /**
+     * Fired when we are done dragging the object
+     * @method endDrag
+     * @param {Event} e the mouseup event
+     */
+    endDrag: function(e) { /* override this */ },
 
-        /**
-         * Fired after a registered DragDrop object gets the mousedown event.
-         * Sets up the events required to track the object being dragged
-         * @method handleMouseDown
-         * @param {Event} e the event
-         * @param oDD the DragDrop object being dragged
-         * @private
-         * @static
-         */
-        handleMouseDown: function(e, oDD) {
+    /**
+     * Code executed immediately before the onMouseDown event
+     * @method b4MouseDown
+     * @param {Event} e the mousedown event
+     * @private
+     */
+    b4MouseDown: function(e) {  },
 
-            this.currentTarget = YAHOO.util.Event.getTarget(e);
+    /**
+     * Event handler that fires when a drag/drop obj gets a mousedown
+     * @method onMouseDown
+     * @param {Event} e the mousedown event
+     */
+    onMouseDown: function(e) { /* override this */ },
 
-            this.dragCurrent = oDD;
+    /**
+     * Event handler that fires when a drag/drop obj gets a mouseup
+     * @method onMouseUp
+     * @param {Event} e the mouseup event
+     */
+    onMouseUp: function(e) { /* override this */ },
+   
+    /**
+     * Override the onAvailable method to do what is needed after the initial
+     * position was determined.
+     * @method onAvailable
+     */
+    onAvailable: function () { 
+    },
 
-            var el = oDD.getEl();
+    /**
+     * Returns a reference to the linked element
+     * @method getEl
+     * @return {HTMLElement} the html element 
+     */
+    getEl: function() { 
+        if (!this._domRef) {
+            this._domRef = Dom.get(this.id); 
+        }
 
-            // track start position
-            this.startX = YAHOO.util.Event.getPageX(e);
-            this.startY = YAHOO.util.Event.getPageY(e);
+        return this._domRef;
+    },
 
-            this.deltaX = this.startX - el.offsetLeft;
-            this.deltaY = this.startY - el.offsetTop;
+    /**
+     * Returns a reference to the actual element to drag.  By default this is
+     * the same as the html element, but it can be assigned to another 
+     * element. An example of this can be found in YAHOO.util.DDProxy
+     * @method getDragEl
+     * @return {HTMLElement} the html element 
+     */
+    getDragEl: function() {
+        return Dom.get(this.dragElId);
+    },
 
-            this.dragThreshMet = false;
+    /**
+     * Sets up the DragDrop object.  Must be called in the constructor of any
+     * YAHOO.util.DragDrop subclass
+     * @method init
+     * @param id the id of the linked element
+     * @param {String} sGroup the group of related items
+     * @param {object} config configuration attributes
+     */
+    init: function(id, sGroup, config) {
+        this.initTarget(id, sGroup, config);
+        Event.on(this._domRef || this.id, "mousedown", 
+                        this.handleMouseDown, this, true);
+        // Event.on(this.id, "selectstart", Event.preventDefault);
+    },
 
-            this.clickTimeout = setTimeout( 
-                    function() { 
-                        var DDM = YAHOO.util.DDM;
-                        DDM.startDrag(DDM.startX, DDM.startY); 
-                    }, 
-                    this.clickTimeThresh );
-        },
+    /**
+     * Initializes Targeting functionality only... the object does not
+     * get a mousedown handler.
+     * @method initTarget
+     * @param id the id of the linked element
+     * @param {String} sGroup the group of related items
+     * @param {object} config configuration attributes
+     */
+    initTarget: function(id, sGroup, config) {
 
-        /**
-         * Fired when either the drag pixel threshol or the mousedown hold 
-         * time threshold has been met.
-         * @method startDrag
-         * @param x {int} the X position of the original mousedown
-         * @param y {int} the Y position of the original mousedown
-         * @static
-         */
-        startDrag: function(x, y) {
-            clearTimeout(this.clickTimeout);
-            if (this.dragCurrent) {
-                this.dragCurrent.b4StartDrag(x, y);
-                this.dragCurrent.startDrag(x, y);
-            }
-            this.dragThreshMet = true;
-        },
+        // configuration attributes 
+        this.config = config || {};
 
-        /**
-         * Internal function to handle the mouseup event.  Will be invoked 
-         * from the context of the document.
-         * @method handleMouseUp
-         * @param {Event} e the event
-         * @private
-         * @static
-         */
-        handleMouseUp: function(e) {
+        // create a local reference to the drag and drop manager
+        this.DDM = YAHOO.util.DDM;
 
-            if (! this.dragCurrent) {
-                return;
-            }
+        // initialize the groups object
+        this.groups = {};
 
-            clearTimeout(this.clickTimeout);
+        // assume that we have an element reference instead of an id if the
+        // parameter is not a string
+        if (typeof id !== "string") {
+            this._domRef = id;
+            id = Dom.generateId(id);
+        }
 
-            if (this.dragThreshMet) {
-                this.fireEvents(e, true);
-            } else {
-            }
+        // set the id
+        this.id = id;
 
-            this.stopDrag(e);
+        // add to an interaction group
+        this.addToGroup((sGroup) ? sGroup : "default");
 
-            this.stopEvent(e);
-        },
+        // We don't want to register this as the handle with the manager
+        // so we just set the id rather than calling the setter.
+        this.handleElId = id;
 
-        /**
-         * Utility to stop event propagation and event default, if these 
-         * features are turned on.
-         * @method stopEvent
-         * @param {Event} e the event as returned by this.getEvent()
-         * @static
-         */
-        stopEvent: function(e) {
-            if (this.stopPropagation) {
-                YAHOO.util.Event.stopPropagation(e);
-            }
+        Event.onAvailable(id, this.handleOnAvailable, this, true);
 
-            if (this.preventDefault) {
-                YAHOO.util.Event.preventDefault(e);
-            }
-        },
 
-        /** 
-         * Internal function to clean up event handlers after the drag 
-         * operation is complete
-         * @method stopDrag
-         * @param {Event} e the event
-         * @private
-         * @static
-         */
-        stopDrag: function(e) {
+        // the linked element is the element that gets dragged by default
+        this.setDragElId(id); 
 
-            // Fire the drag end event for the item that was dragged
-            if (this.dragCurrent) {
-                if (this.dragThreshMet) {
-                    this.dragCurrent.b4EndDrag(e);
-                    this.dragCurrent.endDrag(e);
-                }
+        // by default, clicked anchors will not start drag operations. 
+        // @TODO what else should be here?  Probably form fields.
+        this.invalidHandleTypes = { A: "A" };
+        this.invalidHandleIds = {};
+        this.invalidHandleClasses = [];
 
-                this.dragCurrent.onMouseUp(e);
-            }
+        this.applyConfig();
+    },
 
-            this.dragCurrent = null;
-            this.dragOvers = {};
-        },
+    /**
+     * Applies the configuration parameters that were passed into the constructor.
+     * This is supposed to happen at each level through the inheritance chain.  So
+     * a DDProxy implentation will execute apply config on DDProxy, DD, and 
+     * DragDrop in order to get all of the parameters that are available in
+     * each object.
+     * @method applyConfig
+     */
+    applyConfig: function() {
 
-        /** 
-         * Internal function to handle the mousemove event.  Will be invoked 
-         * from the context of the html element.
-         *
-         * @TODO figure out what we can do about mouse events lost when the 
-         * user drags objects beyond the window boundary.  Currently we can 
-         * detect this in internet explorer by verifying that the mouse is 
-         * down during the mousemove event.  Firefox doesn't give us the 
-         * button state on the mousemove event.
-         * @method handleMouseMove
-         * @param {Event} e the event
-         * @private
-         * @static
-         */
-        handleMouseMove: function(e) {
-            if (! this.dragCurrent) {
-                return true;
-            }
+        // configurable properties: 
+        //    padding, isTarget, maintainOffset, primaryButtonOnly
+        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);
 
-            // var button = e.which || e.button;
+    },
 
-            // check for IE mouseup outside of page boundary
-            if (YAHOO.util.Event.isIE && !e.button) {
-                this.stopEvent(e);
-                return this.handleMouseUp(e);
-            }
+    /**
+     * Executed when the linked element is available
+     * @method handleOnAvailable
+     * @private
+     */
+    handleOnAvailable: function() {
+        this.available = true;
+        this.resetConstraints();
+        this.onAvailable();
+    },
+
+     /**
+     * Configures the padding for the target zone in px.  Effectively expands
+     * (or reduces) the virtual object size for targeting calculations.  
+     * Supports css-style shorthand; if only one parameter is passed, all sides
+     * will have that padding, and if only two are passed, the top and bottom
+     * will have the first param, the left and right the second.
+     * @method setPadding
+     * @param {int} iTop    Top pad
+     * @param {int} iRight  Right pad
+     * @param {int} iBot    Bot pad
+     * @param {int} iLeft   Left pad
+     */
+    setPadding: function(iTop, iRight, iBot, iLeft) {
+        // this.padding = [iLeft, iRight, iTop, iBot];
+        if (!iRight && 0 !== iRight) {
+            this.padding = [iTop, iTop, iTop, iTop];
+        } else if (!iBot && 0 !== iBot) {
+            this.padding = [iTop, iRight, iTop, iRight];
+        } else {
+            this.padding = [iTop, iRight, iBot, iLeft];
+        }
+    },
+
+    /**
+     * Stores the initial placement of the linked element.
+     * @method setInitialPosition
+     * @param {int} diffX   the X offset, default 0
+     * @param {int} diffY   the Y offset, default 0
+     * @private
+     */
+    setInitPosition: function(diffX, diffY) {
+        var el = this.getEl();
 
-            if (!this.dragThreshMet) {
-                var diffX = Math.abs(this.startX - YAHOO.util.Event.getPageX(e));
-                var diffY = Math.abs(this.startY - YAHOO.util.Event.getPageY(e));
-                if (diffX > this.clickPixelThresh || 
-                            diffY > this.clickPixelThresh) {
-                    this.startDrag(this.startX, this.startY);
-                }
-            }
+        if (!this.DDM.verifyEl(el)) {
+            return;
+        }
 
-            if (this.dragThreshMet) {
-                this.dragCurrent.b4Drag(e);
-                this.dragCurrent.onDrag(e);
-                this.fireEvents(e, false);
-            }
+        var dx = diffX || 0;
+        var dy = diffY || 0;
 
-            this.stopEvent(e);
+        var p = Dom.getXY( el );
 
-            return true;
-        },
+        this.initPageX = p[0] - dx;
+        this.initPageY = p[1] - dy;
 
-        /**
-         * Iterates over all of the DragDrop elements to find ones we are 
-         * hovering over or dropping on
-         * @method fireEvents
-         * @param {Event} e the event
-         * @param {boolean} isDrop is this a drop op or a mouseover op?
-         * @private
-         * @static
-         */
-        fireEvents: function(e, isDrop) {
-            var dc = this.dragCurrent;
+        this.lastPageX = p[0];
+        this.lastPageY = p[1];
 
-            // If the user did the mouse up outside of the window, we could 
-            // get here even though we have ended the drag.
-            if (!dc || dc.isLocked()) {
-                return;
-            }
 
-            var x = YAHOO.util.Event.getPageX(e);
-            var y = YAHOO.util.Event.getPageY(e);
-            var pt = new YAHOO.util.Point(x,y);
 
-            // cache the previous dragOver array
-            var oldOvers = [];
+        this.setStartPosition(p);
+    },
 
-            var outEvts   = [];
-            var overEvts  = [];
-            var dropEvts  = [];
-            var enterEvts = [];
+    /**
+     * Sets the start position of the element.  This is set when the obj
+     * is initialized, the reset when a drag is started.
+     * @method setStartPosition
+     * @param pos current position (from previous lookup)
+     * @private
+     */
+    setStartPosition: function(pos) {
+        var p = pos || Dom.getXY(this.getEl());
 
-            // Check to see if the object(s) we were hovering over is no longer 
-            // being hovered over so we can fire the onDragOut event
-            for (var i in this.dragOvers) {
+        this.deltaSetXY = null;
 
-                var ddo = this.dragOvers[i];
+        this.startPageX = p[0];
+        this.startPageY = p[1];
+    },
 
-                if (! this.isTypeOfDD(ddo)) {
-                    continue;
-                }
+    /**
+     * Add this instance to a group of related drag/drop objects.  All 
+     * instances belong to at least one group, and can belong to as many 
+     * groups as needed.
+     * @method addToGroup
+     * @param sGroup {string} the name of the group
+     */
+    addToGroup: function(sGroup) {
+        this.groups[sGroup] = true;
+        this.DDM.regDragDrop(this, sGroup);
+    },
 
-                if (! this.isOverTarget(pt, ddo, this.mode)) {
-                    outEvts.push( ddo );
-                }
+    /**
+     * Remove's this instance from the supplied interaction group
+     * @method removeFromGroup
+     * @param {string}  sGroup  The group to drop
+     */
+    removeFromGroup: function(sGroup) {
+        if (this.groups[sGroup]) {
+            delete this.groups[sGroup];
+        }
 
-                oldOvers[i] = true;
-                delete this.dragOvers[i];
-            }
+        this.DDM.removeDDFromGroup(this, sGroup);
+    },
 
-            for (var sGroup in dc.groups) {
-                
-                if ("string" != typeof sGroup) {
-                    continue;
-                }
+    /**
+     * Allows you to specify that an element other than the linked element 
+     * will be moved with the cursor during a drag
+     * @method setDragElId
+     * @param id {string} the id of the element that will be used to initiate the drag
+     */
+    setDragElId: function(id) {
+        this.dragElId = id;
+    },
 
-                for (i in this.ids[sGroup]) {
-                    var oDD = this.ids[sGroup][i];
-                    if (! this.isTypeOfDD(oDD)) {
-                        continue;
-                    }
+    /**
+     * Allows you to specify a child of the linked element that should be 
+     * used to initiate the drag operation.  An example of this would be if 
+     * you have a content div with text and links.  Clicking anywhere in the 
+     * content area would normally start the drag operation.  Use this method
+     * to specify that an element inside of the content div is the element 
+     * that starts the drag operation.
+     * @method setHandleElId
+     * @param id {string} the id of the element that will be used to 
+     * initiate the drag.
+     */
+    setHandleElId: function(id) {
+        if (typeof id !== "string") {
+            id = Dom.generateId(id);
+        }
+        this.handleElId = id;
+        this.DDM.regHandle(this.id, id);
+    },
 
-                    if (oDD.isTarget && !oDD.isLocked() && oDD != dc) {
-                        if (this.isOverTarget(pt, oDD, this.mode)) {
-                            // look for drop interactions
-                            if (isDrop) {
-                                dropEvts.push( oDD );
-                            // look for drag enter and drag over interactions
-                            } else {
+    /**
+     * Allows you to set an element outside of the linked element as a drag 
+     * handle
+     * @method setOuterHandleElId
+     * @param id the id of the element that will be used to initiate the drag
+     */
+    setOuterHandleElId: function(id) {
+        if (typeof id !== "string") {
+            id = Dom.generateId(id);
+        }
+        Event.on(id, "mousedown", 
+                this.handleMouseDown, this, true);
+        this.setHandleElId(id);
 
-                                // initial drag over: dragEnter fires
-                                if (!oldOvers[oDD.id]) {
-                                    enterEvts.push( oDD );
-                                // subsequent drag overs: dragOver fires
-                                } else {
-                                    overEvts.push( oDD );
-                                }
+        this.hasOuterHandles = true;
+    },
 
-                                this.dragOvers[oDD.id] = oDD;
-                            }
-                        }
-                    }
-                }
-            }
+    /**
+     * Remove all drag and drop hooks for this element
+     * @method unreg
+     */
+    unreg: function() {
+        Event.removeListener(this.id, "mousedown", 
+                this.handleMouseDown);
+        this._domRef = null;
+        this.DDM._remove(this);
+    },
 
-            if (this.mode) {
-                if (outEvts.length) {
-                    dc.b4DragOut(e, outEvts);
-                    dc.onDragOut(e, outEvts);
-                }
+    /**
+     * Returns true if this instance is locked, or the drag drop mgr is locked
+     * (meaning that all drag/drop is disabled on the page.)
+     * @method isLocked
+     * @return {boolean} true if this obj or all drag/drop is locked, else 
+     * false
+     */
+    isLocked: function() {
+        return (this.DDM.isLocked() || this.locked);
+    },
 
-                if (enterEvts.length) {
-                    dc.onDragEnter(e, enterEvts);
-                }
+    /**
+     * Fired when this object is clicked
+     * @method handleMouseDown
+     * @param {Event} e 
+     * @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj)
+     * @private
+     */
+    handleMouseDown: function(e, oDD) {
 
-                if (overEvts.length) {
-                    dc.b4DragOver(e, overEvts);
-                    dc.onDragOver(e, overEvts);
-                }
+        var button = e.which || e.button;
 
-                if (dropEvts.length) {
-                    dc.b4DragDrop(e, dropEvts);
-                    dc.onDragDrop(e, dropEvts);
-                }
+        if (this.primaryButtonOnly && button > 1) {
+            return;
+        }
 
-            } else {
-                // fire dragout events
-                var len = 0;
-                for (i=0, len=outEvts.length; i<len; ++i) {
-                    dc.b4DragOut(e, outEvts[i].id);
-                    dc.onDragOut(e, outEvts[i].id);
-                }
-                 
-                // fire enter events
-                for (i=0,len=enterEvts.length; i<len; ++i) {
-                    // dc.b4DragEnter(e, oDD.id);
-                    dc.onDragEnter(e, enterEvts[i].id);
-                }
-         
-                // fire over events
-                for (i=0,len=overEvts.length; i<len; ++i) {
-                    dc.b4DragOver(e, overEvts[i].id);
-                    dc.onDragOver(e, overEvts[i].id);
-                }
+        if (this.isLocked()) {
+            return;
+        }
 
-                // fire drop events
-                for (i=0, len=dropEvts.length; i<len; ++i) {
-                    dc.b4DragDrop(e, dropEvts[i].id);
-                    dc.onDragDrop(e, dropEvts[i].id);
-                }
 
-            }
 
-            // notify about a drop that did not find a target
-            if (isDrop && !dropEvts.length) {
-                dc.onInvalidDrop(e);
-            }
+        // firing the mousedown events prior to calculating positions
+        this.b4MouseDown(e);
+        this.onMouseDown(e);
 
-        },
+        this.DDM.refreshCache(this.groups);
+        // var self = this;
+        // setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0);
 
-        /**
-         * Helper function for getting the best match from the list of drag 
-         * and drop objects returned by the drag and drop events when we are 
-         * in INTERSECT mode.  It returns either the first object that the 
-         * cursor is over, or the object that has the greatest overlap with 
-         * the dragged element.
-         * @method getBestMatch
-         * @param  {DragDrop[]} dds The array of drag and drop objects 
-         * targeted
-         * @return {DragDrop}       The best single match
-         * @static
-         */
-        getBestMatch: function(dds) {
-            var winner = null;
+        // Only process the event if we really clicked within the linked 
+        // element.  The reason we make this check is that in the case that 
+        // another element was moved between the clicked element and the 
+        // cursor in the time between the mousedown and mouseup events. When 
+        // this happens, the element gets the next mousedown event 
+        // regardless of where on the screen it happened.  
+        var pt = new YAHOO.util.Point(Event.getPageX(e), Event.getPageY(e));
+        if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) )  {
+        } else {
+            if (this.clickValidator(e)) {
 
-            var len = dds.length;
 
-            if (len == 1) {
-                winner = dds[0];
+                // set the initial element position
+                this.setStartPosition();
+
+                // start tracking mousemove distance and mousedown time to
+                // determine when to start the actual drag
+                this.DDM.handleMouseDown(e, this);
+
+                // this mousedown is mine
+                this.DDM.stopEvent(e);
             } else {
-                // Loop through the targeted items
-                for (var i=0; i<len; ++i) {
-                    var dd = dds[i];
-                    // If the cursor is over the object, it wins.  If the 
-                    // cursor is over multiple matches, the first one we come
-                    // to wins.
-                    if (this.mode == this.INTERSECT && dd.cursorIsOver) {
-                        winner = dd;
-                        break;
-                    // Otherwise the object with the most overlap wins
-                    } else {
-                        if (!winner || !winner.overlap || (dd.overlap &&
-                            winner.overlap.getArea() < dd.overlap.getArea())) {
-                            winner = dd;
-                        }
-                    }
-                }
+
+
             }
+        }
+    },
 
-            return winner;
-        },
+    clickValidator: function(e) {
+        var target = Event.getTarget(e);
+        return ( this.isValidHandleChild(target) &&
+                    (this.id == this.handleElId || 
+                        this.DDM.handleWasClicked(target, this.id)) );
+    },
 
-        /**
-         * Refreshes the cache of the top-left and bottom-right points of the 
-         * drag and drop objects in the specified group(s).  This is in the
-         * format that is stored in the drag and drop instance, so typical 
-         * usage is:
-         * <code>
-         * YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups);
-         * </code>
-         * Alternatively:
-         * <code>
-         * YAHOO.util.DragDropMgr.refreshCache({group1:true, group2:true});
-         * </code>
-         * @TODO this really should be an indexed array.  Alternatively this
-         * method could accept both.
-         * @method refreshCache
-         * @param {Object} groups an associative array of groups to refresh
-         * @static
-         */
-        refreshCache: function(groups) {
-            for (var sGroup in groups) {
-                if ("string" != typeof sGroup) {
-                    continue;
-                }
-                for (var i in this.ids[sGroup]) {
-                    var oDD = this.ids[sGroup][i];
+    /**
+     * Finds the location the element should be placed if we want to move
+     * it to where the mouse location less the click offset would place us.
+     * @method getTargetCoord
+     * @param {int} iPageX the X coordinate of the click
+     * @param {int} iPageY the Y coordinate of the click
+     * @return an object that contains the coordinates (Object.x and Object.y)
+     * @private
+     */
+    getTargetCoord: function(iPageX, iPageY) {
 
-                    if (this.isTypeOfDD(oDD)) {
-                    // if (this.isTypeOfDD(oDD) && oDD.isTarget) {
-                        var loc = this.getLocation(oDD);
-                        if (loc) {
-                            this.locationCache[oDD.id] = loc;
-                        } else {
-                            delete this.locationCache[oDD.id];
-                            // this will unregister the drag and drop object if
-                            // the element is not in a usable state
-                            // oDD.unreg();
-                        }
-                    }
-                }
-            }
-        },
 
-        /**
-         * This checks to make sure an element exists and is in the DOM.  The
-         * main purpose is to handle cases where innerHTML is used to remove
-         * drag and drop objects from the DOM.  IE provides an 'unspecified
-         * error' when trying to access the offsetParent of such an element
-         * @method verifyEl
-         * @param {HTMLElement} el the element to check
-         * @return {boolean} true if the element looks usable
-         * @static
-         */
-        verifyEl: function(el) {
-            try {
-                if (el) {
-                    var parent = el.offsetParent;
-                    if (parent) {
-                        return true;
-                    }
-                }
-            } catch(e) {
-            }
+        var x = iPageX - this.deltaX;
+        var y = iPageY - this.deltaY;
 
-            return false;
-        },
-        
-        /**
-         * Returns a Region object containing the drag and drop element's position
-         * and size, including the padding configured for it
-         * @method getLocation
-         * @param {DragDrop} oDD the drag and drop object to get the 
-         *                       location for
-         * @return {YAHOO.util.Region} a Region object representing the total area
-         *                             the element occupies, including any padding
-         *                             the instance is configured for.
-         * @static
-         */
-        getLocation: function(oDD) {
-            if (! this.isTypeOfDD(oDD)) {
-                return null;
-            }
+        if (this.constrainX) {
+            if (x < this.minX) { x = this.minX; }
+            if (x > this.maxX) { x = this.maxX; }
+        }
 
-            var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;
+        if (this.constrainY) {
+            if (y < this.minY) { y = this.minY; }
+            if (y > this.maxY) { y = this.maxY; }
+        }
 
-            try {
-                pos= YAHOO.util.Dom.getXY(el);
-            } catch (e) { }
+        x = this.getTick(x, this.xTicks);
+        y = this.getTick(y, this.yTicks);
 
-            if (!pos) {
-                return null;
-            }
 
-            x1 = pos[0];
-            x2 = x1 + el.offsetWidth;
-            y1 = pos[1];
-            y2 = y1 + el.offsetHeight;
+        return {x:x, y:y};
+    },
 
-            t = y1 - oDD.padding[0];
-            r = x2 + oDD.padding[1];
-            b = y2 + oDD.padding[2];
-            l = x1 - oDD.padding[3];
+    /**
+     * Allows you to specify a tag name that should not start a drag operation
+     * when clicked.  This is designed to facilitate embedding links within a
+     * drag handle that do something other than start the drag.
+     * @method addInvalidHandleType
+     * @param {string} tagName the type of element to exclude
+     */
+    addInvalidHandleType: function(tagName) {
+        var type = tagName.toUpperCase();
+        this.invalidHandleTypes[type] = type;
+    },
 
-            return new YAHOO.util.Region( t, r, b, l );
-        },
+    /**
+     * Lets you to specify an element id for a child of a drag handle
+     * that should not initiate a drag
+     * @method addInvalidHandleId
+     * @param {string} id the element id of the element you wish to ignore
+     */
+    addInvalidHandleId: function(id) {
+        if (typeof id !== "string") {
+            id = Dom.generateId(id);
+        }
+        this.invalidHandleIds[id] = id;
+    },
 
-        /**
-         * Checks the cursor location to see if it over the target
-         * @method isOverTarget
-         * @param {YAHOO.util.Point} pt The point to evaluate
-         * @param {DragDrop} oTarget the DragDrop object we are inspecting
-         * @return {boolean} true if the mouse is over the target
-         * @private
-         * @static
-         */
-        isOverTarget: function(pt, oTarget, intersect) {
-            // use cache if available
-            var loc = this.locationCache[oTarget.id];
-            if (!loc || !this.useCache) {
-                loc = this.getLocation(oTarget);
-                this.locationCache[oTarget.id] = loc;
 
-            }
+    /**
+     * Lets you specify a css class of elements that will not initiate a drag
+     * @method addInvalidHandleClass
+     * @param {string} cssClass the class of the elements you wish to ignore
+     */
+    addInvalidHandleClass: function(cssClass) {
+        this.invalidHandleClasses.push(cssClass);
+    },
 
-            if (!loc) {
-                return false;
+    /**
+     * Unsets an excluded tag name set by addInvalidHandleType
+     * @method removeInvalidHandleType
+     * @param {string} tagName the type of element to unexclude
+     */
+    removeInvalidHandleType: function(tagName) {
+        var type = tagName.toUpperCase();
+        // this.invalidHandleTypes[type] = null;
+        delete this.invalidHandleTypes[type];
+    },
+    
+    /**
+     * Unsets an invalid handle id
+     * @method removeInvalidHandleId
+     * @param {string} id the id of the element to re-enable
+     */
+    removeInvalidHandleId: function(id) {
+        if (typeof id !== "string") {
+            id = Dom.generateId(id);
+        }
+        delete this.invalidHandleIds[id];
+    },
+
+    /**
+     * Unsets an invalid css class
+     * @method removeInvalidHandleClass
+     * @param {string} cssClass the class of the element(s) you wish to 
+     * re-enable
+     */
+    removeInvalidHandleClass: function(cssClass) {
+        for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) {
+            if (this.invalidHandleClasses[i] == cssClass) {
+                delete this.invalidHandleClasses[i];
             }
+        }
+    },
 
-            oTarget.cursorIsOver = loc.contains( pt );
+    /**
+     * Checks the tag exclusion list to see if this click should be ignored
+     * @method isValidHandleChild
+     * @param {HTMLElement} node the HTMLElement to evaluate
+     * @return {boolean} true if this is a valid tag type, false if not
+     */
+    isValidHandleChild: function(node) {
+
+        var valid = true;
+        // var n = (node.nodeName == "#text") ? node.parentNode : node;
+        var nodeName;
+        try {
+            nodeName = node.nodeName.toUpperCase();
+        } catch(e) {
+            nodeName = node.nodeName;
+        }
+        valid = valid && !this.invalidHandleTypes[nodeName];
+        valid = valid && !this.invalidHandleIds[node.id];
 
-            // DragDrop is using this as a sanity check for the initial mousedown
-            // in this case we are done.  In POINT mode, if the drag obj has no
-            // contraints, we are also done. Otherwise we need to evaluate the 
-            // location of the target as related to the actual location of the
-            // dragged element.
-            var dc = this.dragCurrent;
-            if (!dc || !dc.getTargetCoord || 
-                    (!intersect && !dc.constrainX && !dc.constrainY)) {
-                return oTarget.cursorIsOver;
-            }
+        for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {
+            valid = !Dom.hasClass(node, this.invalidHandleClasses[i]);
+        }
 
-            oTarget.overlap = null;
 
-            // Get the current location of the drag element, this is the
-            // location of the mouse event less the delta that represents
-            // where the original mousedown happened on the element.  We
-            // need to consider constraints and ticks as well.
-            var pos = dc.getTargetCoord(pt.x, pt.y);
+        return valid;
 
-            var el = dc.getDragEl();
-            var curRegion = new YAHOO.util.Region( pos.y, 
-                                                   pos.x + el.offsetWidth,
-                                                   pos.y + el.offsetHeight, 
-                                                   pos.x );
+    },
 
-            var overlap = curRegion.intersect(loc);
+    /**
+     * Create the array of horizontal tick marks if an interval was specified
+     * in setXConstraint().
+     * @method setXTicks
+     * @private
+     */
+    setXTicks: function(iStartX, iTickSize) {
+        this.xTicks = [];
+        this.xTickSize = iTickSize;
+        
+        var tickMap = {};
 
-            if (overlap) {
-                oTarget.overlap = overlap;
-                return (intersect) ? true : oTarget.cursorIsOver;
-            } else {
-                return false;
+        for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {
+            if (!tickMap[i]) {
+                this.xTicks[this.xTicks.length] = i;
+                tickMap[i] = true;
             }
-        },
+        }
 
-        /**
-         * unload event handler
-         * @method _onUnload
-         * @private
-         * @static
-         */
-        _onUnload: function(e, me) {
-            this.unregAll();
-        },
+        for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) {
+            if (!tickMap[i]) {
+                this.xTicks[this.xTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
 
-        /**
-         * Cleans up the drag and drop events and objects.
-         * @method unregAll
-         * @private
-         * @static
-         */
-        unregAll: function() {
+        this.xTicks.sort(this.DDM.numericSort) ;
+    },
 
-            if (this.dragCurrent) {
-                this.stopDrag();
-                this.dragCurrent = null;
-            }
+    /**
+     * Create the array of vertical tick marks if an interval was specified in 
+     * setYConstraint().
+     * @method setYTicks
+     * @private
+     */
+    setYTicks: function(iStartY, iTickSize) {
+        this.yTicks = [];
+        this.yTickSize = iTickSize;
 
-            this._execOnAll("unreg", []);
+        var tickMap = {};
 
-            for (i in this.elementCache) {
-                delete this.elementCache[i];
+        for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) {
+            if (!tickMap[i]) {
+                this.yTicks[this.yTicks.length] = i;
+                tickMap[i] = true;
             }
+        }
 
-            this.elementCache = {};
-            this.ids = {};
-        },
-
-        /**
-         * A cache of DOM elements
-         * @property elementCache
-         * @private
-         * @static
-         */
-        elementCache: {},
-        
-        /**
-         * Get the wrapper for the DOM element specified
-         * @method getElWrapper
-         * @param {String} id the id of the element to get
-         * @return {YAHOO.util.DDM.ElementWrapper} the wrapped element
-         * @private
-         * @deprecated This wrapper isn't that useful
-         * @static
-         */
-        getElWrapper: function(id) {
-            var oWrapper = this.elementCache[id];
-            if (!oWrapper || !oWrapper.el) {
-                oWrapper = this.elementCache[id] = 
-                    new this.ElementWrapper(YAHOO.util.Dom.get(id));
+        for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) {
+            if (!tickMap[i]) {
+                this.yTicks[this.yTicks.length] = i;
+                tickMap[i] = true;
             }
-            return oWrapper;
-        },
+        }
 
-        /**
-         * Returns the actual DOM element
-         * @method getElement
-         * @param {String} id the id of the elment to get
-         * @return {Object} The element
-         * @deprecated use YAHOO.util.Dom.get instead
-         * @static
-         */
-        getElement: function(id) {
-            return YAHOO.util.Dom.get(id);
-        },
-        
-        /**
-         * Returns the style property for the DOM element (i.e., 
-         * document.getElById(id).style)
-         * @method getCss
-         * @param {String} id the id of the elment to get
-         * @return {Object} The style property of the element
-         * @deprecated use YAHOO.util.Dom instead
-         * @static
-         */
-        getCss: function(id) {
-            var el = YAHOO.util.Dom.get(id);
-            return (el) ? el.style : null;
-        },
+        this.yTicks.sort(this.DDM.numericSort) ;
+    },
 
-        /**
-         * Inner class for cached elements
-         * @class DragDropMgr.ElementWrapper
-         * @for DragDropMgr
-         * @private
-         * @deprecated
-         */
-        ElementWrapper: function(el) {
-                /**
-                 * The element
-                 * @property el
-                 */
-                this.el = el || null;
-                /**
-                 * The element id
-                 * @property id
-                 */
-                this.id = this.el && el.id;
-                /**
-                 * A reference to the style property
-                 * @property css
-                 */
-                this.css = this.el && el.style;
-            },
+    /**
+     * By default, the element can be dragged any place on the screen.  Use 
+     * this method to limit the horizontal travel of the element.  Pass in 
+     * 0,0 for the parameters if you want to lock the drag to the y axis.
+     * @method setXConstraint
+     * @param {int} iLeft the number of pixels the element can move to the left
+     * @param {int} iRight the number of pixels the element can move to the 
+     * right
+     * @param {int} iTickSize optional parameter for specifying that the 
+     * element
+     * should move iTickSize pixels at a time.
+     */
+    setXConstraint: function(iLeft, iRight, iTickSize) {
+        this.leftConstraint = parseInt(iLeft, 10);
+        this.rightConstraint = parseInt(iRight, 10);
 
-        /**
-         * Returns the X position of an html element
-         * @method getPosX
-         * @param el the element for which to get the position
-         * @return {int} the X coordinate
-         * @for DragDropMgr
-         * @deprecated use YAHOO.util.Dom.getX instead
-         * @static
-         */
-        getPosX: function(el) {
-            return YAHOO.util.Dom.getX(el);
-        },
+        this.minX = this.initPageX - this.leftConstraint;
+        this.maxX = this.initPageX + this.rightConstraint;
+        if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }
 
-        /**
-         * Returns the Y position of an html element
-         * @method getPosY
-         * @param el the element for which to get the position
-         * @return {int} the Y coordinate
-         * @deprecated use YAHOO.util.Dom.getY instead
-         * @static
-         */
-        getPosY: function(el) {
-            return YAHOO.util.Dom.getY(el); 
-        },
+        this.constrainX = true;
+    },
 
-        /**
-         * Swap two nodes.  In IE, we use the native method, for others we 
-         * emulate the IE behavior
-         * @method swapNode
-         * @param n1 the first node to swap
-         * @param n2 the other node to swap
-         * @static
-         */
-        swapNode: function(n1, n2) {
-            if (n1.swapNode) {
-                n1.swapNode(n2);
-            } else {
-                var p = n2.parentNode;
-                var s = n2.nextSibling;
+    /**
+     * Clears any constraints applied to this instance.  Also clears ticks
+     * since they can't exist independent of a constraint at this time.
+     * @method clearConstraints
+     */
+    clearConstraints: function() {
+        this.constrainX = false;
+        this.constrainY = false;
+        this.clearTicks();
+    },
 
-                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);
-                }
-            }
-        },
+    /**
+     * Clears any tick interval defined for this instance
+     * @method clearTicks
+     */
+    clearTicks: function() {
+        this.xTicks = null;
+        this.yTicks = null;
+        this.xTickSize = 0;
+        this.yTickSize = 0;
+    },
 
-        /**
-         * Returns the current scroll position
-         * @method getScroll
-         * @private
-         * @static
-         */
-        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 };
-        },
+    /**
+     * By default, the element can be dragged any place on the screen.  Set 
+     * this to limit the vertical travel of the element.  Pass in 0,0 for the
+     * parameters if you want to lock the drag to the x axis.
+     * @method setYConstraint
+     * @param {int} iUp the number of pixels the element can move up
+     * @param {int} iDown the number of pixels the element can move down
+     * @param {int} iTickSize optional parameter for specifying that the 
+     * element should move iTickSize pixels at a time.
+     */
+    setYConstraint: function(iUp, iDown, iTickSize) {
+        this.topConstraint = parseInt(iUp, 10);
+        this.bottomConstraint = parseInt(iDown, 10);
 
-        /**
-         * Returns the specified element style property
-         * @method getStyle
-         * @param {HTMLElement} el          the element
-         * @param {string}      styleProp   the style property
-         * @return {string} The value of the style property
-         * @deprecated use YAHOO.util.Dom.getStyle
-         * @static
-         */
-        getStyle: function(el, styleProp) {
-            return YAHOO.util.Dom.getStyle(el, styleProp);
-        },
+        this.minY = this.initPageY - this.topConstraint;
+        this.maxY = this.initPageY + this.bottomConstraint;
+        if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }
 
-        /**
-         * Gets the scrollTop
-         * @method getScrollTop
-         * @return {int} the document's scrollTop
-         * @static
-         */
-        getScrollTop: function () { return this.getScroll().top; },
+        this.constrainY = true;
+        
+    },
 
-        /**
-         * Gets the scrollLeft
-         * @method getScrollLeft
-         * @return {int} the document's scrollTop
-         * @static
-         */
-        getScrollLeft: function () { return this.getScroll().left; },
+    /**
+     * resetConstraints must be called if you manually reposition a dd element.
+     * @method resetConstraints
+     */
+    resetConstraints: function() {
 
-        /**
-         * Sets the x/y position of an element to the location of the
-         * target element.
-         * @method moveToEl
-         * @param {HTMLElement} moveEl      The element to move
-         * @param {HTMLElement} targetEl    The position reference element
-         * @static
-         */
-        moveToEl: function (moveEl, targetEl) {
-            var aCoord = YAHOO.util.Dom.getXY(targetEl);
-            YAHOO.util.Dom.setXY(moveEl, aCoord);
-        },
 
-        /**
-         * Gets the client height
-         * @method getClientHeight
-         * @return {int} client height in px
-         * @deprecated use YAHOO.util.Dom.getViewportHeight instead
-         * @static
-         */
-        getClientHeight: function() {
-            return YAHOO.util.Dom.getViewportHeight();
-        },
+        // Maintain offsets if necessary
+        if (this.initPageX || this.initPageX === 0) {
+            // figure out how much this thing has moved
+            var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0;
+            var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0;
 
-        /**
-         * Gets the client width
-         * @method getClientWidth
-         * @return {int} client width in px
-         * @deprecated use YAHOO.util.Dom.getViewportWidth instead
-         * @static
-         */
-        getClientWidth: function() {
-            return YAHOO.util.Dom.getViewportWidth();
-        },
+            this.setInitPosition(dx, dy);
 
-        /**
-         * Numeric array sort function
-         * @method numericSort
-         * @static
-         */
-        numericSort: function(a, b) { return (a - b); },
+        // This is the first time we have detected the element's position
+        } else {
+            this.setInitPosition();
+        }
 
-        /**
-         * Internal counter
-         * @property _timeoutCount
-         * @private
-         * @static
-         */
-        _timeoutCount: 0,
+        if (this.constrainX) {
+            this.setXConstraint( this.leftConstraint, 
+                                 this.rightConstraint, 
+                                 this.xTickSize        );
+        }
 
-        /**
-         * Trying to make the load order less important.  Without this we get
-         * an error if this file is loaded before the Event Utility.
-         * @method _addListeners
-         * @private
-         * @static
-         */
-        _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;
-                    }
-                }
-            }
-        },
+        if (this.constrainY) {
+            this.setYConstraint( this.topConstraint, 
+                                 this.bottomConstraint, 
+                                 this.yTickSize         );
+        }
+    },
 
-        /**
-         * Recursively searches the immediate parent and all child nodes for 
-         * the handle element in order to determine wheter or not it was 
-         * clicked.
-         * @method handleWasClicked
-         * @param node the html element to inspect
-         * @static
-         */
-        handleWasClicked: function(node, id) {
-            if (this.isHandle(id, node.id)) {
-                return true;
-            } else {
-                // check to see if this is a text node child of the one we want
-                var p = node.parentNode;
+    /**
+     * Normally the drag element is moved pixel by pixel, but we can specify 
+     * that it move a number of pixels at a time.  This method resolves the 
+     * location when we have it set up like this.
+     * @method getTick
+     * @param {int} val where we want to place the object
+     * @param {int[]} tickArray sorted array of valid points
+     * @return {int} the closest tick
+     * @private
+     */
+    getTick: function(val, tickArray) {
 
-                while (p) {
-                    if (this.isHandle(id, p.id)) {
-                        return true;
-                    } else {
-                        p = p.parentNode;
-                    }
+        if (!tickArray) {
+            // If tick interval is not defined, it is effectively 1 pixel, 
+            // so we return the value passed to us.
+            return val; 
+        } else if (tickArray[0] >= val) {
+            // The value is lower than the first tick, so we return the first
+            // tick.
+            return tickArray[0];
+        } else {
+            for (var i=0, len=tickArray.length; i<len; ++i) {
+                var next = i + 1;
+                if (tickArray[next] && tickArray[next] >= val) {
+                    var diff1 = val - tickArray[i];
+                    var diff2 = tickArray[next] - val;
+                    return (diff2 > diff1) ? tickArray[i] : tickArray[next];
                 }
             }
 
-            return false;
+            // The value is larger than the last tick, so we return the last
+            // tick.
+            return tickArray[tickArray.length - 1];
         }
+    },
 
-    };
-
-}();
-
-// shorter alias, save a few bytes
-YAHOO.util.DDM = YAHOO.util.DragDropMgr;
-YAHOO.util.DDM._addListeners();
+    /**
+     * toString method
+     * @method toString
+     * @return {string} string representation of the dd obj
+     */
+    toString: function() {
+        return ("DragDrop " + this.id);
+    }
 
-}
+};
 
+})();
 /**
  * A DragDrop implementation where the linked element follows the 
  * mouse cursor during a drag.
@@ -2617,38 +2780,6 @@ YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, {
         }
     },
 
-    /**
-     * Finds the location the element should be placed if we want to move
-     * it to where the mouse location less the click offset would place us.
-     * @method getTargetCoord
-     * @param {int} iPageX the X coordinate of the click
-     * @param {int} iPageY the Y coordinate of the click
-     * @return an object that contains the coordinates (Object.x and Object.y)
-     * @private
-     */
-    getTargetCoord: function(iPageX, iPageY) {
-
-
-        var x = iPageX - this.deltaX;
-        var y = iPageY - this.deltaY;
-
-        if (this.constrainX) {
-            if (x < this.minX) { x = this.minX; }
-            if (x > this.maxX) { x = this.maxX; }
-        }
-
-        if (this.constrainY) {
-            if (y < this.minY) { y = this.minY; }
-            if (y > this.maxY) { y = this.maxY; }
-        }
-
-        x = this.getTick(x, this.xTicks);
-        y = this.getTick(y, this.yTicks);
-
-
-        return {x:x, y:y};
-    },
-
     /*
      * Sets up config options specific to this class. Overrides
      * YAHOO.util.DragDrop, but all versions of this method through the 
@@ -2664,6 +2795,7 @@ YAHOO.extend(YAHOO.util.DD, YAHOO.util.DragDrop, {
      * YAHOO.util.DragDrop.
      */
     b4MouseDown: function(e) {
+        this.setStartPosition();
         // this.resetConstraints();
         this.autoOffset(YAHOO.util.Event.getPageX(e), 
                             YAHOO.util.Event.getPageY(e));
@@ -2770,15 +2902,14 @@ YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {
      * @method createFrame
      */
     createFrame: function() {
-        var self = this;
-        var body = document.body;
+        var self=this, body=document.body;
 
         if (!body || !body.firstChild) {
             setTimeout( function() { self.createFrame(); }, 50 );
             return;
         }
 
-        var div = this.getDragEl();
+        var div=this.getDragEl(), Dom=YAHOO.util.Dom;
 
         if (!div) {
             div    = document.createElement("div");
@@ -2790,6 +2921,21 @@ YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {
             s.cursor     = "move";
             s.border     = "2px solid #aaa";
             s.zIndex     = 999;
+            s.height     = "25px";
+            s.width      = "25px";
+
+            var _data = document.createElement('div');
+            Dom.setStyle(_data, 'height', '100%');
+            Dom.setStyle(_data, 'width', '100%');
+            /**
+            * If the proxy element has no background-color, then it is considered to the "transparent" by Internet Explorer.
+            * Since it is "transparent" then the events pass through it to the iframe below.
+            * So creating a "fake" div inside the proxy element and giving it a background-color, then setting it to an
+            * opacity of 0, it appears to not be there, however IE still thinks that it is so the events never pass through.
+            */
+            Dom.setStyle(_data, 'background-color', '#ccc');
+            Dom.setStyle(_data, 'opacity', '0');
+            div.appendChild(_data);
 
             // appendChild can blow up IE if invoked prior to the window load event
             // while rendering a table.  It is possible there are other scenarios 
@@ -2874,10 +3020,14 @@ YAHOO.extend(YAHOO.util.DDProxy, YAHOO.util.DD, {
 
     // overrides YAHOO.util.DragDrop
     b4MouseDown: function(e) {
+        this.setStartPosition();
         var x = YAHOO.util.Event.getPageX(e);
         var y = YAHOO.util.Event.getPageY(e);
         this.autoOffset(x, y);
-        this.setDragElPos(x, y);
+
+        // This causes the autoscroll code to kick off, which means autoscroll can
+        // happen prior to the check for a valid drag handle.
+        // this.setDragElPos(x, y);
     },
 
     // overrides YAHOO.util.DragDrop
@@ -2946,3 +3096,4 @@ YAHOO.extend(YAHOO.util.DDTarget, YAHOO.util.DragDrop, {
         return ("DDTarget " + this.id);
     }
 });
+YAHOO.register("dragdrop", YAHOO.util.DragDropMgr, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/editor/README b/lib/yui/editor/README
new file mode 100755 (executable)
index 0000000..2190c19
--- /dev/null
@@ -0,0 +1,68 @@
+**** version 2.3.0 ***
+
+* Beta release.
+
+* Known Issues
+    * All
+        1. Removed the menu for Create Ordered Lists, it now defaults to creating a simple OL with no type.
+     
+    * Safari
+        1. Bug #1390926 - Safari may not inject the editor's HTML into the text area when the config handleSubmit is set to true.
+            You can get around this with the following code (where comment is the id of the textarea):
+                YAHOO.util.Dom.setStyle('comment', 'visibility', 'hidden');
+                YAHOO.util.Dom.setStyle('comment', 'position', 'absolute');
+                YAHOO.util.Dom.setStyle('comment', 'display', 'block');
+                oEditor.saveHTML();
+                window.setTimeout(function() {
+                        YAHOO.util.Dom.get('comment').form.submit();
+                }, 200);
+
+            This issue will be fixed in a later release..
+        2. Unable to get the cursor position inside the editable area.
+            What this means is that when an image/object is inserted into the document
+            we have no way of knowing "exactly" where to put it. So we make an educated guess.
+            If they user clicked on an "element" (HTML Element) in the editor, then we will place
+            the newly inserted element directly after it in the DOM. If there was no element clicked
+            We will append the new element to the body.
+
+        3. Ordered/Unorder Lists are not support natively. So we have built a work around for this.
+            Most browsers will allow you to select a block of text and create a list out of it "automagically"
+            by inserting an LI around blocks that are separated by line breaks, BRs or Ps. In Safari, the 
+            entire text block will be turned into the first LI of the list. The user can then place the cursor
+            at the beginning of each line, and backspace, then hit enter to create the new list item. There are some
+            use cases that this might fail.
+
+        4. Dragging and dropping of selections and images/objects is not supported.
+            Safari will do some weird things if the text in the editable area is selected and dragged and dropped.
+            We prevent this from happening to images inside of the editable area, but we can not prevent it for text.
+            Safari will also give unexpected results if text from another Safari window in selected, then dragged
+            into the editable area.
+
+    * Opera
+        1. Placing the cursor in the editor, then Shift Clicking to highlight will not work. The limitation appear to be in Opera.
+
+        2. Image resize is unavailable, due to limitations in the browser
+
+        3. Shortcut keys are not supported in this release.
+
+        4. Dragging and dropping of selections and images/objects is not supported.
+
+        5. Hitting the back button on the page will not reload the iframe.
+
+        6. Selecting the editable area, then hitting the shortcut keys for "Reload" will
+            cause the current page to be displayed inside the editable area.
+
+
+**** version 2.3.0 Peview Release Notes ***
+
+* The only server side resource required to run the editor, is the blankimage file.
+    The blankimage file is the temporary image loaded into the editor when you click the
+    "Insert Image" button in the toolbar.
+
+    This can be set using:
+
+    var myEditor = new YAHOO.widget.Editor('test', {
+        blankimage: 'MY_IMAGE_PATH'
+    });
+
+* There is a performance issue with Safari on a G4 computer. We will be working to get this resolved before the initial beta release.
diff --git a/lib/yui/editor/assets/editor-core.css b/lib/yui/editor/assets/editor-core.css
new file mode 100755 (executable)
index 0000000..4f30451
--- /dev/null
@@ -0,0 +1,633 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* Setup the container with some padding and zoom it for IE's hasLayout */
+.yui-toolbar-container .yui-toolbar-subcont {
+    padding: .25em 0;
+    zoom: 1;
+}
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-toolbar-container .yui-toolbar-subcont:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+
+/* Drag handle for the toolbar's draggable property */
+.yui-toolbar-container span.yui-toolbar-draghandle {
+    cursor: move;
+    border-left: 1px solid #999;
+    border-right: 1px solid #999;
+    overflow: hidden;
+    text-indent: 77777px;
+    width: 2px;
+    height: 20px;
+    display: block;
+    clear: none;
+    float: left;
+    margin: 0 0 0 .2em;
+}
+/* If the titlebar is draggable, the set the cursor */
+.yui-toolbar-container .yui-toolbar-titlebar.draggable {
+    cursor: move;
+}
+/* Set the titlebar to relative so we can position the collapse button */
+.yui-toolbar-container .yui-toolbar-titlebar {
+    position: relative;
+}
+/* Toolbar's titlebar styles */
+.yui-toolbar-container .yui-toolbar-titlebar h2 {
+    font-weight: bold;
+    border: none;
+    color: #000;
+    margin: 0;
+    padding: .2em;
+}
+/* If the toolbar is grouped the draghandle needs to be bigger */
+.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle {
+    height: 40px;
+}
+
+/* Float the groups so they position nicely and zoom them for IE */
+.yui-toolbar-container .yui-toolbar-group {
+    float: left;
+    zoom: 1;
+}
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-toolbar-container .yui-toolbar-group:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+/* Grouped title styles */
+.yui-toolbar-container .yui-toolbar-group h3 {
+    font-size: 75%;
+    color: #999;
+    padding-left: .25em;
+}
+/* Style the separators with a left border */
+.yui-toolbar-container span.yui-toolbar-separator {
+    border-left: 1px solid #999;
+    overflow: hidden;
+    text-indent: 77777px;
+    width: 2px;
+    height: 18px;
+    margin: .2em 0 .2em .1em;
+    display: block;
+    clear: none;
+    float: left;
+}
+/* Set the height of a grouped separator to a little bit bigger */
+.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator {
+    height: 35px;
+}
+
+/* Reset the height of a separator inside of a group */
+.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator {
+    height: 18px;
+}
+
+/* Kill the default styles of the list */
+.yui-toolbar-container ul li {
+    margin: 0;
+    float: left;
+}
+
+/* Setup the default style of a button in the toolbar */
+.yui-toolbar-container .yui-button {
+    border: 1px solid #999999;
+    background: none;
+    padding: 0;
+    cursor: pointer;
+    height: 20px;
+    width: 30px;
+    overflow: hidden;
+    display: block;
+    float: left;
+    margin: 0 1px;
+    position: relative;
+    filter: none; /* UNDO Button filter..*/
+}
+
+/* setup the default style of the A inside of the toolbar button */
+.yui-toolbar-container .yui-button .first-child, .yui-toolbar-container .yui-button .first-child a {
+    margin: 0;
+    border: 0;
+    display: block;
+    text-indent: 50px !important; /* IE Fix */
+    width: 200px;
+    overflow:hidden;
+}
+
+/* Setup the disabled state of a button */
+.yui-toolbar-container .yui-button-disabled {
+    opacity: .5;
+    filter: alpha(opacity=50);
+    cursor: default;
+}
+/* remove any padding from the A */
+.yui-toolbar-container .yui-button a {
+    padding: 0;
+}
+/* Fix a style inherited from the Button widget for IE */
+.yui-toolbar-container .yui-button.ie6.hover {
+    background-color: #98D5FC !important;
+}
+
+/* Select Button Emulation */
+.yui-toolbar-container .yui-toolbar-select {
+    height: 20px;
+    width: auto;
+}
+
+/* Override the default Button style for select menu*/
+.yui-toolbar-container .yui-toolbar-select a {
+    border: none;
+    background-color: transparent;
+    height: 19px;
+    width: 100%;
+    text-align: left;
+    cursor: pointer;
+    opacity: 1;
+    filter: none;
+}
+/* Fix IE */
+.yui-toolbar-container .yui-toolbar-select .first-child {
+    width: 100% !important; /* For IE */
+}
+/* Reset the text-indent because we want to see the text of a select menu */
+.yui-toolbar-container .yui-toolbar-select .first-child a {
+    text-indent: 3px !important;
+    width: 100% !important; /* For IE */
+}
+
+/* Fix styles inherited from Button  */
+.yui-toolbar-container .yui-toolbar-select.yui-button-disabled a {
+    cursor: default;
+    opacity: 1;
+    filter: none;
+    display: block;
+}
+
+
+/* Font Family Drop Down */
+.yui-toolbar-container .yui-toolbar-fontname {
+    width: 125px;
+}
+
+/* Header Drop Down */
+.yui-toolbar-container .yui-toolbar-heading {
+    width: 80px;
+}
+
+/* Font Family Menu Style - This styles the menu items and the selected menu item */
+.yui-toolbar-fontname-arial { font-family: Arial; }
+.yui-toolbar-fontname-arial-black { font-family: Arial Black; }
+.yui-toolbar-fontname-comic-sans-ms { font-family: Comic Sans MS; }
+.yui-toolbar-fontname-courier-new { font-family: Courier New; }
+.yui-toolbar-fontname-times-new-roman { font-family: Times New Roman; }
+.yui-toolbar-fontname-verdana { font-family: Verdana; }
+.yui-toolbar-fontname-impact { font-family: Impact; }
+.yui-toolbar-fontname-lucida-console { font-family: Lucida Console; }
+.yui-toolbar-fontname-tahoma { font-family: Tahoma; }
+.yui-toolbar-fontname-trebuchet-ms { font-family: Trebuchet MS; }
+
+/* Put a fake border around buttons that have focus */
+.yui-toolbar-container .yui-push-button-focus {
+    border: 1px dotted #999;
+}
+
+/* Spin Button */
+.yui-toolbar-container .yui-toolbar-spinbutton {
+    position: relative;
+    width: 35px;
+}
+
+/* Set a default width */
+.yui-toolbar-container .yui-toolbar-spinbutton .first-child {
+    width: 35px;
+}
+/* Setup the default style for the A */
+.yui-toolbar-container .yui-toolbar-spinbutton .first-child a {
+    border: none;
+    background-color: transparent;
+    background-image: none;
+    background-repeat: no-repeat;
+    width: 28px;
+    height: 20px;
+    text-align: left;
+    text-indent: 2px !important;
+    z-index: 0;
+    opacity: 1;
+    filter: none;
+}
+
+/* Setup the position and style for the up and down arrows */
+.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up, .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down {
+    position: absolute;
+    display: block
+    right: 0;
+    cursor: pointer;
+    text-indent: 999px;
+    overflow: hidden;
+    z-index: 1;
+    border: none;
+}
+/* Position all panels/overlays as absolute by default */
+.yui-toolbar-container .yui-overlay {
+    position: absolute;
+}
+/* Smash the default style for lists */
+.yui-toolbar-container .yui-overlay ul li {
+    float: none;
+}
+
+/* Setup the default look of a color menu and Zoom it for IE */
+.yui-toolbar-colors {
+    width: 133px;
+    zoom: 1;
+    display: none;
+    z-index: 100;
+    overflow: hidden;
+}
+
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-toolbar-colors:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+/* Style all of the A's so the float properly */
+.yui-toolbar-colors a {
+    height: 9px;
+    width: 9px;
+    float: left;
+    display: block;
+    overflow: hidden;
+    text-indent: 999px;
+    margin: 0;
+    cursor: pointer;
+    border: 1px solid #F6F7EE;
+}
+/* Put a little border around one that is hovered over */
+.yui-toolbar-colors a:hover {
+    border: 1px solid black;
+}
+
+/* Smash the inhertited Menu style */
+.yui-color-button-menu {
+    overflow: hidden;
+    background-color: transparent;
+}
+
+/* This is the preview box at the bottom of the menu - Zoom it for IE */
+.yui-toolbar-colors span {
+    position: relative;
+    display: block;
+    padding: 3px;
+    overflow: hidden;
+    float: left;
+    width: 100%;
+    zoom: 1;
+}
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-toolbar-colors span:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+
+/* This is the box with the color preview in it */
+.yui-toolbar-colors span em {
+    height: 35px;
+    width: 30px;
+    float: left;
+    display: block;
+    overflow: hidden;
+    text-indent: 999px;
+    margin: 0.75px;
+    border: 1px solid black;
+}
+
+/* The container for the name and hex code */
+.yui-toolbar-colors span strong {
+    font-weight: normal;
+    padding-left: 3px;
+    display: block;
+    font-size: 85%;
+    float: left;
+    width: 65%;
+}
+
+/* Reset the z-index of the toolbar container so that menu's appear over the iframe in IE and Safari */
+.yui-toolbar-container {
+    z-index: 1;
+}
+
+/* The div around the iFrame */
+.yui-editor-container .yui-editor-editable-container {
+    position: relative;
+    z-index: 0;
+}
+/* The disbled state of the Editor */
+.yui-editor-container .yui-editor-masked {
+    background-color: #CCC;
+}
+/* Style the eidtable iframe to hide it */
+.yui-editor-container iframe {
+    border: 0px;
+    padding: 0;
+    margin: 0;
+}
+/* Reset some padding on the editable iframes container */
+.yui-editor-container .yui-editor-editable {
+    padding: 0;
+    margin: 0;
+}
+/* Style the dom path box at the bottom of the editor */
+.yui-editor-container .dompath {
+    height: 1em;
+    padding:0.25em;
+    font-size: 85%;
+}
+
+/* Header styles for the Property Editor */
+.yui-editor-panel .hd {
+    text-align: left;
+    position: relative;
+}
+/* Setup some padding around the h3 */
+.yui-editor-panel .hd h3 {
+    font-weight: bold;
+    padding: 0.25em 0pt 0.25em 0.25em;
+}
+
+/* set it to relative so we can position the close button - Zoom it for IE */
+.yui-editor-panel .bd {
+    width: 100%;
+    zoom: 1;
+    position: relative;
+}
+/* Setup some padding for the body container - Zoom it for IE */
+.yui-editor-panel .bd div.yui-editor-body-cont {
+    padding: .25em .1em;
+    zoom: 1;
+}
+
+/* Setup the :after so that compliant browsers don't loose the bounding box */
+.yui-editor-panel .bd div.yui-editor-body-cont:after { display: block; clear: both; visibility: hidden; content: '.'; height: 0;}
+
+/* style the footer of the property editor */
+.yui-editor-panel .ft {
+    text-align: right;
+    width: 99%;
+    float: left;
+    clear: both;
+}
+
+/* Style the "tip" icon */
+.yui-editor-panel .ft span.tip {
+    display: block;
+    position: relative;
+    padding-left:23px;
+    text-align:left;
+    margin: .5em;
+    zoom: 1;
+}
+
+
+/* setup some form fields */
+.yui-editor-panel label {
+    clear: both;
+    float: left;
+    padding: 0;
+    overflow: auto; /* This fixes the caret issue in Firefox */
+    width: 100%;
+    zoom: 1;
+    text-align: left;
+}
+
+/* more form fields */
+.yui-editor-panel label strong {
+    float: left;
+    width: 6em;
+}
+
+/* The remove link in the Link Property Editor */
+.yui-editor-panel .removeLink {
+    width: 80%;
+    text-align: right;
+}
+
+/* More form styling */
+.yui-editor-panel label input {
+    margin-left: .25em;
+    float: left;
+}
+
+/* Image Padding in the Property Editor */
+.yui-editor-panel .yui-toolbar-group-padding {
+    width: 100px;
+}
+
+/* Image Border in the Property Editor */
+.yui-editor-panel .yui-toolbar-group-border {
+    width: 175px;
+    *width: 190px;
+}
+
+/* Image Text Flow in the Property Editor */
+.yui-editor-panel .yui-toolbar-group-textflow {
+    width: 150px;
+    *width: 180px;
+}
+
+/* Image Height/Width in the Property Editor */
+.yui-editor-panel .height-width {
+    float: left;
+    width: 68%;
+}
+/* Image Height/Width title */
+.yui-editor-panel .height-width h3 {
+    padding-right: 11px;
+}
+/* Image Height/Width container */
+.yui-editor-panel .height-width span {
+    font-style: italic;
+    display: block;
+    float: left;
+    overflow:auto;
+}
+/* Image Height/Width original info container */
+.yui-editor-panel .height-width span.info {
+    font-size: 70%;
+}
+
+/* Border Size/Type button widths */
+.yui-editor-panel .yui-toolbar-bordersize, .yui-editor-panel .yui-toolbar-bordertype {
+    width: 50px;
+    font-size: 75%;
+}
+
+/* Kill the separators in the Property Editor */
+.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator {
+    border: none;
+}
+
+/* Undo the floats on the a's */
+.yui-editor-panel .yui-toolbar-container div.yuimenu li.yuimenuitem a {
+    float: none;
+}
+
+/* Border Type solid */
+.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid {
+    border-bottom: 1px solid black;
+    text-indent: 777px;
+    overflow: hidden;
+    display: block;
+    width: 22px;
+    height: 8px;
+    position: absolute;
+    left: 2px;
+}
+/* Border Type dotted */
+.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted {
+    border-bottom: 1px dotted black;
+    text-indent: 777px;
+    overflow: hidden;
+    display: block;
+    width: 22px;
+    height: 8px;
+    position: absolute;
+    left: 2px;
+}
+/* Border Type dashed */
+.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed {
+    border-bottom: 1px dashed black;
+    text-indent: 777px;
+    overflow: hidden;
+    display: block;
+    width: 22px;
+    height: 8px;
+    position: absolute;
+    left: 2px;
+}
+/* Border Size 1 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1 {
+    border-bottom: 1px solid black;
+    text-indent: 777px;
+    overflow: hidden;
+    display: block;
+    width: 22px;
+    height: 8px;
+    position: absolute;
+    left: 2px;
+}
+/* Border Size 2 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2 {
+    border-bottom: 2px solid black;
+    text-indent: 777px;
+    overflow: hidden;
+    display: block;
+    width: 22px;
+    height: 8px;
+    position: absolute;
+    left: 2px;
+}
+/* Border Size 3 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3 {
+    border-bottom: 3px solid black;
+    text-indent: 777px;
+    overflow: hidden;
+    display: block;
+    width: 22px;
+    height: 8px;
+    position: absolute;
+    left: 2px;
+}
+/* Border Size 4 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4 {
+    border-bottom: 4px solid black;
+    text-indent: 777px;
+    overflow: hidden;
+    display: block;
+    width: 22px;
+    height: 8px;
+    position: absolute;
+    left: 2px;
+}
+/* Border Size 5 */
+.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5 {
+    border-bottom: 5px solid black;
+    text-indent: 777px;
+    overflow: hidden;
+    display: block;
+    width: 22px;
+    height: 8px;
+    position: absolute;
+    left: 2px;
+}
+
+/* Border Size menu size */
+.yui-toolbar-container .yui-toolbar-bordersize-menu {
+    width: 30px;
+}
+/* Border Size menu styles */
+.yui-toolbar-bordersize-menu .yuimenuitemlabel, .yui-toolbar-bordertype-menu .yuimenuitemlabel {
+    display: block;
+    width: 50px;
+    color: #ffffff;
+    position: relative;
+    margin-left: 20px;
+    padding: 0;
+}
+/* Border Size menu styles - Checked */
+.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator, .yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator {
+    position: absolute;
+    left: -14px;
+}
+/* Border Size menu styles - Selected */
+.yui-toolbar-bordersize-menu .yuimenuitem a.selected, .yui-toolbar-bordertype-menu .yuimenuitem a.selected {
+    color: #B3D4FF;
+}
+
+/* Border Size 0 - Menu Item */
+div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a {
+    color: #000;
+}
+/* Border Size 0 - Selected Menu Item */
+div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a.selected {
+    color: #fff;
+}
+/* Border Size 1 - Menu Item */
+div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a {
+    border-bottom: 1px solid black;
+}
+/* Border Size 2 - Menu Item */
+div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a {
+    border-bottom: 2px solid black;
+}
+/* Border Size 3 - Menu Item */
+div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a {
+    border-bottom: 3px solid black;
+}
+/* Border Size 4 - Menu Item */
+div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a {
+    border-bottom: 4px solid black;
+}
+/* Border Size 5 - Menu Item */
+div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a {
+    border-bottom: 5px solid black;
+}
+
+
+/* Border Type Solid - Menu Item */
+div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a {
+    border-bottom: 1px solid black;
+}
+/* Border Type Dashed - Menu Item */
+div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a {
+    border-bottom: 1px dashed black;
+}
+/* Border Type Dotted - Menu Item */
+div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a {
+    border-bottom: 1px dotted black;
+}
+/* Hidden Headers for Accessibility */
+h2.yui-editor-skipheader, h3.yui-editor-skipheader {
+    height: 0;
+    margin: 0;
+    padding: 0;
+    border: none;
+    width: 0;
+    overflow: hidden;
+    position: absolute;
+}
+
diff --git a/lib/yui/editor/assets/skins/sam/blankimage.png b/lib/yui/editor/assets/skins/sam/blankimage.png
new file mode 100755 (executable)
index 0000000..b87bb24
Binary files /dev/null and b/lib/yui/editor/assets/skins/sam/blankimage.png differ
diff --git a/lib/yui/editor/assets/skins/sam/editor-knob.gif b/lib/yui/editor/assets/skins/sam/editor-knob.gif
new file mode 100755 (executable)
index 0000000..03feab3
Binary files /dev/null and b/lib/yui/editor/assets/skins/sam/editor-knob.gif differ
diff --git a/lib/yui/editor/assets/skins/sam/editor-skin.css b/lib/yui/editor/assets/skins/sam/editor-skin.css
new file mode 100755 (executable)
index 0000000..249ea98
--- /dev/null
@@ -0,0 +1,534 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* Color the border of the container */
+.yui-skin-sam .yui-toolbar-container {
+    border: 1px solid #808080;
+    zoom: 1;
+}
+/* Load the background image on the Toolbars titlebar */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar {
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;
+}
+
+/* Give the titlebar some color and padding */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2 {
+    color: #000000;
+    font-weight: bold;
+    margin: 0;
+    padding: 0.3em 1em;
+    font-size: 100%;
+    text-align: left;
+}
+
+/* Give the toolbars groups titles some color and padding */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3 {
+    color: #808080;
+    font-size: 75%;
+    margin: 1em 0 0.25em;
+    padding-bottom: 0;
+    padding-left: 0.25em;
+    text-align: left;
+}
+
+/* Hide all of the sepatators borders */
+.yui-toolbar-container span.yui-toolbar-separator {
+    border: none;
+}
+
+/* Background color of the toolbar */
+.yui-skin-sam .yui-toolbar-container {
+    background-color: #F2F2F2;
+}
+
+/* Add some padding to the toolbars sub container */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont {
+    padding: 0 1em 0.35em;
+}
+
+/* Remove the shadows from the menus in the toolbar - Menu.css override */
+.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow, .yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow {
+    display: none;
+}
+
+/* Remove padding/margin from lists */
+.yui-skin-sam .yui-editor-container ul {
+    list-style-type: none;
+    margin: 0;
+    padding: 0;
+}
+/* Remove padding/margin from list items */
+.yui-skin-sam .yui-editor-container ul li {
+    margin: 0;
+    padding: 0;
+}
+
+/* Place a border around the right/left/bottom of the Editors container (Toolbar provides the top border..) */
+.yui-skin-sam .yui-editor-container .yui-editor-editable-container {
+    border: 1px solid #808080;
+    border-top: none;
+}
+
+/* Set the color and the border of the dompath container at the bottom of the editor */
+.yui-skin-sam .yui-editor-container .dompath {
+    background-color: #F2F2F2;
+    border:1px solid #808080;
+    border-top: none;
+    color: #999;
+    text-align: left;
+}
+
+/* Set the image for the collapse button on the toolbar */
+.yui-skin-sam .yui-toolbar-container .collapse {
+    background: url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -400px;
+}
+/* Position the image and the container */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse {
+    cursor: pointer;
+    position: absolute;
+    top: 2px;
+    right: 2px;
+    display: block;
+    overflow: hidden;
+    height: 15px;
+    width: 15px;
+    text-indent: 9999px;
+}
+
+/* Remove some padding on the top of the select lists */
+.yui-toolbar-container .yui-toolbar-select .first-child a {
+    padding-top: 0;
+}
+
+/* Set the default styles for the buttons */
+.yui-skin-sam .yui-toolbar-container .yui-button {
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;
+    border: 1px solid #808080;
+    cursor: pointer;
+    height: 22px;
+    margin: 0;
+    overflow: hidden;
+    /*padding: 2px 5px;*/
+    position: relative;
+    display: block;
+}
+/* Handle the hover state of the buttons */
+.yui-skin-sam .yui-toolbar-container .yui-button-hover {
+    background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;
+    border-color: #808080;
+}
+
+/* Handle the selected state of the buttons */
+.yui-skin-sam .yui-toolbar-container .yui-button-selected {
+    background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -1700px;
+    border-color: #808080;
+}
+
+
+/* Handle the icon placeholder for the buttons */
+.yui-skin-sam .yui-toolbar-container .yui-button span.yui-toolbar-icon {
+    display: block;
+    position: absolute;
+    top: 2px;
+    height: 18px;
+    width: 18px;
+    overflow: hidden;
+    background-image: url( editor-sprite.gif );
+    background-repeat: no-repeat;
+    background-position: 30px 30px;
+}
+
+/* Swap out the image to an active image */
+.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon, .yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon {
+    background-image: url(editor-sprite-active.gif);
+}
+
+.yui-skin-sam .visible .yuimenuitemlabel {
+    text-align:left;
+}
+
+/* Set the background color of all menu containers */
+.yui-skin-sam .yui-button-menu {
+    background-color: #ffffff;
+}
+
+/* Set the background of all menu items that are selected */
+.yui-skin-sam div.yuimenu li.selected {
+    background-color: #B3D4FF;
+}
+/* Set the color of the hrefs in a selected menu item */
+.yui-skin-sam div.yuimenu li.selected a.selected {
+    color: #000;
+}
+
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon {
+    background-position: 0 0;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon {
+    background-position: 0 -36px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon {
+    background-position: 0 -72px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon {
+    background-position: 0 -180px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon {
+    background-position: 0 -144px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon {
+    background-position: 0 -216px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon {
+    background-position: 0 -288px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon {
+    background-position: 0 -324px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon {
+    background-position: 0 -360px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon {
+    background-position: 0 -396px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon {
+    background-position: 0 -432px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon {
+    background-position: 0 -720px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon {
+    background-position: 0 -684px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon {
+    background-position: 0 -792px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon {
+    background-position: 1px -756px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon {
+    background-position: 0 -972px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon {
+    background-position: 0 -936px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon {
+    background-position: 0 -900px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon {
+    background-position: 0 -864px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon {
+    background-position: 0 -252px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon {
+    background-position: 0 -1080px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon {
+    background-position: 0 -1044px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon {
+    background-position: 0 -468px;
+    left: 5px;
+}
+/* Setting the background position of the sprite */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon {
+    background-position: 0 -504px;
+    left: 5px;
+}
+/* Remove the right border on these icons so they appear to be in a "group" together */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-left,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-block,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordersize,
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordertype
+{
+    border-right: none;
+}
+/* Set the width of the href to be very large so we can style it and hide the text */
+.yui-skin-sam .yui-toolbar-container .yui-button .first-child, .yui-skin-sam .yui-toolbar-container .yui-button .first-child a {
+    width: 500px;
+    position: absolute;
+    _position: static;
+    top: -1px;
+}
+/* Reset the position of the first child so the iframe in IE will not move above the menu */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child, .yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child {
+    position: static;
+}
+/* Set the height of the first-child element so we get the buttons area back */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a, .yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a {
+    height: 19px;
+    left: 0;
+}
+
+
+/* Spin Buttons - Remove the icon holder, they don't need it */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon {
+    display: none;
+}
+
+/* Spin Buttons - The up arrow */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up {
+    top: 0;
+    right: 0;
+    background-image: url( editor-sprite.gif );
+    background-position: 0 -1221px;
+    overflow: hidden;
+    height: 8px;
+    width: 8px;
+    min-height: 0;
+}
+/* Spin Buttons - The down arrow */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down {
+    bottom: 0;
+    right: 0;
+    background-image: url( editor-sprite.gif );
+    background-position: 0 -1187px;
+    overflow: hidden;
+    height: 8px;
+    width: 8px;
+    min-height: 0;
+}
+/* Set the icon of the select menu for the drop down arrow */
+.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon {
+    background-image: url( editor-sprite.gif );
+    background-position: 0px -1144px;
+    overflow: hidden;
+    right: -2px;
+    top: 0px;
+    height: 20px;
+}
+/* Fix the color menu background if it's inside a Property Editor */
+.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd {
+    background-color: transparent;
+    border: none;
+    width: 135px;
+}
+
+/* Place a border around the color menu */
+.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors {
+    border: 1px solid #808080;
+}
+/* Color the input yellow if it has the warning class applied */
+.yui-editor-panel label input.warning {
+    background-color: #FFEE69;
+}
+
+/* Property Editor Panel styles */
+.yui-skin-sam .yui-editor-panel .yui-panel {
+    padding: 0;
+    margin: 0;
+    border: none;
+    background-color: transparent;
+    overflow: visible;
+}
+
+/* Image Properties - Border container size */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border {
+    width: 190px;
+    *width: 195px;
+}
+/* Image Properties - Text flow container size */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow {
+    width: 185px;
+}
+
+/* Margins on the header of the Property Editor */
+.yui-skin-sam .yui-editor-panel .hd {
+    margin: 13px 0 0;
+    padding: 0;
+    border: none;
+}
+/* Setup the background image on the title bar
+    We are styling the h3 instead if the div so we can make room
+    for the "knob" that floats on the top of the window.
+*/
+.yui-skin-sam .yui-editor-panel .hd h3 {
+    color: #000;
+    border: 1px solid #808080;
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;
+    width: 99%;
+    position: relative;
+    margin: 0;
+    padding: 0;
+    font-size: 93%;
+    text-indent: 5px;
+    height: 20px;
+}
+/* Style the body of the Property Editor */
+.yui-skin-sam .yui-editor-panel .bd {
+    background-color: #F2F2F2;
+    border-left: 1px solid #808080;
+    border-right: 1px solid #808080;
+    width: 99%;
+    margin: 0;
+    *margin-left: -1px;
+    padding: 0;
+    overflow: visible;
+}
+/* Remove the padding/margin on lists in the Property Editor */
+.yui-skin-sam .yui-editor-panel ul {
+    list-style-type: none;
+    margin: 0;
+    padding: 0;
+}
+
+/* Remove the padding/margin on list items in the Property Editor */
+.yui-skin-sam .yui-editor-panel ul li {
+    margin: 0;
+    padding: 0;
+}
+
+/* Form styling */
+.yui-skin-sam .yui-editor-panel label strong {
+    font-weight: normal;
+    font-size: 93%;
+}
+
+/* Remove the background image set in Panel.css */
+.yui-skin-sam .yui-editor-panel .hd {
+    background: none;
+}
+
+/* Give the footer som color and a border */
+.yui-skin-sam .yui-editor-panel .ft {
+    background-color: #F2F2F2;
+    border: 1px solid #808080;
+    border-top: none;
+    padding: 0;
+    margin: 0;
+    z-index: -1;
+}
+
+/* Style the close button in the Property Editor */
+.yui-skin-sam .yui-editor-panel .hd span.close {
+    background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;
+    cursor:pointer;
+    display:block;
+    height:16px;
+    overflow:hidden;
+    position:absolute;
+    right:5px;
+    text-indent:500px;
+    top:2px;
+    width:26px;
+}
+
+/* Setup the icon for a tip */
+.yui-skin-sam .yui-editor-panel .ft span.tip span.icon {
+    background-image: url( editor-sprite.gif );
+    background-position: 0 -1260px;
+    display: block;
+    height: 20px;
+    left: 0;
+    position: absolute;
+    top: 0;
+    width: 20px;
+}
+/* Setup the background image for an info icon */
+.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info {
+    background-position: 2px -1260px;
+}
+/* Setup the background image for a warning icon */
+.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn {
+    background-position: 2px -1296px;
+}
+
+/* Handle the knob that floats on top of the panel */
+.yui-skin-sam .yui-editor-panel .hd span.knob {
+    position: absolute;
+    height: 10px;
+    width: 28px;
+    top: -10px;
+    left: 25px;
+    text-indent: 9999px;
+    overflow: hidden;
+    background-image: url( editor-knob.gif );
+    background-repeat: no-repeat;
+}
+/* Reset some styles from the editor toolbar, when a toolbar is inside the Property Editor */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-container {
+    float: left;
+    width: 100%;
+    background-image: none;
+    border: none;
+}
+/* Reset styles for menu buttons inside the Property Editor */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd {
+    background-color: #ffffff;
+    border-bottom: 1px solid #808080;
+}
+
+/* Style the titles of the toolbar groups */
+.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3 {
+    color: #000;
+    float: left;
+    padding-top: 5px;
+}
+
+/* This image is the one used to place the blankimage placeholder into the editor when you click on Insert an Image */
+.yui-editor-blankimage {
+    background-image: url( blankimage.png );
+}
diff --git a/lib/yui/editor/assets/skins/sam/editor-sprite-active.gif b/lib/yui/editor/assets/skins/sam/editor-sprite-active.gif
new file mode 100755 (executable)
index 0000000..04ac4e4
Binary files /dev/null and b/lib/yui/editor/assets/skins/sam/editor-sprite-active.gif differ
diff --git a/lib/yui/editor/assets/skins/sam/editor-sprite.gif b/lib/yui/editor/assets/skins/sam/editor-sprite.gif
new file mode 100755 (executable)
index 0000000..dd36c3e
Binary files /dev/null and b/lib/yui/editor/assets/skins/sam/editor-sprite.gif differ
diff --git a/lib/yui/editor/assets/skins/sam/editor.css b/lib/yui/editor/assets/skins/sam/editor.css
new file mode 100755 (executable)
index 0000000..1c96eba
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;color:#999;padding-left:.25em;}.yui-toolbar-container span.yui-toolbar-separator{border-left:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:18px;margin:.2em 0 .2em .1em;display:block;clear:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:35px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;}.yui-toolbar-container ul li{margin:0;float:left;}.yui-toolbar-container .yui-button{border:1px solid #999999;background:none;padding:0;cursor:pointer;height:20px;width:30px;overflow:hidden;display:block;float:left;margin:0 1px;position:relative;filter:none;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{margin:0;border:0;display:block;text-indent:50px !important;width:200px;overflow:hidden;}.yui-toolbar-container .yui-button-disabled{opacity:.5;filter:alpha(opacity=50);cursor:default;}.yui-toolbar-container .yui-button a{padding:0;}.yui-toolbar-container .yui-button.ie6.hover{background-color:#98D5FC !important;}.yui-toolbar-container .yui-toolbar-select{height:20px;width:auto;}.yui-toolbar-container .yui-toolbar-select a{border:none;background-color:transparent;height:19px;width:100%;text-align:left;cursor:pointer;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-select .first-child{width:100% !important;}.yui-toolbar-container .yui-toolbar-select .first-child a{text-indent:3px !important;width:100% !important;}.yui-toolbar-container .yui-toolbar-select.yui-button-disabled a{cursor:default;opacity:1;filter:none;display:block;}.yui-toolbar-container .yui-toolbar-fontname{width:125px;}.yui-toolbar-container .yui-toolbar-heading{width:80px;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-push-button-focus{border:1px dotted #999;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{border:none;background-color:transparent;background-image:none;background-repeat:no-repeat;width:28px;height:20px;text-align:left;text-indent:2px !important;z-index:0;opacity:1;filter:none;}.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up,.yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{position:absolute;display:block right:0;cursor:pointer;text-indent:999px;overflow:hidden;z-index:1;border:none;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{float:none;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:hidden;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{height:1em;padding:0.25em;font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding-left:23px;text-align:left;margin:.5em;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;overflow:auto;width:100%;zoom:1;text-align:left;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group-padding{width:100px;}.yui-editor-panel .yui-toolbar-group-border{width:175px;*width:190px;}.yui-editor-panel .yui-toolbar-group-textflow{width:150px;*width:180px;}.yui-editor-panel .height-width{float:left;width:68%;}.yui-editor-panel .height-width h3{padding-right:11px;}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:auto;}.yui-editor-panel .height-width span.info{font-size:70%;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{width:50px;font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-container div.yuimenu li.yuimenuitem a{float:none;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{border-bottom:3px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{border-bottom:4px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{border-bottom:5px solid black;text-indent:777px;overflow:hidden;display:block;width:22px;height:8px;position:absolute;left:2px;}.yui-toolbar-container .yui-toolbar-bordersize-menu{width:30px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel{display:block;width:50px;color:#ffffff;position:relative;margin-left:20px;padding:0;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-14px;}.yui-toolbar-bordersize-menu .yuimenuitem a.selected,.yui-toolbar-bordertype-menu .yuimenuitem a.selected{color:#B3D4FF;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a{color:#000;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-0 a.selected{color:#fff;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;}div.yuimenu.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;}div.yuimenu.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-skin-sam .yui-toolbar-container{border:1px solid #808080;zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0.25em;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-container .yui-editor-editable-container{border:1px solid #808080;border-top:none;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border:1px solid #808080;border-top:none;color:#999;text-align:left;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:2px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-toolbar-container .yui-toolbar-select .first-child a{padding-top:0;}.yui-skin-sam .yui-toolbar-container .yui-button{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;border:1px solid #808080;cursor:pointer;height:22px;margin:0;overflow:hidden;position:relative;display:block;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background-image:url( editor-sprite.gif );background-repeat:no-repeat;background-position:30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .visible .yuimenuitemlabel{text-align:left;}.yui-skin-sam .yui-button-menu{background-color:#ffffff;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold,.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic,.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript,.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor,.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter,.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright,.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent,.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist,.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink,.yui-skin-sam .yui-toolbar-container .yui-toolbar-left,.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline,.yui-skin-sam .yui-toolbar-container .yui-toolbar-block,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordersize,.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordertype{border-right:none;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-button .first-child a{width:500px;position:absolute;_position:static;top:-1px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{position:static;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{height:19px;left:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.up{top:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1221px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton.yui-button a.down{bottom:0;right:0;background-image:url( editor-sprite.gif );background-position:0 -1187px;overflow:hidden;height:8px;width:8px;min-height:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background-image:url( editor-sprite.gif );background-position:0px -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;*width:195px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:185px;}.yui-skin-sam .yui-editor-panel .hd{margin:13px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;*margin-left:-1px;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0;z-index:-1;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background-image:url( editor-sprite.gif );background-position:0 -1260px;display:block;height:20px;left:0;position:absolute;top:0;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background-image:url( editor-knob.gif );background-repeat:no-repeat;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;padding-top:5px;}.yui-editor-blankimage{background-image:url( blankimage.png );}
diff --git a/lib/yui/editor/editor-beta-debug.js b/lib/yui/editor/editor-beta-debug.js
new file mode 100755 (executable)
index 0000000..266453f
--- /dev/null
@@ -0,0 +1,5205 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+*/
+/**
+ * @description <p>Creates a rich Toolbar widget based on Button. Primarily used with the Rich Text Editor</p>
+ * @class Toolbar
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event
+ * @optional container, menu, button, dragdrop
+ * @beta
+ */
+(function() {
+    /**
+    * @private
+    **/
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+
+    /**
+     * Provides a rich toolbar widget based on the button and menu widgets
+     * @constructor
+     * @param {String/HTMLElement} el The element to turn into a toolbar.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    YAHOO.widget.Toolbar = function(el, attrs) {
+        YAHOO.log('Toolbar Initalizing', 'info', 'Toolbar');
+        YAHOO.log(arguments.length + ' arguments passed to constructor', 'info', 'Toolbar');
+        
+        if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) {
+            var attrs = el;
+        }
+        var local_attrs = (attrs || {});
+
+        var oConfig = {
+            element: null,
+            attributes: local_attrs
+        }
+        
+        
+        if (Lang.isString(el) && Dom.get(el)) {
+            oConfig.element = Dom.get(el);
+        } else if (Lang.isObject(el) && Dom.get(el) && Dom.get(el).nodeType) {  
+            oConfig.element = Dom.get(el);
+        }
+        
+
+        if (!oConfig.element) {
+            YAHOO.log('No element defined, creating toolbar container', 'warn', 'Toolbar');
+            oConfig.element = document.createElement('DIV');
+            oConfig.element.id = Dom.generateId();
+            
+            if (local_attrs.container && Dom.get(local_attrs.container)) {
+                YAHOO.log('Container found in config appending to it (' + Dom.get(local_attrs.container).id + ')', 'info', 'Toolbar');
+                Dom.get(local_attrs.container).appendChild(oConfig.element);
+            }
+        }
+        
+
+        if (!oConfig.element.id) {
+            oConfig.element.id = ((Lang.isString(el)) ? el : Dom.generateId());
+            YAHOO.log('No element ID defined for toolbar container, creating..', 'warn', 'Toolbar');
+        }
+        YAHOO.log('Initing toolbar with id: ' + oConfig.element.id, 'info', 'Toolbar');
+        
+        var cont = document.createElement('DIV');
+        oConfig.attributes.cont = cont;
+        Dom.addClass(cont, 'yui-toolbar-subcont')
+        oConfig.element.appendChild(cont);
+        
+        oConfig.attributes.element = oConfig.element;
+        oConfig.attributes.id = oConfig.element.id;
+
+        YAHOO.widget.Toolbar.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+        
+        
+    }
+
+    /**
+    * @method _addMenuClasses
+    * @private
+    * @description This method is called from Menu's renderEvent to add a few more classes to the menu items
+    * @param {String} ev The event that fired.
+    * @param {Array} na Array of event information.
+    * @param {Object} o Button config object. 
+    */
+
+    function _addMenuClasses(ev, na, o) {
+        Dom.addClass(this.element, 'yui-toolbar-' + o.get('value') + '-menu');
+        if (Dom.hasClass(o._button.parentNode.parentNode, 'yui-toolbar-select')) {
+            Dom.addClass(this.element, 'yui-toolbar-select-menu');
+        }
+        var items = this.getItems();
+        for (var i = 0; i < items.length; i++) {
+            Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-').toLowerCase() : items[i]._oText.nodeValue.replace(/ /g, '-').toLowerCase()));
+            Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-') : items[i]._oText.nodeValue.replace(/ /g, '-')));
+        }
+        this._setWidth();
+    };
+
+    YAHOO.extend(YAHOO.widget.Toolbar, YAHOO.util.Element, {
+        /** 
+        * @property dd
+        * @description The DragDrop instance associated with the Toolbar
+        * @type Object
+        */
+        dd: null,
+        /** 
+        * @property _colorData
+        * @description Object reference containing colors hex and text values.
+        * @type Object
+        */
+        _colorData: {
+/* {{{ _colorData */
+    '#111111': 'Obsidian',
+    '#2D2D2D': 'Dark Gray',
+    '#434343': 'Shale',
+    '#5B5B5B': 'Flint',
+    '#737373': 'Gray',
+    '#8B8B8B': 'Concrete',
+    '#A2A2A2': 'Gray',
+    '#B9B9B9': 'Titanium',
+    '#000000': 'Black',
+    '#D0D0D0': 'Light Gray',
+    '#E6E6E6': 'Silver',
+    '#FFFFFF': 'White',
+    '#BFBF00': 'Pumpkin',
+    '#FFFF00': 'Yellow',
+    '#FFFF40': 'Banana',
+    '#FFFF80': 'Pale Yellow',
+    '#FFFFBF': 'Butter',
+    '#525330': 'Raw Siena',
+    '#898A49': 'Mildew',
+    '#AEA945': 'Olive',
+    '#7F7F00': 'Paprika',
+    '#C3BE71': 'Earth',
+    '#E0DCAA': 'Khaki',
+    '#FCFAE1': 'Cream',
+    '#60BF00': 'Cactus',
+    '#80FF00': 'Chartreuse',
+    '#A0FF40': 'Green',
+    '#C0FF80': 'Pale Lime',
+    '#DFFFBF': 'Light Mint',
+    '#3B5738': 'Green',
+    '#668F5A': 'Lime Gray',
+    '#7F9757': 'Yellow',
+    '#407F00': 'Clover',
+    '#8A9B55': 'Pistachio',
+    '#B7C296': 'Light Jade',
+    '#E6EBD5': 'Breakwater',
+    '#00BF00': 'Spring Frost',
+    '#00FF80': 'Pastel Green',
+    '#40FFA0': 'Light Emerald',
+    '#80FFC0': 'Sea Foam',
+    '#BFFFDF': 'Sea Mist',
+    '#033D21': 'Dark Forrest',
+    '#438059': 'Moss',
+    '#7FA37C': 'Medium Green',
+    '#007F40': 'Pine',
+    '#8DAE94': 'Yellow Gray Green',
+    '#ACC6B5': 'Aqua Lung',
+    '#DDEBE2': 'Sea Vapor',
+    '#00BFBF': 'Fog',
+    '#00FFFF': 'Cyan',
+    '#40FFFF': 'Turquoise Blue',
+    '#80FFFF': 'Light Aqua',
+    '#BFFFFF': 'Pale Cyan',
+    '#033D3D': 'Dark Teal',
+    '#347D7E': 'Gray Turquoise',
+    '#609A9F': 'Green Blue',
+    '#007F7F': 'Seaweed',
+    '#96BDC4': 'Green Gray',
+    '#B5D1D7': 'Soapstone',
+    '#E2F1F4': 'Light Turquoise',
+    '#0060BF': 'Summer Sky',
+    '#0080FF': 'Sky Blue',
+    '#40A0FF': 'Electric Blue',
+    '#80C0FF': 'Light Azure',
+    '#BFDFFF': 'Ice Blue',
+    '#1B2C48': 'Navy',
+    '#385376': 'Biscay',
+    '#57708F': 'Dusty Blue',
+    '#00407F': 'Sea Blue',
+    '#7792AC': 'Sky Blue Gray',
+    '#A8BED1': 'Morning Sky',
+    '#DEEBF6': 'Vapor',
+    '#0000BF': 'Deep Blue',
+    '#0000FF': 'Blue',
+    '#4040FF': 'Cerulean Blue',
+    '#8080FF': 'Evening Blue',
+    '#BFBFFF': 'Light Blue',
+    '#212143': 'Deep Indigo',
+    '#373E68': 'Sea Blue',
+    '#444F75': 'Night Blue',
+    '#00007F': 'Indigo Blue',
+    '#585E82': 'Dockside',
+    '#8687A4': 'Blue Gray',
+    '#D2D1E1': 'Light Blue Gray',
+    '#6000BF': 'Neon Violet',
+    '#8000FF': 'Blue Violet',
+    '#A040FF': 'Violet Purple',
+    '#C080FF': 'Violet Dusk',
+    '#DFBFFF': 'Pale Lavender',
+    '#302449': 'Cool Shale',
+    '#54466F': 'Dark Indigo',
+    '#655A7F': 'Dark Violet',
+    '#40007F': 'Violet',
+    '#726284': 'Smoky Violet',
+    '#9E8FA9': 'Slate Gray',
+    '#DCD1DF': 'Violet White',
+    '#BF00BF': 'Royal Violet',
+    '#FF00FF': 'Fuchsia',
+    '#FF40FF': 'Magenta',
+    '#FF80FF': 'Orchid',
+    '#FFBFFF': 'Pale Magenta',
+    '#4A234A': 'Dark Purple',
+    '#794A72': 'Medium Purple',
+    '#936386': 'Cool Granite',
+    '#7F007F': 'Purple',
+    '#9D7292': 'Purple Moon',
+    '#C0A0B6': 'Pale Purple',
+    '#ECDAE5': 'Pink Cloud',
+    '#BF005F': 'Hot Pink',
+    '#FF007F': 'Deep Pink',
+    '#FF409F': 'Grape',
+    '#FF80BF': 'Electric Pink',
+    '#FFBFDF': 'Pink',
+    '#451528': 'Purple Red',
+    '#823857': 'Purple Dino',
+    '#A94A76': 'Purple Gray',
+    '#7F003F': 'Rose',
+    '#BC6F95': 'Antique Mauve',
+    '#D8A5BB': 'Cool Marble',
+    '#F7DDE9': 'Pink Granite',
+    '#C00000': 'Apple',
+    '#FF0000': 'Fire Truck',
+    '#FF4040': 'Pale Red',
+    '#FF8080': 'Salmon',
+    '#FFC0C0': 'Warm Pink',
+    '#441415': 'Sepia',
+    '#82393C': 'Rust',
+    '#AA4D4E': 'Brick',
+    '#800000': 'Brick Red',
+    '#BC6E6E': 'Mauve',
+    '#D8A3A4': 'Shrimp Pink',
+    '#F8DDDD': 'Shell Pink',
+    '#BF5F00': 'Dark Orange',
+    '#FF7F00': 'Orange',
+    '#FF9F40': 'Grapefruit',
+    '#FFBF80': 'Canteloupe',
+    '#FFDFBF': 'Wax',
+    '#482C1B': 'Dark Brick',
+    '#855A40': 'Dirt',
+    '#B27C51': 'Tan',
+    '#7F3F00': 'Nutmeg',
+    '#C49B71': 'Mustard',
+    '#E1C4A8': 'Pale Tan',
+    '#FDEEE0': 'Marble'
+/* }}} */
+        },
+        /** 
+        * @property _colorPicker
+        * @description The HTML Element containing the colorPicker
+        * @type HTMLElement
+        */
+        _colorPicker: null,
+        /** 
+        * @property STR_COLLAPSE
+        * @description String for Toolbar Collapse Button
+        * @type String
+        */
+        STR_COLLAPSE: 'Collapse Toolbar',
+        /** 
+        * @property STR_SPIN_LABEL
+        * @description String for spinbutton dynamic label. Note the {VALUE} will be replaced with YAHOO.lang.substitute
+        * @type String
+        */
+        STR_SPIN_LABEL: 'Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.',
+        /** 
+        * @property STR_SPIN_UP
+        * @description String for spinbutton up
+        * @type String
+        */
+        STR_SPIN_UP: 'Click to increase the value of this input',
+        /** 
+        * @property STR_SPIN_DOWN
+        * @description String for spinbutton down
+        * @type String
+        */
+        STR_SPIN_DOWN: 'Click to decrease the value of this input',
+        /** 
+        * @property _titlebar
+        * @description Object reference to the titlebar
+        * @type HTMLElement
+        */
+        _titlebar: null,
+        /** 
+        * @property _disabled
+        * @description Object to track button status when enabling/disabling the toolbar
+        * @type Object
+        */
+        _disabled: null,
+        /** 
+        * @property browser
+        * @description Standard browser detection
+        * @type Object
+        */
+        browser: YAHOO.env.ua,
+        /**
+        * @protected
+        * @property _buttonList
+        * @description Internal property list of current buttons in the toolbar
+        * @type Array
+        */
+        _buttonList: null,
+        /**
+        * @protected
+        * @property _buttonGroupList
+        * @description Internal property list of current button groups in the toolbar
+        * @type Array
+        */
+        _buttonGroupList: null,
+        /**
+        * @protected
+        * @property _sep
+        * @description Internal reference to the separator HTML Element for cloning
+        * @type HTMLElement
+        */
+        _sep: null,
+        /**
+        * @protected
+        * @property _sepCount
+        * @description Internal refernce for counting separators, so we can give them a useful class name for styling
+        * @type Number
+        */
+        _sepCount: null,
+        /**
+        * @protected
+        * @property draghandle
+        * @type HTMLElement
+        */
+        _dragHandle: null,
+        /**
+        * @protected
+        * @property _toolbarConfigs
+        * @type Object
+        */
+        _toolbarConfigs: {
+            renderer: true
+        },
+        /**
+        * @protected
+        * @property CLASS_CONTAINER
+        * @description Default CSS class to apply to the toolbar container element
+        * @type String
+        */
+        CLASS_CONTAINER: 'yui-toolbar-container',
+        /**
+        * @protected
+        * @property CLASS_DRAGHANDLE
+        * @description Default CSS class to apply to the toolbar's drag handle element
+        * @type String
+        */
+        CLASS_DRAGHANDLE: 'yui-toolbar-draghandle',
+        /**
+        * @protected
+        * @property CLASS_SEPARATOR
+        * @description Default CSS class to apply to all separators in the toolbar
+        * @type String
+        */
+        CLASS_SEPARATOR: 'yui-toolbar-separator',
+        /**
+        * @protected
+        * @property CLASS_DISABLED
+        * @description Default CSS class to apply when the toolbar is disabled
+        * @type String
+        */
+        CLASS_DISABLED: 'yui-toolbar-disabled',
+        /**
+        * @protected
+        * @property CLASS_PREFIX
+        * @description Default prefix for dynamically created class names
+        * @type String
+        */
+        CLASS_PREFIX: 'yui-toolbar',
+        /** 
+        * @method init
+        * @description The Toolbar class's initialization method
+        */
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.widget.Toolbar.superclass.init.call(this, p_oElement, p_oAttributes);
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the toolbar.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the toolbar.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.Toolbar.superclass.initAttributes.call(this, attr);
+            var el = this.get('element');
+            this.addClass(this.CLASS_CONTAINER);
+
+
+            /**
+            * @config buttons
+            * @description Object specifying the buttons to include in the toolbar
+            * Example:
+            * <code><pre>
+            * {
+            *   { id: 'b3', type: 'button', label: 'Underline', value: 'underline' },
+            *   { type: 'separator' },
+            *   { id: 'b4', type: 'menu', label: 'Align', value: 'align',
+            *       menu: [
+            *           { text: "Left", value: 'alignleft' },
+            *           { text: "Center", value: 'aligncenter' },
+            *           { text: "Right", value: 'alignright' }
+            *       ]
+            *   }
+            * }
+            * </pre></code>
+            * @type Object
+            */
+            
+            this.setAttributeConfig('buttons', {
+                value: [],
+                writeOnce: true,
+                method: function(data) {
+                    for (var i in data) {
+                        if (Lang.hasOwnProperty(data, i)) {
+                            if (data[i].type == 'separator') {
+                                this.addSeparator();
+                            } else if (data[i].group != undefined) {
+                                this.addButtonGroup(data[i]);
+                            } else {
+                                this.addButton(data[i]);
+                            }
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @config disabled
+            * @description Boolean indicating if the toolbar should be disabled. It will also disable the draggable attribute if it is on.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('disabled', {
+                value: false,
+                method: function(disabled) {
+                    if (!Lang.isObject(this._disabled)) {
+                        this._disabled = {};
+                    }
+                    if (disabled) {
+                        this.addClass(this.CLASS_DISABLED);
+                        this.set('draggable', false);
+                    } else {
+                        this.removeClass(this.CLASS_DISABLED);
+                        if (this._configs.draggable._initialConfig.value) {
+                            //Draggable by default, set it back
+                            this.set('draggable', true);
+                        }
+                    }
+                    var len = this._buttonList.length;
+                    for (var i = 0; i < len; i++) {
+                        if (disabled) {
+                            //If it's already disabled, flag it
+                            if (this._buttonList[i].get('disabled')) {
+                                this._disabled[i] = true;
+                            } else {
+                                this._disabled[i] = null;
+                            }
+                            this.disableButton(this._buttonList[i].get('id'));
+                        } else {
+                            //Check to see if it was disabled by default and skip it
+                            var _button = this._buttonList[i];
+                            var _check = _button._configs.disabled._initialConfig.value;
+                            if (this._disabled[i]) {
+                                _check = true;
+                            }
+                            if (!_check) {
+                                this.enableButton(_button.get('id'));
+                            }
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @config grouplabels
+            * @description Boolean indicating if the toolbar should show the group label's text string.
+            * @default true
+            * @type Boolean
+            */
+            this.setAttributeConfig('grouplabels', {
+                value: true,
+                writeOnce: true
+            });
+
+            /**
+            * @config cont
+            * @description Boolean indicating if the toolbar should show the group label's text string.
+            * @default true
+            * @type Boolean
+            */
+            this.setAttributeConfig('cont', {
+                value: attr.cont,
+                readOnly: true
+            });
+
+            /**
+            * @config collapse
+            * @description Boolean indicating if the the titlebar should have a collapse button.
+            * The collapse button will not remove the toolbar, it will minimize it to the titlebar
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('collapse', {
+                value: false
+            });
+            /**
+            * @config titlebar
+            * @description Boolean indicating if the toolbar should have a titlebar. If
+            * passed a string, it will use that as the titlebar text
+            * @default false
+            * @type Boolean or String
+            */
+            this.setAttributeConfig('titlebar', {
+                value: false,
+                method: function(titlebar) {
+                    if (titlebar) {
+                        if (this._titlebar && this._titlebar.parentNode) {
+                            this._titlebar.parentNode.removeChild(this._titlebar);
+                        }
+                        this._titlebar = document.createElement('DIV');
+                        Dom.addClass(this._titlebar, this.CLASS_PREFIX + '-titlebar');
+                        if (Lang.isString(titlebar)) {
+                            var h2 = document.createElement('h2');
+                            h2.tabIndex = '-1';
+                            h2.innerHTML = titlebar;
+                            this._titlebar.appendChild(h2);
+                        }
+                        if (this.get('collapse')) {
+                            var collapse = document.createElement('SPAN');
+                            collapse.innerHTML = 'X';
+                            collapse.title = this.STR_COLLAPSE;
+
+                            Dom.addClass(collapse, 'collapse');
+                            this._titlebar.appendChild(collapse);
+                            Event.addListener(collapse, 'click', function() {
+                                if (Dom.getStyle(this.get('cont'), 'display') == 'none') {
+                                    Dom.setStyle(this.get('cont'), 'display', 'block');
+                                    Dom.removeClass(collapse, 'collapsed');
+                                    this.fireEvent('toolbarExpanded', { type: 'toolbarExpanded', target: this });
+                                } else {
+                                    Dom.setStyle(this.get('cont'), 'display', 'none');
+                                    Dom.addClass(collapse, 'collapsed');
+                                    this.fireEvent('toolbarCollapsed', { type: 'toolbarCollapsed', target: this });
+                                }
+                            }, this, true);
+                        }
+                        if (this.get('draggable')) {
+                            this.dd = new YAHOO.util.DD(this.get('id'));
+                            this.dd.setHandleElId(this._titlebar);
+                            Dom.addClass(this._titlebar, 'draggable');
+                        }
+                        if (this.get('firstChild')) {
+                            this.insertBefore(this._titlebar, this.get('firstChild'));
+                        } else {
+                            this.appendChild(this._titlebar);
+                        }
+                    } else if (this._titlebar) {
+                        if (this._titlebar && this._titlebar.parentNode) {
+                            this._titlebar.parentNode.removeChild(this._titlebar);
+                        }
+                    }
+                }
+            });
+
+
+            /**
+            * @config draggable
+            * @description Boolean indicating if the toolbar should be draggable.  
+            * @default false
+            * @type Boolean
+            */
+
+            this.setAttributeConfig('draggable', {
+                value: (attr.draggable || false),
+                method: function(draggable) {
+                    var el = this.get('element');
+
+                    if (draggable && !this.get('titlebar')) {
+                        YAHOO.log('Dragging enabled', 'info', 'Toolbar');
+                        if (!this._dragHandle) {
+                            this._dragHandle = document.createElement('SPAN');
+                            this._dragHandle.innerHTML = '|';
+                            this._dragHandle.setAttribute('title', 'Click to drag the toolbar');
+                            this._dragHandle.id = this.get('id') + '_draghandle';
+                            Dom.addClass(this._dragHandle, this.CLASS_DRAGHANDLE);
+                            if (this.get('cont').hasChildNodes()) {
+                                this.get('cont').insertBefore(this._dragHandle, this.get('cont').firstChild);
+                            } else {
+                                this.get('cont').appendChild(this._dragHandle);
+                            }
+                            /**
+                            * @property dd
+                            * @description The DragDrop instance associated with the Toolbar
+                            * @type Object
+                            */
+                            this.dd = new YAHOO.util.DD(this.get('id'));
+                            this.dd.setHandleElId(this._dragHandle.id);
+                            
+                        }
+                    } else {
+                        YAHOO.log('Dragging disabled', 'info', 'Toolbar');
+                        if (this._dragHandle) {
+                            this._dragHandle.parentNode.removeChild(this._dragHandle);
+                            this._dragHandle = null;
+                            this.dd = null;
+                        }
+                    }
+                    if (this._titlebar) {
+                        if (draggable) {
+                            this.dd = new YAHOO.util.DD(this.get('id'));
+                            this.dd.setHandleElId(this._titlebar);
+                            Dom.addClass(this._titlebar, 'draggable');
+                        } else {
+                            Dom.removeClass(this._titlebar, 'draggable');
+                            if (this.dd) {
+                                this.dd.unreg();
+                                this.dd = null;
+                            }
+                        }
+                    }
+                },
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.util.DD) {
+                        ret = false;
+                    }
+                    return ret;
+                }
+            });
+
+        },
+        /**
+        * @method addButtonGroup
+        * @description Add a new button group to the toolbar. (uses addButton)
+        * @param {Object} oGroup Object literal reference to the Groups Config (contains an array of button configs)
+        */
+        addButtonGroup: function(oGroup) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addButtonGroup', arguments];
+                return false;
+            }
+            
+            if (!this.hasClass(this.CLASS_PREFIX + '-grouped')) {
+                this.addClass(this.CLASS_PREFIX + '-grouped');
+            }
+            var div = document.createElement('DIV');
+            Dom.addClass(div, this.CLASS_PREFIX + '-group');
+            Dom.addClass(div, this.CLASS_PREFIX + '-group-' + oGroup.group);
+            if (oGroup.label && this.get('grouplabels')) {
+                var label = document.createElement('h3');
+                label.innerHTML = oGroup.label;
+                div.appendChild(label);
+            }
+
+            this.get('cont').appendChild(div);
+
+            //For accessibility, let's put all of the group buttons in an Unordered List
+            var ul = document.createElement('ul');
+            div.appendChild(ul);
+
+            if (!this._buttonGroupList) {
+                this._buttonGroupList = {};
+            }
+            
+            this._buttonGroupList[oGroup.group] = ul;
+
+            for (var i = 0; i < oGroup.buttons.length; i++) {
+                var li = document.createElement('li');
+                ul.appendChild(li);
+                if ((oGroup.buttons[i].type != undefined) && oGroup.buttons[i].type == 'separator') {
+                    this.addSeparator(li);
+                } else {
+                    oGroup.buttons[i].container = li;
+                    this.addButton(oGroup.buttons[i]);
+                }
+            }
+        },
+        /**
+        * @method addButtonToGroup
+        * @description Add a new button to a toolbar group. Buttons supported:
+        *   push, split, menu, select, color, spin
+        * @param {Object} oButton Object literal reference to the Button's Config
+        * @param {String} group The Group identifier passed into the initial config
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addButtonToGroup: function(oButton, group, after) {
+            var groupCont = this._buttonGroupList[group];
+            var li = document.createElement('li');
+            oButton.container = li;
+            this.addButton(oButton, after);
+            groupCont.appendChild(li);
+        },
+        /**
+        * @method addButton
+        * @description Add a new button to the toolbar. Buttons supported:
+        *   push, split, menu, select, color, spin
+        * @param {Object} oButton Object literal reference to the Button's Config
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addButton: function(oButton, after) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addButton', arguments];
+                return false;
+            }
+            if (!this._buttonList) {
+                this._buttonList = [];
+            }
+            //Add to .get('buttons') manually
+            this._configs.buttons.value[this._configs.buttons.value.length] = oButton;
+            YAHOO.log('Adding button of type: ' + oButton.type, 'info', 'Toolbar');
+            if (!oButton.container) {
+                oButton.container = this.get('cont');
+            }
+
+            if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
+                if (Lang.isArray(oButton.menu)) {
+                    for (var i in oButton.menu) {
+                        if (Lang.hasOwnProperty(oButton.menu, i)) {
+                            var funcObject = {
+                                fn: function(ev, x, oMenu) {
+                                    if (!oButton.menucmd) {
+                                        oButton.menucmd = oButton.value;
+                                    }
+                                    oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
+                                    //This line made Opera fire the click event and the mousedown,
+                                    //  so events for menus where firing twice.
+                                    //this._buttonClick('click', oButton);
+                                },
+                                scope: this
+                            }
+                            oButton.menu[i].onclick = funcObject;
+                        }
+                    }
+                }
+            }
+            var _oButton = {};
+            for (var i in oButton) {
+                if (Lang.hasOwnProperty(oButton, i)) {
+                    if (!this._toolbarConfigs[i]) {
+                        _oButton[i] = oButton[i];
+                    }
+                }
+            }
+            if (oButton.type == 'select') {
+                _oButton.type = 'menu';
+            }
+            if (oButton.type == 'spin') {
+                _oButton.type = 'push';
+            }
+            if (_oButton.type == 'color') {
+                _oButton = this._makeColorButton(_oButton);
+            }
+            if (_oButton.menu) {
+                if (oButton.menu instanceof YAHOO.widget.Overlay) {
+                    oButton.menu.showEvent.subscribe(function() {
+                        this._button = _oButton;
+                    });
+                } else {
+                    for (var i = 0; i < _oButton.menu.length; i++) {
+                        if (!_oButton.menu[i].value) {
+                            _oButton.menu[i].value = _oButton.menu[i].text;
+                        }
+                    }
+                    if (this.browser.webkit) {
+                        _oButton.focusmenu = false;
+                    }
+                }
+            }
+            var tmp = new YAHOO.widget.Button(_oButton);
+            if (this.get('disabled')) {
+                //Toolbar is disabled, disable the new button too!
+                tmp.set('disabled', true);
+            }
+            if (!oButton.id) {
+                oButton.id = tmp.get('id');
+            }
+            YAHOO.log('Button created (' + oButton.type + ')', 'info', 'Toolbar');
+            
+            if (after) {
+                var el = tmp.get('element');
+                var nextSib = null;
+                if (after.get) {
+                    nextSib = after.get('element').nextSibling;
+                } else if (after.nextSibling) {
+                    nextSib = after.nextSibling;
+                }
+                if (nextSib) {
+                    nextSib.parentNode.insertBefore(el, nextSib);
+                }
+            }
+            tmp.addClass(this.CLASS_PREFIX + '-' + tmp.get('value'));
+            var icon = document.createElement('span');
+            icon.className = this.CLASS_PREFIX + '-icon';
+            tmp.get('element').insertBefore(icon, tmp.get('firstChild'));
+            //Replace the Button HTML Element with an a href
+            var a = document.createElement('a');
+            a.innerHTML = tmp._button.innerHTML;
+            a.href = '#';
+            Event.on(a, 'click', function(ev) {
+                Event.stopEvent(ev);
+            });
+            tmp._button.parentNode.replaceChild(a, tmp._button);
+            tmp._button = a;
+
+            if (oButton.type == 'select') {
+                tmp.addClass(this.CLASS_PREFIX + '-select');
+            }
+            if (oButton.type == 'spin') {
+                if (!Lang.isArray(oButton.range)) {
+                    oButton.range = [ 10, 100 ];
+                }
+                this._makeSpinButton(tmp, oButton);
+            }
+
+            tmp.get('element').setAttribute('title', tmp.get('label'));
+
+            if (oButton.type != 'spin') {
+                if (_oButton.menu instanceof YAHOO.widget.Overlay) {
+                    var showPicker = function(ev) {
+                        var exec = true;
+                        if (ev.keyCode && (ev.keyCode == 9)) {
+                            exec = false;
+                        }
+                        if (exec) {
+                            this._colorPicker._button = oButton.value;
+                            var menuEL = tmp.getMenu().element;
+                            if (menuEL.style.visibility == 'hidden') {
+                                tmp.getMenu().show();
+                            } else {
+                                tmp.getMenu().hide();
+                            }
+                        }
+                        YAHOO.util.Event.stopEvent(ev);
+                    };
+                    tmp.on('mousedown', showPicker, oButton, this);
+                    tmp.on('keydown', showPicker, oButton, this);
+                    
+                } else if ((oButton.type != 'menu') && (oButton.type != 'select')) {
+                    tmp.on('keypress', this._buttonClick, oButton, this);
+                    tmp.on('mousedown', function(ev) {
+                        this._buttonClick(ev, oButton);
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                } else {
+                    //Stop the mousedown event so we can trap the selection in the editor!
+                    tmp.on('mousedown', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    });
+                    tmp.on('click', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    });
+                    var self = this;
+                    //Hijack the mousedown event in the menu and make it fire a button click..
+                    tmp.getMenu().mouseDownEvent.subscribe(function(ev, args) {
+                        YAHOO.log('mouseDownEvent', 'warn', 'Toolbar');
+                        var oMenu = args[1];
+                        YAHOO.util.Event.stopEvent(args[0]);
+                        tmp._onMenuClick(args[0], tmp);
+                        if (!oButton.menucmd) {
+                            oButton.menucmd = oButton.value;
+                        }
+                        oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
+                        self._buttonClick.call(self, args[1], oButton);
+                        tmp._hideMenu();
+                        return false;
+                    });
+                    tmp.getMenu().clickEvent.subscribe(function(ev, args) {
+                        YAHOO.log('clickEvent', 'warn', 'Toolbar');
+                        YAHOO.util.Event.stopEvent(args[0]);
+                    });
+                }
+            } else {
+                //Stop the mousedown event so we can trap the selection in the editor!
+                tmp.on('mousedown', function(ev) {
+                    YAHOO.util.Event.stopEvent(ev);
+                });
+                tmp.on('click', function(ev) {
+                    YAHOO.util.Event.stopEvent(ev);
+                });
+            }
+            if (this.browser.ie) {
+                //Add a couple of new events for IE
+                tmp.DOM_EVENTS.focusin = true;
+                tmp.DOM_EVENTS.focusout = true;
+                
+                //Stop them so we don't loose focus in the Editor
+                tmp.on('focusin', function(ev) {
+                    YAHOO.util.Event.stopEvent(ev);
+                }, oButton, this);
+                
+                tmp.on('focusout', function(ev) {
+                    YAHOO.util.Event.stopEvent(ev);
+                }, oButton, this);
+                tmp.on('click', function(ev) {
+                    YAHOO.util.Event.stopEvent(ev);
+                }, oButton, this);
+            }
+            if (this.browser.webkit) {
+                //This will keep the document from gaining focus and the editor from loosing it..
+                //Forcefully remove the focus calls in button!
+                tmp.hasFocus = function() {
+                    return true;
+                }
+            }
+            this._buttonList[this._buttonList.length] = tmp;
+            if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
+                if (Lang.isArray(oButton.menu)) {
+                    YAHOO.log('Button type is (' + oButton.type + '), doing extra renderer work.', 'info', 'Toolbar');
+                    var menu = tmp.getMenu();
+                    menu.renderEvent.subscribe(_addMenuClasses, tmp);
+                    if (oButton.renderer) {
+                        menu.renderEvent.subscribe(oButton.renderer, tmp);
+                    }
+                }
+            }
+            return oButton;
+        },
+        /**
+        * @method addSeparator
+        * @description Add a new button separator to the toolbar.
+        * @param {HTMLElement} cont Optional HTML element to insert this button into.
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addSeparator: function(cont, after) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addSeparator', arguments];
+                return false;
+            }
+            var sepCont = ((cont) ? cont : this.get('cont'));
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addSeparator', arguments];
+                return false;
+            }
+            if (this._sepCount == null) {
+                this._sepCount = 0;
+            }
+            if (!this._sep) {
+                YAHOO.log('Separator does not yet exist, creating', 'info', 'Toolbar');
+                this._sep = document.createElement('SPAN');
+                Dom.addClass(this._sep, this.CLASS_SEPARATOR);
+                this._sep.innerHTML = '|';
+            }
+            YAHOO.log('Separator does exist, cloning', 'info', 'Toolbar');
+            var _sep = this._sep.cloneNode(true);
+            this._sepCount++;
+            Dom.addClass(_sep, this.CLASS_SEPARATOR + '-' + this._sepCount);
+            if (after) {
+                var nextSib = null;
+                if (after.get) {
+                    nextSib = after.get('element').nextSibling;
+                } else if (after.nextSibling) {
+                    nextSib = after.nextSibling;
+                } else {
+                    nextSib = after;
+                }
+                if (nextSib) {
+                    if (nextSib == after) {
+                        nextSib.parentNode.appendChild(_sep);
+                    } else {
+                        nextSib.parentNode.insertBefore(_sep, nextSib);
+                    }
+                }
+            } else {
+                sepCont.appendChild(_sep);
+            }
+            return _sep;
+        },
+        /**
+        * @method _createColorPicker
+        * @private
+        * @description Creates the core DOM reference to the color picker menu item.
+        * @param {String} id the id of the toolbar to prefix this DOM container with.
+        */
+        _createColorPicker: function(id) {
+            if (Dom.get(id + '_colors')) {
+               Dom.get(id + '_colors').parentNode.removeChild(Dom.get(id + '_colors'));
+            }
+            var picker = document.createElement('div');
+            picker.className = 'yui-toolbar-colors';
+            picker.id = id + '_colors';
+            picker.style.display = 'none';
+            Event.on(window, 'load', function() {
+                document.body.appendChild(picker);
+            }, this, true);
+
+            this._colorPicker = picker;
+
+            var html = '';
+            for (var i in this._colorData) {
+                if (Lang.hasOwnProperty(this._colorData, i)) {
+                    html += '<a style="background-color: ' + i + '" href="#">' + i.replace('#', '') + '</a>';
+                }
+            }
+            html += '<span><em>X</em><strong></strong></span>';
+            picker.innerHTML = html;
+            var em = picker.getElementsByTagName('em')[0];
+            var strong = picker.getElementsByTagName('strong')[0];
+
+            Event.on(picker, 'mouseover', function(ev) {
+                var tar = Event.getTarget(ev);
+                if (tar.tagName.toLowerCase() == 'a') {
+                    em.style.backgroundColor = tar.style.backgroundColor;
+                    strong.innerHTML = this._colorData['#' + tar.innerHTML] + '<br>' + tar.innerHTML;
+                }
+            }, this, true);
+            Event.on(picker, 'focus', function(ev) {
+                Event.stopEvent(ev);
+            });
+            Event.on(picker, 'click', function(ev) {
+                Event.stopEvent(ev);
+            });
+            Event.on(picker, 'mousedown', function(ev) {
+                Event.stopEvent(ev);
+                var tar = Event.getTarget(ev);
+                if (tar.tagName.toLowerCase() == 'a') {
+                    this.fireEvent('colorPickerClicked', { type: 'colorPickerClicked', target: this, button: this._colorPicker._button, color: tar.innerHTML, colorName: this._colorData['#' + tar.innerHTML] } );
+                    this.getButtonByValue(this._colorPicker._button).getMenu().hide();
+                }
+            }, this, true);
+        },
+        /**
+        * @method _resetColorPicker
+        * @private
+        * @description Clears the currently selected color or mouseover color in the color picker.
+        */
+        _resetColorPicker: function() {
+            var em = this._colorPicker.getElementsByTagName('em')[0];
+            var strong = this._colorPicker.getElementsByTagName('strong')[0];
+            em.style.backgroundColor = 'transparent';
+            strong.innerHTML = '';
+        },
+        /**
+        * @method _makeColorButton
+        * @private
+        * @description Called to turn a "color" button into a menu button with an Overlay for the menu.
+        * @param {Object} _oButton <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> reference
+        */
+        _makeColorButton: function(_oButton) {
+            if (!this._colorPicker) {   
+                this._createColorPicker(this.get('id'));
+            }
+            _oButton.type = 'color';
+            _oButton.menu = new YAHOO.widget.Overlay(this.get('id') + '_' + _oButton.value + '_menu', { visbile: false, position: 'absolute' });
+            _oButton.menu.setBody('');
+            _oButton.menu.render(this.get('cont'));
+            _oButton.menu.beforeShowEvent.subscribe(function() {
+                _oButton.menu.cfg.setProperty('zindex', 5); //Re Adjust the overlays zIndex.. not sure why.
+                _oButton.menu.cfg.setProperty('context', [this.getButtonById(_oButton.id).get('element'), 'tl', 'bl']); //Re Adjust the overlay.. not sure why.
+                //Move the DOM reference of the color picker to the Overlay that we are about to show.
+                this._resetColorPicker();
+                var _p = this._colorPicker;
+                if (_p.parentNode) {
+                    //if (_p.parentNode != _oButton.menu.body) {
+                        _p.parentNode.removeChild(_p);
+                    //}
+                }
+                _oButton.menu.setBody('');
+                _oButton.menu.appendToBody(_p);
+                this._colorPicker.style.display = 'block';
+            }, this, true);
+            return _oButton;
+        },
+        /**
+        * @private
+        * @method _makeSpinButton
+        * @description Create a button similar to an OS Spin button.. It has an up/down arrow combo to scroll through a range of int values.
+        * @param {Object} _button <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> reference
+        * @param {Object} oButton Object literal containing the buttons initial config
+        */
+        _makeSpinButton: function(_button, oButton) {
+            _button.addClass(this.CLASS_PREFIX + '-spinbutton');
+            var self = this,
+                _par = _button._button.parentNode.parentNode, //parentNode of Button Element for appending child
+                range = oButton.range,
+                _b1 = document.createElement('a'),
+                _b2 = document.createElement('a');
+                _b1.href = '#';
+                _b2.href = '#';
+            
+            //Setup the up and down arrows
+            _b1.className = 'up';
+            _b1.title = this.STR_SPIN_UP;
+            _b1.innerHTML = this.STR_SPIN_UP;
+            _b2.className = 'down';
+            _b2.title = this.STR_SPIN_DOWN;
+            _b2.innerHTML = this.STR_SPIN_DOWN;
+
+            //Append them to the container
+            _par.appendChild(_b1);
+            _par.appendChild(_b2);
+            
+            var label = YAHOO.lang.substitute(this.STR_SPIN_LABEL, { VALUE: _button.get('label') });
+            _button.set('title', label);
+
+            var cleanVal = function(value) {
+                value = ((value < range[0]) ? range[0] : value);
+                value = ((value > range[1]) ? range[1] : value);
+                return value;
+            };
+
+            var br = this.browser;
+            var tbar = false;
+            var strLabel = this.STR_SPIN_LABEL;
+            if (this._titlebar && this._titlebar.firstChild) {
+                tbar = this._titlebar.firstChild;
+            }
+            
+            var _intUp = function(ev) {
+                YAHOO.util.Event.stopEvent(ev);
+                if (!_button.get('disabled') && (ev.keyCode != 9)) {
+                    var value = parseInt(_button.get('label'));
+                    value++;
+                    value = cleanVal(value);
+                    _button.set('label', ''+value);
+                    var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') });
+                    _button.set('title', label);
+                    if (!br.webkit && tbar) {
+                        //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed
+                        //_button.focus();
+                    }
+                    self._buttonClick(ev, oButton);
+                }
+            };
+
+            var _intDown = function(ev) {
+                YAHOO.util.Event.stopEvent(ev);
+                if (!_button.get('disabled') && (ev.keyCode != 9)) {
+                    var value = parseInt(_button.get('label'));
+                    value--;
+                    value = cleanVal(value);
+
+                    _button.set('label', ''+value);
+                    var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') });
+                    _button.set('title', label);
+                    if (!br.webkit && tbar) {
+                        //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed
+                        //_button.focus();
+                    }
+                    self._buttonClick(ev, oButton);
+                }
+            };
+
+            var _intKeyUp = function(ev) {
+                if (ev.keyCode == 38) {
+                    _intUp(ev);
+                } else if (ev.keyCode == 40) {
+                    _intDown(ev);
+                } else if (ev.keyCode == 107 && ev.shiftKey) {  //Plus Key
+                    _intUp(ev);
+                } else if (ev.keyCode == 109 && ev.shiftKey) {  //Minus Key
+                    _intDown(ev);
+                }
+            };
+
+            //Handle arrow keys..
+            _button.on('keydown', _intKeyUp, this, true);
+
+            //Listen for the click on the up button and act on it
+            //Listen for the click on the down button and act on it
+            Event.on(_b1, 'mousedown',function(ev) {
+                Event.stopEvent(ev);
+            }, this, true);
+            Event.on(_b2, 'mousedown', function(ev) {
+                Event.stopEvent(ev);
+            }, this, true);
+            Event.on(_b1, 'click', _intUp, this, true);
+            Event.on(_b2, 'click', _intDown, this, true);
+        },
+        /**
+        * @protected
+        * @method _buttonClick
+        * @description Click handler for all buttons in the toolbar.
+        * @param {String} ev The event that was passed in.
+        * @param {Object} info Object literal of information about the button that was clicked.
+        */
+        _buttonClick: function(ev, info) {
+            var doEvent = true;
+            
+            if (ev && ev.type == 'keypress') {
+                if (ev.keyCode == 9) {
+                    doEvent = false;
+                } else if ((ev.keyCode == 13) || (ev.keyCode == 0) || (ev.keyCode == 32)) {
+                } else {
+                    doEvent = false;
+                }
+            }
+
+            if (doEvent) {
+                if (info.value) {
+                    YAHOO.log('fireEvent::' + info.value + 'Click', 'info', 'Toolbar');
+                    this.fireEvent(info.value + 'Click', { type: info.value + 'Click', target: this.get('element'), button: info });
+                }
+                
+                if (info.menucmd) {
+                    YAHOO.log('fireEvent::' + info.menucmd + 'Click', 'info', 'Toolbar');
+                    this.fireEvent(info.menucmd + 'Click', { type: info.menucmd + 'Click', target: this.get('element'), button: info });
+                }
+                
+                YAHOO.log('fireEvent::buttonClick', 'info', 'Toolbar');
+                this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
+
+                if (info.type == 'select') {
+                    var button = this.getButtonById(info.id);
+                    var txt = info.value;
+                    for (var i = 0; i < info.menu.length; i++) {
+                        if (info.menu[i].value == info.value) {
+                            txt = info.menu[i].text;
+                            break;
+                        }
+                    }
+                    button.set('label', '<span class="yui-toolbar-' + info.menucmd + '-' + (info.value).replace(/ /g, '-').toLowerCase() + '">' + txt + '</span>');
+                    var _items = button.getMenu().getItems();
+                    for (var m = 0; m < _items.length; m++) {
+                        if (_items[m].value.toLowerCase() == info.value.toLowerCase()) {
+                            _items[m].cfg.setProperty('checked', true);
+                        } else {
+                            _items[m].cfg.setProperty('checked', false);
+                        }
+                    }
+                }
+            }
+            if (ev) {
+                Event.stopEvent(ev);
+            }
+        },
+        /**
+        * @method getButtonById
+        * @description Gets a button instance from the toolbar by is Dom id.
+        * @param {String} id The Dom id to query for.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        */
+        getButtonById: function(id) {
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                if (this._buttonList[i].get('id') == id) {
+                    return this._buttonList[i];
+                }
+            }
+            return false;
+        },
+        /**
+        * @method getButtonByValue
+        * @description Gets a button instance or a menuitem instance from the toolbar by it's value.
+        * @param {String} value The button value to query for.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> or <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a>}
+        */
+        getButtonByValue: function(value) {
+            var _buttons = this.get('buttons');
+            var len = _buttons.length;
+            for (var i = 0; i < len; i++) {
+                if (_buttons[i].group != undefined) {
+                    for (var m = 0; m < _buttons[i].buttons.length; m++) {
+                        if ((_buttons[i].buttons[m].value == value) || (_buttons[i].buttons[m].menucmd == value)) {
+                            return this.getButtonById(_buttons[i].buttons[m].id);
+                        }
+                        if (_buttons[i].buttons[m].menu) { //Menu Button, loop through the values
+                            for (var s = 0; s < _buttons[i].buttons[m].menu.length; s++) {
+                                if (_buttons[i].buttons[m].menu[s].value == value) {
+                                    return this.getButtonById(_buttons[i].buttons[m].id);
+                                }
+                            }
+                        }
+                    }
+                } else {
+                    if ((_buttons[i].value == value) || (_buttons[i].menucmd == value)) {
+                        return this.getButtonById(_buttons[i].id);
+                    }
+                    if (_buttons[i].menu) { //Menu Button, loop through the values
+                        for (var s = 0; s < _buttons[i].menu.length; s++) {
+                            if (_buttons[i].menu[s].value == value) {
+                                return this.getButtonById(_buttons[i].id);
+                            }
+                        }
+                    }
+                }
+            }
+            return false;
+        },
+        /**
+        * @method getButtonByIndex
+        * @description Gets a button instance from the toolbar by is index in _buttonList.
+        * @param {Number} index The index of the button in _buttonList.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        */
+        getButtonByIndex: function(index) {
+            if (this._buttonList[index]) {
+                return this._buttonList[index];
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method getButtons
+        * @description Returns an array of buttons in the current toolbar
+        * @return {Array}
+        */
+        getButtons: function() {
+            return this._buttonList;
+        },
+        /**
+        * @method disableButton
+        * @description Disables a button in the toolbar.
+        * @param {String/Number} button Disable a button by it's id or index.
+        * @return {Boolean}
+        */
+        disableButton: function(button) {
+            if (Lang.isString(button)) {
+                var button = this.getButtonById(button);
+            }
+            if (Lang.isNumber(button)) {
+                var button = this.getButtonByIndex(button);
+            }
+            if (button instanceof YAHOO.widget.Button) {
+                button.set('disabled', true);
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method enableButton
+        * @description Enables a button in the toolbar.
+        * @param {String/Number} button Enable a button by it's id or index.
+        * @return {Boolean}
+        */
+        enableButton: function(button) {
+            if (Lang.isString(button)) {
+                var button = this.getButtonById(button);
+            }
+            if (Lang.isNumber(button)) {
+                var button = this.getButtonByIndex(button);
+            }
+            if (button instanceof YAHOO.widget.Button) {
+                button.set('disabled', false);
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method selectButton
+        * @description Selects a button in the toolbar.
+        * @param {String/Number} button select a button by it's id or index.
+        * @return {Boolean}
+        */
+        selectButton: function(button, value) {
+            if (button) {
+                if (Lang.isString(button)) {
+                    var button = this.getButtonById(button);
+                }
+                if (Lang.isNumber(button)) {
+                    var button = this.getButtonByIndex(button);
+                }
+                if (button instanceof YAHOO.widget.Button) {
+                    button.addClass('yui-button-selected');
+                    button.addClass('yui-button-' + button.get('value') + '-selected');
+                    if (value) {
+                        var _items = button.getMenu().getItems();
+                        for (var m = 0; m < _items.length; m++) {
+                            if (_items[m].value == value) {
+                                _items[m].cfg.setProperty('checked', true);
+                                button.set('label', '<span class="yui-toolbar-' + button.get('value') + '-' + (value).replace(/ /g, '-').toLowerCase() + '">' + _items[m]._oText.nodeValue + '</span>');
+                            } else {
+                                _items[m].cfg.setProperty('checked', false);
+                            }
+                        }
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        /**
+        * @method deselectButton
+        * @description Deselects a button in the toolbar.
+        * @param {String/Number} button Deselect a button by it's id or index.
+        * @return {Boolean}
+        */
+        deselectButton: function(button) {
+            if (Lang.isString(button)) {
+                var button = this.getButtonById(button);
+            }
+            if (Lang.isNumber(button)) {
+                var button = this.getButtonByIndex(button);
+            }
+            if (button instanceof YAHOO.widget.Button) {
+                button.removeClass('yui-button-selected');
+                button.removeClass('yui-button-' + button.get('value') + '-selected');
+                button.removeClass('yui-button-hover');
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method deselectAllButtons
+        * @description Deselects all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        deselectAllButtons: function() {
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.deselectButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method destroyButton
+        * @description Destroy a button in the toolbar.
+        * @param {String/Number} button Destroy a button by it's id or index.
+        * @return {Boolean}
+        */
+        destroyButton: function(button) {
+            if (Lang.isString(button)) {
+                var button = this.getButtonById(button);
+            }
+            if (Lang.isNumber(button)) {
+                var button = this.getButtonByIndex(button);
+            }
+            if (button instanceof YAHOO.widget.Button) {
+                var id = button.get('id');
+                button.destroy();
+
+                var len = this._buttonList.length;
+                for (var i = 0; i < len; i++) {
+                    if (this._buttonList[i].get('id') == id) {
+                        this._buttonList[i] = null;
+                    }
+                }
+            } else {
+                return false;
+            }
+
+        },
+        /**
+        * @method destroy
+        * @description Destroys the toolbar, all of it's elements and objects.
+        * @return {Boolean}
+        */
+        destroy: function() {
+            this.get('element').innerHTML = '';
+            this.get('element').className = '';
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+            return true;
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the toolbar.
+        * @return {String}
+        */
+        toString: function() {
+            return 'Toolbar (#' + this.get('element').id + ') with ' + this._buttonList.length + ' buttons.';
+        }
+    });
+/**
+* @event buttonClick
+* @param {Object} o The object passed to this handler is the button config used to create the button.
+* @description Fires when any botton receives a click event. Passes back a single object representing the buttons config object. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event valueClick
+* @param {Object} o The object passed to this handler is the button config used to create the button.
+* @description This is a special dynamic event that is created and dispatched based on the value property
+* of the button config. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* Example:
+* <code><pre>
+* buttons : [
+*   { type: 'button', value: 'test', value: 'testButton' }
+* ]</pre>
+* </code>
+* With the valueClick event you could subscribe to this buttons click event with this:
+* tbar.in('testButtonClick', function() { alert('test button clicked'); })
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event toolbarExpanded
+* @description Fires when the toolbar is expanded via the collapse button. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event toolbarCollapsed
+* @description Fires when the toolbar is collapsed via the collapse button. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+})();
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+*/
+/**
+ * @module editor
+ * @description <p>The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event, toolbar, container, menu, button
+ * @optional dragdrop, animation
+ * @beta
+ */
+
+(function() {
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang,
+    DD = YAHOO.util.DD,
+    Toolbar = YAHOO.widget.Toolbar;
+
+
+    /**
+     * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.
+     * @constructor
+     * @class Editor
+     * @extends YAHOO.util.Element
+     * @param {String/HTMLElement} el The textarea element to turn into an editor.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    
+    YAHOO.widget.Editor = function(el, attrs) {
+        YAHOO.log('Editor Initalizing', 'info', 'Editor');
+
+        var oConfig = {
+            element: null,
+            attributes: (attrs || {})
+        }
+
+        if (Lang.isString(el)) {
+            oConfig.attributes.textarea = Dom.get(el);
+        }
+        
+        var element_cont = document.createElement('DIV');
+        oConfig.attributes.element_cont = new YAHOO.util.Element(element_cont, {
+            id: oConfig.attributes.textarea.id + '_container'
+        });
+        oConfig.attributes.element_cont.setStyle('display', 'none');
+
+        oConfig.element = oConfig.attributes.textarea;
+
+        var div = document.createElement('div');
+        oConfig.attributes.element_cont.appendChild(div);
+        
+        if (!oConfig.attributes.toolbar_cont) {
+            oConfig.attributes.toolbar_cont = document.createElement('DIV');
+            oConfig.attributes.toolbar_cont.id = oConfig.attributes.textarea.id + '_toolbar';
+            div.appendChild(oConfig.attributes.toolbar_cont);
+        }
+        
+        if (!oConfig.attributes.iframe) {
+            oConfig.attributes.iframe = _createIframe(oConfig.attributes.textarea.id);
+            var editorWrapper = document.createElement('DIV');
+            editorWrapper.appendChild(oConfig.attributes.iframe.get('element'));
+            div.appendChild(editorWrapper);
+        }
+
+        Event.onDOMReady(function() {
+            this.DOMReady = true;
+            this.fireQueue();
+        }, this, true);
+
+        YAHOO.widget.Editor.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+    }
+
+    /**
+    * @private _cleanClassName
+    * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -'s.
+    * @param {String} str The classname to clean up
+    * @returns {String}
+    */
+    function _cleanClassName(str) {
+        return str.replace(/ /g, '-').toLowerCase();
+    }
+
+    /**
+    * @private _createIframe
+    * @description Creates the DOM and YUI Element for the iFrame editor area.
+    * @param {String} id The string ID to prefix the iframe with
+    * @returns {Object} iFrame object
+    */
+    function _createIframe(id) {
+        var ifrmID = id + '_editor';
+        var ifrmDom = document.createElement('iframe');
+        ifrmDom.id = ifrmID;
+        var config = {
+            border: '0',
+            frameBorder: '0',
+            marginWidth: '0',
+            marginHeight: '0',
+            leftMargin: '0',
+            topMargin: '0',
+            allowTransparency: 'true',
+            width: '100%',
+            src: 'javascript:false'
+        }
+        for (var i in config) {
+            if (Lang.hasOwnProperty(config, i)) {
+                ifrmDom.setAttribute(i, config[i]);
+            }
+        }
+
+        var ifrm = new YAHOO.util.Element(ifrmDom);
+        ifrm.setStyle('zIndex', '-1');
+        return ifrm;
+    }
+
+    YAHOO.extend(YAHOO.widget.Editor, YAHOO.util.Element, {
+        /**
+        * @property DOMReady
+        * @private
+        * @description Flag to determine if DOM is ready or not
+        * @type Boolean
+        */
+        DOMReady: null,
+        /**
+        * @property _selection
+        * @private
+        * @description Holder for caching iframe selections
+        * @type Object
+        */
+        _selection: null,
+        /**
+        * @property _mask
+        * @private
+        * @description DOM Element holder for the editor Mask when disabled
+        * @type Object
+        */
+        _mask: null,
+        /**
+        * @property _showingHiddenElements
+        * @private
+        * @description Status of the hidden elements button
+        * @type Boolean
+        */
+        _showingHiddenElements: null,
+        /**
+        * @property currentWindow
+        * @description A reference to the currently open EditorWindow
+        * @type Object
+        */
+        currentWindow: null,
+        /**
+        * @property currentEvent
+        * @description A reference to the current editor event
+        * @type Event
+        */
+        currentEvent: null,
+        /**
+        * @property operaEvent
+        * @private
+        * @description setTimeout holder for Opera and Image DoubleClick event..
+        * @type Object
+        */
+        operaEvent: null,
+        /**
+        * @property currentFont
+        * @description A reference to the last font selected from the Toolbar
+        * @type HTMLElement
+        */
+        currentFont: null,
+        /**
+        * @property currentElement
+        * @description A reference to the current working element in the editor
+        * @type Array
+        */
+        currentElement: [],
+        /**
+        * @property dompath
+        * @description A reference to the dompath container for writing the current working dom path to.
+        * @type HTMLElement
+        */
+        dompath: null,
+        /**
+        * @property beforeElement
+        * @description A reference to the H2 placed before the editor for Accessibilty.
+        * @type HTMLElement
+        */
+        beforeElement: null,
+        /**
+        * @property afterElement
+        * @description A reference to the H2 placed after the editor for Accessibilty.
+        * @type HTMLElement
+        */
+        afterElement: null,
+        /**
+        * @property invalidHTML
+        * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found.
+        * @type Object
+        */
+        invalidHTML: {
+            form: true,
+            input: true,
+            button: true,
+            select: true,
+            link: true,
+            html: true,
+            body: true,
+            script: true,
+            style: true,
+            textarea: true
+        },
+        /**
+        * @property toolbar
+        * @description Local property containing the <a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a> instance
+        * @type <a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a>
+        */
+        toolbar: null,
+        /**
+        * @private
+        * @property _contentTimer
+        * @description setTimeout holder for documentReady check
+        */
+        _contentTimer: null,
+        /**
+        * @private
+        * @property _contentTimerCounter
+        * @description Counter to check the number of times the body is polled for before giving up
+        * @type Number
+        */
+        _contentTimerCounter: 0,
+        /**
+        * @private
+        * @property _disabled
+        * @description The Toolbar items that should be disabled if there is no selection present in the editor.
+        * @type Array
+        */
+        _disabled: [ 'createlink', 'forecolor', 'backcolor', 'fontname', 'fontsize', 'superscript', 'subscript', 'removeformat', 'heading', 'indent', 'outdent' ],
+        /**
+        * @private
+        * @property _alwaysDisabled
+        * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor.
+        * @type Object
+        */
+        _alwaysDisabled: { },
+        /**
+        * @private
+        * @property _alwaysEnabled
+        * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor.
+        * @type Object
+        */
+        _alwaysEnabled: { hiddenelements: true },
+        /**
+        * @private
+        * @property _semantic
+        * @description The Toolbar commands that we should attempt to make tags out of instead of using styles.
+        * @type Object
+        */
+        _semantic: { 'bold': true, 'italic' : true, 'underline' : true },
+        /**
+        * @private
+        * @property _tag2cmd
+        * @description A tag map of HTML tags to convert to the different types of commands so we can select the proper toolbar button.
+        * @type Object
+        */
+        _tag2cmd: {
+            'b': 'bold',
+            'strong': 'bold',
+            'i': 'italic',
+            'em': 'italic',
+            'u': 'underline',
+            'blockquote': 'formatblock',
+            'sup': 'superscript',
+            'sub': 'subscript',
+            'img': 'insertimage',
+            'a' : 'createlink',
+            'ul' : 'insertunorderedlist',
+            'ol' : 'insertorderedlist',
+            'indent' : 'indent',
+            'outdent' : 'outdent'
+        },
+        /**
+        * @private
+        * @method _getDoc
+        * @description Get the Document of the IFRAME
+        * @return {Object}
+        */
+        _getDoc: function() {
+            //if (this.get && this.get('iframe') && this.get('iframe').get && this.get('iframe').get('element') && this.get('iframe').get('element').contentWindow && this.get('iframe').get('element').contentWindow.document) {
+            var value = false;
+            if (this.get) {
+                if (this.get('iframe')) {
+                    if (this.get('iframe').get) {
+                        if (this.get('iframe').get('element')) {
+                            try {
+                                if (this.get('iframe').get('element').contentWindow) {
+                                    if (this.get('iframe').get('element').contentWindow.document) {
+                                        value = this.get('iframe').get('element').contentWindow.document;
+                                    }
+                                }
+                            } catch (e) {}
+                        }
+                    }
+                }
+            }
+            return value;
+        },
+        /**
+        * @private
+        * @method _getWindow
+        * @description Get the Window of the IFRAME
+        * @return {Object}
+        */
+        _getWindow: function() {
+            return this.get('iframe').get('element').contentWindow;
+        },
+        /**
+        * @private
+        * @method _focusWindow
+        * @description Attempt to set the focus of the iframes window.
+        * @param {Boolean} onLoad Safari needs some special care to set the cursor in the iframe
+        */
+        _focusWindow: function(onLoad) {
+            if (this.browser.webkit) {
+                if (onLoad) {
+                    /**
+                    * @knownissue Safari Cursor Position
+                    * @browser Safari 2.x
+                    * @description Can't get Safari to place the cursor at the beginning of the text..
+                    * This workaround at least set's the toolbar into the proper state.
+                    */
+                    this._getSelection().setBaseAndExtent(this._getDoc().body, 0, this._getDoc().body, 1);
+                    this._getSelection().collapse(false);   
+                } else {
+                    this._getSelection().setBaseAndExtent(this._getDoc().body, 1, this._getDoc().body, 1);
+                    this._getSelection().collapse(false);   
+                }
+                this._getWindow().focus();
+                //Check for.webkit3
+                if (this._getDoc().queryCommandEnabled('insertimage')) {
+                    this.browser.webkit3 = true;
+                }
+            } else {
+                this._getWindow().focus();
+            }
+        },
+        /**
+        * @private
+        * @method _hasSelection
+        * @description Determines if there is a selection in the editor document.
+        * @returns {Boolean}
+        */
+        _hasSelection: function() {
+            var sel = this._getSelection();
+            var range = this._getRange();
+            var hasSel = false;
+
+            //Internet Explorer
+            if (this.browser.ie || this.browser.opera) {
+                if (range.text) {
+                    hasSel = true;
+                }
+                if (range.html) {
+                    hasSel = true;
+                }
+            } else {
+                if ((sel != '') && (sel != undefined)) {
+                    hasSel = true;
+                }
+            }
+            return hasSel;
+        },
+        /**
+        * @private
+        * @method _getSelection
+        * @description Handles the different selection objects across the A-Grade list.
+        * @returns {Object} Selection Object
+        */
+        _getSelection: function() {
+            var _sel = null;
+            if (this._getDoc() && this._getWindow()) {
+                if (this._getDoc().selection) {
+                    _sel = this._getDoc().selection;
+                } else {
+                    _sel = this._getWindow().getSelection();
+                }
+                //Handle Safari's lack of Selection Object
+                if (this.browser.webkit) {
+                    if (_sel.baseNode) {
+                            this._selection = new Object();
+                            this._selection.baseNode = _sel.baseNode;
+                            this._selection.baseOffset = _sel.baseOffset;
+                            this._selection.extentNode = _sel.extentNode;
+                            this._selection.extentOffset = _sel.extentOffset;
+                    } else if (this._selection != null) {
+                        _sel = this._getWindow().getSelection();
+                        _sel.setBaseAndExtent(
+                            this._selection.baseNode,
+                            this._selection.baseOffset,
+                            this._selection.extentNode,
+                            this._selection.extentOffset
+                        );
+                        this._selection = null;
+                    }
+                }
+            }
+            return _sel;
+        },
+        /**
+        * @private
+        * @method _getRange
+        * @description Handles the different range objects across the A-Grade list.
+        * @returns {Object} Range Object
+        */
+        _getRange: function(sel) {
+            var sel = this._getSelection();
+
+            if (sel == null) {
+                return null;
+            }
+
+            if (this.browser.webkit && !sel.getRangeAt) {
+                var _range = this._getDoc().createRange();
+                try {
+                    _range.setStart(sel.anchorNode, sel.anchorOffset);
+                    _range.setEnd(sel.focusNode, sel.focusOffset);
+                } catch (e) {
+                    _range = this._getWindow().getSelection()+'';
+                }
+                return _range;
+            }
+
+            if (this.browser.ie || this.browser.opera) {
+                return sel.createRange();
+            }
+
+            if (sel.rangeCount > 0) {
+                return sel.getRangeAt(0);
+            }
+            return null;
+        },
+        /**
+        * @private
+        * @method _setDesignMode
+        * @description Sets the designMode of the iFrame document.
+        * @param {String} state This should be either on or off
+        */
+        _setDesignMode: function(state) {
+            try {
+                this._getDoc().designMode = state;
+            } catch(e) { }
+        },
+        /**
+        * @private
+        * @method _toggleDesignMode
+        * @description Toggles the designMode of the iFrame document on and off.
+        * @returns {String} The state that it was set to.
+        */
+        _toggleDesignMode: function() {
+            var _dMode = this._getDoc().designMode,
+                _state = 'on';
+            if (_dMode == 'on') {
+                _state = 'off';
+            }
+            this._setDesignMode(_state);
+            return _state;
+        },
+        /**
+        * @private
+        * @method _initEditor
+        * @description This method is fired from _checkLoaded when the document is ready. It turns on designMode and set's up the listeners.
+        */
+        _initEditor: function() {
+            YAHOO.log('editorLoaded', 'info', 'Editor');
+            if (this.browser.ie) {
+                this._getDoc().body.style.margin = '0';
+            }
+            this._setDesignMode('on');
+            
+            this.toolbar.on('buttonClick', this._handleToolbarClick, this, true);
+            //Setup Listeners on iFrame
+            Event.addListener(this._getDoc(), 'mouseup', this._handleMouseUp, this, true);
+            Event.addListener(this._getDoc(), 'mousedown', this._handleMouseDown, this, true);
+            Event.addListener(this._getDoc(), 'click', this._handleClick, this, true);
+            Event.addListener(this._getDoc(), 'dblclick', this._handleDoubleClick, this, true);
+            Event.addListener(this._getDoc(), 'keypress', this._handleKeyPress, this, true);
+            Event.addListener(this._getDoc(), 'keyup', this._handleKeyUp, this, true);
+            Event.addListener(this._getDoc(), 'keydown', this._handleKeyDown, this, true);
+            this.toolbar.set('disabled', false);
+            this.fireEvent('editorContentLoaded', { type: 'editorLoaded', target: this });
+            if (this.get('dompath')) {
+                var self = this;
+                window.setTimeout(function() {
+                    self._writeDomPath.call(self);
+                }, 150);
+            }
+        },
+        /**
+        * @private
+        * @method _checkLoaded
+        * @description Called from a setTimeout loop to check if the iframes body.onload event has fired, then it will init the editor.
+        */
+        _checkLoaded: function() {
+            this._contentTimerCounter++;
+            if (this._contentTimer) {
+                window.clearTimeout(this._contentTimer);
+            }
+            if (this._contentTimerCounter > 250) {
+                alert('ERROR: Body Did Not load');
+                return false;
+            }
+            if (this._getDoc() && this._getDoc().body && (this._getDoc().body._rteLoaded == true)) {
+                //The onload event has fired, clean up after ourselves and fire the _initEditor method
+                /*
+                if (!this.browser.ie) {
+                    //IE Doesn't like this..
+                    delete this._getDoc().body._rteLoaded;
+                    this._getDoc().body.removeAttribute('onload');
+                }
+                */
+                this._initEditor();
+            } else {
+                var self = this;
+                this._contentTimer = window.setTimeout(function() {
+                    self._checkLoaded.call(self);
+                }, 20);
+            }
+        },
+        /**
+        * @private
+        * @method _setInitialContent
+        * @description This method will open the iframes content document and write the textareas value into it, then start the body.onload checking.
+        */
+        _setInitialContent: function() {
+            YAHOO.log('Body of editor populated with contents of the text area', 'info', 'Editor');
+            var title = this.STR_TITLE;
+            var html = this.get('html');
+            html = html.replace('{TITLE}', title);
+            html = html.replace('{CONTENT}', this.get('textarea').value);
+            html = html.replace('{CSS}', this.get('css'));
+            html = html.replace('{HIDDEN_CSS}', this.get('hiddencss'));
+
+            this._getDoc().open();
+            this._getDoc().write(html);
+            this._getDoc().close();
+            
+            this._checkLoaded();   
+        },
+        /**
+        * @private
+        * @method _setMarkupType
+        * @param {String} action The action to take. Possible values are: css, default or semantic
+        * @description This method will turn on/off the useCSS execCommand.
+        */
+        _setMarkupType: function(action) {
+            switch (this.get('markup')) {
+                case 'css':
+                    this._setEditorStyle(true);
+                    break;
+                case 'default':
+                    this._setEditorStyle(false);
+                    break;
+                case 'semantic':
+                    if (this._semantic[action]) {
+                        this._setEditorStyle(false);
+                    } else {
+                        this._setEditorStyle(true);
+                    }
+                    break;
+            }
+        },
+        /**
+        * Set the editor to use CSS instead of HTML
+        * @param {Booleen} stat True/False
+        */
+        _setEditorStyle: function(stat) {
+            try {
+                this._getDoc().execCommand('useCSS', false, !stat);
+            } catch (ex) {
+            }
+        },
+        /**
+        * @private
+        * @method _getSelectedElement
+        * @description This method will attempt to locate the element that was last interacted with, either via selection, location or event.
+        * @returns {HTMLElement} The currently selected element.
+        */
+        _getSelectedElement: function() {
+            var doc = this._getDoc();
+            if (this.browser.ie) {
+                var range = this._getRange(), elm = null;
+                if (range) {
+                    elm = range.item ? range.item(0) : range.parentElement();
+                    if (elm == doc.body) {
+                        elm = null;
+                    }
+                }
+            } else {
+                var sel = this._getSelection(),
+                    range = this._getRange(),
+                    elm = null;
+                if (!sel || !range) {
+                    return null;
+                }
+                if (sel != '') {
+                    if (sel.anchorNode && (sel.anchorNode.nodeType == 3)) {
+                        if (sel.anchorNode.parentNode) { //next check parentNode
+                            elm = sel.anchorNode.parentNode;
+                        }
+                        if (sel.anchorNode.nextSibling != sel.focusNode.nextSibling) {
+                            elm = sel.anchorNode.nextSibling;
+                        }
+                    }
+                    
+                    if (elm && elm.tagName && (elm.tagName.toLowerCase() == 'br')) {
+                        elm = null;
+                    }
+                
+                    if (!elm) {
+                        elm = range.commonAncestorContainer;
+                        if (!range.collapsed) {
+                            if (range.startContainer == range.endContainer) {
+                                if (range.startOffset - range.endOffset < 2) {
+                                    if (range.startContainer.hasChildNodes()) {
+                                        elm = range.startContainer.childNodes[range.startOffset];
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    //Safari Fix
+                    if (!elm) {
+                        if (this.currentEvent) {
+                            //elm = Event.getTarget(this.currentEvent);
+                        }
+                    }
+                }
+            }
+            if (!elm && (this.currentElement[0] || this.currentEvent)) {
+                if (this.currentEvent && (this.currentEvent.keyCode == undefined) && Event.getTarget(this.currentEvent)) {
+                    elm = Event.getTarget(this.currentEvent);
+                } else if (this.currentEvent && (this.currentEvent.keyCode != undefined) && Event.getTarget(this.currentEvent)) {
+                } else {
+                    elm = this.currentElement[0];
+                }
+            } else if ((elm == this._getDoc().body) && this.currentElement[0] && !this._hasSelection()) {
+                elm = this.currentElement[0];
+            }
+
+            if (this.browser.opera || this.browser.webkit) {
+                if (this.currentEvent && !elm) {
+                    elm = Event.getTarget(this.currentEvent);
+                }
+            }
+
+            if (!elm || !elm.tagName) {
+                elm = doc.body;
+            }
+            if (elm && elm.tagName && elm.tagName.toLowerCase() == 'html') {
+                //Safari sometimes gives us the HTML node back..
+                elm = doc.body;
+            }
+            
+            return elm;
+        },
+        /**
+        * @private
+        * @method _getDomPath
+        * @description This method will attempt to build the DOM path from the currently selected element.
+        * @returns {Array} An array of node references that will create the DOM Path.
+        */
+        _getDomPath: function() {
+                       var el = this._getSelectedElement();
+                       var domPath = [];
+                       
+                       while (el!= null) {
+                if (el.ownerDocument != this._getDoc()) {
+                    return false;
+                }
+                //Check to see if we get el.nodeName and nodeType
+                if (el.nodeName && (el.nodeType == 1)) {
+                    domPath[domPath.length] = el;
+                }
+
+                if (el.nodeName.toUpperCase() == "BODY") {
+                                   break;
+                }
+
+                               el = el.parentNode;
+                       }
+            if (domPath.length == 0) {
+                if (this._getDoc() && this._getDoc().body) {
+                    domPath[0] = this._getDoc().body;
+                }
+            }
+            return domPath.reverse();
+        },
+        /**
+        * @private
+        * @method _writeDomPath
+        * @description Write the current DOM path out to the dompath container below the editor.
+        */
+        _writeDomPath: function() { 
+            var path = this._getDomPath(),
+                pathArr = [];
+            for (var i = 0; i < path.length; i++) {
+                var tag = path[i].tagName.toLowerCase();
+                if ((tag == 'ol') && (path[i].type)) {
+                    tag += ':' + path[i].type;
+                }
+                if (Dom.hasClass(path[i], 'yui-tag')) {
+                    tag = path[i].getAttribute('tag');
+                }
+                if ((this.get('markup') == 'semantic')) {
+                    switch (tag) {
+                        case 'b': tag = 'strong'; break;
+                        case 'i': tag = 'em'; break;
+                    }
+                }
+                if (!Dom.hasClass(path[i], 'yui-non')) {
+                    if (Dom.hasClass(path[i], 'yui-tag')) {
+                        var pathStr = tag;
+                        if (tag == 'a') {
+                            if (path[i].getAttribute('href')) {
+                                pathStr += ':' + path[i].getAttribute('href').replace('mailto:', '').replace('http:/'+'/', '').replace('https:/'+'/', ''); //May need to add others here ftp
+                            }
+                        }
+                    } else {
+                        var classPath = ((path[i].className != '') ? '.' + path[i].className.replace(/ /g, '.') : '');
+                        if ((classPath.indexOf('yui') != -1) || (classPath.toLowerCase().indexOf('apple-style-span') != -1)) {
+                            classPath = '';
+                        }
+                        var pathStr = tag + ((path[i].id) ? '#' + path[i].id : '') + classPath;
+                    }
+                    if (pathStr.length > 10) {
+                        pathStr = pathStr.substring(0, 10) + '...';
+                    }
+                    pathArr[pathArr.length] = pathStr;
+                }
+            }
+            var str = pathArr.join(' ' + this.SEP_DOMPATH + ' ');
+            //Prevent flickering
+            if (this.dompath.innerHTML != str) {
+                this.dompath.innerHTML = str;
+            }
+        },
+        /**
+        * @private
+        * @method _fixNodes
+        * @description Fix href and imgs as well as remove invalid HTML.
+        */
+        _fixNodes: function() {
+            for (var i in this.invalidHTML) {
+                if (Lang.hasOwnProperty(this.invalidHTML, i)) {
+                    var tags = this._getDoc().body.getElementsByTagName(i);
+                    for (var h = 0; h < tags.length; h++) {
+                        if (tags[h].parentNode) {
+                            tags[h].parentNode.removeChild(tags[h]);
+                        }
+                    }
+                }
+            }
+            var as = this._getDoc().body.getElementsByTagName('a');
+            if (as.length) {
+                YAHOO.log('Found an A tag in the document, converting to span holder', 'info', 'Editor');
+                for (var i = 0; i < as.length; i++) {
+                    var el = this._getDoc().createElement('span');
+                    Dom.addClass(el, 'yui-tag-a');
+                    Dom.addClass(el, 'yui-tag');
+                    el.innerHTML = as[i].innerHTML;
+                    el.setAttribute('tag', 'a');
+                    el.setAttribute('href', as[i].getAttribute('href'));
+                    if (as[i].getAttribute('target') != null) {
+                        el.setAttribute('target', as[i].getAttribute('target'));
+                    }
+                    as[i].parentNode.replaceChild(el, as[i]);
+                    as[i] = null;
+                }
+            }
+            var imgs = this._getDoc().getElementsByTagName('img');
+            Dom.addClass(imgs, 'yui-img');
+
+            for (var i = 0; i < imgs.length; i++) {
+                if (imgs[i].getAttribute('href', 2)) {
+                    var url = imgs[i].getAttribute('src', 2);
+                    if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
+                        Dom.addClass(imgs[i], this.CLASS_LOCAL_FILE);
+                    } else {
+                        Dom.removeClass(imgs[i], this.CLASS_LOCAL_FILE);
+                    }
+                }
+            }
+
+            var fakeAs = this._getDoc().body.getElementsByTagName('span');
+            for (var i = 0; i < fakeAs.length; i++) {
+                if (fakeAs[i].getAttribute('href', 2)) {
+                    var url = fakeAs[i].getAttribute('href', 2);
+                    if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
+                        Dom.addClass(fakeAs[i], this.CLASS_LOCAL_FILE);
+                    } else {
+                        Dom.removeClass(fakeAs[i], this.CLASS_LOCAL_FILE);
+                    }
+                }
+            }
+        },
+        /**
+        * @private
+        * @method _showHidden
+        * @description Toggle on/off the hidden.css file.
+        */
+        _showHidden: function() {
+            if (this._showingHiddenElements) {
+                YAHOO.log('Enabling hidden CSS File', 'info', 'Editor');
+                this._showingHiddenElements = false;
+                this.toolbar.deselectButton(this.toolbar.getButtonByValue('hiddenelements'));
+                Dom.removeClass(this._getDoc().body, this.CLASS_HIDDEN);
+            } else {
+                YAHOO.log('Disabling hidden CSS File', 'info', 'Editor');
+                this._showingHiddenElements = true;
+                Dom.addClass(this._getDoc().body, this.CLASS_HIDDEN);
+                this.toolbar.selectButton(this.toolbar.getButtonByValue('hiddenelements'));
+            }
+        },
+        /**
+        * @private
+        * @method _setCurrentEvent
+        * @param {Event} ev The event to cache
+        * @description Sets the current event property
+        */
+        _setCurrentEvent: function(ev) {
+            if (ev && ev.type) {
+                YAHOO.log('Event: ' + ev.type, 'info', 'Editor');
+            }
+            this.currentEvent = ev;
+        },
+        /**
+        * @private
+        * @method _handleClick
+        * @param {Event} ev The event we are working on.
+        * @description Handles all click events inside the iFrame document.
+        */
+        _handleClick: function(ev) {
+            this._setCurrentEvent(ev);
+            if (this.currentWindow) {
+                this.closeWindow();
+            }
+            if (!this.browser.webkit) {
+                this.nodeChange();
+            }
+        },
+        /**
+        * @private
+        * @method _handleMouseUp
+        * @param {Event} ev The event we are working on.
+        * @description Handles all mouseup events inside the iFrame document.
+        */
+        _handleMouseUp: function(ev) {
+            this._setCurrentEvent(ev);
+            if (this.browser.opera) {
+                /**
+                * @knownissue Opera appears to stop the MouseDown, Click and DoubleClick events on an image inside of a document with designMode on..
+                * @browser Opera
+                * @description This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event.
+                */
+                var sel = Event.getTarget(ev);
+                if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+                    this.nodeChange();
+                    var self = this;
+                    if (this.operaEvent) {
+                        clearTimeout(this.operaEvent);
+                        this.operaEvent = null;
+                        this._handleDoubleClick(ev);
+                    } else {
+                        this.operaEvent = window.setTimeout(function() {
+                            self.operaEvent = false;
+                        }, 200);
+                    }
+                }
+            }
+            //This will stop Safari from selecting the entire document if you select all the text in the editor
+            if (this.browser.webkit || this.browser.opera) {
+                if (this.browser.webkit) {
+                    Event.stopEvent(ev);
+                }
+            }            
+            this.nodeChange();
+            this.fireEvent('editorMouseUp', { type: 'editorMouseUp', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleMouseDown
+        * @param {Event} ev The event we are working on.
+        * @description Handles all mousedown events inside the iFrame document.
+        */
+        _handleMouseDown: function(ev) {
+            this._setCurrentEvent(ev);
+            var sel = Event.getTarget(ev);
+            if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+                if (this.browser.webkit) {
+                    this.nodeChange();
+                    Event.stopEvent(ev);
+                }
+            }
+            //this.nodeChange();
+            this.fireEvent('editorMouseDown', { type: 'editorMouseDown', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleDoubleClick
+        * @param {Event} ev The event we are working on.
+        * @description Handles all doubleclick events inside the iFrame document.
+        */
+        _handleDoubleClick: function(ev) {
+            this._setCurrentEvent(ev);
+            var sel = Event.getTarget(ev);
+            if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+                this.currentElement[0] = sel;
+                this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar });
+                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            } else if (sel && sel.getAttribute && sel.getAttribute('tag') && (sel.getAttribute('tag').toLowerCase() == 'a')) {
+                this.currentElement[0] = sel;
+                this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
+                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            }
+            this.nodeChange();
+            this.fireEvent('editorDoubleClick', { type: 'editorDoubleClick', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleKeyUp
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keyup events inside the iFrame document.
+        */
+        _handleKeyUp: function(ev) {
+            this._setCurrentEvent(ev);
+            switch (ev.keyCode) {
+                case 37: //Left Arrow
+                case 38: //Up Arrow
+                case 39: //Right Arrow
+                case 40: //Down Arrow
+                case 46: //Forward Delete
+                case 8: //Delete
+                case 65: //The letter a (for ctrl + a and cmd + a)
+                case 27: //Escape key if window is open
+                    if ((ev.keyCode == 27) && this.currentWindow) {
+                        this.closeWindow();
+                    }
+                    this.nodeChange();
+                    break;
+            }
+            this.fireEvent('editorKeyUp', { type: 'editorKeyUp', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleKeyPress
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keypress events inside the iFrame document.
+        */
+        _handleKeyPress: function(ev) {
+            this._setCurrentEvent(ev);
+            this.fireEvent('editorKeyPress', { type: 'editorKeyPress', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleKeyDown
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keydown events inside the iFrame document.
+        */
+        _handleKeyDown: function(ev) {
+            this._setCurrentEvent(ev);
+            if (this.currentWindow) {
+                this.closeWindow();
+            }
+            var doExec = false;
+            var action = null;
+            //if (ev.ctrlKey) {
+            if (ev.shiftKey && ev.ctrlKey) {
+                doExec = true;
+            }
+            switch (ev.keyCode) {
+                case 84: //Focus Toolbar Header -- Ctrl + Shift + T
+                    if (ev.shiftKey && ev.ctrlKey) {
+                        this.toolbar._titlebar.firstChild.focus();
+                        Event.stopEvent(ev);
+                        doExec = false;
+                    }
+                    break;
+                case 27: //Focus After Element - Ctrl + Shift + Esc
+                    if (ev.shiftKey) {
+                        this.afterElement.focus();
+                        Event.stopEvent(ev);
+                        exec = false;
+                    }
+                    break;
+                case 219: //Left
+                    action = 'justifyleft';
+                    break;
+                case 220: //Center
+                    action = 'justifycenter';
+                    break;
+                case 221: //Right
+                    action = 'justifyright';
+                    break;
+                case 76: //L
+                    if (this._hasSelection()) {
+                        this.execCommand('createlink', '');
+                        this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
+                        this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+                        doExec = false;
+                    }
+                    break;
+                case 66: //B
+                    action = 'bold';
+                    break;
+                case 73: //I
+                    action = 'italic';
+                    break;
+                case 85: //U
+                    action = 'underline';
+                    break;
+                case 9: //Tab Key
+                    if (this.browser.safari) {
+                        this._getDoc().execCommand('inserttext', false, '\t');
+                        Event.stopEvent(ev);
+                    }
+                    break;
+                case 13:
+                    if (this.browser.ie) {
+                        //Insert a <br> instead of a <p></p> in Internet Explorer
+                        var _range = this._getRange();
+                        var tar = this._getSelectedElement();
+                        if (tar && tar.tagName && (tar.tagName.toLowerCase() != 'li')) {
+                            if (_range) {
+                                _range.pasteHTML('<br>');
+                                _range.collapse(false);
+                                _range.select();
+                            }
+                            Event.stopEvent(ev);
+                        }
+                    }
+            }
+            if (doExec && action) {
+                this.execCommand(action, null);
+                Event.stopEvent(ev);
+                this.nodeChange();
+            }
+            this.fireEvent('editorKeyDown', { type: 'editorKeyDown', target: this, ev: ev });
+        },
+        /**
+        * @method nodeChange
+        * @description Handles setting up the toolbar buttons, getting the Dom path, fixing nodes.
+        */
+        nodeChange: function() {
+            this._fixNodes();
+
+            this.fireEvent('beforeNodeChange', { type: 'beforeNodeChange', target: this });
+            if (this.get('dompath')) {
+                this._writeDomPath();
+            }
+            //Check to see if we are disabled before continuing
+            if (!this.get('disabled')) {
+                if (this.STOP_NODE_CHANGE) {
+                    //Reset this var for next action
+                    this.STOP_NODE_CHANGE = false;
+                    return false;
+                } else {
+                    var sel = this._getSelection();
+                    var range = this._getRange();
+
+                    //Handle disabled buttons
+                    for (var i = 0; i < this._disabled.length; i++) {
+                        var _button = this.toolbar.getButtonByValue(this._disabled[i]);
+                        if (_button && _button.get) {
+                            if (!this._hasSelection()) {
+                                //No Selection - disable
+                                this.toolbar.disableButton(_button.get('id'));
+                            } else {
+                                if (!this._alwaysDisabled[this._disabled[i]]) {
+                                    this.toolbar.enableButton(_button.get('id'));
+                                }
+                            }
+                            if (!this._alwaysEnabled[this._disabled[i]]) {
+                                this.toolbar.deselectButton(_button);
+                            }
+                        }
+                    }
+                    //Handle updating the toolbar with active buttons
+                    for (var i = 0; i < this.toolbar._buttonList.length; i++) {
+                        if (!this._alwaysEnabled[this.toolbar._buttonList[i].get('value')]) {
+                            this.toolbar.deselectButton(this.toolbar._buttonList[i]);
+                        }
+                    }
+                    var path = this._getDomPath();
+                    var olType = null;
+                    for (var i = 0; i < path.length; i++) {
+                        var tag = path[i].tagName.toLowerCase();
+                        if (path[i].getAttribute('tag')) {
+                            var tag = path[i].getAttribute('tag').toLowerCase();
+                        }
+                        var cmd = this._tag2cmd[tag];
+
+                        //Bold and Italic styles
+                        if (path[i].style.fontWeight.toLowerCase() == 'bold') {
+                            cmd = 'bold';
+                        }
+                        if (path[i].style.fontStyle.toLowerCase() == 'italic') {
+                            cmd = 'italic';
+                        }
+                        if (path[i].style.textDecoration.toLowerCase() == 'underline') {
+                            cmd = 'underline';
+                        }
+                        if (tag == 'ol') {
+                            if (path[i].type) {
+                                olType = path[i].type;
+                            } else {
+                                olType = 'A';
+                            }
+                        }
+                        if (cmd) {
+                            if (!Lang.isArray(cmd)) {
+                                cmd = [cmd];
+                            }
+                            for (var j = 0; j < cmd.length; j++) {
+                                var button = this.toolbar.getButtonByValue(cmd[j]);
+                                this.toolbar.selectButton(button);
+                                this.toolbar.enableButton(button);
+                            }
+                        }
+                        //Handle Alignment
+                        switch (path[i].style.textAlign.toLowerCase()) {
+                            case 'left':
+                            case 'right':
+                            case 'center':
+                            case 'justify':
+                                var alignType = path[i].style.textAlign.toLowerCase();
+                                if (path[i].style.textAlign.toLowerCase() == 'justify') {
+                                    alignType = 'full';
+                                }
+                                var button = this.toolbar.getButtonByValue('justify' + alignType);
+                                this.toolbar.selectButton(button);
+                                this.toolbar.enableButton(button);
+                                break;
+                        }
+                        //Handle Ordered List Drop Down - it will reset if olType is null
+                        //this._updateMenuChecked('insertorderedlist', olType);
+                    }
+                    //After for loop
+
+                    //Reset Font Family and Size to the inital configs
+                    var fn_button = this.toolbar.getButtonByValue('fontname');
+                    if (fn_button) {
+                        var family = fn_button._configs.label._initialConfig.value;
+                        fn_button.set('label', '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>');
+                        this._updateMenuChecked('fontname', family);
+                    }
+
+                    var fs_button = this.toolbar.getButtonByValue('fontsize');
+                    if (fs_button) {
+                        fs_button.set('label', fs_button._configs.label._initialConfig.value);
+                    }
+
+                    var hd_button = this.toolbar.getButtonByValue('heading');
+                    if (hd_button) {
+                        hd_button.set('label', hd_button._configs.label._initialConfig.value);
+                        this._updateMenuChecked('heading', 'none');
+                    }
+                }
+            }
+
+            this.fireEvent('afterNodeChange', { type: 'afterNodeChange', target: this });
+        },
+        /**
+        * @private
+        * @method _updateMenuChecked
+        * @param {Object} button The command identifier of the button you want to check
+        * @param {String} value The value of the menu item you want to check
+        * @param {<a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a>} The Toolbar instance the button belongs to (defaults to this.toolbar) 
+        * @description Gets the menu from a button instance, if the menu is not rendered it will render it. It will then search the menu for the specified value, unchecking all other items and checking the specified on.
+        */
+        _updateMenuChecked: function(button, value, tbar) {
+            if (!tbar) {
+                tbar = this.toolbar;
+            }
+            var _button = tbar.getButtonByValue(button);
+            var _menuItems = _button.getMenu().getItems();
+            if (_menuItems.length == 0) {
+                _button.getMenu()._onBeforeShow();
+                _menuItems = _button.getMenu().getItems();
+            }
+            for (var i = 0; i < _menuItems.length; i++) {
+                _menuItems[i].cfg.setProperty('checked', false);
+                if (_menuItems[i].value == value) {
+                    _menuItems[i].cfg.setProperty('checked', true);
+                }
+            }
+        },
+        /**
+        * @private
+        * @method _handleToolbarClick
+        * @param {Event} ev The event that triggered the button click
+        * @description This is an event handler attached to the Toolbar's buttonClick event. It will fire execCommand with the command identifier from the Toolbar Button.
+        */
+        _handleToolbarClick: function(ev) {
+            var value = '';
+            var str = '';
+            var cmd = ev.button.value;
+            if (ev.button.menucmd) {
+                value = cmd;
+                cmd = ev.button.menucmd;
+            }
+            if (this.STOP_EXEC_COMMAND) {
+                YAHOO.log('execCommand skipped because we found the STOP_EXEC_COMMAND flag set to true', 'warn', 'Editor');
+                YAHOO.log('NOEXEC::execCommand::(' + cmd + '), (' + value + ')', 'warn', 'Editor');
+                this.STOP_EXEC_COMMAND = false;
+                return false;
+            } else {
+                this.execCommand(cmd, value);
+            }
+            Event.stopEvent(ev);
+        },
+        /**
+        * @private
+        * @method _setupAfterElement
+        * @description Creates the accessibility h2 header and places it after the iframe in the Dom for navigation.
+        */
+        _setupAfterElement: function() {
+            if (!this.afterElement) {
+                this.afterElement = document.createElement('h2');
+                this.afterElement.className = 'yui-editor-skipheader';
+                this.afterElement.tabIndex = '-1';
+                this.afterElement.innerHTML = this.STR_LEAVE_EDITOR;
+                this.get('element_cont').get('firstChild').appendChild(this.afterElement);
+            }
+        },
+        /**
+        * @property EDITOR_PANEL_ID
+        * @description HTML id to give the properties window in the DOM.
+        * @type String
+        */
+        EDITOR_PANEL_ID: 'yui-editor-panel',
+        /**
+        * @property SEP_DOMPATH
+        * @description The value to place in between the Dom path items
+        * @type String
+        */
+        SEP_DOMPATH: '<',
+        /**
+        * @property STR_LEAVE_EDITOR
+        * @description The accessibility string for the element after the iFrame
+        * @type String
+        */
+        STR_LEAVE_EDITOR: 'You have left the Rich Text Editor.',
+        /**
+        * @property STR_BEFORE_EDITOR
+        * @description The accessibility string for the element before the iFrame
+        * @type String
+        */
+        STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift [ aligns text left</li> <li>Control Shift | centers text</li> <li>Control Shift ] aligns text right</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control Shift ESC.</li></ul>',
+        /**
+        * @property STR_CLOSE_WINDOW
+        * @description The Title of the close button in the Editor Window
+        * @type String
+        */
+        STR_CLOSE_WINDOW: 'Close Window',
+        /**
+        * @property STR_CLOSE_WINDOW_NOTE
+        * @description A note appearing in the Editor Window to tell the user that the Escape key will close the window
+        * @type String
+        */
+        STR_CLOSE_WINDOW_NOTE: 'To close this window use the Escape key',
+        /**
+        * @property STR_TITLE
+        * @description The Title of the HTML document that is created in the iFrame
+        * @type String
+        */
+        STR_TITLE: 'Rich Text Area.',
+        /**
+        * @property STR_IMAGE_HERE
+        * @description The text to place in the URL textbox when using the blankimage.
+        * @type String
+        */
+        STR_IMAGE_HERE: 'Image Url Here',
+        /**
+        * @property STR_IMAGE_PROP_TITLE
+        * @description The title for the Image Property Editor Window
+        * @type String
+        */
+        STR_IMAGE_PROP_TITLE: 'Image Options',
+        /**
+        * @property STR_IMAGE_URL
+        * @description The label string for Image URL
+        * @type String
+        */
+        STR_IMAGE_URL: 'Image Url',
+        /**
+        * @property STR_IMAGE_TITLE
+        * @description The label string for Image Description
+        * @type String
+        */
+        STR_IMAGE_TITLE: 'Description',
+        /**
+        * @property STR_IMAGE_SIZE
+        * @description The label string for Image Size
+        * @type String
+        */
+        STR_IMAGE_SIZE: 'Size',
+        /**
+        * @property STR_IMAGE_ORIG_SIZE
+        * @description The label string for Original Image Size
+        * @type String
+        */
+        STR_IMAGE_ORIG_SIZE: 'Original Size',
+        /**
+        * @property STR_IMAGE_COPY
+        * @description The label string for the image copy and paste message for Opera and Safari
+        * @type String
+        */
+        STR_IMAGE_COPY: '<span class="tip"><span class="icon icon-info"></span><strong>Note:</strong>To move this image just highlight it, cut, and paste where ever you\'d like.</span>',
+        /**
+        * @property STR_IMAGE_PADDING
+        * @description The label string for the image padding.
+        * @type String
+        */
+        STR_IMAGE_PADDING: 'Padding',
+        /**
+        * @property STR_IMAGE_BORDER
+        * @description The label string for the image border.
+        * @type String
+        */
+        STR_IMAGE_BORDER: 'Border',
+        /**
+        * @property STR_IMAGE_TEXTFLOW
+        * @description The label string for the image text flow.
+        * @type String
+        */
+        STR_IMAGE_TEXTFLOW: 'Text Flow',
+        /**
+        * @property STR_LOCAL_FILE_WARNING
+        * @description The label string for the local file warning.
+        * @type String
+        */
+        STR_LOCAL_FILE_WARNING: '<span class="tip"><span class="icon icon-warn"></span><strong>Note:</strong>This image/link points to a file on your computer and will not be accessible to others on the internet.</span>',
+        /**
+        * @property STR_LINK_PROP_TITLE
+        * @description The label string for the Link Property Editor Window.
+        * @type String
+        */
+        STR_LINK_PROP_TITLE: 'Link Options',
+        /**
+        * @property STR_LINK_PROP_REMOVE
+        * @description The label string for the Remove link from text link inside the property editor.
+        * @type String
+        */
+        STR_LINK_PROP_REMOVE: 'Remove link from text',
+        /**
+        * @property STR_LINK_URL
+        * @description The label string for the Link URL.
+        * @type String
+        */
+        STR_LINK_URL: 'Link URL',
+        /**
+        * @property STR_LINK_NEW_WINDOW
+        * @description The string for the open in a new window label.
+        * @type String
+        */
+        STR_LINK_NEW_WINDOW: 'Open in a new window.',
+        /**
+        * @property STR_LINK_TITLE
+        * @description The string for the link description.
+        * @type String
+        */
+        STR_LINK_TITLE: 'Description',
+        /**
+        * @protected
+        * @property STOP_EXEC_COMMAND
+        * @description Set to true when you want the default execCommand function to not process anything
+        * @type Boolean
+        */
+        STOP_EXEC_COMMAND: false,
+        /**
+        * @protected
+        * @property STOP_NODE_CHANGE
+        * @description Set to true when you want the default nodeChange function to not process anything
+        * @type Boolean
+        */
+        STOP_NODE_CHANGE: false,
+        /**
+        * @protected
+        * @property CLASS_HIDDEN
+        * @description CSS class applied to the body when the hiddenelements button is pressed.
+        * @type String
+        */
+        CLASS_HIDDEN: 'hidden',
+        /**
+        * @protected
+        * @property CLASS_LOCAL_FILE
+        * @description CSS class applied to an element when it's found to have a local url.
+        * @type String
+        */
+        CLASS_LOCAL_FILE: 'warning-localfile',
+        /**
+        * @protected
+        * @property CLASS_CONTAINER
+        * @description Default CSS class to apply to the editors container element
+        * @type String
+        */
+        CLASS_CONTAINER: 'yui-editor-container',
+        /**
+        * @protected
+        * @property CLASS_EDITABLE
+        * @description Default CSS class to apply to the editors iframe element
+        * @type String
+        */
+        CLASS_EDITABLE: 'yui-editor-editable',
+        /**
+        * @protected
+        * @property CLASS_EDITABLE_CONT
+        * @description Default CSS class to apply to the editors iframe's parent element
+        * @type String
+        */
+        CLASS_EDITABLE_CONT: 'yui-editor-editable-container',
+        /**
+        * @protected
+        * @property CLASS_PREFIX
+        * @description Default prefix for dynamically created class names
+        * @type String
+        */
+        CLASS_PREFIX: 'yui-editor',
+        /** 
+        * @property browser
+        * @description Standard browser detection
+        * @type Object
+        */
+        browser: YAHOO.env.ua,
+        /** 
+        * @method init
+        * @description The Editor class' initialization method
+        */
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.widget.Editor.superclass.init.call(this, p_oElement, p_oAttributes);
+            this.get('element_cont').addClass(this.CLASS_CONTAINER);
+            Dom.addClass(this.get('iframe').get('parentNode'), this.CLASS_EDITABLE_CONT);
+            this.get('iframe').addClass(this.CLASS_EDITABLE);
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the editor.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the editor.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.Editor.superclass.initAttributes.call(this, attr);
+            var self = this;
+
+            /**
+            * @private
+            * @config textarea
+            * @description A reference to the textarea element that we are replacing
+            * @default null
+            * @type Boolean
+            */            
+            this.setAttributeConfig('textarea', {
+                value: attr.textarea,
+                writeOnce: true
+            });
+            /**
+            * @config height
+            * @description The height of the editor iframe container, not including the toolbar..
+            * @default Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument
+            * @type String
+            */
+            this.setAttributeConfig('height', {
+                value: attr.height || Dom.getStyle(self.get('textarea'), 'height'),
+                writeOnce: true
+            });
+            /**
+            * @config width
+            * @description The width of the editor container.
+            * @default Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument
+            * @type String
+            */            
+            this.setAttributeConfig('width', {
+                value: attr.width || Dom.getStyle(this.get('textarea'), 'width'),
+                writeOnce: true
+            });
+                        
+            /**
+            * @config blankimage
+            * @description The CSS used to show/hide hidden elements on the page
+            * @default 'assets/blankimage.png'
+            * @type String
+            */            
+            this.setAttributeConfig('blankimage', {
+                value: attr.blankimage || this._getBlankImage()
+            });
+            /**
+            * @config hiddencss
+            * @description The CSS used to show/hide hidden elements on the page, these rules must be prefixed with the class provided in <code>this.CLASS_HIDDEN</code>
+            * @default <code><pre>
+            .hidden div, .hidden p, .hidden span, .hidden img {
+                border: 1px dotted #ccc;
+            }
+            .hidden .yui-non {
+                border: none;
+            }
+            .hidden img {
+                padding: 2px;
+            }</pre></code>
+            * @type String
+            */            
+            this.setAttributeConfig('hiddencss', {
+                value: attr.hiddencss || '.hidden div,.hidden p,.hidden span,.hidden img { border: 1px dotted #ccc; } .hidden .yui-non { border: none; } .hidden img { padding: 2px; }',
+                writeOnce: true
+            });
+            /**
+            * @config css
+            * @description The Base CSS used to format the content of the editor
+            * @default <code><pre>body {
+                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
+            }
+            span.yui-tag-a {
+                color: blue; text-decoration: underline;
+            }
+            span.yui-tag-blockquote {
+                margin: 1em; display: block;
+            }
+            span.yui-tag-indent {
+                margin-left: 1em; display: block;
+            }
+            .warning-localfile {
+                border-bottom: 1px dashed red !important;
+            }</pre></code>
+            * @type String
+            */            
+            this.setAttributeConfig('css', {
+                value: attr.css || 'body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } span.yui-tag-a { color: blue; text-decoration: underline; } span.yui-tag-blockquote { margin: 1em; display: block; } span.yui-tag-indent { margin-left: 1em; display: block; } .warning-localfile { border-bottom: 1px dashed red !important; }',
+                writeOnce: true
+            });
+            /**
+            * @config html
+            * @description The default HTML to be written to the iframe document before the contents are loaded
+            * @default This HTML requires a few things if you are to override:
+                <p><code>{TITLE}, {CSS}, {HIDDEN_CSS}</code> and <code>{CONTENT}</code> need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.<p>
+                <p><code>onload="document.body._rteLoaded = true;"</code> : the onload statement must be there or the editor will not finish loading.</p>
+                <code>
+                <pre>
+                &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
+                &lt;html&gt;
+                    &lt;head&gt;
+                        &lt;title&gt;{TITLE}&lt;/title&gt;
+                        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
+                        &lt;style&gt;
+                        {CSS}
+                        &lt;/style&gt;
+                        &lt;style&gt;
+                        {HIDDEN_CSS}
+                        &lt;/style&gt;
+                    &lt;/head&gt;
+                &lt;body onload="document.body._rteLoaded = true;"&gt;
+                {CONTENT}
+                &lt;/body&gt;
+                &lt;/html&gt;
+                </pre>
+                </code>
+            * @type String
+            */            
+            this.setAttributeConfig('html', {
+                value: attr.html || '<!DOCTYPE HTML PUBLIC "-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd"><html><head><title>{TITLE}</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style>{CSS}</style><style>{HIDDEN_CSS}</style></head><body onload="document.body._rteLoaded = true;">{CONTENT}</body></html>',
+                writeOnce: true
+            });
+
+            /**
+            * @config handleSubmit
+            * @description Config handles if the editor will attach itself to the textareas parent form's submit handler.
+            If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form.
+            Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('handleSubmit', {
+                value: false,
+                writeOnce: true,
+                method: function(exec) {
+                    if (exec) {
+                        var ta = this.get('textarea');
+                        if (ta.form) {
+                            Event.addListener(ta.form, 'submit', function() {
+                                this.saveHTML();
+                            }, this, true);
+                        }
+                    }
+                }
+            });
+            /**
+            * @private
+            * @config iframe
+            * @description Internal config for holding the iframe element.
+            * @default null
+            * @type Boolean
+            */
+            this.setAttributeConfig('iframe', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @config disabled
+            * @description This will toggle the editor's disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place.
+            All Toolbar buttons are also disabled so they cannot be used.
+            * @default false
+            * @type Boolean
+            */
+
+            this.setAttributeConfig('disabled', {
+                value: false,
+                method: function(disabled) {
+                    if (disabled) {
+                        if (!this._mask) {
+                            this._setDesignMode('off');
+                            this.toolbar.set('disabled', true);
+                            this._mask = document.createElement('DIV');
+                            Dom.setStyle(this._mask, 'height', '100%');
+                            Dom.setStyle(this._mask, 'width', '100%');
+                            Dom.setStyle(this._mask, 'position', 'absolute');
+                            Dom.setStyle(this._mask, 'top', '0');
+                            Dom.setStyle(this._mask, 'left', '0');
+                            Dom.setStyle(this._mask, 'opacity', '.5');
+                            Dom.addClass(this._mask, 'yui-editor-masked');
+                            this.get('iframe').get('parentNode').appendChild(this._mask);
+                        }
+                    } else {
+                        if (this._mask) {
+                            this._mask.parentNode.removeChild(this._mask);
+                            this._mask = null;
+                            this.toolbar.set('disabled', false);
+                            this._setDesignMode('on');
+                            this._focusWindow();
+                        }
+                    }
+                }
+            });
+            /**
+            * @config element_cont
+            * @description Internal config for the editors container
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('element_cont', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @config toolbar_cont
+            * @description Internal config for the toolbars container
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('toolbar_cont', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @config toolbar
+            * @description The default toolbar config.
+            * @default This config is too large to display here, view the code to see it: <a href="editor.js.html"></a>
+            * @type Object
+            */            
+            this.setAttributeConfig('toolbar', {
+                value: attr.toolbar || {
+                    /* {{{ Defaut Toolbar Config */
+                    collapse: true,
+                    titlebar: 'Text Editing Tools',
+                    draggable: false,
+                    buttons: [
+                        { group: 'fontstyle', label: 'Font Name and Size',
+                            buttons: [
+                                { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
+                                    menu: [
+                                        { text: 'Arial', checked: true },
+                                        { text: 'Arial Black' },
+                                        { text: 'Comic Sans MS' },
+                                        { text: 'Courier New' },
+                                        { text: 'Lucida Console' },
+                                        { text: 'Tahoma' },
+                                        { text: 'Times New Roman' },
+                                        { text: 'Trebuchet MS' },
+                                        { text: 'Verdana' }
+                                    ]
+                                },
+                                { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'textstyle', label: 'Font Style',
+                            buttons: [
+                                { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
+                                { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' },
+                                { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' },
+                                { type: 'separator' },
+                                { type: 'push', label: 'Subscript', value: 'subscript', disabled: true },
+                                { type: 'push', label: 'Superscript', value: 'superscript', disabled: true },
+                                { type: 'separator' },
+                                { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
+                                { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true },
+                                { type: 'separator' },
+                                { type: 'push', label: 'Remove Formatting', value: 'removeformat', disabled: true },
+                                { type: 'push', label: 'Hidden Elements', value: 'hiddenelements' }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'alignment', label: 'Alignment',
+                            buttons: [
+                                { type: 'push', label: 'Align Left CTRL + SHIFT + [', value: 'justifyleft' },
+                                { type: 'push', label: 'Align Center CTRL + SHIFT + |', value: 'justifycenter' },
+                                { type: 'push', label: 'Align Right CTRL + SHIFT + ]', value: 'justifyright' },
+                                { type: 'push', label: 'Justify', value: 'justifyfull' }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'parastyle', label: 'Paragraph Style',
+                            buttons: [
+                            { type: 'select', label: 'Normal', value: 'heading', disabled: true,
+                                menu: [
+                                    { text: 'Normal', value: 'none', checked: true },
+                                    { text: 'Header 1', value: 'h1' },
+                                    { text: 'Header 2', value: 'h2' },
+                                    { text: 'Header 3', value: 'h3' },
+                                    { text: 'Header 4', value: 'h4' },
+                                    { text: 'Header 5', value: 'h5' },
+                                    { text: 'Header 6', value: 'h6' }
+                                ]
+                            }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'indentlist', label: 'Indenting and Lists',
+                            buttons: [
+                                { type: 'push', label: 'Indent', value: 'indent', disabled: true },
+                                { type: 'push', label: 'Outdent', value: 'outdent', disabled: true },
+                                { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
+                                { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
+                                /*
+                                { type: 'menu', label: 'Create an Ordered List', value: 'insertorderedlist',
+                                    menu: [
+                                        { text: '1,2,3,4', value: '1', checked: true },
+                                        { text: 'A,B,C,D', value: 'A' },
+                                        { text: 'a,b,c,d', value: 'a' },
+                                        { text: 'I,II,III,IV', value: 'I' },
+                                        { text: 'i,ii,iii,iv', value: 'i' }
+                                    ]
+                                }
+                                */
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'insertitem', label: 'Insert Item',
+                            buttons: [
+                                { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
+                                { type: 'push', label: 'Insert Image', value: 'insertimage' }
+                            ]
+                        }
+                    ]
+                    /* }}} */
+                },
+                writeOnce: true,
+                method: function(toolbar) {
+                }
+            });
+            /**
+            * @config animate
+            * @description Should the editor animate window movements
+            * @default false unless Animation is found, then true
+            * @type Boolean
+            */            
+            this.setAttributeConfig('animate', {
+                value: false,
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.util.Anim) {
+                        ret = false;
+                    }
+                    return ret;
+                }               
+            });
+            /**
+            * @config panel
+            * @description A reference to the panel we are using for windows.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('panel', {
+                value: null,
+                writeOnce: true,
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.widget.Panel) {
+                        ret = false;
+                    }
+                    return ret;
+                }               
+            });
+            /**
+            * @config localFileWarning
+            * @description Should we throw the warning if we detect a file that is local to their machine?
+            * @default true
+            * @type Boolean
+            */            
+            this.setAttributeConfig('localFileWarning', {
+                value: true
+            });
+            /**
+            * @config dompath
+            * @description Toggle the display of the current Dom path below the editor
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('dompath', {
+                value: false,
+                method: function(dompath) {
+                    if (dompath && !this.dompath) {
+                        this.dompath = document.createElement('DIV');
+                        this.dompath.id = this.get('id') + '_dompath';
+                        Dom.addClass(this.dompath, 'dompath');
+                        this.get('element_cont').get('firstChild').appendChild(this.dompath);
+                        if (this.get('iframe')) {
+                            this._writeDomPath();
+                        }
+                    } else if (!dompath && this.dompath) {
+                        this.dompath.parentNode.removeChild(this.dompath);
+                        this.dompath = null;
+                    }
+                    this._setupAfterElement();
+                }
+            });
+            /**
+            * @config markup
+            * @description Should we try to adjust the markup for the following types: semantic, css or default
+            * @default "semantic"
+            * @type Boolean
+            */            
+            this.setAttributeConfig('markup', {
+                value: 'semantic',
+                validator: function(markup) {
+                    switch (markup.toLowerCase()) {
+                        case 'semantic':
+                        case 'css':
+                        case 'default':
+                        return true;
+                        break;
+                    }
+                    return false;
+                }
+            });
+
+            this.on('afterRender', function() {
+                this._renderPanel();
+            });
+        },
+        /**
+        * @private
+        * @method _getBlankImage
+        * @description Retrieves the full url of the image to use as the blank image.
+        * @returns {String} The URL to the blank image
+        */
+        _getBlankImage: function() {
+            if (!this.DOMReady) {
+                this._queue[this._queue.length] = ['_getBlankImage', arguments];
+                return '';
+            }      
+            var div = document.createElement('div');
+            div.style.position = 'absolute';
+            div.style.top = '-9999px';
+            div.style.left = '-9999px';
+            div.className = this.CLASS_PREFIX + '-blankimage';
+            document.body.appendChild(div);
+            var img = YAHOO.util.Dom.getStyle(div, 'background-image');
+            img = img.replace('url(', '').replace(')', '').replace(/"/g, '');
+            this.set('blankimage', img);            
+            return img;
+        },
+        /**
+        * @private
+        * @method _handleFontSize
+        * @description Handles the font size button in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleFontSize: function(o) {
+            var button = this.toolbar.getButtonById(o.button.id);
+            var value = button.get('label') + 'px';
+            this.execCommand('fontsize', value);
+            this.STOP_EXEC_COMMAND = true;
+        },
+        /**
+        * @private
+        * @method _handleColorPicker
+        * @description Handles the colorpicker buttons in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleColorPicker: function(o) {
+            var cmd = o.button;
+            var value = '#' + o.color;
+            if ((cmd == 'forecolor') || (cmd == 'backcolor')) {
+                this.execCommand(cmd, value);
+            }
+        },
+        /**
+        * @private
+        * @method _handleAlign
+        * @description Handles the alignment buttons in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleAlign: function(o) {
+            var button = this.toolbar.getButtonById(o.button.id);
+            var cmd = null;
+            for (var i = 0; i < o.button.menu.length; i++) {
+                if (o.button.menu[i].value == o.button.value) {
+                    cmd = o.button.menu[i].value;
+                }
+            }
+            var value = this._getSelection();
+
+            this.execCommand(cmd, value);
+            this.STOP_EXEC_COMMAND = true;
+        },
+        /**
+        * @private
+        * @method _handleAfterNodeChange
+        * @description Fires after a nodeChange happens to setup the things that where reset on the node change (button state).
+        */
+        _handleAfterNodeChange: function() {
+            var path = this._getDomPath();
+            for (var i = 0; i < path.length; i++) {
+                var elm = path[i],
+                    tag = elm.tagName.toLowerCase(),
+                    family = null,
+                    fontsize = null,
+                    validFont = false;
+
+                if (elm.getAttribute('tag')) {
+                    tag = elm.getAttribute('tag');
+                }
+
+                family = elm.getAttribute('face');
+                if (Dom.getStyle(elm, 'font-family')) {
+                    family = Dom.getStyle(elm, 'font-family');
+                }
+                var fn_button = this.toolbar.getButtonByValue('fontname');
+                if (fn_button) {
+                    for (var b = 0; b < fn_button._configs.menu.value.length; b++) {
+                        if (family && fn_button._configs.menu.value[b].text.toLowerCase() == family.toLowerCase()) {
+                            validFont = true;
+                            family = fn_button._configs.menu.value[b].text; //Put the proper menu name in the button
+                        }
+                    }
+                    if (!validFont) {
+                        family = fn_button._configs.label._initialConfig.value;
+                    }
+                    fn_button.set('label', '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>');
+                    this._updateMenuChecked('fontname', family);
+                }
+
+                var fs_button = this.toolbar.getButtonByValue('fontsize');
+                if (fs_button) {
+                    fontsize = parseInt(Dom.getStyle(elm, 'fontSize'));
+                    if ((fontsize == null) || isNaN(fontsize)) {
+                        fontsize = fs_button._configs.label._initialConfig.value;
+                    }
+                    fs_button.set('label', ''+fontsize);
+                }
+
+                if (tag.substring(0, 1) == 'h') {
+                    var hd_button = this.toolbar.getButtonByValue('heading');
+                    if (hd_button) {
+                        for (var b = 0; b < hd_button._configs.menu.value.length; b++) {
+                            if (hd_button._configs.menu.value[b].value.toLowerCase() == tag) {
+                                hd_button.set('label', hd_button._configs.menu.value[b].text);
+                            }
+                        }
+                        this._updateMenuChecked('heading', tag);
+                    }
+                }
+            }
+            
+            if (elm && elm.tagName && (elm.tagName.toLowerCase() != 'body')) {
+                this.toolbar.enableButton(fn_button);
+                this.toolbar.enableButton(fs_button);
+            }
+            
+        },
+        /**
+        * @private
+        * @method _handleInsertImageClick
+        * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked.
+        */
+        _handleInsertImageClick: function() {
+            //this.toolbar.disableButton(this.toolbar.getButtonByValue('insertimage'));
+            this.on('afterExecCommand', function() {
+                var el = this.currentElement[0],
+                    title = '',
+                    src = '',
+                    align = '',
+                    height = 75,
+                    width = 75,
+                    padding = 0,
+                    blankimage = false,
+                    win = new YAHOO.widget.EditorWindow('insertimage', {
+                        width: '415px'
+                    });
+
+                if (!el) {
+                    el = this._getSelectedElement();
+                }
+                if (el) {
+                    if (el.getAttribute('src')) {
+                        src = el.getAttribute('src', 2);
+                        if (src.indexOf(this.get('blankimage')) != -1) {
+                            src = this.STR_IMAGE_HERE;
+                            blankimage = true;
+                        }
+                    }
+                    if (el.getAttribute('alt', 2)) {
+                        title = el.getAttribute('alt', 2);
+                    }
+                    if (el.getAttribute('title', 2)) {
+                        title = el.getAttribute('title', 2);
+                    }
+                    height = parseInt(el.height);
+                    width = parseInt(el.width);
+                    if (el.style.height) {
+                        height = parseInt(el.style.height);
+                    }
+                    if (el.style.width) {
+                        width = parseInt(el.style.width);
+                    }
+                    if (el.style.margin) {
+                        padding = parseInt(el.style.margin);
+                    }
+                    if (!el._height) {
+                        el._height = height;
+                    }
+                    if (!el._width) {
+                        el._width = width;
+                    }
+                    var oheight = el._height;
+                    var owidth = el._width;
+                }
+                if (!win.cache) {
+                    var str = '<label for="insertimage_url"><strong>' + this.STR_IMAGE_URL + ':</strong> <input type="text" id="insertimage_url" value="' + src + '" size="40"></label>';
+                    var body = document.createElement('div');
+                    body.innerHTML = str;
+
+                    var tbarCont = document.createElement('div');
+                    tbarCont.id = 'img_toolbar';
+                    body.appendChild(tbarCont);
+
+                    var str2 = '<label for="insertimage_title"><strong>' + this.STR_IMAGE_TITLE + ':</strong> <input type="text" id="insertimage_title" value="' + title + '" size="40"></label>';
+                    var div = document.createElement('div');
+                    div.innerHTML = str2;
+                    body.appendChild(div);
+                    win.cache = body;
+                } else {
+                    body = win.cache;
+                }
+
+                var tbar = new YAHOO.widget.Toolbar(tbarCont, {
+                    /* {{{ */ 
+                    buttons: [
+                        { group: 'padding', label: this.STR_IMAGE_PADDING + ':',
+                            buttons: [
+                                { type: 'spin', label: ''+padding, value: 'padding', range: [0, 50] }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'border', label: this.STR_IMAGE_BORDER + ':',
+                            buttons: [
+                                { type: 'select', label: 'Border Size', value: 'bordersize',
+                                    menu: [
+                                        { text: 'none', value: '0', checked: true },
+                                        { text: '----', value: '1' },
+                                        { text: '----', value: '2' },
+                                        { text: '----', value: '3' },
+                                        { text: '----', value: '4' },
+                                        { text: '----', value: '5' }
+                                    ]
+                                },
+                                { type: 'select', label: 'Border Type', value: 'bordertype', disabled: true,
+                                    menu: [
+                                        { text: '----', value: 'solid', checked: true },
+                                        { text: '----', value: 'dashed' },
+                                        { text: '----', value: 'dotted' }
+                                    ]
+                                },
+                                { type: 'color', label: 'Border Color', value: 'bordercolor', disabled: true }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'textflow', label: this.STR_IMAGE_TEXTFLOW + ':',
+                            buttons: [
+                                { type: 'push', label: 'Left', value: 'left' },
+                                { type: 'push', label: 'Inline', value: 'inline' },
+                                { type: 'push', label: 'Block', value: 'block' },
+                                { type: 'push', label: 'Right', value: 'right' }
+                            ]
+                        }
+                    ]
+                    /* }}} */
+                });
+                
+                var bsize = '0';
+                var btype = 'solid';
+                if (el.style.borderLeftWidth) {
+                    bsize = parseInt(el.style.borderLeftWidth);
+                }
+                if (el.style.borderLeftStyle) {
+                    btype = el.style.borderLeftStyle;
+                }
+                var bs_button = tbar.getButtonByValue('bordersize');
+                var bSizeStr = ((parseInt(bsize) > 0) ? '----' : 'none');
+                bs_button.set('label', '<span class="yui-toolbar-bordersize-' + bsize + '">'+bSizeStr+'</span>');
+                this._updateMenuChecked('bordersize', bsize, tbar);
+
+                var bs_button = tbar.getButtonByValue('bordertype');
+                bs_button.set('label', '<span class="yui-toolbar-bordertype-' + btype + '">----</span>');
+                this._updateMenuChecked('bordertype', btype, tbar);
+                if (parseInt(bsize) > 0) {
+                    tbar.enableButton(tbar.getButtonByValue('bordertype'));
+                    tbar.enableButton(tbar.getButtonByValue('bordercolor'));
+                }
+
+                var cont = tbar.get('cont');
+                var hw = document.createElement('div');
+                hw.className = 'yui-toolbar-group yui-toolbar-group-padding height-width';
+                hw.innerHTML = '<h3>' + this.STR_IMAGE_SIZE + ':</h3>';
+                var orgSize = '';
+                if ((height != oheight) || (width != owidth)) {
+                    orgSize = '<span class="info">' + this.STR_IMAGE_ORIG_SIZE + '<br>'+ owidth +' x ' + oheight + '</span>';
+                }
+                hw.innerHTML += '<span><input type="text" size="3" value="'+width+'" id="insertimage_width"> x <input type="text" size="3" value="'+height+'" id="insertimage_height"></span>' + orgSize;
+                cont.insertBefore(hw, cont.firstChild);
+
+                Event.onAvailable('insertimage_width', function() {
+                    Event.on('insertimage_width', 'blur', function() {
+                        var value = parseInt(Dom.get('insertimage_width').value);
+                        if (value > 5) {
+                            el.style.width = value + 'px';
+                            this.moveWindow();
+                        }
+                    }, this, true);
+                }, this, true);
+                Event.onAvailable('insertimage_height', function() {
+                    Event.on('insertimage_height', 'blur', function() {
+                        var value = parseInt(Dom.get('insertimage_height').value);
+                        if (value > 5) {
+                            el.style.height = value + 'px';
+                            this.moveWindow();
+                        }
+                    }, this, true);
+                }, this, true);
+
+                if (el.align == 'right') {
+                    tbar.selectButton(tbar.getButtonByValue('right'));
+                } else if (el.align == 'left') {
+                    tbar.selectButton(tbar.getButtonByValue('left'));
+                } else if (el.style.display == 'block') {
+                    tbar.selectButton(tbar.getButtonByValue('block'));
+                } else {
+                    tbar.selectButton(tbar.getButtonByValue('inline'));
+                }
+                if (parseInt(el.style.marginLeft) > 0) {
+                     tbar.getButtonByValue('padding').set('label', ''+parseInt(el.style.marginLeft));
+                }
+                if (el.style.borderSize) {
+                    tbar.selectButton(tbar.getButtonByValue('bordersize'));
+                    tbar.selectButton(tbar.getButtonByValue(parseInt(el.style.borderSize)));
+                }
+
+                tbar.on('colorPickerClicked', function(o) {
+                    var size = '1', type = 'solid', color = 'black';
+
+                    if (el.style.borderLeftWidth) {
+                        size = parseInt(el.style.borderLeftWidth);
+                    }
+                    if (el.style.borderLeftStyle) {
+                        type = el.style.borderLeftStyle;
+                    }
+                    if (el.style.borderLeftColor) {
+                        color = el.style.borderLeftColor;
+                    }
+                    var borderString = size + 'px ' + type + ' #' + o.color;
+                    el.style.border = borderString;
+                }, this.toolbar, true);
+
+                tbar.on('buttonClick', function(o) {
+                    var value = o.button.value;
+                    if (o.button.menucmd) {
+                        value = o.button.menucmd
+                    }
+                    var size = '1', type = 'solid', color = 'black';
+
+                    /* All border calcs are done on the left border
+                        since our default interface only supports
+                        one border size/type and color */
+                    if (el.style.borderLeftWidth) {
+                        size = parseInt(el.style.borderLeftWidth);
+                    }
+                    if (el.style.borderLeftStyle) {
+                        type = el.style.borderLeftStyle;
+                    }
+                    if (el.style.borderLeftColor) {
+                        color = el.style.borderLeftColor;
+                    }
+                    switch(value) {
+                        case 'bordersize':
+                            var borderString = parseInt(o.button.value) + 'px ' + type + ' ' + color;
+                            el.style.border = borderString;
+                            if (parseInt(o.button.value) > 0) {
+                                tbar.enableButton(tbar.getButtonByValue('bordertype'));
+                                tbar.enableButton(tbar.getButtonByValue('bordercolor'));
+                            } else {
+                                tbar.disableButton(tbar.getButtonByValue('bordertype'));
+                                tbar.disableButton(tbar.getButtonByValue('bordercolor'));
+                            }
+                            break;
+                        case 'bordertype':
+                            var borderString = size + 'px ' + o.button.value + ' ' + color;
+                            el.style.border = borderString;
+                            break;
+                        case 'right':
+                        case 'left':
+                            tbar.deselectAllButtons();
+                            el.style.display = '';
+                            el.align = o.button.value;
+                            break;
+                        case 'inline':
+                            tbar.deselectAllButtons();
+                            el.style.display = '';
+                            el.align = '';
+                            break;
+                        case 'block':
+                            tbar.deselectAllButtons();
+                            el.style.display = 'block';
+                            el.align = 'center';
+                            break;
+                        case 'padding':
+                            var _button = tbar.getButtonById(o.button.id);
+                            el.style.margin = _button.get('label') + 'px';
+                            break;
+                    }
+                    tbar.selectButton(tbar.getButtonByValue(o.button.value));
+                    this.moveWindow();
+                }, this, true);
+
+                win.setHeader(this.STR_IMAGE_PROP_TITLE);
+                win.setBody(body);
+                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
+                    var str = this.STR_IMAGE_COPY;
+                    win.setFooter(str);
+                }
+                this.openWindow(win);
+
+
+                //Set event after openWindow..
+                Event.onAvailable('insertimage_url', function() {
+                    window.setTimeout(function() {
+                        YAHOO.util.Dom.get('insertimage_url').focus();
+                        if (blankimage) {
+                            YAHOO.util.Dom.get('insertimage_url').select();
+                        }
+                    }, 50);
+                    
+                    if (this.get('localFileWarning')) {
+                        Event.on('insertimage_url', 'blur', function() {
+                            var url = Dom.get('insertimage_url');
+                            if ((url.value != '') && ((url.value.indexOf('file:/') != -1) || (url.value.indexOf(':\\') != -1))) {
+                                //Local File throw Warning
+                                Dom.addClass(url, 'warning');
+                                YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor');
+                                var str = this.STR_LOCAL_FILE_WARNING;
+                                this.get('panel').setFooter(str);
+                            } else {
+                                Dom.removeClass(url, 'warning');
+                                this.get('panel').setFooter(' ');
+                                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
+                                    var str = this.STR_IMAGE_COPY;
+                                    this.get('panel').setFooter(str);
+                                }
+                                
+                                if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
+                                    this.currentElement[0].setAttribute('src', url.value);
+                                    var img = new Image();
+                                    var self = this;
+                                    window.setTimeout(function() {
+                                        YAHOO.util.Dom.get('insertimage_height').value = img.height;
+                                        YAHOO.util.Dom.get('insertimage_width').value = img.width;
+                                        if (!self.currentElement[0]._height) {
+                                            self.currentElement[0]._height = img.height;
+                                        }
+                                        if (!self.currentElement[0]._width) {
+                                            self.currentElement[0]._width = img.width;
+                                        }
+                                        self.moveWindow();
+                                    }, 200);
+
+                                    img.src = url.value;
+                                }
+                            }
+                        }, this, true);
+                    }
+                }, this, true);
+            });
+        },
+        /**
+        * @private
+        * @method _handleInsertImageWindowClose
+        * @description Handles the closing of the Image Properties Window.
+        */
+        _handleInsertImageWindowClose: function() {
+            var url = Dom.get('insertimage_url');
+            var title = Dom.get('insertimage_title');
+            var el = this.currentElement[0];
+            if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
+                el.setAttribute('src', url.value);
+                el.setAttribute('title', title.value);
+                el.setAttribute('alt', title.value);
+                //this.toolbar.enableButton(this.toolbar.getButtonByValue('insertimage'));
+            } else {
+                //No url/src given, remove the node from the document
+                el.parentNode.removeChild(el);
+            }
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkClick
+        * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked.
+        */
+        _handleCreateLinkClick: function() {
+            this.on('afterExecCommand', function() {
+
+                var win = new YAHOO.widget.EditorWindow('createlink', {
+                    width: '300px'
+                });
+                
+                var el = this.currentElement[0],
+                    url = '',
+                    title = '',
+                    target = '',
+                    localFile = false;
+                if (el) {
+                    if (el.getAttribute('href') != null) {
+                        url = el.getAttribute('href');
+                        if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
+                            //Local File throw Warning
+                            YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor');
+                            var str = this.STR_LOCAL_FILE_WARNING;
+                            win.setFooter(str);
+                            localFile = true;
+                        } else {
+                            win.setFooter(' ');
+                        }
+                    }
+                    if (el.getAttribute('title') != null) {
+                        title = el.getAttribute('title');
+                    }
+                    if (el.getAttribute('target') != null) {
+                        target = el.getAttribute('target');
+                    }
+                }
+                var str = '<label for="createlink_url"><strong>' + this.STR_LINK_URL + ':</strong> <input type="text" name="createlink_url" id="createlink_url" value="' + url + '"' + ((localFile) ? ' class="warning"' : '') + '></label>';
+                str += '<label for="createlink_target"><strong>&nbsp;</strong><input type="checkbox" name="createlink_target_" id="createlink_target" value="_blank"' + ((target) ? ' checked' : '') + '> ' + this.STR_LINK_NEW_WINDOW + '</label>';
+                str += '<label for="createlink_title"><strong>' + this.STR_LINK_TITLE + ':</strong> <input type="text" name="createlink_title" id="createlink_title" value="' + title + '"></label>';
+                
+                var body = document.createElement('div');
+                body.innerHTML = str;
+
+                var unlinkCont = document.createElement('div');
+                unlinkCont.className = 'removeLink';
+                var unlink = document.createElement('a');
+                unlink.href = '#';
+                unlink.innerHTML = this.STR_LINK_PROP_REMOVE;
+                unlink.title = this.STR_LINK_PROP_REMOVE;
+                Event.on(unlink, 'click', function(ev) {
+                    Event.stopEvent(ev);
+                    this.execCommand('unlink');
+                    this.closeWindow();
+                }, this, true);
+                unlinkCont.appendChild(unlink);
+                body.appendChild(unlinkCont);
+
+                win.setHeader(this.STR_LINK_PROP_TITLE);
+                win.setBody(body);
+
+                Event.onAvailable('createlink_url', function() {
+                    window.setTimeout(function() {
+                        try {
+                            YAHOO.util.Dom.get('createlink_url').focus();
+                        } catch (e) {}
+                    }, 50);
+                    Event.on('createlink_url', 'blur', function() {
+                        var url = Dom.get('createlink_url');
+                        if ((url.value != '') && ((url.value.indexOf('file:/') != -1) || (url.value.indexOf(':\\') != -1))) {
+                            //Local File throw Warning
+                            Dom.addClass(url, 'warning');
+                            YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor');
+                            var str = this.STR_LOCAL_FILE_WARNING;
+                            this.get('panel').setFooter(str);
+                        } else {
+                            Dom.removeClass(url, 'warning');
+                            this.get('panel').setFooter(' ');
+                        }
+                    }, this, true);
+                }, this, true);
+
+                this.openWindow(win);
+            });
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkWindowClose
+        * @description Handles the closing of the Link Properties Window.
+        */
+        _handleCreateLinkWindowClose: function() {
+            var url = Dom.get('createlink_url');
+            var target = Dom.get('createlink_target');
+            var title = Dom.get('createlink_title');
+            var el = this.currentElement[0];
+            if (url && url.value) {
+                var urlValue = url.value;
+                if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                    if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                        //Found an @ sign, prefix with mailto:
+                        urlValue = 'mailto:' + urlValue;
+                    } else {
+                        /* :// not found adding */
+                        urlValue = 'http:/'+'/' + urlValue;
+                    }
+                }
+                el.setAttribute('href', urlValue);
+                if (target.checked) {
+                    el.setAttribute('target', target.value);
+                } else {
+                    el.setAttribute('target', '');
+                }
+                el.setAttribute('title', ((title.value) ? title.value : ''));
+
+            } else {
+                el.removeAttribute('tag');
+                Dom.removeClass(el, 'yui-tag-a');
+                Dom.removeClass(el, 'yui-tag');
+                Dom.addClass(el, 'yui-non');
+            }
+            this.nodeChange();
+        },
+        /**
+        * @method render
+        * @description Causes the toolbar and the editor to render and replace the textarea.
+        */
+        render: function() {
+            if (!this.DOMReady) {
+                this._queue[this._queue.length] = ['render', arguments];
+                return false;
+            }
+            var self = this;
+            var tbarConf = this.get('toolbar');
+            //Set the toolbar to disabled until content is loaded
+            tbarConf.disabled = true;
+            //Create Toolbar instance
+            this.toolbar = new Toolbar(this.get('toolbar_cont'), tbarConf);
+            YAHOO.log('fireEvent::toolbarLoaded', 'info', 'Editor');
+            this.fireEvent('toolbarLoaded', { type: 'toolbarLoaded', target: this.toolbar });
+
+            
+            this.toolbar.on('toolbarCollapsed', function() {
+                if (this.currentWindow) {
+                    this.moveWindow();
+                }
+            }, this, true);
+            this.toolbar.on('toolbarExpanded', function() {
+                if (this.currentWindow) {
+                    this.moveWindow();
+                }
+            }, this, true);
+            this.toolbar.on('fontsizeClick', function(o) {
+                this._handleFontSize(o);
+            }, this, true);
+            
+            this.toolbar.on('colorPickerClicked', function(o) {
+                this._handleColorPicker(o);
+            }, this, true);
+
+            this.toolbar.on('alignClick', function(o) {
+                this._handleAlign(o);
+            }, this, true);
+            this.on('afterNodeChange', function() {
+                this._handleAfterNodeChange();
+            }, this, true);
+            this.toolbar.on('insertimageClick', function() {
+                this._handleInsertImageClick();
+            }, this, true);
+            this.on('windowinsertimageClose', function() {
+                this._handleInsertImageWindowClose();
+            }, this, true);
+            this.toolbar.on('createlinkClick', function() {
+                this._handleCreateLinkClick();
+            }, this, true);
+            this.on('windowcreatelinkClose', function() {
+                this._handleCreateLinkWindowClose();
+            }, this, true);
+
+
+            //Replace Textarea with editable area
+            
+            this.get('parentNode').replaceChild(this.get('element_cont').get('element'), this.get('element'));
+
+
+            if (!this.beforeElement) {
+                this.beforeElement = document.createElement('h2');
+                this.beforeElement.className = 'yui-editor-skipheader';
+                this.beforeElement.tabIndex = '-1';
+                this.beforeElement.innerHTML = this.STR_BEFORE_EDITOR;
+                this.get('element_cont').get('firstChild').insertBefore(this.beforeElement, this.toolbar.get('nextSibling'));
+            }
+            
+            Dom.setStyle(this.get('textarea'), 'display', 'none');
+            this.get('element_cont').appendChild(this.get('element'));
+            this.get('element_cont').setStyle('display', 'block');
+
+
+            //Set height and width of editor container
+            this.get('element_cont').setStyle('width', this.get('width'));
+            Dom.setStyle(this.get('iframe').get('parentNode'), 'height', this.get('height'));
+
+            this.get('iframe').setStyle('width', '100%'); //WIDTH
+            //this.get('iframe').setStyle('_width', '99%'); //WIDTH
+            this.get('iframe').setStyle('height', '100%');
+
+
+            var self = this;
+            window.setTimeout(function() {
+                self._setInitialContent.call(self);
+            }, 10);
+            
+            this.fireEvent('afterRender', { type: 'afterRender', target: this });
+        },
+        /**
+        * @method execCommand
+        * @param {String} action The "execCommand" action to try to execute (Example: bold, insertimage, inserthtml)
+        * @param {String} value (optional) The value for a given action such as action: fontname value: 'Verdana'
+        * @description This method attempts to try and level the differences in the various browsers and their support for execCommand actions
+        */
+        execCommand: function(action, value) {
+            this.fireEvent('beforeExecCommand', { type: 'beforeExecCommand', target: this, args: arguments });
+            if (this.STOP_EXEC_COMMAND) {
+                this.STOP_EXEC_COMMAND = false;
+                return false;
+            }
+            this._setMarkupType(action);
+            if (this.browser.ie) {
+                this._getWindow().focus();
+            }
+            var exec = true;
+            var _sel = this._getSelection();
+            var _range = this._getRange();
+            var _selEl = this._getSelectedElement();
+            if (_selEl) {
+                _sel = _selEl;
+            }
+            switch (action.toLowerCase()) {
+                case 'heading':
+                    if (this.browser.ie) {
+                        action = 'formatblock';
+                    }
+                    if (value == 'none') {
+                        if ((_sel && _sel.tagName && (_sel.tagName.toLowerCase().substring(0,1) == 'h')) || (_sel && _sel.parentNode && _sel.parentNode.tagName && (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h'))) {
+                            if (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h') {
+                                _sel = _sel.parentNode;
+                            }
+                            var _span = this._getDoc().createElement('span');
+                            _span.className = 'yui-non';
+                            _span.innerHTML = _sel.innerHTML;
+                            _sel.parentNode.replaceChild(_span, _sel);
+                        }
+                        exec = false;
+                    } else {
+                        if (this.browser.ie || this.browser.webkit || this.browser.opera) {
+                            this._createCurrentElement(value);
+                            exec = false;
+                        }
+                    }
+                    break;
+                case 'backcolor':
+                    if (this.browser.gecko || this.browser.opera) {
+                        this._setEditorStyle(true);
+                        action = 'hilitecolor';
+                    }
+                    break;
+                case 'hiddenelements':
+                    this._showHidden();
+                    exec = false;
+                    break;
+                case 'unlink':
+                    //var el = this._getSelectedElement();
+                    var el = this.currentElement[0];
+                    el.removeAttribute('title');
+                    el.removeAttribute('tag');
+                    el.removeAttribute('target');
+                    el.removeAttribute('href');
+                    YAHOO.util.Dom.addClass(el, 'yui-non');
+                    YAHOO.util.Dom.removeClass(el, 'yui-tag-a');
+                    YAHOO.util.Dom.removeClass(el, 'yui-tag');
+                    exec = false;
+                    break;
+                case 'createlink':
+                    var el = this._getSelectedElement();
+                    if (!el || (el.getAttribute('tag') != 'a')) {
+                        this._createCurrentElement('a');
+                    } else {
+                        this.currentElement[0] = el;
+                    }
+                    exec = false;
+                    break;
+                case 'insertimage':
+                    if (value == '') {
+                        value = this.get('blankimage');
+                    }
+                    /**
+                    * @knownissue
+                    * @browser Safari 2.x
+                    * @description The issue here is that we have no way of knowing where the cursor position is
+                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+                    */
+                    
+                    var el = this._getSelectedElement();
+
+                    if (el && el.tagName && (el.tagName.toLowerCase() == 'img')) {
+                        this.currentElement[0] = el;
+                        exec = false;
+                    } else {
+                        if (this._getDoc().queryCommandEnabled(action)) {
+                            this._getDoc().execCommand('insertimage', false, value);
+                            var imgs = this._getDoc().getElementsByTagName('img');
+                            for (var i = 0; i < imgs.length; i++) {
+                                if (!YAHOO.util.Dom.hasClass(imgs[i], 'yui-img')) {
+                                    YAHOO.util.Dom.addClass(imgs[i], 'yui-img');
+                                    this.currentElement[0] = imgs[i];
+                                }
+                            }
+                            exec = false;
+                        } else {
+                            this._createCurrentElement('img');
+                            var _img = this._getDoc().createElement('img');
+                            _img.setAttribute('src', value);
+                            YAHOO.util.Dom.addClass(_img, 'yui-img');
+                            this.currentElement[0].parentNode.replaceChild(_img, this.currentElement[0]);
+                            this.currentElement[0] = _img;
+                            exec = false;
+                        }
+                    }
+                    
+                    break;
+                case 'inserthtml':
+                    /**
+                    * @knownissue
+                    * @browser Safari 2.x
+                    * @description The issue here is that we have no way of knowing where the cursor position is
+                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+                    */
+                    if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
+                        YAHOO.log('More Safari DOM tricks (inserthtml)', 'info', 'EditorSafari');
+                        this._createCurrentElement('img');
+                        var _span = this._getDoc().createElement('span');
+                        _span.innerHTML = value;
+                        this.currentElement[0].parentNode.replaceChild(_span, this.currentElement[0]);
+                        exec = false;
+                    } else if (this.browser.ie) {
+                        var _range = this._getRange();
+                        if (_range.item) {
+                            _range.item(0).outerHTML = value;
+                        } else {
+                            _range.pasteHTML(value);
+                        }
+                        exec = false;                    
+                    }
+                    break;
+                case 'removeformat':
+                    /**
+                    * @knownissue Remove Format issue
+                    * @browser Safari 2.x
+                    * @description There is an issue here with Safari, that it may not always remove the format of the item that is selected.
+                    * Due to the way that Safari 2.x handles ranges, it is very difficult to determine what the selection holds.
+                    * So here we are making the best possible guess and acting on it.
+                    */
+                    if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
+                        this._createCurrentElement('span');
+                        YAHOO.util.Dom.addClass(this.currentElement[0], 'yui-non');
+                        var re= /<\S[^><]*>/g;
+                        var str = this.currentElement[0].innerHTML.replace(re, '');
+                        var _txt = this._getDoc().createTextNode(str);
+                        this.currentElement[0].parentNode.parentNode.replaceChild(_txt, this.currentElement[0].parentNode);
+                        
+                        exec = false;
+                    }
+                    break;
+                case 'superscript':
+                case 'subscript':
+                    if (this.browser.webkit) {
+                        YAHOO.log('Safari dom fun again (' + action + ')..', 'info', 'EditorSafari');
+                        var tag = action.toLowerCase().substring(0, 3);
+                        this._createCurrentElement(tag);
+                        if (this.currentElement[0].parentNode.tagName.toLowerCase() == tag) {
+                            YAHOO.log('we are a child of tag (' + tag + '), reverse process', 'info', 'EditorSafari');
+                            var span = this._getDoc().createElement('span');
+                            span.innerHTML = this.currentElement[0].innerHTML;
+                            YAHOO.util.Dom.addClass(span, 'yui-non');
+                            this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
+
+                        } else {
+                            var _sub = this._getDoc().createElement(tag);
+                            _sub.innerHTML = this.currentElement[0].innerHTML;
+                            this.currentElement[0].parentNode.replaceChild(_sub, this.currentElement[0]);
+                        }
+                        exec = false;
+                    }
+                    break;
+                case 'formatblock':
+                    value = 'blockquote';
+                    if (this.browser.webkit) {
+                        this._createCurrentElement('blockquote');
+                        if (YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode, 'yui-tag-blockquote')) {
+                            var span = this._getDoc().createElement('span');
+                            span.innerHTML = this.currentElement[0].innerHTML;
+                            YAHOO.util.Dom.addClass(span, 'yui-non');
+                            this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
+                        }
+                        exec = false;
+                    } else {
+                        var tar = Event.getTarget(this.currentEvent);
+                        if (tar && tar.tagName && (tar.tagName.toLowerCase() == 'blockquote')) {
+                            var span = this._getDoc().createElement('span');
+                            span.innerHTML = tar.innerHTML;
+                            YAHOO.util.Dom.addClass(span, 'yui-non');
+                            tar.parentNode.replaceChild(span, tar);
+                            exec = false;
+                        }
+                    }
+                    break;
+                case 'indent':
+                case 'outdent':
+                    this._createCurrentElement(action.toLowerCase());
+                    if (this.currentElement[0].parentNode) {
+                        if (action.toLowerCase() == 'outdent') {
+                            if (YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode, 'yui-tag-indent')) {
+                                var span = this._getDoc().createElement('span');
+                                span.innerHTML = this.currentElement[0].innerHTML;
+                                YAHOO.util.Dom.addClass(span, 'yui-non');
+                                this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
+                            }
+                        }
+                    }
+                    exec = false;
+                    break;
+                case 'insertorderedlist':
+                case 'insertunorderedlist':
+                    /**
+                    * @knownissue Safari 2.+ doesn't support ordered and unordered lists
+                    * @browser Safari 2.x
+                    * The issue with this workaround is that when applied to a set of text
+                    * that has BR's in it, Safari may or may not pick up the individual items as
+                    * list items. This is fixed in WebKit (Safari 3)
+                    */
+                    var tag = ((action.toLowerCase() == 'insertorderedlist') ? 'ol' : 'ul');
+                    //if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) || this.browser.opera) {
+                    if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action))) {
+                        var selEl = this._getSelectedElement();
+                        if ((selEl.tagName.toLowerCase() == 'li') && (selEl.parentNode.tagName.toLowerCase() == tag)) {
+                            YAHOO.log('We already have a list, undo it', 'info', 'Editor');
+                            var el = selEl.parentNode;
+                            var list = this._getDoc().createElement('span');
+                            YAHOO.util.Dom.addClass(list, 'yui-non');
+                            var str = '';
+                            var lis = el.getElementsByTagName('li');
+                            for (var i = 0; i < lis.length; i++) {
+                                str += lis[i].innerHTML + '<br>';
+                            }
+                            list.innerHTML = str;
+
+                        } else {
+                            YAHOO.log('Create list item', 'info', 'Editor');
+                            this._createCurrentElement(tag.toLowerCase());
+                            var el = this.currentElement[0];
+                            var list = this._getDoc().createElement(tag);
+                            if (tag == 'ol') {
+                                list.type = value;
+                            }
+                            var li = this._getDoc().createElement('li');
+                            li.innerHTML = el.innerHTML + '&nbsp;';
+                            list.appendChild(li);
+                        }
+                        el.parentNode.replaceChild(list, el);
+                        exec = false;
+                    } else {
+                        var el = this._getSelectedElement();
+                        if ((el.tagName.toLowerCase() == 'li') && (el.parentNode.tagName.toLowerCase() == tag) || (this.browser.ie && this._getRange().parentElement && this._getRange().parentElement.tagName && (this._getRange().parentElement.tagName.toLowerCase() == 'li'))) { //we are in a list..
+                            YAHOO.log('We already have a list, undo it', 'info', 'Editor');
+                            if (this.browser.ie) {
+                                YAHOO.log('Undo IE', 'info', 'Editor');
+                                exec = false;
+                                var str = '';
+                                var lis = el.parentNode.getElementsByTagName('li');
+                                for (var i = 0; i < lis.length; i++) {
+                                    str += lis[i].innerHTML + '<br>';
+                                }
+                                var newEl = this._getDoc().createElement('span');
+                                newEl.innerHTML = str;
+                                el.parentNode.parentNode.replaceChild(newEl, el.parentNode);
+                            } else {
+                                this.nodeChange();
+                                this._getDoc().execCommand(action, '', el.parentNode);
+                                this.nodeChange();
+                            }
+                        }
+                        if (this.browser.opera) {
+                            var self = this;
+                            window.setTimeout(function() {
+                                var lis = self._getDoc().getElementsByTagName('li');
+                                for (var i = 0; i < lis.length; i++) {
+                                    if (lis[i].innerHTML.toLowerCase() == '<br>') {
+                                        lis[i].parentNode.parentNode.removeChild(lis[i].parentNode);
+                                    }
+                                }
+                            },30);
+                        }
+                        if (this.browser.ie && exec) {
+                            var html = '';
+                            if (this._getRange().html) {
+                                html = '<li>' + this._getRange().html+ '</li>';
+                            } else {
+                                html = '<li>' + this._getRange().text + '</li>';
+                            }
+
+                            this._getRange().pasteHTML('<' + tag + '>' + html + '</' + tag + '>');
+                            exec = false;
+                        }
+                    }
+                    break;
+                case 'fontname':
+                    var selEl = this._getSelectedElement();
+                    this.currentFont = value;
+                    if (selEl && selEl.tagName && !this._hasSelection()) {
+                        YAHOO.util.Dom.setStyle(selEl, 'font-family', value);
+                        exec = false;
+                    }
+                    break;
+                case 'fontsize':
+                    if ((this.currentElement.length > 0) && (!this._hasSelection())) {
+                        YAHOO.util.Dom.setStyle(this.currentElement, 'fontSize', value);
+                    } else {
+                        this._createCurrentElement('span', {'fontSize': value });
+                    }
+                    exec = false;
+                    break;
+            }
+            if (exec) {
+                YAHOO.log('execCommand::(' + action + '), (' + value + ')', 'info', 'Editor');
+                try {
+                    this._getDoc().execCommand(action, false, value);
+                } catch(e) {
+                    YAHOO.log('execCommand Failed', 'error', 'Editor');
+                }
+            } else {
+                YAHOO.log('OVERRIDE::execCommand skipped', 'warn', 'Editor');
+            }
+            this.on('afterExecCommand', function() {
+                this.unsubscribeAll('afterExecCommand');
+                this.nodeChange();
+            });
+            this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            
+        },
+        /**
+        * @private
+        * @method _createCurrentElement
+        * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create
+        * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element.
+        * @description This is a work around for the various browser issues with execCommand. This method will run <code>execCommand('fontname', false, 'yui-tmp')</code> on the given selection.
+        * It will then search the document for a span with the font-family set to <strong>yui-tmp</strong> and replace that with another span that has other information in it, then assign the new span to
+        * <code>this.currentElement</code>, so we now have an element reference to the element that was just modified. At this point we can use standard DOM manipulation to change it as we see fit.
+        */
+        _createCurrentElement: function(tagName, tagStyle) {
+            var tagName = ((tagName) ? tagName : 'a'),
+                sel = this._getSelection(),
+                tar = null,
+                el = [],
+                _doc = this._getDoc();
+            
+            if (this.currentFont) {
+                if (!tagStyle) {
+                    tagStyle = {};
+                }
+                tagStyle.fontFamily = this.currentFont;
+                this.currentFont = null;
+            }
+            this.currentElement = [];
+
+            var _elCreate = function() {
+                switch (tagName) {
+                    case 'h1':
+                    case 'h2':
+                    case 'h3':
+                    case 'h4':
+                    case 'h5':
+                    case 'h6':
+                        var el = _doc.createElement(tagName);
+                        break;
+                    default:
+                        var el = _doc.createElement('span');
+                        YAHOO.util.Dom.addClass(el, 'yui-tag-' + tagName);
+                        YAHOO.util.Dom.addClass(el, 'yui-tag');
+                        el.setAttribute('tag', tagName);
+                        el.tabIndex = 1;
+
+                        for (var i in tagStyle) {
+                            if (YAHOO.util.Lang.hasOwnProperty(tagStyle, i)) {
+                                el.style[i] = tagStyle[i];
+                            }
+                        }
+                        break;
+                }
+                return el;
+            };
+
+            if (!this._hasSelection()) {
+                if (this._getDoc().queryCommandEnabled('insertimage')) {
+                    this._getDoc().execCommand('insertimage', false, 'yui-tmp-img');
+                    var imgs = this._getDoc().getElementsByTagName('img');
+                    for (var i = 0; i < imgs.length; i++) {
+                        if (imgs[i].getAttribute('src', 2) == 'yui-tmp-img') {
+                            el = _elCreate();
+                            imgs[i].parentNode.replaceChild(el, imgs[i]);
+                            this.currentElement[this.currentElement.length] = el;
+                            //this.currentElement = el;
+                        }
+                    }
+                } else {
+                    if (this.currentEvent) {
+                        tar = YAHOO.util.Event.getTarget(this.currentEvent);
+                    } else {
+                        //For Safari..
+                        tar = this._getDoc().body;                        
+                    }
+                }
+                if (tar) {
+                    /**
+                    * @knownissue
+                    * @browser Safari 2.x
+                    * @description The issue here is that we have no way of knowing where the cursor position is
+                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+                    */
+                    el = _elCreate();
+                    if (tar.tagName.toLowerCase() == 'body') {
+                        tar.appendChild(el);
+                    } else if (tar.nextSibling) {
+                        tar.parentNode.insertBefore(el, tar.nextSibling);
+                    } else {
+                        tar.parentNode.appendChild(el);
+                    }
+                    //this.currentElement = el;
+                    this.currentElement[this.currentElement.length] = el;
+                    this.currentEvent = null;
+                    if (this.browser.webkit) {
+                        //Force Safari to focus the new element
+                        this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                        this._getSelection().collapse(true);   
+                    }
+                }
+            } else {
+                //Force CSS Styling for this action...
+                this._setEditorStyle(true);
+                this._getDoc().execCommand('fontname', false, 'yui-tmp');
+                var _tmp = [];
+                /* TODO: This needs to be cleaned up.. */
+                var _tmp1 = this._getDoc().getElementsByTagName('font');
+                var _tmp2 = this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);
+                var _tmp3 = this._getDoc().getElementsByTagName('span');
+                var _tmp4 = this._getDoc().getElementsByTagName('i');
+                var _tmp5 = this._getDoc().getElementsByTagName('b');
+                for (var e = 0; e < _tmp1.length; e++) {
+                    _tmp[_tmp.length] = _tmp1[e];
+                }
+                for (var e = 0; e < _tmp2.length; e++) {
+                    _tmp[_tmp.length] = _tmp2[e];
+                }
+                for (var e = 0; e < _tmp3.length; e++) {
+                    _tmp[_tmp.length] = _tmp3[e];
+                }
+                for (var e = 0; e < _tmp4.length; e++) {
+                    _tmp[_tmp.length] = _tmp4[e];
+                }
+                for (var e = 0; e < _tmp5.length; e++) {
+                    _tmp[_tmp.length] = _tmp5[e];
+                }
+                for (var i = 0; i < _tmp.length; i++) {
+                    if ((YAHOO.util.Dom.getStyle(_tmp[i], 'font-family') == 'yui-tmp') || (_tmp[i].face && (_tmp[i].face == 'yui-tmp'))) {
+                        var el = _elCreate();
+                        el.innerHTML = _tmp[i].innerHTML;
+                        if (_tmp[i].parentNode) {
+                            _tmp[i].parentNode.replaceChild(el, _tmp[i]);
+                            //this.currentElement = el;
+                            this.currentElement[this.currentElement.length] = el;
+                            this.currentEvent = null;
+                            if (this.browser.webkit) {
+                                //Force Safari to focus the new element
+                                this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                                this._getSelection().collapse(true);   
+                            }
+                            if (this.browser.ie && tagStyle && tagStyle.fontSize) {
+                                this._getSelection().empty();
+                            }
+                            if (this.browser.gecko) {
+                                this._getSelection().collapseToStart();
+                            }
+                        }
+                    }
+                }
+                var len = this.currentElement.length;
+                for (var i = 0; i < len; i++) {
+                    if ((i + 1) != len) { //Skip the last one in the list
+                        if (this.currentElement[i] && this.currentElement[i].nextSibling) {
+                            if (this.currentElement[i].tagName && (this.currentElement[i].tagName.toLowerCase() != 'br')) {
+                                this.currentElement[this.currentElement.length] = this.currentElement[i].nextSibling;
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        /**
+        * @method saveHTML
+        * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea.
+        */
+        saveHTML: function() {
+            var html = this.cleanHTML();
+            this.get('textarea').value = html;
+            return html;
+        },
+        /**
+        * @method setEditorHTML
+        * @param {String} html The html content to load into the editor
+        * @description Loads HTML into the editors body
+        */
+        setEditorHTML: function(html) {
+            this._getDoc().body.innerHTML = html;
+            this.nodeChange();
+        },
+        /**
+        * @method getEditorHTML
+        * @description Gets the unprocessed/unfiltered HTML from the editor
+        */
+        getEditorHTML: function() {
+            return this._getDoc().body.innerHTML;
+        },
+        /**
+        * @method cleanHTML
+        * @param {String} html The unfiltered HTML
+        * @description Process the HTML with a few regexes to clean it up and stabilize the output
+        * @returns {String} The filtered HTML
+        */
+        cleanHTML: function(html) {
+            //Start Filtering Output
+            //Begin RegExs..
+            if (!html) { 
+                var html = this.getEditorHTML();
+            }
+            //Make some backups...
+                   html = html.replace(/<div><br><\/div>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>(&nbsp;|&#160;)<\/p>/g, '<YUI_BR>');            
+                   html = html.replace(/<p><br>&nbsp;<\/p>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>&nbsp;<\/p>/gi, '<YUI_BR>');
+                   html = html.replace(/<br class="khtml-block-placeholder">/gi, '<YUI_BR>');
+                   html = html.replace(/<br>/gi, '<YUI_BR>');
+                   html = html.replace(/<br\/>/gi, '<YUI_BR>');
+                   html = html.replace(/<img([^>]*)>/gi, '<YUI_IMG$1>');
+                   html = html.replace(/<ul([^>]*)>/gi, '<YUI_UL$1>');
+                   html = html.replace(/<\/ul>/gi, '<\/YUI_UL>');
+
+            //Convert b and i tags to strong and em tags
+                   html = html.replace(/<i([^>]*)>/gi, '<em$1>');
+                   html = html.replace(/<\/i>/gi, '</em>');
+                   html = html.replace(/<b([^>]*)>/gi, '<strong$1>');
+                   html = html.replace(/<\/b>/gi, '</strong>');
+
+                   html = html.replace(/<font/gi, '<font');
+                   html = html.replace(/<\/font>/gi, '</font>');
+                   html = html.replace(/<span/gi, '<span');
+                   html = html.replace(/<\/span>/gi, '</span>');
+                   html = html.replace(/<u/gi, '<u');
+                   html = html.replace(/\/u>/gi, '/u>');
+
+                   html = html.replace(/<ol([^>]*)>/gi, '<ol$1>');
+                   html = html.replace(/\/ol>/gi, '/ol>');
+                   html = html.replace(/<li/gi, '<li');
+                   html = html.replace(/\/li>/gi, '/li>');
+
+            //Handle the sudo A tags
+            html = html.replace(new RegExp('<span ([^>]*) tag="a" ([^>]*)>([^>]*)<\/span>', 'gi'), '<a $1 $2>$3</a>');
+
+            //Safari only regexes
+            if (this.browser.webkit) {
+                //<DIV><SPAN class="Apple-style-span" style="line-height: normal;">Test THis</SPAN></DIV>
+                html = html.replace(/Apple-style-span/gi, '');
+                html = html.replace(/style="line-height: normal;"/gi, '');
+            }
+
+            //yui-tag-a yui-tag yui-non yui-img
+                   html = html.replace(/yui-tag-a/gi, '');
+                   html = html.replace(/yui-tag-span/gi, '');
+                   html = html.replace(/yui-tag/gi, '');
+                   html = html.replace(/yui-non/gi, '');
+                   html = html.replace(/yui-img/gi, '');
+                   html = html.replace(/ tag="span"/gi, '');
+                   html = html.replace(/ class=""/gi, '');
+                   html = html.replace(/ class=" "/gi, '');
+                   html = html.replace(/ class="  "/gi, '');
+                   html = html.replace(/ target=""/gi, '');
+                   html = html.replace(/ title=""/gi, '');
+
+            //Other string cleanup
+                   html = html.replace(/<br><li/gi, '<li');
+            //<P><br>&nbsp;</P>
+                   //html = html.replace(/<span >([^>]*)<\/span>/gi, '$1');
+                   //html = html.replace(/<div>([^>]*)<\/div>/gi, '$1');
+            
+            
+            //Replace our backups with the real thing
+                   html = html.replace(/<YUI_BR>/g, '<br>');
+                   html = html.replace(/<YUI_IMG([^>]*)>/g, '<img$1>');
+                   html = html.replace(/<YUI_UL([^>]*)>/g, '<ul$1>');
+                   html = html.replace(/<\/YUI_UL>/g, '<\/ul>');
+
+            return html;
+        },
+        /**
+        * @method clearEditorDoc
+        * @description Clear the doc of the Editor
+        */
+        clearEditorDoc: function() {
+            this._getDoc().body.innerHTML = '&nbsp;';
+        },
+        /**
+        * @private
+        * @method _renderPanel
+        * @description Renders the panel used for Editor Windows to the document so we can start using it..
+        * @returns {<a href="YAHOO.widget.Panel.html">YAHOO.widget.Panel</a>}
+        */
+        _renderPanel: function() {
+            if (!YAHOO.widget.EditorInfo.panel) {
+                var panel = new YAHOO.widget.Panel(this.EDITOR_PANEL_ID, {
+                    width: '300px',
+                    iframe: true,
+                    visible: false,
+                    underlay: 'none',
+                    draggable: false,
+                    close: false
+                });
+                YAHOO.widget.EditorInfo.panel = panel;
+            } else {
+                var panel = YAHOO.widget.EditorInfo.panel;
+            }
+            this.set('panel', panel);
+
+            this.get('panel').setBody('---');
+            this.get('panel').setHeader(' ');
+            this.get('panel').setFooter(' ');
+            if (this.DOMReady) {
+                this.get('panel').render(document.body);
+                Dom.addClass(this.get('panel').element, 'yui-editor-panel');
+            } else {
+                Event.onDOMReady(function() {
+                    this.get('panel').render(document.body);
+                    Dom.addClass(this.get('panel').element, 'yui-editor-panel');
+                }, this, true);
+            }
+            this.get('panel').showEvent.subscribe(function() {
+                YAHOO.util.Dom.setStyle(this.element, 'display', 'block');
+            });
+            return this.get('panel');
+        },
+        /**
+        * @method openWindow
+        * @param {<a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a>} win A <a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a> instance
+        * @description Opens a new "window/panel"
+        */
+        openWindow: function(win) {
+            this.toolbar.set('disabled', true); //Disable the toolbar when an editor window is open..
+            Event.addListener(document, 'keypress', this._closeWindow, this, true);
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            YAHOO.widget.EditorInfo.window.win = win;
+            YAHOO.widget.EditorInfo.window.scope = this;
+
+            var self = this,
+                xy = Dom.getXY(this.currentElement[0]),
+                elXY = Dom.getXY(this.get('iframe').get('element')),
+                panel = this.get('panel'),
+                newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)],
+                wWidth = (parseInt(win.attrs.width) / 2),
+                align = 'center';
+
+            this.fireEvent('beforeOpenWindow', { type: 'beforeOpenWindow', win: win, panel: panel });
+
+            body = document.createElement('div');
+            body.className = this.CLASS_PREFIX + '-body-cont';
+
+            var _note = document.createElement('h3');
+            _note.className = 'yui-editor-skipheader';
+            _note.innerHTML = this.STR_CLOSE_WINDOW_NOTE;
+            body.appendChild(_note);
+            form = document.createElement('form');
+            form.setAttribute('method', 'GET');
+            var windowName = win.name;
+            Event.addListener(form, 'submit', function(ev) {
+                var evName = 'window' + windowName + 'Submit';
+                self.fireEvent(evName, { type: evName, target: this });
+                Event.stopEvent(ev);
+            }, this, true);
+            body.appendChild(form);
+
+            Dom.setStyle(panel.element.firstChild, 'width', win.attrs.width);
+            if (Lang.isObject(win.body)) { //Assume it's a reference
+                form.appendChild(win.body);
+            } else { //Assume it's a string
+                var _tmp = document.createElement('div');
+                _tmp.innerHTML = win.body;
+                form.appendChild(_tmp);
+            }
+            var _close = document.createElement('span');
+            _close.innerHTML = 'X';
+            _close.title = this.STR_CLOSE_WINDOW;
+            _close.className = 'close';
+            Event.addListener(_close, 'click', function() {
+                this.closeWindow();
+            }, this, true);
+            var _knob = document.createElement('span');
+            _knob.innerHTML = '^';
+            _knob.className = 'knob';
+            win._knob = _knob;
+
+            var _header = document.createElement('h3');
+            _header.innerHTML = win.header;
+
+            panel.cfg.setProperty('width', win.attrs.width);
+            panel.setHeader(' '); //Clear the current header
+            panel.appendToHeader(_header);
+            _header.appendChild(_close);
+            _header.appendChild(_knob);
+            panel.setBody(' '); //Clear the current body
+            panel.setFooter(' '); //Clear the current footer
+            if (win.footer != null) {
+                panel.setFooter(win.footer);
+            }
+            panel.appendToBody(body); //Append the new DOM node to it
+            panel.showEvent.subscribe(function() {
+                Event.addListener(panel.element, 'click', function(ev) {
+                    Event.stopPropagation(ev);
+                });
+            }, this, true);
+            panel.hideEvent.subscribe(function() {
+                this.currentWindow = null;
+                var evName = 'window' + windowName + 'Close';
+                this.fireEvent(evName, { type: evName, target: this });
+
+            }, this, true);
+            this.currentWindow = win;
+            this.moveWindow(true);
+            panel.show();
+            this.fireEvent('afterOpenWindow', { type: 'afterOpenWindow', win: win, panel: panel });
+        },
+        /**
+        * @method moveWindow
+        * @param {Boolean} force Boolean to tell it to move but not use any animation (Usually done the first time the window is loaded.)
+        * @description Realign the window with the currentElement and reposition the knob above the panel.
+        */
+        moveWindow: function(force) {
+            if (!this.currentWindow) {
+                return false;
+            }
+            var win = this.currentWindow,
+                xy = Dom.getXY(this.currentElement[0]),
+                elXY = Dom.getXY(this.get('iframe').get('element')),
+                panel = this.get('panel'),
+                //newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)],
+                newXY = [(xy[0] + elXY[0]), (xy[1] + elXY[1])],
+                wWidth = (parseInt(win.attrs.width) / 2),
+                align = 'center',
+                orgXY = panel.cfg.getProperty('xy'),
+                _knob = win._knob;
+
+            newXY[0] = ((newXY[0] - wWidth) + 20);
+            //Account for the Scroll bars in a scrolled editor window.
+            newXY[0] = newXY[0] - Dom.getDocumentScrollLeft(this._getDoc());
+            newXY[1] = newXY[1] - Dom.getDocumentScrollTop(this._getDoc());
+            
+
+
+            if (this.currentElement[0].tagName && (this.currentElement[0].tagName.toLowerCase() == 'img')) {
+                if (this.currentElement[0].src.indexOf(this.get('blankimage')) != -1) {
+                    newXY[0] = (newXY[0] + (75 / 2)); //Placeholder size
+                    newXY[1] = (newXY[1] + 75); //Placeholder sizea
+                } else {
+                    var w = parseInt(this.currentElement[0].width);
+                    var h = parseInt(this.currentElement[0].height);
+                    newXY[0] = (newXY[0] + (w / 2));
+                    newXY[1] = (newXY[1] + h);
+                }
+                newXY[1] = newXY[1] + 15;
+            } else {
+                if (Dom.getStyle(this.currentElement[0], 'fontSize').indexOf('px') != -1) {
+                    newXY[1] = newXY[1] + parseInt(Dom.getStyle(this.currentElement[0], 'fontSize')) + 5;
+                } else {
+                    newXY[1] = newXY[1] + 20;
+                }
+            }
+            if (newXY[0] < elXY[0]) {
+                newXY[0] = elXY[0] + 5;
+                align = 'left';
+            }
+
+            if ((newXY[0] + (wWidth * 2)) > (elXY[0] + parseInt(this.get('iframe').get('element').clientWidth))) {
+                newXY[0] = ((elXY[0] + parseInt(this.get('iframe').get('element').clientWidth)) - (wWidth * 2) - 5);
+                align = 'right';
+            }
+            
+            try {
+                var xDiff = (newXY[0] - orgXY[0]);
+                var yDiff = (newXY[1] - orgXY[1]);
+            } catch (e) {
+                var xDiff = 0;
+                var yDiff = 0;
+            }
+            
+            //Convert negative numbers to positive so we can get the difference in distance
+            xDiff = ((xDiff < 0) ? (xDiff * -1) : xDiff);
+            yDiff = ((yDiff < 0) ? (yDiff * -1) : yDiff);
+
+            if (((xDiff > 10) || (yDiff > 10)) || force) { //Only move the window if it's supposed to move more than 10px or force was passed (new window)
+                var _knobLeft = 0,
+                    elW = 0;
+
+                if (this.currentElement[0].width) {
+                    elW = (parseInt(this.currentElement[0].width) / 2);
+                }
+
+                var leftOffset = xy[0] + elXY[0] + elW;
+                _knobLeft = leftOffset - newXY[0];
+                //Check to see if the knob will go off either side & reposition it
+                if (_knobLeft > (parseInt(win.attrs.width) - 40)) {
+                    _knobLeft = parseInt(win.attrs.width) - 40;
+                } else if (_knobLeft < 40) {
+                    _knobLeft = 40;
+                }
+                if (isNaN(_knobLeft)) {
+                    _knobLeft = 40;
+                }
+                if (force) {
+                    if (_knob) {
+                        _knob.style.left = _knobLeft + 'px';
+                    }
+                    if (this.get('animate')) {
+                        Dom.setStyle(panel.element, 'opacity', '0');
+                        var anim = new YAHOO.util.Anim(panel.element, {
+                            opacity: {
+                                from: 0,
+                                to: 1
+                            }
+                        }, .1, YAHOO.util.Easing.easeOut);
+                        panel.cfg.setProperty('xy', newXY);
+                        anim.onComplete.subscribe(function() {
+                            if (this.browser.ie) {
+                                panel.element.style.filter = 'none';
+                            }
+                        }, this, true);
+                        anim.animate();
+                    } else {
+                        panel.cfg.setProperty('xy', newXY);
+                    }
+                } else {
+                    if (this.get('animate')) {
+                        var anim = new YAHOO.util.Anim(panel.element, {}, .5, YAHOO.util.Easing.easeOut);
+                        anim.attributes = {
+                            top: {
+                                to: newXY[1]
+                            },
+                            left: {
+                                to: newXY[0]
+                            }
+                        }
+                        anim.onComplete.subscribe(function() {
+                            panel.cfg.setProperty('xy', newXY);
+                        });
+                        //We have to animate the iframe shim at the same time as the panel or we get scrollbar bleed ..
+                        var iframeAnim = new YAHOO.util.Anim(panel.iframe, anim.attributes, .5, YAHOO.util.Easing.easeOut)
+
+                        var _knobAnim = new YAHOO.util.Anim(_knob, {
+                            left: {
+                                to: _knobLeft
+                            }
+                        }, .75, YAHOO.util.Easing.easeOut);
+                        anim.animate();
+                        iframeAnim.animate();
+                        _knobAnim.animate();
+                    } else {
+                        _knob.style.left = _knobLeft + 'px';
+                        panel.cfg.setProperty('xy', newXY);
+                    }
+                }
+            }
+        },
+        /**
+        * @private
+        * @method _closeWindow
+        * @description Close the currently open EditorWindow with the Escape key.
+        * @param {Event} ev The keypress Event that we are trapping
+        */
+        _closeWindow: function(ev) {
+            if (ev.keyCode == 27) {
+                if (this.currentWindow) {
+                    this.closeWindow();
+                }
+            }
+        },
+        /**
+        * @method closeWindow
+        * @description Close the currently open EditorWindow.
+        */
+        closeWindow: function() {
+            YAHOO.widget.EditorInfo.window = {};
+            this.fireEvent('closeWindow', { type: 'closeWindow', win: this.currentWindow });
+            this.currentWindow = null;
+            this.get('panel').hide();
+            this.get('panel').cfg.setProperty('xy', [-900,-900]);
+            this.get('panel').syncIframe(); //Needed to move the iframe with the hidden panel
+            this.unsubscribeAll('afterExecCommand');
+            this.toolbar.set('disabled', false); //enable the toolbar now that the window is closed
+            this._focusWindow();
+            Event.removeListener(document, 'keypress', this._closeWindow);
+        },
+        /**
+        * @method destroy
+        * @description Destroys the editor, all of it's elements and objects.
+        * @return {Boolean}
+        */
+        destroy: function() {
+            this.saveHTML();
+            this.toolbar.destroy();
+            Dom.setStyle(this.get('textarea'), 'display', 'block');
+            var textArea = this.get('textarea');
+            this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element'));
+            this.get('element_cont').get('element').innerHTML = '';
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+            return true;
+        },        
+        /**
+        * @method toString
+        * @description Returns a string representing the editor.
+        * @return {String}
+        */
+        toString: function() {
+            var str = 'Editor';
+            if (this.get && this.get('element_cont')) {
+                str = 'Editor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : ''));
+            }
+            return str;
+        }
+    });
+
+/**
+* @event toolbarLoaded
+* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterRender
+* @description Event is fired after the render process finishes. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorContentLoaded
+* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorDoubleClick
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyPress
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeNodeChange
+* @description Event fires at the beginning of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterNodeChange
+* @description Event fires at the end of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeExecCommand
+* @description Event fires at the beginning of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterExecCommand
+* @description Event fires at the end of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeOpenWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Event fires before an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterOpenWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Event fires after an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event closeWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @description Event fires after an Editor Window is closed. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event windowCMDOpen
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is opened.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkOpen event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event windowCMDClose
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is closed.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkClose event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+
+/**
+     * @description Singleton object used to track the open window objects and panels across the various open editors
+     * @class EditorInfo
+     * @static
+    */
+    YAHOO.widget.EditorInfo = {
+        /**
+        * @private
+        * @property window
+        * @description A reference to the currently open window object in any editor on the page.
+        * @type Object <a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a>
+        */
+        window: {},
+        /**
+        * @private
+        * @property panel
+        * @description A reference to the currently open panel in any editor on the page.
+        * @type Object <a href="YAHOO.widget.Panel.html">YAHOO.widget.Panel</a>
+        */
+        panel: null
+    }
+
+    /**
+     * @description Class to hold Window information between uses. We use the same panel to show the windows, so using this will allow you to configure a window before it is shown.
+     * This is what you pass to Editor.openWindow();. These parameters will not take effect until the openWindow() is called in the editor.
+     * @class EditorWindow
+     * @param {String} name The name of the window.
+     * @param {Object} attrs Attributes for the window. Current attributes used are : height and width
+    */
+    YAHOO.widget.EditorWindow = function(name, attrs) {
+        /**
+        * @private
+        * @property name
+        * @description A unique name for the window
+        */
+        this.name = name.replace(' ', '_');
+        /**
+        * @private
+        * @property attrs
+        * @description The window attributes
+        */
+        this.attrs = attrs;
+    }
+
+    YAHOO.widget.EditorWindow.prototype = {
+        /**
+        * @private
+        * @property _cache
+        * @description Holds a cache of the DOM for the window so we only have to build it once..
+        */
+        _cache: null,
+        /**
+        * @private
+        * @property header
+        * @description Holder for the header of the window, used in Editor.openWindow
+        */
+        header: null,
+        /**
+        * @private
+        * @property body
+        * @description Holder for the body of the window, used in Editor.openWindow
+        */
+        body: null,
+        /**
+        * @private
+        * @property footer
+        * @description Holder for the footer of the window, used in Editor.openWindow
+        */
+        footer: null,
+        /**
+        * @method setHeader
+        * @description Sets the header for the window.
+        * @param {String/HTMLElement} str The string or DOM reference to be used as the windows header.
+        */
+        setHeader: function(str) {
+            this.header = str;
+        },
+        /**
+        * @method setBody
+        * @description Sets the body for the window.
+        * @param {String/HTMLElement} str The string or DOM reference to be used as the windows body.
+        */
+        setBody: function(str) {
+            this.body = str;
+        },
+        /**
+        * @method setFooter
+        * @description Sets the footer for the window.
+        * @param {String/HTMLElement} str The string or DOM reference to be used as the windows footer.
+        */
+        setFooter: function(str) {
+            this.footer = str;
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the EditorWindow.
+        * @return {String}
+        */
+        toString: function() {
+            return 'Editor Window (' + this.name + ')';
+        }
+    };
+
+
+    
+})();
+YAHOO.register("editor", YAHOO.widget.Editor, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/editor/editor-beta-min.js b/lib/yui/editor/editor-beta-min.js
new file mode 100755 (executable)
index 0000000..38662e2
--- /dev/null
@@ -0,0 +1,302 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
+(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.lang;YAHOO.widget.Toolbar=function(el,attrs){if(Lang.isObject(arguments[0])&&!Dom.get(el).nodeType){var attrs=el;}
+var local_attrs=(attrs||{});var oConfig={element:null,attributes:local_attrs}
+if(Lang.isString(el)&&Dom.get(el)){oConfig.element=Dom.get(el);}else if(Lang.isObject(el)&&Dom.get(el)&&Dom.get(el).nodeType){oConfig.element=Dom.get(el);}
+if(!oConfig.element){oConfig.element=document.createElement('DIV');oConfig.element.id=Dom.generateId();if(local_attrs.container&&Dom.get(local_attrs.container)){Dom.get(local_attrs.container).appendChild(oConfig.element);}}
+if(!oConfig.element.id){oConfig.element.id=((Lang.isString(el))?el:Dom.generateId());}
+var cont=document.createElement('DIV');oConfig.attributes.cont=cont;Dom.addClass(cont,'yui-toolbar-subcont')
+oConfig.element.appendChild(cont);oConfig.attributes.element=oConfig.element;oConfig.attributes.id=oConfig.element.id;YAHOO.widget.Toolbar.superclass.constructor.call(this,oConfig.element,oConfig.attributes);}
+function _addMenuClasses(ev,na,o){Dom.addClass(this.element,'yui-toolbar-'+o.get('value')+'-menu');if(Dom.hasClass(o._button.parentNode.parentNode,'yui-toolbar-select')){Dom.addClass(this.element,'yui-toolbar-select-menu');}
+var items=this.getItems();for(var i=0;i<items.length;i++){Dom.addClass(items[i].element,'yui-toolbar-'+o.get('value')+'-'+((items[i].value)?items[i].value.replace(/ /g,'-').toLowerCase():items[i]._oText.nodeValue.replace(/ /g,'-').toLowerCase()));Dom.addClass(items[i].element,'yui-toolbar-'+o.get('value')+'-'+((items[i].value)?items[i].value.replace(/ /g,'-'):items[i]._oText.nodeValue.replace(/ /g,'-')));}
+this._setWidth();};YAHOO.extend(YAHOO.widget.Toolbar,YAHOO.util.Element,{dd:null,_colorData:{'#111111':'Obsidian','#2D2D2D':'Dark Gray','#434343':'Shale','#5B5B5B':'Flint','#737373':'Gray','#8B8B8B':'Concrete','#A2A2A2':'Gray','#B9B9B9':'Titanium','#000000':'Black','#D0D0D0':'Light Gray','#E6E6E6':'Silver','#FFFFFF':'White','#BFBF00':'Pumpkin','#FFFF00':'Yellow','#FFFF40':'Banana','#FFFF80':'Pale Yellow','#FFFFBF':'Butter','#525330':'Raw Siena','#898A49':'Mildew','#AEA945':'Olive','#7F7F00':'Paprika','#C3BE71':'Earth','#E0DCAA':'Khaki','#FCFAE1':'Cream','#60BF00':'Cactus','#80FF00':'Chartreuse','#A0FF40':'Green','#C0FF80':'Pale Lime','#DFFFBF':'Light Mint','#3B5738':'Green','#668F5A':'Lime Gray','#7F9757':'Yellow','#407F00':'Clover','#8A9B55':'Pistachio','#B7C296':'Light Jade','#E6EBD5':'Breakwater','#00BF00':'Spring Frost','#00FF80':'Pastel Green','#40FFA0':'Light Emerald','#80FFC0':'Sea Foam','#BFFFDF':'Sea Mist','#033D21':'Dark Forrest','#438059':'Moss','#7FA37C':'Medium Green','#007F40':'Pine','#8DAE94':'Yellow Gray Green','#ACC6B5':'Aqua Lung','#DDEBE2':'Sea Vapor','#00BFBF':'Fog','#00FFFF':'Cyan','#40FFFF':'Turquoise Blue','#80FFFF':'Light Aqua','#BFFFFF':'Pale Cyan','#033D3D':'Dark Teal','#347D7E':'Gray Turquoise','#609A9F':'Green Blue','#007F7F':'Seaweed','#96BDC4':'Green Gray','#B5D1D7':'Soapstone','#E2F1F4':'Light Turquoise','#0060BF':'Summer Sky','#0080FF':'Sky Blue','#40A0FF':'Electric Blue','#80C0FF':'Light Azure','#BFDFFF':'Ice Blue','#1B2C48':'Navy','#385376':'Biscay','#57708F':'Dusty Blue','#00407F':'Sea Blue','#7792AC':'Sky Blue Gray','#A8BED1':'Morning Sky','#DEEBF6':'Vapor','#0000BF':'Deep Blue','#0000FF':'Blue','#4040FF':'Cerulean Blue','#8080FF':'Evening Blue','#BFBFFF':'Light Blue','#212143':'Deep Indigo','#373E68':'Sea Blue','#444F75':'Night Blue','#00007F':'Indigo Blue','#585E82':'Dockside','#8687A4':'Blue Gray','#D2D1E1':'Light Blue Gray','#6000BF':'Neon Violet','#8000FF':'Blue Violet','#A040FF':'Violet Purple','#C080FF':'Violet Dusk','#DFBFFF':'Pale Lavender','#302449':'Cool Shale','#54466F':'Dark Indigo','#655A7F':'Dark Violet','#40007F':'Violet','#726284':'Smoky Violet','#9E8FA9':'Slate Gray','#DCD1DF':'Violet White','#BF00BF':'Royal Violet','#FF00FF':'Fuchsia','#FF40FF':'Magenta','#FF80FF':'Orchid','#FFBFFF':'Pale Magenta','#4A234A':'Dark Purple','#794A72':'Medium Purple','#936386':'Cool Granite','#7F007F':'Purple','#9D7292':'Purple Moon','#C0A0B6':'Pale Purple','#ECDAE5':'Pink Cloud','#BF005F':'Hot Pink','#FF007F':'Deep Pink','#FF409F':'Grape','#FF80BF':'Electric Pink','#FFBFDF':'Pink','#451528':'Purple Red','#823857':'Purple Dino','#A94A76':'Purple Gray','#7F003F':'Rose','#BC6F95':'Antique Mauve','#D8A5BB':'Cool Marble','#F7DDE9':'Pink Granite','#C00000':'Apple','#FF0000':'Fire Truck','#FF4040':'Pale Red','#FF8080':'Salmon','#FFC0C0':'Warm Pink','#441415':'Sepia','#82393C':'Rust','#AA4D4E':'Brick','#800000':'Brick Red','#BC6E6E':'Mauve','#D8A3A4':'Shrimp Pink','#F8DDDD':'Shell Pink','#BF5F00':'Dark Orange','#FF7F00':'Orange','#FF9F40':'Grapefruit','#FFBF80':'Canteloupe','#FFDFBF':'Wax','#482C1B':'Dark Brick','#855A40':'Dirt','#B27C51':'Tan','#7F3F00':'Nutmeg','#C49B71':'Mustard','#E1C4A8':'Pale Tan','#FDEEE0':'Marble'},_colorPicker:null,STR_COLLAPSE:'Collapse Toolbar',STR_SPIN_LABEL:'Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.',STR_SPIN_UP:'Click to increase the value of this input',STR_SPIN_DOWN:'Click to decrease the value of this input',_titlebar:null,_disabled:null,browser:YAHOO.env.ua,_buttonList:null,_buttonGroupList:null,_sep:null,_sepCount:null,_dragHandle:null,_toolbarConfigs:{renderer:true},CLASS_CONTAINER:'yui-toolbar-container',CLASS_DRAGHANDLE:'yui-toolbar-draghandle',CLASS_SEPARATOR:'yui-toolbar-separator',CLASS_DISABLED:'yui-toolbar-disabled',CLASS_PREFIX:'yui-toolbar',init:function(p_oElement,p_oAttributes){YAHOO.widget.Toolbar.superclass.init.call(this,p_oElement,p_oAttributes);},initAttributes:function(attr){YAHOO.widget.Toolbar.superclass.initAttributes.call(this,attr);var el=this.get('element');this.addClass(this.CLASS_CONTAINER);this.setAttributeConfig('buttons',{value:[],writeOnce:true,method:function(data){for(var i in data){if(Lang.hasOwnProperty(data,i)){if(data[i].type=='separator'){this.addSeparator();}else if(data[i].group!=undefined){this.addButtonGroup(data[i]);}else{this.addButton(data[i]);}}}}});this.setAttributeConfig('disabled',{value:false,method:function(disabled){if(!Lang.isObject(this._disabled)){this._disabled={};}
+if(disabled){this.addClass(this.CLASS_DISABLED);this.set('draggable',false);}else{this.removeClass(this.CLASS_DISABLED);if(this._configs.draggable._initialConfig.value){this.set('draggable',true);}}
+var len=this._buttonList.length;for(var i=0;i<len;i++){if(disabled){if(this._buttonList[i].get('disabled')){this._disabled[i]=true;}else{this._disabled[i]=null;}
+this.disableButton(this._buttonList[i].get('id'));}else{var _button=this._buttonList[i];var _check=_button._configs.disabled._initialConfig.value;if(this._disabled[i]){_check=true;}
+if(!_check){this.enableButton(_button.get('id'));}}}}});this.setAttributeConfig('grouplabels',{value:true,writeOnce:true});this.setAttributeConfig('cont',{value:attr.cont,readOnly:true});this.setAttributeConfig('collapse',{value:false});this.setAttributeConfig('titlebar',{value:false,method:function(titlebar){if(titlebar){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar);}
+this._titlebar=document.createElement('DIV');Dom.addClass(this._titlebar,this.CLASS_PREFIX+'-titlebar');if(Lang.isString(titlebar)){var h2=document.createElement('h2');h2.tabIndex='-1';h2.innerHTML=titlebar;this._titlebar.appendChild(h2);}
+if(this.get('collapse')){var collapse=document.createElement('SPAN');collapse.innerHTML='X';collapse.title=this.STR_COLLAPSE;Dom.addClass(collapse,'collapse');this._titlebar.appendChild(collapse);Event.addListener(collapse,'click',function(){if(Dom.getStyle(this.get('cont'),'display')=='none'){Dom.setStyle(this.get('cont'),'display','block');Dom.removeClass(collapse,'collapsed');this.fireEvent('toolbarExpanded',{type:'toolbarExpanded',target:this});}else{Dom.setStyle(this.get('cont'),'display','none');Dom.addClass(collapse,'collapsed');this.fireEvent('toolbarCollapsed',{type:'toolbarCollapsed',target:this});}},this,true);}
+if(this.get('draggable')){this.dd=new YAHOO.util.DD(this.get('id'));this.dd.setHandleElId(this._titlebar);Dom.addClass(this._titlebar,'draggable');}
+if(this.get('firstChild')){this.insertBefore(this._titlebar,this.get('firstChild'));}else{this.appendChild(this._titlebar);}}else if(this._titlebar){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar);}}}});this.setAttributeConfig('draggable',{value:(attr.draggable||false),method:function(draggable){var el=this.get('element');if(draggable&&!this.get('titlebar')){if(!this._dragHandle){this._dragHandle=document.createElement('SPAN');this._dragHandle.innerHTML='|';this._dragHandle.setAttribute('title','Click to drag the toolbar');this._dragHandle.id=this.get('id')+'_draghandle';Dom.addClass(this._dragHandle,this.CLASS_DRAGHANDLE);if(this.get('cont').hasChildNodes()){this.get('cont').insertBefore(this._dragHandle,this.get('cont').firstChild);}else{this.get('cont').appendChild(this._dragHandle);}
+this.dd=new YAHOO.util.DD(this.get('id'));this.dd.setHandleElId(this._dragHandle.id);}}else{if(this._dragHandle){this._dragHandle.parentNode.removeChild(this._dragHandle);this._dragHandle=null;this.dd=null;}}
+if(this._titlebar){if(draggable){this.dd=new YAHOO.util.DD(this.get('id'));this.dd.setHandleElId(this._titlebar);Dom.addClass(this._titlebar,'draggable');}else{Dom.removeClass(this._titlebar,'draggable');if(this.dd){this.dd.unreg();this.dd=null;}}}},validator:function(value){var ret=true;if(!YAHOO.util.DD){ret=false;}
+return ret;}});},addButtonGroup:function(oGroup){if(!this.get('element')){this._queue[this._queue.length]=['addButtonGroup',arguments];return false;}
+if(!this.hasClass(this.CLASS_PREFIX+'-grouped')){this.addClass(this.CLASS_PREFIX+'-grouped');}
+var div=document.createElement('DIV');Dom.addClass(div,this.CLASS_PREFIX+'-group');Dom.addClass(div,this.CLASS_PREFIX+'-group-'+oGroup.group);if(oGroup.label&&this.get('grouplabels')){var label=document.createElement('h3');label.innerHTML=oGroup.label;div.appendChild(label);}
+this.get('cont').appendChild(div);var ul=document.createElement('ul');div.appendChild(ul);if(!this._buttonGroupList){this._buttonGroupList={};}
+this._buttonGroupList[oGroup.group]=ul;for(var i=0;i<oGroup.buttons.length;i++){var li=document.createElement('li');ul.appendChild(li);if((oGroup.buttons[i].type!=undefined)&&oGroup.buttons[i].type=='separator'){this.addSeparator(li);}else{oGroup.buttons[i].container=li;this.addButton(oGroup.buttons[i]);}}},addButtonToGroup:function(oButton,group,after){var groupCont=this._buttonGroupList[group];var li=document.createElement('li');oButton.container=li;this.addButton(oButton,after);groupCont.appendChild(li);},addButton:function(oButton,after){if(!this.get('element')){this._queue[this._queue.length]=['addButton',arguments];return false;}
+if(!this._buttonList){this._buttonList=[];}
+this._configs.buttons.value[this._configs.buttons.value.length]=oButton;if(!oButton.container){oButton.container=this.get('cont');}
+if((oButton.type=='menu')||(oButton.type=='split')||(oButton.type=='select')){if(Lang.isArray(oButton.menu)){for(var i in oButton.menu){if(Lang.hasOwnProperty(oButton.menu,i)){var funcObject={fn:function(ev,x,oMenu){if(!oButton.menucmd){oButton.menucmd=oButton.value;}
+oButton.value=((oMenu.value)?oMenu.value:oMenu._oText.nodeValue);},scope:this}
+oButton.menu[i].onclick=funcObject;}}}}
+var _oButton={};for(var i in oButton){if(Lang.hasOwnProperty(oButton,i)){if(!this._toolbarConfigs[i]){_oButton[i]=oButton[i];}}}
+if(oButton.type=='select'){_oButton.type='menu';}
+if(oButton.type=='spin'){_oButton.type='push';}
+if(_oButton.type=='color'){_oButton=this._makeColorButton(_oButton);}
+if(_oButton.menu){if(oButton.menu instanceof YAHOO.widget.Overlay){oButton.menu.showEvent.subscribe(function(){this._button=_oButton;});}else{for(var i=0;i<_oButton.menu.length;i++){if(!_oButton.menu[i].value){_oButton.menu[i].value=_oButton.menu[i].text;}}
+if(this.browser.webkit){_oButton.focusmenu=false;}}}
+var tmp=new YAHOO.widget.Button(_oButton);if(this.get('disabled')){tmp.set('disabled',true);}
+if(!oButton.id){oButton.id=tmp.get('id');}
+if(after){var el=tmp.get('element');var nextSib=null;if(after.get){nextSib=after.get('element').nextSibling;}else if(after.nextSibling){nextSib=after.nextSibling;}
+if(nextSib){nextSib.parentNode.insertBefore(el,nextSib);}}
+tmp.addClass(this.CLASS_PREFIX+'-'+tmp.get('value'));var icon=document.createElement('span');icon.className=this.CLASS_PREFIX+'-icon';tmp.get('element').insertBefore(icon,tmp.get('firstChild'));var a=document.createElement('a');a.innerHTML=tmp._button.innerHTML;a.href='#';Event.on(a,'click',function(ev){Event.stopEvent(ev);});tmp._button.parentNode.replaceChild(a,tmp._button);tmp._button=a;if(oButton.type=='select'){tmp.addClass(this.CLASS_PREFIX+'-select');}
+if(oButton.type=='spin'){if(!Lang.isArray(oButton.range)){oButton.range=[10,100];}
+this._makeSpinButton(tmp,oButton);}
+tmp.get('element').setAttribute('title',tmp.get('label'));if(oButton.type!='spin'){if(_oButton.menu instanceof YAHOO.widget.Overlay){var showPicker=function(ev){var exec=true;if(ev.keyCode&&(ev.keyCode==9)){exec=false;}
+if(exec){this._colorPicker._button=oButton.value;var menuEL=tmp.getMenu().element;if(menuEL.style.visibility=='hidden'){tmp.getMenu().show();}else{tmp.getMenu().hide();}}
+YAHOO.util.Event.stopEvent(ev);};tmp.on('mousedown',showPicker,oButton,this);tmp.on('keydown',showPicker,oButton,this);}else if((oButton.type!='menu')&&(oButton.type!='select')){tmp.on('keypress',this._buttonClick,oButton,this);tmp.on('mousedown',function(ev){this._buttonClick(ev,oButton);YAHOO.util.Event.stopEvent(ev);},oButton,this);}else{tmp.on('mousedown',function(ev){YAHOO.util.Event.stopEvent(ev);});tmp.on('click',function(ev){YAHOO.util.Event.stopEvent(ev);});var self=this;tmp.getMenu().mouseDownEvent.subscribe(function(ev,args){var oMenu=args[1];YAHOO.util.Event.stopEvent(args[0]);tmp._onMenuClick(args[0],tmp);if(!oButton.menucmd){oButton.menucmd=oButton.value;}
+oButton.value=((oMenu.value)?oMenu.value:oMenu._oText.nodeValue);self._buttonClick.call(self,args[1],oButton);tmp._hideMenu();return false;});tmp.getMenu().clickEvent.subscribe(function(ev,args){YAHOO.util.Event.stopEvent(args[0]);});}}else{tmp.on('mousedown',function(ev){YAHOO.util.Event.stopEvent(ev);});tmp.on('click',function(ev){YAHOO.util.Event.stopEvent(ev);});}
+if(this.browser.ie){tmp.DOM_EVENTS.focusin=true;tmp.DOM_EVENTS.focusout=true;tmp.on('focusin',function(ev){YAHOO.util.Event.stopEvent(ev);},oButton,this);tmp.on('focusout',function(ev){YAHOO.util.Event.stopEvent(ev);},oButton,this);tmp.on('click',function(ev){YAHOO.util.Event.stopEvent(ev);},oButton,this);}
+if(this.browser.webkit){tmp.hasFocus=function(){return true;}}
+this._buttonList[this._buttonList.length]=tmp;if((oButton.type=='menu')||(oButton.type=='split')||(oButton.type=='select')){if(Lang.isArray(oButton.menu)){var menu=tmp.getMenu();menu.renderEvent.subscribe(_addMenuClasses,tmp);if(oButton.renderer){menu.renderEvent.subscribe(oButton.renderer,tmp);}}}
+return oButton;},addSeparator:function(cont,after){if(!this.get('element')){this._queue[this._queue.length]=['addSeparator',arguments];return false;}
+var sepCont=((cont)?cont:this.get('cont'));if(!this.get('element')){this._queue[this._queue.length]=['addSeparator',arguments];return false;}
+if(this._sepCount==null){this._sepCount=0;}
+if(!this._sep){this._sep=document.createElement('SPAN');Dom.addClass(this._sep,this.CLASS_SEPARATOR);this._sep.innerHTML='|';}
+var _sep=this._sep.cloneNode(true);this._sepCount++;Dom.addClass(_sep,this.CLASS_SEPARATOR+'-'+this._sepCount);if(after){var nextSib=null;if(after.get){nextSib=after.get('element').nextSibling;}else if(after.nextSibling){nextSib=after.nextSibling;}else{nextSib=after;}
+if(nextSib){if(nextSib==after){nextSib.parentNode.appendChild(_sep);}else{nextSib.parentNode.insertBefore(_sep,nextSib);}}}else{sepCont.appendChild(_sep);}
+return _sep;},_createColorPicker:function(id){if(Dom.get(id+'_colors')){Dom.get(id+'_colors').parentNode.removeChild(Dom.get(id+'_colors'));}
+var picker=document.createElement('div');picker.className='yui-toolbar-colors';picker.id=id+'_colors';picker.style.display='none';Event.on(window,'load',function(){document.body.appendChild(picker);},this,true);this._colorPicker=picker;var html='';for(var i in this._colorData){if(Lang.hasOwnProperty(this._colorData,i)){html+='<a style="background-color: '+i+'" href="#">'+i.replace('#','')+'</a>';}}
+html+='<span><em>X</em><strong></strong></span>';picker.innerHTML=html;var em=picker.getElementsByTagName('em')[0];var strong=picker.getElementsByTagName('strong')[0];Event.on(picker,'mouseover',function(ev){var tar=Event.getTarget(ev);if(tar.tagName.toLowerCase()=='a'){em.style.backgroundColor=tar.style.backgroundColor;strong.innerHTML=this._colorData['#'+tar.innerHTML]+'<br>'+tar.innerHTML;}},this,true);Event.on(picker,'focus',function(ev){Event.stopEvent(ev);});Event.on(picker,'click',function(ev){Event.stopEvent(ev);});Event.on(picker,'mousedown',function(ev){Event.stopEvent(ev);var tar=Event.getTarget(ev);if(tar.tagName.toLowerCase()=='a'){this.fireEvent('colorPickerClicked',{type:'colorPickerClicked',target:this,button:this._colorPicker._button,color:tar.innerHTML,colorName:this._colorData['#'+tar.innerHTML]});this.getButtonByValue(this._colorPicker._button).getMenu().hide();}},this,true);},_resetColorPicker:function(){var em=this._colorPicker.getElementsByTagName('em')[0];var strong=this._colorPicker.getElementsByTagName('strong')[0];em.style.backgroundColor='transparent';strong.innerHTML='';},_makeColorButton:function(_oButton){if(!this._colorPicker){this._createColorPicker(this.get('id'));}
+_oButton.type='color';_oButton.menu=new YAHOO.widget.Overlay(this.get('id')+'_'+_oButton.value+'_menu',{visbile:false,position:'absolute'});_oButton.menu.setBody('');_oButton.menu.render(this.get('cont'));_oButton.menu.beforeShowEvent.subscribe(function(){_oButton.menu.cfg.setProperty('zindex',5);_oButton.menu.cfg.setProperty('context',[this.getButtonById(_oButton.id).get('element'),'tl','bl']);this._resetColorPicker();var _p=this._colorPicker;if(_p.parentNode){_p.parentNode.removeChild(_p);}
+_oButton.menu.setBody('');_oButton.menu.appendToBody(_p);this._colorPicker.style.display='block';},this,true);return _oButton;},_makeSpinButton:function(_button,oButton){_button.addClass(this.CLASS_PREFIX+'-spinbutton');var self=this,_par=_button._button.parentNode.parentNode,range=oButton.range,_b1=document.createElement('a'),_b2=document.createElement('a');_b1.href='#';_b2.href='#';_b1.className='up';_b1.title=this.STR_SPIN_UP;_b1.innerHTML=this.STR_SPIN_UP;_b2.className='down';_b2.title=this.STR_SPIN_DOWN;_b2.innerHTML=this.STR_SPIN_DOWN;_par.appendChild(_b1);_par.appendChild(_b2);var label=YAHOO.lang.substitute(this.STR_SPIN_LABEL,{VALUE:_button.get('label')});_button.set('title',label);var cleanVal=function(value){value=((value<range[0])?range[0]:value);value=((value>range[1])?range[1]:value);return value;};var br=this.browser;var tbar=false;var strLabel=this.STR_SPIN_LABEL;if(this._titlebar&&this._titlebar.firstChild){tbar=this._titlebar.firstChild;}
+var _intUp=function(ev){YAHOO.util.Event.stopEvent(ev);if(!_button.get('disabled')&&(ev.keyCode!=9)){var value=parseInt(_button.get('label'));value++;value=cleanVal(value);_button.set('label',''+value);var label=YAHOO.lang.substitute(strLabel,{VALUE:_button.get('label')});_button.set('title',label);if(!br.webkit&&tbar){}
+self._buttonClick(ev,oButton);}};var _intDown=function(ev){YAHOO.util.Event.stopEvent(ev);if(!_button.get('disabled')&&(ev.keyCode!=9)){var value=parseInt(_button.get('label'));value--;value=cleanVal(value);_button.set('label',''+value);var label=YAHOO.lang.substitute(strLabel,{VALUE:_button.get('label')});_button.set('title',label);if(!br.webkit&&tbar){}
+self._buttonClick(ev,oButton);}};var _intKeyUp=function(ev){if(ev.keyCode==38){_intUp(ev);}else if(ev.keyCode==40){_intDown(ev);}else if(ev.keyCode==107&&ev.shiftKey){_intUp(ev);}else if(ev.keyCode==109&&ev.shiftKey){_intDown(ev);}};_button.on('keydown',_intKeyUp,this,true);Event.on(_b1,'mousedown',function(ev){Event.stopEvent(ev);},this,true);Event.on(_b2,'mousedown',function(ev){Event.stopEvent(ev);},this,true);Event.on(_b1,'click',_intUp,this,true);Event.on(_b2,'click',_intDown,this,true);},_buttonClick:function(ev,info){var doEvent=true;if(ev&&ev.type=='keypress'){if(ev.keyCode==9){doEvent=false;}else if((ev.keyCode==13)||(ev.keyCode==0)||(ev.keyCode==32)){}else{doEvent=false;}}
+if(doEvent){if(info.value){this.fireEvent(info.value+'Click',{type:info.value+'Click',target:this.get('element'),button:info});}
+if(info.menucmd){this.fireEvent(info.menucmd+'Click',{type:info.menucmd+'Click',target:this.get('element'),button:info});}
+this.fireEvent('buttonClick',{type:'buttonClick',target:this.get('element'),button:info});if(info.type=='select'){var button=this.getButtonById(info.id);var txt=info.value;for(var i=0;i<info.menu.length;i++){if(info.menu[i].value==info.value){txt=info.menu[i].text;break;}}
+button.set('label','<span class="yui-toolbar-'+info.menucmd+'-'+(info.value).replace(/ /g,'-').toLowerCase()+'">'+txt+'</span>');var _items=button.getMenu().getItems();for(var m=0;m<_items.length;m++){if(_items[m].value.toLowerCase()==info.value.toLowerCase()){_items[m].cfg.setProperty('checked',true);}else{_items[m].cfg.setProperty('checked',false);}}}}
+if(ev){Event.stopEvent(ev);}},getButtonById:function(id){var len=this._buttonList.length;for(var i=0;i<len;i++){if(this._buttonList[i].get('id')==id){return this._buttonList[i];}}
+return false;},getButtonByValue:function(value){var _buttons=this.get('buttons');var len=_buttons.length;for(var i=0;i<len;i++){if(_buttons[i].group!=undefined){for(var m=0;m<_buttons[i].buttons.length;m++){if((_buttons[i].buttons[m].value==value)||(_buttons[i].buttons[m].menucmd==value)){return this.getButtonById(_buttons[i].buttons[m].id);}
+if(_buttons[i].buttons[m].menu){for(var s=0;s<_buttons[i].buttons[m].menu.length;s++){if(_buttons[i].buttons[m].menu[s].value==value){return this.getButtonById(_buttons[i].buttons[m].id);}}}}}else{if((_buttons[i].value==value)||(_buttons[i].menucmd==value)){return this.getButtonById(_buttons[i].id);}
+if(_buttons[i].menu){for(var s=0;s<_buttons[i].menu.length;s++){if(_buttons[i].menu[s].value==value){return this.getButtonById(_buttons[i].id);}}}}}
+return false;},getButtonByIndex:function(index){if(this._buttonList[index]){return this._buttonList[index];}else{return false;}},getButtons:function(){return this._buttonList;},disableButton:function(button){if(Lang.isString(button)){var button=this.getButtonById(button);}
+if(Lang.isNumber(button)){var button=this.getButtonByIndex(button);}
+if(button instanceof YAHOO.widget.Button){button.set('disabled',true);}else{return false;}},enableButton:function(button){if(Lang.isString(button)){var button=this.getButtonById(button);}
+if(Lang.isNumber(button)){var button=this.getButtonByIndex(button);}
+if(button instanceof YAHOO.widget.Button){button.set('disabled',false);}else{return false;}},selectButton:function(button,value){if(button){if(Lang.isString(button)){var button=this.getButtonById(button);}
+if(Lang.isNumber(button)){var button=this.getButtonByIndex(button);}
+if(button instanceof YAHOO.widget.Button){button.addClass('yui-button-selected');button.addClass('yui-button-'+button.get('value')+'-selected');if(value){var _items=button.getMenu().getItems();for(var m=0;m<_items.length;m++){if(_items[m].value==value){_items[m].cfg.setProperty('checked',true);button.set('label','<span class="yui-toolbar-'+button.get('value')+'-'+(value).replace(/ /g,'-').toLowerCase()+'">'+_items[m]._oText.nodeValue+'</span>');}else{_items[m].cfg.setProperty('checked',false);}}}}else{return false;}}},deselectButton:function(button){if(Lang.isString(button)){var button=this.getButtonById(button);}
+if(Lang.isNumber(button)){var button=this.getButtonByIndex(button);}
+if(button instanceof YAHOO.widget.Button){button.removeClass('yui-button-selected');button.removeClass('yui-button-'+button.get('value')+'-selected');button.removeClass('yui-button-hover');}else{return false;}},deselectAllButtons:function(){var len=this._buttonList.length;for(var i=0;i<len;i++){this.deselectButton(this._buttonList[i]);}},destroyButton:function(button){if(Lang.isString(button)){var button=this.getButtonById(button);}
+if(Lang.isNumber(button)){var button=this.getButtonByIndex(button);}
+if(button instanceof YAHOO.widget.Button){var id=button.get('id');button.destroy();var len=this._buttonList.length;for(var i=0;i<len;i++){if(this._buttonList[i].get('id')==id){this._buttonList[i]=null;}}}else{return false;}},destroy:function(){this.get('element').innerHTML='';this.get('element').className='';for(var i in this){if(Lang.hasOwnProperty(this,i)){this[i]=null;}}
+return true;},toString:function(){return'Toolbar (#'+this.get('element').id+') with '+this._buttonList.length+' buttons.';}});})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.lang,DD=YAHOO.util.DD,Toolbar=YAHOO.widget.Toolbar;YAHOO.widget.Editor=function(el,attrs){var oConfig={element:null,attributes:(attrs||{})}
+if(Lang.isString(el)){oConfig.attributes.textarea=Dom.get(el);}
+var element_cont=document.createElement('DIV');oConfig.attributes.element_cont=new YAHOO.util.Element(element_cont,{id:oConfig.attributes.textarea.id+'_container'});oConfig.attributes.element_cont.setStyle('display','none');oConfig.element=oConfig.attributes.textarea;var div=document.createElement('div');oConfig.attributes.element_cont.appendChild(div);if(!oConfig.attributes.toolbar_cont){oConfig.attributes.toolbar_cont=document.createElement('DIV');oConfig.attributes.toolbar_cont.id=oConfig.attributes.textarea.id+'_toolbar';div.appendChild(oConfig.attributes.toolbar_cont);}
+if(!oConfig.attributes.iframe){oConfig.attributes.iframe=_createIframe(oConfig.attributes.textarea.id);var editorWrapper=document.createElement('DIV');editorWrapper.appendChild(oConfig.attributes.iframe.get('element'));div.appendChild(editorWrapper);}
+Event.onDOMReady(function(){this.DOMReady=true;this.fireQueue();},this,true);YAHOO.widget.Editor.superclass.constructor.call(this,oConfig.element,oConfig.attributes);}
+function _cleanClassName(str){return str.replace(/ /g,'-').toLowerCase();}
+function _createIframe(id){var ifrmID=id+'_editor';var ifrmDom=document.createElement('iframe');ifrmDom.id=ifrmID;var config={border:'0',frameBorder:'0',marginWidth:'0',marginHeight:'0',leftMargin:'0',topMargin:'0',allowTransparency:'true',width:'100%',src:'javascript:false'}
+for(var i in config){if(Lang.hasOwnProperty(config,i)){ifrmDom.setAttribute(i,config[i]);}}
+var ifrm=new YAHOO.util.Element(ifrmDom);ifrm.setStyle('zIndex','-1');return ifrm;}
+YAHOO.extend(YAHOO.widget.Editor,YAHOO.util.Element,{DOMReady:null,_selection:null,_mask:null,_showingHiddenElements:null,currentWindow:null,currentEvent:null,operaEvent:null,currentFont:null,currentElement:[],dompath:null,beforeElement:null,afterElement:null,invalidHTML:{form:true,input:true,button:true,select:true,link:true,html:true,body:true,script:true,style:true,textarea:true},toolbar:null,_contentTimer:null,_contentTimerCounter:0,_disabled:['createlink','forecolor','backcolor','fontname','fontsize','superscript','subscript','removeformat','heading','indent','outdent'],_alwaysDisabled:{},_alwaysEnabled:{hiddenelements:true},_semantic:{'bold':true,'italic':true,'underline':true},_tag2cmd:{'b':'bold','strong':'bold','i':'italic','em':'italic','u':'underline','blockquote':'formatblock','sup':'superscript','sub':'subscript','img':'insertimage','a':'createlink','ul':'insertunorderedlist','ol':'insertorderedlist','indent':'indent','outdent':'outdent'},_getDoc:function(){var value=false;if(this.get){if(this.get('iframe')){if(this.get('iframe').get){if(this.get('iframe').get('element')){try{if(this.get('iframe').get('element').contentWindow){if(this.get('iframe').get('element').contentWindow.document){value=this.get('iframe').get('element').contentWindow.document;}}}catch(e){}}}}}
+return value;},_getWindow:function(){return this.get('iframe').get('element').contentWindow;},_focusWindow:function(onLoad){if(this.browser.webkit){if(onLoad){this._getSelection().setBaseAndExtent(this._getDoc().body,0,this._getDoc().body,1);this._getSelection().collapse(false);}else{this._getSelection().setBaseAndExtent(this._getDoc().body,1,this._getDoc().body,1);this._getSelection().collapse(false);}
+this._getWindow().focus();if(this._getDoc().queryCommandEnabled('insertimage')){this.browser.webkit3=true;}}else{this._getWindow().focus();}},_hasSelection:function(){var sel=this._getSelection();var range=this._getRange();var hasSel=false;if(this.browser.ie||this.browser.opera){if(range.text){hasSel=true;}
+if(range.html){hasSel=true;}}else{if((sel!='')&&(sel!=undefined)){hasSel=true;}}
+return hasSel;},_getSelection:function(){var _sel=null;if(this._getDoc()&&this._getWindow()){if(this._getDoc().selection){_sel=this._getDoc().selection;}else{_sel=this._getWindow().getSelection();}
+if(this.browser.webkit){if(_sel.baseNode){this._selection=new Object();this._selection.baseNode=_sel.baseNode;this._selection.baseOffset=_sel.baseOffset;this._selection.extentNode=_sel.extentNode;this._selection.extentOffset=_sel.extentOffset;}else if(this._selection!=null){_sel=this._getWindow().getSelection();_sel.setBaseAndExtent(this._selection.baseNode,this._selection.baseOffset,this._selection.extentNode,this._selection.extentOffset);this._selection=null;}}}
+return _sel;},_getRange:function(sel){var sel=this._getSelection();if(sel==null){return null;}
+if(this.browser.webkit&&!sel.getRangeAt){var _range=this._getDoc().createRange();try{_range.setStart(sel.anchorNode,sel.anchorOffset);_range.setEnd(sel.focusNode,sel.focusOffset);}catch(e){_range=this._getWindow().getSelection()+'';}
+return _range;}
+if(this.browser.ie||this.browser.opera){return sel.createRange();}
+if(sel.rangeCount>0){return sel.getRangeAt(0);}
+return null;},_setDesignMode:function(state){try{this._getDoc().designMode=state;}catch(e){}},_toggleDesignMode:function(){var _dMode=this._getDoc().designMode,_state='on';if(_dMode=='on'){_state='off';}
+this._setDesignMode(_state);return _state;},_initEditor:function(){if(this.browser.ie){this._getDoc().body.style.margin='0';}
+this._setDesignMode('on');this.toolbar.on('buttonClick',this._handleToolbarClick,this,true);Event.addListener(this._getDoc(),'mouseup',this._handleMouseUp,this,true);Event.addListener(this._getDoc(),'mousedown',this._handleMouseDown,this,true);Event.addListener(this._getDoc(),'click',this._handleClick,this,true);Event.addListener(this._getDoc(),'dblclick',this._handleDoubleClick,this,true);Event.addListener(this._getDoc(),'keypress',this._handleKeyPress,this,true);Event.addListener(this._getDoc(),'keyup',this._handleKeyUp,this,true);Event.addListener(this._getDoc(),'keydown',this._handleKeyDown,this,true);this.toolbar.set('disabled',false);this.fireEvent('editorContentLoaded',{type:'editorLoaded',target:this});if(this.get('dompath')){var self=this;window.setTimeout(function(){self._writeDomPath.call(self);},150);}},_checkLoaded:function(){this._contentTimerCounter++;if(this._contentTimer){window.clearTimeout(this._contentTimer);}
+if(this._contentTimerCounter>250){alert('ERROR: Body Did Not load');return false;}
+if(this._getDoc()&&this._getDoc().body&&(this._getDoc().body._rteLoaded==true)){this._initEditor();}else{var self=this;this._contentTimer=window.setTimeout(function(){self._checkLoaded.call(self);},20);}},_setInitialContent:function(){var title=this.STR_TITLE;var html=this.get('html');html=html.replace('{TITLE}',title);html=html.replace('{CONTENT}',this.get('textarea').value);html=html.replace('{CSS}',this.get('css'));html=html.replace('{HIDDEN_CSS}',this.get('hiddencss'));this._getDoc().open();this._getDoc().write(html);this._getDoc().close();this._checkLoaded();},_setMarkupType:function(action){switch(this.get('markup')){case'css':this._setEditorStyle(true);break;case'default':this._setEditorStyle(false);break;case'semantic':if(this._semantic[action]){this._setEditorStyle(false);}else{this._setEditorStyle(true);}
+break;}},_setEditorStyle:function(stat){try{this._getDoc().execCommand('useCSS',false,!stat);}catch(ex){}},_getSelectedElement:function(){var doc=this._getDoc();if(this.browser.ie){var range=this._getRange(),elm=null;if(range){elm=range.item?range.item(0):range.parentElement();if(elm==doc.body){elm=null;}}}else{var sel=this._getSelection(),range=this._getRange(),elm=null;if(!sel||!range){return null;}
+if(sel!=''){if(sel.anchorNode&&(sel.anchorNode.nodeType==3)){if(sel.anchorNode.parentNode){elm=sel.anchorNode.parentNode;}
+if(sel.anchorNode.nextSibling!=sel.focusNode.nextSibling){elm=sel.anchorNode.nextSibling;}}
+if(elm&&elm.tagName&&(elm.tagName.toLowerCase()=='br')){elm=null;}
+if(!elm){elm=range.commonAncestorContainer;if(!range.collapsed){if(range.startContainer==range.endContainer){if(range.startOffset-range.endOffset<2){if(range.startContainer.hasChildNodes()){elm=range.startContainer.childNodes[range.startOffset];}}}}}
+if(!elm){if(this.currentEvent){}}}}
+if(!elm&&(this.currentElement[0]||this.currentEvent)){if(this.currentEvent&&(this.currentEvent.keyCode==undefined)&&Event.getTarget(this.currentEvent)){elm=Event.getTarget(this.currentEvent);}else if(this.currentEvent&&(this.currentEvent.keyCode!=undefined)&&Event.getTarget(this.currentEvent)){}else{elm=this.currentElement[0];}}else if((elm==this._getDoc().body)&&this.currentElement[0]&&!this._hasSelection()){elm=this.currentElement[0];}
+if(this.browser.opera||this.browser.webkit){if(this.currentEvent&&!elm){elm=Event.getTarget(this.currentEvent);}}
+if(!elm||!elm.tagName){elm=doc.body;}
+if(elm&&elm.tagName&&elm.tagName.toLowerCase()=='html'){elm=doc.body;}
+return elm;},_getDomPath:function(){var el=this._getSelectedElement();var domPath=[];while(el!=null){if(el.ownerDocument!=this._getDoc()){return false;}
+if(el.nodeName&&(el.nodeType==1)){domPath[domPath.length]=el;}
+if(el.nodeName.toUpperCase()=="BODY"){break;}
+el=el.parentNode;}
+if(domPath.length==0){if(this._getDoc()&&this._getDoc().body){domPath[0]=this._getDoc().body;}}
+return domPath.reverse();},_writeDomPath:function(){var path=this._getDomPath(),pathArr=[];for(var i=0;i<path.length;i++){var tag=path[i].tagName.toLowerCase();if((tag=='ol')&&(path[i].type)){tag+=':'+path[i].type;}
+if(Dom.hasClass(path[i],'yui-tag')){tag=path[i].getAttribute('tag');}
+if((this.get('markup')=='semantic')){switch(tag){case'b':tag='strong';break;case'i':tag='em';break;}}
+if(!Dom.hasClass(path[i],'yui-non')){if(Dom.hasClass(path[i],'yui-tag')){var pathStr=tag;if(tag=='a'){if(path[i].getAttribute('href')){pathStr+=':'+path[i].getAttribute('href').replace('mailto:','').replace('http:/'+'/','').replace('https:/'+'/','');}}}else{var classPath=((path[i].className!='')?'.'+path[i].className.replace(/ /g,'.'):'');if((classPath.indexOf('yui')!=-1)||(classPath.toLowerCase().indexOf('apple-style-span')!=-1)){classPath='';}
+var pathStr=tag+((path[i].id)?'#'+path[i].id:'')+classPath;}
+if(pathStr.length>10){pathStr=pathStr.substring(0,10)+'...';}
+pathArr[pathArr.length]=pathStr;}}
+var str=pathArr.join(' '+this.SEP_DOMPATH+' ');if(this.dompath.innerHTML!=str){this.dompath.innerHTML=str;}},_fixNodes:function(){for(var i in this.invalidHTML){if(Lang.hasOwnProperty(this.invalidHTML,i)){var tags=this._getDoc().body.getElementsByTagName(i);for(var h=0;h<tags.length;h++){if(tags[h].parentNode){tags[h].parentNode.removeChild(tags[h]);}}}}
+var as=this._getDoc().body.getElementsByTagName('a');if(as.length){for(var i=0;i<as.length;i++){var el=this._getDoc().createElement('span');Dom.addClass(el,'yui-tag-a');Dom.addClass(el,'yui-tag');el.innerHTML=as[i].innerHTML;el.setAttribute('tag','a');el.setAttribute('href',as[i].getAttribute('href'));if(as[i].getAttribute('target')!=null){el.setAttribute('target',as[i].getAttribute('target'));}
+as[i].parentNode.replaceChild(el,as[i]);as[i]=null;}}
+var imgs=this._getDoc().getElementsByTagName('img');Dom.addClass(imgs,'yui-img');for(var i=0;i<imgs.length;i++){if(imgs[i].getAttribute('href',2)){var url=imgs[i].getAttribute('src',2);if((url!='')&&((url.indexOf('file:/')!=-1)||(url.indexOf(':\\')!=-1))){Dom.addClass(imgs[i],this.CLASS_LOCAL_FILE);}else{Dom.removeClass(imgs[i],this.CLASS_LOCAL_FILE);}}}
+var fakeAs=this._getDoc().body.getElementsByTagName('span');for(var i=0;i<fakeAs.length;i++){if(fakeAs[i].getAttribute('href',2)){var url=fakeAs[i].getAttribute('href',2);if((url!='')&&((url.indexOf('file:/')!=-1)||(url.indexOf(':\\')!=-1))){Dom.addClass(fakeAs[i],this.CLASS_LOCAL_FILE);}else{Dom.removeClass(fakeAs[i],this.CLASS_LOCAL_FILE);}}}},_showHidden:function(){if(this._showingHiddenElements){this._showingHiddenElements=false;this.toolbar.deselectButton(this.toolbar.getButtonByValue('hiddenelements'));Dom.removeClass(this._getDoc().body,this.CLASS_HIDDEN);}else{this._showingHiddenElements=true;Dom.addClass(this._getDoc().body,this.CLASS_HIDDEN);this.toolbar.selectButton(this.toolbar.getButtonByValue('hiddenelements'));}},_setCurrentEvent:function(ev){if(ev&&ev.type){}
+this.currentEvent=ev;},_handleClick:function(ev){this._setCurrentEvent(ev);if(this.currentWindow){this.closeWindow();}
+if(!this.browser.webkit){this.nodeChange();}},_handleMouseUp:function(ev){this._setCurrentEvent(ev);if(this.browser.opera){var sel=Event.getTarget(ev);if(sel&&sel.tagName&&(sel.tagName.toLowerCase()=='img')){this.nodeChange();var self=this;if(this.operaEvent){clearTimeout(this.operaEvent);this.operaEvent=null;this._handleDoubleClick(ev);}else{this.operaEvent=window.setTimeout(function(){self.operaEvent=false;},200);}}}
+if(this.browser.webkit||this.browser.opera){if(this.browser.webkit){Event.stopEvent(ev);}}
+this.nodeChange();this.fireEvent('editorMouseUp',{type:'editorMouseUp',target:this,ev:ev});},_handleMouseDown:function(ev){this._setCurrentEvent(ev);var sel=Event.getTarget(ev);if(sel&&sel.tagName&&(sel.tagName.toLowerCase()=='img')){if(this.browser.webkit){this.nodeChange();Event.stopEvent(ev);}}
+this.fireEvent('editorMouseDown',{type:'editorMouseDown',target:this,ev:ev});},_handleDoubleClick:function(ev){this._setCurrentEvent(ev);var sel=Event.getTarget(ev);if(sel&&sel.tagName&&(sel.tagName.toLowerCase()=='img')){this.currentElement[0]=sel;this.toolbar.fireEvent('insertimageClick',{type:'insertimageClick',target:this.toolbar});this.fireEvent('afterExecCommand',{type:'afterExecCommand',target:this});}else if(sel&&sel.getAttribute&&sel.getAttribute('tag')&&(sel.getAttribute('tag').toLowerCase()=='a')){this.currentElement[0]=sel;this.toolbar.fireEvent('createlinkClick',{type:'createlinkClick',target:this.toolbar});this.fireEvent('afterExecCommand',{type:'afterExecCommand',target:this});}
+this.nodeChange();this.fireEvent('editorDoubleClick',{type:'editorDoubleClick',target:this,ev:ev});},_handleKeyUp:function(ev){this._setCurrentEvent(ev);switch(ev.keyCode){case 37:case 38:case 39:case 40:case 46:case 8:case 65:case 27:if((ev.keyCode==27)&&this.currentWindow){this.closeWindow();}
+this.nodeChange();break;}
+this.fireEvent('editorKeyUp',{type:'editorKeyUp',target:this,ev:ev});},_handleKeyPress:function(ev){this._setCurrentEvent(ev);this.fireEvent('editorKeyPress',{type:'editorKeyPress',target:this,ev:ev});},_handleKeyDown:function(ev){this._setCurrentEvent(ev);if(this.currentWindow){this.closeWindow();}
+var doExec=false;var action=null;if(ev.shiftKey&&ev.ctrlKey){doExec=true;}
+switch(ev.keyCode){case 84:if(ev.shiftKey&&ev.ctrlKey){this.toolbar._titlebar.firstChild.focus();Event.stopEvent(ev);doExec=false;}
+break;case 27:if(ev.shiftKey){this.afterElement.focus();Event.stopEvent(ev);exec=false;}
+break;case 219:action='justifyleft';break;case 220:action='justifycenter';break;case 221:action='justifyright';break;case 76:if(this._hasSelection()){this.execCommand('createlink','');this.toolbar.fireEvent('createlinkClick',{type:'createlinkClick',target:this.toolbar});this.fireEvent('afterExecCommand',{type:'afterExecCommand',target:this});doExec=false;}
+break;case 66:action='bold';break;case 73:action='italic';break;case 85:action='underline';break;case 9:if(this.browser.safari){this._getDoc().execCommand('inserttext',false,'\t');Event.stopEvent(ev);}
+break;case 13:if(this.browser.ie){var _range=this._getRange();var tar=this._getSelectedElement();if(tar&&tar.tagName&&(tar.tagName.toLowerCase()!='li')){if(_range){_range.pasteHTML('<br>');_range.collapse(false);_range.select();}
+Event.stopEvent(ev);}}}
+if(doExec&&action){this.execCommand(action,null);Event.stopEvent(ev);this.nodeChange();}
+this.fireEvent('editorKeyDown',{type:'editorKeyDown',target:this,ev:ev});},nodeChange:function(){this._fixNodes();this.fireEvent('beforeNodeChange',{type:'beforeNodeChange',target:this});if(this.get('dompath')){this._writeDomPath();}
+if(!this.get('disabled')){if(this.STOP_NODE_CHANGE){this.STOP_NODE_CHANGE=false;return false;}else{var sel=this._getSelection();var range=this._getRange();for(var i=0;i<this._disabled.length;i++){var _button=this.toolbar.getButtonByValue(this._disabled[i]);if(_button&&_button.get){if(!this._hasSelection()){this.toolbar.disableButton(_button.get('id'));}else{if(!this._alwaysDisabled[this._disabled[i]]){this.toolbar.enableButton(_button.get('id'));}}
+if(!this._alwaysEnabled[this._disabled[i]]){this.toolbar.deselectButton(_button);}}}
+for(var i=0;i<this.toolbar._buttonList.length;i++){if(!this._alwaysEnabled[this.toolbar._buttonList[i].get('value')]){this.toolbar.deselectButton(this.toolbar._buttonList[i]);}}
+var path=this._getDomPath();var olType=null;for(var i=0;i<path.length;i++){var tag=path[i].tagName.toLowerCase();if(path[i].getAttribute('tag')){var tag=path[i].getAttribute('tag').toLowerCase();}
+var cmd=this._tag2cmd[tag];if(path[i].style.fontWeight.toLowerCase()=='bold'){cmd='bold';}
+if(path[i].style.fontStyle.toLowerCase()=='italic'){cmd='italic';}
+if(path[i].style.textDecoration.toLowerCase()=='underline'){cmd='underline';}
+if(tag=='ol'){if(path[i].type){olType=path[i].type;}else{olType='A';}}
+if(cmd){if(!Lang.isArray(cmd)){cmd=[cmd];}
+for(var j=0;j<cmd.length;j++){var button=this.toolbar.getButtonByValue(cmd[j]);this.toolbar.selectButton(button);this.toolbar.enableButton(button);}}
+switch(path[i].style.textAlign.toLowerCase()){case'left':case'right':case'center':case'justify':var alignType=path[i].style.textAlign.toLowerCase();if(path[i].style.textAlign.toLowerCase()=='justify'){alignType='full';}
+var button=this.toolbar.getButtonByValue('justify'+alignType);this.toolbar.selectButton(button);this.toolbar.enableButton(button);break;}}
+var fn_button=this.toolbar.getButtonByValue('fontname');if(fn_button){var family=fn_button._configs.label._initialConfig.value;fn_button.set('label','<span class="yui-toolbar-fontname-'+_cleanClassName(family)+'">'+family+'</span>');this._updateMenuChecked('fontname',family);}
+var fs_button=this.toolbar.getButtonByValue('fontsize');if(fs_button){fs_button.set('label',fs_button._configs.label._initialConfig.value);}
+var hd_button=this.toolbar.getButtonByValue('heading');if(hd_button){hd_button.set('label',hd_button._configs.label._initialConfig.value);this._updateMenuChecked('heading','none');}}}
+this.fireEvent('afterNodeChange',{type:'afterNodeChange',target:this});},_updateMenuChecked:function(button,value,tbar){if(!tbar){tbar=this.toolbar;}
+var _button=tbar.getButtonByValue(button);var _menuItems=_button.getMenu().getItems();if(_menuItems.length==0){_button.getMenu()._onBeforeShow();_menuItems=_button.getMenu().getItems();}
+for(var i=0;i<_menuItems.length;i++){_menuItems[i].cfg.setProperty('checked',false);if(_menuItems[i].value==value){_menuItems[i].cfg.setProperty('checked',true);}}},_handleToolbarClick:function(ev){var value='';var str='';var cmd=ev.button.value;if(ev.button.menucmd){value=cmd;cmd=ev.button.menucmd;}
+if(this.STOP_EXEC_COMMAND){this.STOP_EXEC_COMMAND=false;return false;}else{this.execCommand(cmd,value);}
+Event.stopEvent(ev);},_setupAfterElement:function(){if(!this.afterElement){this.afterElement=document.createElement('h2');this.afterElement.className='yui-editor-skipheader';this.afterElement.tabIndex='-1';this.afterElement.innerHTML=this.STR_LEAVE_EDITOR;this.get('element_cont').get('firstChild').appendChild(this.afterElement);}},EDITOR_PANEL_ID:'yui-editor-panel',SEP_DOMPATH:'<',STR_LEAVE_EDITOR:'You have left the Rich Text Editor.',STR_BEFORE_EDITOR:'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift [ aligns text left</li> <li>Control Shift | centers text</li> <li>Control Shift ] aligns text right</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control Shift ESC.</li></ul>',STR_CLOSE_WINDOW:'Close Window',STR_CLOSE_WINDOW_NOTE:'To close this window use the Escape key',STR_TITLE:'Rich Text Area.',STR_IMAGE_HERE:'Image Url Here',STR_IMAGE_PROP_TITLE:'Image Options',STR_IMAGE_URL:'Image Url',STR_IMAGE_TITLE:'Description',STR_IMAGE_SIZE:'Size',STR_IMAGE_ORIG_SIZE:'Original Size',STR_IMAGE_COPY:'<span class="tip"><span class="icon icon-info"></span><strong>Note:</strong>To move this image just highlight it, cut, and paste where ever you\'d like.</span>',STR_IMAGE_PADDING:'Padding',STR_IMAGE_BORDER:'Border',STR_IMAGE_TEXTFLOW:'Text Flow',STR_LOCAL_FILE_WARNING:'<span class="tip"><span class="icon icon-warn"></span><strong>Note:</strong>This image/link points to a file on your computer and will not be accessible to others on the internet.</span>',STR_LINK_PROP_TITLE:'Link Options',STR_LINK_PROP_REMOVE:'Remove link from text',STR_LINK_URL:'Link URL',STR_LINK_NEW_WINDOW:'Open in a new window.',STR_LINK_TITLE:'Description',STOP_EXEC_COMMAND:false,STOP_NODE_CHANGE:false,CLASS_HIDDEN:'hidden',CLASS_LOCAL_FILE:'warning-localfile',CLASS_CONTAINER:'yui-editor-container',CLASS_EDITABLE:'yui-editor-editable',CLASS_EDITABLE_CONT:'yui-editor-editable-container',CLASS_PREFIX:'yui-editor',browser:YAHOO.env.ua,init:function(p_oElement,p_oAttributes){YAHOO.widget.Editor.superclass.init.call(this,p_oElement,p_oAttributes);this.get('element_cont').addClass(this.CLASS_CONTAINER);Dom.addClass(this.get('iframe').get('parentNode'),this.CLASS_EDITABLE_CONT);this.get('iframe').addClass(this.CLASS_EDITABLE);},initAttributes:function(attr){YAHOO.widget.Editor.superclass.initAttributes.call(this,attr);var self=this;this.setAttributeConfig('textarea',{value:attr.textarea,writeOnce:true});this.setAttributeConfig('height',{value:attr.height||Dom.getStyle(self.get('textarea'),'height'),writeOnce:true});this.setAttributeConfig('width',{value:attr.width||Dom.getStyle(this.get('textarea'),'width'),writeOnce:true});this.setAttributeConfig('blankimage',{value:attr.blankimage||this._getBlankImage()});this.setAttributeConfig('hiddencss',{value:attr.hiddencss||'.hidden div,.hidden p,.hidden span,.hidden img { border: 1px dotted #ccc; } .hidden .yui-non { border: none; } .hidden img { padding: 2px; }',writeOnce:true});this.setAttributeConfig('css',{value:attr.css||'body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } span.yui-tag-a { color: blue; text-decoration: underline; } span.yui-tag-blockquote { margin: 1em; display: block; } span.yui-tag-indent { margin-left: 1em; display: block; } .warning-localfile { border-bottom: 1px dashed red !important; }',writeOnce:true});this.setAttributeConfig('html',{value:attr.html||'<!DOCTYPE HTML PUBLIC "-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd"><html><head><title>{TITLE}</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style>{CSS}</style><style>{HIDDEN_CSS}</style></head><body onload="document.body._rteLoaded = true;">{CONTENT}</body></html>',writeOnce:true});this.setAttributeConfig('handleSubmit',{value:false,writeOnce:true,method:function(exec){if(exec){var ta=this.get('textarea');if(ta.form){Event.addListener(ta.form,'submit',function(){this.saveHTML();},this,true);}}}});this.setAttributeConfig('iframe',{value:null,writeOnce:true});this.setAttributeConfig('disabled',{value:false,method:function(disabled){if(disabled){if(!this._mask){this._setDesignMode('off');this.toolbar.set('disabled',true);this._mask=document.createElement('DIV');Dom.setStyle(this._mask,'height','100%');Dom.setStyle(this._mask,'width','100%');Dom.setStyle(this._mask,'position','absolute');Dom.setStyle(this._mask,'top','0');Dom.setStyle(this._mask,'left','0');Dom.setStyle(this._mask,'opacity','.5');Dom.addClass(this._mask,'yui-editor-masked');this.get('iframe').get('parentNode').appendChild(this._mask);}}else{if(this._mask){this._mask.parentNode.removeChild(this._mask);this._mask=null;this.toolbar.set('disabled',false);this._setDesignMode('on');this._focusWindow();}}}});this.setAttributeConfig('element_cont',{value:null,writeOnce:true});this.setAttributeConfig('toolbar_cont',{value:null,writeOnce:true});this.setAttributeConfig('toolbar',{value:attr.toolbar||{collapse:true,titlebar:'Text Editing Tools',draggable:false,buttons:[{group:'fontstyle',label:'Font Name and Size',buttons:[{type:'select',label:'Arial',value:'fontname',disabled:true,menu:[{text:'Arial',checked:true},{text:'Arial Black'},{text:'Comic Sans MS'},{text:'Courier New'},{text:'Lucida Console'},{text:'Tahoma'},{text:'Times New Roman'},{text:'Trebuchet MS'},{text:'Verdana'}]},{type:'spin',label:'13',value:'fontsize',range:[9,75],disabled:true}]},{type:'separator'},{group:'textstyle',label:'Font Style',buttons:[{type:'push',label:'Bold CTRL + SHIFT + B',value:'bold'},{type:'push',label:'Italic CTRL + SHIFT + I',value:'italic'},{type:'push',label:'Underline CTRL + SHIFT + U',value:'underline'},{type:'separator'},{type:'push',label:'Subscript',value:'subscript',disabled:true},{type:'push',label:'Superscript',value:'superscript',disabled:true},{type:'separator'},{type:'color',label:'Font Color',value:'forecolor',disabled:true},{type:'color',label:'Background Color',value:'backcolor',disabled:true},{type:'separator'},{type:'push',label:'Remove Formatting',value:'removeformat',disabled:true},{type:'push',label:'Hidden Elements',value:'hiddenelements'}]},{type:'separator'},{group:'alignment',label:'Alignment',buttons:[{type:'push',label:'Align Left CTRL + SHIFT + [',value:'justifyleft'},{type:'push',label:'Align Center CTRL + SHIFT + |',value:'justifycenter'},{type:'push',label:'Align Right CTRL + SHIFT + ]',value:'justifyright'},{type:'push',label:'Justify',value:'justifyfull'}]},{type:'separator'},{group:'parastyle',label:'Paragraph Style',buttons:[{type:'select',label:'Normal',value:'heading',disabled:true,menu:[{text:'Normal',value:'none',checked:true},{text:'Header 1',value:'h1'},{text:'Header 2',value:'h2'},{text:'Header 3',value:'h3'},{text:'Header 4',value:'h4'},{text:'Header 5',value:'h5'},{text:'Header 6',value:'h6'}]}]},{type:'separator'},{group:'indentlist',label:'Indenting and Lists',buttons:[{type:'push',label:'Indent',value:'indent',disabled:true},{type:'push',label:'Outdent',value:'outdent',disabled:true},{type:'push',label:'Create an Unordered List',value:'insertunorderedlist'},{type:'push',label:'Create an Ordered List',value:'insertorderedlist'}]},{type:'separator'},{group:'insertitem',label:'Insert Item',buttons:[{type:'push',label:'HTML Link CTRL + SHIFT + L',value:'createlink',disabled:true},{type:'push',label:'Insert Image',value:'insertimage'}]}]},writeOnce:true,method:function(toolbar){}});this.setAttributeConfig('animate',{value:false,validator:function(value){var ret=true;if(!YAHOO.util.Anim){ret=false;}
+return ret;}});this.setAttributeConfig('panel',{value:null,writeOnce:true,validator:function(value){var ret=true;if(!YAHOO.widget.Panel){ret=false;}
+return ret;}});this.setAttributeConfig('localFileWarning',{value:true});this.setAttributeConfig('dompath',{value:false,method:function(dompath){if(dompath&&!this.dompath){this.dompath=document.createElement('DIV');this.dompath.id=this.get('id')+'_dompath';Dom.addClass(this.dompath,'dompath');this.get('element_cont').get('firstChild').appendChild(this.dompath);if(this.get('iframe')){this._writeDomPath();}}else if(!dompath&&this.dompath){this.dompath.parentNode.removeChild(this.dompath);this.dompath=null;}
+this._setupAfterElement();}});this.setAttributeConfig('markup',{value:'semantic',validator:function(markup){switch(markup.toLowerCase()){case'semantic':case'css':case'default':return true;break;}
+return false;}});this.on('afterRender',function(){this._renderPanel();});},_getBlankImage:function(){if(!this.DOMReady){this._queue[this._queue.length]=['_getBlankImage',arguments];return'';}
+var div=document.createElement('div');div.style.position='absolute';div.style.top='-9999px';div.style.left='-9999px';div.className=this.CLASS_PREFIX+'-blankimage';document.body.appendChild(div);var img=YAHOO.util.Dom.getStyle(div,'background-image');img=img.replace('url(','').replace(')','').replace(/"/g,'');this.set('blankimage',img);return img;},_handleFontSize:function(o){var button=this.toolbar.getButtonById(o.button.id);var value=button.get('label')+'px';this.execCommand('fontsize',value);this.STOP_EXEC_COMMAND=true;},_handleColorPicker:function(o){var cmd=o.button;var value='#'+o.color;if((cmd=='forecolor')||(cmd=='backcolor')){this.execCommand(cmd,value);}},_handleAlign:function(o){var button=this.toolbar.getButtonById(o.button.id);var cmd=null;for(var i=0;i<o.button.menu.length;i++){if(o.button.menu[i].value==o.button.value){cmd=o.button.menu[i].value;}}
+var value=this._getSelection();this.execCommand(cmd,value);this.STOP_EXEC_COMMAND=true;},_handleAfterNodeChange:function(){var path=this._getDomPath();for(var i=0;i<path.length;i++){var elm=path[i],tag=elm.tagName.toLowerCase(),family=null,fontsize=null,validFont=false;if(elm.getAttribute('tag')){tag=elm.getAttribute('tag');}
+family=elm.getAttribute('face');if(Dom.getStyle(elm,'font-family')){family=Dom.getStyle(elm,'font-family');}
+var fn_button=this.toolbar.getButtonByValue('fontname');if(fn_button){for(var b=0;b<fn_button._configs.menu.value.length;b++){if(family&&fn_button._configs.menu.value[b].text.toLowerCase()==family.toLowerCase()){validFont=true;family=fn_button._configs.menu.value[b].text;}}
+if(!validFont){family=fn_button._configs.label._initialConfig.value;}
+fn_button.set('label','<span class="yui-toolbar-fontname-'+_cleanClassName(family)+'">'+family+'</span>');this._updateMenuChecked('fontname',family);}
+var fs_button=this.toolbar.getButtonByValue('fontsize');if(fs_button){fontsize=parseInt(Dom.getStyle(elm,'fontSize'));if((fontsize==null)||isNaN(fontsize)){fontsize=fs_button._configs.label._initialConfig.value;}
+fs_button.set('label',''+fontsize);}
+if(tag.substring(0,1)=='h'){var hd_button=this.toolbar.getButtonByValue('heading');if(hd_button){for(var b=0;b<hd_button._configs.menu.value.length;b++){if(hd_button._configs.menu.value[b].value.toLowerCase()==tag){hd_button.set('label',hd_button._configs.menu.value[b].text);}}
+this._updateMenuChecked('heading',tag);}}}
+if(elm&&elm.tagName&&(elm.tagName.toLowerCase()!='body')){this.toolbar.enableButton(fn_button);this.toolbar.enableButton(fs_button);}},_handleInsertImageClick:function(){this.on('afterExecCommand',function(){var el=this.currentElement[0],title='',src='',align='',height=75,width=75,padding=0,blankimage=false,win=new YAHOO.widget.EditorWindow('insertimage',{width:'415px'});if(!el){el=this._getSelectedElement();}
+if(el){if(el.getAttribute('src')){src=el.getAttribute('src',2);if(src.indexOf(this.get('blankimage'))!=-1){src=this.STR_IMAGE_HERE;blankimage=true;}}
+if(el.getAttribute('alt',2)){title=el.getAttribute('alt',2);}
+if(el.getAttribute('title',2)){title=el.getAttribute('title',2);}
+height=parseInt(el.height);width=parseInt(el.width);if(el.style.height){height=parseInt(el.style.height);}
+if(el.style.width){width=parseInt(el.style.width);}
+if(el.style.margin){padding=parseInt(el.style.margin);}
+if(!el._height){el._height=height;}
+if(!el._width){el._width=width;}
+var oheight=el._height;var owidth=el._width;}
+if(!win.cache){var str='<label for="insertimage_url"><strong>'+this.STR_IMAGE_URL+':</strong> <input type="text" id="insertimage_url" value="'+src+'" size="40"></label>';var body=document.createElement('div');body.innerHTML=str;var tbarCont=document.createElement('div');tbarCont.id='img_toolbar';body.appendChild(tbarCont);var str2='<label for="insertimage_title"><strong>'+this.STR_IMAGE_TITLE+':</strong> <input type="text" id="insertimage_title" value="'+title+'" size="40"></label>';var div=document.createElement('div');div.innerHTML=str2;body.appendChild(div);win.cache=body;}else{body=win.cache;}
+var tbar=new YAHOO.widget.Toolbar(tbarCont,{buttons:[{group:'padding',label:this.STR_IMAGE_PADDING+':',buttons:[{type:'spin',label:''+padding,value:'padding',range:[0,50]}]},{type:'separator'},{group:'border',label:this.STR_IMAGE_BORDER+':',buttons:[{type:'select',label:'Border Size',value:'bordersize',menu:[{text:'none',value:'0',checked:true},{text:'----',value:'1'},{text:'----',value:'2'},{text:'----',value:'3'},{text:'----',value:'4'},{text:'----',value:'5'}]},{type:'select',label:'Border Type',value:'bordertype',disabled:true,menu:[{text:'----',value:'solid',checked:true},{text:'----',value:'dashed'},{text:'----',value:'dotted'}]},{type:'color',label:'Border Color',value:'bordercolor',disabled:true}]},{type:'separator'},{group:'textflow',label:this.STR_IMAGE_TEXTFLOW+':',buttons:[{type:'push',label:'Left',value:'left'},{type:'push',label:'Inline',value:'inline'},{type:'push',label:'Block',value:'block'},{type:'push',label:'Right',value:'right'}]}]});var bsize='0';var btype='solid';if(el.style.borderLeftWidth){bsize=parseInt(el.style.borderLeftWidth);}
+if(el.style.borderLeftStyle){btype=el.style.borderLeftStyle;}
+var bs_button=tbar.getButtonByValue('bordersize');var bSizeStr=((parseInt(bsize)>0)?'----':'none');bs_button.set('label','<span class="yui-toolbar-bordersize-'+bsize+'">'+bSizeStr+'</span>');this._updateMenuChecked('bordersize',bsize,tbar);var bs_button=tbar.getButtonByValue('bordertype');bs_button.set('label','<span class="yui-toolbar-bordertype-'+btype+'">----</span>');this._updateMenuChecked('bordertype',btype,tbar);if(parseInt(bsize)>0){tbar.enableButton(tbar.getButtonByValue('bordertype'));tbar.enableButton(tbar.getButtonByValue('bordercolor'));}
+var cont=tbar.get('cont');var hw=document.createElement('div');hw.className='yui-toolbar-group yui-toolbar-group-padding height-width';hw.innerHTML='<h3>'+this.STR_IMAGE_SIZE+':</h3>';var orgSize='';if((height!=oheight)||(width!=owidth)){orgSize='<span class="info">'+this.STR_IMAGE_ORIG_SIZE+'<br>'+owidth+' x '+oheight+'</span>';}
+hw.innerHTML+='<span><input type="text" size="3" value="'+width+'" id="insertimage_width"> x <input type="text" size="3" value="'+height+'" id="insertimage_height"></span>'+orgSize;cont.insertBefore(hw,cont.firstChild);Event.onAvailable('insertimage_width',function(){Event.on('insertimage_width','blur',function(){var value=parseInt(Dom.get('insertimage_width').value);if(value>5){el.style.width=value+'px';this.moveWindow();}},this,true);},this,true);Event.onAvailable('insertimage_height',function(){Event.on('insertimage_height','blur',function(){var value=parseInt(Dom.get('insertimage_height').value);if(value>5){el.style.height=value+'px';this.moveWindow();}},this,true);},this,true);if(el.align=='right'){tbar.selectButton(tbar.getButtonByValue('right'));}else if(el.align=='left'){tbar.selectButton(tbar.getButtonByValue('left'));}else if(el.style.display=='block'){tbar.selectButton(tbar.getButtonByValue('block'));}else{tbar.selectButton(tbar.getButtonByValue('inline'));}
+if(parseInt(el.style.marginLeft)>0){tbar.getButtonByValue('padding').set('label',''+parseInt(el.style.marginLeft));}
+if(el.style.borderSize){tbar.selectButton(tbar.getButtonByValue('bordersize'));tbar.selectButton(tbar.getButtonByValue(parseInt(el.style.borderSize)));}
+tbar.on('colorPickerClicked',function(o){var size='1',type='solid',color='black';if(el.style.borderLeftWidth){size=parseInt(el.style.borderLeftWidth);}
+if(el.style.borderLeftStyle){type=el.style.borderLeftStyle;}
+if(el.style.borderLeftColor){color=el.style.borderLeftColor;}
+var borderString=size+'px '+type+' #'+o.color;el.style.border=borderString;},this.toolbar,true);tbar.on('buttonClick',function(o){var value=o.button.value;if(o.button.menucmd){value=o.button.menucmd}
+var size='1',type='solid',color='black';if(el.style.borderLeftWidth){size=parseInt(el.style.borderLeftWidth);}
+if(el.style.borderLeftStyle){type=el.style.borderLeftStyle;}
+if(el.style.borderLeftColor){color=el.style.borderLeftColor;}
+switch(value){case'bordersize':var borderString=parseInt(o.button.value)+'px '+type+' '+color;el.style.border=borderString;if(parseInt(o.button.value)>0){tbar.enableButton(tbar.getButtonByValue('bordertype'));tbar.enableButton(tbar.getButtonByValue('bordercolor'));}else{tbar.disableButton(tbar.getButtonByValue('bordertype'));tbar.disableButton(tbar.getButtonByValue('bordercolor'));}
+break;case'bordertype':var borderString=size+'px '+o.button.value+' '+color;el.style.border=borderString;break;case'right':case'left':tbar.deselectAllButtons();el.style.display='';el.align=o.button.value;break;case'inline':tbar.deselectAllButtons();el.style.display='';el.align='';break;case'block':tbar.deselectAllButtons();el.style.display='block';el.align='center';break;case'padding':var _button=tbar.getButtonById(o.button.id);el.style.margin=_button.get('label')+'px';break;}
+tbar.selectButton(tbar.getButtonByValue(o.button.value));this.moveWindow();},this,true);win.setHeader(this.STR_IMAGE_PROP_TITLE);win.setBody(body);if((this.browser.webkit&&!this.browser.webkit3)||this.browser.opera){var str=this.STR_IMAGE_COPY;win.setFooter(str);}
+this.openWindow(win);Event.onAvailable('insertimage_url',function(){window.setTimeout(function(){YAHOO.util.Dom.get('insertimage_url').focus();if(blankimage){YAHOO.util.Dom.get('insertimage_url').select();}},50);if(this.get('localFileWarning')){Event.on('insertimage_url','blur',function(){var url=Dom.get('insertimage_url');if((url.value!='')&&((url.value.indexOf('file:/')!=-1)||(url.value.indexOf(':\\')!=-1))){Dom.addClass(url,'warning');var str=this.STR_LOCAL_FILE_WARNING;this.get('panel').setFooter(str);}else{Dom.removeClass(url,'warning');this.get('panel').setFooter(' ');if((this.browser.webkit&&!this.browser.webkit3)||this.browser.opera){var str=this.STR_IMAGE_COPY;this.get('panel').setFooter(str);}
+if(url&&url.value&&(url.value!=this.STR_IMAGE_HERE)){this.currentElement[0].setAttribute('src',url.value);var img=new Image();var self=this;window.setTimeout(function(){YAHOO.util.Dom.get('insertimage_height').value=img.height;YAHOO.util.Dom.get('insertimage_width').value=img.width;if(!self.currentElement[0]._height){self.currentElement[0]._height=img.height;}
+if(!self.currentElement[0]._width){self.currentElement[0]._width=img.width;}
+self.moveWindow();},200);img.src=url.value;}}},this,true);}},this,true);});},_handleInsertImageWindowClose:function(){var url=Dom.get('insertimage_url');var title=Dom.get('insertimage_title');var el=this.currentElement[0];if(url&&url.value&&(url.value!=this.STR_IMAGE_HERE)){el.setAttribute('src',url.value);el.setAttribute('title',title.value);el.setAttribute('alt',title.value);}else{el.parentNode.removeChild(el);}},_handleCreateLinkClick:function(){this.on('afterExecCommand',function(){var win=new YAHOO.widget.EditorWindow('createlink',{width:'300px'});var el=this.currentElement[0],url='',title='',target='',localFile=false;if(el){if(el.getAttribute('href')!=null){url=el.getAttribute('href');if((url!='')&&((url.indexOf('file:/')!=-1)||(url.indexOf(':\\')!=-1))){var str=this.STR_LOCAL_FILE_WARNING;win.setFooter(str);localFile=true;}else{win.setFooter(' ');}}
+if(el.getAttribute('title')!=null){title=el.getAttribute('title');}
+if(el.getAttribute('target')!=null){target=el.getAttribute('target');}}
+var str='<label for="createlink_url"><strong>'+this.STR_LINK_URL+':</strong> <input type="text" name="createlink_url" id="createlink_url" value="'+url+'"'+((localFile)?' class="warning"':'')+'></label>';str+='<label for="createlink_target"><strong>&nbsp;</strong><input type="checkbox" name="createlink_target_" id="createlink_target" value="_blank"'+((target)?' checked':'')+'> '+this.STR_LINK_NEW_WINDOW+'</label>';str+='<label for="createlink_title"><strong>'+this.STR_LINK_TITLE+':</strong> <input type="text" name="createlink_title" id="createlink_title" value="'+title+'"></label>';var body=document.createElement('div');body.innerHTML=str;var unlinkCont=document.createElement('div');unlinkCont.className='removeLink';var unlink=document.createElement('a');unlink.href='#';unlink.innerHTML=this.STR_LINK_PROP_REMOVE;unlink.title=this.STR_LINK_PROP_REMOVE;Event.on(unlink,'click',function(ev){Event.stopEvent(ev);this.execCommand('unlink');this.closeWindow();},this,true);unlinkCont.appendChild(unlink);body.appendChild(unlinkCont);win.setHeader(this.STR_LINK_PROP_TITLE);win.setBody(body);Event.onAvailable('createlink_url',function(){window.setTimeout(function(){try{YAHOO.util.Dom.get('createlink_url').focus();}catch(e){}},50);Event.on('createlink_url','blur',function(){var url=Dom.get('createlink_url');if((url.value!='')&&((url.value.indexOf('file:/')!=-1)||(url.value.indexOf(':\\')!=-1))){Dom.addClass(url,'warning');var str=this.STR_LOCAL_FILE_WARNING;this.get('panel').setFooter(str);}else{Dom.removeClass(url,'warning');this.get('panel').setFooter(' ');}},this,true);},this,true);this.openWindow(win);});},_handleCreateLinkWindowClose:function(){var url=Dom.get('createlink_url');var target=Dom.get('createlink_target');var title=Dom.get('createlink_title');var el=this.currentElement[0];if(url&&url.value){var urlValue=url.value;if((urlValue.indexOf(':/'+'/')==-1)&&(urlValue.substring(0,1)!='/')&&(urlValue.substring(0,6).toLowerCase()!='mailto')){if((urlValue.indexOf('@')!=-1)&&(urlValue.substring(0,6).toLowerCase()!='mailto')){urlValue='mailto:'+urlValue;}else{urlValue='http:/'+'/'+urlValue;}}
+el.setAttribute('href',urlValue);if(target.checked){el.setAttribute('target',target.value);}else{el.setAttribute('target','');}
+el.setAttribute('title',((title.value)?title.value:''));}else{el.removeAttribute('tag');Dom.removeClass(el,'yui-tag-a');Dom.removeClass(el,'yui-tag');Dom.addClass(el,'yui-non');}
+this.nodeChange();},render:function(){if(!this.DOMReady){this._queue[this._queue.length]=['render',arguments];return false;}
+var self=this;var tbarConf=this.get('toolbar');tbarConf.disabled=true;this.toolbar=new Toolbar(this.get('toolbar_cont'),tbarConf);this.fireEvent('toolbarLoaded',{type:'toolbarLoaded',target:this.toolbar});this.toolbar.on('toolbarCollapsed',function(){if(this.currentWindow){this.moveWindow();}},this,true);this.toolbar.on('toolbarExpanded',function(){if(this.currentWindow){this.moveWindow();}},this,true);this.toolbar.on('fontsizeClick',function(o){this._handleFontSize(o);},this,true);this.toolbar.on('colorPickerClicked',function(o){this._handleColorPicker(o);},this,true);this.toolbar.on('alignClick',function(o){this._handleAlign(o);},this,true);this.on('afterNodeChange',function(){this._handleAfterNodeChange();},this,true);this.toolbar.on('insertimageClick',function(){this._handleInsertImageClick();},this,true);this.on('windowinsertimageClose',function(){this._handleInsertImageWindowClose();},this,true);this.toolbar.on('createlinkClick',function(){this._handleCreateLinkClick();},this,true);this.on('windowcreatelinkClose',function(){this._handleCreateLinkWindowClose();},this,true);this.get('parentNode').replaceChild(this.get('element_cont').get('element'),this.get('element'));if(!this.beforeElement){this.beforeElement=document.createElement('h2');this.beforeElement.className='yui-editor-skipheader';this.beforeElement.tabIndex='-1';this.beforeElement.innerHTML=this.STR_BEFORE_EDITOR;this.get('element_cont').get('firstChild').insertBefore(this.beforeElement,this.toolbar.get('nextSibling'));}
+Dom.setStyle(this.get('textarea'),'display','none');this.get('element_cont').appendChild(this.get('element'));this.get('element_cont').setStyle('display','block');this.get('element_cont').setStyle('width',this.get('width'));Dom.setStyle(this.get('iframe').get('parentNode'),'height',this.get('height'));this.get('iframe').setStyle('width','100%');this.get('iframe').setStyle('height','100%');var self=this;window.setTimeout(function(){self._setInitialContent.call(self);},10);this.fireEvent('afterRender',{type:'afterRender',target:this});},execCommand:function(action,value){this.fireEvent('beforeExecCommand',{type:'beforeExecCommand',target:this,args:arguments});if(this.STOP_EXEC_COMMAND){this.STOP_EXEC_COMMAND=false;return false;}
+this._setMarkupType(action);if(this.browser.ie){this._getWindow().focus();}
+var exec=true;var _sel=this._getSelection();var _range=this._getRange();var _selEl=this._getSelectedElement();if(_selEl){_sel=_selEl;}
+switch(action.toLowerCase()){case'heading':if(this.browser.ie){action='formatblock';}
+if(value=='none'){if((_sel&&_sel.tagName&&(_sel.tagName.toLowerCase().substring(0,1)=='h'))||(_sel&&_sel.parentNode&&_sel.parentNode.tagName&&(_sel.parentNode.tagName.toLowerCase().substring(0,1)=='h'))){if(_sel.parentNode.tagName.toLowerCase().substring(0,1)=='h'){_sel=_sel.parentNode;}
+var _span=this._getDoc().createElement('span');_span.className='yui-non';_span.innerHTML=_sel.innerHTML;_sel.parentNode.replaceChild(_span,_sel);}
+exec=false;}else{if(this.browser.ie||this.browser.webkit||this.browser.opera){this._createCurrentElement(value);exec=false;}}
+break;case'backcolor':if(this.browser.gecko||this.browser.opera){this._setEditorStyle(true);action='hilitecolor';}
+break;case'hiddenelements':this._showHidden();exec=false;break;case'unlink':var el=this.currentElement[0];el.removeAttribute('title');el.removeAttribute('tag');el.removeAttribute('target');el.removeAttribute('href');YAHOO.util.Dom.addClass(el,'yui-non');YAHOO.util.Dom.removeClass(el,'yui-tag-a');YAHOO.util.Dom.removeClass(el,'yui-tag');exec=false;break;case'createlink':var el=this._getSelectedElement();if(!el||(el.getAttribute('tag')!='a')){this._createCurrentElement('a');}else{this.currentElement[0]=el;}
+exec=false;break;case'insertimage':if(value==''){value=this.get('blankimage');}
+var el=this._getSelectedElement();if(el&&el.tagName&&(el.tagName.toLowerCase()=='img')){this.currentElement[0]=el;exec=false;}else{if(this._getDoc().queryCommandEnabled(action)){this._getDoc().execCommand('insertimage',false,value);var imgs=this._getDoc().getElementsByTagName('img');for(var i=0;i<imgs.length;i++){if(!YAHOO.util.Dom.hasClass(imgs[i],'yui-img')){YAHOO.util.Dom.addClass(imgs[i],'yui-img');this.currentElement[0]=imgs[i];}}
+exec=false;}else{this._createCurrentElement('img');var _img=this._getDoc().createElement('img');_img.setAttribute('src',value);YAHOO.util.Dom.addClass(_img,'yui-img');this.currentElement[0].parentNode.replaceChild(_img,this.currentElement[0]);this.currentElement[0]=_img;exec=false;}}
+break;case'inserthtml':if(this.browser.webkit&&!this._getDoc().queryCommandEnabled(action)){this._createCurrentElement('img');var _span=this._getDoc().createElement('span');_span.innerHTML=value;this.currentElement[0].parentNode.replaceChild(_span,this.currentElement[0]);exec=false;}else if(this.browser.ie){var _range=this._getRange();if(_range.item){_range.item(0).outerHTML=value;}else{_range.pasteHTML(value);}
+exec=false;}
+break;case'removeformat':if(this.browser.webkit&&!this._getDoc().queryCommandEnabled(action)){this._createCurrentElement('span');YAHOO.util.Dom.addClass(this.currentElement[0],'yui-non');var re=/<\S[^><]*>/g;var str=this.currentElement[0].innerHTML.replace(re,'');var _txt=this._getDoc().createTextNode(str);this.currentElement[0].parentNode.parentNode.replaceChild(_txt,this.currentElement[0].parentNode);exec=false;}
+break;case'superscript':case'subscript':if(this.browser.webkit){var tag=action.toLowerCase().substring(0,3);this._createCurrentElement(tag);if(this.currentElement[0].parentNode.tagName.toLowerCase()==tag){var span=this._getDoc().createElement('span');span.innerHTML=this.currentElement[0].innerHTML;YAHOO.util.Dom.addClass(span,'yui-non');this.currentElement[0].parentNode.parentNode.replaceChild(span,this.currentElement[0].parentNode);}else{var _sub=this._getDoc().createElement(tag);_sub.innerHTML=this.currentElement[0].innerHTML;this.currentElement[0].parentNode.replaceChild(_sub,this.currentElement[0]);}
+exec=false;}
+break;case'formatblock':value='blockquote';if(this.browser.webkit){this._createCurrentElement('blockquote');if(YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode,'yui-tag-blockquote')){var span=this._getDoc().createElement('span');span.innerHTML=this.currentElement[0].innerHTML;YAHOO.util.Dom.addClass(span,'yui-non');this.currentElement[0].parentNode.parentNode.replaceChild(span,this.currentElement[0].parentNode);}
+exec=false;}else{var tar=Event.getTarget(this.currentEvent);if(tar&&tar.tagName&&(tar.tagName.toLowerCase()=='blockquote')){var span=this._getDoc().createElement('span');span.innerHTML=tar.innerHTML;YAHOO.util.Dom.addClass(span,'yui-non');tar.parentNode.replaceChild(span,tar);exec=false;}}
+break;case'indent':case'outdent':this._createCurrentElement(action.toLowerCase());if(this.currentElement[0].parentNode){if(action.toLowerCase()=='outdent'){if(YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode,'yui-tag-indent')){var span=this._getDoc().createElement('span');span.innerHTML=this.currentElement[0].innerHTML;YAHOO.util.Dom.addClass(span,'yui-non');this.currentElement[0].parentNode.parentNode.replaceChild(span,this.currentElement[0].parentNode);}}}
+exec=false;break;case'insertorderedlist':case'insertunorderedlist':var tag=((action.toLowerCase()=='insertorderedlist')?'ol':'ul');if((this.browser.webkit&&!this._getDoc().queryCommandEnabled(action))){var selEl=this._getSelectedElement();if((selEl.tagName.toLowerCase()=='li')&&(selEl.parentNode.tagName.toLowerCase()==tag)){var el=selEl.parentNode;var list=this._getDoc().createElement('span');YAHOO.util.Dom.addClass(list,'yui-non');var str='';var lis=el.getElementsByTagName('li');for(var i=0;i<lis.length;i++){str+=lis[i].innerHTML+'<br>';}
+list.innerHTML=str;}else{this._createCurrentElement(tag.toLowerCase());var el=this.currentElement[0];var list=this._getDoc().createElement(tag);if(tag=='ol'){list.type=value;}
+var li=this._getDoc().createElement('li');li.innerHTML=el.innerHTML+'&nbsp;';list.appendChild(li);}
+el.parentNode.replaceChild(list,el);exec=false;}else{var el=this._getSelectedElement();if((el.tagName.toLowerCase()=='li')&&(el.parentNode.tagName.toLowerCase()==tag)||(this.browser.ie&&this._getRange().parentElement&&this._getRange().parentElement.tagName&&(this._getRange().parentElement.tagName.toLowerCase()=='li'))){if(this.browser.ie){exec=false;var str='';var lis=el.parentNode.getElementsByTagName('li');for(var i=0;i<lis.length;i++){str+=lis[i].innerHTML+'<br>';}
+var newEl=this._getDoc().createElement('span');newEl.innerHTML=str;el.parentNode.parentNode.replaceChild(newEl,el.parentNode);}else{this.nodeChange();this._getDoc().execCommand(action,'',el.parentNode);this.nodeChange();}}
+if(this.browser.opera){var self=this;window.setTimeout(function(){var lis=self._getDoc().getElementsByTagName('li');for(var i=0;i<lis.length;i++){if(lis[i].innerHTML.toLowerCase()=='<br>'){lis[i].parentNode.parentNode.removeChild(lis[i].parentNode);}}},30);}
+if(this.browser.ie&&exec){var html='';if(this._getRange().html){html='<li>'+this._getRange().html+'</li>';}else{html='<li>'+this._getRange().text+'</li>';}
+this._getRange().pasteHTML('<'+tag+'>'+html+'</'+tag+'>');exec=false;}}
+break;case'fontname':var selEl=this._getSelectedElement();this.currentFont=value;if(selEl&&selEl.tagName&&!this._hasSelection()){YAHOO.util.Dom.setStyle(selEl,'font-family',value);exec=false;}
+break;case'fontsize':if((this.currentElement.length>0)&&(!this._hasSelection())){YAHOO.util.Dom.setStyle(this.currentElement,'fontSize',value);}else{this._createCurrentElement('span',{'fontSize':value});}
+exec=false;break;}
+if(exec){try{this._getDoc().execCommand(action,false,value);}catch(e){}}else{}
+this.on('afterExecCommand',function(){this.unsubscribeAll('afterExecCommand');this.nodeChange();});this.fireEvent('afterExecCommand',{type:'afterExecCommand',target:this});},_createCurrentElement:function(tagName,tagStyle){var tagName=((tagName)?tagName:'a'),sel=this._getSelection(),tar=null,el=[],_doc=this._getDoc();if(this.currentFont){if(!tagStyle){tagStyle={};}
+tagStyle.fontFamily=this.currentFont;this.currentFont=null;}
+this.currentElement=[];var _elCreate=function(){switch(tagName){case'h1':case'h2':case'h3':case'h4':case'h5':case'h6':var el=_doc.createElement(tagName);break;default:var el=_doc.createElement('span');YAHOO.util.Dom.addClass(el,'yui-tag-'+tagName);YAHOO.util.Dom.addClass(el,'yui-tag');el.setAttribute('tag',tagName);el.tabIndex=1;for(var i in tagStyle){if(YAHOO.util.Lang.hasOwnProperty(tagStyle,i)){el.style[i]=tagStyle[i];}}
+break;}
+return el;};if(!this._hasSelection()){if(this._getDoc().queryCommandEnabled('insertimage')){this._getDoc().execCommand('insertimage',false,'yui-tmp-img');var imgs=this._getDoc().getElementsByTagName('img');for(var i=0;i<imgs.length;i++){if(imgs[i].getAttribute('src',2)=='yui-tmp-img'){el=_elCreate();imgs[i].parentNode.replaceChild(el,imgs[i]);this.currentElement[this.currentElement.length]=el;}}}else{if(this.currentEvent){tar=YAHOO.util.Event.getTarget(this.currentEvent);}else{tar=this._getDoc().body;}}
+if(tar){el=_elCreate();if(tar.tagName.toLowerCase()=='body'){tar.appendChild(el);}else if(tar.nextSibling){tar.parentNode.insertBefore(el,tar.nextSibling);}else{tar.parentNode.appendChild(el);}
+this.currentElement[this.currentElement.length]=el;this.currentEvent=null;if(this.browser.webkit){this._getSelection().setBaseAndExtent(el,0,el,0);this._getSelection().collapse(true);}}}else{this._setEditorStyle(true);this._getDoc().execCommand('fontname',false,'yui-tmp');var _tmp=[];var _tmp1=this._getDoc().getElementsByTagName('font');var _tmp2=this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);var _tmp3=this._getDoc().getElementsByTagName('span');var _tmp4=this._getDoc().getElementsByTagName('i');var _tmp5=this._getDoc().getElementsByTagName('b');for(var e=0;e<_tmp1.length;e++){_tmp[_tmp.length]=_tmp1[e];}
+for(var e=0;e<_tmp2.length;e++){_tmp[_tmp.length]=_tmp2[e];}
+for(var e=0;e<_tmp3.length;e++){_tmp[_tmp.length]=_tmp3[e];}
+for(var e=0;e<_tmp4.length;e++){_tmp[_tmp.length]=_tmp4[e];}
+for(var e=0;e<_tmp5.length;e++){_tmp[_tmp.length]=_tmp5[e];}
+for(var i=0;i<_tmp.length;i++){if((YAHOO.util.Dom.getStyle(_tmp[i],'font-family')=='yui-tmp')||(_tmp[i].face&&(_tmp[i].face=='yui-tmp'))){var el=_elCreate();el.innerHTML=_tmp[i].innerHTML;if(_tmp[i].parentNode){_tmp[i].parentNode.replaceChild(el,_tmp[i]);this.currentElement[this.currentElement.length]=el;this.currentEvent=null;if(this.browser.webkit){this._getSelection().setBaseAndExtent(el,0,el,0);this._getSelection().collapse(true);}
+if(this.browser.ie&&tagStyle&&tagStyle.fontSize){this._getSelection().empty();}
+if(this.browser.gecko){this._getSelection().collapseToStart();}}}}
+var len=this.currentElement.length;for(var i=0;i<len;i++){if((i+1)!=len){if(this.currentElement[i]&&this.currentElement[i].nextSibling){if(this.currentElement[i].tagName&&(this.currentElement[i].tagName.toLowerCase()!='br')){this.currentElement[this.currentElement.length]=this.currentElement[i].nextSibling;}}}}}},saveHTML:function(){var html=this.cleanHTML();this.get('textarea').value=html;return html;},setEditorHTML:function(html){this._getDoc().body.innerHTML=html;this.nodeChange();},getEditorHTML:function(){return this._getDoc().body.innerHTML;},cleanHTML:function(html){if(!html){var html=this.getEditorHTML();}
+html=html.replace(/<div><br><\/div>/gi,'<YUI_BR>');html=html.replace(/<p>(&nbsp;|&#160;)<\/p>/g,'<YUI_BR>');html=html.replace(/<p><br>&nbsp;<\/p>/gi,'<YUI_BR>');html=html.replace(/<p>&nbsp;<\/p>/gi,'<YUI_BR>');html=html.replace(/<br class="khtml-block-placeholder">/gi,'<YUI_BR>');html=html.replace(/<br>/gi,'<YUI_BR>');html=html.replace(/<br\/>/gi,'<YUI_BR>');html=html.replace(/<img([^>]*)>/gi,'<YUI_IMG$1>');html=html.replace(/<ul([^>]*)>/gi,'<YUI_UL$1>');html=html.replace(/<\/ul>/gi,'<\/YUI_UL>');html=html.replace(/<i([^>]*)>/gi,'<em$1>');html=html.replace(/<\/i>/gi,'</em>');html=html.replace(/<b([^>]*)>/gi,'<strong$1>');html=html.replace(/<\/b>/gi,'</strong>');html=html.replace(/<font/gi,'<font');html=html.replace(/<\/font>/gi,'</font>');html=html.replace(/<span/gi,'<span');html=html.replace(/<\/span>/gi,'</span>');html=html.replace(/<u/gi,'<u');html=html.replace(/\/u>/gi,'/u>');html=html.replace(/<ol([^>]*)>/gi,'<ol$1>');html=html.replace(/\/ol>/gi,'/ol>');html=html.replace(/<li/gi,'<li');html=html.replace(/\/li>/gi,'/li>');html=html.replace(new RegExp('<span ([^>]*) tag="a" ([^>]*)>([^>]*)<\/span>','gi'),'<a $1 $2>$3</a>');if(this.browser.webkit){html=html.replace(/Apple-style-span/gi,'');html=html.replace(/style="line-height: normal;"/gi,'');}
+html=html.replace(/yui-tag-a/gi,'');html=html.replace(/yui-tag-span/gi,'');html=html.replace(/yui-tag/gi,'');html=html.replace(/yui-non/gi,'');html=html.replace(/yui-img/gi,'');html=html.replace(/ tag="span"/gi,'');html=html.replace(/ class=""/gi,'');html=html.replace(/ class=" "/gi,'');html=html.replace(/ class="  "/gi,'');html=html.replace(/ target=""/gi,'');html=html.replace(/ title=""/gi,'');html=html.replace(/<br><li/gi,'<li');html=html.replace(/<YUI_BR>/g,'<br>');html=html.replace(/<YUI_IMG([^>]*)>/g,'<img$1>');html=html.replace(/<YUI_UL([^>]*)>/g,'<ul$1>');html=html.replace(/<\/YUI_UL>/g,'<\/ul>');return html;},clearEditorDoc:function(){this._getDoc().body.innerHTML='&nbsp;';},_renderPanel:function(){if(!YAHOO.widget.EditorInfo.panel){var panel=new YAHOO.widget.Panel(this.EDITOR_PANEL_ID,{width:'300px',iframe:true,visible:false,underlay:'none',draggable:false,close:false});YAHOO.widget.EditorInfo.panel=panel;}else{var panel=YAHOO.widget.EditorInfo.panel;}
+this.set('panel',panel);this.get('panel').setBody('---');this.get('panel').setHeader(' ');this.get('panel').setFooter(' ');if(this.DOMReady){this.get('panel').render(document.body);Dom.addClass(this.get('panel').element,'yui-editor-panel');}else{Event.onDOMReady(function(){this.get('panel').render(document.body);Dom.addClass(this.get('panel').element,'yui-editor-panel');},this,true);}
+this.get('panel').showEvent.subscribe(function(){YAHOO.util.Dom.setStyle(this.element,'display','block');});return this.get('panel');},openWindow:function(win){this.toolbar.set('disabled',true);Event.addListener(document,'keypress',this._closeWindow,this,true);if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}
+YAHOO.widget.EditorInfo.window.win=win;YAHOO.widget.EditorInfo.window.scope=this;var self=this,xy=Dom.getXY(this.currentElement[0]),elXY=Dom.getXY(this.get('iframe').get('element')),panel=this.get('panel'),newXY=[(xy[0]+elXY[0]-20),(xy[1]+elXY[1]+10)],wWidth=(parseInt(win.attrs.width)/2),align='center';this.fireEvent('beforeOpenWindow',{type:'beforeOpenWindow',win:win,panel:panel});body=document.createElement('div');body.className=this.CLASS_PREFIX+'-body-cont';var _note=document.createElement('h3');_note.className='yui-editor-skipheader';_note.innerHTML=this.STR_CLOSE_WINDOW_NOTE;body.appendChild(_note);form=document.createElement('form');form.setAttribute('method','GET');var windowName=win.name;Event.addListener(form,'submit',function(ev){var evName='window'+windowName+'Submit';self.fireEvent(evName,{type:evName,target:this});Event.stopEvent(ev);},this,true);body.appendChild(form);Dom.setStyle(panel.element.firstChild,'width',win.attrs.width);if(Lang.isObject(win.body)){form.appendChild(win.body);}else{var _tmp=document.createElement('div');_tmp.innerHTML=win.body;form.appendChild(_tmp);}
+var _close=document.createElement('span');_close.innerHTML='X';_close.title=this.STR_CLOSE_WINDOW;_close.className='close';Event.addListener(_close,'click',function(){this.closeWindow();},this,true);var _knob=document.createElement('span');_knob.innerHTML='^';_knob.className='knob';win._knob=_knob;var _header=document.createElement('h3');_header.innerHTML=win.header;panel.cfg.setProperty('width',win.attrs.width);panel.setHeader(' ');panel.appendToHeader(_header);_header.appendChild(_close);_header.appendChild(_knob);panel.setBody(' ');panel.setFooter(' ');if(win.footer!=null){panel.setFooter(win.footer);}
+panel.appendToBody(body);panel.showEvent.subscribe(function(){Event.addListener(panel.element,'click',function(ev){Event.stopPropagation(ev);});},this,true);panel.hideEvent.subscribe(function(){this.currentWindow=null;var evName='window'+windowName+'Close';this.fireEvent(evName,{type:evName,target:this});},this,true);this.currentWindow=win;this.moveWindow(true);panel.show();this.fireEvent('afterOpenWindow',{type:'afterOpenWindow',win:win,panel:panel});},moveWindow:function(force){if(!this.currentWindow){return false;}
+var win=this.currentWindow,xy=Dom.getXY(this.currentElement[0]),elXY=Dom.getXY(this.get('iframe').get('element')),panel=this.get('panel'),newXY=[(xy[0]+elXY[0]),(xy[1]+elXY[1])],wWidth=(parseInt(win.attrs.width)/2),align='center',orgXY=panel.cfg.getProperty('xy'),_knob=win._knob;newXY[0]=((newXY[0]-wWidth)+20);newXY[0]=newXY[0]-Dom.getDocumentScrollLeft(this._getDoc());newXY[1]=newXY[1]-Dom.getDocumentScrollTop(this._getDoc());if(this.currentElement[0].tagName&&(this.currentElement[0].tagName.toLowerCase()=='img')){if(this.currentElement[0].src.indexOf(this.get('blankimage'))!=-1){newXY[0]=(newXY[0]+(75/2));newXY[1]=(newXY[1]+75);}else{var w=parseInt(this.currentElement[0].width);var h=parseInt(this.currentElement[0].height);newXY[0]=(newXY[0]+(w/2));newXY[1]=(newXY[1]+h);}
+newXY[1]=newXY[1]+15;}else{if(Dom.getStyle(this.currentElement[0],'fontSize').indexOf('px')!=-1){newXY[1]=newXY[1]+parseInt(Dom.getStyle(this.currentElement[0],'fontSize'))+5;}else{newXY[1]=newXY[1]+20;}}
+if(newXY[0]<elXY[0]){newXY[0]=elXY[0]+5;align='left';}
+if((newXY[0]+(wWidth*2))>(elXY[0]+parseInt(this.get('iframe').get('element').clientWidth))){newXY[0]=((elXY[0]+parseInt(this.get('iframe').get('element').clientWidth))-(wWidth*2)-5);align='right';}
+try{var xDiff=(newXY[0]-orgXY[0]);var yDiff=(newXY[1]-orgXY[1]);}catch(e){var xDiff=0;var yDiff=0;}
+xDiff=((xDiff<0)?(xDiff*-1):xDiff);yDiff=((yDiff<0)?(yDiff*-1):yDiff);if(((xDiff>10)||(yDiff>10))||force){var _knobLeft=0,elW=0;if(this.currentElement[0].width){elW=(parseInt(this.currentElement[0].width)/2);}
+var leftOffset=xy[0]+elXY[0]+elW;_knobLeft=leftOffset-newXY[0];if(_knobLeft>(parseInt(win.attrs.width)-40)){_knobLeft=parseInt(win.attrs.width)-40;}else if(_knobLeft<40){_knobLeft=40;}
+if(isNaN(_knobLeft)){_knobLeft=40;}
+if(force){if(_knob){_knob.style.left=_knobLeft+'px';}
+if(this.get('animate')){Dom.setStyle(panel.element,'opacity','0');var anim=new YAHOO.util.Anim(panel.element,{opacity:{from:0,to:1}},.1,YAHOO.util.Easing.easeOut);panel.cfg.setProperty('xy',newXY);anim.onComplete.subscribe(function(){if(this.browser.ie){panel.element.style.filter='none';}},this,true);anim.animate();}else{panel.cfg.setProperty('xy',newXY);}}else{if(this.get('animate')){var anim=new YAHOO.util.Anim(panel.element,{},.5,YAHOO.util.Easing.easeOut);anim.attributes={top:{to:newXY[1]},left:{to:newXY[0]}}
+anim.onComplete.subscribe(function(){panel.cfg.setProperty('xy',newXY);});var iframeAnim=new YAHOO.util.Anim(panel.iframe,anim.attributes,.5,YAHOO.util.Easing.easeOut)
+var _knobAnim=new YAHOO.util.Anim(_knob,{left:{to:_knobLeft}},.75,YAHOO.util.Easing.easeOut);anim.animate();iframeAnim.animate();_knobAnim.animate();}else{_knob.style.left=_knobLeft+'px';panel.cfg.setProperty('xy',newXY);}}}},_closeWindow:function(ev){if(ev.keyCode==27){if(this.currentWindow){this.closeWindow();}}},closeWindow:function(){YAHOO.widget.EditorInfo.window={};this.fireEvent('closeWindow',{type:'closeWindow',win:this.currentWindow});this.currentWindow=null;this.get('panel').hide();this.get('panel').cfg.setProperty('xy',[-900,-900]);this.get('panel').syncIframe();this.unsubscribeAll('afterExecCommand');this.toolbar.set('disabled',false);this._focusWindow();Event.removeListener(document,'keypress',this._closeWindow);},destroy:function(){this.saveHTML();this.toolbar.destroy();Dom.setStyle(this.get('textarea'),'display','block');var textArea=this.get('textarea');this.get('element_cont').get('parentNode').replaceChild(textArea,this.get('element_cont').get('element'));this.get('element_cont').get('element').innerHTML='';for(var i in this){if(Lang.hasOwnProperty(this,i)){this[i]=null;}}
+return true;},toString:function(){var str='Editor';if(this.get&&this.get('element_cont')){str='Editor (#'+this.get('element_cont').get('id')+')'+((this.get('disabled')?' Disabled':''));}
+return str;}});YAHOO.widget.EditorInfo={window:{},panel:null}
+YAHOO.widget.EditorWindow=function(name,attrs){this.name=name.replace(' ','_');this.attrs=attrs;}
+YAHOO.widget.EditorWindow.prototype={_cache:null,header:null,body:null,footer:null,setHeader:function(str){this.header=str;},setBody:function(str){this.body=str;},setFooter:function(str){this.footer=str;},toString:function(){return'Editor Window ('+this.name+')';}};})();YAHOO.register("editor",YAHOO.widget.Editor,{version:"2.3.0",build:"442"});
\ No newline at end of file
diff --git a/lib/yui/editor/editor-beta.js b/lib/yui/editor/editor-beta.js
new file mode 100755 (executable)
index 0000000..658a32b
--- /dev/null
@@ -0,0 +1,5164 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+*/
+/**
+ * @description <p>Creates a rich Toolbar widget based on Button. Primarily used with the Rich Text Editor</p>
+ * @class Toolbar
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event
+ * @optional container, menu, button, dragdrop
+ * @beta
+ */
+(function() {
+    /**
+    * @private
+    **/
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang;
+
+    /**
+     * Provides a rich toolbar widget based on the button and menu widgets
+     * @constructor
+     * @param {String/HTMLElement} el The element to turn into a toolbar.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    YAHOO.widget.Toolbar = function(el, attrs) {
+        
+        if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) {
+            var attrs = el;
+        }
+        var local_attrs = (attrs || {});
+
+        var oConfig = {
+            element: null,
+            attributes: local_attrs
+        }
+        
+        
+        if (Lang.isString(el) && Dom.get(el)) {
+            oConfig.element = Dom.get(el);
+        } else if (Lang.isObject(el) && Dom.get(el) && Dom.get(el).nodeType) {  
+            oConfig.element = Dom.get(el);
+        }
+        
+
+        if (!oConfig.element) {
+            oConfig.element = document.createElement('DIV');
+            oConfig.element.id = Dom.generateId();
+            
+            if (local_attrs.container && Dom.get(local_attrs.container)) {
+                Dom.get(local_attrs.container).appendChild(oConfig.element);
+            }
+        }
+        
+
+        if (!oConfig.element.id) {
+            oConfig.element.id = ((Lang.isString(el)) ? el : Dom.generateId());
+        }
+        
+        var cont = document.createElement('DIV');
+        oConfig.attributes.cont = cont;
+        Dom.addClass(cont, 'yui-toolbar-subcont')
+        oConfig.element.appendChild(cont);
+        
+        oConfig.attributes.element = oConfig.element;
+        oConfig.attributes.id = oConfig.element.id;
+
+        YAHOO.widget.Toolbar.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+        
+        
+    }
+
+    /**
+    * @method _addMenuClasses
+    * @private
+    * @description This method is called from Menu's renderEvent to add a few more classes to the menu items
+    * @param {String} ev The event that fired.
+    * @param {Array} na Array of event information.
+    * @param {Object} o Button config object. 
+    */
+
+    function _addMenuClasses(ev, na, o) {
+        Dom.addClass(this.element, 'yui-toolbar-' + o.get('value') + '-menu');
+        if (Dom.hasClass(o._button.parentNode.parentNode, 'yui-toolbar-select')) {
+            Dom.addClass(this.element, 'yui-toolbar-select-menu');
+        }
+        var items = this.getItems();
+        for (var i = 0; i < items.length; i++) {
+            Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-').toLowerCase() : items[i]._oText.nodeValue.replace(/ /g, '-').toLowerCase()));
+            Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-') : items[i]._oText.nodeValue.replace(/ /g, '-')));
+        }
+        this._setWidth();
+    };
+
+    YAHOO.extend(YAHOO.widget.Toolbar, YAHOO.util.Element, {
+        /** 
+        * @property dd
+        * @description The DragDrop instance associated with the Toolbar
+        * @type Object
+        */
+        dd: null,
+        /** 
+        * @property _colorData
+        * @description Object reference containing colors hex and text values.
+        * @type Object
+        */
+        _colorData: {
+/* {{{ _colorData */
+    '#111111': 'Obsidian',
+    '#2D2D2D': 'Dark Gray',
+    '#434343': 'Shale',
+    '#5B5B5B': 'Flint',
+    '#737373': 'Gray',
+    '#8B8B8B': 'Concrete',
+    '#A2A2A2': 'Gray',
+    '#B9B9B9': 'Titanium',
+    '#000000': 'Black',
+    '#D0D0D0': 'Light Gray',
+    '#E6E6E6': 'Silver',
+    '#FFFFFF': 'White',
+    '#BFBF00': 'Pumpkin',
+    '#FFFF00': 'Yellow',
+    '#FFFF40': 'Banana',
+    '#FFFF80': 'Pale Yellow',
+    '#FFFFBF': 'Butter',
+    '#525330': 'Raw Siena',
+    '#898A49': 'Mildew',
+    '#AEA945': 'Olive',
+    '#7F7F00': 'Paprika',
+    '#C3BE71': 'Earth',
+    '#E0DCAA': 'Khaki',
+    '#FCFAE1': 'Cream',
+    '#60BF00': 'Cactus',
+    '#80FF00': 'Chartreuse',
+    '#A0FF40': 'Green',
+    '#C0FF80': 'Pale Lime',
+    '#DFFFBF': 'Light Mint',
+    '#3B5738': 'Green',
+    '#668F5A': 'Lime Gray',
+    '#7F9757': 'Yellow',
+    '#407F00': 'Clover',
+    '#8A9B55': 'Pistachio',
+    '#B7C296': 'Light Jade',
+    '#E6EBD5': 'Breakwater',
+    '#00BF00': 'Spring Frost',
+    '#00FF80': 'Pastel Green',
+    '#40FFA0': 'Light Emerald',
+    '#80FFC0': 'Sea Foam',
+    '#BFFFDF': 'Sea Mist',
+    '#033D21': 'Dark Forrest',
+    '#438059': 'Moss',
+    '#7FA37C': 'Medium Green',
+    '#007F40': 'Pine',
+    '#8DAE94': 'Yellow Gray Green',
+    '#ACC6B5': 'Aqua Lung',
+    '#DDEBE2': 'Sea Vapor',
+    '#00BFBF': 'Fog',
+    '#00FFFF': 'Cyan',
+    '#40FFFF': 'Turquoise Blue',
+    '#80FFFF': 'Light Aqua',
+    '#BFFFFF': 'Pale Cyan',
+    '#033D3D': 'Dark Teal',
+    '#347D7E': 'Gray Turquoise',
+    '#609A9F': 'Green Blue',
+    '#007F7F': 'Seaweed',
+    '#96BDC4': 'Green Gray',
+    '#B5D1D7': 'Soapstone',
+    '#E2F1F4': 'Light Turquoise',
+    '#0060BF': 'Summer Sky',
+    '#0080FF': 'Sky Blue',
+    '#40A0FF': 'Electric Blue',
+    '#80C0FF': 'Light Azure',
+    '#BFDFFF': 'Ice Blue',
+    '#1B2C48': 'Navy',
+    '#385376': 'Biscay',
+    '#57708F': 'Dusty Blue',
+    '#00407F': 'Sea Blue',
+    '#7792AC': 'Sky Blue Gray',
+    '#A8BED1': 'Morning Sky',
+    '#DEEBF6': 'Vapor',
+    '#0000BF': 'Deep Blue',
+    '#0000FF': 'Blue',
+    '#4040FF': 'Cerulean Blue',
+    '#8080FF': 'Evening Blue',
+    '#BFBFFF': 'Light Blue',
+    '#212143': 'Deep Indigo',
+    '#373E68': 'Sea Blue',
+    '#444F75': 'Night Blue',
+    '#00007F': 'Indigo Blue',
+    '#585E82': 'Dockside',
+    '#8687A4': 'Blue Gray',
+    '#D2D1E1': 'Light Blue Gray',
+    '#6000BF': 'Neon Violet',
+    '#8000FF': 'Blue Violet',
+    '#A040FF': 'Violet Purple',
+    '#C080FF': 'Violet Dusk',
+    '#DFBFFF': 'Pale Lavender',
+    '#302449': 'Cool Shale',
+    '#54466F': 'Dark Indigo',
+    '#655A7F': 'Dark Violet',
+    '#40007F': 'Violet',
+    '#726284': 'Smoky Violet',
+    '#9E8FA9': 'Slate Gray',
+    '#DCD1DF': 'Violet White',
+    '#BF00BF': 'Royal Violet',
+    '#FF00FF': 'Fuchsia',
+    '#FF40FF': 'Magenta',
+    '#FF80FF': 'Orchid',
+    '#FFBFFF': 'Pale Magenta',
+    '#4A234A': 'Dark Purple',
+    '#794A72': 'Medium Purple',
+    '#936386': 'Cool Granite',
+    '#7F007F': 'Purple',
+    '#9D7292': 'Purple Moon',
+    '#C0A0B6': 'Pale Purple',
+    '#ECDAE5': 'Pink Cloud',
+    '#BF005F': 'Hot Pink',
+    '#FF007F': 'Deep Pink',
+    '#FF409F': 'Grape',
+    '#FF80BF': 'Electric Pink',
+    '#FFBFDF': 'Pink',
+    '#451528': 'Purple Red',
+    '#823857': 'Purple Dino',
+    '#A94A76': 'Purple Gray',
+    '#7F003F': 'Rose',
+    '#BC6F95': 'Antique Mauve',
+    '#D8A5BB': 'Cool Marble',
+    '#F7DDE9': 'Pink Granite',
+    '#C00000': 'Apple',
+    '#FF0000': 'Fire Truck',
+    '#FF4040': 'Pale Red',
+    '#FF8080': 'Salmon',
+    '#FFC0C0': 'Warm Pink',
+    '#441415': 'Sepia',
+    '#82393C': 'Rust',
+    '#AA4D4E': 'Brick',
+    '#800000': 'Brick Red',
+    '#BC6E6E': 'Mauve',
+    '#D8A3A4': 'Shrimp Pink',
+    '#F8DDDD': 'Shell Pink',
+    '#BF5F00': 'Dark Orange',
+    '#FF7F00': 'Orange',
+    '#FF9F40': 'Grapefruit',
+    '#FFBF80': 'Canteloupe',
+    '#FFDFBF': 'Wax',
+    '#482C1B': 'Dark Brick',
+    '#855A40': 'Dirt',
+    '#B27C51': 'Tan',
+    '#7F3F00': 'Nutmeg',
+    '#C49B71': 'Mustard',
+    '#E1C4A8': 'Pale Tan',
+    '#FDEEE0': 'Marble'
+/* }}} */
+        },
+        /** 
+        * @property _colorPicker
+        * @description The HTML Element containing the colorPicker
+        * @type HTMLElement
+        */
+        _colorPicker: null,
+        /** 
+        * @property STR_COLLAPSE
+        * @description String for Toolbar Collapse Button
+        * @type String
+        */
+        STR_COLLAPSE: 'Collapse Toolbar',
+        /** 
+        * @property STR_SPIN_LABEL
+        * @description String for spinbutton dynamic label. Note the {VALUE} will be replaced with YAHOO.lang.substitute
+        * @type String
+        */
+        STR_SPIN_LABEL: 'Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.',
+        /** 
+        * @property STR_SPIN_UP
+        * @description String for spinbutton up
+        * @type String
+        */
+        STR_SPIN_UP: 'Click to increase the value of this input',
+        /** 
+        * @property STR_SPIN_DOWN
+        * @description String for spinbutton down
+        * @type String
+        */
+        STR_SPIN_DOWN: 'Click to decrease the value of this input',
+        /** 
+        * @property _titlebar
+        * @description Object reference to the titlebar
+        * @type HTMLElement
+        */
+        _titlebar: null,
+        /** 
+        * @property _disabled
+        * @description Object to track button status when enabling/disabling the toolbar
+        * @type Object
+        */
+        _disabled: null,
+        /** 
+        * @property browser
+        * @description Standard browser detection
+        * @type Object
+        */
+        browser: YAHOO.env.ua,
+        /**
+        * @protected
+        * @property _buttonList
+        * @description Internal property list of current buttons in the toolbar
+        * @type Array
+        */
+        _buttonList: null,
+        /**
+        * @protected
+        * @property _buttonGroupList
+        * @description Internal property list of current button groups in the toolbar
+        * @type Array
+        */
+        _buttonGroupList: null,
+        /**
+        * @protected
+        * @property _sep
+        * @description Internal reference to the separator HTML Element for cloning
+        * @type HTMLElement
+        */
+        _sep: null,
+        /**
+        * @protected
+        * @property _sepCount
+        * @description Internal refernce for counting separators, so we can give them a useful class name for styling
+        * @type Number
+        */
+        _sepCount: null,
+        /**
+        * @protected
+        * @property draghandle
+        * @type HTMLElement
+        */
+        _dragHandle: null,
+        /**
+        * @protected
+        * @property _toolbarConfigs
+        * @type Object
+        */
+        _toolbarConfigs: {
+            renderer: true
+        },
+        /**
+        * @protected
+        * @property CLASS_CONTAINER
+        * @description Default CSS class to apply to the toolbar container element
+        * @type String
+        */
+        CLASS_CONTAINER: 'yui-toolbar-container',
+        /**
+        * @protected
+        * @property CLASS_DRAGHANDLE
+        * @description Default CSS class to apply to the toolbar's drag handle element
+        * @type String
+        */
+        CLASS_DRAGHANDLE: 'yui-toolbar-draghandle',
+        /**
+        * @protected
+        * @property CLASS_SEPARATOR
+        * @description Default CSS class to apply to all separators in the toolbar
+        * @type String
+        */
+        CLASS_SEPARATOR: 'yui-toolbar-separator',
+        /**
+        * @protected
+        * @property CLASS_DISABLED
+        * @description Default CSS class to apply when the toolbar is disabled
+        * @type String
+        */
+        CLASS_DISABLED: 'yui-toolbar-disabled',
+        /**
+        * @protected
+        * @property CLASS_PREFIX
+        * @description Default prefix for dynamically created class names
+        * @type String
+        */
+        CLASS_PREFIX: 'yui-toolbar',
+        /** 
+        * @method init
+        * @description The Toolbar class's initialization method
+        */
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.widget.Toolbar.superclass.init.call(this, p_oElement, p_oAttributes);
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the toolbar.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the toolbar.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.Toolbar.superclass.initAttributes.call(this, attr);
+            var el = this.get('element');
+            this.addClass(this.CLASS_CONTAINER);
+
+
+            /**
+            * @config buttons
+            * @description Object specifying the buttons to include in the toolbar
+            * Example:
+            * <code><pre>
+            * {
+            *   { id: 'b3', type: 'button', label: 'Underline', value: 'underline' },
+            *   { type: 'separator' },
+            *   { id: 'b4', type: 'menu', label: 'Align', value: 'align',
+            *       menu: [
+            *           { text: "Left", value: 'alignleft' },
+            *           { text: "Center", value: 'aligncenter' },
+            *           { text: "Right", value: 'alignright' }
+            *       ]
+            *   }
+            * }
+            * </pre></code>
+            * @type Object
+            */
+            
+            this.setAttributeConfig('buttons', {
+                value: [],
+                writeOnce: true,
+                method: function(data) {
+                    for (var i in data) {
+                        if (Lang.hasOwnProperty(data, i)) {
+                            if (data[i].type == 'separator') {
+                                this.addSeparator();
+                            } else if (data[i].group != undefined) {
+                                this.addButtonGroup(data[i]);
+                            } else {
+                                this.addButton(data[i]);
+                            }
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @config disabled
+            * @description Boolean indicating if the toolbar should be disabled. It will also disable the draggable attribute if it is on.
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('disabled', {
+                value: false,
+                method: function(disabled) {
+                    if (!Lang.isObject(this._disabled)) {
+                        this._disabled = {};
+                    }
+                    if (disabled) {
+                        this.addClass(this.CLASS_DISABLED);
+                        this.set('draggable', false);
+                    } else {
+                        this.removeClass(this.CLASS_DISABLED);
+                        if (this._configs.draggable._initialConfig.value) {
+                            //Draggable by default, set it back
+                            this.set('draggable', true);
+                        }
+                    }
+                    var len = this._buttonList.length;
+                    for (var i = 0; i < len; i++) {
+                        if (disabled) {
+                            //If it's already disabled, flag it
+                            if (this._buttonList[i].get('disabled')) {
+                                this._disabled[i] = true;
+                            } else {
+                                this._disabled[i] = null;
+                            }
+                            this.disableButton(this._buttonList[i].get('id'));
+                        } else {
+                            //Check to see if it was disabled by default and skip it
+                            var _button = this._buttonList[i];
+                            var _check = _button._configs.disabled._initialConfig.value;
+                            if (this._disabled[i]) {
+                                _check = true;
+                            }
+                            if (!_check) {
+                                this.enableButton(_button.get('id'));
+                            }
+                        }
+                    }
+                }
+            });
+
+            /**
+            * @config grouplabels
+            * @description Boolean indicating if the toolbar should show the group label's text string.
+            * @default true
+            * @type Boolean
+            */
+            this.setAttributeConfig('grouplabels', {
+                value: true,
+                writeOnce: true
+            });
+
+            /**
+            * @config cont
+            * @description Boolean indicating if the toolbar should show the group label's text string.
+            * @default true
+            * @type Boolean
+            */
+            this.setAttributeConfig('cont', {
+                value: attr.cont,
+                readOnly: true
+            });
+
+            /**
+            * @config collapse
+            * @description Boolean indicating if the the titlebar should have a collapse button.
+            * The collapse button will not remove the toolbar, it will minimize it to the titlebar
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('collapse', {
+                value: false
+            });
+            /**
+            * @config titlebar
+            * @description Boolean indicating if the toolbar should have a titlebar. If
+            * passed a string, it will use that as the titlebar text
+            * @default false
+            * @type Boolean or String
+            */
+            this.setAttributeConfig('titlebar', {
+                value: false,
+                method: function(titlebar) {
+                    if (titlebar) {
+                        if (this._titlebar && this._titlebar.parentNode) {
+                            this._titlebar.parentNode.removeChild(this._titlebar);
+                        }
+                        this._titlebar = document.createElement('DIV');
+                        Dom.addClass(this._titlebar, this.CLASS_PREFIX + '-titlebar');
+                        if (Lang.isString(titlebar)) {
+                            var h2 = document.createElement('h2');
+                            h2.tabIndex = '-1';
+                            h2.innerHTML = titlebar;
+                            this._titlebar.appendChild(h2);
+                        }
+                        if (this.get('collapse')) {
+                            var collapse = document.createElement('SPAN');
+                            collapse.innerHTML = 'X';
+                            collapse.title = this.STR_COLLAPSE;
+
+                            Dom.addClass(collapse, 'collapse');
+                            this._titlebar.appendChild(collapse);
+                            Event.addListener(collapse, 'click', function() {
+                                if (Dom.getStyle(this.get('cont'), 'display') == 'none') {
+                                    Dom.setStyle(this.get('cont'), 'display', 'block');
+                                    Dom.removeClass(collapse, 'collapsed');
+                                    this.fireEvent('toolbarExpanded', { type: 'toolbarExpanded', target: this });
+                                } else {
+                                    Dom.setStyle(this.get('cont'), 'display', 'none');
+                                    Dom.addClass(collapse, 'collapsed');
+                                    this.fireEvent('toolbarCollapsed', { type: 'toolbarCollapsed', target: this });
+                                }
+                            }, this, true);
+                        }
+                        if (this.get('draggable')) {
+                            this.dd = new YAHOO.util.DD(this.get('id'));
+                            this.dd.setHandleElId(this._titlebar);
+                            Dom.addClass(this._titlebar, 'draggable');
+                        }
+                        if (this.get('firstChild')) {
+                            this.insertBefore(this._titlebar, this.get('firstChild'));
+                        } else {
+                            this.appendChild(this._titlebar);
+                        }
+                    } else if (this._titlebar) {
+                        if (this._titlebar && this._titlebar.parentNode) {
+                            this._titlebar.parentNode.removeChild(this._titlebar);
+                        }
+                    }
+                }
+            });
+
+
+            /**
+            * @config draggable
+            * @description Boolean indicating if the toolbar should be draggable.  
+            * @default false
+            * @type Boolean
+            */
+
+            this.setAttributeConfig('draggable', {
+                value: (attr.draggable || false),
+                method: function(draggable) {
+                    var el = this.get('element');
+
+                    if (draggable && !this.get('titlebar')) {
+                        if (!this._dragHandle) {
+                            this._dragHandle = document.createElement('SPAN');
+                            this._dragHandle.innerHTML = '|';
+                            this._dragHandle.setAttribute('title', 'Click to drag the toolbar');
+                            this._dragHandle.id = this.get('id') + '_draghandle';
+                            Dom.addClass(this._dragHandle, this.CLASS_DRAGHANDLE);
+                            if (this.get('cont').hasChildNodes()) {
+                                this.get('cont').insertBefore(this._dragHandle, this.get('cont').firstChild);
+                            } else {
+                                this.get('cont').appendChild(this._dragHandle);
+                            }
+                            /**
+                            * @property dd
+                            * @description The DragDrop instance associated with the Toolbar
+                            * @type Object
+                            */
+                            this.dd = new YAHOO.util.DD(this.get('id'));
+                            this.dd.setHandleElId(this._dragHandle.id);
+                            
+                        }
+                    } else {
+                        if (this._dragHandle) {
+                            this._dragHandle.parentNode.removeChild(this._dragHandle);
+                            this._dragHandle = null;
+                            this.dd = null;
+                        }
+                    }
+                    if (this._titlebar) {
+                        if (draggable) {
+                            this.dd = new YAHOO.util.DD(this.get('id'));
+                            this.dd.setHandleElId(this._titlebar);
+                            Dom.addClass(this._titlebar, 'draggable');
+                        } else {
+                            Dom.removeClass(this._titlebar, 'draggable');
+                            if (this.dd) {
+                                this.dd.unreg();
+                                this.dd = null;
+                            }
+                        }
+                    }
+                },
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.util.DD) {
+                        ret = false;
+                    }
+                    return ret;
+                }
+            });
+
+        },
+        /**
+        * @method addButtonGroup
+        * @description Add a new button group to the toolbar. (uses addButton)
+        * @param {Object} oGroup Object literal reference to the Groups Config (contains an array of button configs)
+        */
+        addButtonGroup: function(oGroup) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addButtonGroup', arguments];
+                return false;
+            }
+            
+            if (!this.hasClass(this.CLASS_PREFIX + '-grouped')) {
+                this.addClass(this.CLASS_PREFIX + '-grouped');
+            }
+            var div = document.createElement('DIV');
+            Dom.addClass(div, this.CLASS_PREFIX + '-group');
+            Dom.addClass(div, this.CLASS_PREFIX + '-group-' + oGroup.group);
+            if (oGroup.label && this.get('grouplabels')) {
+                var label = document.createElement('h3');
+                label.innerHTML = oGroup.label;
+                div.appendChild(label);
+            }
+
+            this.get('cont').appendChild(div);
+
+            //For accessibility, let's put all of the group buttons in an Unordered List
+            var ul = document.createElement('ul');
+            div.appendChild(ul);
+
+            if (!this._buttonGroupList) {
+                this._buttonGroupList = {};
+            }
+            
+            this._buttonGroupList[oGroup.group] = ul;
+
+            for (var i = 0; i < oGroup.buttons.length; i++) {
+                var li = document.createElement('li');
+                ul.appendChild(li);
+                if ((oGroup.buttons[i].type != undefined) && oGroup.buttons[i].type == 'separator') {
+                    this.addSeparator(li);
+                } else {
+                    oGroup.buttons[i].container = li;
+                    this.addButton(oGroup.buttons[i]);
+                }
+            }
+        },
+        /**
+        * @method addButtonToGroup
+        * @description Add a new button to a toolbar group. Buttons supported:
+        *   push, split, menu, select, color, spin
+        * @param {Object} oButton Object literal reference to the Button's Config
+        * @param {String} group The Group identifier passed into the initial config
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addButtonToGroup: function(oButton, group, after) {
+            var groupCont = this._buttonGroupList[group];
+            var li = document.createElement('li');
+            oButton.container = li;
+            this.addButton(oButton, after);
+            groupCont.appendChild(li);
+        },
+        /**
+        * @method addButton
+        * @description Add a new button to the toolbar. Buttons supported:
+        *   push, split, menu, select, color, spin
+        * @param {Object} oButton Object literal reference to the Button's Config
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addButton: function(oButton, after) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addButton', arguments];
+                return false;
+            }
+            if (!this._buttonList) {
+                this._buttonList = [];
+            }
+            //Add to .get('buttons') manually
+            this._configs.buttons.value[this._configs.buttons.value.length] = oButton;
+            if (!oButton.container) {
+                oButton.container = this.get('cont');
+            }
+
+            if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
+                if (Lang.isArray(oButton.menu)) {
+                    for (var i in oButton.menu) {
+                        if (Lang.hasOwnProperty(oButton.menu, i)) {
+                            var funcObject = {
+                                fn: function(ev, x, oMenu) {
+                                    if (!oButton.menucmd) {
+                                        oButton.menucmd = oButton.value;
+                                    }
+                                    oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
+                                    //This line made Opera fire the click event and the mousedown,
+                                    //  so events for menus where firing twice.
+                                    //this._buttonClick('click', oButton);
+                                },
+                                scope: this
+                            }
+                            oButton.menu[i].onclick = funcObject;
+                        }
+                    }
+                }
+            }
+            var _oButton = {};
+            for (var i in oButton) {
+                if (Lang.hasOwnProperty(oButton, i)) {
+                    if (!this._toolbarConfigs[i]) {
+                        _oButton[i] = oButton[i];
+                    }
+                }
+            }
+            if (oButton.type == 'select') {
+                _oButton.type = 'menu';
+            }
+            if (oButton.type == 'spin') {
+                _oButton.type = 'push';
+            }
+            if (_oButton.type == 'color') {
+                _oButton = this._makeColorButton(_oButton);
+            }
+            if (_oButton.menu) {
+                if (oButton.menu instanceof YAHOO.widget.Overlay) {
+                    oButton.menu.showEvent.subscribe(function() {
+                        this._button = _oButton;
+                    });
+                } else {
+                    for (var i = 0; i < _oButton.menu.length; i++) {
+                        if (!_oButton.menu[i].value) {
+                            _oButton.menu[i].value = _oButton.menu[i].text;
+                        }
+                    }
+                    if (this.browser.webkit) {
+                        _oButton.focusmenu = false;
+                    }
+                }
+            }
+            var tmp = new YAHOO.widget.Button(_oButton);
+            if (this.get('disabled')) {
+                //Toolbar is disabled, disable the new button too!
+                tmp.set('disabled', true);
+            }
+            if (!oButton.id) {
+                oButton.id = tmp.get('id');
+            }
+            
+            if (after) {
+                var el = tmp.get('element');
+                var nextSib = null;
+                if (after.get) {
+                    nextSib = after.get('element').nextSibling;
+                } else if (after.nextSibling) {
+                    nextSib = after.nextSibling;
+                }
+                if (nextSib) {
+                    nextSib.parentNode.insertBefore(el, nextSib);
+                }
+            }
+            tmp.addClass(this.CLASS_PREFIX + '-' + tmp.get('value'));
+            var icon = document.createElement('span');
+            icon.className = this.CLASS_PREFIX + '-icon';
+            tmp.get('element').insertBefore(icon, tmp.get('firstChild'));
+            //Replace the Button HTML Element with an a href
+            var a = document.createElement('a');
+            a.innerHTML = tmp._button.innerHTML;
+            a.href = '#';
+            Event.on(a, 'click', function(ev) {
+                Event.stopEvent(ev);
+            });
+            tmp._button.parentNode.replaceChild(a, tmp._button);
+            tmp._button = a;
+
+            if (oButton.type == 'select') {
+                tmp.addClass(this.CLASS_PREFIX + '-select');
+            }
+            if (oButton.type == 'spin') {
+                if (!Lang.isArray(oButton.range)) {
+                    oButton.range = [ 10, 100 ];
+                }
+                this._makeSpinButton(tmp, oButton);
+            }
+
+            tmp.get('element').setAttribute('title', tmp.get('label'));
+
+            if (oButton.type != 'spin') {
+                if (_oButton.menu instanceof YAHOO.widget.Overlay) {
+                    var showPicker = function(ev) {
+                        var exec = true;
+                        if (ev.keyCode && (ev.keyCode == 9)) {
+                            exec = false;
+                        }
+                        if (exec) {
+                            this._colorPicker._button = oButton.value;
+                            var menuEL = tmp.getMenu().element;
+                            if (menuEL.style.visibility == 'hidden') {
+                                tmp.getMenu().show();
+                            } else {
+                                tmp.getMenu().hide();
+                            }
+                        }
+                        YAHOO.util.Event.stopEvent(ev);
+                    };
+                    tmp.on('mousedown', showPicker, oButton, this);
+                    tmp.on('keydown', showPicker, oButton, this);
+                    
+                } else if ((oButton.type != 'menu') && (oButton.type != 'select')) {
+                    tmp.on('keypress', this._buttonClick, oButton, this);
+                    tmp.on('mousedown', function(ev) {
+                        this._buttonClick(ev, oButton);
+                        YAHOO.util.Event.stopEvent(ev);
+                    }, oButton, this);
+                } else {
+                    //Stop the mousedown event so we can trap the selection in the editor!
+                    tmp.on('mousedown', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    });
+                    tmp.on('click', function(ev) {
+                        YAHOO.util.Event.stopEvent(ev);
+                    });
+                    var self = this;
+                    //Hijack the mousedown event in the menu and make it fire a button click..
+                    tmp.getMenu().mouseDownEvent.subscribe(function(ev, args) {
+                        var oMenu = args[1];
+                        YAHOO.util.Event.stopEvent(args[0]);
+                        tmp._onMenuClick(args[0], tmp);
+                        if (!oButton.menucmd) {
+                            oButton.menucmd = oButton.value;
+                        }
+                        oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue);
+                        self._buttonClick.call(self, args[1], oButton);
+                        tmp._hideMenu();
+                        return false;
+                    });
+                    tmp.getMenu().clickEvent.subscribe(function(ev, args) {
+                        YAHOO.util.Event.stopEvent(args[0]);
+                    });
+                }
+            } else {
+                //Stop the mousedown event so we can trap the selection in the editor!
+                tmp.on('mousedown', function(ev) {
+                    YAHOO.util.Event.stopEvent(ev);
+                });
+                tmp.on('click', function(ev) {
+                    YAHOO.util.Event.stopEvent(ev);
+                });
+            }
+            if (this.browser.ie) {
+                //Add a couple of new events for IE
+                tmp.DOM_EVENTS.focusin = true;
+                tmp.DOM_EVENTS.focusout = true;
+                
+                //Stop them so we don't loose focus in the Editor
+                tmp.on('focusin', function(ev) {
+                    YAHOO.util.Event.stopEvent(ev);
+                }, oButton, this);
+                
+                tmp.on('focusout', function(ev) {
+                    YAHOO.util.Event.stopEvent(ev);
+                }, oButton, this);
+                tmp.on('click', function(ev) {
+                    YAHOO.util.Event.stopEvent(ev);
+                }, oButton, this);
+            }
+            if (this.browser.webkit) {
+                //This will keep the document from gaining focus and the editor from loosing it..
+                //Forcefully remove the focus calls in button!
+                tmp.hasFocus = function() {
+                    return true;
+                }
+            }
+            this._buttonList[this._buttonList.length] = tmp;
+            if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) {
+                if (Lang.isArray(oButton.menu)) {
+                    var menu = tmp.getMenu();
+                    menu.renderEvent.subscribe(_addMenuClasses, tmp);
+                    if (oButton.renderer) {
+                        menu.renderEvent.subscribe(oButton.renderer, tmp);
+                    }
+                }
+            }
+            return oButton;
+        },
+        /**
+        * @method addSeparator
+        * @description Add a new button separator to the toolbar.
+        * @param {HTMLElement} cont Optional HTML element to insert this button into.
+        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.
+        */
+        addSeparator: function(cont, after) {
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addSeparator', arguments];
+                return false;
+            }
+            var sepCont = ((cont) ? cont : this.get('cont'));
+            if (!this.get('element')) {
+                this._queue[this._queue.length] = ['addSeparator', arguments];
+                return false;
+            }
+            if (this._sepCount == null) {
+                this._sepCount = 0;
+            }
+            if (!this._sep) {
+                this._sep = document.createElement('SPAN');
+                Dom.addClass(this._sep, this.CLASS_SEPARATOR);
+                this._sep.innerHTML = '|';
+            }
+            var _sep = this._sep.cloneNode(true);
+            this._sepCount++;
+            Dom.addClass(_sep, this.CLASS_SEPARATOR + '-' + this._sepCount);
+            if (after) {
+                var nextSib = null;
+                if (after.get) {
+                    nextSib = after.get('element').nextSibling;
+                } else if (after.nextSibling) {
+                    nextSib = after.nextSibling;
+                } else {
+                    nextSib = after;
+                }
+                if (nextSib) {
+                    if (nextSib == after) {
+                        nextSib.parentNode.appendChild(_sep);
+                    } else {
+                        nextSib.parentNode.insertBefore(_sep, nextSib);
+                    }
+                }
+            } else {
+                sepCont.appendChild(_sep);
+            }
+            return _sep;
+        },
+        /**
+        * @method _createColorPicker
+        * @private
+        * @description Creates the core DOM reference to the color picker menu item.
+        * @param {String} id the id of the toolbar to prefix this DOM container with.
+        */
+        _createColorPicker: function(id) {
+            if (Dom.get(id + '_colors')) {
+               Dom.get(id + '_colors').parentNode.removeChild(Dom.get(id + '_colors'));
+            }
+            var picker = document.createElement('div');
+            picker.className = 'yui-toolbar-colors';
+            picker.id = id + '_colors';
+            picker.style.display = 'none';
+            Event.on(window, 'load', function() {
+                document.body.appendChild(picker);
+            }, this, true);
+
+            this._colorPicker = picker;
+
+            var html = '';
+            for (var i in this._colorData) {
+                if (Lang.hasOwnProperty(this._colorData, i)) {
+                    html += '<a style="background-color: ' + i + '" href="#">' + i.replace('#', '') + '</a>';
+                }
+            }
+            html += '<span><em>X</em><strong></strong></span>';
+            picker.innerHTML = html;
+            var em = picker.getElementsByTagName('em')[0];
+            var strong = picker.getElementsByTagName('strong')[0];
+
+            Event.on(picker, 'mouseover', function(ev) {
+                var tar = Event.getTarget(ev);
+                if (tar.tagName.toLowerCase() == 'a') {
+                    em.style.backgroundColor = tar.style.backgroundColor;
+                    strong.innerHTML = this._colorData['#' + tar.innerHTML] + '<br>' + tar.innerHTML;
+                }
+            }, this, true);
+            Event.on(picker, 'focus', function(ev) {
+                Event.stopEvent(ev);
+            });
+            Event.on(picker, 'click', function(ev) {
+                Event.stopEvent(ev);
+            });
+            Event.on(picker, 'mousedown', function(ev) {
+                Event.stopEvent(ev);
+                var tar = Event.getTarget(ev);
+                if (tar.tagName.toLowerCase() == 'a') {
+                    this.fireEvent('colorPickerClicked', { type: 'colorPickerClicked', target: this, button: this._colorPicker._button, color: tar.innerHTML, colorName: this._colorData['#' + tar.innerHTML] } );
+                    this.getButtonByValue(this._colorPicker._button).getMenu().hide();
+                }
+            }, this, true);
+        },
+        /**
+        * @method _resetColorPicker
+        * @private
+        * @description Clears the currently selected color or mouseover color in the color picker.
+        */
+        _resetColorPicker: function() {
+            var em = this._colorPicker.getElementsByTagName('em')[0];
+            var strong = this._colorPicker.getElementsByTagName('strong')[0];
+            em.style.backgroundColor = 'transparent';
+            strong.innerHTML = '';
+        },
+        /**
+        * @method _makeColorButton
+        * @private
+        * @description Called to turn a "color" button into a menu button with an Overlay for the menu.
+        * @param {Object} _oButton <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> reference
+        */
+        _makeColorButton: function(_oButton) {
+            if (!this._colorPicker) {   
+                this._createColorPicker(this.get('id'));
+            }
+            _oButton.type = 'color';
+            _oButton.menu = new YAHOO.widget.Overlay(this.get('id') + '_' + _oButton.value + '_menu', { visbile: false, position: 'absolute' });
+            _oButton.menu.setBody('');
+            _oButton.menu.render(this.get('cont'));
+            _oButton.menu.beforeShowEvent.subscribe(function() {
+                _oButton.menu.cfg.setProperty('zindex', 5); //Re Adjust the overlays zIndex.. not sure why.
+                _oButton.menu.cfg.setProperty('context', [this.getButtonById(_oButton.id).get('element'), 'tl', 'bl']); //Re Adjust the overlay.. not sure why.
+                //Move the DOM reference of the color picker to the Overlay that we are about to show.
+                this._resetColorPicker();
+                var _p = this._colorPicker;
+                if (_p.parentNode) {
+                    //if (_p.parentNode != _oButton.menu.body) {
+                        _p.parentNode.removeChild(_p);
+                    //}
+                }
+                _oButton.menu.setBody('');
+                _oButton.menu.appendToBody(_p);
+                this._colorPicker.style.display = 'block';
+            }, this, true);
+            return _oButton;
+        },
+        /**
+        * @private
+        * @method _makeSpinButton
+        * @description Create a button similar to an OS Spin button.. It has an up/down arrow combo to scroll through a range of int values.
+        * @param {Object} _button <a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> reference
+        * @param {Object} oButton Object literal containing the buttons initial config
+        */
+        _makeSpinButton: function(_button, oButton) {
+            _button.addClass(this.CLASS_PREFIX + '-spinbutton');
+            var self = this,
+                _par = _button._button.parentNode.parentNode, //parentNode of Button Element for appending child
+                range = oButton.range,
+                _b1 = document.createElement('a'),
+                _b2 = document.createElement('a');
+                _b1.href = '#';
+                _b2.href = '#';
+            
+            //Setup the up and down arrows
+            _b1.className = 'up';
+            _b1.title = this.STR_SPIN_UP;
+            _b1.innerHTML = this.STR_SPIN_UP;
+            _b2.className = 'down';
+            _b2.title = this.STR_SPIN_DOWN;
+            _b2.innerHTML = this.STR_SPIN_DOWN;
+
+            //Append them to the container
+            _par.appendChild(_b1);
+            _par.appendChild(_b2);
+            
+            var label = YAHOO.lang.substitute(this.STR_SPIN_LABEL, { VALUE: _button.get('label') });
+            _button.set('title', label);
+
+            var cleanVal = function(value) {
+                value = ((value < range[0]) ? range[0] : value);
+                value = ((value > range[1]) ? range[1] : value);
+                return value;
+            };
+
+            var br = this.browser;
+            var tbar = false;
+            var strLabel = this.STR_SPIN_LABEL;
+            if (this._titlebar && this._titlebar.firstChild) {
+                tbar = this._titlebar.firstChild;
+            }
+            
+            var _intUp = function(ev) {
+                YAHOO.util.Event.stopEvent(ev);
+                if (!_button.get('disabled') && (ev.keyCode != 9)) {
+                    var value = parseInt(_button.get('label'));
+                    value++;
+                    value = cleanVal(value);
+                    _button.set('label', ''+value);
+                    var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') });
+                    _button.set('title', label);
+                    if (!br.webkit && tbar) {
+                        //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed
+                        //_button.focus();
+                    }
+                    self._buttonClick(ev, oButton);
+                }
+            };
+
+            var _intDown = function(ev) {
+                YAHOO.util.Event.stopEvent(ev);
+                if (!_button.get('disabled') && (ev.keyCode != 9)) {
+                    var value = parseInt(_button.get('label'));
+                    value--;
+                    value = cleanVal(value);
+
+                    _button.set('label', ''+value);
+                    var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') });
+                    _button.set('title', label);
+                    if (!br.webkit && tbar) {
+                        //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed
+                        //_button.focus();
+                    }
+                    self._buttonClick(ev, oButton);
+                }
+            };
+
+            var _intKeyUp = function(ev) {
+                if (ev.keyCode == 38) {
+                    _intUp(ev);
+                } else if (ev.keyCode == 40) {
+                    _intDown(ev);
+                } else if (ev.keyCode == 107 && ev.shiftKey) {  //Plus Key
+                    _intUp(ev);
+                } else if (ev.keyCode == 109 && ev.shiftKey) {  //Minus Key
+                    _intDown(ev);
+                }
+            };
+
+            //Handle arrow keys..
+            _button.on('keydown', _intKeyUp, this, true);
+
+            //Listen for the click on the up button and act on it
+            //Listen for the click on the down button and act on it
+            Event.on(_b1, 'mousedown',function(ev) {
+                Event.stopEvent(ev);
+            }, this, true);
+            Event.on(_b2, 'mousedown', function(ev) {
+                Event.stopEvent(ev);
+            }, this, true);
+            Event.on(_b1, 'click', _intUp, this, true);
+            Event.on(_b2, 'click', _intDown, this, true);
+        },
+        /**
+        * @protected
+        * @method _buttonClick
+        * @description Click handler for all buttons in the toolbar.
+        * @param {String} ev The event that was passed in.
+        * @param {Object} info Object literal of information about the button that was clicked.
+        */
+        _buttonClick: function(ev, info) {
+            var doEvent = true;
+            
+            if (ev && ev.type == 'keypress') {
+                if (ev.keyCode == 9) {
+                    doEvent = false;
+                } else if ((ev.keyCode == 13) || (ev.keyCode == 0) || (ev.keyCode == 32)) {
+                } else {
+                    doEvent = false;
+                }
+            }
+
+            if (doEvent) {
+                if (info.value) {
+                    this.fireEvent(info.value + 'Click', { type: info.value + 'Click', target: this.get('element'), button: info });
+                }
+                
+                if (info.menucmd) {
+                    this.fireEvent(info.menucmd + 'Click', { type: info.menucmd + 'Click', target: this.get('element'), button: info });
+                }
+                
+                this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info });
+
+                if (info.type == 'select') {
+                    var button = this.getButtonById(info.id);
+                    var txt = info.value;
+                    for (var i = 0; i < info.menu.length; i++) {
+                        if (info.menu[i].value == info.value) {
+                            txt = info.menu[i].text;
+                            break;
+                        }
+                    }
+                    button.set('label', '<span class="yui-toolbar-' + info.menucmd + '-' + (info.value).replace(/ /g, '-').toLowerCase() + '">' + txt + '</span>');
+                    var _items = button.getMenu().getItems();
+                    for (var m = 0; m < _items.length; m++) {
+                        if (_items[m].value.toLowerCase() == info.value.toLowerCase()) {
+                            _items[m].cfg.setProperty('checked', true);
+                        } else {
+                            _items[m].cfg.setProperty('checked', false);
+                        }
+                    }
+                }
+            }
+            if (ev) {
+                Event.stopEvent(ev);
+            }
+        },
+        /**
+        * @method getButtonById
+        * @description Gets a button instance from the toolbar by is Dom id.
+        * @param {String} id The Dom id to query for.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        */
+        getButtonById: function(id) {
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                if (this._buttonList[i].get('id') == id) {
+                    return this._buttonList[i];
+                }
+            }
+            return false;
+        },
+        /**
+        * @method getButtonByValue
+        * @description Gets a button instance or a menuitem instance from the toolbar by it's value.
+        * @param {String} value The button value to query for.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a> or <a href="YAHOO.widget.MenuItem.html">YAHOO.widget.MenuItem</a>}
+        */
+        getButtonByValue: function(value) {
+            var _buttons = this.get('buttons');
+            var len = _buttons.length;
+            for (var i = 0; i < len; i++) {
+                if (_buttons[i].group != undefined) {
+                    for (var m = 0; m < _buttons[i].buttons.length; m++) {
+                        if ((_buttons[i].buttons[m].value == value) || (_buttons[i].buttons[m].menucmd == value)) {
+                            return this.getButtonById(_buttons[i].buttons[m].id);
+                        }
+                        if (_buttons[i].buttons[m].menu) { //Menu Button, loop through the values
+                            for (var s = 0; s < _buttons[i].buttons[m].menu.length; s++) {
+                                if (_buttons[i].buttons[m].menu[s].value == value) {
+                                    return this.getButtonById(_buttons[i].buttons[m].id);
+                                }
+                            }
+                        }
+                    }
+                } else {
+                    if ((_buttons[i].value == value) || (_buttons[i].menucmd == value)) {
+                        return this.getButtonById(_buttons[i].id);
+                    }
+                    if (_buttons[i].menu) { //Menu Button, loop through the values
+                        for (var s = 0; s < _buttons[i].menu.length; s++) {
+                            if (_buttons[i].menu[s].value == value) {
+                                return this.getButtonById(_buttons[i].id);
+                            }
+                        }
+                    }
+                }
+            }
+            return false;
+        },
+        /**
+        * @method getButtonByIndex
+        * @description Gets a button instance from the toolbar by is index in _buttonList.
+        * @param {Number} index The index of the button in _buttonList.
+        * @return {<a href="YAHOO.widget.Button.html">YAHOO.widget.Button</a>}
+        */
+        getButtonByIndex: function(index) {
+            if (this._buttonList[index]) {
+                return this._buttonList[index];
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method getButtons
+        * @description Returns an array of buttons in the current toolbar
+        * @return {Array}
+        */
+        getButtons: function() {
+            return this._buttonList;
+        },
+        /**
+        * @method disableButton
+        * @description Disables a button in the toolbar.
+        * @param {String/Number} button Disable a button by it's id or index.
+        * @return {Boolean}
+        */
+        disableButton: function(button) {
+            if (Lang.isString(button)) {
+                var button = this.getButtonById(button);
+            }
+            if (Lang.isNumber(button)) {
+                var button = this.getButtonByIndex(button);
+            }
+            if (button instanceof YAHOO.widget.Button) {
+                button.set('disabled', true);
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method enableButton
+        * @description Enables a button in the toolbar.
+        * @param {String/Number} button Enable a button by it's id or index.
+        * @return {Boolean}
+        */
+        enableButton: function(button) {
+            if (Lang.isString(button)) {
+                var button = this.getButtonById(button);
+            }
+            if (Lang.isNumber(button)) {
+                var button = this.getButtonByIndex(button);
+            }
+            if (button instanceof YAHOO.widget.Button) {
+                button.set('disabled', false);
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method selectButton
+        * @description Selects a button in the toolbar.
+        * @param {String/Number} button select a button by it's id or index.
+        * @return {Boolean}
+        */
+        selectButton: function(button, value) {
+            if (button) {
+                if (Lang.isString(button)) {
+                    var button = this.getButtonById(button);
+                }
+                if (Lang.isNumber(button)) {
+                    var button = this.getButtonByIndex(button);
+                }
+                if (button instanceof YAHOO.widget.Button) {
+                    button.addClass('yui-button-selected');
+                    button.addClass('yui-button-' + button.get('value') + '-selected');
+                    if (value) {
+                        var _items = button.getMenu().getItems();
+                        for (var m = 0; m < _items.length; m++) {
+                            if (_items[m].value == value) {
+                                _items[m].cfg.setProperty('checked', true);
+                                button.set('label', '<span class="yui-toolbar-' + button.get('value') + '-' + (value).replace(/ /g, '-').toLowerCase() + '">' + _items[m]._oText.nodeValue + '</span>');
+                            } else {
+                                _items[m].cfg.setProperty('checked', false);
+                            }
+                        }
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        /**
+        * @method deselectButton
+        * @description Deselects a button in the toolbar.
+        * @param {String/Number} button Deselect a button by it's id or index.
+        * @return {Boolean}
+        */
+        deselectButton: function(button) {
+            if (Lang.isString(button)) {
+                var button = this.getButtonById(button);
+            }
+            if (Lang.isNumber(button)) {
+                var button = this.getButtonByIndex(button);
+            }
+            if (button instanceof YAHOO.widget.Button) {
+                button.removeClass('yui-button-selected');
+                button.removeClass('yui-button-' + button.get('value') + '-selected');
+                button.removeClass('yui-button-hover');
+            } else {
+                return false;
+            }
+        },
+        /**
+        * @method deselectAllButtons
+        * @description Deselects all buttons in the toolbar.
+        * @return {Boolean}
+        */
+        deselectAllButtons: function() {
+            var len = this._buttonList.length;
+            for (var i = 0; i < len; i++) {
+                this.deselectButton(this._buttonList[i]);
+            }
+        },
+        /**
+        * @method destroyButton
+        * @description Destroy a button in the toolbar.
+        * @param {String/Number} button Destroy a button by it's id or index.
+        * @return {Boolean}
+        */
+        destroyButton: function(button) {
+            if (Lang.isString(button)) {
+                var button = this.getButtonById(button);
+            }
+            if (Lang.isNumber(button)) {
+                var button = this.getButtonByIndex(button);
+            }
+            if (button instanceof YAHOO.widget.Button) {
+                var id = button.get('id');
+                button.destroy();
+
+                var len = this._buttonList.length;
+                for (var i = 0; i < len; i++) {
+                    if (this._buttonList[i].get('id') == id) {
+                        this._buttonList[i] = null;
+                    }
+                }
+            } else {
+                return false;
+            }
+
+        },
+        /**
+        * @method destroy
+        * @description Destroys the toolbar, all of it's elements and objects.
+        * @return {Boolean}
+        */
+        destroy: function() {
+            this.get('element').innerHTML = '';
+            this.get('element').className = '';
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+            return true;
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the toolbar.
+        * @return {String}
+        */
+        toString: function() {
+            return 'Toolbar (#' + this.get('element').id + ') with ' + this._buttonList.length + ' buttons.';
+        }
+    });
+/**
+* @event buttonClick
+* @param {Object} o The object passed to this handler is the button config used to create the button.
+* @description Fires when any botton receives a click event. Passes back a single object representing the buttons config object. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event valueClick
+* @param {Object} o The object passed to this handler is the button config used to create the button.
+* @description This is a special dynamic event that is created and dispatched based on the value property
+* of the button config. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* Example:
+* <code><pre>
+* buttons : [
+*   { type: 'button', value: 'test', value: 'testButton' }
+* ]</pre>
+* </code>
+* With the valueClick event you could subscribe to this buttons click event with this:
+* tbar.in('testButtonClick', function() { alert('test button clicked'); })
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event toolbarExpanded
+* @description Fires when the toolbar is expanded via the collapse button. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event toolbarCollapsed
+* @description Fires when the toolbar is collapsed via the collapse button. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+})();
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+*/
+/**
+ * @module editor
+ * @description <p>The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.</p>
+ * @namespace YAHOO.widget
+ * @requires yahoo, dom, element, event, toolbar, container, menu, button
+ * @optional dragdrop, animation
+ * @beta
+ */
+
+(function() {
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Lang = YAHOO.lang,
+    DD = YAHOO.util.DD,
+    Toolbar = YAHOO.widget.Toolbar;
+
+
+    /**
+     * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.
+     * @constructor
+     * @class Editor
+     * @extends YAHOO.util.Element
+     * @param {String/HTMLElement} el The textarea element to turn into an editor.
+     * @param {Object} attrs Object liternal containing configuration parameters.
+    */
+    
+    YAHOO.widget.Editor = function(el, attrs) {
+
+        var oConfig = {
+            element: null,
+            attributes: (attrs || {})
+        }
+
+        if (Lang.isString(el)) {
+            oConfig.attributes.textarea = Dom.get(el);
+        }
+        
+        var element_cont = document.createElement('DIV');
+        oConfig.attributes.element_cont = new YAHOO.util.Element(element_cont, {
+            id: oConfig.attributes.textarea.id + '_container'
+        });
+        oConfig.attributes.element_cont.setStyle('display', 'none');
+
+        oConfig.element = oConfig.attributes.textarea;
+
+        var div = document.createElement('div');
+        oConfig.attributes.element_cont.appendChild(div);
+        
+        if (!oConfig.attributes.toolbar_cont) {
+            oConfig.attributes.toolbar_cont = document.createElement('DIV');
+            oConfig.attributes.toolbar_cont.id = oConfig.attributes.textarea.id + '_toolbar';
+            div.appendChild(oConfig.attributes.toolbar_cont);
+        }
+        
+        if (!oConfig.attributes.iframe) {
+            oConfig.attributes.iframe = _createIframe(oConfig.attributes.textarea.id);
+            var editorWrapper = document.createElement('DIV');
+            editorWrapper.appendChild(oConfig.attributes.iframe.get('element'));
+            div.appendChild(editorWrapper);
+        }
+
+        Event.onDOMReady(function() {
+            this.DOMReady = true;
+            this.fireQueue();
+        }, this, true);
+
+        YAHOO.widget.Editor.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
+    }
+
+    /**
+    * @private _cleanClassName
+    * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -'s.
+    * @param {String} str The classname to clean up
+    * @returns {String}
+    */
+    function _cleanClassName(str) {
+        return str.replace(/ /g, '-').toLowerCase();
+    }
+
+    /**
+    * @private _createIframe
+    * @description Creates the DOM and YUI Element for the iFrame editor area.
+    * @param {String} id The string ID to prefix the iframe with
+    * @returns {Object} iFrame object
+    */
+    function _createIframe(id) {
+        var ifrmID = id + '_editor';
+        var ifrmDom = document.createElement('iframe');
+        ifrmDom.id = ifrmID;
+        var config = {
+            border: '0',
+            frameBorder: '0',
+            marginWidth: '0',
+            marginHeight: '0',
+            leftMargin: '0',
+            topMargin: '0',
+            allowTransparency: 'true',
+            width: '100%',
+            src: 'javascript:false'
+        }
+        for (var i in config) {
+            if (Lang.hasOwnProperty(config, i)) {
+                ifrmDom.setAttribute(i, config[i]);
+            }
+        }
+
+        var ifrm = new YAHOO.util.Element(ifrmDom);
+        ifrm.setStyle('zIndex', '-1');
+        return ifrm;
+    }
+
+    YAHOO.extend(YAHOO.widget.Editor, YAHOO.util.Element, {
+        /**
+        * @property DOMReady
+        * @private
+        * @description Flag to determine if DOM is ready or not
+        * @type Boolean
+        */
+        DOMReady: null,
+        /**
+        * @property _selection
+        * @private
+        * @description Holder for caching iframe selections
+        * @type Object
+        */
+        _selection: null,
+        /**
+        * @property _mask
+        * @private
+        * @description DOM Element holder for the editor Mask when disabled
+        * @type Object
+        */
+        _mask: null,
+        /**
+        * @property _showingHiddenElements
+        * @private
+        * @description Status of the hidden elements button
+        * @type Boolean
+        */
+        _showingHiddenElements: null,
+        /**
+        * @property currentWindow
+        * @description A reference to the currently open EditorWindow
+        * @type Object
+        */
+        currentWindow: null,
+        /**
+        * @property currentEvent
+        * @description A reference to the current editor event
+        * @type Event
+        */
+        currentEvent: null,
+        /**
+        * @property operaEvent
+        * @private
+        * @description setTimeout holder for Opera and Image DoubleClick event..
+        * @type Object
+        */
+        operaEvent: null,
+        /**
+        * @property currentFont
+        * @description A reference to the last font selected from the Toolbar
+        * @type HTMLElement
+        */
+        currentFont: null,
+        /**
+        * @property currentElement
+        * @description A reference to the current working element in the editor
+        * @type Array
+        */
+        currentElement: [],
+        /**
+        * @property dompath
+        * @description A reference to the dompath container for writing the current working dom path to.
+        * @type HTMLElement
+        */
+        dompath: null,
+        /**
+        * @property beforeElement
+        * @description A reference to the H2 placed before the editor for Accessibilty.
+        * @type HTMLElement
+        */
+        beforeElement: null,
+        /**
+        * @property afterElement
+        * @description A reference to the H2 placed after the editor for Accessibilty.
+        * @type HTMLElement
+        */
+        afterElement: null,
+        /**
+        * @property invalidHTML
+        * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found.
+        * @type Object
+        */
+        invalidHTML: {
+            form: true,
+            input: true,
+            button: true,
+            select: true,
+            link: true,
+            html: true,
+            body: true,
+            script: true,
+            style: true,
+            textarea: true
+        },
+        /**
+        * @property toolbar
+        * @description Local property containing the <a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a> instance
+        * @type <a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a>
+        */
+        toolbar: null,
+        /**
+        * @private
+        * @property _contentTimer
+        * @description setTimeout holder for documentReady check
+        */
+        _contentTimer: null,
+        /**
+        * @private
+        * @property _contentTimerCounter
+        * @description Counter to check the number of times the body is polled for before giving up
+        * @type Number
+        */
+        _contentTimerCounter: 0,
+        /**
+        * @private
+        * @property _disabled
+        * @description The Toolbar items that should be disabled if there is no selection present in the editor.
+        * @type Array
+        */
+        _disabled: [ 'createlink', 'forecolor', 'backcolor', 'fontname', 'fontsize', 'superscript', 'subscript', 'removeformat', 'heading', 'indent', 'outdent' ],
+        /**
+        * @private
+        * @property _alwaysDisabled
+        * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor.
+        * @type Object
+        */
+        _alwaysDisabled: { },
+        /**
+        * @private
+        * @property _alwaysEnabled
+        * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor.
+        * @type Object
+        */
+        _alwaysEnabled: { hiddenelements: true },
+        /**
+        * @private
+        * @property _semantic
+        * @description The Toolbar commands that we should attempt to make tags out of instead of using styles.
+        * @type Object
+        */
+        _semantic: { 'bold': true, 'italic' : true, 'underline' : true },
+        /**
+        * @private
+        * @property _tag2cmd
+        * @description A tag map of HTML tags to convert to the different types of commands so we can select the proper toolbar button.
+        * @type Object
+        */
+        _tag2cmd: {
+            'b': 'bold',
+            'strong': 'bold',
+            'i': 'italic',
+            'em': 'italic',
+            'u': 'underline',
+            'blockquote': 'formatblock',
+            'sup': 'superscript',
+            'sub': 'subscript',
+            'img': 'insertimage',
+            'a' : 'createlink',
+            'ul' : 'insertunorderedlist',
+            'ol' : 'insertorderedlist',
+            'indent' : 'indent',
+            'outdent' : 'outdent'
+        },
+        /**
+        * @private
+        * @method _getDoc
+        * @description Get the Document of the IFRAME
+        * @return {Object}
+        */
+        _getDoc: function() {
+            //if (this.get && this.get('iframe') && this.get('iframe').get && this.get('iframe').get('element') && this.get('iframe').get('element').contentWindow && this.get('iframe').get('element').contentWindow.document) {
+            var value = false;
+            if (this.get) {
+                if (this.get('iframe')) {
+                    if (this.get('iframe').get) {
+                        if (this.get('iframe').get('element')) {
+                            try {
+                                if (this.get('iframe').get('element').contentWindow) {
+                                    if (this.get('iframe').get('element').contentWindow.document) {
+                                        value = this.get('iframe').get('element').contentWindow.document;
+                                    }
+                                }
+                            } catch (e) {}
+                        }
+                    }
+                }
+            }
+            return value;
+        },
+        /**
+        * @private
+        * @method _getWindow
+        * @description Get the Window of the IFRAME
+        * @return {Object}
+        */
+        _getWindow: function() {
+            return this.get('iframe').get('element').contentWindow;
+        },
+        /**
+        * @private
+        * @method _focusWindow
+        * @description Attempt to set the focus of the iframes window.
+        * @param {Boolean} onLoad Safari needs some special care to set the cursor in the iframe
+        */
+        _focusWindow: function(onLoad) {
+            if (this.browser.webkit) {
+                if (onLoad) {
+                    /**
+                    * @knownissue Safari Cursor Position
+                    * @browser Safari 2.x
+                    * @description Can't get Safari to place the cursor at the beginning of the text..
+                    * This workaround at least set's the toolbar into the proper state.
+                    */
+                    this._getSelection().setBaseAndExtent(this._getDoc().body, 0, this._getDoc().body, 1);
+                    this._getSelection().collapse(false);   
+                } else {
+                    this._getSelection().setBaseAndExtent(this._getDoc().body, 1, this._getDoc().body, 1);
+                    this._getSelection().collapse(false);   
+                }
+                this._getWindow().focus();
+                //Check for.webkit3
+                if (this._getDoc().queryCommandEnabled('insertimage')) {
+                    this.browser.webkit3 = true;
+                }
+            } else {
+                this._getWindow().focus();
+            }
+        },
+        /**
+        * @private
+        * @method _hasSelection
+        * @description Determines if there is a selection in the editor document.
+        * @returns {Boolean}
+        */
+        _hasSelection: function() {
+            var sel = this._getSelection();
+            var range = this._getRange();
+            var hasSel = false;
+
+            //Internet Explorer
+            if (this.browser.ie || this.browser.opera) {
+                if (range.text) {
+                    hasSel = true;
+                }
+                if (range.html) {
+                    hasSel = true;
+                }
+            } else {
+                if ((sel != '') && (sel != undefined)) {
+                    hasSel = true;
+                }
+            }
+            return hasSel;
+        },
+        /**
+        * @private
+        * @method _getSelection
+        * @description Handles the different selection objects across the A-Grade list.
+        * @returns {Object} Selection Object
+        */
+        _getSelection: function() {
+            var _sel = null;
+            if (this._getDoc() && this._getWindow()) {
+                if (this._getDoc().selection) {
+                    _sel = this._getDoc().selection;
+                } else {
+                    _sel = this._getWindow().getSelection();
+                }
+                //Handle Safari's lack of Selection Object
+                if (this.browser.webkit) {
+                    if (_sel.baseNode) {
+                            this._selection = new Object();
+                            this._selection.baseNode = _sel.baseNode;
+                            this._selection.baseOffset = _sel.baseOffset;
+                            this._selection.extentNode = _sel.extentNode;
+                            this._selection.extentOffset = _sel.extentOffset;
+                    } else if (this._selection != null) {
+                        _sel = this._getWindow().getSelection();
+                        _sel.setBaseAndExtent(
+                            this._selection.baseNode,
+                            this._selection.baseOffset,
+                            this._selection.extentNode,
+                            this._selection.extentOffset
+                        );
+                        this._selection = null;
+                    }
+                }
+            }
+            return _sel;
+        },
+        /**
+        * @private
+        * @method _getRange
+        * @description Handles the different range objects across the A-Grade list.
+        * @returns {Object} Range Object
+        */
+        _getRange: function(sel) {
+            var sel = this._getSelection();
+
+            if (sel == null) {
+                return null;
+            }
+
+            if (this.browser.webkit && !sel.getRangeAt) {
+                var _range = this._getDoc().createRange();
+                try {
+                    _range.setStart(sel.anchorNode, sel.anchorOffset);
+                    _range.setEnd(sel.focusNode, sel.focusOffset);
+                } catch (e) {
+                    _range = this._getWindow().getSelection()+'';
+                }
+                return _range;
+            }
+
+            if (this.browser.ie || this.browser.opera) {
+                return sel.createRange();
+            }
+
+            if (sel.rangeCount > 0) {
+                return sel.getRangeAt(0);
+            }
+            return null;
+        },
+        /**
+        * @private
+        * @method _setDesignMode
+        * @description Sets the designMode of the iFrame document.
+        * @param {String} state This should be either on or off
+        */
+        _setDesignMode: function(state) {
+            try {
+                this._getDoc().designMode = state;
+            } catch(e) { }
+        },
+        /**
+        * @private
+        * @method _toggleDesignMode
+        * @description Toggles the designMode of the iFrame document on and off.
+        * @returns {String} The state that it was set to.
+        */
+        _toggleDesignMode: function() {
+            var _dMode = this._getDoc().designMode,
+                _state = 'on';
+            if (_dMode == 'on') {
+                _state = 'off';
+            }
+            this._setDesignMode(_state);
+            return _state;
+        },
+        /**
+        * @private
+        * @method _initEditor
+        * @description This method is fired from _checkLoaded when the document is ready. It turns on designMode and set's up the listeners.
+        */
+        _initEditor: function() {
+            if (this.browser.ie) {
+                this._getDoc().body.style.margin = '0';
+            }
+            this._setDesignMode('on');
+            
+            this.toolbar.on('buttonClick', this._handleToolbarClick, this, true);
+            //Setup Listeners on iFrame
+            Event.addListener(this._getDoc(), 'mouseup', this._handleMouseUp, this, true);
+            Event.addListener(this._getDoc(), 'mousedown', this._handleMouseDown, this, true);
+            Event.addListener(this._getDoc(), 'click', this._handleClick, this, true);
+            Event.addListener(this._getDoc(), 'dblclick', this._handleDoubleClick, this, true);
+            Event.addListener(this._getDoc(), 'keypress', this._handleKeyPress, this, true);
+            Event.addListener(this._getDoc(), 'keyup', this._handleKeyUp, this, true);
+            Event.addListener(this._getDoc(), 'keydown', this._handleKeyDown, this, true);
+            this.toolbar.set('disabled', false);
+            this.fireEvent('editorContentLoaded', { type: 'editorLoaded', target: this });
+            if (this.get('dompath')) {
+                var self = this;
+                window.setTimeout(function() {
+                    self._writeDomPath.call(self);
+                }, 150);
+            }
+        },
+        /**
+        * @private
+        * @method _checkLoaded
+        * @description Called from a setTimeout loop to check if the iframes body.onload event has fired, then it will init the editor.
+        */
+        _checkLoaded: function() {
+            this._contentTimerCounter++;
+            if (this._contentTimer) {
+                window.clearTimeout(this._contentTimer);
+            }
+            if (this._contentTimerCounter > 250) {
+                alert('ERROR: Body Did Not load');
+                return false;
+            }
+            if (this._getDoc() && this._getDoc().body && (this._getDoc().body._rteLoaded == true)) {
+                //The onload event has fired, clean up after ourselves and fire the _initEditor method
+                /*
+                if (!this.browser.ie) {
+                    //IE Doesn't like this..
+                    delete this._getDoc().body._rteLoaded;
+                    this._getDoc().body.removeAttribute('onload');
+                }
+                */
+                this._initEditor();
+            } else {
+                var self = this;
+                this._contentTimer = window.setTimeout(function() {
+                    self._checkLoaded.call(self);
+                }, 20);
+            }
+        },
+        /**
+        * @private
+        * @method _setInitialContent
+        * @description This method will open the iframes content document and write the textareas value into it, then start the body.onload checking.
+        */
+        _setInitialContent: function() {
+            var title = this.STR_TITLE;
+            var html = this.get('html');
+            html = html.replace('{TITLE}', title);
+            html = html.replace('{CONTENT}', this.get('textarea').value);
+            html = html.replace('{CSS}', this.get('css'));
+            html = html.replace('{HIDDEN_CSS}', this.get('hiddencss'));
+
+            this._getDoc().open();
+            this._getDoc().write(html);
+            this._getDoc().close();
+            
+            this._checkLoaded();   
+        },
+        /**
+        * @private
+        * @method _setMarkupType
+        * @param {String} action The action to take. Possible values are: css, default or semantic
+        * @description This method will turn on/off the useCSS execCommand.
+        */
+        _setMarkupType: function(action) {
+            switch (this.get('markup')) {
+                case 'css':
+                    this._setEditorStyle(true);
+                    break;
+                case 'default':
+                    this._setEditorStyle(false);
+                    break;
+                case 'semantic':
+                    if (this._semantic[action]) {
+                        this._setEditorStyle(false);
+                    } else {
+                        this._setEditorStyle(true);
+                    }
+                    break;
+            }
+        },
+        /**
+        * Set the editor to use CSS instead of HTML
+        * @param {Booleen} stat True/False
+        */
+        _setEditorStyle: function(stat) {
+            try {
+                this._getDoc().execCommand('useCSS', false, !stat);
+            } catch (ex) {
+            }
+        },
+        /**
+        * @private
+        * @method _getSelectedElement
+        * @description This method will attempt to locate the element that was last interacted with, either via selection, location or event.
+        * @returns {HTMLElement} The currently selected element.
+        */
+        _getSelectedElement: function() {
+            var doc = this._getDoc();
+            if (this.browser.ie) {
+                var range = this._getRange(), elm = null;
+                if (range) {
+                    elm = range.item ? range.item(0) : range.parentElement();
+                    if (elm == doc.body) {
+                        elm = null;
+                    }
+                }
+            } else {
+                var sel = this._getSelection(),
+                    range = this._getRange(),
+                    elm = null;
+                if (!sel || !range) {
+                    return null;
+                }
+                if (sel != '') {
+                    if (sel.anchorNode && (sel.anchorNode.nodeType == 3)) {
+                        if (sel.anchorNode.parentNode) { //next check parentNode
+                            elm = sel.anchorNode.parentNode;
+                        }
+                        if (sel.anchorNode.nextSibling != sel.focusNode.nextSibling) {
+                            elm = sel.anchorNode.nextSibling;
+                        }
+                    }
+                    
+                    if (elm && elm.tagName && (elm.tagName.toLowerCase() == 'br')) {
+                        elm = null;
+                    }
+                
+                    if (!elm) {
+                        elm = range.commonAncestorContainer;
+                        if (!range.collapsed) {
+                            if (range.startContainer == range.endContainer) {
+                                if (range.startOffset - range.endOffset < 2) {
+                                    if (range.startContainer.hasChildNodes()) {
+                                        elm = range.startContainer.childNodes[range.startOffset];
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    //Safari Fix
+                    if (!elm) {
+                        if (this.currentEvent) {
+                            //elm = Event.getTarget(this.currentEvent);
+                        }
+                    }
+                }
+            }
+            if (!elm && (this.currentElement[0] || this.currentEvent)) {
+                if (this.currentEvent && (this.currentEvent.keyCode == undefined) && Event.getTarget(this.currentEvent)) {
+                    elm = Event.getTarget(this.currentEvent);
+                } else if (this.currentEvent && (this.currentEvent.keyCode != undefined) && Event.getTarget(this.currentEvent)) {
+                } else {
+                    elm = this.currentElement[0];
+                }
+            } else if ((elm == this._getDoc().body) && this.currentElement[0] && !this._hasSelection()) {
+                elm = this.currentElement[0];
+            }
+
+            if (this.browser.opera || this.browser.webkit) {
+                if (this.currentEvent && !elm) {
+                    elm = Event.getTarget(this.currentEvent);
+                }
+            }
+
+            if (!elm || !elm.tagName) {
+                elm = doc.body;
+            }
+            if (elm && elm.tagName && elm.tagName.toLowerCase() == 'html') {
+                //Safari sometimes gives us the HTML node back..
+                elm = doc.body;
+            }
+            
+            return elm;
+        },
+        /**
+        * @private
+        * @method _getDomPath
+        * @description This method will attempt to build the DOM path from the currently selected element.
+        * @returns {Array} An array of node references that will create the DOM Path.
+        */
+        _getDomPath: function() {
+                       var el = this._getSelectedElement();
+                       var domPath = [];
+                       
+                       while (el!= null) {
+                if (el.ownerDocument != this._getDoc()) {
+                    return false;
+                }
+                //Check to see if we get el.nodeName and nodeType
+                if (el.nodeName && (el.nodeType == 1)) {
+                    domPath[domPath.length] = el;
+                }
+
+                if (el.nodeName.toUpperCase() == "BODY") {
+                                   break;
+                }
+
+                               el = el.parentNode;
+                       }
+            if (domPath.length == 0) {
+                if (this._getDoc() && this._getDoc().body) {
+                    domPath[0] = this._getDoc().body;
+                }
+            }
+            return domPath.reverse();
+        },
+        /**
+        * @private
+        * @method _writeDomPath
+        * @description Write the current DOM path out to the dompath container below the editor.
+        */
+        _writeDomPath: function() { 
+            var path = this._getDomPath(),
+                pathArr = [];
+            for (var i = 0; i < path.length; i++) {
+                var tag = path[i].tagName.toLowerCase();
+                if ((tag == 'ol') && (path[i].type)) {
+                    tag += ':' + path[i].type;
+                }
+                if (Dom.hasClass(path[i], 'yui-tag')) {
+                    tag = path[i].getAttribute('tag');
+                }
+                if ((this.get('markup') == 'semantic')) {
+                    switch (tag) {
+                        case 'b': tag = 'strong'; break;
+                        case 'i': tag = 'em'; break;
+                    }
+                }
+                if (!Dom.hasClass(path[i], 'yui-non')) {
+                    if (Dom.hasClass(path[i], 'yui-tag')) {
+                        var pathStr = tag;
+                        if (tag == 'a') {
+                            if (path[i].getAttribute('href')) {
+                                pathStr += ':' + path[i].getAttribute('href').replace('mailto:', '').replace('http:/'+'/', '').replace('https:/'+'/', ''); //May need to add others here ftp
+                            }
+                        }
+                    } else {
+                        var classPath = ((path[i].className != '') ? '.' + path[i].className.replace(/ /g, '.') : '');
+                        if ((classPath.indexOf('yui') != -1) || (classPath.toLowerCase().indexOf('apple-style-span') != -1)) {
+                            classPath = '';
+                        }
+                        var pathStr = tag + ((path[i].id) ? '#' + path[i].id : '') + classPath;
+                    }
+                    if (pathStr.length > 10) {
+                        pathStr = pathStr.substring(0, 10) + '...';
+                    }
+                    pathArr[pathArr.length] = pathStr;
+                }
+            }
+            var str = pathArr.join(' ' + this.SEP_DOMPATH + ' ');
+            //Prevent flickering
+            if (this.dompath.innerHTML != str) {
+                this.dompath.innerHTML = str;
+            }
+        },
+        /**
+        * @private
+        * @method _fixNodes
+        * @description Fix href and imgs as well as remove invalid HTML.
+        */
+        _fixNodes: function() {
+            for (var i in this.invalidHTML) {
+                if (Lang.hasOwnProperty(this.invalidHTML, i)) {
+                    var tags = this._getDoc().body.getElementsByTagName(i);
+                    for (var h = 0; h < tags.length; h++) {
+                        if (tags[h].parentNode) {
+                            tags[h].parentNode.removeChild(tags[h]);
+                        }
+                    }
+                }
+            }
+            var as = this._getDoc().body.getElementsByTagName('a');
+            if (as.length) {
+                for (var i = 0; i < as.length; i++) {
+                    var el = this._getDoc().createElement('span');
+                    Dom.addClass(el, 'yui-tag-a');
+                    Dom.addClass(el, 'yui-tag');
+                    el.innerHTML = as[i].innerHTML;
+                    el.setAttribute('tag', 'a');
+                    el.setAttribute('href', as[i].getAttribute('href'));
+                    if (as[i].getAttribute('target') != null) {
+                        el.setAttribute('target', as[i].getAttribute('target'));
+                    }
+                    as[i].parentNode.replaceChild(el, as[i]);
+                    as[i] = null;
+                }
+            }
+            var imgs = this._getDoc().getElementsByTagName('img');
+            Dom.addClass(imgs, 'yui-img');
+
+            for (var i = 0; i < imgs.length; i++) {
+                if (imgs[i].getAttribute('href', 2)) {
+                    var url = imgs[i].getAttribute('src', 2);
+                    if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
+                        Dom.addClass(imgs[i], this.CLASS_LOCAL_FILE);
+                    } else {
+                        Dom.removeClass(imgs[i], this.CLASS_LOCAL_FILE);
+                    }
+                }
+            }
+
+            var fakeAs = this._getDoc().body.getElementsByTagName('span');
+            for (var i = 0; i < fakeAs.length; i++) {
+                if (fakeAs[i].getAttribute('href', 2)) {
+                    var url = fakeAs[i].getAttribute('href', 2);
+                    if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
+                        Dom.addClass(fakeAs[i], this.CLASS_LOCAL_FILE);
+                    } else {
+                        Dom.removeClass(fakeAs[i], this.CLASS_LOCAL_FILE);
+                    }
+                }
+            }
+        },
+        /**
+        * @private
+        * @method _showHidden
+        * @description Toggle on/off the hidden.css file.
+        */
+        _showHidden: function() {
+            if (this._showingHiddenElements) {
+                this._showingHiddenElements = false;
+                this.toolbar.deselectButton(this.toolbar.getButtonByValue('hiddenelements'));
+                Dom.removeClass(this._getDoc().body, this.CLASS_HIDDEN);
+            } else {
+                this._showingHiddenElements = true;
+                Dom.addClass(this._getDoc().body, this.CLASS_HIDDEN);
+                this.toolbar.selectButton(this.toolbar.getButtonByValue('hiddenelements'));
+            }
+        },
+        /**
+        * @private
+        * @method _setCurrentEvent
+        * @param {Event} ev The event to cache
+        * @description Sets the current event property
+        */
+        _setCurrentEvent: function(ev) {
+            if (ev && ev.type) {
+            }
+            this.currentEvent = ev;
+        },
+        /**
+        * @private
+        * @method _handleClick
+        * @param {Event} ev The event we are working on.
+        * @description Handles all click events inside the iFrame document.
+        */
+        _handleClick: function(ev) {
+            this._setCurrentEvent(ev);
+            if (this.currentWindow) {
+                this.closeWindow();
+            }
+            if (!this.browser.webkit) {
+                this.nodeChange();
+            }
+        },
+        /**
+        * @private
+        * @method _handleMouseUp
+        * @param {Event} ev The event we are working on.
+        * @description Handles all mouseup events inside the iFrame document.
+        */
+        _handleMouseUp: function(ev) {
+            this._setCurrentEvent(ev);
+            if (this.browser.opera) {
+                /**
+                * @knownissue Opera appears to stop the MouseDown, Click and DoubleClick events on an image inside of a document with designMode on..
+                * @browser Opera
+                * @description This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event.
+                */
+                var sel = Event.getTarget(ev);
+                if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+                    this.nodeChange();
+                    var self = this;
+                    if (this.operaEvent) {
+                        clearTimeout(this.operaEvent);
+                        this.operaEvent = null;
+                        this._handleDoubleClick(ev);
+                    } else {
+                        this.operaEvent = window.setTimeout(function() {
+                            self.operaEvent = false;
+                        }, 200);
+                    }
+                }
+            }
+            //This will stop Safari from selecting the entire document if you select all the text in the editor
+            if (this.browser.webkit || this.browser.opera) {
+                if (this.browser.webkit) {
+                    Event.stopEvent(ev);
+                }
+            }            
+            this.nodeChange();
+            this.fireEvent('editorMouseUp', { type: 'editorMouseUp', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleMouseDown
+        * @param {Event} ev The event we are working on.
+        * @description Handles all mousedown events inside the iFrame document.
+        */
+        _handleMouseDown: function(ev) {
+            this._setCurrentEvent(ev);
+            var sel = Event.getTarget(ev);
+            if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+                if (this.browser.webkit) {
+                    this.nodeChange();
+                    Event.stopEvent(ev);
+                }
+            }
+            //this.nodeChange();
+            this.fireEvent('editorMouseDown', { type: 'editorMouseDown', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleDoubleClick
+        * @param {Event} ev The event we are working on.
+        * @description Handles all doubleclick events inside the iFrame document.
+        */
+        _handleDoubleClick: function(ev) {
+            this._setCurrentEvent(ev);
+            var sel = Event.getTarget(ev);
+            if (sel && sel.tagName && (sel.tagName.toLowerCase() == 'img')) {
+                this.currentElement[0] = sel;
+                this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar });
+                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            } else if (sel && sel.getAttribute && sel.getAttribute('tag') && (sel.getAttribute('tag').toLowerCase() == 'a')) {
+                this.currentElement[0] = sel;
+                this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
+                this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            }
+            this.nodeChange();
+            this.fireEvent('editorDoubleClick', { type: 'editorDoubleClick', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleKeyUp
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keyup events inside the iFrame document.
+        */
+        _handleKeyUp: function(ev) {
+            this._setCurrentEvent(ev);
+            switch (ev.keyCode) {
+                case 37: //Left Arrow
+                case 38: //Up Arrow
+                case 39: //Right Arrow
+                case 40: //Down Arrow
+                case 46: //Forward Delete
+                case 8: //Delete
+                case 65: //The letter a (for ctrl + a and cmd + a)
+                case 27: //Escape key if window is open
+                    if ((ev.keyCode == 27) && this.currentWindow) {
+                        this.closeWindow();
+                    }
+                    this.nodeChange();
+                    break;
+            }
+            this.fireEvent('editorKeyUp', { type: 'editorKeyUp', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleKeyPress
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keypress events inside the iFrame document.
+        */
+        _handleKeyPress: function(ev) {
+            this._setCurrentEvent(ev);
+            this.fireEvent('editorKeyPress', { type: 'editorKeyPress', target: this, ev: ev });
+        },
+        /**
+        * @private
+        * @method _handleKeyDown
+        * @param {Event} ev The event we are working on.
+        * @description Handles all keydown events inside the iFrame document.
+        */
+        _handleKeyDown: function(ev) {
+            this._setCurrentEvent(ev);
+            if (this.currentWindow) {
+                this.closeWindow();
+            }
+            var doExec = false;
+            var action = null;
+            //if (ev.ctrlKey) {
+            if (ev.shiftKey && ev.ctrlKey) {
+                doExec = true;
+            }
+            switch (ev.keyCode) {
+                case 84: //Focus Toolbar Header -- Ctrl + Shift + T
+                    if (ev.shiftKey && ev.ctrlKey) {
+                        this.toolbar._titlebar.firstChild.focus();
+                        Event.stopEvent(ev);
+                        doExec = false;
+                    }
+                    break;
+                case 27: //Focus After Element - Ctrl + Shift + Esc
+                    if (ev.shiftKey) {
+                        this.afterElement.focus();
+                        Event.stopEvent(ev);
+                        exec = false;
+                    }
+                    break;
+                case 219: //Left
+                    action = 'justifyleft';
+                    break;
+                case 220: //Center
+                    action = 'justifycenter';
+                    break;
+                case 221: //Right
+                    action = 'justifyright';
+                    break;
+                case 76: //L
+                    if (this._hasSelection()) {
+                        this.execCommand('createlink', '');
+                        this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar });
+                        this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+                        doExec = false;
+                    }
+                    break;
+                case 66: //B
+                    action = 'bold';
+                    break;
+                case 73: //I
+                    action = 'italic';
+                    break;
+                case 85: //U
+                    action = 'underline';
+                    break;
+                case 9: //Tab Key
+                    if (this.browser.safari) {
+                        this._getDoc().execCommand('inserttext', false, '\t');
+                        Event.stopEvent(ev);
+                    }
+                    break;
+                case 13:
+                    if (this.browser.ie) {
+                        //Insert a <br> instead of a <p></p> in Internet Explorer
+                        var _range = this._getRange();
+                        var tar = this._getSelectedElement();
+                        if (tar && tar.tagName && (tar.tagName.toLowerCase() != 'li')) {
+                            if (_range) {
+                                _range.pasteHTML('<br>');
+                                _range.collapse(false);
+                                _range.select();
+                            }
+                            Event.stopEvent(ev);
+                        }
+                    }
+            }
+            if (doExec && action) {
+                this.execCommand(action, null);
+                Event.stopEvent(ev);
+                this.nodeChange();
+            }
+            this.fireEvent('editorKeyDown', { type: 'editorKeyDown', target: this, ev: ev });
+        },
+        /**
+        * @method nodeChange
+        * @description Handles setting up the toolbar buttons, getting the Dom path, fixing nodes.
+        */
+        nodeChange: function() {
+            this._fixNodes();
+
+            this.fireEvent('beforeNodeChange', { type: 'beforeNodeChange', target: this });
+            if (this.get('dompath')) {
+                this._writeDomPath();
+            }
+            //Check to see if we are disabled before continuing
+            if (!this.get('disabled')) {
+                if (this.STOP_NODE_CHANGE) {
+                    //Reset this var for next action
+                    this.STOP_NODE_CHANGE = false;
+                    return false;
+                } else {
+                    var sel = this._getSelection();
+                    var range = this._getRange();
+
+                    //Handle disabled buttons
+                    for (var i = 0; i < this._disabled.length; i++) {
+                        var _button = this.toolbar.getButtonByValue(this._disabled[i]);
+                        if (_button && _button.get) {
+                            if (!this._hasSelection()) {
+                                //No Selection - disable
+                                this.toolbar.disableButton(_button.get('id'));
+                            } else {
+                                if (!this._alwaysDisabled[this._disabled[i]]) {
+                                    this.toolbar.enableButton(_button.get('id'));
+                                }
+                            }
+                            if (!this._alwaysEnabled[this._disabled[i]]) {
+                                this.toolbar.deselectButton(_button);
+                            }
+                        }
+                    }
+                    //Handle updating the toolbar with active buttons
+                    for (var i = 0; i < this.toolbar._buttonList.length; i++) {
+                        if (!this._alwaysEnabled[this.toolbar._buttonList[i].get('value')]) {
+                            this.toolbar.deselectButton(this.toolbar._buttonList[i]);
+                        }
+                    }
+                    var path = this._getDomPath();
+                    var olType = null;
+                    for (var i = 0; i < path.length; i++) {
+                        var tag = path[i].tagName.toLowerCase();
+                        if (path[i].getAttribute('tag')) {
+                            var tag = path[i].getAttribute('tag').toLowerCase();
+                        }
+                        var cmd = this._tag2cmd[tag];
+
+                        //Bold and Italic styles
+                        if (path[i].style.fontWeight.toLowerCase() == 'bold') {
+                            cmd = 'bold';
+                        }
+                        if (path[i].style.fontStyle.toLowerCase() == 'italic') {
+                            cmd = 'italic';
+                        }
+                        if (path[i].style.textDecoration.toLowerCase() == 'underline') {
+                            cmd = 'underline';
+                        }
+                        if (tag == 'ol') {
+                            if (path[i].type) {
+                                olType = path[i].type;
+                            } else {
+                                olType = 'A';
+                            }
+                        }
+                        if (cmd) {
+                            if (!Lang.isArray(cmd)) {
+                                cmd = [cmd];
+                            }
+                            for (var j = 0; j < cmd.length; j++) {
+                                var button = this.toolbar.getButtonByValue(cmd[j]);
+                                this.toolbar.selectButton(button);
+                                this.toolbar.enableButton(button);
+                            }
+                        }
+                        //Handle Alignment
+                        switch (path[i].style.textAlign.toLowerCase()) {
+                            case 'left':
+                            case 'right':
+                            case 'center':
+                            case 'justify':
+                                var alignType = path[i].style.textAlign.toLowerCase();
+                                if (path[i].style.textAlign.toLowerCase() == 'justify') {
+                                    alignType = 'full';
+                                }
+                                var button = this.toolbar.getButtonByValue('justify' + alignType);
+                                this.toolbar.selectButton(button);
+                                this.toolbar.enableButton(button);
+                                break;
+                        }
+                        //Handle Ordered List Drop Down - it will reset if olType is null
+                        //this._updateMenuChecked('insertorderedlist', olType);
+                    }
+                    //After for loop
+
+                    //Reset Font Family and Size to the inital configs
+                    var fn_button = this.toolbar.getButtonByValue('fontname');
+                    if (fn_button) {
+                        var family = fn_button._configs.label._initialConfig.value;
+                        fn_button.set('label', '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>');
+                        this._updateMenuChecked('fontname', family);
+                    }
+
+                    var fs_button = this.toolbar.getButtonByValue('fontsize');
+                    if (fs_button) {
+                        fs_button.set('label', fs_button._configs.label._initialConfig.value);
+                    }
+
+                    var hd_button = this.toolbar.getButtonByValue('heading');
+                    if (hd_button) {
+                        hd_button.set('label', hd_button._configs.label._initialConfig.value);
+                        this._updateMenuChecked('heading', 'none');
+                    }
+                }
+            }
+
+            this.fireEvent('afterNodeChange', { type: 'afterNodeChange', target: this });
+        },
+        /**
+        * @private
+        * @method _updateMenuChecked
+        * @param {Object} button The command identifier of the button you want to check
+        * @param {String} value The value of the menu item you want to check
+        * @param {<a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a>} The Toolbar instance the button belongs to (defaults to this.toolbar) 
+        * @description Gets the menu from a button instance, if the menu is not rendered it will render it. It will then search the menu for the specified value, unchecking all other items and checking the specified on.
+        */
+        _updateMenuChecked: function(button, value, tbar) {
+            if (!tbar) {
+                tbar = this.toolbar;
+            }
+            var _button = tbar.getButtonByValue(button);
+            var _menuItems = _button.getMenu().getItems();
+            if (_menuItems.length == 0) {
+                _button.getMenu()._onBeforeShow();
+                _menuItems = _button.getMenu().getItems();
+            }
+            for (var i = 0; i < _menuItems.length; i++) {
+                _menuItems[i].cfg.setProperty('checked', false);
+                if (_menuItems[i].value == value) {
+                    _menuItems[i].cfg.setProperty('checked', true);
+                }
+            }
+        },
+        /**
+        * @private
+        * @method _handleToolbarClick
+        * @param {Event} ev The event that triggered the button click
+        * @description This is an event handler attached to the Toolbar's buttonClick event. It will fire execCommand with the command identifier from the Toolbar Button.
+        */
+        _handleToolbarClick: function(ev) {
+            var value = '';
+            var str = '';
+            var cmd = ev.button.value;
+            if (ev.button.menucmd) {
+                value = cmd;
+                cmd = ev.button.menucmd;
+            }
+            if (this.STOP_EXEC_COMMAND) {
+                this.STOP_EXEC_COMMAND = false;
+                return false;
+            } else {
+                this.execCommand(cmd, value);
+            }
+            Event.stopEvent(ev);
+        },
+        /**
+        * @private
+        * @method _setupAfterElement
+        * @description Creates the accessibility h2 header and places it after the iframe in the Dom for navigation.
+        */
+        _setupAfterElement: function() {
+            if (!this.afterElement) {
+                this.afterElement = document.createElement('h2');
+                this.afterElement.className = 'yui-editor-skipheader';
+                this.afterElement.tabIndex = '-1';
+                this.afterElement.innerHTML = this.STR_LEAVE_EDITOR;
+                this.get('element_cont').get('firstChild').appendChild(this.afterElement);
+            }
+        },
+        /**
+        * @property EDITOR_PANEL_ID
+        * @description HTML id to give the properties window in the DOM.
+        * @type String
+        */
+        EDITOR_PANEL_ID: 'yui-editor-panel',
+        /**
+        * @property SEP_DOMPATH
+        * @description The value to place in between the Dom path items
+        * @type String
+        */
+        SEP_DOMPATH: '<',
+        /**
+        * @property STR_LEAVE_EDITOR
+        * @description The accessibility string for the element after the iFrame
+        * @type String
+        */
+        STR_LEAVE_EDITOR: 'You have left the Rich Text Editor.',
+        /**
+        * @property STR_BEFORE_EDITOR
+        * @description The accessibility string for the element before the iFrame
+        * @type String
+        */
+        STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift [ aligns text left</li> <li>Control Shift | centers text</li> <li>Control Shift ] aligns text right</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control Shift ESC.</li></ul>',
+        /**
+        * @property STR_CLOSE_WINDOW
+        * @description The Title of the close button in the Editor Window
+        * @type String
+        */
+        STR_CLOSE_WINDOW: 'Close Window',
+        /**
+        * @property STR_CLOSE_WINDOW_NOTE
+        * @description A note appearing in the Editor Window to tell the user that the Escape key will close the window
+        * @type String
+        */
+        STR_CLOSE_WINDOW_NOTE: 'To close this window use the Escape key',
+        /**
+        * @property STR_TITLE
+        * @description The Title of the HTML document that is created in the iFrame
+        * @type String
+        */
+        STR_TITLE: 'Rich Text Area.',
+        /**
+        * @property STR_IMAGE_HERE
+        * @description The text to place in the URL textbox when using the blankimage.
+        * @type String
+        */
+        STR_IMAGE_HERE: 'Image Url Here',
+        /**
+        * @property STR_IMAGE_PROP_TITLE
+        * @description The title for the Image Property Editor Window
+        * @type String
+        */
+        STR_IMAGE_PROP_TITLE: 'Image Options',
+        /**
+        * @property STR_IMAGE_URL
+        * @description The label string for Image URL
+        * @type String
+        */
+        STR_IMAGE_URL: 'Image Url',
+        /**
+        * @property STR_IMAGE_TITLE
+        * @description The label string for Image Description
+        * @type String
+        */
+        STR_IMAGE_TITLE: 'Description',
+        /**
+        * @property STR_IMAGE_SIZE
+        * @description The label string for Image Size
+        * @type String
+        */
+        STR_IMAGE_SIZE: 'Size',
+        /**
+        * @property STR_IMAGE_ORIG_SIZE
+        * @description The label string for Original Image Size
+        * @type String
+        */
+        STR_IMAGE_ORIG_SIZE: 'Original Size',
+        /**
+        * @property STR_IMAGE_COPY
+        * @description The label string for the image copy and paste message for Opera and Safari
+        * @type String
+        */
+        STR_IMAGE_COPY: '<span class="tip"><span class="icon icon-info"></span><strong>Note:</strong>To move this image just highlight it, cut, and paste where ever you\'d like.</span>',
+        /**
+        * @property STR_IMAGE_PADDING
+        * @description The label string for the image padding.
+        * @type String
+        */
+        STR_IMAGE_PADDING: 'Padding',
+        /**
+        * @property STR_IMAGE_BORDER
+        * @description The label string for the image border.
+        * @type String
+        */
+        STR_IMAGE_BORDER: 'Border',
+        /**
+        * @property STR_IMAGE_TEXTFLOW
+        * @description The label string for the image text flow.
+        * @type String
+        */
+        STR_IMAGE_TEXTFLOW: 'Text Flow',
+        /**
+        * @property STR_LOCAL_FILE_WARNING
+        * @description The label string for the local file warning.
+        * @type String
+        */
+        STR_LOCAL_FILE_WARNING: '<span class="tip"><span class="icon icon-warn"></span><strong>Note:</strong>This image/link points to a file on your computer and will not be accessible to others on the internet.</span>',
+        /**
+        * @property STR_LINK_PROP_TITLE
+        * @description The label string for the Link Property Editor Window.
+        * @type String
+        */
+        STR_LINK_PROP_TITLE: 'Link Options',
+        /**
+        * @property STR_LINK_PROP_REMOVE
+        * @description The label string for the Remove link from text link inside the property editor.
+        * @type String
+        */
+        STR_LINK_PROP_REMOVE: 'Remove link from text',
+        /**
+        * @property STR_LINK_URL
+        * @description The label string for the Link URL.
+        * @type String
+        */
+        STR_LINK_URL: 'Link URL',
+        /**
+        * @property STR_LINK_NEW_WINDOW
+        * @description The string for the open in a new window label.
+        * @type String
+        */
+        STR_LINK_NEW_WINDOW: 'Open in a new window.',
+        /**
+        * @property STR_LINK_TITLE
+        * @description The string for the link description.
+        * @type String
+        */
+        STR_LINK_TITLE: 'Description',
+        /**
+        * @protected
+        * @property STOP_EXEC_COMMAND
+        * @description Set to true when you want the default execCommand function to not process anything
+        * @type Boolean
+        */
+        STOP_EXEC_COMMAND: false,
+        /**
+        * @protected
+        * @property STOP_NODE_CHANGE
+        * @description Set to true when you want the default nodeChange function to not process anything
+        * @type Boolean
+        */
+        STOP_NODE_CHANGE: false,
+        /**
+        * @protected
+        * @property CLASS_HIDDEN
+        * @description CSS class applied to the body when the hiddenelements button is pressed.
+        * @type String
+        */
+        CLASS_HIDDEN: 'hidden',
+        /**
+        * @protected
+        * @property CLASS_LOCAL_FILE
+        * @description CSS class applied to an element when it's found to have a local url.
+        * @type String
+        */
+        CLASS_LOCAL_FILE: 'warning-localfile',
+        /**
+        * @protected
+        * @property CLASS_CONTAINER
+        * @description Default CSS class to apply to the editors container element
+        * @type String
+        */
+        CLASS_CONTAINER: 'yui-editor-container',
+        /**
+        * @protected
+        * @property CLASS_EDITABLE
+        * @description Default CSS class to apply to the editors iframe element
+        * @type String
+        */
+        CLASS_EDITABLE: 'yui-editor-editable',
+        /**
+        * @protected
+        * @property CLASS_EDITABLE_CONT
+        * @description Default CSS class to apply to the editors iframe's parent element
+        * @type String
+        */
+        CLASS_EDITABLE_CONT: 'yui-editor-editable-container',
+        /**
+        * @protected
+        * @property CLASS_PREFIX
+        * @description Default prefix for dynamically created class names
+        * @type String
+        */
+        CLASS_PREFIX: 'yui-editor',
+        /** 
+        * @property browser
+        * @description Standard browser detection
+        * @type Object
+        */
+        browser: YAHOO.env.ua,
+        /** 
+        * @method init
+        * @description The Editor class' initialization method
+        */
+        init: function(p_oElement, p_oAttributes) {
+            YAHOO.widget.Editor.superclass.init.call(this, p_oElement, p_oAttributes);
+            this.get('element_cont').addClass(this.CLASS_CONTAINER);
+            Dom.addClass(this.get('iframe').get('parentNode'), this.CLASS_EDITABLE_CONT);
+            this.get('iframe').addClass(this.CLASS_EDITABLE);
+        },
+        /**
+        * @method initAttributes
+        * @description Initializes all of the configuration attributes used to create 
+        * the editor.
+        * @param {Object} attr Object literal specifying a set of 
+        * configuration attributes used to create the editor.
+        */
+        initAttributes: function(attr) {
+            YAHOO.widget.Editor.superclass.initAttributes.call(this, attr);
+            var self = this;
+
+            /**
+            * @private
+            * @config textarea
+            * @description A reference to the textarea element that we are replacing
+            * @default null
+            * @type Boolean
+            */            
+            this.setAttributeConfig('textarea', {
+                value: attr.textarea,
+                writeOnce: true
+            });
+            /**
+            * @config height
+            * @description The height of the editor iframe container, not including the toolbar..
+            * @default Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument
+            * @type String
+            */
+            this.setAttributeConfig('height', {
+                value: attr.height || Dom.getStyle(self.get('textarea'), 'height'),
+                writeOnce: true
+            });
+            /**
+            * @config width
+            * @description The width of the editor container.
+            * @default Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument
+            * @type String
+            */            
+            this.setAttributeConfig('width', {
+                value: attr.width || Dom.getStyle(this.get('textarea'), 'width'),
+                writeOnce: true
+            });
+                        
+            /**
+            * @config blankimage
+            * @description The CSS used to show/hide hidden elements on the page
+            * @default 'assets/blankimage.png'
+            * @type String
+            */            
+            this.setAttributeConfig('blankimage', {
+                value: attr.blankimage || this._getBlankImage()
+            });
+            /**
+            * @config hiddencss
+            * @description The CSS used to show/hide hidden elements on the page, these rules must be prefixed with the class provided in <code>this.CLASS_HIDDEN</code>
+            * @default <code><pre>
+            .hidden div, .hidden p, .hidden span, .hidden img {
+                border: 1px dotted #ccc;
+            }
+            .hidden .yui-non {
+                border: none;
+            }
+            .hidden img {
+                padding: 2px;
+            }</pre></code>
+            * @type String
+            */            
+            this.setAttributeConfig('hiddencss', {
+                value: attr.hiddencss || '.hidden div,.hidden p,.hidden span,.hidden img { border: 1px dotted #ccc; } .hidden .yui-non { border: none; } .hidden img { padding: 2px; }',
+                writeOnce: true
+            });
+            /**
+            * @config css
+            * @description The Base CSS used to format the content of the editor
+            * @default <code><pre>body {
+                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
+            }
+            span.yui-tag-a {
+                color: blue; text-decoration: underline;
+            }
+            span.yui-tag-blockquote {
+                margin: 1em; display: block;
+            }
+            span.yui-tag-indent {
+                margin-left: 1em; display: block;
+            }
+            .warning-localfile {
+                border-bottom: 1px dashed red !important;
+            }</pre></code>
+            * @type String
+            */            
+            this.setAttributeConfig('css', {
+                value: attr.css || 'body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } span.yui-tag-a { color: blue; text-decoration: underline; } span.yui-tag-blockquote { margin: 1em; display: block; } span.yui-tag-indent { margin-left: 1em; display: block; } .warning-localfile { border-bottom: 1px dashed red !important; }',
+                writeOnce: true
+            });
+            /**
+            * @config html
+            * @description The default HTML to be written to the iframe document before the contents are loaded
+            * @default This HTML requires a few things if you are to override:
+                <p><code>{TITLE}, {CSS}, {HIDDEN_CSS}</code> and <code>{CONTENT}</code> need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.<p>
+                <p><code>onload="document.body._rteLoaded = true;"</code> : the onload statement must be there or the editor will not finish loading.</p>
+                <code>
+                <pre>
+                &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
+                &lt;html&gt;
+                    &lt;head&gt;
+                        &lt;title&gt;{TITLE}&lt;/title&gt;
+                        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
+                        &lt;style&gt;
+                        {CSS}
+                        &lt;/style&gt;
+                        &lt;style&gt;
+                        {HIDDEN_CSS}
+                        &lt;/style&gt;
+                    &lt;/head&gt;
+                &lt;body onload="document.body._rteLoaded = true;"&gt;
+                {CONTENT}
+                &lt;/body&gt;
+                &lt;/html&gt;
+                </pre>
+                </code>
+            * @type String
+            */            
+            this.setAttributeConfig('html', {
+                value: attr.html || '<!DOCTYPE HTML PUBLIC "-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd"><html><head><title>{TITLE}</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style>{CSS}</style><style>{HIDDEN_CSS}</style></head><body onload="document.body._rteLoaded = true;">{CONTENT}</body></html>',
+                writeOnce: true
+            });
+
+            /**
+            * @config handleSubmit
+            * @description Config handles if the editor will attach itself to the textareas parent form's submit handler.
+            If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form.
+            Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('handleSubmit', {
+                value: false,
+                writeOnce: true,
+                method: function(exec) {
+                    if (exec) {
+                        var ta = this.get('textarea');
+                        if (ta.form) {
+                            Event.addListener(ta.form, 'submit', function() {
+                                this.saveHTML();
+                            }, this, true);
+                        }
+                    }
+                }
+            });
+            /**
+            * @private
+            * @config iframe
+            * @description Internal config for holding the iframe element.
+            * @default null
+            * @type Boolean
+            */
+            this.setAttributeConfig('iframe', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @config disabled
+            * @description This will toggle the editor's disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place.
+            All Toolbar buttons are also disabled so they cannot be used.
+            * @default false
+            * @type Boolean
+            */
+
+            this.setAttributeConfig('disabled', {
+                value: false,
+                method: function(disabled) {
+                    if (disabled) {
+                        if (!this._mask) {
+                            this._setDesignMode('off');
+                            this.toolbar.set('disabled', true);
+                            this._mask = document.createElement('DIV');
+                            Dom.setStyle(this._mask, 'height', '100%');
+                            Dom.setStyle(this._mask, 'width', '100%');
+                            Dom.setStyle(this._mask, 'position', 'absolute');
+                            Dom.setStyle(this._mask, 'top', '0');
+                            Dom.setStyle(this._mask, 'left', '0');
+                            Dom.setStyle(this._mask, 'opacity', '.5');
+                            Dom.addClass(this._mask, 'yui-editor-masked');
+                            this.get('iframe').get('parentNode').appendChild(this._mask);
+                        }
+                    } else {
+                        if (this._mask) {
+                            this._mask.parentNode.removeChild(this._mask);
+                            this._mask = null;
+                            this.toolbar.set('disabled', false);
+                            this._setDesignMode('on');
+                            this._focusWindow();
+                        }
+                    }
+                }
+            });
+            /**
+            * @config element_cont
+            * @description Internal config for the editors container
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('element_cont', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @config toolbar_cont
+            * @description Internal config for the toolbars container
+            * @default false
+            * @type Boolean
+            */
+            this.setAttributeConfig('toolbar_cont', {
+                value: null,
+                writeOnce: true
+            });
+            /**
+            * @config toolbar
+            * @description The default toolbar config.
+            * @default This config is too large to display here, view the code to see it: <a href="editor.js.html"></a>
+            * @type Object
+            */            
+            this.setAttributeConfig('toolbar', {
+                value: attr.toolbar || {
+                    /* {{{ Defaut Toolbar Config */
+                    collapse: true,
+                    titlebar: 'Text Editing Tools',
+                    draggable: false,
+                    buttons: [
+                        { group: 'fontstyle', label: 'Font Name and Size',
+                            buttons: [
+                                { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
+                                    menu: [
+                                        { text: 'Arial', checked: true },
+                                        { text: 'Arial Black' },
+                                        { text: 'Comic Sans MS' },
+                                        { text: 'Courier New' },
+                                        { text: 'Lucida Console' },
+                                        { text: 'Tahoma' },
+                                        { text: 'Times New Roman' },
+                                        { text: 'Trebuchet MS' },
+                                        { text: 'Verdana' }
+                                    ]
+                                },
+                                { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'textstyle', label: 'Font Style',
+                            buttons: [
+                                { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
+                                { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' },
+                                { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' },
+                                { type: 'separator' },
+                                { type: 'push', label: 'Subscript', value: 'subscript', disabled: true },
+                                { type: 'push', label: 'Superscript', value: 'superscript', disabled: true },
+                                { type: 'separator' },
+                                { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
+                                { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true },
+                                { type: 'separator' },
+                                { type: 'push', label: 'Remove Formatting', value: 'removeformat', disabled: true },
+                                { type: 'push', label: 'Hidden Elements', value: 'hiddenelements' }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'alignment', label: 'Alignment',
+                            buttons: [
+                                { type: 'push', label: 'Align Left CTRL + SHIFT + [', value: 'justifyleft' },
+                                { type: 'push', label: 'Align Center CTRL + SHIFT + |', value: 'justifycenter' },
+                                { type: 'push', label: 'Align Right CTRL + SHIFT + ]', value: 'justifyright' },
+                                { type: 'push', label: 'Justify', value: 'justifyfull' }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'parastyle', label: 'Paragraph Style',
+                            buttons: [
+                            { type: 'select', label: 'Normal', value: 'heading', disabled: true,
+                                menu: [
+                                    { text: 'Normal', value: 'none', checked: true },
+                                    { text: 'Header 1', value: 'h1' },
+                                    { text: 'Header 2', value: 'h2' },
+                                    { text: 'Header 3', value: 'h3' },
+                                    { text: 'Header 4', value: 'h4' },
+                                    { text: 'Header 5', value: 'h5' },
+                                    { text: 'Header 6', value: 'h6' }
+                                ]
+                            }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'indentlist', label: 'Indenting and Lists',
+                            buttons: [
+                                { type: 'push', label: 'Indent', value: 'indent', disabled: true },
+                                { type: 'push', label: 'Outdent', value: 'outdent', disabled: true },
+                                { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
+                                { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
+                                /*
+                                { type: 'menu', label: 'Create an Ordered List', value: 'insertorderedlist',
+                                    menu: [
+                                        { text: '1,2,3,4', value: '1', checked: true },
+                                        { text: 'A,B,C,D', value: 'A' },
+                                        { text: 'a,b,c,d', value: 'a' },
+                                        { text: 'I,II,III,IV', value: 'I' },
+                                        { text: 'i,ii,iii,iv', value: 'i' }
+                                    ]
+                                }
+                                */
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'insertitem', label: 'Insert Item',
+                            buttons: [
+                                { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
+                                { type: 'push', label: 'Insert Image', value: 'insertimage' }
+                            ]
+                        }
+                    ]
+                    /* }}} */
+                },
+                writeOnce: true,
+                method: function(toolbar) {
+                }
+            });
+            /**
+            * @config animate
+            * @description Should the editor animate window movements
+            * @default false unless Animation is found, then true
+            * @type Boolean
+            */            
+            this.setAttributeConfig('animate', {
+                value: false,
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.util.Anim) {
+                        ret = false;
+                    }
+                    return ret;
+                }               
+            });
+            /**
+            * @config panel
+            * @description A reference to the panel we are using for windows.
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('panel', {
+                value: null,
+                writeOnce: true,
+                validator: function(value) {
+                    var ret = true;
+                    if (!YAHOO.widget.Panel) {
+                        ret = false;
+                    }
+                    return ret;
+                }               
+            });
+            /**
+            * @config localFileWarning
+            * @description Should we throw the warning if we detect a file that is local to their machine?
+            * @default true
+            * @type Boolean
+            */            
+            this.setAttributeConfig('localFileWarning', {
+                value: true
+            });
+            /**
+            * @config dompath
+            * @description Toggle the display of the current Dom path below the editor
+            * @default false
+            * @type Boolean
+            */            
+            this.setAttributeConfig('dompath', {
+                value: false,
+                method: function(dompath) {
+                    if (dompath && !this.dompath) {
+                        this.dompath = document.createElement('DIV');
+                        this.dompath.id = this.get('id') + '_dompath';
+                        Dom.addClass(this.dompath, 'dompath');
+                        this.get('element_cont').get('firstChild').appendChild(this.dompath);
+                        if (this.get('iframe')) {
+                            this._writeDomPath();
+                        }
+                    } else if (!dompath && this.dompath) {
+                        this.dompath.parentNode.removeChild(this.dompath);
+                        this.dompath = null;
+                    }
+                    this._setupAfterElement();
+                }
+            });
+            /**
+            * @config markup
+            * @description Should we try to adjust the markup for the following types: semantic, css or default
+            * @default "semantic"
+            * @type Boolean
+            */            
+            this.setAttributeConfig('markup', {
+                value: 'semantic',
+                validator: function(markup) {
+                    switch (markup.toLowerCase()) {
+                        case 'semantic':
+                        case 'css':
+                        case 'default':
+                        return true;
+                        break;
+                    }
+                    return false;
+                }
+            });
+
+            this.on('afterRender', function() {
+                this._renderPanel();
+            });
+        },
+        /**
+        * @private
+        * @method _getBlankImage
+        * @description Retrieves the full url of the image to use as the blank image.
+        * @returns {String} The URL to the blank image
+        */
+        _getBlankImage: function() {
+            if (!this.DOMReady) {
+                this._queue[this._queue.length] = ['_getBlankImage', arguments];
+                return '';
+            }      
+            var div = document.createElement('div');
+            div.style.position = 'absolute';
+            div.style.top = '-9999px';
+            div.style.left = '-9999px';
+            div.className = this.CLASS_PREFIX + '-blankimage';
+            document.body.appendChild(div);
+            var img = YAHOO.util.Dom.getStyle(div, 'background-image');
+            img = img.replace('url(', '').replace(')', '').replace(/"/g, '');
+            this.set('blankimage', img);            
+            return img;
+        },
+        /**
+        * @private
+        * @method _handleFontSize
+        * @description Handles the font size button in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleFontSize: function(o) {
+            var button = this.toolbar.getButtonById(o.button.id);
+            var value = button.get('label') + 'px';
+            this.execCommand('fontsize', value);
+            this.STOP_EXEC_COMMAND = true;
+        },
+        /**
+        * @private
+        * @method _handleColorPicker
+        * @description Handles the colorpicker buttons in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleColorPicker: function(o) {
+            var cmd = o.button;
+            var value = '#' + o.color;
+            if ((cmd == 'forecolor') || (cmd == 'backcolor')) {
+                this.execCommand(cmd, value);
+            }
+        },
+        /**
+        * @private
+        * @method _handleAlign
+        * @description Handles the alignment buttons in the toolbar.
+        * @param {Object} o Object returned from Toolbar's buttonClick Event
+        */
+        _handleAlign: function(o) {
+            var button = this.toolbar.getButtonById(o.button.id);
+            var cmd = null;
+            for (var i = 0; i < o.button.menu.length; i++) {
+                if (o.button.menu[i].value == o.button.value) {
+                    cmd = o.button.menu[i].value;
+                }
+            }
+            var value = this._getSelection();
+
+            this.execCommand(cmd, value);
+            this.STOP_EXEC_COMMAND = true;
+        },
+        /**
+        * @private
+        * @method _handleAfterNodeChange
+        * @description Fires after a nodeChange happens to setup the things that where reset on the node change (button state).
+        */
+        _handleAfterNodeChange: function() {
+            var path = this._getDomPath();
+            for (var i = 0; i < path.length; i++) {
+                var elm = path[i],
+                    tag = elm.tagName.toLowerCase(),
+                    family = null,
+                    fontsize = null,
+                    validFont = false;
+
+                if (elm.getAttribute('tag')) {
+                    tag = elm.getAttribute('tag');
+                }
+
+                family = elm.getAttribute('face');
+                if (Dom.getStyle(elm, 'font-family')) {
+                    family = Dom.getStyle(elm, 'font-family');
+                }
+                var fn_button = this.toolbar.getButtonByValue('fontname');
+                if (fn_button) {
+                    for (var b = 0; b < fn_button._configs.menu.value.length; b++) {
+                        if (family && fn_button._configs.menu.value[b].text.toLowerCase() == family.toLowerCase()) {
+                            validFont = true;
+                            family = fn_button._configs.menu.value[b].text; //Put the proper menu name in the button
+                        }
+                    }
+                    if (!validFont) {
+                        family = fn_button._configs.label._initialConfig.value;
+                    }
+                    fn_button.set('label', '<span class="yui-toolbar-fontname-' + _cleanClassName(family) + '">' + family + '</span>');
+                    this._updateMenuChecked('fontname', family);
+                }
+
+                var fs_button = this.toolbar.getButtonByValue('fontsize');
+                if (fs_button) {
+                    fontsize = parseInt(Dom.getStyle(elm, 'fontSize'));
+                    if ((fontsize == null) || isNaN(fontsize)) {
+                        fontsize = fs_button._configs.label._initialConfig.value;
+                    }
+                    fs_button.set('label', ''+fontsize);
+                }
+
+                if (tag.substring(0, 1) == 'h') {
+                    var hd_button = this.toolbar.getButtonByValue('heading');
+                    if (hd_button) {
+                        for (var b = 0; b < hd_button._configs.menu.value.length; b++) {
+                            if (hd_button._configs.menu.value[b].value.toLowerCase() == tag) {
+                                hd_button.set('label', hd_button._configs.menu.value[b].text);
+                            }
+                        }
+                        this._updateMenuChecked('heading', tag);
+                    }
+                }
+            }
+            
+            if (elm && elm.tagName && (elm.tagName.toLowerCase() != 'body')) {
+                this.toolbar.enableButton(fn_button);
+                this.toolbar.enableButton(fs_button);
+            }
+            
+        },
+        /**
+        * @private
+        * @method _handleInsertImageClick
+        * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked.
+        */
+        _handleInsertImageClick: function() {
+            //this.toolbar.disableButton(this.toolbar.getButtonByValue('insertimage'));
+            this.on('afterExecCommand', function() {
+                var el = this.currentElement[0],
+                    title = '',
+                    src = '',
+                    align = '',
+                    height = 75,
+                    width = 75,
+                    padding = 0,
+                    blankimage = false,
+                    win = new YAHOO.widget.EditorWindow('insertimage', {
+                        width: '415px'
+                    });
+
+                if (!el) {
+                    el = this._getSelectedElement();
+                }
+                if (el) {
+                    if (el.getAttribute('src')) {
+                        src = el.getAttribute('src', 2);
+                        if (src.indexOf(this.get('blankimage')) != -1) {
+                            src = this.STR_IMAGE_HERE;
+                            blankimage = true;
+                        }
+                    }
+                    if (el.getAttribute('alt', 2)) {
+                        title = el.getAttribute('alt', 2);
+                    }
+                    if (el.getAttribute('title', 2)) {
+                        title = el.getAttribute('title', 2);
+                    }
+                    height = parseInt(el.height);
+                    width = parseInt(el.width);
+                    if (el.style.height) {
+                        height = parseInt(el.style.height);
+                    }
+                    if (el.style.width) {
+                        width = parseInt(el.style.width);
+                    }
+                    if (el.style.margin) {
+                        padding = parseInt(el.style.margin);
+                    }
+                    if (!el._height) {
+                        el._height = height;
+                    }
+                    if (!el._width) {
+                        el._width = width;
+                    }
+                    var oheight = el._height;
+                    var owidth = el._width;
+                }
+                if (!win.cache) {
+                    var str = '<label for="insertimage_url"><strong>' + this.STR_IMAGE_URL + ':</strong> <input type="text" id="insertimage_url" value="' + src + '" size="40"></label>';
+                    var body = document.createElement('div');
+                    body.innerHTML = str;
+
+                    var tbarCont = document.createElement('div');
+                    tbarCont.id = 'img_toolbar';
+                    body.appendChild(tbarCont);
+
+                    var str2 = '<label for="insertimage_title"><strong>' + this.STR_IMAGE_TITLE + ':</strong> <input type="text" id="insertimage_title" value="' + title + '" size="40"></label>';
+                    var div = document.createElement('div');
+                    div.innerHTML = str2;
+                    body.appendChild(div);
+                    win.cache = body;
+                } else {
+                    body = win.cache;
+                }
+
+                var tbar = new YAHOO.widget.Toolbar(tbarCont, {
+                    /* {{{ */ 
+                    buttons: [
+                        { group: 'padding', label: this.STR_IMAGE_PADDING + ':',
+                            buttons: [
+                                { type: 'spin', label: ''+padding, value: 'padding', range: [0, 50] }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'border', label: this.STR_IMAGE_BORDER + ':',
+                            buttons: [
+                                { type: 'select', label: 'Border Size', value: 'bordersize',
+                                    menu: [
+                                        { text: 'none', value: '0', checked: true },
+                                        { text: '----', value: '1' },
+                                        { text: '----', value: '2' },
+                                        { text: '----', value: '3' },
+                                        { text: '----', value: '4' },
+                                        { text: '----', value: '5' }
+                                    ]
+                                },
+                                { type: 'select', label: 'Border Type', value: 'bordertype', disabled: true,
+                                    menu: [
+                                        { text: '----', value: 'solid', checked: true },
+                                        { text: '----', value: 'dashed' },
+                                        { text: '----', value: 'dotted' }
+                                    ]
+                                },
+                                { type: 'color', label: 'Border Color', value: 'bordercolor', disabled: true }
+                            ]
+                        },
+                        { type: 'separator' },
+                        { group: 'textflow', label: this.STR_IMAGE_TEXTFLOW + ':',
+                            buttons: [
+                                { type: 'push', label: 'Left', value: 'left' },
+                                { type: 'push', label: 'Inline', value: 'inline' },
+                                { type: 'push', label: 'Block', value: 'block' },
+                                { type: 'push', label: 'Right', value: 'right' }
+                            ]
+                        }
+                    ]
+                    /* }}} */
+                });
+                
+                var bsize = '0';
+                var btype = 'solid';
+                if (el.style.borderLeftWidth) {
+                    bsize = parseInt(el.style.borderLeftWidth);
+                }
+                if (el.style.borderLeftStyle) {
+                    btype = el.style.borderLeftStyle;
+                }
+                var bs_button = tbar.getButtonByValue('bordersize');
+                var bSizeStr = ((parseInt(bsize) > 0) ? '----' : 'none');
+                bs_button.set('label', '<span class="yui-toolbar-bordersize-' + bsize + '">'+bSizeStr+'</span>');
+                this._updateMenuChecked('bordersize', bsize, tbar);
+
+                var bs_button = tbar.getButtonByValue('bordertype');
+                bs_button.set('label', '<span class="yui-toolbar-bordertype-' + btype + '">----</span>');
+                this._updateMenuChecked('bordertype', btype, tbar);
+                if (parseInt(bsize) > 0) {
+                    tbar.enableButton(tbar.getButtonByValue('bordertype'));
+                    tbar.enableButton(tbar.getButtonByValue('bordercolor'));
+                }
+
+                var cont = tbar.get('cont');
+                var hw = document.createElement('div');
+                hw.className = 'yui-toolbar-group yui-toolbar-group-padding height-width';
+                hw.innerHTML = '<h3>' + this.STR_IMAGE_SIZE + ':</h3>';
+                var orgSize = '';
+                if ((height != oheight) || (width != owidth)) {
+                    orgSize = '<span class="info">' + this.STR_IMAGE_ORIG_SIZE + '<br>'+ owidth +' x ' + oheight + '</span>';
+                }
+                hw.innerHTML += '<span><input type="text" size="3" value="'+width+'" id="insertimage_width"> x <input type="text" size="3" value="'+height+'" id="insertimage_height"></span>' + orgSize;
+                cont.insertBefore(hw, cont.firstChild);
+
+                Event.onAvailable('insertimage_width', function() {
+                    Event.on('insertimage_width', 'blur', function() {
+                        var value = parseInt(Dom.get('insertimage_width').value);
+                        if (value > 5) {
+                            el.style.width = value + 'px';
+                            this.moveWindow();
+                        }
+                    }, this, true);
+                }, this, true);
+                Event.onAvailable('insertimage_height', function() {
+                    Event.on('insertimage_height', 'blur', function() {
+                        var value = parseInt(Dom.get('insertimage_height').value);
+                        if (value > 5) {
+                            el.style.height = value + 'px';
+                            this.moveWindow();
+                        }
+                    }, this, true);
+                }, this, true);
+
+                if (el.align == 'right') {
+                    tbar.selectButton(tbar.getButtonByValue('right'));
+                } else if (el.align == 'left') {
+                    tbar.selectButton(tbar.getButtonByValue('left'));
+                } else if (el.style.display == 'block') {
+                    tbar.selectButton(tbar.getButtonByValue('block'));
+                } else {
+                    tbar.selectButton(tbar.getButtonByValue('inline'));
+                }
+                if (parseInt(el.style.marginLeft) > 0) {
+                     tbar.getButtonByValue('padding').set('label', ''+parseInt(el.style.marginLeft));
+                }
+                if (el.style.borderSize) {
+                    tbar.selectButton(tbar.getButtonByValue('bordersize'));
+                    tbar.selectButton(tbar.getButtonByValue(parseInt(el.style.borderSize)));
+                }
+
+                tbar.on('colorPickerClicked', function(o) {
+                    var size = '1', type = 'solid', color = 'black';
+
+                    if (el.style.borderLeftWidth) {
+                        size = parseInt(el.style.borderLeftWidth);
+                    }
+                    if (el.style.borderLeftStyle) {
+                        type = el.style.borderLeftStyle;
+                    }
+                    if (el.style.borderLeftColor) {
+                        color = el.style.borderLeftColor;
+                    }
+                    var borderString = size + 'px ' + type + ' #' + o.color;
+                    el.style.border = borderString;
+                }, this.toolbar, true);
+
+                tbar.on('buttonClick', function(o) {
+                    var value = o.button.value;
+                    if (o.button.menucmd) {
+                        value = o.button.menucmd
+                    }
+                    var size = '1', type = 'solid', color = 'black';
+
+                    /* All border calcs are done on the left border
+                        since our default interface only supports
+                        one border size/type and color */
+                    if (el.style.borderLeftWidth) {
+                        size = parseInt(el.style.borderLeftWidth);
+                    }
+                    if (el.style.borderLeftStyle) {
+                        type = el.style.borderLeftStyle;
+                    }
+                    if (el.style.borderLeftColor) {
+                        color = el.style.borderLeftColor;
+                    }
+                    switch(value) {
+                        case 'bordersize':
+                            var borderString = parseInt(o.button.value) + 'px ' + type + ' ' + color;
+                            el.style.border = borderString;
+                            if (parseInt(o.button.value) > 0) {
+                                tbar.enableButton(tbar.getButtonByValue('bordertype'));
+                                tbar.enableButton(tbar.getButtonByValue('bordercolor'));
+                            } else {
+                                tbar.disableButton(tbar.getButtonByValue('bordertype'));
+                                tbar.disableButton(tbar.getButtonByValue('bordercolor'));
+                            }
+                            break;
+                        case 'bordertype':
+                            var borderString = size + 'px ' + o.button.value + ' ' + color;
+                            el.style.border = borderString;
+                            break;
+                        case 'right':
+                        case 'left':
+                            tbar.deselectAllButtons();
+                            el.style.display = '';
+                            el.align = o.button.value;
+                            break;
+                        case 'inline':
+                            tbar.deselectAllButtons();
+                            el.style.display = '';
+                            el.align = '';
+                            break;
+                        case 'block':
+                            tbar.deselectAllButtons();
+                            el.style.display = 'block';
+                            el.align = 'center';
+                            break;
+                        case 'padding':
+                            var _button = tbar.getButtonById(o.button.id);
+                            el.style.margin = _button.get('label') + 'px';
+                            break;
+                    }
+                    tbar.selectButton(tbar.getButtonByValue(o.button.value));
+                    this.moveWindow();
+                }, this, true);
+
+                win.setHeader(this.STR_IMAGE_PROP_TITLE);
+                win.setBody(body);
+                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
+                    var str = this.STR_IMAGE_COPY;
+                    win.setFooter(str);
+                }
+                this.openWindow(win);
+
+
+                //Set event after openWindow..
+                Event.onAvailable('insertimage_url', function() {
+                    window.setTimeout(function() {
+                        YAHOO.util.Dom.get('insertimage_url').focus();
+                        if (blankimage) {
+                            YAHOO.util.Dom.get('insertimage_url').select();
+                        }
+                    }, 50);
+                    
+                    if (this.get('localFileWarning')) {
+                        Event.on('insertimage_url', 'blur', function() {
+                            var url = Dom.get('insertimage_url');
+                            if ((url.value != '') && ((url.value.indexOf('file:/') != -1) || (url.value.indexOf(':\\') != -1))) {
+                                //Local File throw Warning
+                                Dom.addClass(url, 'warning');
+                                var str = this.STR_LOCAL_FILE_WARNING;
+                                this.get('panel').setFooter(str);
+                            } else {
+                                Dom.removeClass(url, 'warning');
+                                this.get('panel').setFooter(' ');
+                                if ((this.browser.webkit && !this.browser.webkit3) || this.browser.opera) {
+                                    var str = this.STR_IMAGE_COPY;
+                                    this.get('panel').setFooter(str);
+                                }
+                                
+                                if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
+                                    this.currentElement[0].setAttribute('src', url.value);
+                                    var img = new Image();
+                                    var self = this;
+                                    window.setTimeout(function() {
+                                        YAHOO.util.Dom.get('insertimage_height').value = img.height;
+                                        YAHOO.util.Dom.get('insertimage_width').value = img.width;
+                                        if (!self.currentElement[0]._height) {
+                                            self.currentElement[0]._height = img.height;
+                                        }
+                                        if (!self.currentElement[0]._width) {
+                                            self.currentElement[0]._width = img.width;
+                                        }
+                                        self.moveWindow();
+                                    }, 200);
+
+                                    img.src = url.value;
+                                }
+                            }
+                        }, this, true);
+                    }
+                }, this, true);
+            });
+        },
+        /**
+        * @private
+        * @method _handleInsertImageWindowClose
+        * @description Handles the closing of the Image Properties Window.
+        */
+        _handleInsertImageWindowClose: function() {
+            var url = Dom.get('insertimage_url');
+            var title = Dom.get('insertimage_title');
+            var el = this.currentElement[0];
+            if (url && url.value && (url.value != this.STR_IMAGE_HERE)) {
+                el.setAttribute('src', url.value);
+                el.setAttribute('title', title.value);
+                el.setAttribute('alt', title.value);
+                //this.toolbar.enableButton(this.toolbar.getButtonByValue('insertimage'));
+            } else {
+                //No url/src given, remove the node from the document
+                el.parentNode.removeChild(el);
+            }
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkClick
+        * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked.
+        */
+        _handleCreateLinkClick: function() {
+            this.on('afterExecCommand', function() {
+
+                var win = new YAHOO.widget.EditorWindow('createlink', {
+                    width: '300px'
+                });
+                
+                var el = this.currentElement[0],
+                    url = '',
+                    title = '',
+                    target = '',
+                    localFile = false;
+                if (el) {
+                    if (el.getAttribute('href') != null) {
+                        url = el.getAttribute('href');
+                        if ((url != '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) {
+                            //Local File throw Warning
+                            var str = this.STR_LOCAL_FILE_WARNING;
+                            win.setFooter(str);
+                            localFile = true;
+                        } else {
+                            win.setFooter(' ');
+                        }
+                    }
+                    if (el.getAttribute('title') != null) {
+                        title = el.getAttribute('title');
+                    }
+                    if (el.getAttribute('target') != null) {
+                        target = el.getAttribute('target');
+                    }
+                }
+                var str = '<label for="createlink_url"><strong>' + this.STR_LINK_URL + ':</strong> <input type="text" name="createlink_url" id="createlink_url" value="' + url + '"' + ((localFile) ? ' class="warning"' : '') + '></label>';
+                str += '<label for="createlink_target"><strong>&nbsp;</strong><input type="checkbox" name="createlink_target_" id="createlink_target" value="_blank"' + ((target) ? ' checked' : '') + '> ' + this.STR_LINK_NEW_WINDOW + '</label>';
+                str += '<label for="createlink_title"><strong>' + this.STR_LINK_TITLE + ':</strong> <input type="text" name="createlink_title" id="createlink_title" value="' + title + '"></label>';
+                
+                var body = document.createElement('div');
+                body.innerHTML = str;
+
+                var unlinkCont = document.createElement('div');
+                unlinkCont.className = 'removeLink';
+                var unlink = document.createElement('a');
+                unlink.href = '#';
+                unlink.innerHTML = this.STR_LINK_PROP_REMOVE;
+                unlink.title = this.STR_LINK_PROP_REMOVE;
+                Event.on(unlink, 'click', function(ev) {
+                    Event.stopEvent(ev);
+                    this.execCommand('unlink');
+                    this.closeWindow();
+                }, this, true);
+                unlinkCont.appendChild(unlink);
+                body.appendChild(unlinkCont);
+
+                win.setHeader(this.STR_LINK_PROP_TITLE);
+                win.setBody(body);
+
+                Event.onAvailable('createlink_url', function() {
+                    window.setTimeout(function() {
+                        try {
+                            YAHOO.util.Dom.get('createlink_url').focus();
+                        } catch (e) {}
+                    }, 50);
+                    Event.on('createlink_url', 'blur', function() {
+                        var url = Dom.get('createlink_url');
+                        if ((url.value != '') && ((url.value.indexOf('file:/') != -1) || (url.value.indexOf(':\\') != -1))) {
+                            //Local File throw Warning
+                            Dom.addClass(url, 'warning');
+                            var str = this.STR_LOCAL_FILE_WARNING;
+                            this.get('panel').setFooter(str);
+                        } else {
+                            Dom.removeClass(url, 'warning');
+                            this.get('panel').setFooter(' ');
+                        }
+                    }, this, true);
+                }, this, true);
+
+                this.openWindow(win);
+            });
+        },
+        /**
+        * @private
+        * @method _handleCreateLinkWindowClose
+        * @description Handles the closing of the Link Properties Window.
+        */
+        _handleCreateLinkWindowClose: function() {
+            var url = Dom.get('createlink_url');
+            var target = Dom.get('createlink_target');
+            var title = Dom.get('createlink_title');
+            var el = this.currentElement[0];
+            if (url && url.value) {
+                var urlValue = url.value;
+                if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                    if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) {
+                        //Found an @ sign, prefix with mailto:
+                        urlValue = 'mailto:' + urlValue;
+                    } else {
+                        /* :// not found adding */
+                        urlValue = 'http:/'+'/' + urlValue;
+                    }
+                }
+                el.setAttribute('href', urlValue);
+                if (target.checked) {
+                    el.setAttribute('target', target.value);
+                } else {
+                    el.setAttribute('target', '');
+                }
+                el.setAttribute('title', ((title.value) ? title.value : ''));
+
+            } else {
+                el.removeAttribute('tag');
+                Dom.removeClass(el, 'yui-tag-a');
+                Dom.removeClass(el, 'yui-tag');
+                Dom.addClass(el, 'yui-non');
+            }
+            this.nodeChange();
+        },
+        /**
+        * @method render
+        * @description Causes the toolbar and the editor to render and replace the textarea.
+        */
+        render: function() {
+            if (!this.DOMReady) {
+                this._queue[this._queue.length] = ['render', arguments];
+                return false;
+            }
+            var self = this;
+            var tbarConf = this.get('toolbar');
+            //Set the toolbar to disabled until content is loaded
+            tbarConf.disabled = true;
+            //Create Toolbar instance
+            this.toolbar = new Toolbar(this.get('toolbar_cont'), tbarConf);
+            this.fireEvent('toolbarLoaded', { type: 'toolbarLoaded', target: this.toolbar });
+
+            
+            this.toolbar.on('toolbarCollapsed', function() {
+                if (this.currentWindow) {
+                    this.moveWindow();
+                }
+            }, this, true);
+            this.toolbar.on('toolbarExpanded', function() {
+                if (this.currentWindow) {
+                    this.moveWindow();
+                }
+            }, this, true);
+            this.toolbar.on('fontsizeClick', function(o) {
+                this._handleFontSize(o);
+            }, this, true);
+            
+            this.toolbar.on('colorPickerClicked', function(o) {
+                this._handleColorPicker(o);
+            }, this, true);
+
+            this.toolbar.on('alignClick', function(o) {
+                this._handleAlign(o);
+            }, this, true);
+            this.on('afterNodeChange', function() {
+                this._handleAfterNodeChange();
+            }, this, true);
+            this.toolbar.on('insertimageClick', function() {
+                this._handleInsertImageClick();
+            }, this, true);
+            this.on('windowinsertimageClose', function() {
+                this._handleInsertImageWindowClose();
+            }, this, true);
+            this.toolbar.on('createlinkClick', function() {
+                this._handleCreateLinkClick();
+            }, this, true);
+            this.on('windowcreatelinkClose', function() {
+                this._handleCreateLinkWindowClose();
+            }, this, true);
+
+
+            //Replace Textarea with editable area
+            
+            this.get('parentNode').replaceChild(this.get('element_cont').get('element'), this.get('element'));
+
+
+            if (!this.beforeElement) {
+                this.beforeElement = document.createElement('h2');
+                this.beforeElement.className = 'yui-editor-skipheader';
+                this.beforeElement.tabIndex = '-1';
+                this.beforeElement.innerHTML = this.STR_BEFORE_EDITOR;
+                this.get('element_cont').get('firstChild').insertBefore(this.beforeElement, this.toolbar.get('nextSibling'));
+            }
+            
+            Dom.setStyle(this.get('textarea'), 'display', 'none');
+            this.get('element_cont').appendChild(this.get('element'));
+            this.get('element_cont').setStyle('display', 'block');
+
+
+            //Set height and width of editor container
+            this.get('element_cont').setStyle('width', this.get('width'));
+            Dom.setStyle(this.get('iframe').get('parentNode'), 'height', this.get('height'));
+
+            this.get('iframe').setStyle('width', '100%'); //WIDTH
+            //this.get('iframe').setStyle('_width', '99%'); //WIDTH
+            this.get('iframe').setStyle('height', '100%');
+
+
+            var self = this;
+            window.setTimeout(function() {
+                self._setInitialContent.call(self);
+            }, 10);
+            
+            this.fireEvent('afterRender', { type: 'afterRender', target: this });
+        },
+        /**
+        * @method execCommand
+        * @param {String} action The "execCommand" action to try to execute (Example: bold, insertimage, inserthtml)
+        * @param {String} value (optional) The value for a given action such as action: fontname value: 'Verdana'
+        * @description This method attempts to try and level the differences in the various browsers and their support for execCommand actions
+        */
+        execCommand: function(action, value) {
+            this.fireEvent('beforeExecCommand', { type: 'beforeExecCommand', target: this, args: arguments });
+            if (this.STOP_EXEC_COMMAND) {
+                this.STOP_EXEC_COMMAND = false;
+                return false;
+            }
+            this._setMarkupType(action);
+            if (this.browser.ie) {
+                this._getWindow().focus();
+            }
+            var exec = true;
+            var _sel = this._getSelection();
+            var _range = this._getRange();
+            var _selEl = this._getSelectedElement();
+            if (_selEl) {
+                _sel = _selEl;
+            }
+            switch (action.toLowerCase()) {
+                case 'heading':
+                    if (this.browser.ie) {
+                        action = 'formatblock';
+                    }
+                    if (value == 'none') {
+                        if ((_sel && _sel.tagName && (_sel.tagName.toLowerCase().substring(0,1) == 'h')) || (_sel && _sel.parentNode && _sel.parentNode.tagName && (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h'))) {
+                            if (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h') {
+                                _sel = _sel.parentNode;
+                            }
+                            var _span = this._getDoc().createElement('span');
+                            _span.className = 'yui-non';
+                            _span.innerHTML = _sel.innerHTML;
+                            _sel.parentNode.replaceChild(_span, _sel);
+                        }
+                        exec = false;
+                    } else {
+                        if (this.browser.ie || this.browser.webkit || this.browser.opera) {
+                            this._createCurrentElement(value);
+                            exec = false;
+                        }
+                    }
+                    break;
+                case 'backcolor':
+                    if (this.browser.gecko || this.browser.opera) {
+                        this._setEditorStyle(true);
+                        action = 'hilitecolor';
+                    }
+                    break;
+                case 'hiddenelements':
+                    this._showHidden();
+                    exec = false;
+                    break;
+                case 'unlink':
+                    //var el = this._getSelectedElement();
+                    var el = this.currentElement[0];
+                    el.removeAttribute('title');
+                    el.removeAttribute('tag');
+                    el.removeAttribute('target');
+                    el.removeAttribute('href');
+                    YAHOO.util.Dom.addClass(el, 'yui-non');
+                    YAHOO.util.Dom.removeClass(el, 'yui-tag-a');
+                    YAHOO.util.Dom.removeClass(el, 'yui-tag');
+                    exec = false;
+                    break;
+                case 'createlink':
+                    var el = this._getSelectedElement();
+                    if (!el || (el.getAttribute('tag') != 'a')) {
+                        this._createCurrentElement('a');
+                    } else {
+                        this.currentElement[0] = el;
+                    }
+                    exec = false;
+                    break;
+                case 'insertimage':
+                    if (value == '') {
+                        value = this.get('blankimage');
+                    }
+                    /**
+                    * @knownissue
+                    * @browser Safari 2.x
+                    * @description The issue here is that we have no way of knowing where the cursor position is
+                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+                    */
+                    
+                    var el = this._getSelectedElement();
+
+                    if (el && el.tagName && (el.tagName.toLowerCase() == 'img')) {
+                        this.currentElement[0] = el;
+                        exec = false;
+                    } else {
+                        if (this._getDoc().queryCommandEnabled(action)) {
+                            this._getDoc().execCommand('insertimage', false, value);
+                            var imgs = this._getDoc().getElementsByTagName('img');
+                            for (var i = 0; i < imgs.length; i++) {
+                                if (!YAHOO.util.Dom.hasClass(imgs[i], 'yui-img')) {
+                                    YAHOO.util.Dom.addClass(imgs[i], 'yui-img');
+                                    this.currentElement[0] = imgs[i];
+                                }
+                            }
+                            exec = false;
+                        } else {
+                            this._createCurrentElement('img');
+                            var _img = this._getDoc().createElement('img');
+                            _img.setAttribute('src', value);
+                            YAHOO.util.Dom.addClass(_img, 'yui-img');
+                            this.currentElement[0].parentNode.replaceChild(_img, this.currentElement[0]);
+                            this.currentElement[0] = _img;
+                            exec = false;
+                        }
+                    }
+                    
+                    break;
+                case 'inserthtml':
+                    /**
+                    * @knownissue
+                    * @browser Safari 2.x
+                    * @description The issue here is that we have no way of knowing where the cursor position is
+                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+                    */
+                    if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
+                        this._createCurrentElement('img');
+                        var _span = this._getDoc().createElement('span');
+                        _span.innerHTML = value;
+                        this.currentElement[0].parentNode.replaceChild(_span, this.currentElement[0]);
+                        exec = false;
+                    } else if (this.browser.ie) {
+                        var _range = this._getRange();
+                        if (_range.item) {
+                            _range.item(0).outerHTML = value;
+                        } else {
+                            _range.pasteHTML(value);
+                        }
+                        exec = false;                    
+                    }
+                    break;
+                case 'removeformat':
+                    /**
+                    * @knownissue Remove Format issue
+                    * @browser Safari 2.x
+                    * @description There is an issue here with Safari, that it may not always remove the format of the item that is selected.
+                    * Due to the way that Safari 2.x handles ranges, it is very difficult to determine what the selection holds.
+                    * So here we are making the best possible guess and acting on it.
+                    */
+                    if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) {
+                        this._createCurrentElement('span');
+                        YAHOO.util.Dom.addClass(this.currentElement[0], 'yui-non');
+                        var re= /<\S[^><]*>/g;
+                        var str = this.currentElement[0].innerHTML.replace(re, '');
+                        var _txt = this._getDoc().createTextNode(str);
+                        this.currentElement[0].parentNode.parentNode.replaceChild(_txt, this.currentElement[0].parentNode);
+                        
+                        exec = false;
+                    }
+                    break;
+                case 'superscript':
+                case 'subscript':
+                    if (this.browser.webkit) {
+                        var tag = action.toLowerCase().substring(0, 3);
+                        this._createCurrentElement(tag);
+                        if (this.currentElement[0].parentNode.tagName.toLowerCase() == tag) {
+                            var span = this._getDoc().createElement('span');
+                            span.innerHTML = this.currentElement[0].innerHTML;
+                            YAHOO.util.Dom.addClass(span, 'yui-non');
+                            this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
+
+                        } else {
+                            var _sub = this._getDoc().createElement(tag);
+                            _sub.innerHTML = this.currentElement[0].innerHTML;
+                            this.currentElement[0].parentNode.replaceChild(_sub, this.currentElement[0]);
+                        }
+                        exec = false;
+                    }
+                    break;
+                case 'formatblock':
+                    value = 'blockquote';
+                    if (this.browser.webkit) {
+                        this._createCurrentElement('blockquote');
+                        if (YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode, 'yui-tag-blockquote')) {
+                            var span = this._getDoc().createElement('span');
+                            span.innerHTML = this.currentElement[0].innerHTML;
+                            YAHOO.util.Dom.addClass(span, 'yui-non');
+                            this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
+                        }
+                        exec = false;
+                    } else {
+                        var tar = Event.getTarget(this.currentEvent);
+                        if (tar && tar.tagName && (tar.tagName.toLowerCase() == 'blockquote')) {
+                            var span = this._getDoc().createElement('span');
+                            span.innerHTML = tar.innerHTML;
+                            YAHOO.util.Dom.addClass(span, 'yui-non');
+                            tar.parentNode.replaceChild(span, tar);
+                            exec = false;
+                        }
+                    }
+                    break;
+                case 'indent':
+                case 'outdent':
+                    this._createCurrentElement(action.toLowerCase());
+                    if (this.currentElement[0].parentNode) {
+                        if (action.toLowerCase() == 'outdent') {
+                            if (YAHOO.util.Dom.hasClass(this.currentElement[0].parentNode, 'yui-tag-indent')) {
+                                var span = this._getDoc().createElement('span');
+                                span.innerHTML = this.currentElement[0].innerHTML;
+                                YAHOO.util.Dom.addClass(span, 'yui-non');
+                                this.currentElement[0].parentNode.parentNode.replaceChild(span, this.currentElement[0].parentNode);
+                            }
+                        }
+                    }
+                    exec = false;
+                    break;
+                case 'insertorderedlist':
+                case 'insertunorderedlist':
+                    /**
+                    * @knownissue Safari 2.+ doesn't support ordered and unordered lists
+                    * @browser Safari 2.x
+                    * The issue with this workaround is that when applied to a set of text
+                    * that has BR's in it, Safari may or may not pick up the individual items as
+                    * list items. This is fixed in WebKit (Safari 3)
+                    */
+                    var tag = ((action.toLowerCase() == 'insertorderedlist') ? 'ol' : 'ul');
+                    //if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) || this.browser.opera) {
+                    if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action))) {
+                        var selEl = this._getSelectedElement();
+                        if ((selEl.tagName.toLowerCase() == 'li') && (selEl.parentNode.tagName.toLowerCase() == tag)) {
+                            var el = selEl.parentNode;
+                            var list = this._getDoc().createElement('span');
+                            YAHOO.util.Dom.addClass(list, 'yui-non');
+                            var str = '';
+                            var lis = el.getElementsByTagName('li');
+                            for (var i = 0; i < lis.length; i++) {
+                                str += lis[i].innerHTML + '<br>';
+                            }
+                            list.innerHTML = str;
+
+                        } else {
+                            this._createCurrentElement(tag.toLowerCase());
+                            var el = this.currentElement[0];
+                            var list = this._getDoc().createElement(tag);
+                            if (tag == 'ol') {
+                                list.type = value;
+                            }
+                            var li = this._getDoc().createElement('li');
+                            li.innerHTML = el.innerHTML + '&nbsp;';
+                            list.appendChild(li);
+                        }
+                        el.parentNode.replaceChild(list, el);
+                        exec = false;
+                    } else {
+                        var el = this._getSelectedElement();
+                        if ((el.tagName.toLowerCase() == 'li') && (el.parentNode.tagName.toLowerCase() == tag) || (this.browser.ie && this._getRange().parentElement && this._getRange().parentElement.tagName && (this._getRange().parentElement.tagName.toLowerCase() == 'li'))) { //we are in a list..
+                            if (this.browser.ie) {
+                                exec = false;
+                                var str = '';
+                                var lis = el.parentNode.getElementsByTagName('li');
+                                for (var i = 0; i < lis.length; i++) {
+                                    str += lis[i].innerHTML + '<br>';
+                                }
+                                var newEl = this._getDoc().createElement('span');
+                                newEl.innerHTML = str;
+                                el.parentNode.parentNode.replaceChild(newEl, el.parentNode);
+                            } else {
+                                this.nodeChange();
+                                this._getDoc().execCommand(action, '', el.parentNode);
+                                this.nodeChange();
+                            }
+                        }
+                        if (this.browser.opera) {
+                            var self = this;
+                            window.setTimeout(function() {
+                                var lis = self._getDoc().getElementsByTagName('li');
+                                for (var i = 0; i < lis.length; i++) {
+                                    if (lis[i].innerHTML.toLowerCase() == '<br>') {
+                                        lis[i].parentNode.parentNode.removeChild(lis[i].parentNode);
+                                    }
+                                }
+                            },30);
+                        }
+                        if (this.browser.ie && exec) {
+                            var html = '';
+                            if (this._getRange().html) {
+                                html = '<li>' + this._getRange().html+ '</li>';
+                            } else {
+                                html = '<li>' + this._getRange().text + '</li>';
+                            }
+
+                            this._getRange().pasteHTML('<' + tag + '>' + html + '</' + tag + '>');
+                            exec = false;
+                        }
+                    }
+                    break;
+                case 'fontname':
+                    var selEl = this._getSelectedElement();
+                    this.currentFont = value;
+                    if (selEl && selEl.tagName && !this._hasSelection()) {
+                        YAHOO.util.Dom.setStyle(selEl, 'font-family', value);
+                        exec = false;
+                    }
+                    break;
+                case 'fontsize':
+                    if ((this.currentElement.length > 0) && (!this._hasSelection())) {
+                        YAHOO.util.Dom.setStyle(this.currentElement, 'fontSize', value);
+                    } else {
+                        this._createCurrentElement('span', {'fontSize': value });
+                    }
+                    exec = false;
+                    break;
+            }
+            if (exec) {
+                try {
+                    this._getDoc().execCommand(action, false, value);
+                } catch(e) {
+                }
+            } else {
+            }
+            this.on('afterExecCommand', function() {
+                this.unsubscribeAll('afterExecCommand');
+                this.nodeChange();
+            });
+            this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this });
+            
+        },
+        /**
+        * @private
+        * @method _createCurrentElement
+        * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create
+        * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element.
+        * @description This is a work around for the various browser issues with execCommand. This method will run <code>execCommand('fontname', false, 'yui-tmp')</code> on the given selection.
+        * It will then search the document for a span with the font-family set to <strong>yui-tmp</strong> and replace that with another span that has other information in it, then assign the new span to
+        * <code>this.currentElement</code>, so we now have an element reference to the element that was just modified. At this point we can use standard DOM manipulation to change it as we see fit.
+        */
+        _createCurrentElement: function(tagName, tagStyle) {
+            var tagName = ((tagName) ? tagName : 'a'),
+                sel = this._getSelection(),
+                tar = null,
+                el = [],
+                _doc = this._getDoc();
+            
+            if (this.currentFont) {
+                if (!tagStyle) {
+                    tagStyle = {};
+                }
+                tagStyle.fontFamily = this.currentFont;
+                this.currentFont = null;
+            }
+            this.currentElement = [];
+
+            var _elCreate = function() {
+                switch (tagName) {
+                    case 'h1':
+                    case 'h2':
+                    case 'h3':
+                    case 'h4':
+                    case 'h5':
+                    case 'h6':
+                        var el = _doc.createElement(tagName);
+                        break;
+                    default:
+                        var el = _doc.createElement('span');
+                        YAHOO.util.Dom.addClass(el, 'yui-tag-' + tagName);
+                        YAHOO.util.Dom.addClass(el, 'yui-tag');
+                        el.setAttribute('tag', tagName);
+                        el.tabIndex = 1;
+
+                        for (var i in tagStyle) {
+                            if (YAHOO.util.Lang.hasOwnProperty(tagStyle, i)) {
+                                el.style[i] = tagStyle[i];
+                            }
+                        }
+                        break;
+                }
+                return el;
+            };
+
+            if (!this._hasSelection()) {
+                if (this._getDoc().queryCommandEnabled('insertimage')) {
+                    this._getDoc().execCommand('insertimage', false, 'yui-tmp-img');
+                    var imgs = this._getDoc().getElementsByTagName('img');
+                    for (var i = 0; i < imgs.length; i++) {
+                        if (imgs[i].getAttribute('src', 2) == 'yui-tmp-img') {
+                            el = _elCreate();
+                            imgs[i].parentNode.replaceChild(el, imgs[i]);
+                            this.currentElement[this.currentElement.length] = el;
+                            //this.currentElement = el;
+                        }
+                    }
+                } else {
+                    if (this.currentEvent) {
+                        tar = YAHOO.util.Event.getTarget(this.currentEvent);
+                    } else {
+                        //For Safari..
+                        tar = this._getDoc().body;                        
+                    }
+                }
+                if (tar) {
+                    /**
+                    * @knownissue
+                    * @browser Safari 2.x
+                    * @description The issue here is that we have no way of knowing where the cursor position is
+                    * inside of the iframe, so we have to place the newly inserted data in the best place that we can.
+                    */
+                    el = _elCreate();
+                    if (tar.tagName.toLowerCase() == 'body') {
+                        tar.appendChild(el);
+                    } else if (tar.nextSibling) {
+                        tar.parentNode.insertBefore(el, tar.nextSibling);
+                    } else {
+                        tar.parentNode.appendChild(el);
+                    }
+                    //this.currentElement = el;
+                    this.currentElement[this.currentElement.length] = el;
+                    this.currentEvent = null;
+                    if (this.browser.webkit) {
+                        //Force Safari to focus the new element
+                        this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                        this._getSelection().collapse(true);   
+                    }
+                }
+            } else {
+                //Force CSS Styling for this action...
+                this._setEditorStyle(true);
+                this._getDoc().execCommand('fontname', false, 'yui-tmp');
+                var _tmp = [];
+                /* TODO: This needs to be cleaned up.. */
+                var _tmp1 = this._getDoc().getElementsByTagName('font');
+                var _tmp2 = this._getDoc().getElementsByTagName(this._getSelectedElement().tagName);
+                var _tmp3 = this._getDoc().getElementsByTagName('span');
+                var _tmp4 = this._getDoc().getElementsByTagName('i');
+                var _tmp5 = this._getDoc().getElementsByTagName('b');
+                for (var e = 0; e < _tmp1.length; e++) {
+                    _tmp[_tmp.length] = _tmp1[e];
+                }
+                for (var e = 0; e < _tmp2.length; e++) {
+                    _tmp[_tmp.length] = _tmp2[e];
+                }
+                for (var e = 0; e < _tmp3.length; e++) {
+                    _tmp[_tmp.length] = _tmp3[e];
+                }
+                for (var e = 0; e < _tmp4.length; e++) {
+                    _tmp[_tmp.length] = _tmp4[e];
+                }
+                for (var e = 0; e < _tmp5.length; e++) {
+                    _tmp[_tmp.length] = _tmp5[e];
+                }
+                for (var i = 0; i < _tmp.length; i++) {
+                    if ((YAHOO.util.Dom.getStyle(_tmp[i], 'font-family') == 'yui-tmp') || (_tmp[i].face && (_tmp[i].face == 'yui-tmp'))) {
+                        var el = _elCreate();
+                        el.innerHTML = _tmp[i].innerHTML;
+                        if (_tmp[i].parentNode) {
+                            _tmp[i].parentNode.replaceChild(el, _tmp[i]);
+                            //this.currentElement = el;
+                            this.currentElement[this.currentElement.length] = el;
+                            this.currentEvent = null;
+                            if (this.browser.webkit) {
+                                //Force Safari to focus the new element
+                                this._getSelection().setBaseAndExtent(el, 0, el, 0);
+                                this._getSelection().collapse(true);   
+                            }
+                            if (this.browser.ie && tagStyle && tagStyle.fontSize) {
+                                this._getSelection().empty();
+                            }
+                            if (this.browser.gecko) {
+                                this._getSelection().collapseToStart();
+                            }
+                        }
+                    }
+                }
+                var len = this.currentElement.length;
+                for (var i = 0; i < len; i++) {
+                    if ((i + 1) != len) { //Skip the last one in the list
+                        if (this.currentElement[i] && this.currentElement[i].nextSibling) {
+                            if (this.currentElement[i].tagName && (this.currentElement[i].tagName.toLowerCase() != 'br')) {
+                                this.currentElement[this.currentElement.length] = this.currentElement[i].nextSibling;
+                            }
+                        }
+                    }
+                }
+            }
+        },
+        /**
+        * @method saveHTML
+        * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea.
+        */
+        saveHTML: function() {
+            var html = this.cleanHTML();
+            this.get('textarea').value = html;
+            return html;
+        },
+        /**
+        * @method setEditorHTML
+        * @param {String} html The html content to load into the editor
+        * @description Loads HTML into the editors body
+        */
+        setEditorHTML: function(html) {
+            this._getDoc().body.innerHTML = html;
+            this.nodeChange();
+        },
+        /**
+        * @method getEditorHTML
+        * @description Gets the unprocessed/unfiltered HTML from the editor
+        */
+        getEditorHTML: function() {
+            return this._getDoc().body.innerHTML;
+        },
+        /**
+        * @method cleanHTML
+        * @param {String} html The unfiltered HTML
+        * @description Process the HTML with a few regexes to clean it up and stabilize the output
+        * @returns {String} The filtered HTML
+        */
+        cleanHTML: function(html) {
+            //Start Filtering Output
+            //Begin RegExs..
+            if (!html) { 
+                var html = this.getEditorHTML();
+            }
+            //Make some backups...
+                   html = html.replace(/<div><br><\/div>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>(&nbsp;|&#160;)<\/p>/g, '<YUI_BR>');            
+                   html = html.replace(/<p><br>&nbsp;<\/p>/gi, '<YUI_BR>');
+                   html = html.replace(/<p>&nbsp;<\/p>/gi, '<YUI_BR>');
+                   html = html.replace(/<br class="khtml-block-placeholder">/gi, '<YUI_BR>');
+                   html = html.replace(/<br>/gi, '<YUI_BR>');
+                   html = html.replace(/<br\/>/gi, '<YUI_BR>');
+                   html = html.replace(/<img([^>]*)>/gi, '<YUI_IMG$1>');
+                   html = html.replace(/<ul([^>]*)>/gi, '<YUI_UL$1>');
+                   html = html.replace(/<\/ul>/gi, '<\/YUI_UL>');
+
+            //Convert b and i tags to strong and em tags
+                   html = html.replace(/<i([^>]*)>/gi, '<em$1>');
+                   html = html.replace(/<\/i>/gi, '</em>');
+                   html = html.replace(/<b([^>]*)>/gi, '<strong$1>');
+                   html = html.replace(/<\/b>/gi, '</strong>');
+
+                   html = html.replace(/<font/gi, '<font');
+                   html = html.replace(/<\/font>/gi, '</font>');
+                   html = html.replace(/<span/gi, '<span');
+                   html = html.replace(/<\/span>/gi, '</span>');
+                   html = html.replace(/<u/gi, '<u');
+                   html = html.replace(/\/u>/gi, '/u>');
+
+                   html = html.replace(/<ol([^>]*)>/gi, '<ol$1>');
+                   html = html.replace(/\/ol>/gi, '/ol>');
+                   html = html.replace(/<li/gi, '<li');
+                   html = html.replace(/\/li>/gi, '/li>');
+
+            //Handle the sudo A tags
+            html = html.replace(new RegExp('<span ([^>]*) tag="a" ([^>]*)>([^>]*)<\/span>', 'gi'), '<a $1 $2>$3</a>');
+
+            //Safari only regexes
+            if (this.browser.webkit) {
+                //<DIV><SPAN class="Apple-style-span" style="line-height: normal;">Test THis</SPAN></DIV>
+                html = html.replace(/Apple-style-span/gi, '');
+                html = html.replace(/style="line-height: normal;"/gi, '');
+            }
+
+            //yui-tag-a yui-tag yui-non yui-img
+                   html = html.replace(/yui-tag-a/gi, '');
+                   html = html.replace(/yui-tag-span/gi, '');
+                   html = html.replace(/yui-tag/gi, '');
+                   html = html.replace(/yui-non/gi, '');
+                   html = html.replace(/yui-img/gi, '');
+                   html = html.replace(/ tag="span"/gi, '');
+                   html = html.replace(/ class=""/gi, '');
+                   html = html.replace(/ class=" "/gi, '');
+                   html = html.replace(/ class="  "/gi, '');
+                   html = html.replace(/ target=""/gi, '');
+                   html = html.replace(/ title=""/gi, '');
+
+            //Other string cleanup
+                   html = html.replace(/<br><li/gi, '<li');
+            //<P><br>&nbsp;</P>
+                   //html = html.replace(/<span >([^>]*)<\/span>/gi, '$1');
+                   //html = html.replace(/<div>([^>]*)<\/div>/gi, '$1');
+            
+            
+            //Replace our backups with the real thing
+                   html = html.replace(/<YUI_BR>/g, '<br>');
+                   html = html.replace(/<YUI_IMG([^>]*)>/g, '<img$1>');
+                   html = html.replace(/<YUI_UL([^>]*)>/g, '<ul$1>');
+                   html = html.replace(/<\/YUI_UL>/g, '<\/ul>');
+
+            return html;
+        },
+        /**
+        * @method clearEditorDoc
+        * @description Clear the doc of the Editor
+        */
+        clearEditorDoc: function() {
+            this._getDoc().body.innerHTML = '&nbsp;';
+        },
+        /**
+        * @private
+        * @method _renderPanel
+        * @description Renders the panel used for Editor Windows to the document so we can start using it..
+        * @returns {<a href="YAHOO.widget.Panel.html">YAHOO.widget.Panel</a>}
+        */
+        _renderPanel: function() {
+            if (!YAHOO.widget.EditorInfo.panel) {
+                var panel = new YAHOO.widget.Panel(this.EDITOR_PANEL_ID, {
+                    width: '300px',
+                    iframe: true,
+                    visible: false,
+                    underlay: 'none',
+                    draggable: false,
+                    close: false
+                });
+                YAHOO.widget.EditorInfo.panel = panel;
+            } else {
+                var panel = YAHOO.widget.EditorInfo.panel;
+            }
+            this.set('panel', panel);
+
+            this.get('panel').setBody('---');
+            this.get('panel').setHeader(' ');
+            this.get('panel').setFooter(' ');
+            if (this.DOMReady) {
+                this.get('panel').render(document.body);
+                Dom.addClass(this.get('panel').element, 'yui-editor-panel');
+            } else {
+                Event.onDOMReady(function() {
+                    this.get('panel').render(document.body);
+                    Dom.addClass(this.get('panel').element, 'yui-editor-panel');
+                }, this, true);
+            }
+            this.get('panel').showEvent.subscribe(function() {
+                YAHOO.util.Dom.setStyle(this.element, 'display', 'block');
+            });
+            return this.get('panel');
+        },
+        /**
+        * @method openWindow
+        * @param {<a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a>} win A <a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a> instance
+        * @description Opens a new "window/panel"
+        */
+        openWindow: function(win) {
+            this.toolbar.set('disabled', true); //Disable the toolbar when an editor window is open..
+            Event.addListener(document, 'keypress', this._closeWindow, this, true);
+            if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
+                YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
+            }
+            YAHOO.widget.EditorInfo.window.win = win;
+            YAHOO.widget.EditorInfo.window.scope = this;
+
+            var self = this,
+                xy = Dom.getXY(this.currentElement[0]),
+                elXY = Dom.getXY(this.get('iframe').get('element')),
+                panel = this.get('panel'),
+                newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)],
+                wWidth = (parseInt(win.attrs.width) / 2),
+                align = 'center';
+
+            this.fireEvent('beforeOpenWindow', { type: 'beforeOpenWindow', win: win, panel: panel });
+
+            body = document.createElement('div');
+            body.className = this.CLASS_PREFIX + '-body-cont';
+
+            var _note = document.createElement('h3');
+            _note.className = 'yui-editor-skipheader';
+            _note.innerHTML = this.STR_CLOSE_WINDOW_NOTE;
+            body.appendChild(_note);
+            form = document.createElement('form');
+            form.setAttribute('method', 'GET');
+            var windowName = win.name;
+            Event.addListener(form, 'submit', function(ev) {
+                var evName = 'window' + windowName + 'Submit';
+                self.fireEvent(evName, { type: evName, target: this });
+                Event.stopEvent(ev);
+            }, this, true);
+            body.appendChild(form);
+
+            Dom.setStyle(panel.element.firstChild, 'width', win.attrs.width);
+            if (Lang.isObject(win.body)) { //Assume it's a reference
+                form.appendChild(win.body);
+            } else { //Assume it's a string
+                var _tmp = document.createElement('div');
+                _tmp.innerHTML = win.body;
+                form.appendChild(_tmp);
+            }
+            var _close = document.createElement('span');
+            _close.innerHTML = 'X';
+            _close.title = this.STR_CLOSE_WINDOW;
+            _close.className = 'close';
+            Event.addListener(_close, 'click', function() {
+                this.closeWindow();
+            }, this, true);
+            var _knob = document.createElement('span');
+            _knob.innerHTML = '^';
+            _knob.className = 'knob';
+            win._knob = _knob;
+
+            var _header = document.createElement('h3');
+            _header.innerHTML = win.header;
+
+            panel.cfg.setProperty('width', win.attrs.width);
+            panel.setHeader(' '); //Clear the current header
+            panel.appendToHeader(_header);
+            _header.appendChild(_close);
+            _header.appendChild(_knob);
+            panel.setBody(' '); //Clear the current body
+            panel.setFooter(' '); //Clear the current footer
+            if (win.footer != null) {
+                panel.setFooter(win.footer);
+            }
+            panel.appendToBody(body); //Append the new DOM node to it
+            panel.showEvent.subscribe(function() {
+                Event.addListener(panel.element, 'click', function(ev) {
+                    Event.stopPropagation(ev);
+                });
+            }, this, true);
+            panel.hideEvent.subscribe(function() {
+                this.currentWindow = null;
+                var evName = 'window' + windowName + 'Close';
+                this.fireEvent(evName, { type: evName, target: this });
+
+            }, this, true);
+            this.currentWindow = win;
+            this.moveWindow(true);
+            panel.show();
+            this.fireEvent('afterOpenWindow', { type: 'afterOpenWindow', win: win, panel: panel });
+        },
+        /**
+        * @method moveWindow
+        * @param {Boolean} force Boolean to tell it to move but not use any animation (Usually done the first time the window is loaded.)
+        * @description Realign the window with the currentElement and reposition the knob above the panel.
+        */
+        moveWindow: function(force) {
+            if (!this.currentWindow) {
+                return false;
+            }
+            var win = this.currentWindow,
+                xy = Dom.getXY(this.currentElement[0]),
+                elXY = Dom.getXY(this.get('iframe').get('element')),
+                panel = this.get('panel'),
+                //newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)],
+                newXY = [(xy[0] + elXY[0]), (xy[1] + elXY[1])],
+                wWidth = (parseInt(win.attrs.width) / 2),
+                align = 'center',
+                orgXY = panel.cfg.getProperty('xy'),
+                _knob = win._knob;
+
+            newXY[0] = ((newXY[0] - wWidth) + 20);
+            //Account for the Scroll bars in a scrolled editor window.
+            newXY[0] = newXY[0] - Dom.getDocumentScrollLeft(this._getDoc());
+            newXY[1] = newXY[1] - Dom.getDocumentScrollTop(this._getDoc());
+            
+
+
+            if (this.currentElement[0].tagName && (this.currentElement[0].tagName.toLowerCase() == 'img')) {
+                if (this.currentElement[0].src.indexOf(this.get('blankimage')) != -1) {
+                    newXY[0] = (newXY[0] + (75 / 2)); //Placeholder size
+                    newXY[1] = (newXY[1] + 75); //Placeholder sizea
+                } else {
+                    var w = parseInt(this.currentElement[0].width);
+                    var h = parseInt(this.currentElement[0].height);
+                    newXY[0] = (newXY[0] + (w / 2));
+                    newXY[1] = (newXY[1] + h);
+                }
+                newXY[1] = newXY[1] + 15;
+            } else {
+                if (Dom.getStyle(this.currentElement[0], 'fontSize').indexOf('px') != -1) {
+                    newXY[1] = newXY[1] + parseInt(Dom.getStyle(this.currentElement[0], 'fontSize')) + 5;
+                } else {
+                    newXY[1] = newXY[1] + 20;
+                }
+            }
+            if (newXY[0] < elXY[0]) {
+                newXY[0] = elXY[0] + 5;
+                align = 'left';
+            }
+
+            if ((newXY[0] + (wWidth * 2)) > (elXY[0] + parseInt(this.get('iframe').get('element').clientWidth))) {
+                newXY[0] = ((elXY[0] + parseInt(this.get('iframe').get('element').clientWidth)) - (wWidth * 2) - 5);
+                align = 'right';
+            }
+            
+            try {
+                var xDiff = (newXY[0] - orgXY[0]);
+                var yDiff = (newXY[1] - orgXY[1]);
+            } catch (e) {
+                var xDiff = 0;
+                var yDiff = 0;
+            }
+            
+            //Convert negative numbers to positive so we can get the difference in distance
+            xDiff = ((xDiff < 0) ? (xDiff * -1) : xDiff);
+            yDiff = ((yDiff < 0) ? (yDiff * -1) : yDiff);
+
+            if (((xDiff > 10) || (yDiff > 10)) || force) { //Only move the window if it's supposed to move more than 10px or force was passed (new window)
+                var _knobLeft = 0,
+                    elW = 0;
+
+                if (this.currentElement[0].width) {
+                    elW = (parseInt(this.currentElement[0].width) / 2);
+                }
+
+                var leftOffset = xy[0] + elXY[0] + elW;
+                _knobLeft = leftOffset - newXY[0];
+                //Check to see if the knob will go off either side & reposition it
+                if (_knobLeft > (parseInt(win.attrs.width) - 40)) {
+                    _knobLeft = parseInt(win.attrs.width) - 40;
+                } else if (_knobLeft < 40) {
+                    _knobLeft = 40;
+                }
+                if (isNaN(_knobLeft)) {
+                    _knobLeft = 40;
+                }
+                if (force) {
+                    if (_knob) {
+                        _knob.style.left = _knobLeft + 'px';
+                    }
+                    if (this.get('animate')) {
+                        Dom.setStyle(panel.element, 'opacity', '0');
+                        var anim = new YAHOO.util.Anim(panel.element, {
+                            opacity: {
+                                from: 0,
+                                to: 1
+                            }
+                        }, .1, YAHOO.util.Easing.easeOut);
+                        panel.cfg.setProperty('xy', newXY);
+                        anim.onComplete.subscribe(function() {
+                            if (this.browser.ie) {
+                                panel.element.style.filter = 'none';
+                            }
+                        }, this, true);
+                        anim.animate();
+                    } else {
+                        panel.cfg.setProperty('xy', newXY);
+                    }
+                } else {
+                    if (this.get('animate')) {
+                        var anim = new YAHOO.util.Anim(panel.element, {}, .5, YAHOO.util.Easing.easeOut);
+                        anim.attributes = {
+                            top: {
+                                to: newXY[1]
+                            },
+                            left: {
+                                to: newXY[0]
+                            }
+                        }
+                        anim.onComplete.subscribe(function() {
+                            panel.cfg.setProperty('xy', newXY);
+                        });
+                        //We have to animate the iframe shim at the same time as the panel or we get scrollbar bleed ..
+                        var iframeAnim = new YAHOO.util.Anim(panel.iframe, anim.attributes, .5, YAHOO.util.Easing.easeOut)
+
+                        var _knobAnim = new YAHOO.util.Anim(_knob, {
+                            left: {
+                                to: _knobLeft
+                            }
+                        }, .75, YAHOO.util.Easing.easeOut);
+                        anim.animate();
+                        iframeAnim.animate();
+                        _knobAnim.animate();
+                    } else {
+                        _knob.style.left = _knobLeft + 'px';
+                        panel.cfg.setProperty('xy', newXY);
+                    }
+                }
+            }
+        },
+        /**
+        * @private
+        * @method _closeWindow
+        * @description Close the currently open EditorWindow with the Escape key.
+        * @param {Event} ev The keypress Event that we are trapping
+        */
+        _closeWindow: function(ev) {
+            if (ev.keyCode == 27) {
+                if (this.currentWindow) {
+                    this.closeWindow();
+                }
+            }
+        },
+        /**
+        * @method closeWindow
+        * @description Close the currently open EditorWindow.
+        */
+        closeWindow: function() {
+            YAHOO.widget.EditorInfo.window = {};
+            this.fireEvent('closeWindow', { type: 'closeWindow', win: this.currentWindow });
+            this.currentWindow = null;
+            this.get('panel').hide();
+            this.get('panel').cfg.setProperty('xy', [-900,-900]);
+            this.get('panel').syncIframe(); //Needed to move the iframe with the hidden panel
+            this.unsubscribeAll('afterExecCommand');
+            this.toolbar.set('disabled', false); //enable the toolbar now that the window is closed
+            this._focusWindow();
+            Event.removeListener(document, 'keypress', this._closeWindow);
+        },
+        /**
+        * @method destroy
+        * @description Destroys the editor, all of it's elements and objects.
+        * @return {Boolean}
+        */
+        destroy: function() {
+            this.saveHTML();
+            this.toolbar.destroy();
+            Dom.setStyle(this.get('textarea'), 'display', 'block');
+            var textArea = this.get('textarea');
+            this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element'));
+            this.get('element_cont').get('element').innerHTML = '';
+            //Brutal Object Destroy
+            for (var i in this) {
+                if (Lang.hasOwnProperty(this, i)) {
+                    this[i] = null;
+                }
+            }
+            return true;
+        },        
+        /**
+        * @method toString
+        * @description Returns a string representing the editor.
+        * @return {String}
+        */
+        toString: function() {
+            var str = 'Editor';
+            if (this.get && this.get('element_cont')) {
+                str = 'Editor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : ''));
+            }
+            return str;
+        }
+    });
+
+/**
+* @event toolbarLoaded
+* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterRender
+* @description Event is fired after the render process finishes. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorContentLoaded
+* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorMouseDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorDoubleClick
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyUp
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyPress
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event editorKeyDown
+* @param {Event} ev The DOM Event that occured
+* @description Passed through HTML Event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeNodeChange
+* @description Event fires at the beginning of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterNodeChange
+* @description Event fires at the end of the nodeChange process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeExecCommand
+* @description Event fires at the beginning of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterExecCommand
+* @description Event fires at the end of the execCommand process. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event beforeOpenWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Event fires before an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event afterOpenWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Event fires after an Editor Window is opened. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event closeWindow
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @description Event fires after an Editor Window is closed. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event windowCMDOpen
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is opened.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkOpen event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+/**
+* @event windowCMDClose
+* @param {<a href="YAHOO.widget.EditorWindow.html">EditorWindow</a>} win The EditorWindow object
+* @param {Overlay} panel The Overlay object that is used to create the window.
+* @description Dynamic event fired when an <a href="YAHOO.widget.EditorWindow.html">EditorWindow</a> is closed.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkClose event. See <a href="YAHOO.util.Element.html#addListener">Element.addListener</a> for more information on listening for this event.
+* @type YAHOO.util.CustomEvent
+*/
+
+/**
+     * @description Singleton object used to track the open window objects and panels across the various open editors
+     * @class EditorInfo
+     * @static
+    */
+    YAHOO.widget.EditorInfo = {
+        /**
+        * @private
+        * @property window
+        * @description A reference to the currently open window object in any editor on the page.
+        * @type Object <a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a>
+        */
+        window: {},
+        /**
+        * @private
+        * @property panel
+        * @description A reference to the currently open panel in any editor on the page.
+        * @type Object <a href="YAHOO.widget.Panel.html">YAHOO.widget.Panel</a>
+        */
+        panel: null
+    }
+
+    /**
+     * @description Class to hold Window information between uses. We use the same panel to show the windows, so using this will allow you to configure a window before it is shown.
+     * This is what you pass to Editor.openWindow();. These parameters will not take effect until the openWindow() is called in the editor.
+     * @class EditorWindow
+     * @param {String} name The name of the window.
+     * @param {Object} attrs Attributes for the window. Current attributes used are : height and width
+    */
+    YAHOO.widget.EditorWindow = function(name, attrs) {
+        /**
+        * @private
+        * @property name
+        * @description A unique name for the window
+        */
+        this.name = name.replace(' ', '_');
+        /**
+        * @private
+        * @property attrs
+        * @description The window attributes
+        */
+        this.attrs = attrs;
+    }
+
+    YAHOO.widget.EditorWindow.prototype = {
+        /**
+        * @private
+        * @property _cache
+        * @description Holds a cache of the DOM for the window so we only have to build it once..
+        */
+        _cache: null,
+        /**
+        * @private
+        * @property header
+        * @description Holder for the header of the window, used in Editor.openWindow
+        */
+        header: null,
+        /**
+        * @private
+        * @property body
+        * @description Holder for the body of the window, used in Editor.openWindow
+        */
+        body: null,
+        /**
+        * @private
+        * @property footer
+        * @description Holder for the footer of the window, used in Editor.openWindow
+        */
+        footer: null,
+        /**
+        * @method setHeader
+        * @description Sets the header for the window.
+        * @param {String/HTMLElement} str The string or DOM reference to be used as the windows header.
+        */
+        setHeader: function(str) {
+            this.header = str;
+        },
+        /**
+        * @method setBody
+        * @description Sets the body for the window.
+        * @param {String/HTMLElement} str The string or DOM reference to be used as the windows body.
+        */
+        setBody: function(str) {
+            this.body = str;
+        },
+        /**
+        * @method setFooter
+        * @description Sets the footer for the window.
+        * @param {String/HTMLElement} str The string or DOM reference to be used as the windows footer.
+        */
+        setFooter: function(str) {
+            this.footer = str;
+        },
+        /**
+        * @method toString
+        * @description Returns a string representing the EditorWindow.
+        * @return {String}
+        */
+        toString: function() {
+            return 'Editor Window (' + this.name + ')';
+        }
+    };
+
+
+    
+})();
+YAHOO.register("editor", YAHOO.widget.Editor, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/element/README b/lib/yui/element/README
new file mode 100755 (executable)
index 0000000..595f2b6
--- /dev/null
@@ -0,0 +1,20 @@
+Element Release Notes
+
+*** version 2.3.0 ***
+* setAttributes now sets in order configs were added
+* added subscribe alias for on/addListener
+
+** version 2.2.2 ***
+
+* fixed contentReady timing regression
+
+*** version 2.2.1 ***
+
+* Added support for "dblclick", "focus", "blur", and "submit" event (for elements that support them)
+* Fixed scope correction for addListener/on/subscribe
+
+*** version 2.2.0 ***
+
+* beta introduction (broken out of TabView for general use)
+
+* The Element class provides a wrapper for HTMLElements in the DOM and makes simpler common tasks such as adding listeners, manipulating the DOM, and setting and getting attributes.
diff --git a/lib/yui/element/element-beta-debug.js b/lib/yui/element/element-beta-debug.js
new file mode 100755 (executable)
index 0000000..f974b56
--- /dev/null
@@ -0,0 +1,957 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * Provides Attribute configurations.
+ * @namespace YAHOO.util
+ * @class Attribute
+ * @constructor
+ * @param hash {Object} The intial Attribute.
+ * @param {YAHOO.util.AttributeProvider} The owner of the Attribute instance.
+ */
+
+YAHOO.util.Attribute = function(hash, owner) {
+    if (owner) { 
+        this.owner = owner;
+        this.configure(hash, true);
+    }
+};
+
+YAHOO.util.Attribute.prototype = {
+       /**
+     * The name of the attribute.
+        * @property name
+        * @type String
+        */
+    name: undefined,
+    
+       /**
+     * The value of the attribute.
+        * @property value
+        * @type String
+        */
+    value: null,
+    
+       /**
+     * The owner of the attribute.
+        * @property owner
+        * @type YAHOO.util.AttributeProvider
+        */
+    owner: null,
+    
+       /**
+     * Whether or not the attribute is read only.
+        * @property readOnly
+        * @type Boolean
+        */
+    readOnly: false,
+    
+       /**
+     * Whether or not the attribute can only be written once.
+        * @property writeOnce
+        * @type Boolean
+        */
+    writeOnce: false,
+
+       /**
+     * The attribute's initial configuration.
+     * @private
+        * @property _initialConfig
+        * @type Object
+        */
+    _initialConfig: null,
+    
+       /**
+     * Whether or not the attribute's value has been set.
+     * @private
+        * @property _written
+        * @type Boolean
+        */
+    _written: false,
+    
+       /**
+     * The method to use when setting the attribute's value.
+     * The method recieves the new value as the only argument.
+        * @property method
+        * @type Function
+        */
+    method: null,
+    
+       /**
+     * The validator to use when setting the attribute's value.
+        * @property validator
+        * @type Function
+     * @return Boolean
+        */
+    validator: null,
+    
+    /**
+     * Retrieves the current value of the attribute.
+     * @method getValue
+     * @return {any} The current value of the attribute.
+     */
+    getValue: function() {
+        return this.value;
+    },
+    
+    /**
+     * Sets the value of the attribute and fires beforeChange and change events.
+     * @method setValue
+     * @param {Any} value The value to apply to the attribute.
+     * @param {Boolean} silent If true the change events will not be fired.
+     * @return {Boolean} Whether or not the value was set.
+     */
+    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) ) {
+            YAHOO.log( 'setValue ' + name + ', ' +  value +
+                    ' failed: read only', 'error', 'Attribute');
+            return false; // write not allowed
+        }
+        
+        if (this.validator && !this.validator.call(owner, value) ) {
+            YAHOO.log( 'setValue ' + name + ', ' + value +
+                    ' validation failed', 'error', 'Attribute');
+            return false; // invalid value
+        }
+
+        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;
+    },
+    
+    /**
+     * Allows for configuring the Attribute's properties.
+     * @method configure
+     * @param {Object} map A key-value map of Attribute properties.
+     * @param {Boolean} init Whether or not this should become the initial config.
+     */
+    configure: function(map, init) {
+        map = map || {};
+        this._written = false; // reset writeOnce
+        this._initialConfig = this._initialConfig || {};
+        
+        for (var key in map) {
+            if ( key && YAHOO.lang.hasOwnProperty(map, key) ) {
+                this[key] = map[key];
+                if (init) {
+                    this._initialConfig[key] = map[key];
+                }
+            }
+        }
+    },
+    
+    /**
+     * Resets the value to the initial config value.
+     * @method resetValue
+     * @return {Boolean} Whether or not the value was set.
+     */
+    resetValue: function() {
+        return this.setValue(this._initialConfig.value);
+    },
+    
+    /**
+     * Resets the attribute config to the initial config state.
+     * @method resetConfig
+     */
+    resetConfig: function() {
+        this.configure(this._initialConfig);
+    },
+    
+    /**
+     * Resets the value to the current value.
+     * Useful when values may have gotten out of sync with actual properties.
+     * @method refresh
+     * @return {Boolean} Whether or not the value was set.
+     */
+    refresh: function(silent) {
+        this.setValue(this.value, silent);
+    }
+};
+
+(function() {
+    var Lang = YAHOO.util.Lang;
+
+    /*
+    Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+    Code licensed under the BSD License:
+    http://developer.yahoo.net/yui/license.txt
+    */
+    
+    /**
+     * Provides and manages YAHOO.util.Attribute instances
+     * @namespace YAHOO.util
+     * @class AttributeProvider
+     * @uses YAHOO.util.EventProvider
+     */
+    YAHOO.util.AttributeProvider = function() {};
+    
+    YAHOO.util.AttributeProvider.prototype = {
+        
+        /**
+         * A key-value map of Attribute configurations
+         * @property _configs
+         * @protected (may be used by subclasses and augmentors)
+         * @private
+         * @type {Object}
+         */
+        _configs: null,
+        /**
+         * Returns the current value of the attribute.
+         * @method get
+         * @param {String} key The attribute whose value will be returned.
+         */
+        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;
+        },
+        
+        /**
+         * Sets the value of a config.
+         * @method set
+         * @param {String} key The name of the attribute
+         * @param {Any} value The value to apply to the attribute
+         * @param {Boolean} silent Whether or not to suppress change events
+         * @return {Boolean} Whether or not the value was set.
+         */
+        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);
+        },
+    
+        /**
+         * Returns an array of attribute names.
+         * @method getAttributeKeys
+         * @return {Array} An array of attribute names.
+         */
+        getAttributeKeys: function(){
+            var configs = this._configs;
+            var keys = [];
+            var config;
+            for (var key in configs) {
+                config = configs[key];
+                if ( Lang.hasOwnProperty(configs, key) && 
+                        !Lang.isUndefined(config) ) {
+                    keys[keys.length] = key;
+                }
+            }
+            
+            return keys;
+        },
+        
+        /**
+         * Sets multiple attribute values.
+         * @method setAttributes
+         * @param {Object} map  A key-value map of attributes
+         * @param {Boolean} silent Whether or not to suppress change events
+         */
+        setAttributes: function(map, silent){
+            for (var key in map) {
+                if ( Lang.hasOwnProperty(map, key) ) {
+                    this.set(key, map[key], silent);
+                }
+            }
+        },
+    
+        /**
+         * Resets the specified attribute's value to its initial value.
+         * @method resetValue
+         * @param {String} key The name of the attribute
+         * @param {Boolean} silent Whether or not to suppress change events
+         * @return {Boolean} Whether or not the value was set
+         */
+        resetValue: function(key, silent){
+            var configs = this._configs || {};
+            if (configs[key]) {
+                this.set(key, configs[key]._initialConfig.value, silent);
+                return true;
+            }
+            return false;
+        },
+    
+        /**
+         * Sets the attribute's value to its current value.
+         * @method refresh
+         * @param {String | Array} key The attribute(s) to refresh
+         * @param {Boolean} silent Whether or not to suppress change events
+         */
+        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 ( // only set if there is a value and not null
+                    configs[key[i]] && 
+                    ! Lang.isUndefined(configs[key[i]].value) &&
+                    ! Lang.isNull(configs[key[i]].value) ) {
+                    configs[key[i]].refresh(silent);
+                }
+            }
+        },
+    
+        /**
+         * Adds an Attribute to the AttributeProvider instance. 
+         * @method register
+         * @param {String} key The attribute's name
+         * @param {Object} map A key-value map containing the
+         * attribute's properties.
+         * @deprecated Use setAttributeConfig
+         */
+        register: function(key, map) {
+            this.setAttributeConfig(key, map);
+        },
+        
+        
+        /**
+         * Returns the attribute's properties.
+         * @method getAttributeConfig
+         * @param {String} key The attribute's name
+         * @private
+         * @return {object} A key-value map containing all of the
+         * attribute's properties.
+         */
+        getAttributeConfig: function(key) {
+            var configs = this._configs || {};
+            var config = configs[key] || {};
+            var map = {}; // returning a copy to prevent overrides
+            
+            for (key in config) {
+                if ( Lang.hasOwnProperty(config, key) ) {
+                    map[key] = config[key];
+                }
+            }
+    
+            return map;
+        },
+        
+        /**
+         * Sets or updates an Attribute instance's properties. 
+         * @method setAttributeConfig
+         * @param {String} key The attribute's name.
+         * @param {Object} map A key-value map of attribute properties
+         * @param {Boolean} init Whether or not this should become the intial config.
+         */
+        setAttributeConfig: function(key, map, init) {
+            var configs = this._configs || {};
+            map = map || {};
+            if (!configs[key]) {
+                map.name = key;
+                configs[key] = new YAHOO.util.Attribute(map, this);
+            } else {
+                configs[key].configure(map, init);
+            }
+        },
+        
+        /**
+         * Sets or updates an Attribute instance's properties. 
+         * @method configureAttribute
+         * @param {String} key The attribute's name.
+         * @param {Object} map A key-value map of attribute properties
+         * @param {Boolean} init Whether or not this should become the intial config.
+         * @deprecated Use setAttributeConfig
+         */
+        configureAttribute: function(key, map, init) {
+            this.setAttributeConfig(key, map, init);
+        },
+        
+        /**
+         * Resets an attribute to its intial configuration. 
+         * @method resetAttributeConfig
+         * @param {String} key The attribute's name.
+         * @private
+         */
+        resetAttributeConfig: function(key){
+            var configs = this._configs || {};
+            configs[key].resetConfig();
+        },
+        
+        /**
+         * Fires the attribute's beforeChange event. 
+         * @method fireBeforeChangeEvent
+         * @param {String} key The attribute's name.
+         * @param {Obj} e The event object to pass to handlers.
+         */
+        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);
+        },
+        
+        /**
+         * Fires the attribute's change event. 
+         * @method fireChangeEvent
+         * @param {String} key The attribute's name.
+         * @param {Obj} e The event object to pass to the handlers.
+         */
+        fireChangeEvent: function(e) {
+            e.type += 'Change';
+            return this.fireEvent(e.type, e);
+        }
+    };
+    
+    YAHOO.augment(YAHOO.util.AttributeProvider, YAHOO.util.EventProvider);
+})();
+
+(function() {
+// internal shorthand
+var Dom = YAHOO.util.Dom,
+    AttributeProvider = YAHOO.util.AttributeProvider;
+
+/**
+ * Element provides an wrapper object to simplify adding
+ * event listeners, using dom methods, and managing attributes. 
+ * @module element
+ * @namespace YAHOO.util
+ * @requires yahoo, dom, event
+ * @beta
+ */
+
+/**
+ * Element provides an wrapper object to simplify adding
+ * event listeners, using dom methods, and managing attributes. 
+ * @class Element
+ * @uses YAHOO.util.AttributeProvider
+ * @constructor
+ * @param el {HTMLElement | String} The html element that 
+ * represents the Element.
+ * @param {Object} map A key-value map of initial config names and values
+ */
+YAHOO.util.Element = function(el, map) {
+    if (arguments.length) {
+        this.init(el, map);
+    }
+};
+
+YAHOO.util.Element.prototype = {
+    /**
+     * Dom events supported by the Element instance.
+     * @property DOM_EVENTS
+     * @type Object
+     */
+    DOM_EVENTS: null,
+
+    /**
+     * Wrapper for HTMLElement method.
+     * @method appendChild
+     * @param {YAHOO.util.Element || HTMLElement} child The element to append. 
+     */
+    appendChild: function(child) {
+        child = child.get ? child.get('element') : child;
+        this.get('element').appendChild(child);
+    },
+    
+    /**
+     * Wrapper for HTMLElement method.
+     * @method getElementsByTagName
+     * @param {String} tag The tagName to collect
+     */
+    getElementsByTagName: function(tag) {
+        return this.get('element').getElementsByTagName(tag);
+    },
+    
+    /**
+     * Wrapper for HTMLElement method.
+     * @method hasChildNodes
+     * @return {Boolean} Whether or not the element has childNodes
+     */
+    hasChildNodes: function() {
+        return this.get('element').hasChildNodes();
+    },
+    
+    /**
+     * Wrapper for HTMLElement method.
+     * @method insertBefore
+     * @param {HTMLElement} element The HTMLElement to insert
+     * @param {HTMLElement} before The HTMLElement to insert
+     * the element before.
+     */
+    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);
+    },
+    
+    /**
+     * Wrapper for HTMLElement method.
+     * @method removeChild
+     * @param {HTMLElement} child The HTMLElement to remove
+     */
+    removeChild: function(child) {
+        child = child.get ? child.get('element') : child;
+        this.get('element').removeChild(child);
+        return true;
+    },
+    
+    /**
+     * Wrapper for HTMLElement method.
+     * @method replaceChild
+     * @param {HTMLElement} newNode The HTMLElement to insert
+     * @param {HTMLElement} oldNode The HTMLElement to replace
+     */
+    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);
+    },
+
+    
+    /**
+     * Registers Element specific attributes.
+     * @method initAttributes
+     * @param {Object} map A key-value map of initial attribute configs
+     */
+    initAttributes: function(map) {
+    },
+
+    /**
+     * Adds a listener for the given event.  These may be DOM or 
+     * customEvent listeners.  Any event that is fired via fireEvent
+     * can be listened for.  All handlers receive an event object. 
+     * @method addListener
+     * @param {String} type The name of the event to listen for
+     * @param {Function} fn The handler to call when the event fires
+     * @param {Any} obj A variable to pass to the handler
+     * @param {Object} scope The object to use for the scope of the handler 
+     */
+    addListener: function(type, fn, obj, scope) {
+        var el = this.get('element');
+        scope = scope || this;
+        
+        el = this.get('id') || el;
+        var self = this; 
+        if (!this._events[type]) { // create on the fly
+            if ( this.DOM_EVENTS[type] ) {
+                YAHOO.util.Event.addListener(el, type, function(e) {
+                    if (e.srcElement && !e.target) { // supplement IE with target
+                        e.target = e.srcElement;
+                    }
+                    self.fireEvent(type, e);
+                }, obj, scope);
+            }
+            
+            this.createEvent(type, this);
+        }
+        
+        YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); // notify via customEvent
+    },
+    
+    
+    /**
+     * Alias for addListener
+     * @method on
+     * @param {String} type The name of the event to listen for
+     * @param {Function} fn The function call when the event fires
+     * @param {Any} obj A variable to pass to the handler
+     * @param {Object} scope The object to use for the scope of the handler 
+     */
+    on: function() { this.addListener.apply(this, arguments); },
+    
+    /**
+     * Alias for addListener
+     * @method subscribe
+     * @param {String} type The name of the event to listen for
+     * @param {Function} fn The function call when the event fires
+     * @param {Any} obj A variable to pass to the handler
+     * @param {Object} scope The object to use for the scope of the handler 
+     */
+    subscribe: function() { this.addListener.apply(this, arguments); },
+    
+    /**
+     * Remove an event listener
+     * @method removeListener
+     * @param {String} type The name of the event to listen for
+     * @param {Function} fn The function call when the event fires
+     */
+    removeListener: function(type, fn) {
+        this.unsubscribe.apply(this, arguments);
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method addClass
+     * @param {String} className The className to add
+     */
+    addClass: function(className) {
+        Dom.addClass(this.get('element'), className);
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method getElementsByClassName
+     * @param {String} className The className to collect
+     * @param {String} tag (optional) The tag to use in
+     * conjunction with class name
+     * @return {Array} Array of HTMLElements
+     */
+    getElementsByClassName: function(className, tag) {
+        return Dom.getElementsByClassName(className, tag,
+                this.get('element') );
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method hasClass
+     * @param {String} className The className to add
+     * @return {Boolean} Whether or not the element has the class name
+     */
+    hasClass: function(className) {
+        return Dom.hasClass(this.get('element'), className); 
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method removeClass
+     * @param {String} className The className to remove
+     */
+    removeClass: function(className) {
+        return Dom.removeClass(this.get('element'), className);
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method replaceClass
+     * @param {String} oldClassName The className to replace
+     * @param {String} newClassName The className to add
+     */
+    replaceClass: function(oldClassName, newClassName) {
+        return Dom.replaceClass(this.get('element'), 
+                oldClassName, newClassName);
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method setStyle
+     * @param {String} property The style property to set
+     * @param {String} value The value to apply to the style property
+     */
+    setStyle: function(property, value) {
+        var el = this.get('element');
+        if (!el) {
+            return this._queue[this._queue.length] = ['setStyle', arguments];
+        }
+
+        return Dom.setStyle(el,  property, value); // TODO: always queuing?
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method getStyle
+     * @param {String} property The style property to retrieve
+     * @return {String} The current value of the property
+     */
+    getStyle: function(property) {
+        return Dom.getStyle(this.get('element'),  property);
+    },
+    
+    /**
+     * Apply any queued set calls.
+     * @method fireQueue
+     */
+    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]);
+        }
+    },
+    
+    /**
+     * Appends the HTMLElement into either the supplied parentNode.
+     * @method appendTo
+     * @param {HTMLElement | Element} parentNode The node to append to
+     * @param {HTMLElement | Element} before An optional node to insert before
+     */
+    appendTo: function(parent, before) {
+        parent = (parent.get) ?  parent.get('element') : Dom.get(parent);
+        
+        this.fireEvent('beforeAppendTo', {
+            type: 'beforeAppendTo',
+            target: parent
+        });
+        
+        
+        before = (before && before.get) ? 
+                before.get('element') : Dom.get(before);
+        var element = this.get('element');
+        
+        if (!element) {
+            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);
+        
+        this.fireEvent('appendTo', {
+            type: 'appendTo',
+            target: parent
+        });
+    },
+    
+    get: function(key) {
+        var configs = this._configs || {};
+        var el = configs.element; // avoid loop due to 'element'
+        if (el && !configs[key] && !YAHOO.lang.isUndefined(el.value[key]) ) {
+            return el.value[key];
+        }
+
+        return AttributeProvider.prototype.get.call(this, key);
+    },
+
+    setAttributes: function(map, silent){
+        var el = this.get('element');
+        for (var key in map) {
+            // need to configure if setting unconfigured HTMLElement attribute 
+            if ( !this._configs[key] && !YAHOO.lang.isUndefined(el[key]) ) {
+                this.setAttributeConfig(key);
+            }
+        }
+
+        // set based on configOrder
+        for (var i = 0, len = this._configOrder.length; i < len; ++i) {
+            if (map[this._configOrder[i]]) {
+                this.set(this._configOrder[i], map[this._configOrder[i]], silent);
+            }
+        }
+    },
+
+    set: function(key, value, silent) {
+        var el = this.get('element');
+        if (!el) {
+            this._queue[this._queue.length] = ['set', arguments];
+            if (this._configs[key]) {
+                this._configs[key].value = value; // so "get" works while queueing
+            
+            }
+            return;
+        }
+        
+        // set it on the element if not configured and is an HTML attribute
+        if ( !this._configs[key] && !YAHOO.lang.isUndefined(el[key]) ) {
+            _registerHTMLAttr.call(this, key);
+        }
+
+        return AttributeProvider.prototype.set.apply(this, arguments);
+    },
+    
+    setAttributeConfig: function(key, map, init) {
+        var el = this.get('element');
+
+        if (el && !this._configs[key] && !YAHOO.lang.isUndefined(el[key]) ) {
+            _registerHTMLAttr.call(this, key, map);
+        } else {
+            AttributeProvider.prototype.setAttributeConfig.apply(this, arguments);
+        }
+        this._configOrder.push(key);
+    },
+    
+    getAttributeKeys: function() {
+        var el = this.get('element');
+        var keys = AttributeProvider.prototype.getAttributeKeys.call(this);
+        
+        //add any unconfigured element keys
+        for (var key in el) {
+            if (!this._configs[key]) {
+                keys[key] = keys[key] || el[key];
+            }
+        }
+        
+        return keys;
+    },
+
+    createEvent: function(type, scope) {
+        this._events[type] = true;
+        AttributeProvider.prototype.createEvent.apply(this, arguments);
+    },
+    
+    init: function(el, attr) {
+        _initElement.apply(this, arguments); 
+    }
+};
+
+var _initElement = function(el, attr) {
+    this._queue = this._queue || [];
+    this._events = this._events || {};
+    this._configs = this._configs || {};
+    this._configOrder = []; 
+    attr = attr || {};
+    attr.element = attr.element || el || null;
+
+    this.DOM_EVENTS = {
+        'click': true,
+        'dblclick': true,
+        'keydown': true,
+        'keypress': true,
+        'keyup': true,
+        'mousedown': true,
+        'mousemove': true,
+        'mouseout': true, 
+        'mouseover': true, 
+        'mouseup': true,
+        'focus': true,
+        'blur': true,
+        'submit': true
+    };
+
+    var isReady = false;  // to determine when to init HTMLElement and content
+
+    if (YAHOO.lang.isString(el) ) { // defer until available/ready
+        _registerHTMLAttr.call(this, 'id', { value: attr.element });
+    }
+
+    if (Dom.get(el)) {
+        isReady = true;
+        _initHTMLElement.call(this, attr);
+        _initContent.call(this, attr);
+    } 
+
+    YAHOO.util.Event.onAvailable(attr.element, function() {
+        if (!isReady) { // otherwise already done
+            _initHTMLElement.call(this, attr);
+        }
+
+        this.fireEvent('available', { type: 'available', target: attr.element });  
+    }, this, true);
+    
+    YAHOO.util.Event.onContentReady(attr.element, function() {
+        if (!isReady) { // otherwise already done
+            _initContent.call(this, attr);
+        }
+        this.fireEvent('contentReady', { type: 'contentReady', target: attr.element });  
+    }, this, true);
+};
+
+var _initHTMLElement = function(attr) {
+    /**
+     * The HTMLElement the Element instance refers to.
+     * @config element
+     * @type HTMLElement
+     */
+    this.setAttributeConfig('element', {
+        value: Dom.get(attr.element),
+        readOnly: true
+     });
+};
+
+var _initContent = function(attr) {
+    this.initAttributes(attr);
+    this.setAttributes(attr, true);
+    this.fireQueue();
+
+};
+
+/**
+ * Sets the value of the property and fires beforeChange and change events.
+ * @private
+ * @method _registerHTMLAttr
+ * @param {YAHOO.util.Element} element The Element instance to
+ * register the config to.
+ * @param {String} key The name of the config to register
+ * @param {Object} map A key-value map of the config's params
+ */
+var _registerHTMLAttr = function(key, map) {
+    var el = this.get('element');
+    map = map || {};
+    map.name = key;
+    map.method = map.method || function(value) {
+        el[key] = value;
+    };
+    map.value = map.value || el[key];
+    this._configs[key] = new YAHOO.util.Attribute(map, this);
+};
+
+/**
+ * Fires when the Element's HTMLElement can be retrieved by Id.
+ * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> available<br>
+ * <code>&lt;HTMLElement&gt;
+ * target</code> the HTMLElement bound to this Element instance<br>
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var target = e.target};<br>
+ * myTabs.addListener('available', handler);</code></p>
+ * @event available
+ */
+/**
+ * Fires when the Element's HTMLElement subtree is rendered.
+ * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> contentReady<br>
+ * <code>&lt;HTMLElement&gt;
+ * target</code> the HTMLElement bound to this Element instance<br>
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var target = e.target};<br>
+ * myTabs.addListener('contentReady', handler);</code></p>
+ * @event contentReady
+ */
+
+
+YAHOO.augment(YAHOO.util.Element, AttributeProvider);
+})();
+
+YAHOO.register("element", YAHOO.util.Element, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/element/element-beta-min.js b/lib/yui/element/element-beta-min.js
new file mode 100755 (executable)
index 0000000..1def950
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
+YAHOO.util.Attribute=function(hash,owner){if(owner){this.owner=owner;this.configure(hash,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(value,silent){var beforeRetVal;var owner=this.owner;var name=this.name;var event={type:name,prevValue:this.getValue(),newValue:value};if(this.readOnly||(this.writeOnce&&this._written)){return false;}
+if(this.validator&&!this.validator.call(owner,value)){return false;}
+if(!silent){beforeRetVal=owner.fireBeforeChangeEvent(event);if(beforeRetVal===false){return false;}}
+if(this.method){this.method.call(owner,value);}
+this.value=value;this._written=true;event.type=name;if(!silent){this.owner.fireChangeEvent(event);}
+return true;},configure:function(map,init){map=map||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var key in map){if(key&&YAHOO.lang.hasOwnProperty(map,key)){this[key]=map[key];if(init){this._initialConfig[key]=map[key];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(silent){this.setValue(this.value,silent);}};(function(){var Lang=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(key){var configs=this._configs||{};var config=configs[key];if(!config){return undefined;}
+return config.value;},set:function(key,value,silent){var configs=this._configs||{};var config=configs[key];if(!config){return false;}
+return config.setValue(value,silent);},getAttributeKeys:function(){var configs=this._configs;var keys=[];var config;for(var key in configs){config=configs[key];if(Lang.hasOwnProperty(configs,key)&&!Lang.isUndefined(config)){keys[keys.length]=key;}}
+return keys;},setAttributes:function(map,silent){for(var key in map){if(Lang.hasOwnProperty(map,key)){this.set(key,map[key],silent);}}},resetValue:function(key,silent){var configs=this._configs||{};if(configs[key]){this.set(key,configs[key]._initialConfig.value,silent);return true;}
+return false;},refresh:function(key,silent){var configs=this._configs;key=((Lang.isString(key))?[key]:key)||this.getAttributeKeys();for(var i=0,len=key.length;i<len;++i){if(configs[key[i]]&&!Lang.isUndefined(configs[key[i]].value)&&!Lang.isNull(configs[key[i]].value)){configs[key[i]].refresh(silent);}}},register:function(key,map){this.setAttributeConfig(key,map);},getAttributeConfig:function(key){var configs=this._configs||{};var config=configs[key]||{};var map={};for(key in config){if(Lang.hasOwnProperty(config,key)){map[key]=config[key];}}
+return map;},setAttributeConfig:function(key,map,init){var configs=this._configs||{};map=map||{};if(!configs[key]){map.name=key;configs[key]=new YAHOO.util.Attribute(map,this);}else{configs[key].configure(map,init);}},configureAttribute:function(key,map,init){this.setAttributeConfig(key,map,init);},resetAttributeConfig:function(key){var configs=this._configs||{};configs[key].resetConfig();},fireBeforeChangeEvent:function(e){var type='before';type+=e.type.charAt(0).toUpperCase()+e.type.substr(1)+'Change';e.type=type;return this.fireEvent(e.type,e);},fireChangeEvent:function(e){e.type+='Change';return this.fireEvent(e.type,e);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var Dom=YAHOO.util.Dom,AttributeProvider=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(el,map){if(arguments.length){this.init(el,map);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(child){child=child.get?child.get('element'):child;this.get('element').appendChild(child);},getElementsByTagName:function(tag){return this.get('element').getElementsByTagName(tag);},hasChildNodes:function(){return this.get('element').hasChildNodes();},insertBefore:function(element,before){element=element.get?element.get('element'):element;before=(before&&before.get)?before.get('element'):before;this.get('element').insertBefore(element,before);},removeChild:function(child){child=child.get?child.get('element'):child;this.get('element').removeChild(child);return true;},replaceChild:function(newNode,oldNode){newNode=newNode.get?newNode.get('element'):newNode;oldNode=oldNode.get?oldNode.get('element'):oldNode;return this.get('element').replaceChild(newNode,oldNode);},initAttributes:function(map){},addListener:function(type,fn,obj,scope){var el=this.get('element');scope=scope||this;el=this.get('id')||el;var self=this;if(!this._events[type]){if(this.DOM_EVENTS[type]){YAHOO.util.Event.addListener(el,type,function(e){if(e.srcElement&&!e.target){e.target=e.srcElement;}
+self.fireEvent(type,e);},obj,scope);}
+this.createEvent(type,this);}
+YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},subscribe:function(){this.addListener.apply(this,arguments);},removeListener:function(type,fn){this.unsubscribe.apply(this,arguments);},addClass:function(className){Dom.addClass(this.get('element'),className);},getElementsByClassName:function(className,tag){return Dom.getElementsByClassName(className,tag,this.get('element'));},hasClass:function(className){return Dom.hasClass(this.get('element'),className);},removeClass:function(className){return Dom.removeClass(this.get('element'),className);},replaceClass:function(oldClassName,newClassName){return Dom.replaceClass(this.get('element'),oldClassName,newClassName);},setStyle:function(property,value){var el=this.get('element');if(!el){return this._queue[this._queue.length]=['setStyle',arguments];}
+return Dom.setStyle(el,property,value);},getStyle:function(property){return Dom.getStyle(this.get('element'),property);},fireQueue:function(){var queue=this._queue;for(var i=0,len=queue.length;i<len;++i){this[queue[i][0]].apply(this,queue[i][1]);}},appendTo:function(parent,before){parent=(parent.get)?parent.get('element'):Dom.get(parent);this.fireEvent('beforeAppendTo',{type:'beforeAppendTo',target:parent});before=(before&&before.get)?before.get('element'):Dom.get(before);var element=this.get('element');if(!element){return false;}
+if(!parent){return false;}
+if(element.parent!=parent){if(before){parent.insertBefore(element,before);}else{parent.appendChild(element);}}
+this.fireEvent('appendTo',{type:'appendTo',target:parent});},get:function(key){var configs=this._configs||{};var el=configs.element;if(el&&!configs[key]&&!YAHOO.lang.isUndefined(el.value[key])){return el.value[key];}
+return AttributeProvider.prototype.get.call(this,key);},setAttributes:function(map,silent){var el=this.get('element');for(var key in map){if(!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){this.setAttributeConfig(key);}}
+for(var i=0,len=this._configOrder.length;i<len;++i){if(map[this._configOrder[i]]){this.set(this._configOrder[i],map[this._configOrder[i]],silent);}}},set:function(key,value,silent){var el=this.get('element');if(!el){this._queue[this._queue.length]=['set',arguments];if(this._configs[key]){this._configs[key].value=value;}
+return;}
+if(!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){_registerHTMLAttr.call(this,key);}
+return AttributeProvider.prototype.set.apply(this,arguments);},setAttributeConfig:function(key,map,init){var el=this.get('element');if(el&&!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){_registerHTMLAttr.call(this,key,map);}else{AttributeProvider.prototype.setAttributeConfig.apply(this,arguments);}
+this._configOrder.push(key);},getAttributeKeys:function(){var el=this.get('element');var keys=AttributeProvider.prototype.getAttributeKeys.call(this);for(var key in el){if(!this._configs[key]){keys[key]=keys[key]||el[key];}}
+return keys;},createEvent:function(type,scope){this._events[type]=true;AttributeProvider.prototype.createEvent.apply(this,arguments);},init:function(el,attr){_initElement.apply(this,arguments);}};var _initElement=function(el,attr){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];attr=attr||{};attr.element=attr.element||el||null;this.DOM_EVENTS={'click':true,'dblclick':true,'keydown':true,'keypress':true,'keyup':true,'mousedown':true,'mousemove':true,'mouseout':true,'mouseover':true,'mouseup':true,'focus':true,'blur':true,'submit':true};var isReady=false;if(YAHOO.lang.isString(el)){_registerHTMLAttr.call(this,'id',{value:attr.element});}
+if(Dom.get(el)){isReady=true;_initHTMLElement.call(this,attr);_initContent.call(this,attr);}
+YAHOO.util.Event.onAvailable(attr.element,function(){if(!isReady){_initHTMLElement.call(this,attr);}
+this.fireEvent('available',{type:'available',target:attr.element});},this,true);YAHOO.util.Event.onContentReady(attr.element,function(){if(!isReady){_initContent.call(this,attr);}
+this.fireEvent('contentReady',{type:'contentReady',target:attr.element});},this,true);};var _initHTMLElement=function(attr){this.setAttributeConfig('element',{value:Dom.get(attr.element),readOnly:true});};var _initContent=function(attr){this.initAttributes(attr);this.setAttributes(attr,true);this.fireQueue();};var _registerHTMLAttr=function(key,map){var el=this.get('element');map=map||{};map.name=key;map.method=map.method||function(value){el[key]=value;};map.value=map.value||el[key];this._configs[key]=new YAHOO.util.Attribute(map,this);};YAHOO.augment(YAHOO.util.Element,AttributeProvider);})();YAHOO.register("element",YAHOO.util.Element,{version:"2.3.0",build:"442"});
\ No newline at end of file
diff --git a/lib/yui/element/element-beta.js b/lib/yui/element/element-beta.js
new file mode 100755 (executable)
index 0000000..7223fcb
--- /dev/null
@@ -0,0 +1,943 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * Provides Attribute configurations.
+ * @namespace YAHOO.util
+ * @class Attribute
+ * @constructor
+ * @param hash {Object} The intial Attribute.
+ * @param {YAHOO.util.AttributeProvider} The owner of the Attribute instance.
+ */
+
+YAHOO.util.Attribute = function(hash, owner) {
+    if (owner) { 
+        this.owner = owner;
+        this.configure(hash, true);
+    }
+};
+
+YAHOO.util.Attribute.prototype = {
+       /**
+     * The name of the attribute.
+        * @property name
+        * @type String
+        */
+    name: undefined,
+    
+       /**
+     * The value of the attribute.
+        * @property value
+        * @type String
+        */
+    value: null,
+    
+       /**
+     * The owner of the attribute.
+        * @property owner
+        * @type YAHOO.util.AttributeProvider
+        */
+    owner: null,
+    
+       /**
+     * Whether or not the attribute is read only.
+        * @property readOnly
+        * @type Boolean
+        */
+    readOnly: false,
+    
+       /**
+     * Whether or not the attribute can only be written once.
+        * @property writeOnce
+        * @type Boolean
+        */
+    writeOnce: false,
+
+       /**
+     * The attribute's initial configuration.
+     * @private
+        * @property _initialConfig
+        * @type Object
+        */
+    _initialConfig: null,
+    
+       /**
+     * Whether or not the attribute's value has been set.
+     * @private
+        * @property _written
+        * @type Boolean
+        */
+    _written: false,
+    
+       /**
+     * The method to use when setting the attribute's value.
+     * The method recieves the new value as the only argument.
+        * @property method
+        * @type Function
+        */
+    method: null,
+    
+       /**
+     * The validator to use when setting the attribute's value.
+        * @property validator
+        * @type Function
+     * @return Boolean
+        */
+    validator: null,
+    
+    /**
+     * Retrieves the current value of the attribute.
+     * @method getValue
+     * @return {any} The current value of the attribute.
+     */
+    getValue: function() {
+        return this.value;
+    },
+    
+    /**
+     * Sets the value of the attribute and fires beforeChange and change events.
+     * @method setValue
+     * @param {Any} value The value to apply to the attribute.
+     * @param {Boolean} silent If true the change events will not be fired.
+     * @return {Boolean} Whether or not the value was set.
+     */
+    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; // write not allowed
+        }
+        
+        if (this.validator && !this.validator.call(owner, value) ) {
+            return false; // invalid value
+        }
+
+        if (!silent) {
+            beforeRetVal = owner.fireBeforeChangeEvent(event);
+            if (beforeRetVal === false) {
+                return false;
+            }
+        }
+
+        if (this.method) {
+            this.method.call(owner, value);
+        }
+        
+        this.value = value;
+        this._written = true;
+        
+        event.type = name;
+        
+        if (!silent) {
+            this.owner.fireChangeEvent(event);
+        }
+        
+        return true;
+    },
+    
+    /**
+     * Allows for configuring the Attribute's properties.
+     * @method configure
+     * @param {Object} map A key-value map of Attribute properties.
+     * @param {Boolean} init Whether or not this should become the initial config.
+     */
+    configure: function(map, init) {
+        map = map || {};
+        this._written = false; // reset writeOnce
+        this._initialConfig = this._initialConfig || {};
+        
+        for (var key in map) {
+            if ( key && YAHOO.lang.hasOwnProperty(map, key) ) {
+                this[key] = map[key];
+                if (init) {
+                    this._initialConfig[key] = map[key];
+                }
+            }
+        }
+    },
+    
+    /**
+     * Resets the value to the initial config value.
+     * @method resetValue
+     * @return {Boolean} Whether or not the value was set.
+     */
+    resetValue: function() {
+        return this.setValue(this._initialConfig.value);
+    },
+    
+    /**
+     * Resets the attribute config to the initial config state.
+     * @method resetConfig
+     */
+    resetConfig: function() {
+        this.configure(this._initialConfig);
+    },
+    
+    /**
+     * Resets the value to the current value.
+     * Useful when values may have gotten out of sync with actual properties.
+     * @method refresh
+     * @return {Boolean} Whether or not the value was set.
+     */
+    refresh: function(silent) {
+        this.setValue(this.value, silent);
+    }
+};
+
+(function() {
+    var Lang = YAHOO.util.Lang;
+
+    /*
+    Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+    Code licensed under the BSD License:
+    http://developer.yahoo.net/yui/license.txt
+    */
+    
+    /**
+     * Provides and manages YAHOO.util.Attribute instances
+     * @namespace YAHOO.util
+     * @class AttributeProvider
+     * @uses YAHOO.util.EventProvider
+     */
+    YAHOO.util.AttributeProvider = function() {};
+    
+    YAHOO.util.AttributeProvider.prototype = {
+        
+        /**
+         * A key-value map of Attribute configurations
+         * @property _configs
+         * @protected (may be used by subclasses and augmentors)
+         * @private
+         * @type {Object}
+         */
+        _configs: null,
+        /**
+         * Returns the current value of the attribute.
+         * @method get
+         * @param {String} key The attribute whose value will be returned.
+         */
+        get: function(key){
+            var configs = this._configs || {};
+            var config = configs[key];
+            
+            if (!config) {
+                return undefined;
+            }
+            
+            return config.value;
+        },
+        
+        /**
+         * Sets the value of a config.
+         * @method set
+         * @param {String} key The name of the attribute
+         * @param {Any} value The value to apply to the attribute
+         * @param {Boolean} silent Whether or not to suppress change events
+         * @return {Boolean} Whether or not the value was set.
+         */
+        set: function(key, value, silent){
+            var configs = this._configs || {};
+            var config = configs[key];
+            
+            if (!config) {
+                return false;
+            }
+            
+            return config.setValue(value, silent);
+        },
+    
+        /**
+         * Returns an array of attribute names.
+         * @method getAttributeKeys
+         * @return {Array} An array of attribute names.
+         */
+        getAttributeKeys: function(){
+            var configs = this._configs;
+            var keys = [];
+            var config;
+            for (var key in configs) {
+                config = configs[key];
+                if ( Lang.hasOwnProperty(configs, key) && 
+                        !Lang.isUndefined(config) ) {
+                    keys[keys.length] = key;
+                }
+            }
+            
+            return keys;
+        },
+        
+        /**
+         * Sets multiple attribute values.
+         * @method setAttributes
+         * @param {Object} map  A key-value map of attributes
+         * @param {Boolean} silent Whether or not to suppress change events
+         */
+        setAttributes: function(map, silent){
+            for (var key in map) {
+                if ( Lang.hasOwnProperty(map, key) ) {
+                    this.set(key, map[key], silent);
+                }
+            }
+        },
+    
+        /**
+         * Resets the specified attribute's value to its initial value.
+         * @method resetValue
+         * @param {String} key The name of the attribute
+         * @param {Boolean} silent Whether or not to suppress change events
+         * @return {Boolean} Whether or not the value was set
+         */
+        resetValue: function(key, silent){
+            var configs = this._configs || {};
+            if (configs[key]) {
+                this.set(key, configs[key]._initialConfig.value, silent);
+                return true;
+            }
+            return false;
+        },
+    
+        /**
+         * Sets the attribute's value to its current value.
+         * @method refresh
+         * @param {String | Array} key The attribute(s) to refresh
+         * @param {Boolean} silent Whether or not to suppress change events
+         */
+        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 ( // only set if there is a value and not null
+                    configs[key[i]] && 
+                    ! Lang.isUndefined(configs[key[i]].value) &&
+                    ! Lang.isNull(configs[key[i]].value) ) {
+                    configs[key[i]].refresh(silent);
+                }
+            }
+        },
+    
+        /**
+         * Adds an Attribute to the AttributeProvider instance. 
+         * @method register
+         * @param {String} key The attribute's name
+         * @param {Object} map A key-value map containing the
+         * attribute's properties.
+         * @deprecated Use setAttributeConfig
+         */
+        register: function(key, map) {
+            this.setAttributeConfig(key, map);
+        },
+        
+        
+        /**
+         * Returns the attribute's properties.
+         * @method getAttributeConfig
+         * @param {String} key The attribute's name
+         * @private
+         * @return {object} A key-value map containing all of the
+         * attribute's properties.
+         */
+        getAttributeConfig: function(key) {
+            var configs = this._configs || {};
+            var config = configs[key] || {};
+            var map = {}; // returning a copy to prevent overrides
+            
+            for (key in config) {
+                if ( Lang.hasOwnProperty(config, key) ) {
+                    map[key] = config[key];
+                }
+            }
+    
+            return map;
+        },
+        
+        /**
+         * Sets or updates an Attribute instance's properties. 
+         * @method setAttributeConfig
+         * @param {String} key The attribute's name.
+         * @param {Object} map A key-value map of attribute properties
+         * @param {Boolean} init Whether or not this should become the intial config.
+         */
+        setAttributeConfig: function(key, map, init) {
+            var configs = this._configs || {};
+            map = map || {};
+            if (!configs[key]) {
+                map.name = key;
+                configs[key] = new YAHOO.util.Attribute(map, this);
+            } else {
+                configs[key].configure(map, init);
+            }
+        },
+        
+        /**
+         * Sets or updates an Attribute instance's properties. 
+         * @method configureAttribute
+         * @param {String} key The attribute's name.
+         * @param {Object} map A key-value map of attribute properties
+         * @param {Boolean} init Whether or not this should become the intial config.
+         * @deprecated Use setAttributeConfig
+         */
+        configureAttribute: function(key, map, init) {
+            this.setAttributeConfig(key, map, init);
+        },
+        
+        /**
+         * Resets an attribute to its intial configuration. 
+         * @method resetAttributeConfig
+         * @param {String} key The attribute's name.
+         * @private
+         */
+        resetAttributeConfig: function(key){
+            var configs = this._configs || {};
+            configs[key].resetConfig();
+        },
+        
+        /**
+         * Fires the attribute's beforeChange event. 
+         * @method fireBeforeChangeEvent
+         * @param {String} key The attribute's name.
+         * @param {Obj} e The event object to pass to handlers.
+         */
+        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);
+        },
+        
+        /**
+         * Fires the attribute's change event. 
+         * @method fireChangeEvent
+         * @param {String} key The attribute's name.
+         * @param {Obj} e The event object to pass to the handlers.
+         */
+        fireChangeEvent: function(e) {
+            e.type += 'Change';
+            return this.fireEvent(e.type, e);
+        }
+    };
+    
+    YAHOO.augment(YAHOO.util.AttributeProvider, YAHOO.util.EventProvider);
+})();
+
+(function() {
+// internal shorthand
+var Dom = YAHOO.util.Dom,
+    AttributeProvider = YAHOO.util.AttributeProvider;
+
+/**
+ * Element provides an wrapper object to simplify adding
+ * event listeners, using dom methods, and managing attributes. 
+ * @module element
+ * @namespace YAHOO.util
+ * @requires yahoo, dom, event
+ * @beta
+ */
+
+/**
+ * Element provides an wrapper object to simplify adding
+ * event listeners, using dom methods, and managing attributes. 
+ * @class Element
+ * @uses YAHOO.util.AttributeProvider
+ * @constructor
+ * @param el {HTMLElement | String} The html element that 
+ * represents the Element.
+ * @param {Object} map A key-value map of initial config names and values
+ */
+YAHOO.util.Element = function(el, map) {
+    if (arguments.length) {
+        this.init(el, map);
+    }
+};
+
+YAHOO.util.Element.prototype = {
+    /**
+     * Dom events supported by the Element instance.
+     * @property DOM_EVENTS
+     * @type Object
+     */
+    DOM_EVENTS: null,
+
+    /**
+     * Wrapper for HTMLElement method.
+     * @method appendChild
+     * @param {YAHOO.util.Element || HTMLElement} child The element to append. 
+     */
+    appendChild: function(child) {
+        child = child.get ? child.get('element') : child;
+        this.get('element').appendChild(child);
+    },
+    
+    /**
+     * Wrapper for HTMLElement method.
+     * @method getElementsByTagName
+     * @param {String} tag The tagName to collect
+     */
+    getElementsByTagName: function(tag) {
+        return this.get('element').getElementsByTagName(tag);
+    },
+    
+    /**
+     * Wrapper for HTMLElement method.
+     * @method hasChildNodes
+     * @return {Boolean} Whether or not the element has childNodes
+     */
+    hasChildNodes: function() {
+        return this.get('element').hasChildNodes();
+    },
+    
+    /**
+     * Wrapper for HTMLElement method.
+     * @method insertBefore
+     * @param {HTMLElement} element The HTMLElement to insert
+     * @param {HTMLElement} before The HTMLElement to insert
+     * the element before.
+     */
+    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);
+    },
+    
+    /**
+     * Wrapper for HTMLElement method.
+     * @method removeChild
+     * @param {HTMLElement} child The HTMLElement to remove
+     */
+    removeChild: function(child) {
+        child = child.get ? child.get('element') : child;
+        this.get('element').removeChild(child);
+        return true;
+    },
+    
+    /**
+     * Wrapper for HTMLElement method.
+     * @method replaceChild
+     * @param {HTMLElement} newNode The HTMLElement to insert
+     * @param {HTMLElement} oldNode The HTMLElement to replace
+     */
+    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);
+    },
+
+    
+    /**
+     * Registers Element specific attributes.
+     * @method initAttributes
+     * @param {Object} map A key-value map of initial attribute configs
+     */
+    initAttributes: function(map) {
+    },
+
+    /**
+     * Adds a listener for the given event.  These may be DOM or 
+     * customEvent listeners.  Any event that is fired via fireEvent
+     * can be listened for.  All handlers receive an event object. 
+     * @method addListener
+     * @param {String} type The name of the event to listen for
+     * @param {Function} fn The handler to call when the event fires
+     * @param {Any} obj A variable to pass to the handler
+     * @param {Object} scope The object to use for the scope of the handler 
+     */
+    addListener: function(type, fn, obj, scope) {
+        var el = this.get('element');
+        scope = scope || this;
+        
+        el = this.get('id') || el;
+        var self = this; 
+        if (!this._events[type]) { // create on the fly
+            if ( this.DOM_EVENTS[type] ) {
+                YAHOO.util.Event.addListener(el, type, function(e) {
+                    if (e.srcElement && !e.target) { // supplement IE with target
+                        e.target = e.srcElement;
+                    }
+                    self.fireEvent(type, e);
+                }, obj, scope);
+            }
+            
+            this.createEvent(type, this);
+        }
+        
+        YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); // notify via customEvent
+    },
+    
+    
+    /**
+     * Alias for addListener
+     * @method on
+     * @param {String} type The name of the event to listen for
+     * @param {Function} fn The function call when the event fires
+     * @param {Any} obj A variable to pass to the handler
+     * @param {Object} scope The object to use for the scope of the handler 
+     */
+    on: function() { this.addListener.apply(this, arguments); },
+    
+    /**
+     * Alias for addListener
+     * @method subscribe
+     * @param {String} type The name of the event to listen for
+     * @param {Function} fn The function call when the event fires
+     * @param {Any} obj A variable to pass to the handler
+     * @param {Object} scope The object to use for the scope of the handler 
+     */
+    subscribe: function() { this.addListener.apply(this, arguments); },
+    
+    /**
+     * Remove an event listener
+     * @method removeListener
+     * @param {String} type The name of the event to listen for
+     * @param {Function} fn The function call when the event fires
+     */
+    removeListener: function(type, fn) {
+        this.unsubscribe.apply(this, arguments);
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method addClass
+     * @param {String} className The className to add
+     */
+    addClass: function(className) {
+        Dom.addClass(this.get('element'), className);
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method getElementsByClassName
+     * @param {String} className The className to collect
+     * @param {String} tag (optional) The tag to use in
+     * conjunction with class name
+     * @return {Array} Array of HTMLElements
+     */
+    getElementsByClassName: function(className, tag) {
+        return Dom.getElementsByClassName(className, tag,
+                this.get('element') );
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method hasClass
+     * @param {String} className The className to add
+     * @return {Boolean} Whether or not the element has the class name
+     */
+    hasClass: function(className) {
+        return Dom.hasClass(this.get('element'), className); 
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method removeClass
+     * @param {String} className The className to remove
+     */
+    removeClass: function(className) {
+        return Dom.removeClass(this.get('element'), className);
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method replaceClass
+     * @param {String} oldClassName The className to replace
+     * @param {String} newClassName The className to add
+     */
+    replaceClass: function(oldClassName, newClassName) {
+        return Dom.replaceClass(this.get('element'), 
+                oldClassName, newClassName);
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method setStyle
+     * @param {String} property The style property to set
+     * @param {String} value The value to apply to the style property
+     */
+    setStyle: function(property, value) {
+        var el = this.get('element');
+        if (!el) {
+            return this._queue[this._queue.length] = ['setStyle', arguments];
+        }
+
+        return Dom.setStyle(el,  property, value); // TODO: always queuing?
+    },
+    
+    /**
+     * Wrapper for Dom method.
+     * @method getStyle
+     * @param {String} property The style property to retrieve
+     * @return {String} The current value of the property
+     */
+    getStyle: function(property) {
+        return Dom.getStyle(this.get('element'),  property);
+    },
+    
+    /**
+     * Apply any queued set calls.
+     * @method fireQueue
+     */
+    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]);
+        }
+    },
+    
+    /**
+     * Appends the HTMLElement into either the supplied parentNode.
+     * @method appendTo
+     * @param {HTMLElement | Element} parentNode The node to append to
+     * @param {HTMLElement | Element} before An optional node to insert before
+     */
+    appendTo: function(parent, before) {
+        parent = (parent.get) ?  parent.get('element') : Dom.get(parent);
+        
+        this.fireEvent('beforeAppendTo', {
+            type: 'beforeAppendTo',
+            target: parent
+        });
+        
+        
+        before = (before && before.get) ? 
+                before.get('element') : Dom.get(before);
+        var element = this.get('element');
+        
+        if (!element) {
+            return false;
+        }
+        
+        if (!parent) {
+            return false;
+        }
+        
+        if (element.parent != parent) {
+            if (before) {
+                parent.insertBefore(element, before);
+            } else {
+                parent.appendChild(element);
+            }
+        }
+        
+        
+        this.fireEvent('appendTo', {
+            type: 'appendTo',
+            target: parent
+        });
+    },
+    
+    get: function(key) {
+        var configs = this._configs || {};
+        var el = configs.element; // avoid loop due to 'element'
+        if (el && !configs[key] && !YAHOO.lang.isUndefined(el.value[key]) ) {
+            return el.value[key];
+        }
+
+        return AttributeProvider.prototype.get.call(this, key);
+    },
+
+    setAttributes: function(map, silent){
+        var el = this.get('element');
+        for (var key in map) {
+            // need to configure if setting unconfigured HTMLElement attribute 
+            if ( !this._configs[key] && !YAHOO.lang.isUndefined(el[key]) ) {
+                this.setAttributeConfig(key);
+            }
+        }
+
+        // set based on configOrder
+        for (var i = 0, len = this._configOrder.length; i < len; ++i) {
+            if (map[this._configOrder[i]]) {
+                this.set(this._configOrder[i], map[this._configOrder[i]], silent);
+            }
+        }
+    },
+
+    set: function(key, value, silent) {
+        var el = this.get('element');
+        if (!el) {
+            this._queue[this._queue.length] = ['set', arguments];
+            if (this._configs[key]) {
+                this._configs[key].value = value; // so "get" works while queueing
+            
+            }
+            return;
+        }
+        
+        // set it on the element if not configured and is an HTML attribute
+        if ( !this._configs[key] && !YAHOO.lang.isUndefined(el[key]) ) {
+            _registerHTMLAttr.call(this, key);
+        }
+
+        return AttributeProvider.prototype.set.apply(this, arguments);
+    },
+    
+    setAttributeConfig: function(key, map, init) {
+        var el = this.get('element');
+
+        if (el && !this._configs[key] && !YAHOO.lang.isUndefined(el[key]) ) {
+            _registerHTMLAttr.call(this, key, map);
+        } else {
+            AttributeProvider.prototype.setAttributeConfig.apply(this, arguments);
+        }
+        this._configOrder.push(key);
+    },
+    
+    getAttributeKeys: function() {
+        var el = this.get('element');
+        var keys = AttributeProvider.prototype.getAttributeKeys.call(this);
+        
+        //add any unconfigured element keys
+        for (var key in el) {
+            if (!this._configs[key]) {
+                keys[key] = keys[key] || el[key];
+            }
+        }
+        
+        return keys;
+    },
+
+    createEvent: function(type, scope) {
+        this._events[type] = true;
+        AttributeProvider.prototype.createEvent.apply(this, arguments);
+    },
+    
+    init: function(el, attr) {
+        _initElement.apply(this, arguments); 
+    }
+};
+
+var _initElement = function(el, attr) {
+    this._queue = this._queue || [];
+    this._events = this._events || {};
+    this._configs = this._configs || {};
+    this._configOrder = []; 
+    attr = attr || {};
+    attr.element = attr.element || el || null;
+
+    this.DOM_EVENTS = {
+        'click': true,
+        'dblclick': true,
+        'keydown': true,
+        'keypress': true,
+        'keyup': true,
+        'mousedown': true,
+        'mousemove': true,
+        'mouseout': true, 
+        'mouseover': true, 
+        'mouseup': true,
+        'focus': true,
+        'blur': true,
+        'submit': true
+    };
+
+    var isReady = false;  // to determine when to init HTMLElement and content
+
+    if (YAHOO.lang.isString(el) ) { // defer until available/ready
+        _registerHTMLAttr.call(this, 'id', { value: attr.element });
+    }
+
+    if (Dom.get(el)) {
+        isReady = true;
+        _initHTMLElement.call(this, attr);
+        _initContent.call(this, attr);
+    } 
+
+    YAHOO.util.Event.onAvailable(attr.element, function() {
+        if (!isReady) { // otherwise already done
+            _initHTMLElement.call(this, attr);
+        }
+
+        this.fireEvent('available', { type: 'available', target: attr.element });  
+    }, this, true);
+    
+    YAHOO.util.Event.onContentReady(attr.element, function() {
+        if (!isReady) { // otherwise already done
+            _initContent.call(this, attr);
+        }
+        this.fireEvent('contentReady', { type: 'contentReady', target: attr.element });  
+    }, this, true);
+};
+
+var _initHTMLElement = function(attr) {
+    /**
+     * The HTMLElement the Element instance refers to.
+     * @config element
+     * @type HTMLElement
+     */
+    this.setAttributeConfig('element', {
+        value: Dom.get(attr.element),
+        readOnly: true
+     });
+};
+
+var _initContent = function(attr) {
+    this.initAttributes(attr);
+    this.setAttributes(attr, true);
+    this.fireQueue();
+
+};
+
+/**
+ * Sets the value of the property and fires beforeChange and change events.
+ * @private
+ * @method _registerHTMLAttr
+ * @param {YAHOO.util.Element} element The Element instance to
+ * register the config to.
+ * @param {String} key The name of the config to register
+ * @param {Object} map A key-value map of the config's params
+ */
+var _registerHTMLAttr = function(key, map) {
+    var el = this.get('element');
+    map = map || {};
+    map.name = key;
+    map.method = map.method || function(value) {
+        el[key] = value;
+    };
+    map.value = map.value || el[key];
+    this._configs[key] = new YAHOO.util.Attribute(map, this);
+};
+
+/**
+ * Fires when the Element's HTMLElement can be retrieved by Id.
+ * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> available<br>
+ * <code>&lt;HTMLElement&gt;
+ * target</code> the HTMLElement bound to this Element instance<br>
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var target = e.target};<br>
+ * myTabs.addListener('available', handler);</code></p>
+ * @event available
+ */
+/**
+ * Fires when the Element's HTMLElement subtree is rendered.
+ * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> contentReady<br>
+ * <code>&lt;HTMLElement&gt;
+ * target</code> the HTMLElement bound to this Element instance<br>
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var target = e.target};<br>
+ * myTabs.addListener('contentReady', handler);</code></p>
+ * @event contentReady
+ */
+
+
+YAHOO.augment(YAHOO.util.Element, AttributeProvider);
+})();
+
+YAHOO.register("element", YAHOO.util.Element, {version: "2.3.0", build: "442"});
index 18defb61c71f55d1343dd7df90be3ccf0fcdf795..b1d980b80048055f51df8602f3fe9d75cec5e59a 100755 (executable)
@@ -1,6 +1,68 @@
 
 YUI Library - Event - Release Notes
 
+2.3.0
+  * addListener now produces a logger warning if the supplied callback is 
+    undefined.
+  * Reduced the likelihood that window onload listeners fire before
+    onAvailable listeners when the two happen near the same moment.
+  * Fixed an IE error that could occur when the library was injected into 
+    the page after window onload.
+  * The onDOMReady listener will be executed immediately if the
+    DOMReady event had already fired prior to the call.
+  * Unsubscribing custom events within a handler for the event now works 
+    properly.
+  * EventProvider unsubscribeAll will unsubscribe all listeners from
+    all hosted custom events if the type is not specified.
+  * Event.getKeyCode now checks keyCode before charCode for Safari normalization.  
+    Safari arrow key codes are normalized as well.
+  * Broke up the </script> in Event to allow it to be included inline
+
+2.2.2
+  * No change
+
+2.2.1
+  * onAvailable listeners are processed before onContentReady listeners so
+    they fire in the logical order when an element is found to be available 
+    and ready in the same pass.
+  * Added onDOMReady for receiving notification when the DOM is first usable.
+  * In Internet Explorer, onAvailable/onContentReady checks now start when
+    DOMReady fires to reduce the possibility of receiving an "operation
+    aborted" errors when inserting DOM nodes during in the onAvailable/
+    onContentReady listener execution.
+  * CustomEvent subscribers supplying undefined callbacks will be notified
+    when subscribing rather than having an ambiguous error thrown when the
+    event is fired.
+  * Fixed missing html tags in the examples.
+  * POLL_INTERVAL is 10 ms.
+  * YAHOO.util.CustomEvent is now declared before YAHOO.util.Event.
+
+2.2.0
+
+  * YAHOO.util.KeyListener was moved from the container package into event.
+  
+  * The Safari bug that made it so preventDefault would not work with click
+    and double-click listeners on anchor tags was resolved in version 2.0.4.
+    The workaround (using DOM0 events for these instead of the normal DOM2
+    events) is now only used for releases prior to 2.0.4.
+    
+  * getListeners/purgeElement now work correctly with unload listeners
+
+  * When legacyEvents are used (Safari<2.0.4 click events), if there was an
+    existing DOM0 event that the utility replaced, it is executed along with
+    the listeners that were added with the utility.
+
+  * Restored Event.regCE for compatibility with a beta release of the library
+    that in use in an external API.
+
+  * unsubscribe in CustomEvent and EventProvider will remove all listeners
+    if the listener is omitted.
+
+  * Added unsubscribeAll to EventProvider
+
+  * Added Event.lastError which stores the most recent error object if
+    a browser-specific add/remove listener call throws an exception.
+
 0.12.2
 
   * Fixed a bug introduced in 0.12.1 release caused nested onAvailable
index 468e592e718bb72625e5a1c4a23c53c453ec3111..307ab5245f6b4f578557071541d487b1acac2c31 100755 (executable)
@@ -1,11 +1,10 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 
-
 /**
  * The CustomEvent class lets you define events for your application
  * that can be subscribed to by one or more independent component.
@@ -147,6 +146,11 @@ YAHOO.util.CustomEvent.prototype = {
      *                                   the execution scope.
      */
     subscribe: function(fn, obj, override) {
+
+        if (!fn) {
+throw new Error("Invalid callback for subscriber to '" + this.type + "'");
+        }
+
         if (this.subscribeEvent) {
             this.subscribeEvent.fire(fn, obj, override);
         }
@@ -155,13 +159,23 @@ YAHOO.util.CustomEvent.prototype = {
     },
 
     /**
-     * Unsubscribes the caller from this event
+     * Unsubscribes subscribers.
      * @method unsubscribe
-     * @param {Function} fn  The function to execute
-     * @param {Object}   obj  The custom object passed to subscribe (optional)
+     * @param {Function} fn  The subscribed function to remove, if not supplied
+     *                       all will be removed
+     * @param {Object}   obj  The custom object passed to subscribe.  This is
+     *                        optional, but if supplied will be used to
+     *                        disambiguate multiple listeners that are the same
+     *                        (e.g., you subscribe many object using a function
+     *                        that lives on the prototype)
      * @return {boolean} True if the subscriber was found and detached.
      */
     unsubscribe: function(fn, obj) {
+
+        if (!fn) {
+            return this.unsubscribeAll();
+        }
+
         var found = false;
         for (var i=0, len=this.subscribers.length; i<len; ++i) {
             var s = this.subscribers[i];
@@ -196,7 +210,7 @@ YAHOO.util.CustomEvent.prototype = {
             return true;
         }
 
-        var args=[], ret=true, i;
+        var args=[], ret=true, i, rebuild=false;
 
         for (i=0; i<arguments.length; ++i) {
             args.push(arguments[i]);
@@ -213,7 +227,9 @@ YAHOO.util.CustomEvent.prototype = {
 
         for (i=0; i<len; ++i) {
             var s = this.subscribers[i];
-            if (s) {
+            if (!s) {
+                rebuild=true;
+            } else {
                 if (!this.silent) {
                     YAHOO.log( this.type + "->" + (i+1) + ": " +  s, 
                                 "info", "Event" );
@@ -233,7 +249,7 @@ YAHOO.util.CustomEvent.prototype = {
                 if (false === ret) {
                     if (!this.silent) {
                         YAHOO.log("Event cancelled, subscriber " + i + 
-                                  " of " + len);
+                                  " of " + len, "info", "Event");
                     }
 
                     //break;
@@ -242,17 +258,32 @@ YAHOO.util.CustomEvent.prototype = {
             }
         }
 
+        if (rebuild) {
+            var newlist=[],subs=this.subscribers;
+            for (i=0,len=subs.length; i<len; ++i) {
+                s = subs[i];
+                newlist.push(subs[i]);
+            }
+
+            this.subscribers=newlist;
+        }
+
         return true;
     },
 
     /**
      * Removes all listeners
      * @method unsubscribeAll
+     * @return {int} The number of listeners unsubscribed
      */
     unsubscribeAll: function() {
         for (var i=0, len=this.subscribers.length; i<len; ++i) {
             this._delete(len - 1 - i);
         }
+
+        this.subscribers=[];
+
+        return i;
     },
 
     /**
@@ -266,8 +297,7 @@ YAHOO.util.CustomEvent.prototype = {
             delete s.obj;
         }
 
-        // delete this.subscribers[index];
-        this.subscribers.splice(index, 1);
+        this.subscribers[index]=null;
     },
 
     /**
@@ -306,7 +336,7 @@ YAHOO.util.Subscriber = function(fn, obj, override) {
      * @property obj
      * @type object
      */
-    this.obj = obj || null;
+    this.obj = YAHOO.lang.isUndefined(obj) ? null : obj;
 
     /**
      * The default execution scope for the event listener is defined when the
@@ -362,7 +392,7 @@ YAHOO.util.Subscriber.prototype.contains = function(fn, obj) {
  * @method toString
  */
 YAHOO.util.Subscriber.prototype.toString = function() {
-    return "Subscriber { obj: " + (this.obj || "")  + 
+    return "Subscriber { obj: " + this.obj  + 
            ", override: " +  (this.override || "no") + " }";
 };
 
@@ -377,6 +407,9 @@ YAHOO.util.Subscriber.prototype.toString = function() {
  */
 
 // The first instance of Event will win if it is loaded more than once.
+// @TODO this needs to be changed so that only the state data that needs to
+// be preserved is kept, while methods are overwritten/added as needed.
+// This means that the module pattern can't be used.
 if (!YAHOO.util.Event) {
 
 /**
@@ -398,6 +431,15 @@ if (!YAHOO.util.Event) {
          */
         var loadComplete =  false;
 
+        /**
+         * True when the document is initially usable
+         * @property DOMReady
+         * @type boolean
+         * @static
+         * @private
+         */
+        var DOMReady = false;
+
         /**
          * Cache of wrapped listeners
          * @property listeners
@@ -467,21 +509,36 @@ if (!YAHOO.util.Event) {
          * @private
          */
         var counter = 0;
+        
+        /**
+         * Normalized keycodes for webkit/safari
+         * @property webkitKeymap
+         * @type {int: int}
+         * @private
+         * @static
+         * @final
+         */
+        var webkitKeymap = {
+            63232: 38, // up
+            63233: 40, // down
+            63234: 37, // left
+            63235: 39  // right
+        };
 
-        return { // PREPROCESS
+        return {
 
             /**
              * The number of times we should look for elements that are not
              * in the DOM at the time the event is requested after the document
-             * has been loaded.  The default is 200@amp;50 ms, so it will poll
-             * for 10 seconds or until all outstanding handlers are bound
+             * has been loaded.  The default is 4000@amp;10 ms, so it will poll
+             * for 40 seconds or until all outstanding handlers are bound
              * (whichever comes first).
              * @property POLL_RETRYS
              * @type int
              * @static
              * @final
              */
-            POLL_RETRYS: 200,
+            POLL_RETRYS: 4000,
 
             /**
              * The poll interval in milliseconds
@@ -490,7 +547,7 @@ if (!YAHOO.util.Event) {
              * @static
              * @final
              */
-            POLL_INTERVAL: 20,
+            POLL_INTERVAL: 10,
 
             /**
              * Element to bind, int constant
@@ -549,30 +606,47 @@ if (!YAHOO.util.Event) {
             ADJ_SCOPE: 4,
 
             /**
-             * Safari detection is necessary to work around the preventDefault
-             * bug that makes it so you can't cancel a href click from the 
-             * handler.  There is not a capabilities check we can use here.
+             * addListener/removeListener can throw errors in unexpected scenarios.
+             * These errors are suppressed, the method returns false, and this property
+             * is set
+             * @property lastError
+             * @static
+             * @type Error
+             */
+            lastError: null,
+
+            /**
+             * Safari detection
              * @property isSafari
              * @private
              * @static
+             * @deprecated use YAHOO.env.ua.webkit
              */
-            isSafari: (/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),
-
+            isSafari: YAHOO.env.ua.webkit,
+            
+            /**
+             * webkit version
+             * @property webkit
+             * @type string
+             * @private
+             * @static
+             * @deprecated use YAHOO.env.ua.webkit
+             */
+            webkit: YAHOO.env.ua.webkit,
+            
             /**
-             * IE detection needed to properly calculate pageX and pageY.  
-             * capabilities checking didn't seem to work because another 
-             * browser that does not provide the properties have the values 
-             * calculated in a different manner than IE.
+             * IE detection 
              * @property isIE
              * @private
              * @static
+             * @deprecated use YAHOO.env.ua.ie
              */
-            isIE: (!this.isSafari && !navigator.userAgent.match(/opera/gi) && 
-                    navigator.userAgent.match(/msie/gi)),
+            isIE: YAHOO.env.ua.ie,
 
             /**
              * poll handle
              * @property _interval
+             * @static
              * @private
              */
             _interval: null,
@@ -587,7 +661,6 @@ if (!YAHOO.util.Event) {
                     var self = this;
                     var callback = function() { self._tryPreloadAttach(); };
                     this._interval = setInterval(callback, this.POLL_INTERVAL);
-                    // this.timeout = setTimeout(callback, i);
                 }
             },
 
@@ -599,14 +672,18 @@ if (!YAHOO.util.Event) {
              * The number of times it will poll and the frequency are
              * configurable.  By default it will poll for 10 seconds.
              *
+             * <p>The callback is executed with a single parameter:
+             * the custom object parameter, if provided.</p>
+             *
              * @method onAvailable
              *
              * @param {string}   p_id the id of the element to look for.
              * @param {function} p_fn what to execute when the element is found.
              * @param {object}   p_obj an optional object to be passed back as
              *                   a parameter to p_fn.
-             * @param {boolean}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj
+             * @param {boolean|object}  p_override If set to true, p_fn will execute
+             *                   in the scope of p_obj, if set to an object it
+             *                   will execute in the scope of that object
              *
              * @static
              */
@@ -616,24 +693,77 @@ if (!YAHOO.util.Event) {
                                      obj:        p_obj, 
                                      override:   p_override, 
                                      checkReady: false    } );
-
                 retryCount = this.POLL_RETRYS;
                 this.startInterval();
             },
 
+            /**
+             * Executes the supplied callback when the DOM is first usable.  This
+             * will execute immediately if called after the DOMReady event has
+             * fired.   @todo the DOMContentReady event does not fire when the
+             * script is dynamically injected into the page.  This means the
+             * DOMReady custom event will never fire in FireFox or Opera when the
+             * library is injected.  It _will_ fire in Safari, and the IE 
+             * implementation would allow for us to fire it if the defered script
+             * is not available.  We want this to behave the same in all browsers.
+             * Is there a way to identify when the script has been injected 
+             * instead of included inline?  Is there a way to know whether the 
+             * window onload event has fired without having had a listener attached 
+             * to it when it did so?
+             *
+             * <p>The callback is a CustomEvent, so the signature is:</p>
+             * <p>type <string>, args <array>, customobject <object></p>
+             * <p>For DOMReady events, there are no fire argments, so the
+             * signature is:</p>
+             * <p>"DOMReady", [], obj</p>
+             *
+             *
+             * @method onDOMReady
+             *
+             * @param {function} p_fn what to execute when the element is found.
+             * @param {object}   p_obj an optional object to be passed back as
+             *                   a parameter to p_fn.
+             * @param {boolean|object}  p_scope If set to true, p_fn will execute
+             *                   in the scope of p_obj, if set to an object it
+             *                   will execute in the scope of that object
+             *
+             * @static
+             */
+            onDOMReady: function(p_fn, p_obj, p_override) {
+                if (DOMReady) {
+                    setTimeout(function() {
+                        var s = window;
+                        if (p_override) {
+                            if (p_override === true) {
+                                s = p_obj;
+                            } else {
+                                s = p_override;
+                            }
+                        }
+                        p_fn.call(s, "DOMReady", [], p_obj);
+                    }, 0);
+                } else {
+                    this.DOMReadyEvent.subscribe(p_fn, p_obj, p_override);
+                }
+            },
+
             /**
              * Works the same way as onAvailable, but additionally checks the
              * state of sibling elements to determine if the content of the
              * available element is safe to modify.
              *
+             * <p>The callback is executed with a single parameter:
+             * the custom object parameter, if provided.</p>
+             *
              * @method onContentReady
              *
              * @param {string}   p_id the id of the element to look for.
              * @param {function} p_fn what to execute when the element is ready.
              * @param {object}   p_obj an optional object to be passed back as
              *                   a parameter to p_fn.
-             * @param {boolean}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj
+             * @param {boolean|object}  p_override If set to true, p_fn will execute
+             *                   in the scope of p_obj.  If an object, p_fn will
+             *                   exectute in the scope of that object
              *
              * @static
              */
@@ -653,15 +783,18 @@ if (!YAHOO.util.Event) {
              *
              * @method addListener
              *
-             * @param {Object}   el        The html element to assign the 
-             *                             event to
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to assign the 
+             *  listener to.
              * @param {String}   sType     The type of event to append
              * @param {Function} fn        The method the event invokes
              * @param {Object}   obj    An arbitrary object that will be 
              *                             passed as a parameter to the handler
-             * @param {boolean}  override  If true, the obj passed in becomes
-             *                             the execution scope of the listener
-             * @return {boolean} True if the action was successful or defered,
+             * @param {Boolean|object}  override  If true, the obj passed in becomes
+             *                             the execution scope of the listener. If an
+             *                             object, this object becomes the execution
+             *                             scope.
+             * @return {Boolean} True if the action was successful or defered,
              *                        false if one or more of the elements 
              *                        could not have the listener attached,
              *                        or if the operation throws an exception.
@@ -669,9 +802,9 @@ if (!YAHOO.util.Event) {
              */
             addListener: function(el, sType, fn, obj, override) {
 
-
                 if (!fn || !fn.call) {
-                    // this.logger.debug("Error, function is not valid " + fn);
+// throw new TypeError(sType + " addListener call failed, callback undefined");
+YAHOO.log(sType + " addListener call failed, invalid callback", "error", "Event");
                     return false;
                 }
 
@@ -687,7 +820,7 @@ if (!YAHOO.util.Event) {
                     }
                     return ok;
 
-                } else if (typeof el == "string") {
+                } else if (YAHOO.lang.isString(el)) {
                     var oEl = this.getEl(el);
                     // If the el argument is a string, we assume it is 
                     // actually the id of the element.  If the page is loaded
@@ -783,9 +916,10 @@ if (!YAHOO.util.Event) {
                 } else {
                     try {
                         this._simpleAdd(el, sType, wrappedFn, false);
-                    } catch(e) {
+                    } catch(ex) {
                         // handle an error trying to attach an event.  If it fails
                         // we need to clean up the cache
+                        this.lastError = ex;
                         this.removeListener(el, sType, fn);
                         return false;
                     }
@@ -804,18 +938,27 @@ if (!YAHOO.util.Event) {
              */
             fireLegacyEvent: function(e, legacyIndex) {
                 // this.logger.debug("fireLegacyEvent " + legacyIndex);
-                var ok = true;
-
-                var le = legacyHandlers[legacyIndex];
-                for (var i=0,len=le.length; i<len; ++i) {
-                    var li = le[i];
+                var ok=true,le,lh,li,scope,ret;
+                
+                lh = legacyHandlers[legacyIndex];
+                for (var i=0,len=lh.length; i<len; ++i) {
+                    li = lh[i];
                     if ( li && li[this.WFN] ) {
-                        var scope = li[this.ADJ_SCOPE];
-                        var ret = li[this.WFN].call(scope, e);
+                        scope = li[this.ADJ_SCOPE];
+                        ret = li[this.WFN].call(scope, e);
                         ok = (ok && ret);
                     }
                 }
 
+                // Fire the original handler if we replaced one.  We fire this
+                // after the other events to keep stopPropagation/preventDefault
+                // that happened in the DOM0 handler from touching our DOM2
+                // substitute
+                le = legacyEvents[legacyIndex];
+                if (le && le[2]) {
+                    le[2](e);
+                }
+                
                 return ok;
             },
 
@@ -837,16 +980,16 @@ if (!YAHOO.util.Event) {
 
             /**
              * Logic that determines when we should automatically use legacy
-             * events instead of DOM2 events.
+             * events instead of DOM2 events.  Currently this is limited to old
+             * Safari browsers with a broken preventDefault
              * @method useLegacyEvent
              * @static
              * @private
              */
             useLegacyEvent: function(el, sType) {
-                if (!el.addEventListener && !el.attachEvent) {
-                    return true;
-                } else if (this.isSafari) {
-                    if ("click" == sType || "dblclick" == sType) {
+                if (this.webkit && ("click"==sType || "dblclick"==sType)) {
+                    var v = parseInt(this.webkit, 10);
+                    if (!isNaN(v) && v<418) {
                         return true;
                     }
                 }
@@ -854,18 +997,19 @@ if (!YAHOO.util.Event) {
             },
                     
             /**
-             * Removes an event handler
+             * Removes an event listener
              *
              * @method removeListener
              *
-             * @param {Object} el the html element or the id of the element to 
-             * assign the event to.
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to remove
+             *  the listener from.
              * @param {String} sType the type of event to remove.
              * @param {Function} fn the method the event invokes.  If fn is
-             * undefined, then all event handlers for the type of event are 
-             * removed.
+             *  undefined, then all event handlers for the type of event are 
+             *  removed.
              * @return {boolean} true if the unbind was successful, false 
-             * otherwise.
+             *  otherwise.
              * @static
              */
             removeListener: function(el, sType, fn) {
@@ -889,7 +1033,6 @@ if (!YAHOO.util.Event) {
                     return this.purgeElement(el, false, sType);
                 }
 
-
                 if ("unload" == sType) {
 
                     for (i=0, len=unloadListeners.length; i<len; i++) {
@@ -898,7 +1041,8 @@ if (!YAHOO.util.Event) {
                             li[0] == el && 
                             li[1] == sType && 
                             li[2] == fn) {
-                                unloadListeners.splice(i, 1);
+                                //unloadListeners.splice(i, 1);
+                                unloadListeners[i]=null;
                                 return true;
                         }
                     }
@@ -938,7 +1082,8 @@ if (!YAHOO.util.Event) {
                                 li[this.EL] == el && 
                                 li[this.TYPE] == sType && 
                                 li[this.FN] == fn) {
-                                    llist.splice(i, 1);
+                                    //llist.splice(i, 1);
+                                    llist[i]=null;
                                     break;
                             }
                         }
@@ -947,7 +1092,8 @@ if (!YAHOO.util.Event) {
                 } else {
                     try {
                         this._simpleRemove(el, sType, cacheItem[this.WFN], false);
-                    } catch(e) {
+                    } catch(ex) {
+                        this.lastError = ex;
                         return false;
                     }
                 }
@@ -955,14 +1101,17 @@ if (!YAHOO.util.Event) {
                 // removed the wrapped handler
                 delete listeners[index][this.WFN];
                 delete listeners[index][this.FN];
-                listeners.splice(index, 1);
+                //listeners.splice(index, 1);
+                listeners[index]=null;
 
                 return true;
 
             },
 
             /**
-             * Returns the event's target element
+             * Returns the event's target element.  Safari sometimes provides
+             * a text node, and this is automatically resolved to the text
+             * node's parent so that it behaves like other browsers.
              * @method getTarget
              * @param {Event} ev the event
              * @param {boolean} resolveTextNode when set to true the target's
@@ -987,8 +1136,6 @@ if (!YAHOO.util.Event) {
              * @static
              */
             resolveTextNode: function(node) {
-                // if (node && node.nodeName && 
-                        // "#TEXT" == node.nodeName.toUpperCase()) {
                 if (node && 3 == node.nodeType) {
                     return node.parentNode;
                 } else {
@@ -1081,7 +1228,8 @@ if (!YAHOO.util.Event) {
                     var t = new Date().getTime();
                     try {
                         ev.time = t;
-                    } catch(e) { 
+                    } catch(ex) { 
+                        this.lastError = ex;
                         return t;
                     }
                 }
@@ -1164,7 +1312,13 @@ if (!YAHOO.util.Event) {
              * @static
              */
             getCharCode: function(ev) {
-                return ev.charCode || ev.keyCode || 0;
+                var code = ev.keyCode || ev.charCode || 0;
+
+                // webkit normalization
+                if (YAHOO.env.ua.webkit && (code in webkitKeymap)) {
+                    code = webkitKeymap[code];
+                }
+                return code;
             },
 
             /**
@@ -1222,15 +1376,18 @@ if (!YAHOO.util.Event) {
              * @private
              */
             _isValidCollection: function(o) {
-                // this.logger.debug(o.constructor.toString())
-                // this.logger.debug(typeof o)
-
-                return ( o                    && // o is something
-                         o.length             && // o is indexed
-                         typeof o != "string" && // o is not a string
-                         !o.tagName           && // o is not an HTML element
-                         !o.alert             && // o is not a window
-                         typeof o[0] != "undefined" );
+                try {
+                    return ( o                    && // o is something
+                             o.length             && // o is indexed
+                             typeof o != "string" && // o is not a string
+                             !o.tagName           && // o is not an HTML element
+                             !o.alert             && // o is not a window
+                             typeof o[0] != "undefined" );
+                } catch(e) {
+                    YAHOO.log("_isValidCollection threw an error, assuming that " +
+                        " this is a cross frame problem and not a collection", warn);
+                    return false;
+                }
 
             },
 
@@ -1239,6 +1396,8 @@ if (!YAHOO.util.Event) {
              * @property elCache
              * DOM element cache
              * @static
+             * @deprecated Elements are not cached due to issues that arise when
+             * elements are removed and re-added
              */
             elCache: {},
 
@@ -1248,6 +1407,7 @@ if (!YAHOO.util.Event) {
              * @method getEl
              * @static
              * @private
+             * @deprecated Elements are not cached any longer
              */
             getEl: function(id) {
                 return document.getElementById(id);
@@ -1262,6 +1422,12 @@ if (!YAHOO.util.Event) {
              */
             clearCache: function() { },
 
+            /**
+             * Custom event the fires when the dom is initially usable
+             * @event DOMReadyEvent
+             */
+            DOMReadyEvent: new YAHOO.util.CustomEvent("DOMReady", this),
+
             /**
              * hook up any deferred listeners
              * @method _load
@@ -1269,12 +1435,45 @@ if (!YAHOO.util.Event) {
              * @private
              */
             _load: function(e) {
-                loadComplete = true;
-                var EU = YAHOO.util.Event;
-                // Remove the listener to assist with the IE memory issue, but not
-                // for other browsers because FF 1.0x does not like it.
-                if (this.isIE) {
-                    EU._simpleRemove(window, "load", EU._load);
+
+                if (!loadComplete) {
+                    loadComplete = true;
+                    var EU = YAHOO.util.Event;
+
+                    // Just in case DOMReady did not go off for some reason
+                    EU._ready();
+
+                    // Available elements may not have been detected before the
+                    // window load event fires. Try to find them now so that the
+                    // the user is more likely to get the onAvailable notifications
+                    // before the window load notification
+                    EU._tryPreloadAttach();
+
+                    // Remove the listener to assist with the IE memory issue, but not
+                    // for other browsers because FF 1.0x does not like it.
+                    //if (this.isIE) {
+                        //EU._simpleRemove(window, "load", EU._load);
+                    //}
+                }
+            },
+
+            /**
+             * Fires the DOMReady event listeners the first time the document is
+             * usable.
+             * @method _ready
+             * @static
+             * @private
+             */
+            _ready: function(e) {
+                if (!DOMReady) {
+                    DOMReady=true;
+                    var EU = YAHOO.util.Event;
+
+                    // Fire the content ready custom event
+                    EU.DOMReadyEvent.fire();
+
+                    // Remove the DOMContentLoaded (FF/Opera)
+                    EU._simpleRemove(document, "DOMContentLoaded", EU._ready);
                 }
             },
 
@@ -1292,6 +1491,17 @@ if (!YAHOO.util.Event) {
                     return false;
                 }
 
+                if (this.isIE) {
+                    // Hold off if DOMReady has not fired and check current
+                    // readyState to protect against the IE operation aborted
+                    // issue.
+                    //if (!DOMReady || "complete" !== document.readyState) {
+                    if (!DOMReady) {
+                        this.startInterval();
+                        return false;
+                    }
+                }
+
                 this.locked = true;
 
                 // this.logger.debug("tryPreloadAttach");
@@ -1307,32 +1517,46 @@ if (!YAHOO.util.Event) {
 
                 // onAvailable
                 var notAvail = [];
-                for (var i=0,len=onAvailStack.length; i<len ; ++i) {
-                    var item = onAvailStack[i];
-                    if (item) {
-                        var el = this.getEl(item.id);
+
+                var executeItem = function (el, item) {
+                    var scope = el;
+                    if (item.override) {
+                        if (item.override === true) {
+                            scope = item.obj;
+                        } else {
+                            scope = item.override;
+                        }
+                    }
+                    item.fn.call(scope, item.obj);
+                };
+
+                var i,len,item,el;
+
+                // onAvailable
+                for (i=0,len=onAvailStack.length; i<len; ++i) {
+                    item = onAvailStack[i];
+                    if (item && !item.checkReady) {
+                        el = this.getEl(item.id);
+                        if (el) {
+                            executeItem(el, item);
+                            onAvailStack[i] = null;
+                        } else {
+                            notAvail.push(item);
+                        }
+                    }
+                }
+
+                // onContentReady
+                for (i=0,len=onAvailStack.length; i<len; ++i) {
+                    item = onAvailStack[i];
+                    if (item && item.checkReady) {
+                        el = this.getEl(item.id);
 
                         if (el) {
                             // The element is available, but not necessarily ready
-                            // @todo verify IE7 compatibility
                             // @todo should we test parentNode.nextSibling?
-                            // @todo re-evaluate global content ready
-                            if ( !item.checkReady || 
-                                    loadComplete || 
-                                    el.nextSibling ||
-                                    (document && document.body) ) {
-
-                                var scope = el;
-                                if (item.override) {
-                                    if (item.override === true) {
-                                        scope = item.obj;
-                                    } else {
-                                        scope = item.override;
-                                    }
-                                }
-                                item.fn.call(scope, item.obj);
-                                //delete onAvailStack[i];
-                                // null out instead of delete for Opera
+                            if (loadComplete || el.nextSibling) {
+                                executeItem(el, item);
                                 onAvailStack[i] = null;
                             }
                         } else {
@@ -1375,8 +1599,8 @@ if (!YAHOO.util.Event) {
                     for (var i=0,len=elListeners.length; i<len ; ++i) {
                         var l = elListeners[i];
                         // can't use the index on the changing collection
-                        //this.removeListener(el, l.type, l.fn, l.index);
-                        this.removeListener(el, l.type, l.fn);
+                        this.removeListener(el, l.type, l.fn, l.index);
+                        //this.removeListener(el, l.type, l.fn);
                     }
                 }
 
@@ -1403,24 +1627,35 @@ if (!YAHOO.util.Event) {
              * @static
              */           
             getListeners: function(el, sType) {
-                var elListeners = [];
-                if (listeners && listeners.length > 0) {
-                    for (var i=0,len=listeners.length; i<len ; ++i) {
-                        var l = listeners[i];
-                        if ( l  && l[this.EL] === el && 
-                                (!sType || sType === l[this.TYPE]) ) {
-                            elListeners.push({
-                                type:   l[this.TYPE],
-                                fn:     l[this.FN],
-                                obj:    l[this.OBJ],
-                                adjust: l[this.ADJ_SCOPE],
-                                index:  i
-                            });
+                var results=[], searchLists;
+                if (!sType) {
+                    searchLists = [listeners, unloadListeners];
+                } else if (sType == "unload") {
+                    searchLists = [unloadListeners];
+                } else {
+                    searchLists = [listeners];
+                }
+
+                for (var j=0;j<searchLists.length; ++j) {
+                    var searchList = searchLists[j];
+                    if (searchList && searchList.length > 0) {
+                        for (var i=0,len=searchList.length; i<len ; ++i) {
+                            var l = searchList[i];
+                            if ( l  && l[this.EL] === el && 
+                                    (!sType || sType === l[this.TYPE]) ) {
+                                results.push({
+                                    type:   l[this.TYPE],
+                                    fn:     l[this.FN],
+                                    obj:    l[this.OBJ],
+                                    adjust: l[this.ADJ_SCOPE],
+                                    index:  i
+                                });
+                            }
                         }
                     }
                 }
 
-                return (elListeners.length) ? elListeners : null;
+                return (results.length) ? results : null;
             },
 
             /**
@@ -1460,8 +1695,7 @@ if (!YAHOO.util.Event) {
                         index = j-1;
                         l = listeners[index];
                         if (l) {
-                            EU.removeListener(l[EU.EL], l[EU.TYPE], 
-                                    l[EU.FN], index);
+                            EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], index);
                         } 
                         j = j - 1;
                     }
@@ -1523,6 +1757,18 @@ if (!YAHOO.util.Event) {
                     return [0, 0];
                 }
             },
+            
+            /**
+             * Used by old versions of CustomEvent, restored for backwards
+             * compatibility
+             * @method regCE
+             * @private
+             * @static
+             * @deprecated still here for backwards compatibility
+             */
+            regCE: function() {
+                // does nothing
+            },
 
             /**
              * Adds a DOM event directly without the caching, cleanup, scope adj, etc
@@ -1588,21 +1834,102 @@ if (!YAHOO.util.Event) {
          */
         EU.on = EU.addListener;
 
-        // YAHOO.mix(EU, YAHOO.util.EventProvider.prototype);
-        // EU.createEvent("DOMContentReady");
-        // EU.subscribe("DOMContentReady", EU._load);
+        /////////////////////////////////////////////////////////////
+        // DOMReady
+        // based on work by: Dean Edwards/John Resig/Matthias Miller 
+
+        // Internet Explorer: use the readyState of a defered script.
+        // This isolates what appears to be a safe moment to manipulate
+        // the DOM prior to when the document's readyState suggests
+        // it is safe to do so.
+        if (EU.isIE) {
+
+            // Process onAvailable/onContentReady items when when the 
+            // DOM is ready.
+            YAHOO.util.Event.onDOMReady(
+                    YAHOO.util.Event._tryPreloadAttach,
+                    YAHOO.util.Event, true);
+
+            //YAHOO.log("-" + document.readyState + "-");
+
+            var el, d=document, b=d.body;
+
+            // If the library is being injected after window.onload, it
+            // is not safe to document.write the script tag.  Detecting
+            // this state doesn't appear possible, so we expect a flag
+            // in YAHOO_config to be set if the library is being injected.
+            if (("undefined" !== typeof YAHOO_config) && YAHOO_config.injecting) {
+
+                //YAHOO.log("-head-");
+
+                //var dr = d.readyState;
+                //if ("complete" === dr || "interactive" === dr) {
+                    //YAHOO.util.Event._ready();
+                    //YAHOO.util.Event._tryPreloadAttach();
+                //} else {
+
+                    el = document.createElement("script");
+                    var p=d.getElementsByTagName("head")[0] || b;
+                    p.insertBefore(el, p.firstChild);
+
+                //}
+
+            } else {
+                //YAHOO.log("-dw-");
+    d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');
+                el=document.getElementById("_yui_eu_dr");
+            }
+            
+
+            if (el) {
+                el.onreadystatechange = function() {
+                    //YAHOO.log(";comp-" + this.readyState + ";");
+                    if ("complete" === this.readyState) {
+                        this.parentNode.removeChild(this);
+                        YAHOO.util.Event._ready();
+                    }
+                };
+            } else {
+                // The library was likely injected into the page
+                // rendering onDOMReady unreliable
+                // YAHOO.util.Event._ready();
+            }
 
-        if (document && document.body) {
-            EU._load();
+            el=null;
+
+        
+        // Safari: The document's readyState in Safari currently will
+        // change to loaded/complete before images are loaded.
+        //} else if (EU.webkit) {
+        } else if (EU.webkit) {
+
+            EU._drwatch = setInterval(function(){
+                var rs=document.readyState;
+                if ("loaded" == rs || "complete" == rs) {
+                    clearInterval(EU._drwatch);
+                    EU._drwatch = null;
+                    EU._ready();
+                }
+            }, EU.POLL_INTERVAL); 
+
+        // FireFox and Opera: These browsers provide a event for this
+        // moment.
         } else {
-            // EU._simpleAdd(document, "DOMContentLoaded", EU._load);
-            EU._simpleAdd(window, "load", EU._load);
+
+            // @todo will this fire when the library is injected?
+
+            EU._simpleAdd(document, "DOMContentLoaded", EU._ready);
+
         }
+        /////////////////////////////////////////////////////////////
+
+
+        EU._simpleAdd(window, "load", EU._load);
         EU._simpleAdd(window, "unload", EU._unload);
         EU._tryPreloadAttach();
     })();
-}
 
+}
 /**
  * EventProvider is designed to be used with YAHOO.augment to wrap 
  * CustomEvents in an interface that allows events to be subscribed to 
@@ -1638,7 +1965,6 @@ YAHOO.util.EventProvider.prototype = {
      * @method subscribe
      * @param p_type     {string}   the type, or name of the event
      * @param p_fn       {function} the function to exectute when the event fires
-     * @param p_obj
      * @param p_obj      {Object}   An object to be passed along when the event 
      *                              fires
      * @param p_override {boolean}  If true, the obj passed in becomes the 
@@ -1663,21 +1989,50 @@ YAHOO.util.EventProvider.prototype = {
     },
 
     /**
-     * Unsubscribes the from the specified event
+     * Unsubscribes one or more listeners the from the specified event
      * @method unsubscribe
-     * @param p_type {string}   The type, or name of the event
-     * @param p_fn   {Function} The function to execute
-     * @param p_obj  {Object}   The custom object passed to subscribe (optional)
+     * @param p_type {string}   The type, or name of the event.  If the type
+     *                          is not specified, it will attempt to remove
+     *                          the listener from all hosted events.
+     * @param p_fn   {Function} The subscribed function to unsubscribe, if not
+     *                          supplied, all subscribers will be removed.
+     * @param p_obj  {Object}   The custom object passed to subscribe.  This is
+     *                        optional, but if supplied will be used to
+     *                        disambiguate multiple listeners that are the same
+     *                        (e.g., you subscribe many object using a function
+     *                        that lives on the prototype)
      * @return {boolean} true if the subscriber was found and detached.
      */
     unsubscribe: function(p_type, p_fn, p_obj) {
         this.__yui_events = this.__yui_events || {};
-        var ce = this.__yui_events[p_type];
-        if (ce) {
-            return ce.unsubscribe(p_fn, p_obj);
+        var evts = this.__yui_events;
+        if (p_type) {
+            var ce = evts[p_type];
+            if (ce) {
+                return ce.unsubscribe(p_fn, p_obj);
+            }
         } else {
-            return false;
+            for (var i in evts) {
+                var ret = true;
+                if (YAHOO.lang.hasOwnProperty(evts, i)) {
+                    ret = ret && evts[i].unsubscribe(p_fn, p_obj);
+                }
+            }
+            return ret;
         }
+
+        return false;
+    },
+    
+    /**
+     * Removes all listeners from the specified event.  If the event type
+     * is not specified, all listeners from all hosted custom events will
+     * be removed.
+     * @method unsubscribeAll
+     * @param p_type {string}   The type, or name of the event
+     */
+    unsubscribeAll: function(p_type) {
+        return this.unsubscribe(p_type);
     },
 
     /**
@@ -1717,11 +2072,11 @@ YAHOO.util.EventProvider.prototype = {
         var events = this.__yui_events;
 
         if (events[p_type]) {
-            YAHOO.log("EventProvider: error, event already exists");
+YAHOO.log("EventProvider createEvent skipped: '"+p_type+"' already exists");
         } else {
 
             var scope  = opts.scope  || this;
-            var silent = opts.silent || null;
+            var silent = (opts.silent);
 
             var ce = new YAHOO.util.CustomEvent(p_type, scope, silent,
                     YAHOO.util.CustomEvent.FLAT);
@@ -1754,28 +2109,30 @@ YAHOO.util.EventProvider.prototype = {
      *   <li>The custom object (if any) that was passed into the subscribe() 
      *       method</li>
      *   </ul>
+     * If the custom event has not been explicitly created, it will be
+     * created now with the default config, scoped to the host object
      * @method fireEvent
      * @param p_type    {string}  the type, or name of the event
      * @param arguments {Object*} an arbitrary set of parameters to pass to 
      *                            the handler.
-     * @return {boolean} the return value from CustomEvent.fire, or null if 
-     *                   the custom event does not exist.
+     * @return {boolean} the return value from CustomEvent.fire
+     *                   
      */
     fireEvent: function(p_type, arg1, arg2, etc) {
 
         this.__yui_events = this.__yui_events || {};
         var ce = this.__yui_events[p_type];
 
-        if (ce) {
-            var args = [];
-            for (var i=1; i<arguments.length; ++i) {
-                args.push(arguments[i]);
-            }
-            return ce.fire.apply(ce, args);
-        } else {
-            YAHOO.log("EventProvider.fire could not find event: " + p_type);
+        if (!ce) {
+YAHOO.log(p_type + "event fired before it was created.");
             return null;
         }
+
+        var args = [];
+        for (var i=1; i<arguments.length; ++i) {
+            args.push(arguments[i]);
+        }
+        return ce.fire.apply(ce, args);
     },
 
     /**
@@ -1795,3 +2152,199 @@ YAHOO.util.EventProvider.prototype = {
 
 };
 
+/**
+* KeyListener is a utility that provides an easy interface for listening for
+* keydown/keyup events fired against DOM elements.
+* @namespace YAHOO.util
+* @class KeyListener
+* @constructor
+* @param {HTMLElement} attachTo The element or element ID to which the key 
+*                               event should be attached
+* @param {String}      attachTo The element or element ID to which the key
+*                               event should be attached
+* @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).
+* @param {Function}    handler  The CustomEvent handler to fire when the 
+*                               key event is detected
+* @param {Object}      handler  An object literal representing the handler. 
+* @param {String}      event    Optional. The event (keydown or keyup) to 
+*                               listen for. Defaults automatically to keydown.
+*
+* @knownissue the "keypress" event is completely broken in Safari 2.x and below.
+*             the workaround is use "keydown" for key listening.  However, if
+*             it is desired to prevent the default behavior of the keystroke,
+*             that can only be done on the keypress event.  This makes key
+*             handling quite ugly.
+* @knownissue keydown is also broken in Safari 2.x and below for the ESC key.
+*             There currently is no workaround other than choosing another
+*             key to listen for.
+*/
+YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
+    if (!attachTo) {
+        YAHOO.log("No attachTo element specified", "error");
+    } else if (!keyData) {
+        YAHOO.log("No keyData specified", "error");
+    } else if (!handler) {
+        YAHOO.log("No handler specified", "error");
+    } 
+    
+    if (!event) {
+        event = YAHOO.util.KeyListener.KEYDOWN;
+    }
+
+    /**
+    * The CustomEvent fired internally when a key is pressed
+    * @event keyEvent
+    * @private
+    * @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).
+    */
+    var keyEvent = new YAHOO.util.CustomEvent("keyPressed");
+    
+    /**
+    * The CustomEvent fired when the KeyListener is enabled via the enable() 
+    * function
+    * @event enabledEvent
+    * @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).
+    */
+    this.enabledEvent = new YAHOO.util.CustomEvent("enabled");
+
+    /**
+    * The CustomEvent fired when the KeyListener is disabled via the 
+    * disable() function
+    * @event disabledEvent
+    * @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).
+    */
+    this.disabledEvent = new YAHOO.util.CustomEvent("disabled");
+
+    if (typeof attachTo == 'string') {
+        attachTo = document.getElementById(attachTo);
+    }
+
+    if (typeof handler == 'function') {
+        keyEvent.subscribe(handler);
+    } else {
+        keyEvent.subscribe(handler.fn, handler.scope, handler.correctScope);
+    }
+
+    /**
+    * Handles the key event when a key is pressed.
+    * @method handleKeyPress
+    * @param {DOMEvent} e   The keypress DOM event
+    * @param {Object}   obj The DOM event scope object
+    * @private
+    */
+    function handleKeyPress(e, obj) {
+        if (! keyData.shift) {  
+            keyData.shift = false; 
+        }
+        if (! keyData.alt) {    
+            keyData.alt = false;
+        }
+        if (! keyData.ctrl) {
+            keyData.ctrl = false;
+        }
+
+        // check held down modifying keys first
+        if (e.shiftKey == keyData.shift && 
+            e.altKey   == keyData.alt &&
+            e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
+            
+            var dataItem;
+            var keyPressed;
+
+            if (keyData.keys instanceof Array) {
+                for (var i=0;i<keyData.keys.length;i++) {
+                    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);
+                }
+            }
+        }
+    }
+
+    /**
+    * Enables the KeyListener by attaching the DOM event listeners to the 
+    * target DOM element
+    * @method enable
+    */
+    this.enable = function() {
+        if (! this.enabled) {
+            YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);
+            this.enabledEvent.fire(keyData);
+        }
+        /**
+        * Boolean indicating the enabled/disabled state of the Tooltip
+        * @property enabled
+        * @type Boolean
+        */
+        this.enabled = true;
+    };
+
+    /**
+    * Disables the KeyListener by removing the DOM event listeners from the 
+    * target DOM element
+    * @method disable
+    */
+    this.disable = function() {
+        if (this.enabled) {
+            YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);
+            this.disabledEvent.fire(keyData);
+        }
+        this.enabled = false;
+    };
+
+    /**
+    * Returns a String representation of the object.
+    * @method toString
+    * @return {String}  The string representation of the KeyListener
+    */ 
+    this.toString = function() {
+        return "KeyListener [" + keyData.keys + "] " + attachTo.tagName + 
+                (attachTo.id ? "[" + attachTo.id + "]" : "");
+    };
+
+};
+
+/**
+* Constant representing the DOM "keydown" event.
+* @property YAHOO.util.KeyListener.KEYDOWN
+* @static
+* @final
+* @type String
+*/
+YAHOO.util.KeyListener.KEYDOWN = "keydown";
+
+/**
+* Constant representing the DOM "keyup" event.
+* @property YAHOO.util.KeyListener.KEYUP
+* @static
+* @final
+* @type String
+*/
+YAHOO.util.KeyListener.KEYUP = "keyup";
+YAHOO.register("event", YAHOO.util.Event, {version: "2.3.0", build: "442"});
index 1bb595a73984d68ee4b50c6edc94f2678a19595a..00437966f679717770f9cf4d0bcd38f3d7a87116 100755 (executable)
@@ -1,69 +1,95 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 
-
 YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}
-var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
-this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
+var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}
+if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
+this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();}
+var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
 return found;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}
-var args=[],ret=true,i;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
+var args=[],ret=true,i,rebuild=false;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
 var argslength=args.length;if(!this.silent){}
-for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}
+for(i=0;i<len;++i){var s=this.subscribers[i];if(!s){rebuild=true;}else{if(!this.silent){}
 var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}
 ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}
 if(false===ret){if(!this.silent){}
 return false;}}}
-return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
-this.subscribers.splice(index,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=obj||null;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
-return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=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 self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
+if(rebuild){var newlist=[],subs=this.subscribers;for(i=0,len=subs.length;i<len;++i){s=subs[i];newlist.push(subs[i]);}
+this.subscribers=newlist;}
+return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}
+this.subscribers=[];return i;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
+this.subscribers[index]=null;},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=YAHOO.lang.isUndefined(obj)?null:obj;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
+return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var DOMReady=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var webkitKeymap={63232:38,63233:40,63234:37,63235:39};return{POLL_RETRYS:4000,POLL_INTERVAL:10,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onDOMReady:function(p_fn,p_obj,p_override){if(DOMReady){setTimeout(function(){var s=window;if(p_override){if(p_override===true){s=p_obj;}else{s=p_override;}}
+p_fn.call(s,"DOMReady",[],p_obj);},0);}else{this.DOMReadyEvent.subscribe(p_fn,p_obj,p_override);}},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
 if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}
-return ok;}else if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
+return ok;}else if(YAHOO.lang.isString(el)){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
 if(!el){return false;}
 if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}
 var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}
 var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
-legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(e){this.removeListener(el,sType,fn);return false;}}
-return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true;var le=legacyHandlers[legacyIndex];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var scope=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
-return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(!el.addEventListener&&!el.attachEvent){return true;}else if(this.isSafari){if("click"==sType||"dblclick"==sType){return true;}}
+legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}}
+return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true,le,lh,li,scope,ret;lh=legacyHandlers[legacyIndex];for(var i=0,len=lh.length;i<len;++i){li=lh[i];if(li&&li[this.WFN]){scope=li[this.ADJ_SCOPE];ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
+le=legacyEvents[legacyIndex];if(le&&le[2]){le[2](e);}
+return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(this.webkit&&("click"==sType||"dblclick"==sType)){var v=parseInt(this.webkit,10);if(!isNaN(v)&&v<418){return true;}}
 return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
 return ok;}
 if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
-if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners.splice(i,1);return true;}}
+if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners[i]=null;return true;}}
 return false;}
 var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}
 if(index>=0){cacheItem=listeners[index];}
 if(!el||!cacheItem){return false;}
-if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist.splice(i,1);break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(e){return false;}}
-delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
+if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist[i]=null;break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(ex){this.lastError=ex;return false;}}
+delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners[index]=null;return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
 return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
 return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
-return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}
+return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}
 return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
 c=c.caller;}}
-return ev;},getCharCode:function(ev){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
+return ev;},getCharCode:function(ev){var code=ev.keyCode||ev.charCode||0;if(YAHOO.env.ua.webkit&&(code in webkitKeymap)){code=webkitKeymap[code];}
+return code;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
 return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
-return id;},_isValidCollection:function(o){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){loadComplete=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}
+return id;},_isValidCollection:function(o){try{return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");}catch(e){return false;}},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(e){if(!loadComplete){loadComplete=true;var EU=YAHOO.util.Event;EU._ready();EU._tryPreloadAttach();}},_ready:function(e){if(!DOMReady){DOMReady=true;var EU=YAHOO.util.Event;EU.DOMReadyEvent.fire();EU._simpleRemove(document,"DOMContentLoaded",EU._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}
+if(this.isIE){if(!DOMReady){this.startInterval();return false;}}
 this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}
-var notAvail=[];for(var i=0,len=onAvailStack.length;i<len;++i){var item=onAvailStack[i];if(item){var el=this.getEl(item.id);if(el){if(!item.checkReady||loadComplete||el.nextSibling||(document&&document.body)){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
-item.fn.call(scope,item.obj);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
+var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
+item.fn.call(scope,item.obj);};var i,len,item,el;for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&!item.checkReady){el=this.getEl(item.id);if(el){executeItem(el,item);onAvailStack[i]=null;}else{notAvail.push(item);}}}
+for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&item.checkReady){el=this.getEl(item.id);if(el){if(loadComplete||el.nextSibling){executeItem(el,item);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
 retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}
-this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn);}}
-if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var elListeners=[];if(listeners&&listeners.length>0){for(var i=0,len=listeners.length;i<len;++i){var l=listeners[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){elListeners.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}
-return(elListeners.length)?elListeners:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
+this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn,l.index);}}
+if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else if(sType=="unload"){searchLists=[unloadListeners];}else{searchLists=[listeners];}
+for(var j=0;j<searchLists.length;++j){var searchList=searchLists[j];if(searchList&&searchList.length>0){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}
+return(results.length)?results:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
 l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}
 unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}
 j=j-1;}
 l=null;EU.clearCache();}
 for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}
-legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}
-EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
+legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var el,d=document,b=d.body;if(("undefined"!==typeof YAHOO_config)&&YAHOO_config.injecting){el=document.createElement("script");var p=d.getElementsByTagName("head")[0]||b;p.insertBefore(el,p.firstChild);}else{d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');el=document.getElementById("_yui_eu_dr");}
+if(el){el.onreadystatechange=function(){if("complete"===this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};}else{}
+el=null;}else if(EU.webkit){EU._drwatch=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._drwatch);EU._drwatch=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}
+EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
 YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}
-subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}else{return false;}},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=opts.silent||null;var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
+subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var evts=this.__yui_events;if(p_type){var ce=evts[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}}else{for(var i in evts){var ret=true;if(YAHOO.lang.hasOwnProperty(evts,i)){ret=ret&&evts[i].unsubscribe(p_fn,p_obj);}}
+return ret;}
+return false;},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=(opts.silent);var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
 this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}
-return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){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
+return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(!ce){return null;}
+var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
+return ce.fire.apply(ce,args);},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}
+return false;}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else if(!keyData){}else if(!handler){}
+if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
+var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
+if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
+function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
+if(!keyData.alt){keyData.alt=false;}
+if(!keyData.ctrl){keyData.ctrl=false;}
+if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
+this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
+this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
+this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+
+(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.register("event",YAHOO.util.Event,{version:"2.3.0",build:"442"});
\ No newline at end of file
index 22c97ca2b3503c6c31a4c317db1b24fbb0465200..83815a8a9388471ea0b9bdd93f1a50cca7c54e5c 100755 (executable)
@@ -1,9 +1,10 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
+
 /**
  * The CustomEvent class lets you define events for your application
  * that can be subscribed to by one or more independent component.
@@ -144,6 +145,11 @@ YAHOO.util.CustomEvent.prototype = {
      *                                   the execution scope.
      */
     subscribe: function(fn, obj, override) {
+
+        if (!fn) {
+throw new Error("Invalid callback for subscriber to '" + this.type + "'");
+        }
+
         if (this.subscribeEvent) {
             this.subscribeEvent.fire(fn, obj, override);
         }
@@ -152,13 +158,23 @@ YAHOO.util.CustomEvent.prototype = {
     },
 
     /**
-     * Unsubscribes the caller from this event
+     * Unsubscribes subscribers.
      * @method unsubscribe
-     * @param {Function} fn  The function to execute
-     * @param {Object}   obj  The custom object passed to subscribe (optional)
+     * @param {Function} fn  The subscribed function to remove, if not supplied
+     *                       all will be removed
+     * @param {Object}   obj  The custom object passed to subscribe.  This is
+     *                        optional, but if supplied will be used to
+     *                        disambiguate multiple listeners that are the same
+     *                        (e.g., you subscribe many object using a function
+     *                        that lives on the prototype)
      * @return {boolean} True if the subscriber was found and detached.
      */
     unsubscribe: function(fn, obj) {
+
+        if (!fn) {
+            return this.unsubscribeAll();
+        }
+
         var found = false;
         for (var i=0, len=this.subscribers.length; i<len; ++i) {
             var s = this.subscribers[i];
@@ -193,7 +209,7 @@ YAHOO.util.CustomEvent.prototype = {
             return true;
         }
 
-        var args=[], ret=true, i;
+        var args=[], ret=true, i, rebuild=false;
 
         for (i=0; i<arguments.length; ++i) {
             args.push(arguments[i]);
@@ -206,7 +222,9 @@ YAHOO.util.CustomEvent.prototype = {
 
         for (i=0; i<len; ++i) {
             var s = this.subscribers[i];
-            if (s) {
+            if (!s) {
+                rebuild=true;
+            } else {
                 if (!this.silent) {
                 }
 
@@ -231,17 +249,32 @@ YAHOO.util.CustomEvent.prototype = {
             }
         }
 
+        if (rebuild) {
+            var newlist=[],subs=this.subscribers;
+            for (i=0,len=subs.length; i<len; ++i) {
+                s = subs[i];
+                newlist.push(subs[i]);
+            }
+
+            this.subscribers=newlist;
+        }
+
         return true;
     },
 
     /**
      * Removes all listeners
      * @method unsubscribeAll
+     * @return {int} The number of listeners unsubscribed
      */
     unsubscribeAll: function() {
         for (var i=0, len=this.subscribers.length; i<len; ++i) {
             this._delete(len - 1 - i);
         }
+
+        this.subscribers=[];
+
+        return i;
     },
 
     /**
@@ -255,8 +288,7 @@ YAHOO.util.CustomEvent.prototype = {
             delete s.obj;
         }
 
-        // delete this.subscribers[index];
-        this.subscribers.splice(index, 1);
+        this.subscribers[index]=null;
     },
 
     /**
@@ -295,7 +327,7 @@ YAHOO.util.Subscriber = function(fn, obj, override) {
      * @property obj
      * @type object
      */
-    this.obj = obj || null;
+    this.obj = YAHOO.lang.isUndefined(obj) ? null : obj;
 
     /**
      * The default execution scope for the event listener is defined when the
@@ -351,7 +383,7 @@ YAHOO.util.Subscriber.prototype.contains = function(fn, obj) {
  * @method toString
  */
 YAHOO.util.Subscriber.prototype.toString = function() {
-    return "Subscriber { obj: " + (this.obj || "")  + 
+    return "Subscriber { obj: " + this.obj  + 
            ", override: " +  (this.override || "no") + " }";
 };
 
@@ -366,6 +398,9 @@ YAHOO.util.Subscriber.prototype.toString = function() {
  */
 
 // The first instance of Event will win if it is loaded more than once.
+// @TODO this needs to be changed so that only the state data that needs to
+// be preserved is kept, while methods are overwritten/added as needed.
+// This means that the module pattern can't be used.
 if (!YAHOO.util.Event) {
 
 /**
@@ -387,6 +422,15 @@ if (!YAHOO.util.Event) {
          */
         var loadComplete =  false;
 
+        /**
+         * True when the document is initially usable
+         * @property DOMReady
+         * @type boolean
+         * @static
+         * @private
+         */
+        var DOMReady = false;
+
         /**
          * Cache of wrapped listeners
          * @property listeners
@@ -456,21 +500,36 @@ if (!YAHOO.util.Event) {
          * @private
          */
         var counter = 0;
+        
+        /**
+         * Normalized keycodes for webkit/safari
+         * @property webkitKeymap
+         * @type {int: int}
+         * @private
+         * @static
+         * @final
+         */
+        var webkitKeymap = {
+            63232: 38, // up
+            63233: 40, // down
+            63234: 37, // left
+            63235: 39  // right
+        };
 
-        return { // PREPROCESS
+        return {
 
             /**
              * The number of times we should look for elements that are not
              * in the DOM at the time the event is requested after the document
-             * has been loaded.  The default is 200@amp;50 ms, so it will poll
-             * for 10 seconds or until all outstanding handlers are bound
+             * has been loaded.  The default is 4000@amp;10 ms, so it will poll
+             * for 40 seconds or until all outstanding handlers are bound
              * (whichever comes first).
              * @property POLL_RETRYS
              * @type int
              * @static
              * @final
              */
-            POLL_RETRYS: 200,
+            POLL_RETRYS: 4000,
 
             /**
              * The poll interval in milliseconds
@@ -479,7 +538,7 @@ if (!YAHOO.util.Event) {
              * @static
              * @final
              */
-            POLL_INTERVAL: 20,
+            POLL_INTERVAL: 10,
 
             /**
              * Element to bind, int constant
@@ -538,30 +597,47 @@ if (!YAHOO.util.Event) {
             ADJ_SCOPE: 4,
 
             /**
-             * Safari detection is necessary to work around the preventDefault
-             * bug that makes it so you can't cancel a href click from the 
-             * handler.  There is not a capabilities check we can use here.
+             * addListener/removeListener can throw errors in unexpected scenarios.
+             * These errors are suppressed, the method returns false, and this property
+             * is set
+             * @property lastError
+             * @static
+             * @type Error
+             */
+            lastError: null,
+
+            /**
+             * Safari detection
              * @property isSafari
              * @private
              * @static
+             * @deprecated use YAHOO.env.ua.webkit
              */
-            isSafari: (/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),
-
+            isSafari: YAHOO.env.ua.webkit,
+            
+            /**
+             * webkit version
+             * @property webkit
+             * @type string
+             * @private
+             * @static
+             * @deprecated use YAHOO.env.ua.webkit
+             */
+            webkit: YAHOO.env.ua.webkit,
+            
             /**
-             * IE detection needed to properly calculate pageX and pageY.  
-             * capabilities checking didn't seem to work because another 
-             * browser that does not provide the properties have the values 
-             * calculated in a different manner than IE.
+             * IE detection 
              * @property isIE
              * @private
              * @static
+             * @deprecated use YAHOO.env.ua.ie
              */
-            isIE: (!this.isSafari && !navigator.userAgent.match(/opera/gi) && 
-                    navigator.userAgent.match(/msie/gi)),
+            isIE: YAHOO.env.ua.ie,
 
             /**
              * poll handle
              * @property _interval
+             * @static
              * @private
              */
             _interval: null,
@@ -576,7 +652,6 @@ if (!YAHOO.util.Event) {
                     var self = this;
                     var callback = function() { self._tryPreloadAttach(); };
                     this._interval = setInterval(callback, this.POLL_INTERVAL);
-                    // this.timeout = setTimeout(callback, i);
                 }
             },
 
@@ -588,14 +663,18 @@ if (!YAHOO.util.Event) {
              * The number of times it will poll and the frequency are
              * configurable.  By default it will poll for 10 seconds.
              *
+             * <p>The callback is executed with a single parameter:
+             * the custom object parameter, if provided.</p>
+             *
              * @method onAvailable
              *
              * @param {string}   p_id the id of the element to look for.
              * @param {function} p_fn what to execute when the element is found.
              * @param {object}   p_obj an optional object to be passed back as
              *                   a parameter to p_fn.
-             * @param {boolean}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj
+             * @param {boolean|object}  p_override If set to true, p_fn will execute
+             *                   in the scope of p_obj, if set to an object it
+             *                   will execute in the scope of that object
              *
              * @static
              */
@@ -605,24 +684,77 @@ if (!YAHOO.util.Event) {
                                      obj:        p_obj, 
                                      override:   p_override, 
                                      checkReady: false    } );
-
                 retryCount = this.POLL_RETRYS;
                 this.startInterval();
             },
 
+            /**
+             * Executes the supplied callback when the DOM is first usable.  This
+             * will execute immediately if called after the DOMReady event has
+             * fired.   @todo the DOMContentReady event does not fire when the
+             * script is dynamically injected into the page.  This means the
+             * DOMReady custom event will never fire in FireFox or Opera when the
+             * library is injected.  It _will_ fire in Safari, and the IE 
+             * implementation would allow for us to fire it if the defered script
+             * is not available.  We want this to behave the same in all browsers.
+             * Is there a way to identify when the script has been injected 
+             * instead of included inline?  Is there a way to know whether the 
+             * window onload event has fired without having had a listener attached 
+             * to it when it did so?
+             *
+             * <p>The callback is a CustomEvent, so the signature is:</p>
+             * <p>type <string>, args <array>, customobject <object></p>
+             * <p>For DOMReady events, there are no fire argments, so the
+             * signature is:</p>
+             * <p>"DOMReady", [], obj</p>
+             *
+             *
+             * @method onDOMReady
+             *
+             * @param {function} p_fn what to execute when the element is found.
+             * @param {object}   p_obj an optional object to be passed back as
+             *                   a parameter to p_fn.
+             * @param {boolean|object}  p_scope If set to true, p_fn will execute
+             *                   in the scope of p_obj, if set to an object it
+             *                   will execute in the scope of that object
+             *
+             * @static
+             */
+            onDOMReady: function(p_fn, p_obj, p_override) {
+                if (DOMReady) {
+                    setTimeout(function() {
+                        var s = window;
+                        if (p_override) {
+                            if (p_override === true) {
+                                s = p_obj;
+                            } else {
+                                s = p_override;
+                            }
+                        }
+                        p_fn.call(s, "DOMReady", [], p_obj);
+                    }, 0);
+                } else {
+                    this.DOMReadyEvent.subscribe(p_fn, p_obj, p_override);
+                }
+            },
+
             /**
              * Works the same way as onAvailable, but additionally checks the
              * state of sibling elements to determine if the content of the
              * available element is safe to modify.
              *
+             * <p>The callback is executed with a single parameter:
+             * the custom object parameter, if provided.</p>
+             *
              * @method onContentReady
              *
              * @param {string}   p_id the id of the element to look for.
              * @param {function} p_fn what to execute when the element is ready.
              * @param {object}   p_obj an optional object to be passed back as
              *                   a parameter to p_fn.
-             * @param {boolean}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj
+             * @param {boolean|object}  p_override If set to true, p_fn will execute
+             *                   in the scope of p_obj.  If an object, p_fn will
+             *                   exectute in the scope of that object
              *
              * @static
              */
@@ -642,15 +774,18 @@ if (!YAHOO.util.Event) {
              *
              * @method addListener
              *
-             * @param {Object}   el        The html element to assign the 
-             *                             event to
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to assign the 
+             *  listener to.
              * @param {String}   sType     The type of event to append
              * @param {Function} fn        The method the event invokes
              * @param {Object}   obj    An arbitrary object that will be 
              *                             passed as a parameter to the handler
-             * @param {boolean}  override  If true, the obj passed in becomes
-             *                             the execution scope of the listener
-             * @return {boolean} True if the action was successful or defered,
+             * @param {Boolean|object}  override  If true, the obj passed in becomes
+             *                             the execution scope of the listener. If an
+             *                             object, this object becomes the execution
+             *                             scope.
+             * @return {Boolean} True if the action was successful or defered,
              *                        false if one or more of the elements 
              *                        could not have the listener attached,
              *                        or if the operation throws an exception.
@@ -659,6 +794,7 @@ if (!YAHOO.util.Event) {
             addListener: function(el, sType, fn, obj, override) {
 
                 if (!fn || !fn.call) {
+// throw new TypeError(sType + " addListener call failed, callback undefined");
                     return false;
                 }
 
@@ -674,7 +810,7 @@ if (!YAHOO.util.Event) {
                     }
                     return ok;
 
-                } else if (typeof el == "string") {
+                } else if (YAHOO.lang.isString(el)) {
                     var oEl = this.getEl(el);
                     // If the el argument is a string, we assume it is 
                     // actually the id of the element.  If the page is loaded
@@ -768,9 +904,10 @@ if (!YAHOO.util.Event) {
                 } else {
                     try {
                         this._simpleAdd(el, sType, wrappedFn, false);
-                    } catch(e) {
+                    } catch(ex) {
                         // handle an error trying to attach an event.  If it fails
                         // we need to clean up the cache
+                        this.lastError = ex;
                         this.removeListener(el, sType, fn);
                         return false;
                     }
@@ -788,18 +925,27 @@ if (!YAHOO.util.Event) {
              * @private
              */
             fireLegacyEvent: function(e, legacyIndex) {
-                var ok = true;
-
-                var le = legacyHandlers[legacyIndex];
-                for (var i=0,len=le.length; i<len; ++i) {
-                    var li = le[i];
+                var ok=true,le,lh,li,scope,ret;
+                
+                lh = legacyHandlers[legacyIndex];
+                for (var i=0,len=lh.length; i<len; ++i) {
+                    li = lh[i];
                     if ( li && li[this.WFN] ) {
-                        var scope = li[this.ADJ_SCOPE];
-                        var ret = li[this.WFN].call(scope, e);
+                        scope = li[this.ADJ_SCOPE];
+                        ret = li[this.WFN].call(scope, e);
                         ok = (ok && ret);
                     }
                 }
 
+                // Fire the original handler if we replaced one.  We fire this
+                // after the other events to keep stopPropagation/preventDefault
+                // that happened in the DOM0 handler from touching our DOM2
+                // substitute
+                le = legacyEvents[legacyIndex];
+                if (le && le[2]) {
+                    le[2](e);
+                }
+                
                 return ok;
             },
 
@@ -821,16 +967,16 @@ if (!YAHOO.util.Event) {
 
             /**
              * Logic that determines when we should automatically use legacy
-             * events instead of DOM2 events.
+             * events instead of DOM2 events.  Currently this is limited to old
+             * Safari browsers with a broken preventDefault
              * @method useLegacyEvent
              * @static
              * @private
              */
             useLegacyEvent: function(el, sType) {
-                if (!el.addEventListener && !el.attachEvent) {
-                    return true;
-                } else if (this.isSafari) {
-                    if ("click" == sType || "dblclick" == sType) {
+                if (this.webkit && ("click"==sType || "dblclick"==sType)) {
+                    var v = parseInt(this.webkit, 10);
+                    if (!isNaN(v) && v<418) {
                         return true;
                     }
                 }
@@ -838,18 +984,19 @@ if (!YAHOO.util.Event) {
             },
                     
             /**
-             * Removes an event handler
+             * Removes an event listener
              *
              * @method removeListener
              *
-             * @param {Object} el the html element or the id of the element to 
-             * assign the event to.
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to remove
+             *  the listener from.
              * @param {String} sType the type of event to remove.
              * @param {Function} fn the method the event invokes.  If fn is
-             * undefined, then all event handlers for the type of event are 
-             * removed.
+             *  undefined, then all event handlers for the type of event are 
+             *  removed.
              * @return {boolean} true if the unbind was successful, false 
-             * otherwise.
+             *  otherwise.
              * @static
              */
             removeListener: function(el, sType, fn) {
@@ -880,7 +1027,8 @@ if (!YAHOO.util.Event) {
                             li[0] == el && 
                             li[1] == sType && 
                             li[2] == fn) {
-                                unloadListeners.splice(i, 1);
+                                //unloadListeners.splice(i, 1);
+                                unloadListeners[i]=null;
                                 return true;
                         }
                     }
@@ -918,7 +1066,8 @@ if (!YAHOO.util.Event) {
                                 li[this.EL] == el && 
                                 li[this.TYPE] == sType && 
                                 li[this.FN] == fn) {
-                                    llist.splice(i, 1);
+                                    //llist.splice(i, 1);
+                                    llist[i]=null;
                                     break;
                             }
                         }
@@ -927,7 +1076,8 @@ if (!YAHOO.util.Event) {
                 } else {
                     try {
                         this._simpleRemove(el, sType, cacheItem[this.WFN], false);
-                    } catch(e) {
+                    } catch(ex) {
+                        this.lastError = ex;
                         return false;
                     }
                 }
@@ -935,14 +1085,17 @@ if (!YAHOO.util.Event) {
                 // removed the wrapped handler
                 delete listeners[index][this.WFN];
                 delete listeners[index][this.FN];
-                listeners.splice(index, 1);
+                //listeners.splice(index, 1);
+                listeners[index]=null;
 
                 return true;
 
             },
 
             /**
-             * Returns the event's target element
+             * Returns the event's target element.  Safari sometimes provides
+             * a text node, and this is automatically resolved to the text
+             * node's parent so that it behaves like other browsers.
              * @method getTarget
              * @param {Event} ev the event
              * @param {boolean} resolveTextNode when set to true the target's
@@ -967,8 +1120,6 @@ if (!YAHOO.util.Event) {
              * @static
              */
             resolveTextNode: function(node) {
-                // if (node && node.nodeName && 
-                        // "#TEXT" == node.nodeName.toUpperCase()) {
                 if (node && 3 == node.nodeType) {
                     return node.parentNode;
                 } else {
@@ -1013,6 +1164,7 @@ if (!YAHOO.util.Event) {
                     }
                 }
 
+
                 return y;
             },
 
@@ -1060,7 +1212,8 @@ if (!YAHOO.util.Event) {
                     var t = new Date().getTime();
                     try {
                         ev.time = t;
-                    } catch(e) { 
+                    } catch(ex) { 
+                        this.lastError = ex;
                         return t;
                     }
                 }
@@ -1143,7 +1296,13 @@ if (!YAHOO.util.Event) {
              * @static
              */
             getCharCode: function(ev) {
-                return ev.charCode || ev.keyCode || 0;
+                var code = ev.keyCode || ev.charCode || 0;
+
+                // webkit normalization
+                if (YAHOO.env.ua.webkit && (code in webkitKeymap)) {
+                    code = webkitKeymap[code];
+                }
+                return code;
             },
 
             /**
@@ -1187,6 +1346,7 @@ if (!YAHOO.util.Event) {
                 return id;
             },
 
+
             /**
              * We want to be able to use getElementsByTagName as a collection
              * to attach a group of events to.  Unfortunately, different 
@@ -1200,15 +1360,16 @@ if (!YAHOO.util.Event) {
              * @private
              */
             _isValidCollection: function(o) {
-                // this.logger.debug(o.constructor.toString())
-                // this.logger.debug(typeof o)
-
-                return ( o                    && // o is something
-                         o.length             && // o is indexed
-                         typeof o != "string" && // o is not a string
-                         !o.tagName           && // o is not an HTML element
-                         !o.alert             && // o is not a window
-                         typeof o[0] != "undefined" );
+                try {
+                    return ( o                    && // o is something
+                             o.length             && // o is indexed
+                             typeof o != "string" && // o is not a string
+                             !o.tagName           && // o is not an HTML element
+                             !o.alert             && // o is not a window
+                             typeof o[0] != "undefined" );
+                } catch(e) {
+                    return false;
+                }
 
             },
 
@@ -1217,6 +1378,8 @@ if (!YAHOO.util.Event) {
              * @property elCache
              * DOM element cache
              * @static
+             * @deprecated Elements are not cached due to issues that arise when
+             * elements are removed and re-added
              */
             elCache: {},
 
@@ -1226,6 +1389,7 @@ if (!YAHOO.util.Event) {
              * @method getEl
              * @static
              * @private
+             * @deprecated Elements are not cached any longer
              */
             getEl: function(id) {
                 return document.getElementById(id);
@@ -1240,6 +1404,12 @@ if (!YAHOO.util.Event) {
              */
             clearCache: function() { },
 
+            /**
+             * Custom event the fires when the dom is initially usable
+             * @event DOMReadyEvent
+             */
+            DOMReadyEvent: new YAHOO.util.CustomEvent("DOMReady", this),
+
             /**
              * hook up any deferred listeners
              * @method _load
@@ -1247,12 +1417,45 @@ if (!YAHOO.util.Event) {
              * @private
              */
             _load: function(e) {
-                loadComplete = true;
-                var EU = YAHOO.util.Event;
-                // Remove the listener to assist with the IE memory issue, but not
-                // for other browsers because FF 1.0x does not like it.
-                if (this.isIE) {
-                    EU._simpleRemove(window, "load", EU._load);
+
+                if (!loadComplete) {
+                    loadComplete = true;
+                    var EU = YAHOO.util.Event;
+
+                    // Just in case DOMReady did not go off for some reason
+                    EU._ready();
+
+                    // Available elements may not have been detected before the
+                    // window load event fires. Try to find them now so that the
+                    // the user is more likely to get the onAvailable notifications
+                    // before the window load notification
+                    EU._tryPreloadAttach();
+
+                    // Remove the listener to assist with the IE memory issue, but not
+                    // for other browsers because FF 1.0x does not like it.
+                    //if (this.isIE) {
+                        //EU._simpleRemove(window, "load", EU._load);
+                    //}
+                }
+            },
+
+            /**
+             * Fires the DOMReady event listeners the first time the document is
+             * usable.
+             * @method _ready
+             * @static
+             * @private
+             */
+            _ready: function(e) {
+                if (!DOMReady) {
+                    DOMReady=true;
+                    var EU = YAHOO.util.Event;
+
+                    // Fire the content ready custom event
+                    EU.DOMReadyEvent.fire();
+
+                    // Remove the DOMContentLoaded (FF/Opera)
+                    EU._simpleRemove(document, "DOMContentLoaded", EU._ready);
                 }
             },
 
@@ -1270,6 +1473,17 @@ if (!YAHOO.util.Event) {
                     return false;
                 }
 
+                if (this.isIE) {
+                    // Hold off if DOMReady has not fired and check current
+                    // readyState to protect against the IE operation aborted
+                    // issue.
+                    //if (!DOMReady || "complete" !== document.readyState) {
+                    if (!DOMReady) {
+                        this.startInterval();
+                        return false;
+                    }
+                }
+
                 this.locked = true;
 
 
@@ -1284,32 +1498,46 @@ if (!YAHOO.util.Event) {
 
                 // onAvailable
                 var notAvail = [];
-                for (var i=0,len=onAvailStack.length; i<len ; ++i) {
-                    var item = onAvailStack[i];
-                    if (item) {
-                        var el = this.getEl(item.id);
+
+                var executeItem = function (el, item) {
+                    var scope = el;
+                    if (item.override) {
+                        if (item.override === true) {
+                            scope = item.obj;
+                        } else {
+                            scope = item.override;
+                        }
+                    }
+                    item.fn.call(scope, item.obj);
+                };
+
+                var i,len,item,el;
+
+                // onAvailable
+                for (i=0,len=onAvailStack.length; i<len; ++i) {
+                    item = onAvailStack[i];
+                    if (item && !item.checkReady) {
+                        el = this.getEl(item.id);
+                        if (el) {
+                            executeItem(el, item);
+                            onAvailStack[i] = null;
+                        } else {
+                            notAvail.push(item);
+                        }
+                    }
+                }
+
+                // onContentReady
+                for (i=0,len=onAvailStack.length; i<len; ++i) {
+                    item = onAvailStack[i];
+                    if (item && item.checkReady) {
+                        el = this.getEl(item.id);
 
                         if (el) {
                             // The element is available, but not necessarily ready
-                            // @todo verify IE7 compatibility
                             // @todo should we test parentNode.nextSibling?
-                            // @todo re-evaluate global content ready
-                            if ( !item.checkReady || 
-                                    loadComplete || 
-                                    el.nextSibling ||
-                                    (document && document.body) ) {
-
-                                var scope = el;
-                                if (item.override) {
-                                    if (item.override === true) {
-                                        scope = item.obj;
-                                    } else {
-                                        scope = item.override;
-                                    }
-                                }
-                                item.fn.call(scope, item.obj);
-                                //delete onAvailStack[i];
-                                // null out instead of delete for Opera
+                            if (loadComplete || el.nextSibling) {
+                                executeItem(el, item);
                                 onAvailStack[i] = null;
                             }
                         } else {
@@ -1352,8 +1580,8 @@ if (!YAHOO.util.Event) {
                     for (var i=0,len=elListeners.length; i<len ; ++i) {
                         var l = elListeners[i];
                         // can't use the index on the changing collection
-                        //this.removeListener(el, l.type, l.fn, l.index);
-                        this.removeListener(el, l.type, l.fn);
+                        this.removeListener(el, l.type, l.fn, l.index);
+                        //this.removeListener(el, l.type, l.fn);
                     }
                 }
 
@@ -1380,24 +1608,35 @@ if (!YAHOO.util.Event) {
              * @static
              */           
             getListeners: function(el, sType) {
-                var elListeners = [];
-                if (listeners && listeners.length > 0) {
-                    for (var i=0,len=listeners.length; i<len ; ++i) {
-                        var l = listeners[i];
-                        if ( l  && l[this.EL] === el && 
-                                (!sType || sType === l[this.TYPE]) ) {
-                            elListeners.push({
-                                type:   l[this.TYPE],
-                                fn:     l[this.FN],
-                                obj:    l[this.OBJ],
-                                adjust: l[this.ADJ_SCOPE],
-                                index:  i
-                            });
+                var results=[], searchLists;
+                if (!sType) {
+                    searchLists = [listeners, unloadListeners];
+                } else if (sType == "unload") {
+                    searchLists = [unloadListeners];
+                } else {
+                    searchLists = [listeners];
+                }
+
+                for (var j=0;j<searchLists.length; ++j) {
+                    var searchList = searchLists[j];
+                    if (searchList && searchList.length > 0) {
+                        for (var i=0,len=searchList.length; i<len ; ++i) {
+                            var l = searchList[i];
+                            if ( l  && l[this.EL] === el && 
+                                    (!sType || sType === l[this.TYPE]) ) {
+                                results.push({
+                                    type:   l[this.TYPE],
+                                    fn:     l[this.FN],
+                                    obj:    l[this.OBJ],
+                                    adjust: l[this.ADJ_SCOPE],
+                                    index:  i
+                                });
+                            }
                         }
                     }
                 }
 
-                return (elListeners.length) ? elListeners : null;
+                return (results.length) ? results : null;
             },
 
             /**
@@ -1437,8 +1676,7 @@ if (!YAHOO.util.Event) {
                         index = j-1;
                         l = listeners[index];
                         if (l) {
-                            EU.removeListener(l[EU.EL], l[EU.TYPE], 
-                                    l[EU.FN], index);
+                            EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], index);
                         } 
                         j = j - 1;
                     }
@@ -1500,6 +1738,18 @@ if (!YAHOO.util.Event) {
                     return [0, 0];
                 }
             },
+            
+            /**
+             * Used by old versions of CustomEvent, restored for backwards
+             * compatibility
+             * @method regCE
+             * @private
+             * @static
+             * @deprecated still here for backwards compatibility
+             */
+            regCE: function() {
+                // does nothing
+            },
 
             /**
              * Adds a DOM event directly without the caching, cleanup, scope adj, etc
@@ -1565,21 +1815,98 @@ if (!YAHOO.util.Event) {
          */
         EU.on = EU.addListener;
 
-        // YAHOO.mix(EU, YAHOO.util.EventProvider.prototype);
-        // EU.createEvent("DOMContentReady");
-        // EU.subscribe("DOMContentReady", EU._load);
+        /////////////////////////////////////////////////////////////
+        // DOMReady
+        // based on work by: Dean Edwards/John Resig/Matthias Miller 
+
+        // Internet Explorer: use the readyState of a defered script.
+        // This isolates what appears to be a safe moment to manipulate
+        // the DOM prior to when the document's readyState suggests
+        // it is safe to do so.
+        if (EU.isIE) {
+
+            // Process onAvailable/onContentReady items when when the 
+            // DOM is ready.
+            YAHOO.util.Event.onDOMReady(
+                    YAHOO.util.Event._tryPreloadAttach,
+                    YAHOO.util.Event, true);
+
+
+            var el, d=document, b=d.body;
+
+            // If the library is being injected after window.onload, it
+            // is not safe to document.write the script tag.  Detecting
+            // this state doesn't appear possible, so we expect a flag
+            // in YAHOO_config to be set if the library is being injected.
+            if (("undefined" !== typeof YAHOO_config) && YAHOO_config.injecting) {
+
+
+                //var dr = d.readyState;
+                //if ("complete" === dr || "interactive" === dr) {
+                    //YAHOO.util.Event._ready();
+                    //YAHOO.util.Event._tryPreloadAttach();
+                //} else {
+
+                    el = document.createElement("script");
+                    var p=d.getElementsByTagName("head")[0] || b;
+                    p.insertBefore(el, p.firstChild);
+
+                //}
+
+            } else {
+    d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');
+                el=document.getElementById("_yui_eu_dr");
+            }
+            
+
+            if (el) {
+                el.onreadystatechange = function() {
+                    if ("complete" === this.readyState) {
+                        this.parentNode.removeChild(this);
+                        YAHOO.util.Event._ready();
+                    }
+                };
+            } else {
+                // The library was likely injected into the page
+                // rendering onDOMReady unreliable
+                // YAHOO.util.Event._ready();
+            }
 
-        if (document && document.body) {
-            EU._load();
+            el=null;
+
+        
+        // Safari: The document's readyState in Safari currently will
+        // change to loaded/complete before images are loaded.
+        //} else if (EU.webkit) {
+        } else if (EU.webkit) {
+
+            EU._drwatch = setInterval(function(){
+                var rs=document.readyState;
+                if ("loaded" == rs || "complete" == rs) {
+                    clearInterval(EU._drwatch);
+                    EU._drwatch = null;
+                    EU._ready();
+                }
+            }, EU.POLL_INTERVAL); 
+
+        // FireFox and Opera: These browsers provide a event for this
+        // moment.
         } else {
-            // EU._simpleAdd(document, "DOMContentLoaded", EU._load);
-            EU._simpleAdd(window, "load", EU._load);
+
+            // @todo will this fire when the library is injected?
+
+            EU._simpleAdd(document, "DOMContentLoaded", EU._ready);
+
         }
+        /////////////////////////////////////////////////////////////
+
+
+        EU._simpleAdd(window, "load", EU._load);
         EU._simpleAdd(window, "unload", EU._unload);
         EU._tryPreloadAttach();
     })();
-}
 
+}
 /**
  * EventProvider is designed to be used with YAHOO.augment to wrap 
  * CustomEvents in an interface that allows events to be subscribed to 
@@ -1615,7 +1942,6 @@ YAHOO.util.EventProvider.prototype = {
      * @method subscribe
      * @param p_type     {string}   the type, or name of the event
      * @param p_fn       {function} the function to exectute when the event fires
-     * @param p_obj
      * @param p_obj      {Object}   An object to be passed along when the event 
      *                              fires
      * @param p_override {boolean}  If true, the obj passed in becomes the 
@@ -1640,21 +1966,50 @@ YAHOO.util.EventProvider.prototype = {
     },
 
     /**
-     * Unsubscribes the from the specified event
+     * Unsubscribes one or more listeners the from the specified event
      * @method unsubscribe
-     * @param p_type {string}   The type, or name of the event
-     * @param p_fn   {Function} The function to execute
-     * @param p_obj  {Object}   The custom object passed to subscribe (optional)
+     * @param p_type {string}   The type, or name of the event.  If the type
+     *                          is not specified, it will attempt to remove
+     *                          the listener from all hosted events.
+     * @param p_fn   {Function} The subscribed function to unsubscribe, if not
+     *                          supplied, all subscribers will be removed.
+     * @param p_obj  {Object}   The custom object passed to subscribe.  This is
+     *                        optional, but if supplied will be used to
+     *                        disambiguate multiple listeners that are the same
+     *                        (e.g., you subscribe many object using a function
+     *                        that lives on the prototype)
      * @return {boolean} true if the subscriber was found and detached.
      */
     unsubscribe: function(p_type, p_fn, p_obj) {
         this.__yui_events = this.__yui_events || {};
-        var ce = this.__yui_events[p_type];
-        if (ce) {
-            return ce.unsubscribe(p_fn, p_obj);
+        var evts = this.__yui_events;
+        if (p_type) {
+            var ce = evts[p_type];
+            if (ce) {
+                return ce.unsubscribe(p_fn, p_obj);
+            }
         } else {
-            return false;
+            for (var i in evts) {
+                var ret = true;
+                if (YAHOO.lang.hasOwnProperty(evts, i)) {
+                    ret = ret && evts[i].unsubscribe(p_fn, p_obj);
+                }
+            }
+            return ret;
         }
+
+        return false;
+    },
+    
+    /**
+     * Removes all listeners from the specified event.  If the event type
+     * is not specified, all listeners from all hosted custom events will
+     * be removed.
+     * @method unsubscribeAll
+     * @param p_type {string}   The type, or name of the event
+     */
+    unsubscribeAll: function(p_type) {
+        return this.unsubscribe(p_type);
     },
 
     /**
@@ -1697,7 +2052,7 @@ YAHOO.util.EventProvider.prototype = {
         } else {
 
             var scope  = opts.scope  || this;
-            var silent = opts.silent || null;
+            var silent = (opts.silent);
 
             var ce = new YAHOO.util.CustomEvent(p_type, scope, silent,
                     YAHOO.util.CustomEvent.FLAT);
@@ -1720,6 +2075,7 @@ YAHOO.util.EventProvider.prototype = {
         return events[p_type];
     },
 
+
    /**
      * Fire a custom event by name.  The callback functions will be executed
      * from the scope specified when the event was created, and with the 
@@ -1729,27 +2085,29 @@ YAHOO.util.EventProvider.prototype = {
      *   <li>The custom object (if any) that was passed into the subscribe() 
      *       method</li>
      *   </ul>
+     * If the custom event has not been explicitly created, it will be
+     * created now with the default config, scoped to the host object
      * @method fireEvent
      * @param p_type    {string}  the type, or name of the event
      * @param arguments {Object*} an arbitrary set of parameters to pass to 
      *                            the handler.
-     * @return {boolean} the return value from CustomEvent.fire, or null if 
-     *                   the custom event does not exist.
+     * @return {boolean} the return value from CustomEvent.fire
+     *                   
      */
     fireEvent: function(p_type, arg1, arg2, etc) {
 
         this.__yui_events = this.__yui_events || {};
         var ce = this.__yui_events[p_type];
 
-        if (ce) {
-            var args = [];
-            for (var i=1; i<arguments.length; ++i) {
-                args.push(arguments[i]);
-            }
-            return ce.fire.apply(ce, args);
-        } else {
+        if (!ce) {
             return null;
         }
+
+        var args = [];
+        for (var i=1; i<arguments.length; ++i) {
+            args.push(arguments[i]);
+        }
+        return ce.fire.apply(ce, args);
     },
 
     /**
@@ -1769,3 +2127,196 @@ YAHOO.util.EventProvider.prototype = {
 
 };
 
+/**
+* KeyListener is a utility that provides an easy interface for listening for
+* keydown/keyup events fired against DOM elements.
+* @namespace YAHOO.util
+* @class KeyListener
+* @constructor
+* @param {HTMLElement} attachTo The element or element ID to which the key 
+*                               event should be attached
+* @param {String}      attachTo The element or element ID to which the key
+*                               event should be attached
+* @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).
+* @param {Function}    handler  The CustomEvent handler to fire when the 
+*                               key event is detected
+* @param {Object}      handler  An object literal representing the handler. 
+* @param {String}      event    Optional. The event (keydown or keyup) to 
+*                               listen for. Defaults automatically to keydown.
+*
+* @knownissue the "keypress" event is completely broken in Safari 2.x and below.
+*             the workaround is use "keydown" for key listening.  However, if
+*             it is desired to prevent the default behavior of the keystroke,
+*             that can only be done on the keypress event.  This makes key
+*             handling quite ugly.
+* @knownissue keydown is also broken in Safari 2.x and below for the ESC key.
+*             There currently is no workaround other than choosing another
+*             key to listen for.
+*/
+YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
+    if (!attachTo) {
+    } else if (!keyData) {
+    } else if (!handler) {
+    } 
+    
+    if (!event) {
+        event = YAHOO.util.KeyListener.KEYDOWN;
+    }
+
+    /**
+    * The CustomEvent fired internally when a key is pressed
+    * @event keyEvent
+    * @private
+    * @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).
+    */
+    var keyEvent = new YAHOO.util.CustomEvent("keyPressed");
+    
+    /**
+    * The CustomEvent fired when the KeyListener is enabled via the enable() 
+    * function
+    * @event enabledEvent
+    * @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).
+    */
+    this.enabledEvent = new YAHOO.util.CustomEvent("enabled");
+
+    /**
+    * The CustomEvent fired when the KeyListener is disabled via the 
+    * disable() function
+    * @event disabledEvent
+    * @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).
+    */
+    this.disabledEvent = new YAHOO.util.CustomEvent("disabled");
+
+    if (typeof attachTo == 'string') {
+        attachTo = document.getElementById(attachTo);
+    }
+
+    if (typeof handler == 'function') {
+        keyEvent.subscribe(handler);
+    } else {
+        keyEvent.subscribe(handler.fn, handler.scope, handler.correctScope);
+    }
+
+    /**
+    * Handles the key event when a key is pressed.
+    * @method handleKeyPress
+    * @param {DOMEvent} e   The keypress DOM event
+    * @param {Object}   obj The DOM event scope object
+    * @private
+    */
+    function handleKeyPress(e, obj) {
+        if (! keyData.shift) {  
+            keyData.shift = false; 
+        }
+        if (! keyData.alt) {    
+            keyData.alt = false;
+        }
+        if (! keyData.ctrl) {
+            keyData.ctrl = false;
+        }
+
+        // check held down modifying keys first
+        if (e.shiftKey == keyData.shift && 
+            e.altKey   == keyData.alt &&
+            e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
+            
+            var dataItem;
+            var keyPressed;
+
+            if (keyData.keys instanceof Array) {
+                for (var i=0;i<keyData.keys.length;i++) {
+                    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);
+                }
+            }
+        }
+    }
+
+    /**
+    * Enables the KeyListener by attaching the DOM event listeners to the 
+    * target DOM element
+    * @method enable
+    */
+    this.enable = function() {
+        if (! this.enabled) {
+            YAHOO.util.Event.addListener(attachTo, event, handleKeyPress);
+            this.enabledEvent.fire(keyData);
+        }
+        /**
+        * Boolean indicating the enabled/disabled state of the Tooltip
+        * @property enabled
+        * @type Boolean
+        */
+        this.enabled = true;
+    };
+
+    /**
+    * Disables the KeyListener by removing the DOM event listeners from the 
+    * target DOM element
+    * @method disable
+    */
+    this.disable = function() {
+        if (this.enabled) {
+            YAHOO.util.Event.removeListener(attachTo, event, handleKeyPress);
+            this.disabledEvent.fire(keyData);
+        }
+        this.enabled = false;
+    };
+
+    /**
+    * Returns a String representation of the object.
+    * @method toString
+    * @return {String}  The string representation of the KeyListener
+    */ 
+    this.toString = function() {
+        return "KeyListener [" + keyData.keys + "] " + attachTo.tagName + 
+                (attachTo.id ? "[" + attachTo.id + "]" : "");
+    };
+
+};
+
+/**
+* Constant representing the DOM "keydown" event.
+* @property YAHOO.util.KeyListener.KEYDOWN
+* @static
+* @final
+* @type String
+*/
+YAHOO.util.KeyListener.KEYDOWN = "keydown";
+
+/**
+* Constant representing the DOM "keyup" event.
+* @property YAHOO.util.KeyListener.KEYUP
+* @static
+* @final
+* @type String
+*/
+YAHOO.util.KeyListener.KEYUP = "keyup";
+YAHOO.register("event", YAHOO.util.Event, {version: "2.3.0", build: "442"});
index 6b3b1e8face3685fb671061ce9443a0805877b69..259b40e84a1c7f83c4c93c32956fe56d59e34380 100755 (executable)
@@ -1,5 +1,21 @@
 YUI Library - Fonts - Release Notes
 
+Version 2.3.0
+
+  * Updated %-to-px conversion charted for increased accuracy
+    across browsers
+  * Move body line-height away from * wildcard selector. Now it is
+    part of the initial BODY rule set.
+  * Changed core lineheight from 1.22em to 1.231 (no units)
+  * Changed code,pre to not use font-property shorthand syntax
+  * Tweaked the sizing fix for monospace font size (pre,code...)
+  * Added "kbd,samp,tt" as new selectors for monospaced font stuff
+  * Added line-height:99% to keep monospaced font the right height
+
+Version 2.2.0 - 2.2.2
+
+  * No changes.
+
 Version 0.10.1 - 0.12.2
 
   * No changes.
index 006544a47aba46e91db5faac5cca5ee30913897e..2ea440ffcb34bb7411f4a424b43747f187bc76fb 100755 (executable)
@@ -1 +1,7 @@
-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;}
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+body {font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:99%;}
index 72142c3d26a597d28066e9354ad43a5bb01e7bb3..ffa12ffb53506242036d4b53bb8b535ea9f611df 100755 (executable)
@@ -1,23 +1,16 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
 /**
  * Percents could work for IE, but for backCompat purposes, we are using keywords.
  * x-small is for IE6/7 quirks mode.
- * 
  */
-body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
+body {font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
 table {font-size:inherit;font:100%;}
-
 /**
- * 99% for safari; 100% is too large
+ * Bump up IE to get to 13px equivalent
  */
-select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}
-
-/**
- * Bump up !IE to get to 13px equivalent
- */
-pre, code {font:115% monospace;*font-size:100%;}
-
-/**
- * Default line-height based on font-size rather than "computed-value"
- * see: http://www.w3.org/TR/CSS21/visudet.html#line-height
- */
-body * {line-height:1.22em;}
+pre,code,kbd,samp,tt {font-family:monospace;*font-size:108%;line-height:99%;}
index 95baac4059ce57a93fe818e628cfa6bce6ed0156..c87ff787c4dc81f4445280c9f2a4b66462cb6768 100755 (executable)
@@ -1,5 +1,16 @@
 YUI Library - Grids - Release Notes
 
+Version 2.3.0
+
+  * Added more specific selectors to allow deeper nesting of both 
+    grids inside special grids, special grids within special 
+       grids, and special grids within grids.
+  * Added #doc4 which provides a 974px page width
+
+Version 2.2.0 - 2.2.2
+
+  * No changes.
+
 Version 0.12.1 - 0.12.2
 
   * No changes.
index 2a4812d058780e3a29d09101e5aa0ea14786e49d..e4aac3f34e6e6a28dfc5700cb31566d3227cce48 100755 (executable)
@@ -1 +1,7 @@
-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
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.301em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.117em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;margin-left:2%;width:32%;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{_margin-left:1.2%;*margin-left:1.7%;}.yui-g .yui-gb .yui-u{_margin-left:.8%;}.yui-gb .yui-u{margin-left:2%;width:32%;float:right;*width:31.8%;}.yui-gb div.first{margin-left:0;*margin-right:1px;float:left;}.yui-gb .yui-gb div.first{*margin-right:0;width:31.7%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-g .yui-gc div.first,.yui-g .yui-ge div.first{float:left;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-gb .yui-gc .yui-u,.yui-g .yui-gc .yui-u{_float:right;width:32%;_width:29.9%;}.yui-gb .yui-gc div.first{width:66%;*width:64.5%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:48.1%;*margin-left:0;}.yui-g .yui-g div.first{*margin:0;}.yui-gb .yui-g div.first{*margin-right:1px;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{_width:48.1%;*width:48.1%;*margin-left:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-gc div.first,.yui-gc div.first,.yui-gd .yui-g,.yui-gd .yui-u{width:66%;}.yui-gd div.first,.yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf div.first{width:24%;}.yui-ge div.first,.yui-gf .yui-g,.yui-gf .yui-u{width:74.2%;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
\ No newline at end of file
index cdd1bd6f740d40aa0e4c2b41730409e1fc45c771..358df4837597846e55b1045c0acafbda5425f3c0 100755 (executable)
@@ -1,18 +1,27 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
 /* for all templates and grids */
 body{text-align:center;}
 #ft{clear:both;}
 /**/
 /* 750 centered, and backward compatibility */ 
-#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {
+#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {
        margin:auto;text-align:left;
-       width:57.69em;*width:56.3em;min-width:750px;}
+       width:57.69em;*width:56.301em;min-width:750px;}
 /* 950 centered */ 
 #doc2 {
-       width:73.074em;*width:71.313em;min-width:950px;}
+       width:73.074em;*width:71.313em;}
 /* 100% with 10px viewport side matting */ 
 #doc3 {
        margin:auto 10px; /* not for structure, but so content doesn't bleed to edge */
        width:auto;}
+/* 974 centered */
+#doc4 {
+       width:74.923em;*width:73.117em;}
        
 /* below required for all fluid grids; adjust widths and margins above accordingly */
 
@@ -77,36 +86,120 @@ body{text-align:center;}
 }
 #yui-main .yui-b {float:none;width:auto;}
 /* GRIDS (not TEMPLATES) */
-.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-g,/*new for nesting normal grids in special grids*/
+.yui-gb .yui-gb,/*new for nesting normal grids in special grids*/
 .yui-gb .yui-u, 
+.yui-g .yui-gb .yui-u,
+.yui-gb .yui-gc,
+.yui-gb .yui-gd,
+.yui-gb .yui-ge,
+.yui-gb .yui-gf, 
 .yui-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 .yui-g,
+.yui-gd .yui-u{float:left;margin-left:2%;width:32%;}
+
+.yui-gb .yui-gb .yui-u,
+.yui-gb .yui-gc .yui-u {_margin-left:1.2%;*margin-left:1.7%;}
+.yui-g .yui-gb .yui-u {_margin-left:.8%;} /* for #8-10 for IE6 */
+.yui-gb .yui-u {margin-left:2%;width:32%;float:right;*width:31.8%;}
+.yui-gb div.first {margin-left:0;*margin-right:1px;float:left;}
+.yui-gb .yui-gb div.first {*margin-right:0;width:31.7%;} /* for #29 for IE7*/
+.yui-gb .yui-gc div.first, /* for #41 for IE7 */
+.yui-gb .yui-gd div.first  /* for #40 for IE7 */
+        {*margin-right:0;}
+
+.yui-g .yui-gc div.first,
+.yui-g .yui-ge div.first {float:left;}
+
+.yui-gb .yui-gd .yui-u {*width:66%;_width:61.2%;} 
+.yui-gb .yui-gd div.first {*width:31%;_width:29.5%;}
+
+.yui-gb .yui-gc .yui-u,
+.yui-g .yui-gc .yui-u {_float:right;width:32%;_width:29.9%;}
+.yui-gb .yui-gc div.first {width:66%;*width:64.5%;*float:left;*margin-left:0;}
+.yui-gb .yui-ge .yui-u, 
+.yui-gb .yui-gf .yui-u {margin:0;}
+
+       /*Float units (and sub grids) to the right */
+       .yui-g .yui-u,
+       .yui-g .yui-g,
+       .yui-g .yui-gb, 
+       .yui-g .yui-gc, 
+       .yui-g .yui-gd, 
+       .yui-g .yui-ge, 
+       .yui-g .yui-gf, 
+       .yui-gc .yui-u, 
+       .yui-gd .yui-g,
+       .yui-g .yui-gc .yui-u,
+       .yui-ge .yui-u, 
+       .yui-ge .yui-g, 
+       .yui-gf .yui-g,
+       .yui-gf .yui-u{float:right;display:inline;}
+       
+       /*Float units (and sub grids) to the left */
+       .yui-g div.first,
+       .yui-g div.first, 
+       .yui-gc div.first,
+       .yui-gc div.first div.first,
+       .yui-gd div.first, 
+       .yui-ge div.first, 
+       .yui-gf div.first{float:left;}
+
+.yui-g .yui-g .yui-u,
+.yui-gb .yui-g .yui-u,
+.yui-gc .yui-g .yui-u,
+.yui-gd .yui-g .yui-u,
+.yui-ge .yui-g .yui-u,
+.yui-gf .yui-g .yui-u {width:48.1%;*margin-left:0;}
+.yui-g .yui-g div.first {*margin:0;}
+.yui-gb .yui-g div.first {*margin-right:1px;}
+
+.yui-gb .yui-gb .yui-u {_margin-left:.7%;} /* for #23-32 for IE6*/
+.yui-gb .yui-g div.first, /* for #23 for IE6*/
+.yui-gb .yui-gb div.first {*margin-left:0;}
+
+.yui-gc .yui-g .yui-u,
+.yui-gd .yui-g .yui-u {_width:48.1%;*width:48.1%;*margin-left:0;}
+
+.yui-g .yui-u,
+.yui-g .yui-g,
+.yui-g .yui-gb,
+.yui-g .yui-gc,
+.yui-g .yui-gd,
+.yui-g .yui-ge,
+.yui-g .yui-gf {width:49.1%;}
+
+.yui-g .yui-gb div.first,
+       .yui-gb div.first, 
+       .yui-gc div.first, 
+       .yui-gd div.first {margin-left:0;}
+          
+.yui-g .yui-gc div.first, 
 .yui-gc div.first, 
-.yui-gd .yui-u{width:66%;}
-.yui-gd div.first{width:32%;}
-.yui-ge .yui-u{width:24%;}
+.yui-gd .yui-g, /* for 056, 057 */
+.yui-gd .yui-u {width:66%;}
+
+.yui-gd div.first,
+.yui-gb .yui-gd div.first {width:32%;}
+.yui-g .yui-gd div.first {_width:29.9%;}
+
+.yui-ge .yui-u,
+.yui-ge .yui-g,
+.yui-gf div.first {width:24%;}
+
 .yui-ge div.first, 
+.yui-gf .yui-g,
 .yui-gf .yui-u{width:74.2%;}
-.yui-gf div.first{width:24%;}
-.yui-ge div.first{width:74.2%;}
+
+/* narrower width in nexted contexts */
+.yui-gb .yui-ge .yui-u,
+.yui-gb .yui-gf div.first {*width:24%;_width:20%;}
+
+/* narrower width in nexted contexts */
+.yui-gb .yui-ge div.first, 
+.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}
+
 #bd:after,
 .yui-g:after, 
 .yui-gb:after, 
diff --git a/lib/yui/history/README b/lib/yui/history/README
new file mode 100755 (executable)
index 0000000..84a9ccc
--- /dev/null
@@ -0,0 +1,35 @@
+YUI Library - History - Release Notes
+
+2.3.0
+
+  * The Browser History Manager now works on IE if used inside an IFrame
+    (See SourceForge Bug #1729569)
+  * Added multiNavigate method, which allows changing the state of several
+    modules at once, without introducing intermediate history entries
+    (See SourceForge Bug #1713236)
+  * Do not raise an exception when re-registering a module
+    (See SourceForge Bug #1708840)
+
+2.2.1
+
+  * Use YAHOO.lang.hasOwnProperty when iterating over the _modules associative
+    array. This way, the browser history manager will play nice with the
+    libraries that add methods to the prototype of the Array object.
+  * Fixed bug related to escaping / unescaping some values.
+  * Added parameters to the register method to look like the addListener method
+    of the Event utility (you can now pass an object that becomes the scope of
+    the onStateChange handler, or is simply passed in to that handler)
+  * Upgraded code presentation to work with Crockford's latest recommendations
+    (which the latest version of JSLint online implements)
+  * Integrated David Bloom's findings to not have to use an external asset
+    (blank.html) on IE (when not going through HTTPS)
+
+2.2.0
+
+  * This is the initial release of the browser history manager.
+    This component is considered experimental.  Experimental components
+    are released for community experimentation and feedback; they
+    are not considered appropriate for implementation in mission-
+    critical applications. Please see the YUI FAQ at
+    http://developer.yahoo.com/yui/articles/faq/#experimental
+    for more information about the "experimental" designation.
\ No newline at end of file
diff --git a/lib/yui/history/assets/blank.html b/lib/yui/history/assets/blank.html
new file mode 100755 (executable)
index 0000000..c63060f
--- /dev/null
@@ -0,0 +1 @@
+<html><head><title>bhm</title></head><body>&#160;</body></html>\r
\ No newline at end of file
diff --git a/lib/yui/history/history-beta-debug.js b/lib/yui/history/history-beta-debug.js
new file mode 100755 (executable)
index 0000000..f3cf3b9
--- /dev/null
@@ -0,0 +1,768 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * The Browser History Manager provides the ability to use the
+ * back/forward navigation buttons in a DHTML application. It also allows
+ * a DHTML application to be bookmarked in a specific state.
+ *
+ * @module history
+ * @requires yahoo,event
+ * @namespace YAHOO.util
+ * @title Browser History Manager
+ * @experimental
+ */
+
+/**
+ * The History class provides the ability to use the back/forward navigation
+ * buttons in a DHTML application. It also allows a DHTML application to
+ * be bookmarked in a specific state.
+ *
+ * @class History
+ * @constructor
+ */
+YAHOO.util.History = ( function () {
+
+    /**
+     * Our hidden IFrame used to store the browsing history.
+     *
+     * @property _iframe
+     * @type HTMLIFrameElement
+     * @default null
+     * @private
+     */
+    var _iframe = null;
+
+    /**
+     * INPUT field (with type="hidden" or type="text") or TEXTAREA.
+     * This field keeps the value of the initial state, current state
+     * the list of all states across pages within a single browser session.
+     *
+     * @property _storageField
+     * @type HTMLInputElement|HTMLTextAreaElement
+     * @default null
+     * @private
+     */
+    var _storageField = null;
+
+    /**
+     * Flag used to tell whether YAHOO.util.History.initialize has been called.
+     *
+     * @property _initialized
+     * @type boolean
+     * @default false
+     * @private
+     */
+    var _initialized = false;
+
+    /**
+     * Flag used to tell whether the storage field is ready to be used.
+     *
+     * @property _storageFieldReady
+     * @type boolean
+     * @default false
+     * @private
+     */
+    var _storageFieldReady = false;
+
+    /**
+     * Flag used to tell whether the Browser History Manager is ready.
+     *
+     * @property _bhmReady
+     * @type boolean
+     * @default false
+     * @private
+     */
+    var _bhmReady = false;
+
+    /**
+     * List of registered modules.
+     *
+     * @property _modules
+     * @type array
+     * @default []
+     * @private
+     */
+    var _modules = [];
+
+    /**
+     * List of fully qualified states. This is used only by Safari.
+     *
+     * @property _fqstates
+     * @type array
+     * @default []
+     * @private
+     */
+    var _fqstates = [];
+
+    /**
+     * Trims a string.
+     *
+     * @method _trim
+     * @param {string} str The string to be trimmed.
+     * @return {string} The trimmed string
+     * @private
+     */
+    function _trim( str ) {
+        return str.replace( /^\s*(\S*(\s+\S+)*)\s*$/, "$1" );
+    }
+
+    /**
+     * location.hash is a bit buggy on Opera. I have seen instances where
+     * navigating the history using the back/forward buttons, and hence
+     * changing the URL, would not change location.hash. That's ok, the
+     * implementation of an equivalent is trivial.
+     *
+     * @method _getHash
+     * @return {string} The hash portion of the document's location
+     * @private
+     */
+    function _getHash() {
+
+        var href;
+        var i;
+
+        href = top.location.href;
+        i = href.indexOf( "#" );
+        return i >= 0 ? href.substr( i + 1 ) : null;
+    }
+
+    /**
+     * Stores all the registered modules' initial state and current state.
+     * On Safari, we also store all the fully qualified states visited by
+     * the application within a single browser session. The storage takes
+     * place in the form field specified during initialization.
+     *
+     * @method _storeStates
+     * @private
+     */
+    function _storeStates() {
+
+        var moduleName;
+        var moduleObj;
+        var initialStates = [];
+        var currentStates = [];
+
+        for ( moduleName in _modules ) {
+            if ( YAHOO.lang.hasOwnProperty( _modules, moduleName ) ) {
+                moduleObj = _modules[moduleName];
+                initialStates.push( moduleName + "=" + moduleObj.initialState );
+                currentStates.push( moduleName + "=" + moduleObj.currentState );
+            }
+        }
+
+        _storageField.value = initialStates.join( "&" ) + "|" + currentStates.join( "&" );
+
+        if ( YAHOO.env.ua.webkit ) {
+            _storageField.value += "|" + _fqstates.join( "," );
+        }
+    }
+
+    /**
+     * Sets the new currentState attribute of all modules depending on the new
+     * fully qualified state. Also notifies the modules which current state has
+     * changed.
+     *
+     * @method _handleFQStateChange
+     * @param {string} fqstate Fully qualified state
+     * @private
+     */
+    function _handleFQStateChange( fqstate ) {
+
+        var i;
+        var len;
+        var moduleName;
+        var moduleObj;
+        var modules;
+        var states;
+        var tokens;
+        var currentState;
+
+        if ( !fqstate ) {
+            // Notifies all modules
+            for ( moduleName in _modules ) {
+                if ( YAHOO.lang.hasOwnProperty( _modules, moduleName ) ) {
+                    moduleObj = _modules[moduleName];
+                    moduleObj.currentState = moduleObj.initialState;
+                    moduleObj.onStateChange( unescape( moduleObj.currentState ) );
+                }
+            }
+            return;
+        }
+
+        modules = [];
+        states = fqstate.split( "&" );
+        for ( i = 0, len = states.length ; i < len ; i++ ) {
+            tokens = states[i].split( "=" );
+            if ( tokens.length === 2 ) {
+                moduleName = tokens[0];
+                currentState = tokens[1];
+                modules[moduleName] = currentState;
+            }
+        }
+
+        for ( moduleName in _modules ) {
+            if ( YAHOO.lang.hasOwnProperty( _modules, moduleName ) ) {
+                moduleObj = _modules[moduleName];
+                currentState = modules[moduleName];
+                if ( !currentState || moduleObj.currentState !== currentState ) {
+                    moduleObj.currentState = currentState || moduleObj.initialState;
+                    moduleObj.onStateChange( unescape( moduleObj.currentState ) );
+                }
+            }
+        }
+    }
+
+    /**
+     * Periodically checks whether our internal IFrame is ready to be used.
+     *
+     * @method _checkIframeLoaded
+     * @private
+     */
+    function _checkIframeLoaded() {
+
+        var doc;
+        var elem;
+        var fqstate;
+
+        if ( !_iframe.contentWindow || !_iframe.contentWindow.document ) {
+            // Check again in 10 msec...
+            setTimeout( _checkIframeLoaded, 10 );
+            return;
+        }
+
+        // Start the thread that will have the responsibility to
+        // periodically check whether a navigate operation has been
+        // requested on the main window. This will happen when
+        // YAHOO.util.History.navigate has been called or after
+        // the user has hit the back/forward button.
+
+        doc = _iframe.contentWindow.document;
+        elem = doc.getElementById( "state" );
+        // We must use innerText, and not innerHTML because our string contains
+        // the "&" character (which would end up being escaped as "&amp;") and
+        // the string comparison would fail...
+        fqstate = elem ? elem.innerText : null;
+
+        setInterval( function () {
+
+            var newfqstate;
+            var hash;
+            var states;
+            var moduleName;
+            var moduleObj;
+
+            doc = _iframe.contentWindow.document;
+            elem = doc.getElementById( "state" );
+            // See my comment above about using innerText instead of innerHTML...
+            newfqstate = elem ? elem.innerText : null;
+
+            if ( newfqstate !== fqstate ) {
+                fqstate = newfqstate;
+                _handleFQStateChange( fqstate );
+
+                if ( !fqstate ) {
+                    states = [];
+                    for ( moduleName in _modules ) {
+                        if ( YAHOO.lang.hasOwnProperty( _modules, moduleName ) ) {
+                            moduleObj = _modules[moduleName];
+                            states.push( moduleName + "=" + moduleObj.initialState );
+                        }
+                    }
+                    hash = states.join( "&" );
+                } else {
+                    hash = fqstate;
+                }
+
+                // Allow the state to be bookmarked by setting the top window's
+                // URL fragment identifier. Note that here, we are on IE, and
+                // IE does not touch the browser history when setting the hash
+                // (unlike all the other browsers). I used to write:
+                //     top.location.replace( "#" + hash );
+                // but this had a side effect when the page was not the top frame.
+                top.location.hash = hash;
+
+                _storeStates();
+            }
+        }, 50 );
+
+        _bhmReady = true;
+
+        YAHOO.util.History.onLoadEvent.fire();
+    }
+
+    /**
+     * Finish up the initialization of the Browser History Manager.
+     *
+     * @method _initialize
+     * @private
+     */
+    function _initialize() {
+
+        var i;
+        var len;
+        var parts;
+        var tokens;
+        var moduleName;
+        var moduleObj;
+        var initialStates;
+        var initialState;
+        var currentStates;
+        var currentState;
+        var counter;
+        var hash;
+
+        _storageField = document.getElementById( "yui_hist_field" );
+
+        // Decode the content of our storage field...
+        parts = _storageField.value.split( "|" );
+
+        if ( parts.length > 1 ) {
+
+            initialStates = parts[0].split( "&" );
+            for ( i = 0, len = initialStates.length ; i < len ; i++ ) {
+                tokens = initialStates[i].split( "=" );
+                if ( tokens.length === 2 ) {
+                    moduleName = tokens[0];
+                    initialState = tokens[1];
+                    moduleObj = _modules[moduleName];
+                    if ( moduleObj ) {
+                        moduleObj.initialState = initialState;
+                    }
+                }
+            }
+
+            currentStates = parts[1].split( "&" );
+            for ( i = 0, len = currentStates.length ; i < len ; i++ ) {
+                tokens = currentStates[i].split( "=" );
+                if ( tokens.length >= 2 ) {
+                    moduleName = tokens[0];
+                    currentState = tokens[1];
+                    moduleObj = _modules[moduleName];
+                    if ( moduleObj ) {
+                        moduleObj.currentState = currentState;
+                    }
+                }
+            }
+        }
+
+        if ( parts.length > 2 ) {
+            _fqstates = parts[2].split( "," );
+        }
+
+        _storageFieldReady = true;
+
+        if ( YAHOO.env.ua.ie ) {
+
+            _iframe = document.getElementById( "yui_hist_iframe" );
+            _checkIframeLoaded();
+
+        } else {
+
+            // Start the thread that will have the responsibility to
+            // periodically check whether a navigate operation has been
+            // requested on the main window. This will happen when
+            // YAHOO.util.History.navigate has been called or after
+            // the user has hit the back/forward button.
+
+            // On Safari 1.x and 2.0, the only way to catch a back/forward
+            // operation is to watch history.length... We basically exploit
+            // what I consider to be a bug (history.length is not supposed
+            // to change when going back/forward in the history...) This is
+            // why, in the following thread, we first compare the hash,
+            // because the hash thing will be fixed in the next major
+            // version of Safari. So even if they fix the history.length
+            // bug, all this will still work!
+            counter = history.length;
+
+            // On Gecko and Opera, we just need to watch the hash...
+            hash = _getHash();
+
+            setInterval( function () {
+
+                var state;
+                var newHash;
+                var newCounter;
+
+                newHash = _getHash();
+                newCounter = history.length;
+                if ( newHash !== hash ) {
+                    hash = newHash;
+                    counter = newCounter;
+                    _handleFQStateChange( hash );
+                    _storeStates();
+                } else if ( newCounter !== counter ) {
+                    // If we ever get here, we should be on Safari...
+                    hash = newHash;
+                    counter = newCounter;
+                    state = _fqstates[counter - 1];
+                    _handleFQStateChange( state );
+                    _storeStates();
+                }
+            }, 50 );
+
+            _bhmReady = true;
+
+            YAHOO.util.History.onLoadEvent.fire();
+        }
+    }
+
+    return {
+
+        /**
+         * Fired when the Browser History Manager is ready.
+         *
+         * @event onLoadEvent
+         */
+        onLoadEvent: new YAHOO.util.CustomEvent( "onLoad" ),
+
+        /**
+         * Registers a new module.
+         *
+         * @method register
+         * @param {string} module Non-empty string uniquely identifying the
+         *     module you wish to register.
+         * @param {string} initialState The initial state of the specified
+         *     module corresponding to its earliest history entry.
+         * @param {function} onStateChange Callback called when the
+         *     state of the specified module has changed.
+         * @param {object} obj An arbitrary object that will be passed as a
+         *     parameter to the handler.
+         * @param {boolean} override If true, the obj passed in becomes the
+         *     execution scope of the listener.
+         */
+        register: function ( module, initialState, onStateChange, obj, override ) {
+
+            var scope;
+            var wrappedFn;
+
+            if ( typeof module !== "string" || _trim( module ) === "" ||
+                 typeof initialState !== "string" ||
+                 typeof onStateChange !== "function" ) {
+                throw new Error( "Missing or invalid argument passed to YAHOO.util.History.register" );
+            }
+
+            if ( _modules[module] ) {
+                // Here, we used to throw an exception. However, users have
+                // complained about this behavior, so we now just return.
+                return;
+            }
+
+            // Note: A module CANNOT be registered after calling
+            // YAHOO.util.History.initialize. Indeed, we set the initial state
+            // of each registered module in YAHOO.util.History.initialize.
+            // If you could register a module after initializing the Browser
+            // History Manager, you would not read the correct state using
+            // YAHOO.util.History.getCurrentState when coming back to the
+            // page using the back button.
+            if ( _initialized ) {
+                throw new Error( "All modules must be registered before calling YAHOO.util.History.initialize" );
+            }
+
+            // Make sure the strings passed in do not contain our separators "," and "|"
+            module = escape( module );
+            initialState = escape( initialState );
+
+            // If the user chooses to override the scope, we use the
+            // custom object passed in as the execution scope.
+            scope = null;
+            if ( override === true ) {
+                scope = obj;
+            } else {
+                scope = override;
+            }
+
+            wrappedFn = function ( state ) {
+                return onStateChange.call( scope, state, obj );
+            };
+
+            _modules[module] = {
+                name: module,
+                initialState: initialState,
+                currentState: initialState,
+                onStateChange: wrappedFn
+            };
+        },
+
+        /**
+         * Initializes the Browser History Manager. Call this method
+         * from a script block located right after the opening body tag.
+         *
+         * @method initialize
+         * @param {string} iframeTarget Optional - Path to an existing
+         *     HTML document accessible from the same domain. If not
+         *     specified, defaults to "blank.html". This is only useful
+         *     if you use https.
+         * @public
+         */
+        initialize: function ( iframeTarget ) {
+
+            // Return if the browser history manager has already been initialized
+            if ( _initialized ) {
+                return;
+            }
+
+            if ( !iframeTarget ) {
+                iframeTarget = "blank.html";
+            }
+
+            if ( typeof iframeTarget !== "string" || _trim( iframeTarget ) === "" ) {
+                throw new Error( "Invalid argument passed to YAHOO.util.History.initialize" );
+            }
+
+            document.write( '<input type="hidden" id="yui_hist_field">' );
+
+            if ( YAHOO.env.ua.ie ) {
+                if ( location.protocol === "https:" ) {
+                    // If we use https, we MUST point the IFrame to a valid
+                    // document on the same server. If we don't, we will get
+                    // a warning (do you want to display non secure items?)
+                    document.write( '<iframe id="yui_hist_iframe" src="' + iframeTarget + '" style="position:absolute;visibility:hidden;"></iframe>' );
+                } else {
+                    // This trick allows us to do without having to download
+                    // the asset, saving one HTTP request...
+                    document.write( '<iframe id="yui_hist_iframe" src="javascript:document.open();document.write(&quot;' + new Date().getTime() + '&quot;);document.close();" style="position:absolute;visibility:hidden;"></iframe>' );
+                }
+            }
+
+            // We have to wait for the window's onload handler. Otherwise, our
+            // hidden form field will always be empty (i.e. the browser won't
+            // have had enough time to restore the session)
+            YAHOO.util.Event.addListener( window, "load", _initialize );
+
+            _initialized = true;
+        },
+
+        /**
+         * Call this method when you want to store a new entry in the browser's history.
+         *
+         * @method navigate
+         * @param {string} module Non-empty string representing your module.
+         * @param {string} state String representing the new state of the specified module.
+         * @return {boolean} Indicates whether the new state was successfully added to the history.
+         * @public
+         */
+        navigate: function ( module, state ) {
+
+            var currentStates;
+            var moduleName;
+            var moduleObj;
+            var currentState;
+            var states;
+
+            if ( typeof module !== "string" || typeof state !== "string" ) {
+                throw new Error( "Missing or invalid argument passed to YAHOO.util.History.navigate" );
+            }
+
+            states = {};
+            states[module] = state;
+
+            return YAHOO.util.History.multiNavigate( states );
+        },
+
+        /**
+         * Call this method when you want to store a new entry in the browser's history.
+         *
+         * @method multiNavigate
+         * @param {object} states Associative array of module-state pairs to set simultaneously.
+         * @return {boolean} Indicates whether the new state was successfully added to the history.
+         * @public
+         */
+        multiNavigate: function ( states ) {
+
+            var currentStates;
+            var moduleName;
+            var moduleObj;
+            var currentState;
+            var fqstate;
+            var html;
+            var doc;
+
+            if ( typeof states !== "object" ) {
+                throw new Error( "Missing or invalid argument passed to YAHOO.util.History.multiNavigate" );
+            }
+
+            if ( !_bhmReady ) {
+                throw new Error( "The Browser History Manager is not initialized" );
+            }
+
+            for ( moduleName in states ) {
+                if ( !_modules[moduleName] ) {
+                    throw new Error( "The following module has not been registered: " + moduleName );
+                }
+            }
+
+            // Generate our new full state string mod1=xxx&mod2=yyy
+            currentStates = [];
+
+            for ( moduleName in _modules ) {
+                if ( YAHOO.lang.hasOwnProperty( _modules, moduleName ) ) {
+                    moduleObj = _modules[moduleName];
+                    if ( YAHOO.lang.hasOwnProperty( states, moduleName ) ) {
+                        currentState = states[moduleName];
+                    } else {
+                        currentState = moduleObj.currentState;
+                    }
+
+                    // Make sure the strings passed in do not contain our separators "," and "|"
+                    moduleName = escape( moduleName );
+                    currentState = escape( currentState );
+
+                    currentStates.push( moduleName + "=" + currentState );
+                }
+            }
+
+            fqstate = currentStates.join( "&" );
+
+            if ( YAHOO.env.ua.ie ) {
+
+                html = '<html><body><div id="state">' + fqstate + '</div></body></html>';
+                try {
+                    doc = _iframe.contentWindow.document;
+                    doc.open();
+                    doc.write( html );
+                    doc.close();
+                } catch ( e ) {
+                    return false;
+                }
+
+            } else {
+
+                // Known bug: On Safari 1.x and 2.0, if you have tab browsing
+                // enabled, Safari will show an endless loading icon in the
+                // tab. This has apparently been fixed in recent WebKit builds.
+                // One work around found by Dav Glass is to submit a form that
+                // points to the same document. This indeed works on Safari 1.x
+                // and 2.0 but creates bigger problems on WebKit. So for now,
+                // we'll consider this an acceptable bug, and hope that Apple
+                // comes out with their next version of Safari very soon.
+                top.location.hash = fqstate;
+                if ( YAHOO.env.ua.webkit ) {
+                    // The following two lines are only useful for Safari 1.x
+                    // and 2.0. Recent nightly builds of WebKit do not require
+                    // that, but unfortunately, it is not easy to differentiate
+                    // between the two. Once Safari 2.0 departs the A-grade
+                    // list, we can remove the following two lines...
+                    _fqstates[history.length] = fqstate;
+                    _storeStates();
+                }
+
+            }
+
+            return true;
+        },
+
+        /**
+         * Returns the current state of the specified module.
+         *
+         * @method getCurrentState
+         * @param {string} module Non-empty string representing your module.
+         * @return {string} The current state of the specified module.
+         * @public
+         */
+        getCurrentState: function ( module ) {
+
+            var moduleObj;
+
+            if ( typeof module !== "string" ) {
+                throw new Error( "Missing or invalid argument passed to YAHOO.util.History.getCurrentState" );
+            }
+
+            if ( !_storageFieldReady ) {
+                throw new Error( "The Browser History Manager is not initialized" );
+            }
+
+            moduleObj = _modules[module];
+            if ( !moduleObj ) {
+                throw new Error( "No such registered module: " + module );
+            }
+
+            return unescape( moduleObj.currentState );
+        },
+
+        /**
+         * Returns the state of a module according to the URL fragment
+         * identifier. This method is useful to initialize your modules
+         * if your application was bookmarked from a particular state.
+         *
+         * @method getBookmarkedState
+         * @param {string} module Non-empty string representing your module.
+         * @return {string} The bookmarked state of the specified module.
+         * @public
+         */
+        getBookmarkedState: function ( module ) {
+
+            var i;
+            var len;
+            var hash;
+            var states;
+            var tokens;
+            var moduleName;
+
+            if ( typeof module !== "string" ) {
+                throw new Error( "Missing or invalid argument passed to YAHOO.util.History.getBookmarkedState" );
+            }
+
+            hash = top.location.hash.substr(1);
+            states = hash.split( "&" );
+            for ( i = 0, len = states.length ; i < len ; i++ ) {
+                tokens = states[i].split( "=" );
+                if ( tokens.length === 2 ) {
+                    moduleName = tokens[0];
+                    if ( moduleName === module ) {
+                        return unescape( tokens[1] );
+                    }
+                }
+            }
+
+            return null;
+        },
+
+        /**
+         * Returns the value of the specified query string parameter.
+         * This method is not used internally by the Browser History Manager.
+         * However, it is provided here as a helper since many applications
+         * using the Browser History Manager will want to read the value of
+         * url parameters to initialize themselves.
+         *
+         * @method getQueryStringParameter
+         * @param {string} paramName Name of the parameter we want to look up.
+         * @param {string} queryString Optional URL to look at. If not specified,
+         *     this method uses the URL in the address bar.
+         * @return {string} The value of the specified parameter, or null.
+         * @public
+         */
+        getQueryStringParameter: function ( paramName, url ) {
+
+            var i;
+            var len;
+            var idx;
+            var queryString;
+            var params;
+            var tokens;
+
+            url = url || top.location.href;
+
+            idx = url.indexOf( "?" );
+            queryString = idx >= 0 ? url.substr( idx + 1 ) : url;
+            params = queryString.split( "&" );
+
+            for ( i = 0, len = params.length ; i < len ; i++ ) {
+                tokens = params[i].split( "=" );
+                if ( tokens.length >= 2 ) {
+                    if ( tokens[0] === paramName ) {
+                        return unescape( tokens[1] );
+                    }
+                }
+            }
+
+            return null;
+        }
+
+    };
+
+} )();
+YAHOO.register("history", YAHOO.util.History, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/history/history-beta-min.js b/lib/yui/history/history-beta-min.js
new file mode 100755 (executable)
index 0000000..46620ec
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
+YAHOO.util.History=(function(){var _iframe=null;var _storageField=null;var _initialized=false;var _storageFieldReady=false;var _bhmReady=false;var _modules=[];var _fqstates=[];function _trim(str){return str.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1");}
+function _getHash(){var href;var i;href=top.location.href;i=href.indexOf("#");return i>=0?href.substr(i+1):null;}
+function _storeStates(){var moduleName;var moduleObj;var initialStates=[];var currentStates=[];for(moduleName in _modules){if(YAHOO.lang.hasOwnProperty(_modules,moduleName)){moduleObj=_modules[moduleName];initialStates.push(moduleName+"="+moduleObj.initialState);currentStates.push(moduleName+"="+moduleObj.currentState);}}
+_storageField.value=initialStates.join("&")+"|"+currentStates.join("&");if(YAHOO.env.ua.webkit){_storageField.value+="|"+_fqstates.join(",");}}
+function _handleFQStateChange(fqstate){var i;var len;var moduleName;var moduleObj;var modules;var states;var tokens;var currentState;if(!fqstate){for(moduleName in _modules){if(YAHOO.lang.hasOwnProperty(_modules,moduleName)){moduleObj=_modules[moduleName];moduleObj.currentState=moduleObj.initialState;moduleObj.onStateChange(unescape(moduleObj.currentState));}}
+return;}
+modules=[];states=fqstate.split("&");for(i=0,len=states.length;i<len;i++){tokens=states[i].split("=");if(tokens.length===2){moduleName=tokens[0];currentState=tokens[1];modules[moduleName]=currentState;}}
+for(moduleName in _modules){if(YAHOO.lang.hasOwnProperty(_modules,moduleName)){moduleObj=_modules[moduleName];currentState=modules[moduleName];if(!currentState||moduleObj.currentState!==currentState){moduleObj.currentState=currentState||moduleObj.initialState;moduleObj.onStateChange(unescape(moduleObj.currentState));}}}}
+function _checkIframeLoaded(){var doc;var elem;var fqstate;if(!_iframe.contentWindow||!_iframe.contentWindow.document){setTimeout(_checkIframeLoaded,10);return;}
+doc=_iframe.contentWindow.document;elem=doc.getElementById("state");fqstate=elem?elem.innerText:null;setInterval(function(){var newfqstate;var hash;var states;var moduleName;var moduleObj;doc=_iframe.contentWindow.document;elem=doc.getElementById("state");newfqstate=elem?elem.innerText:null;if(newfqstate!==fqstate){fqstate=newfqstate;_handleFQStateChange(fqstate);if(!fqstate){states=[];for(moduleName in _modules){if(YAHOO.lang.hasOwnProperty(_modules,moduleName)){moduleObj=_modules[moduleName];states.push(moduleName+"="+moduleObj.initialState);}}
+hash=states.join("&");}else{hash=fqstate;}
+top.location.hash=hash;_storeStates();}},50);_bhmReady=true;YAHOO.util.History.onLoadEvent.fire();}
+function _initialize(){var i;var len;var parts;var tokens;var moduleName;var moduleObj;var initialStates;var initialState;var currentStates;var currentState;var counter;var hash;_storageField=document.getElementById("yui_hist_field");parts=_storageField.value.split("|");if(parts.length>1){initialStates=parts[0].split("&");for(i=0,len=initialStates.length;i<len;i++){tokens=initialStates[i].split("=");if(tokens.length===2){moduleName=tokens[0];initialState=tokens[1];moduleObj=_modules[moduleName];if(moduleObj){moduleObj.initialState=initialState;}}}
+currentStates=parts[1].split("&");for(i=0,len=currentStates.length;i<len;i++){tokens=currentStates[i].split("=");if(tokens.length>=2){moduleName=tokens[0];currentState=tokens[1];moduleObj=_modules[moduleName];if(moduleObj){moduleObj.currentState=currentState;}}}}
+if(parts.length>2){_fqstates=parts[2].split(",");}
+_storageFieldReady=true;if(YAHOO.env.ua.ie){_iframe=document.getElementById("yui_hist_iframe");_checkIframeLoaded();}else{counter=history.length;hash=_getHash();setInterval(function(){var state;var newHash;var newCounter;newHash=_getHash();newCounter=history.length;if(newHash!==hash){hash=newHash;counter=newCounter;_handleFQStateChange(hash);_storeStates();}else if(newCounter!==counter){hash=newHash;counter=newCounter;state=_fqstates[counter-1];_handleFQStateChange(state);_storeStates();}},50);_bhmReady=true;YAHOO.util.History.onLoadEvent.fire();}}
+return{onLoadEvent:new YAHOO.util.CustomEvent("onLoad"),register:function(module,initialState,onStateChange,obj,override){var scope;var wrappedFn;if(typeof module!=="string"||_trim(module)===""||typeof initialState!=="string"||typeof onStateChange!=="function"){throw new Error("Missing or invalid argument passed to YAHOO.util.History.register");}
+if(_modules[module]){return;}
+if(_initialized){throw new Error("All modules must be registered before calling YAHOO.util.History.initialize");}
+module=escape(module);initialState=escape(initialState);scope=null;if(override===true){scope=obj;}else{scope=override;}
+wrappedFn=function(state){return onStateChange.call(scope,state,obj);};_modules[module]={name:module,initialState:initialState,currentState:initialState,onStateChange:wrappedFn};},initialize:function(iframeTarget){if(_initialized){return;}
+if(!iframeTarget){iframeTarget="blank.html";}
+if(typeof iframeTarget!=="string"||_trim(iframeTarget)===""){throw new Error("Invalid argument passed to YAHOO.util.History.initialize");}
+document.write('<input type="hidden" id="yui_hist_field">');if(YAHOO.env.ua.ie){if(location.protocol==="https:"){document.write('<iframe id="yui_hist_iframe" src="'+iframeTarget+'" style="position:absolute;visibility:hidden;"></iframe>');}else{document.write('<iframe id="yui_hist_iframe" src="javascript:document.open();document.write(&quot;'+new Date().getTime()+'&quot;);document.close();" style="position:absolute;visibility:hidden;"></iframe>');}}
+YAHOO.util.Event.addListener(window,"load",_initialize);_initialized=true;},navigate:function(module,state){var currentStates;var moduleName;var moduleObj;var currentState;var states;if(typeof module!=="string"||typeof state!=="string"){throw new Error("Missing or invalid argument passed to YAHOO.util.History.navigate");}
+states={};states[module]=state;return YAHOO.util.History.multiNavigate(states);},multiNavigate:function(states){var currentStates;var moduleName;var moduleObj;var currentState;var fqstate;var html;var doc;if(typeof states!=="object"){throw new Error("Missing or invalid argument passed to YAHOO.util.History.multiNavigate");}
+if(!_bhmReady){throw new Error("The Browser History Manager is not initialized");}
+for(moduleName in states){if(!_modules[moduleName]){throw new Error("The following module has not been registered: "+moduleName);}}
+currentStates=[];for(moduleName in _modules){if(YAHOO.lang.hasOwnProperty(_modules,moduleName)){moduleObj=_modules[moduleName];if(YAHOO.lang.hasOwnProperty(states,moduleName)){currentState=states[moduleName];}else{currentState=moduleObj.currentState;}
+moduleName=escape(moduleName);currentState=escape(currentState);currentStates.push(moduleName+"="+currentState);}}
+fqstate=currentStates.join("&");if(YAHOO.env.ua.ie){html='<html><body><div id="state">'+fqstate+'</div></body></html>';try{doc=_iframe.contentWindow.document;doc.open();doc.write(html);doc.close();}catch(e){return false;}}else{top.location.hash=fqstate;if(YAHOO.env.ua.webkit){_fqstates[history.length]=fqstate;_storeStates();}}
+return true;},getCurrentState:function(module){var moduleObj;if(typeof module!=="string"){throw new Error("Missing or invalid argument passed to YAHOO.util.History.getCurrentState");}
+if(!_storageFieldReady){throw new Error("The Browser History Manager is not initialized");}
+moduleObj=_modules[module];if(!moduleObj){throw new Error("No such registered module: "+module);}
+return unescape(moduleObj.currentState);},getBookmarkedState:function(module){var i;var len;var hash;var states;var tokens;var moduleName;if(typeof module!=="string"){throw new Error("Missing or invalid argument passed to YAHOO.util.History.getBookmarkedState");}
+hash=top.location.hash.substr(1);states=hash.split("&");for(i=0,len=states.length;i<len;i++){tokens=states[i].split("=");if(tokens.length===2){moduleName=tokens[0];if(moduleName===module){return unescape(tokens[1]);}}}
+return null;},getQueryStringParameter:function(paramName,url){var i;var len;var idx;var queryString;var params;var tokens;url=url||top.location.href;idx=url.indexOf("?");queryString=idx>=0?url.substr(idx+1):url;params=queryString.split("&");for(i=0,len=params.length;i<len;i++){tokens=params[i].split("=");if(tokens.length>=2){if(tokens[0]===paramName){return unescape(tokens[1]);}}}
+return null;}};})();YAHOO.register("history",YAHOO.util.History,{version:"2.3.0",build:"442"});
\ No newline at end of file
diff --git a/lib/yui/history/history-beta.js b/lib/yui/history/history-beta.js
new file mode 100755 (executable)
index 0000000..f3cf3b9
--- /dev/null
@@ -0,0 +1,768 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * The Browser History Manager provides the ability to use the
+ * back/forward navigation buttons in a DHTML application. It also allows
+ * a DHTML application to be bookmarked in a specific state.
+ *
+ * @module history
+ * @requires yahoo,event
+ * @namespace YAHOO.util
+ * @title Browser History Manager
+ * @experimental
+ */
+
+/**
+ * The History class provides the ability to use the back/forward navigation
+ * buttons in a DHTML application. It also allows a DHTML application to
+ * be bookmarked in a specific state.
+ *
+ * @class History
+ * @constructor
+ */
+YAHOO.util.History = ( function () {
+
+    /**
+     * Our hidden IFrame used to store the browsing history.
+     *
+     * @property _iframe
+     * @type HTMLIFrameElement
+     * @default null
+     * @private
+     */
+    var _iframe = null;
+
+    /**
+     * INPUT field (with type="hidden" or type="text") or TEXTAREA.
+     * This field keeps the value of the initial state, current state
+     * the list of all states across pages within a single browser session.
+     *
+     * @property _storageField
+     * @type HTMLInputElement|HTMLTextAreaElement
+     * @default null
+     * @private
+     */
+    var _storageField = null;
+
+    /**
+     * Flag used to tell whether YAHOO.util.History.initialize has been called.
+     *
+     * @property _initialized
+     * @type boolean
+     * @default false
+     * @private
+     */
+    var _initialized = false;
+
+    /**
+     * Flag used to tell whether the storage field is ready to be used.
+     *
+     * @property _storageFieldReady
+     * @type boolean
+     * @default false
+     * @private
+     */
+    var _storageFieldReady = false;
+
+    /**
+     * Flag used to tell whether the Browser History Manager is ready.
+     *
+     * @property _bhmReady
+     * @type boolean
+     * @default false
+     * @private
+     */
+    var _bhmReady = false;
+
+    /**
+     * List of registered modules.
+     *
+     * @property _modules
+     * @type array
+     * @default []
+     * @private
+     */
+    var _modules = [];
+
+    /**
+     * List of fully qualified states. This is used only by Safari.
+     *
+     * @property _fqstates
+     * @type array
+     * @default []
+     * @private
+     */
+    var _fqstates = [];
+
+    /**
+     * Trims a string.
+     *
+     * @method _trim
+     * @param {string} str The string to be trimmed.
+     * @return {string} The trimmed string
+     * @private
+     */
+    function _trim( str ) {
+        return str.replace( /^\s*(\S*(\s+\S+)*)\s*$/, "$1" );
+    }
+
+    /**
+     * location.hash is a bit buggy on Opera. I have seen instances where
+     * navigating the history using the back/forward buttons, and hence
+     * changing the URL, would not change location.hash. That's ok, the
+     * implementation of an equivalent is trivial.
+     *
+     * @method _getHash
+     * @return {string} The hash portion of the document's location
+     * @private
+     */
+    function _getHash() {
+
+        var href;
+        var i;
+
+        href = top.location.href;
+        i = href.indexOf( "#" );
+        return i >= 0 ? href.substr( i + 1 ) : null;
+    }
+
+    /**
+     * Stores all the registered modules' initial state and current state.
+     * On Safari, we also store all the fully qualified states visited by
+     * the application within a single browser session. The storage takes
+     * place in the form field specified during initialization.
+     *
+     * @method _storeStates
+     * @private
+     */
+    function _storeStates() {
+
+        var moduleName;
+        var moduleObj;
+        var initialStates = [];
+        var currentStates = [];
+
+        for ( moduleName in _modules ) {
+            if ( YAHOO.lang.hasOwnProperty( _modules, moduleName ) ) {
+                moduleObj = _modules[moduleName];
+                initialStates.push( moduleName + "=" + moduleObj.initialState );
+                currentStates.push( moduleName + "=" + moduleObj.currentState );
+            }
+        }
+
+        _storageField.value = initialStates.join( "&" ) + "|" + currentStates.join( "&" );
+
+        if ( YAHOO.env.ua.webkit ) {
+            _storageField.value += "|" + _fqstates.join( "," );
+        }
+    }
+
+    /**
+     * Sets the new currentState attribute of all modules depending on the new
+     * fully qualified state. Also notifies the modules which current state has
+     * changed.
+     *
+     * @method _handleFQStateChange
+     * @param {string} fqstate Fully qualified state
+     * @private
+     */
+    function _handleFQStateChange( fqstate ) {
+
+        var i;
+        var len;
+        var moduleName;
+        var moduleObj;
+        var modules;
+        var states;
+        var tokens;
+        var currentState;
+
+        if ( !fqstate ) {
+            // Notifies all modules
+            for ( moduleName in _modules ) {
+                if ( YAHOO.lang.hasOwnProperty( _modules, moduleName ) ) {
+                    moduleObj = _modules[moduleName];
+                    moduleObj.currentState = moduleObj.initialState;
+                    moduleObj.onStateChange( unescape( moduleObj.currentState ) );
+                }
+            }
+            return;
+        }
+
+        modules = [];
+        states = fqstate.split( "&" );
+        for ( i = 0, len = states.length ; i < len ; i++ ) {
+            tokens = states[i].split( "=" );
+            if ( tokens.length === 2 ) {
+                moduleName = tokens[0];
+                currentState = tokens[1];
+                modules[moduleName] = currentState;
+            }
+        }
+
+        for ( moduleName in _modules ) {
+            if ( YAHOO.lang.hasOwnProperty( _modules, moduleName ) ) {
+                moduleObj = _modules[moduleName];
+                currentState = modules[moduleName];
+                if ( !currentState || moduleObj.currentState !== currentState ) {
+                    moduleObj.currentState = currentState || moduleObj.initialState;
+                    moduleObj.onStateChange( unescape( moduleObj.currentState ) );
+                }
+            }
+        }
+    }
+
+    /**
+     * Periodically checks whether our internal IFrame is ready to be used.
+     *
+     * @method _checkIframeLoaded
+     * @private
+     */
+    function _checkIframeLoaded() {
+
+        var doc;
+        var elem;
+        var fqstate;
+
+        if ( !_iframe.contentWindow || !_iframe.contentWindow.document ) {
+            // Check again in 10 msec...
+            setTimeout( _checkIframeLoaded, 10 );
+            return;
+        }
+
+        // Start the thread that will have the responsibility to
+        // periodically check whether a navigate operation has been
+        // requested on the main window. This will happen when
+        // YAHOO.util.History.navigate has been called or after
+        // the user has hit the back/forward button.
+
+        doc = _iframe.contentWindow.document;
+        elem = doc.getElementById( "state" );
+        // We must use innerText, and not innerHTML because our string contains
+        // the "&" character (which would end up being escaped as "&amp;") and
+        // the string comparison would fail...
+        fqstate = elem ? elem.innerText : null;
+
+        setInterval( function () {
+
+            var newfqstate;
+            var hash;
+            var states;
+            var moduleName;
+            var moduleObj;
+
+            doc = _iframe.contentWindow.document;
+            elem = doc.getElementById( "state" );
+            // See my comment above about using innerText instead of innerHTML...
+            newfqstate = elem ? elem.innerText : null;
+
+            if ( newfqstate !== fqstate ) {
+                fqstate = newfqstate;
+                _handleFQStateChange( fqstate );
+
+                if ( !fqstate ) {
+                    states = [];
+                    for ( moduleName in _modules ) {
+                        if ( YAHOO.lang.hasOwnProperty( _modules, moduleName ) ) {
+                            moduleObj = _modules[moduleName];
+                            states.push( moduleName + "=" + moduleObj.initialState );
+                        }
+                    }
+                    hash = states.join( "&" );
+                } else {
+                    hash = fqstate;
+                }
+
+                // Allow the state to be bookmarked by setting the top window's
+                // URL fragment identifier. Note that here, we are on IE, and
+                // IE does not touch the browser history when setting the hash
+                // (unlike all the other browsers). I used to write:
+                //     top.location.replace( "#" + hash );
+                // but this had a side effect when the page was not the top frame.
+                top.location.hash = hash;
+
+                _storeStates();
+            }
+        }, 50 );
+
+        _bhmReady = true;
+
+        YAHOO.util.History.onLoadEvent.fire();
+    }
+
+    /**
+     * Finish up the initialization of the Browser History Manager.
+     *
+     * @method _initialize
+     * @private
+     */
+    function _initialize() {
+
+        var i;
+        var len;
+        var parts;
+        var tokens;
+        var moduleName;
+        var moduleObj;
+        var initialStates;
+        var initialState;
+        var currentStates;
+        var currentState;
+        var counter;
+        var hash;
+
+        _storageField = document.getElementById( "yui_hist_field" );
+
+        // Decode the content of our storage field...
+        parts = _storageField.value.split( "|" );
+
+        if ( parts.length > 1 ) {
+
+            initialStates = parts[0].split( "&" );
+            for ( i = 0, len = initialStates.length ; i < len ; i++ ) {
+                tokens = initialStates[i].split( "=" );
+                if ( tokens.length === 2 ) {
+                    moduleName = tokens[0];
+                    initialState = tokens[1];
+                    moduleObj = _modules[moduleName];
+                    if ( moduleObj ) {
+                        moduleObj.initialState = initialState;
+                    }
+                }
+            }
+
+            currentStates = parts[1].split( "&" );
+            for ( i = 0, len = currentStates.length ; i < len ; i++ ) {
+                tokens = currentStates[i].split( "=" );
+                if ( tokens.length >= 2 ) {
+                    moduleName = tokens[0];
+                    currentState = tokens[1];
+                    moduleObj = _modules[moduleName];
+                    if ( moduleObj ) {
+                        moduleObj.currentState = currentState;
+                    }
+                }
+            }
+        }
+
+        if ( parts.length > 2 ) {
+            _fqstates = parts[2].split( "," );
+        }
+
+        _storageFieldReady = true;
+
+        if ( YAHOO.env.ua.ie ) {
+
+            _iframe = document.getElementById( "yui_hist_iframe" );
+            _checkIframeLoaded();
+
+        } else {
+
+            // Start the thread that will have the responsibility to
+            // periodically check whether a navigate operation has been
+            // requested on the main window. This will happen when
+            // YAHOO.util.History.navigate has been called or after
+            // the user has hit the back/forward button.
+
+            // On Safari 1.x and 2.0, the only way to catch a back/forward
+            // operation is to watch history.length... We basically exploit
+            // what I consider to be a bug (history.length is not supposed
+            // to change when going back/forward in the history...) This is
+            // why, in the following thread, we first compare the hash,
+            // because the hash thing will be fixed in the next major
+            // version of Safari. So even if they fix the history.length
+            // bug, all this will still work!
+            counter = history.length;
+
+            // On Gecko and Opera, we just need to watch the hash...
+            hash = _getHash();
+
+            setInterval( function () {
+
+                var state;
+                var newHash;
+                var newCounter;
+
+                newHash = _getHash();
+                newCounter = history.length;
+                if ( newHash !== hash ) {
+                    hash = newHash;
+                    counter = newCounter;
+                    _handleFQStateChange( hash );
+                    _storeStates();
+                } else if ( newCounter !== counter ) {
+                    // If we ever get here, we should be on Safari...
+                    hash = newHash;
+                    counter = newCounter;
+                    state = _fqstates[counter - 1];
+                    _handleFQStateChange( state );
+                    _storeStates();
+                }
+            }, 50 );
+
+            _bhmReady = true;
+
+            YAHOO.util.History.onLoadEvent.fire();
+        }
+    }
+
+    return {
+
+        /**
+         * Fired when the Browser History Manager is ready.
+         *
+         * @event onLoadEvent
+         */
+        onLoadEvent: new YAHOO.util.CustomEvent( "onLoad" ),
+
+        /**
+         * Registers a new module.
+         *
+         * @method register
+         * @param {string} module Non-empty string uniquely identifying the
+         *     module you wish to register.
+         * @param {string} initialState The initial state of the specified
+         *     module corresponding to its earliest history entry.
+         * @param {function} onStateChange Callback called when the
+         *     state of the specified module has changed.
+         * @param {object} obj An arbitrary object that will be passed as a
+         *     parameter to the handler.
+         * @param {boolean} override If true, the obj passed in becomes the
+         *     execution scope of the listener.
+         */
+        register: function ( module, initialState, onStateChange, obj, override ) {
+
+            var scope;
+            var wrappedFn;
+
+            if ( typeof module !== "string" || _trim( module ) === "" ||
+                 typeof initialState !== "string" ||
+                 typeof onStateChange !== "function" ) {
+                throw new Error( "Missing or invalid argument passed to YAHOO.util.History.register" );
+            }
+
+            if ( _modules[module] ) {
+                // Here, we used to throw an exception. However, users have
+                // complained about this behavior, so we now just return.
+                return;
+            }
+
+            // Note: A module CANNOT be registered after calling
+            // YAHOO.util.History.initialize. Indeed, we set the initial state
+            // of each registered module in YAHOO.util.History.initialize.
+            // If you could register a module after initializing the Browser
+            // History Manager, you would not read the correct state using
+            // YAHOO.util.History.getCurrentState when coming back to the
+            // page using the back button.
+            if ( _initialized ) {
+                throw new Error( "All modules must be registered before calling YAHOO.util.History.initialize" );
+            }
+
+            // Make sure the strings passed in do not contain our separators "," and "|"
+            module = escape( module );
+            initialState = escape( initialState );
+
+            // If the user chooses to override the scope, we use the
+            // custom object passed in as the execution scope.
+            scope = null;
+            if ( override === true ) {
+                scope = obj;
+            } else {
+                scope = override;
+            }
+
+            wrappedFn = function ( state ) {
+                return onStateChange.call( scope, state, obj );
+            };
+
+            _modules[module] = {
+                name: module,
+                initialState: initialState,
+                currentState: initialState,
+                onStateChange: wrappedFn
+            };
+        },
+
+        /**
+         * Initializes the Browser History Manager. Call this method
+         * from a script block located right after the opening body tag.
+         *
+         * @method initialize
+         * @param {string} iframeTarget Optional - Path to an existing
+         *     HTML document accessible from the same domain. If not
+         *     specified, defaults to "blank.html". This is only useful
+         *     if you use https.
+         * @public
+         */
+        initialize: function ( iframeTarget ) {
+
+            // Return if the browser history manager has already been initialized
+            if ( _initialized ) {
+                return;
+            }
+
+            if ( !iframeTarget ) {
+                iframeTarget = "blank.html";
+            }
+
+            if ( typeof iframeTarget !== "string" || _trim( iframeTarget ) === "" ) {
+                throw new Error( "Invalid argument passed to YAHOO.util.History.initialize" );
+            }
+
+            document.write( '<input type="hidden" id="yui_hist_field">' );
+
+            if ( YAHOO.env.ua.ie ) {
+                if ( location.protocol === "https:" ) {
+                    // If we use https, we MUST point the IFrame to a valid
+                    // document on the same server. If we don't, we will get
+                    // a warning (do you want to display non secure items?)
+                    document.write( '<iframe id="yui_hist_iframe" src="' + iframeTarget + '" style="position:absolute;visibility:hidden;"></iframe>' );
+                } else {
+                    // This trick allows us to do without having to download
+                    // the asset, saving one HTTP request...
+                    document.write( '<iframe id="yui_hist_iframe" src="javascript:document.open();document.write(&quot;' + new Date().getTime() + '&quot;);document.close();" style="position:absolute;visibility:hidden;"></iframe>' );
+                }
+            }
+
+            // We have to wait for the window's onload handler. Otherwise, our
+            // hidden form field will always be empty (i.e. the browser won't
+            // have had enough time to restore the session)
+            YAHOO.util.Event.addListener( window, "load", _initialize );
+
+            _initialized = true;
+        },
+
+        /**
+         * Call this method when you want to store a new entry in the browser's history.
+         *
+         * @method navigate
+         * @param {string} module Non-empty string representing your module.
+         * @param {string} state String representing the new state of the specified module.
+         * @return {boolean} Indicates whether the new state was successfully added to the history.
+         * @public
+         */
+        navigate: function ( module, state ) {
+
+            var currentStates;
+            var moduleName;
+            var moduleObj;
+            var currentState;
+            var states;
+
+            if ( typeof module !== "string" || typeof state !== "string" ) {
+                throw new Error( "Missing or invalid argument passed to YAHOO.util.History.navigate" );
+            }
+
+            states = {};
+            states[module] = state;
+
+            return YAHOO.util.History.multiNavigate( states );
+        },
+
+        /**
+         * Call this method when you want to store a new entry in the browser's history.
+         *
+         * @method multiNavigate
+         * @param {object} states Associative array of module-state pairs to set simultaneously.
+         * @return {boolean} Indicates whether the new state was successfully added to the history.
+         * @public
+         */
+        multiNavigate: function ( states ) {
+
+            var currentStates;
+            var moduleName;
+            var moduleObj;
+            var currentState;
+            var fqstate;
+            var html;
+            var doc;
+
+            if ( typeof states !== "object" ) {
+                throw new Error( "Missing or invalid argument passed to YAHOO.util.History.multiNavigate" );
+            }
+
+            if ( !_bhmReady ) {
+                throw new Error( "The Browser History Manager is not initialized" );
+            }
+
+            for ( moduleName in states ) {
+                if ( !_modules[moduleName] ) {
+                    throw new Error( "The following module has not been registered: " + moduleName );
+                }
+            }
+
+            // Generate our new full state string mod1=xxx&mod2=yyy
+            currentStates = [];
+
+            for ( moduleName in _modules ) {
+                if ( YAHOO.lang.hasOwnProperty( _modules, moduleName ) ) {
+                    moduleObj = _modules[moduleName];
+                    if ( YAHOO.lang.hasOwnProperty( states, moduleName ) ) {
+                        currentState = states[moduleName];
+                    } else {
+                        currentState = moduleObj.currentState;
+                    }
+
+                    // Make sure the strings passed in do not contain our separators "," and "|"
+                    moduleName = escape( moduleName );
+                    currentState = escape( currentState );
+
+                    currentStates.push( moduleName + "=" + currentState );
+                }
+            }
+
+            fqstate = currentStates.join( "&" );
+
+            if ( YAHOO.env.ua.ie ) {
+
+                html = '<html><body><div id="state">' + fqstate + '</div></body></html>';
+                try {
+                    doc = _iframe.contentWindow.document;
+                    doc.open();
+                    doc.write( html );
+                    doc.close();
+                } catch ( e ) {
+                    return false;
+                }
+
+            } else {
+
+                // Known bug: On Safari 1.x and 2.0, if you have tab browsing
+                // enabled, Safari will show an endless loading icon in the
+                // tab. This has apparently been fixed in recent WebKit builds.
+                // One work around found by Dav Glass is to submit a form that
+                // points to the same document. This indeed works on Safari 1.x
+                // and 2.0 but creates bigger problems on WebKit. So for now,
+                // we'll consider this an acceptable bug, and hope that Apple
+                // comes out with their next version of Safari very soon.
+                top.location.hash = fqstate;
+                if ( YAHOO.env.ua.webkit ) {
+                    // The following two lines are only useful for Safari 1.x
+                    // and 2.0. Recent nightly builds of WebKit do not require
+                    // that, but unfortunately, it is not easy to differentiate
+                    // between the two. Once Safari 2.0 departs the A-grade
+                    // list, we can remove the following two lines...
+                    _fqstates[history.length] = fqstate;
+                    _storeStates();
+                }
+
+            }
+
+            return true;
+        },
+
+        /**
+         * Returns the current state of the specified module.
+         *
+         * @method getCurrentState
+         * @param {string} module Non-empty string representing your module.
+         * @return {string} The current state of the specified module.
+         * @public
+         */
+        getCurrentState: function ( module ) {
+
+            var moduleObj;
+
+            if ( typeof module !== "string" ) {
+                throw new Error( "Missing or invalid argument passed to YAHOO.util.History.getCurrentState" );
+            }
+
+            if ( !_storageFieldReady ) {
+                throw new Error( "The Browser History Manager is not initialized" );
+            }
+
+            moduleObj = _modules[module];
+            if ( !moduleObj ) {
+                throw new Error( "No such registered module: " + module );
+            }
+
+            return unescape( moduleObj.currentState );
+        },
+
+        /**
+         * Returns the state of a module according to the URL fragment
+         * identifier. This method is useful to initialize your modules
+         * if your application was bookmarked from a particular state.
+         *
+         * @method getBookmarkedState
+         * @param {string} module Non-empty string representing your module.
+         * @return {string} The bookmarked state of the specified module.
+         * @public
+         */
+        getBookmarkedState: function ( module ) {
+
+            var i;
+            var len;
+            var hash;
+            var states;
+            var tokens;
+            var moduleName;
+
+            if ( typeof module !== "string" ) {
+                throw new Error( "Missing or invalid argument passed to YAHOO.util.History.getBookmarkedState" );
+            }
+
+            hash = top.location.hash.substr(1);
+            states = hash.split( "&" );
+            for ( i = 0, len = states.length ; i < len ; i++ ) {
+                tokens = states[i].split( "=" );
+                if ( tokens.length === 2 ) {
+                    moduleName = tokens[0];
+                    if ( moduleName === module ) {
+                        return unescape( tokens[1] );
+                    }
+                }
+            }
+
+            return null;
+        },
+
+        /**
+         * Returns the value of the specified query string parameter.
+         * This method is not used internally by the Browser History Manager.
+         * However, it is provided here as a helper since many applications
+         * using the Browser History Manager will want to read the value of
+         * url parameters to initialize themselves.
+         *
+         * @method getQueryStringParameter
+         * @param {string} paramName Name of the parameter we want to look up.
+         * @param {string} queryString Optional URL to look at. If not specified,
+         *     this method uses the URL in the address bar.
+         * @return {string} The value of the specified parameter, or null.
+         * @public
+         */
+        getQueryStringParameter: function ( paramName, url ) {
+
+            var i;
+            var len;
+            var idx;
+            var queryString;
+            var params;
+            var tokens;
+
+            url = url || top.location.href;
+
+            idx = url.indexOf( "?" );
+            queryString = idx >= 0 ? url.substr( idx + 1 ) : url;
+            params = queryString.split( "&" );
+
+            for ( i = 0, len = params.length ; i < len ; i++ ) {
+                tokens = params[i].split( "=" );
+                if ( tokens.length >= 2 ) {
+                    if ( tokens[0] === paramName ) {
+                        return unescape( tokens[1] );
+                    }
+                }
+            }
+
+            return null;
+        }
+
+    };
+
+} )();
+YAHOO.register("history", YAHOO.util.History, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/imageloader/README b/lib/yui/imageloader/README
new file mode 100755 (executable)
index 0000000..b1d5eb8
--- /dev/null
@@ -0,0 +1,4 @@
+ImageLoader - Release Notes
+
+2.3.0
+   * Initial release
diff --git a/lib/yui/imageloader/imageloader-experimental-debug.js b/lib/yui/imageloader/imageloader-experimental-debug.js
new file mode 100755 (executable)
index 0000000..55b85c5
--- /dev/null
@@ -0,0 +1,442 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * The image loader is a framework to dynamically load images
+ * according to certain triggers, enabling faster load times
+ * and a more responsive UI.
+ *
+ * @module imageloader
+ * @namespace YAHOO.util
+ * @experimental
+ */
+
+if (typeof(YAHOO.util.ImageLoader) == 'undefined') {
+       YAHOO.util.ImageLoader = {};
+}
+
+/**
+ * A group for images. A group can have one time limit and a series of triggers. Thus the images belonging to this group must share these constraints.
+ * @class YAHOO.util.ImageLoader.group
+ * @requires YAHOO.util.Dom
+ * @requires YAHOO.util.Event
+ * @constructor
+ * @param {String|HTMLElement} trigEl  The HTML element id or reference to assign the trigger event to. Can be null for no trigger
+ * @param {String}     trigAct The type of event to assign to trigEl. Can be null for no trigger
+ * @param {Number}     timeout Timeout (time limit) length, in seconds. Can be undefined, or <= 0, for no time limit
+ */
+YAHOO.util.ImageLoader.group = function(trigEl, trigAct, timeout) {
+       /**
+        * Name for the group. Only used to identify the group in logging statements
+        * @property name
+        * @type String
+        */
+       this.name = 'unnamed';
+       
+       /**
+        * Collection of images registered with this group
+        * @property _imgObjs
+        * @private
+        * @type Object
+        */
+       this._imgObjs = {};
+       
+       /**
+        * Timeout (time limit) length, in seconds
+        * @property timeoutLen
+        * @type Number
+        */
+       this.timeoutLen = timeout;
+       
+       /**
+        * Timeout object to keep a handle on the time limit
+        * @property _timeout
+        * @private
+        * @type Object
+        */
+       this._timeout = null;
+       
+       /**
+        * Collection of triggers for this group.
+        * Keeps track of each trigger's element, event, and event-listener-callback "fetch" function
+        * @property _triggers
+        * @private
+        * @type Array
+        */
+       this._triggers = [];
+
+       /**
+        * Flag to check if images are above the fold. If foldConditional is true, the group will check each of its image locations at page load. If any part of the image is within the client viewport, the image is displayed immediately
+        * @property foldConditional
+        * @type Boolean
+        */
+       this.foldConditional = false;
+
+       /**
+        * Class name that will identify images belonging to the group. This class name will be removed from each element in order to fetch images.
+        * This class should have, in its CSS style definition, "background:none !important;"
+        * @property className
+        * @type String
+        */
+       this.className = null;
+
+       /**
+        * HTML elements having the class name that is associated with this group
+        * Elements are stored during the _foldCheck function and reused later during the fetch function. Gives a slight performance improvement when className and foldConditional are both used
+        * @property _classImageEls
+        * @private
+        * @type Array
+        */
+       this._classImageEls = null;
+
+       // add a listener to set the time limit in the onload
+       YAHOO.util.Event.addListener(window, 'load', this._onloadTasks, this, true);
+       // add the trigger
+       this.addTrigger(trigEl, trigAct);
+
+};
+
+/**
+ * Adds a trigger to the group. Call this with the same style as YAHOO.util.Event.addListener
+ * @method addTrigger
+ * @param {String|HTMLElement} trigEl  The HTML element id or reference to assign the trigger event to
+ * @param {String} trigAct The type of event to assign to trigEl
+ */
+YAHOO.util.ImageLoader.group.prototype.addTrigger = function(trigEl, trigAct) {
+       if (! trigEl || ! trigAct) {
+               return;
+       }
+       /* Need to wrap the fetch function. Event Util can't distinguish prototyped functions of different instantiations
+        *   Leads to this scenario: groupA and groupZ both have window-scroll triggers. groupZ also has a 2-sec timeout (groupA has no timeout).
+        *   groupZ's timeout fires; we remove the triggers. The removeListener call finds the first window-scroll event with Y.u.IL.p.fetch, which is groupA's. 
+        *   groupA's trigger is removed and never fires, leaving images unfetched
+        */
+       var wrappedFetch = function() {
+               this.fetch();
+       };
+       this._triggers.push([trigEl, trigAct, wrappedFetch]);
+       YAHOO.util.Event.addListener(trigEl, trigAct, wrappedFetch, this, true);
+};
+
+/**
+ * Setup to do in the window's onload
+ * Initiates time limit for group; executes the fold check for the images
+ * @method _onloadTasks
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._onloadTasks = function() {
+       if (this.timeoutLen && typeof(this.timeoutLen) == 'number' && this.timeoutLen > 0) {
+               this._timeout = setTimeout(this._getFetchTimeout(), this.timeoutLen * 1000);
+       }
+
+       if (this.foldConditional) {
+               this._foldCheck();
+       }
+};
+
+/**
+ * Returns the group's fetch method, with the proper closure, for use with setTimeout
+ * @method _getFetchTimeout
+ * @return {Function}  group's fetch method
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._getFetchTimeout = function() {
+       var self = this;
+       return function() { self.fetch(); };
+};
+
+/**
+ * Registers a background image with the group
+ * @method registerBgImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @return {Object}    bgImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerBgImage = function(domId, url) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.bgImgObj(domId, url);
+       return this._imgObjs[domId];
+};
+/**
+ * Registers a src image with the group
+ * @method registerSrcImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Int}        width   pixel width of the image - defaults to image's natural size
+ * @param {Int}        height  pixel height of the image - defaults to image's natural size
+ * @return {Object}    srcImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerSrcImage = function(domId, url, width, height) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.srcImgObj(domId, url, width, height);
+       return this._imgObjs[domId];
+};
+/**
+ * Registers an alpha-channel-type png background image with the group
+ * @method registerPngBgImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @return {Object}    pngBgImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerPngBgImage = function(domId, url) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.pngBgImgObj(domId, url);
+       return this._imgObjs[domId];
+};
+
+/**
+ * Displays the images in the group
+ * @method fetch
+ */
+YAHOO.util.ImageLoader.group.prototype.fetch = function() {
+       YAHOO.log('Fetching images in group: "' + this.name + '".', 'info', 'imageloader');
+
+       clearTimeout(this._timeout);
+       // remove all listeners
+       for (var i=0; i < this._triggers.length; i++) {
+               YAHOO.util.Event.removeListener(this._triggers[i][0], this._triggers[i][1], this._triggers[i][2]);
+       }
+
+       // fetch whatever we need to by className
+       this._fetchByClass();
+
+       // fetch registered images
+       for (var id in this._imgObjs) {
+               if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) {
+                       this._imgObjs[id].fetch();
+               }
+       }
+};
+
+/**
+ * Checks the position of each image in the group. If any part of the image is within the client viewport, shows the image immediately.
+ * @method _foldCheck
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._foldCheck = function() {
+       YAHOO.log('Checking for images above the fold in group: "' + this.name + '"', 'info', 'imageloader');
+       var scrollTop = (document.compatMode != 'CSS1Compat') ? document.body.scrollTop : document.documentElement.scrollTop;
+       var viewHeight = YAHOO.util.Dom.getViewportHeight();
+       var hLimit = scrollTop + viewHeight;
+       var scrollLeft = (document.compatMode != 'CSS1Compat') ? document.body.scrollLeft : document.documentElement.scrollLeft;
+       var viewWidth = YAHOO.util.Dom.getViewportWidth();
+       var wLimit = scrollLeft + viewWidth;
+       for (var id in this._imgObjs) {
+               if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) {
+                       var elPos = YAHOO.util.Dom.getXY(this._imgObjs[id].domId);
+                       if (elPos[1] < hLimit && elPos[0] < wLimit) {
+                               YAHOO.log('Image with id "' + this._imgObjs[id].domId + '" is above the fold. Fetching image.', 'info', 'imageloader');
+                               this._imgObjs[id].fetch();
+                       }
+               }
+       }
+       // and by class
+       if (this.className) {
+               this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className);
+               for (var i=0; i < this._classImageEls.length; i++) {
+                       var elPos = YAHOO.util.Dom.getXY(this._classImageEls[i]);
+                       if (elPos[1] < hLimit && elPos[0] < wLimit) {
+                               YAHOO.log('Image with id "' + this._classImageEls[i].id + '" is above the fold. Fetching image. (Image registered by class name with the group - may not have an id.)', 'info', 'imageloader');
+                               YAHOO.util.Dom.removeClass(this._classImageEls[i], this.className);
+                       }
+               }
+       }
+};
+
+/**
+ * Finds all elements in the Dom with the class name specified in the group. Removes the class from the element in order to let the style definitions trigger the image fetching
+ * @method _fetchByClass
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._fetchByClass = function() {
+       if (! this.className) {
+               return;
+       }
+
+       YAHOO.log('Fetching all images with class "' + this.className + '" in group "' + this.name + '".', 'info', 'imageloader');
+       // this._classImageEls may have been set during _foldCheck
+       if (this._classImageEls === null) {
+               this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className);
+       }
+       YAHOO.util.Dom.removeClass(this._classImageEls, this.className);
+};
+
+
+/**
+ * Base class for image objects to be registered with the groups
+ * @class YAHOO.util.ImageLoader.imgObj
+ * @constructor
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ */
+YAHOO.util.ImageLoader.imgObj = function(domId, url) {
+       /**
+        * HTML DOM id of the image element
+        * @property domId
+        * @type String
+        */
+       this.domId = domId;
+
+       /**
+        * URL for the image
+        * @property url
+        * @type String
+        */
+       this.url = url;
+
+       /**
+        * Pixel width of the image. Will be set as a "width" attribute after the image is fetched.
+        * Detaults to the natural width of the image.
+        * Only appropriate with src images
+        * @property width
+        * @type Int
+        */
+       this.width = null;
+
+       /**
+        * Pixel height of the image. Will be set as a "height" attribute after the image is fetched.
+        * Detaults to the natural height of the image.
+        * Only appropriate with src images
+        * @property height
+        * @type Int
+        */
+       this.height = null;
+
+       /**
+        * Whether the style.visibility should be set to "visible" after the image is fetched.
+        * Used when setting src images as visibility:hidden prior to image fetching
+        * @property setVisible
+        * @type Boolean
+        */
+       this.setVisible = false;
+
+       /**
+        * Whether the image has already been fetched. In the case of a foldCondional group, keeps track for when the trigger is fired so images aren't fetched twice
+        * @property _fetched
+        * @type Boolean
+        * @private
+        */
+       this._fetched = false;
+};
+
+/**
+ * Displays the image; puts the URL into the DOM
+ * @method fetch
+ */
+YAHOO.util.ImageLoader.imgObj.prototype.fetch = function() {
+       if (this._fetched) {
+               return;
+       }
+       var el = document.getElementById(this.domId);
+       if (! el) {
+               return;
+       }
+       YAHOO.log('Fetching image with id "' + this.domId + '".', 'info', 'imageloader');
+       this._applyUrl(el);
+
+       if (this.setVisible) {
+               el.style.visibility = 'visible';
+       }
+       if (this.width) {
+               el.width = this.width;
+       }
+       if (this.height) {
+               el.height = this.height;
+       }
+       this._fetched = true;
+};
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Must be overridden by child class
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.imgObj.prototype._applyUrl = function(el) {
+};
+
+/**
+ * Background image object. A background image is one whose URL is specified by "background-image" in the element's style
+ * @class YAHOO.util.ImageLoader.bgImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ */
+YAHOO.util.ImageLoader.bgImgObj = function(domId, url) {
+       YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url);
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Sets style.backgroundImage
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) {
+       el.style.backgroundImage = "url('" + this.url + "')";
+};
+
+/**
+ * Source image object. A source image is one whose URL is specified by a src attribute in the DOM element
+ * @class YAHOO.util.ImageLoader.srcImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Int}        width   pixel width of the image - defaults to image's natural size
+ * @param {Int}        height  pixel height of the image - defaults to image's natural size
+ */
+YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) {
+       YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url);
+       this.width = width;
+       this.height = height;
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Sets src
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) {
+       el.src = this.url;
+};
+
+/**
+ * PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style
+ * @class YAHOO.util.ImageLoader.pngBgImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ */
+YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url) {
+       YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url);
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) {
+       if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
+               el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="scale")';
+       }
+       else {
+               el.style.backgroundImage = "url('" + this.url + "')";
+       }
+};
+YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/imageloader/imageloader-experimental-min.js b/lib/yui/imageloader/imageloader-experimental-min.js
new file mode 100755 (executable)
index 0000000..da9a475
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
+if(typeof(YAHOO.util.ImageLoader)=='undefined'){YAHOO.util.ImageLoader={};}
+YAHOO.util.ImageLoader.group=function(trigEl,trigAct,timeout){this.name='unnamed';this._imgObjs={};this.timeoutLen=timeout;this._timeout=null;this._triggers=[];this.foldConditional=false;this.className=null;this._classImageEls=null;YAHOO.util.Event.addListener(window,'load',this._onloadTasks,this,true);this.addTrigger(trigEl,trigAct);};YAHOO.util.ImageLoader.group.prototype.addTrigger=function(trigEl,trigAct){if(!trigEl||!trigAct){return;}
+var wrappedFetch=function(){this.fetch();};this._triggers.push([trigEl,trigAct,wrappedFetch]);YAHOO.util.Event.addListener(trigEl,trigAct,wrappedFetch,this,true);};YAHOO.util.ImageLoader.group.prototype._onloadTasks=function(){if(this.timeoutLen&&typeof(this.timeoutLen)=='number'&&this.timeoutLen>0){this._timeout=setTimeout(this._getFetchTimeout(),this.timeoutLen*1000);}
+if(this.foldConditional){this._foldCheck();}};YAHOO.util.ImageLoader.group.prototype._getFetchTimeout=function(){var self=this;return function(){self.fetch();};};YAHOO.util.ImageLoader.group.prototype.registerBgImage=function(domId,url){this._imgObjs[domId]=new YAHOO.util.ImageLoader.bgImgObj(domId,url);return this._imgObjs[domId];};YAHOO.util.ImageLoader.group.prototype.registerSrcImage=function(domId,url,width,height){this._imgObjs[domId]=new YAHOO.util.ImageLoader.srcImgObj(domId,url,width,height);return this._imgObjs[domId];};YAHOO.util.ImageLoader.group.prototype.registerPngBgImage=function(domId,url){this._imgObjs[domId]=new YAHOO.util.ImageLoader.pngBgImgObj(domId,url);return this._imgObjs[domId];};YAHOO.util.ImageLoader.group.prototype.fetch=function(){YAHOO.log('Fetching images in group: "'+this.name+'".','info','imageloader');clearTimeout(this._timeout);for(var i=0;i<this._triggers.length;i++){YAHOO.util.Event.removeListener(this._triggers[i][0],this._triggers[i][1],this._triggers[i][2]);}
+this._fetchByClass();for(var id in this._imgObjs){if(YAHOO.lang.hasOwnProperty(this._imgObjs,id)){this._imgObjs[id].fetch();}}};YAHOO.util.ImageLoader.group.prototype._foldCheck=function(){YAHOO.log('Checking for images above the fold in group: "'+this.name+'"','info','imageloader');var scrollTop=(document.compatMode!='CSS1Compat')?document.body.scrollTop:document.documentElement.scrollTop;var viewHeight=YAHOO.util.Dom.getViewportHeight();var hLimit=scrollTop+viewHeight;var scrollLeft=(document.compatMode!='CSS1Compat')?document.body.scrollLeft:document.documentElement.scrollLeft;var viewWidth=YAHOO.util.Dom.getViewportWidth();var wLimit=scrollLeft+viewWidth;for(var id in this._imgObjs){if(YAHOO.lang.hasOwnProperty(this._imgObjs,id)){var elPos=YAHOO.util.Dom.getXY(this._imgObjs[id].domId);if(elPos[1]<hLimit&&elPos[0]<wLimit){YAHOO.log('Image with id "'+this._imgObjs[id].domId+'" is above the fold. Fetching image.','info','imageloader');this._imgObjs[id].fetch();}}}
+if(this.className){this._classImageEls=YAHOO.util.Dom.getElementsByClassName(this.className);for(var i=0;i<this._classImageEls.length;i++){var elPos=YAHOO.util.Dom.getXY(this._classImageEls[i]);if(elPos[1]<hLimit&&elPos[0]<wLimit){YAHOO.log('Image with id "'+this._classImageEls[i].id+'" is above the fold. Fetching image. (Image registered by class name with the group - may not have an id.)','info','imageloader');YAHOO.util.Dom.removeClass(this._classImageEls[i],this.className);}}}};YAHOO.util.ImageLoader.group.prototype._fetchByClass=function(){if(!this.className){return;}
+YAHOO.log('Fetching all images with class "'+this.className+'" in group "'+this.name+'".','info','imageloader');if(this._classImageEls===null){this._classImageEls=YAHOO.util.Dom.getElementsByClassName(this.className);}
+YAHOO.util.Dom.removeClass(this._classImageEls,this.className);};YAHOO.util.ImageLoader.imgObj=function(domId,url){this.domId=domId;this.url=url;this.width=null;this.height=null;this.setVisible=false;this._fetched=false;};YAHOO.util.ImageLoader.imgObj.prototype.fetch=function(){if(this._fetched){return;}
+var el=document.getElementById(this.domId);if(!el){return;}
+YAHOO.log('Fetching image with id "'+this.domId+'".','info','imageloader');this._applyUrl(el);if(this.setVisible){el.style.visibility='visible';}
+if(this.width){el.width=this.width;}
+if(this.height){el.height=this.height;}
+this._fetched=true;};YAHOO.util.ImageLoader.imgObj.prototype._applyUrl=function(el){};YAHOO.util.ImageLoader.bgImgObj=function(domId,url){YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this,domId,url);};YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj,YAHOO.util.ImageLoader.imgObj);YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl=function(el){el.style.backgroundImage="url('"+this.url+"')";};YAHOO.util.ImageLoader.srcImgObj=function(domId,url,width,height){YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this,domId,url);this.width=width;this.height=height;};YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj,YAHOO.util.ImageLoader.imgObj);YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl=function(el){el.src=this.url;};YAHOO.util.ImageLoader.pngBgImgObj=function(domId,url){YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this,domId,url);};YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj,YAHOO.util.ImageLoader.imgObj);YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl=function(el){if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6){el.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+this.url+'", sizingMethod="scale")';}
+else{el.style.backgroundImage="url('"+this.url+"')";}};YAHOO.register("imageloader",YAHOO.util.ImageLoader,{version:"2.3.0",build:"442"});
\ No newline at end of file
diff --git a/lib/yui/imageloader/imageloader-experimental.js b/lib/yui/imageloader/imageloader-experimental.js
new file mode 100755 (executable)
index 0000000..55b85c5
--- /dev/null
@@ -0,0 +1,442 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * The image loader is a framework to dynamically load images
+ * according to certain triggers, enabling faster load times
+ * and a more responsive UI.
+ *
+ * @module imageloader
+ * @namespace YAHOO.util
+ * @experimental
+ */
+
+if (typeof(YAHOO.util.ImageLoader) == 'undefined') {
+       YAHOO.util.ImageLoader = {};
+}
+
+/**
+ * A group for images. A group can have one time limit and a series of triggers. Thus the images belonging to this group must share these constraints.
+ * @class YAHOO.util.ImageLoader.group
+ * @requires YAHOO.util.Dom
+ * @requires YAHOO.util.Event
+ * @constructor
+ * @param {String|HTMLElement} trigEl  The HTML element id or reference to assign the trigger event to. Can be null for no trigger
+ * @param {String}     trigAct The type of event to assign to trigEl. Can be null for no trigger
+ * @param {Number}     timeout Timeout (time limit) length, in seconds. Can be undefined, or <= 0, for no time limit
+ */
+YAHOO.util.ImageLoader.group = function(trigEl, trigAct, timeout) {
+       /**
+        * Name for the group. Only used to identify the group in logging statements
+        * @property name
+        * @type String
+        */
+       this.name = 'unnamed';
+       
+       /**
+        * Collection of images registered with this group
+        * @property _imgObjs
+        * @private
+        * @type Object
+        */
+       this._imgObjs = {};
+       
+       /**
+        * Timeout (time limit) length, in seconds
+        * @property timeoutLen
+        * @type Number
+        */
+       this.timeoutLen = timeout;
+       
+       /**
+        * Timeout object to keep a handle on the time limit
+        * @property _timeout
+        * @private
+        * @type Object
+        */
+       this._timeout = null;
+       
+       /**
+        * Collection of triggers for this group.
+        * Keeps track of each trigger's element, event, and event-listener-callback "fetch" function
+        * @property _triggers
+        * @private
+        * @type Array
+        */
+       this._triggers = [];
+
+       /**
+        * Flag to check if images are above the fold. If foldConditional is true, the group will check each of its image locations at page load. If any part of the image is within the client viewport, the image is displayed immediately
+        * @property foldConditional
+        * @type Boolean
+        */
+       this.foldConditional = false;
+
+       /**
+        * Class name that will identify images belonging to the group. This class name will be removed from each element in order to fetch images.
+        * This class should have, in its CSS style definition, "background:none !important;"
+        * @property className
+        * @type String
+        */
+       this.className = null;
+
+       /**
+        * HTML elements having the class name that is associated with this group
+        * Elements are stored during the _foldCheck function and reused later during the fetch function. Gives a slight performance improvement when className and foldConditional are both used
+        * @property _classImageEls
+        * @private
+        * @type Array
+        */
+       this._classImageEls = null;
+
+       // add a listener to set the time limit in the onload
+       YAHOO.util.Event.addListener(window, 'load', this._onloadTasks, this, true);
+       // add the trigger
+       this.addTrigger(trigEl, trigAct);
+
+};
+
+/**
+ * Adds a trigger to the group. Call this with the same style as YAHOO.util.Event.addListener
+ * @method addTrigger
+ * @param {String|HTMLElement} trigEl  The HTML element id or reference to assign the trigger event to
+ * @param {String} trigAct The type of event to assign to trigEl
+ */
+YAHOO.util.ImageLoader.group.prototype.addTrigger = function(trigEl, trigAct) {
+       if (! trigEl || ! trigAct) {
+               return;
+       }
+       /* Need to wrap the fetch function. Event Util can't distinguish prototyped functions of different instantiations
+        *   Leads to this scenario: groupA and groupZ both have window-scroll triggers. groupZ also has a 2-sec timeout (groupA has no timeout).
+        *   groupZ's timeout fires; we remove the triggers. The removeListener call finds the first window-scroll event with Y.u.IL.p.fetch, which is groupA's. 
+        *   groupA's trigger is removed and never fires, leaving images unfetched
+        */
+       var wrappedFetch = function() {
+               this.fetch();
+       };
+       this._triggers.push([trigEl, trigAct, wrappedFetch]);
+       YAHOO.util.Event.addListener(trigEl, trigAct, wrappedFetch, this, true);
+};
+
+/**
+ * Setup to do in the window's onload
+ * Initiates time limit for group; executes the fold check for the images
+ * @method _onloadTasks
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._onloadTasks = function() {
+       if (this.timeoutLen && typeof(this.timeoutLen) == 'number' && this.timeoutLen > 0) {
+               this._timeout = setTimeout(this._getFetchTimeout(), this.timeoutLen * 1000);
+       }
+
+       if (this.foldConditional) {
+               this._foldCheck();
+       }
+};
+
+/**
+ * Returns the group's fetch method, with the proper closure, for use with setTimeout
+ * @method _getFetchTimeout
+ * @return {Function}  group's fetch method
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._getFetchTimeout = function() {
+       var self = this;
+       return function() { self.fetch(); };
+};
+
+/**
+ * Registers a background image with the group
+ * @method registerBgImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @return {Object}    bgImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerBgImage = function(domId, url) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.bgImgObj(domId, url);
+       return this._imgObjs[domId];
+};
+/**
+ * Registers a src image with the group
+ * @method registerSrcImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Int}        width   pixel width of the image - defaults to image's natural size
+ * @param {Int}        height  pixel height of the image - defaults to image's natural size
+ * @return {Object}    srcImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerSrcImage = function(domId, url, width, height) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.srcImgObj(domId, url, width, height);
+       return this._imgObjs[domId];
+};
+/**
+ * Registers an alpha-channel-type png background image with the group
+ * @method registerPngBgImage
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @return {Object}    pngBgImgObj that was registered, for modifying any attributes in the object
+ */
+YAHOO.util.ImageLoader.group.prototype.registerPngBgImage = function(domId, url) {
+       this._imgObjs[domId] = new YAHOO.util.ImageLoader.pngBgImgObj(domId, url);
+       return this._imgObjs[domId];
+};
+
+/**
+ * Displays the images in the group
+ * @method fetch
+ */
+YAHOO.util.ImageLoader.group.prototype.fetch = function() {
+       YAHOO.log('Fetching images in group: "' + this.name + '".', 'info', 'imageloader');
+
+       clearTimeout(this._timeout);
+       // remove all listeners
+       for (var i=0; i < this._triggers.length; i++) {
+               YAHOO.util.Event.removeListener(this._triggers[i][0], this._triggers[i][1], this._triggers[i][2]);
+       }
+
+       // fetch whatever we need to by className
+       this._fetchByClass();
+
+       // fetch registered images
+       for (var id in this._imgObjs) {
+               if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) {
+                       this._imgObjs[id].fetch();
+               }
+       }
+};
+
+/**
+ * Checks the position of each image in the group. If any part of the image is within the client viewport, shows the image immediately.
+ * @method _foldCheck
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._foldCheck = function() {
+       YAHOO.log('Checking for images above the fold in group: "' + this.name + '"', 'info', 'imageloader');
+       var scrollTop = (document.compatMode != 'CSS1Compat') ? document.body.scrollTop : document.documentElement.scrollTop;
+       var viewHeight = YAHOO.util.Dom.getViewportHeight();
+       var hLimit = scrollTop + viewHeight;
+       var scrollLeft = (document.compatMode != 'CSS1Compat') ? document.body.scrollLeft : document.documentElement.scrollLeft;
+       var viewWidth = YAHOO.util.Dom.getViewportWidth();
+       var wLimit = scrollLeft + viewWidth;
+       for (var id in this._imgObjs) {
+               if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) {
+                       var elPos = YAHOO.util.Dom.getXY(this._imgObjs[id].domId);
+                       if (elPos[1] < hLimit && elPos[0] < wLimit) {
+                               YAHOO.log('Image with id "' + this._imgObjs[id].domId + '" is above the fold. Fetching image.', 'info', 'imageloader');
+                               this._imgObjs[id].fetch();
+                       }
+               }
+       }
+       // and by class
+       if (this.className) {
+               this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className);
+               for (var i=0; i < this._classImageEls.length; i++) {
+                       var elPos = YAHOO.util.Dom.getXY(this._classImageEls[i]);
+                       if (elPos[1] < hLimit && elPos[0] < wLimit) {
+                               YAHOO.log('Image with id "' + this._classImageEls[i].id + '" is above the fold. Fetching image. (Image registered by class name with the group - may not have an id.)', 'info', 'imageloader');
+                               YAHOO.util.Dom.removeClass(this._classImageEls[i], this.className);
+                       }
+               }
+       }
+};
+
+/**
+ * Finds all elements in the Dom with the class name specified in the group. Removes the class from the element in order to let the style definitions trigger the image fetching
+ * @method _fetchByClass
+ * @private
+ */
+YAHOO.util.ImageLoader.group.prototype._fetchByClass = function() {
+       if (! this.className) {
+               return;
+       }
+
+       YAHOO.log('Fetching all images with class "' + this.className + '" in group "' + this.name + '".', 'info', 'imageloader');
+       // this._classImageEls may have been set during _foldCheck
+       if (this._classImageEls === null) {
+               this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className);
+       }
+       YAHOO.util.Dom.removeClass(this._classImageEls, this.className);
+};
+
+
+/**
+ * Base class for image objects to be registered with the groups
+ * @class YAHOO.util.ImageLoader.imgObj
+ * @constructor
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ */
+YAHOO.util.ImageLoader.imgObj = function(domId, url) {
+       /**
+        * HTML DOM id of the image element
+        * @property domId
+        * @type String
+        */
+       this.domId = domId;
+
+       /**
+        * URL for the image
+        * @property url
+        * @type String
+        */
+       this.url = url;
+
+       /**
+        * Pixel width of the image. Will be set as a "width" attribute after the image is fetched.
+        * Detaults to the natural width of the image.
+        * Only appropriate with src images
+        * @property width
+        * @type Int
+        */
+       this.width = null;
+
+       /**
+        * Pixel height of the image. Will be set as a "height" attribute after the image is fetched.
+        * Detaults to the natural height of the image.
+        * Only appropriate with src images
+        * @property height
+        * @type Int
+        */
+       this.height = null;
+
+       /**
+        * Whether the style.visibility should be set to "visible" after the image is fetched.
+        * Used when setting src images as visibility:hidden prior to image fetching
+        * @property setVisible
+        * @type Boolean
+        */
+       this.setVisible = false;
+
+       /**
+        * Whether the image has already been fetched. In the case of a foldCondional group, keeps track for when the trigger is fired so images aren't fetched twice
+        * @property _fetched
+        * @type Boolean
+        * @private
+        */
+       this._fetched = false;
+};
+
+/**
+ * Displays the image; puts the URL into the DOM
+ * @method fetch
+ */
+YAHOO.util.ImageLoader.imgObj.prototype.fetch = function() {
+       if (this._fetched) {
+               return;
+       }
+       var el = document.getElementById(this.domId);
+       if (! el) {
+               return;
+       }
+       YAHOO.log('Fetching image with id "' + this.domId + '".', 'info', 'imageloader');
+       this._applyUrl(el);
+
+       if (this.setVisible) {
+               el.style.visibility = 'visible';
+       }
+       if (this.width) {
+               el.width = this.width;
+       }
+       if (this.height) {
+               el.height = this.height;
+       }
+       this._fetched = true;
+};
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Must be overridden by child class
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.imgObj.prototype._applyUrl = function(el) {
+};
+
+/**
+ * Background image object. A background image is one whose URL is specified by "background-image" in the element's style
+ * @class YAHOO.util.ImageLoader.bgImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ */
+YAHOO.util.ImageLoader.bgImgObj = function(domId, url) {
+       YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url);
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Sets style.backgroundImage
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) {
+       el.style.backgroundImage = "url('" + this.url + "')";
+};
+
+/**
+ * Source image object. A source image is one whose URL is specified by a src attribute in the DOM element
+ * @class YAHOO.util.ImageLoader.srcImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ * @param {Int}        width   pixel width of the image - defaults to image's natural size
+ * @param {Int}        height  pixel height of the image - defaults to image's natural size
+ */
+YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) {
+       YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url);
+       this.width = width;
+       this.height = height;
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * Sets src
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) {
+       el.src = this.url;
+};
+
+/**
+ * PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style
+ * @class YAHOO.util.ImageLoader.pngBgImgObj
+ * @constructor
+ * @extends YAHOO.util.ImageLoader.imgObj
+ * @param {String}     domId   HTML DOM id of the image element
+ * @param {String}     url     URL for the image
+ */
+YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url) {
+       YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url);
+};
+
+YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj);
+
+/**
+ * Inserts the image URL into the DOM so that the image is displayed.
+ * If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage
+ * @method _applyUrl
+ * @param {Object}     el      HTML DOM element
+ * @private
+ */
+YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) {
+       if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
+               el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="scale")';
+       }
+       else {
+               el.style.backgroundImage = "url('" + this.url + "')";
+       }
+};
+YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.3.0", build: "442"});
index 2443d0454520725366db180a60c2e27a26133293..478f308a7ee376f9fe8106bf8dc66d044c9bc521 100755 (executable)
@@ -1,5 +1,41 @@
 Logger Release Notes
 
+**** version 2.3.0 ****
+
+* Applied new skinning model.
+* Logger singleton no longer clobbers itself.
+* Fixed issues when setting LogReader property footerEnabled to false.
+
+
+
+**** version 2.2.2 ****
+
+* No changes.
+
+
+
+*** version 2.2.1 ***
+
+* Updated default ".yui-log-hd h4" font-size to "107%".
+* Fixed synchronicity issue with pause()/resume() calls and the corresponding
+LogReader button state.
+* Better support for "\n" newlines in log messages, while wrapping long lines in
+verboseOutput mode.
+* Added draggable and outputBuffer properties to LogReader.
+* Added showCategory(), hideCategory(), showSource(), hideSource(), and
+clearConsole() methods to LogReader.
+* Support for multiple freestanding LogReader instances.
+* Improved type checking with YAHOO.lang.
+
+
+
+**** version 2.2.0 ***
+
+* Implemented expand() and collapse() in LogReader class.
+* Better internal browser detection.
+
+
+
 *** version 0.12.2 ***
 
 * No changes.
@@ -23,17 +59,13 @@ for output to a LogReader.
 
 * The Logger static method enableFirebug() has been RENAMED to
 enableBrowserConsole().
-
 * The Logger static method disableFirebug() has been RENAMED to
 disableBrowserConsole().
-
 * By default, the Logger will not automatically output to Firebug or Safari's
 JavaScript console. To enable this feature, implementers should now explicitly
 call YAHOO.widget.Logger.enableBrowserConsole().
-
 * Implementers may now cap the size of the YAHOO.widget.Logger stack by setting
 the property YAHOO.widget.Logger.maxStackEntries.
-
 * Implementers may now control the number of items displayed in each console by
 setting the LogReader properties thresholdMax and thresholdMin.
 
diff --git a/lib/yui/logger/assets/logger-core.css b/lib/yui/logger/assets/logger-core.css
new file mode 100755 (executable)
index 0000000..921fad9
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* This file intentionally left blank */\r
index 2e1cf51089ca8d84ab6e4c9ad1adad977a591893..0d41c177a1c93deabc0ff2d39abb8cc092c5c75e 100755 (executable)
@@ -1,18 +1,55 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
 /* logger default styles */\r
-/* font size is controlled here: default 77% */\r
-#yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;}\r
-/* width is controlled here: default 31em */\r
-.yui-log {padding:1em;width:31em;background-color:#AAA;border:1px solid black;font-family:monospace;z-index:9000;}\r
+/* default width: 31em */\r
+/* default font-size 77% */\r
+.yui-log {padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;}\r
+\r
+/* for containers built from scratch */\r
+.yui-log-container {position:absolute;top:1em;right:1em;}\r
+\r
+/* buttons */\r
+.yui-log input {\r
+    margin:0;padding:0;\r
+    font-family:arial;\r
+    font-size:100%;\r
+    font-weight:normal;\r
+}\r
+.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;}\r
+\r
+/* header */\r
+.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;}\r
+.yui-log .yui-log-hd h4 {margin:0;padding:0;font-size:107%;font-weight:bold;color:#FFF;}\r
+\r
+/* body */\r
+\r
+.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;} /* height is controlled here: default 20em*/\r
 .yui-log p {margin:1px;padding:.1em;}\r
-.yui-log button {font-family:monospace;}\r
-.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;color:#FFF;}\r
-/* height is controlled here: default 20em*/\r
-.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}\r
-.yui-log .yui-log-ft {margin-top:.5em;margin-bottom:1em;}\r
+.yui-log pre {margin:0;padding:0;}\r
+\r
+/* for pre to respect newlines yet wrap long lines */\r
+/* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */\r
+.yui-log pre.yui-log-verbose {\r
+    white-space: pre-wrap; /* css-3 */\r
+    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */\r
+    white-space: -pre-wrap; /* Opera 4-6 */\r
+    white-space: -o-pre-wrap; /* Opera 7 */\r
+    word-wrap: break-word; /* Internet Explorer 5.5+ */\r
+}\r
+\r
+/* footer */\r
+.yui-log .yui-log-ft {margin-top:.5em;}\r
 .yui-log .yui-log-ft .yui-log-categoryfilters {}\r
 .yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}\r
-.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;}\r
 .yui-log .yui-log-filtergrp {margin-right:.5em;}\r
+/*.yui-log .yui-log-ft ul {margin:0;padding:0;line-height:1.8}\r
+.yui-log .yui-log-ft li {list-style:none;display:inline;white-space:nowrap;}*/\r
+\r
+/* logs */\r
 .yui-log .info {background-color:#A7CC25;} /* A7CC25 green */\r
 .yui-log .warn {background-color:#F58516;} /* F58516 orange */\r
 .yui-log .error {background-color:#E32F0B;} /* E32F0B red */\r
diff --git a/lib/yui/logger/assets/skins/sam/logger-skin.css b/lib/yui/logger/assets/skins/sam/logger-skin.css
new file mode 100755 (executable)
index 0000000..de83af6
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* logger default styles */\r
+/* default width: 31em */\r
+/* default font-size 77% */\r
+.yui-skin-sam .yui-log { padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000; }\r
+\r
+/* for containers built from scratch */\r
+.yui-skin-sam .yui-log-container { position:absolute;top:1em;right:1em; }\r
+\r
+/* buttons */\r
+.yui-skin-sam .yui-log input {\r
+    margin:0;padding:0;\r
+    font-family:arial;\r
+    font-size:100%;\r
+    font-weight:normal;\r
+}\r
+.yui-skin-sam .yui-log .yui-log-btns { position:relative;float:right;bottom:.25em; }\r
+\r
+/* header */\r
+.yui-skin-sam .yui-log .yui-log-hd { margin-top:1em;padding:.5em;background-color:#575757; }\r
+.yui-skin-sam .yui-log .yui-log-hd h4 { margin:0;padding:0;font-size:108%;font-weight:bold;color:#FFF; }\r
+\r
+/* body */\r
+\r
+.yui-skin-sam .yui-log .yui-log-bd { width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto; } /* height is controlled here: default 20em*/\r
+.yui-skin-sam .yui-log p { margin:1px;padding:.1em; }\r
+.yui-skin-sam .yui-log pre { margin:0;padding:0; }\r
+\r
+/* for pre to respect newlines yet wrap long lines */\r
+/* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */\r
+.yui-skin-sam .yui-log pre.yui-log-verbose {\r
+    white-space: pre-wrap; /* css-3 */\r
+    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */\r
+    white-space: -pre-wrap; /* Opera 4-6 */\r
+    white-space: -o-pre-wrap; /* Opera 7 */\r
+    word-wrap: break-word; /* Internet Explorer 5.5+ */\r
+}\r
+\r
+/* footer */\r
+.yui-skin-sam .yui-log .yui-log-ft { margin-top:.5em; }\r
+.yui-skin-sam .yui-log .yui-log-ft .yui-log-categoryfilters { }\r
+.yui-skin-sam .yui-log .yui-log-ft .yui-log-sourcefilters { width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em; }\r
+.yui-skin-sam .yui-log .yui-log-filtergrp { margin-right:.5em; }\r
+\r
+/* logs */\r
+.yui-skin-sam .yui-log .info { background-color:#A7CC25; } /* A7CC25 green */\r
+.yui-skin-sam .yui-log .warn { background-color:#F58516; } /* F58516 orange */\r
+.yui-skin-sam .yui-log .error { background-color:#E32F0B; } /* E32F0B red */\r
+.yui-skin-sam .yui-log .time { background-color:#A6C9D7; } /* A6C9D7 blue */\r
+.yui-skin-sam .yui-log .window { background-color:#F2E886; } /* F2E886 tan */\r
diff --git a/lib/yui/logger/assets/skins/sam/logger.css b/lib/yui/logger/assets/skins/sam/logger.css
new file mode 100755 (executable)
index 0000000..5b8077f
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-skin-sam .yui-log{padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;}.yui-skin-sam .yui-log-container{position:absolute;top:1em;right:1em;}.yui-skin-sam .yui-log input{margin:0;padding:0;font-family:arial;font-size:100%;font-weight:normal;}.yui-skin-sam .yui-log .yui-log-btns{position:relative;float:right;bottom:.25em;}.yui-skin-sam .yui-log .yui-log-hd{margin-top:1em;padding:.5em;background-color:#575757;}.yui-skin-sam .yui-log .yui-log-hd h4{margin:0;padding:0;font-size:108%;font-weight:bold;color:#FFF;}.yui-skin-sam .yui-log .yui-log-bd{width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}.yui-skin-sam .yui-log p{margin:1px;padding:.1em;}.yui-skin-sam .yui-log pre{margin:0;padding:0;}.yui-skin-sam .yui-log pre.yui-log-verbose{white-space:pre-wrap;white-space:-moz-pre-wrap !important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}.yui-skin-sam .yui-log .yui-log-ft{margin-top:.5em;}.yui-skin-sam .yui-log .yui-log-ft .yui-log-categoryfilters{}.yui-skin-sam .yui-log .yui-log-ft .yui-log-sourcefilters{width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}.yui-skin-sam .yui-log .yui-log-filtergrp{margin-right:.5em;}.yui-skin-sam .yui-log .info{background-color:#A7CC25;}.yui-skin-sam .yui-log .warn{background-color:#F58516;}.yui-skin-sam .yui-log .error{background-color:#E32F0B;}.yui-skin-sam .yui-log .time{background-color:#A6C9D7;}.yui-skin-sam .yui-log .window{background-color:#F2E886;}
index 3134716e596c132ce8fec722243c73e3ce90be14..583eda200fde4326696ad4cc0790ed861e3e8c86 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * The LogMsg class defines a single log message.\r
- *\r
- * @class LogMsg\r
- * @constructor\r
- * @param oConfigs {Object} Object literal of configuration params.\r
- */\r
- YAHOO.widget.LogMsg = function(oConfigs) {\r
-    // Parse configs\r
-    if (typeof oConfigs == "object") {\r
-        for(var param in oConfigs) {\r
-            this[param] = oConfigs[param];\r
-        }\r
-    }\r
- };\r
\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Log message.\r
- *\r
- * @property msg\r
- * @type String\r
- */\r
-YAHOO.widget.LogMsg.prototype.msg = null;\r
\r
-/**\r
- * Log timestamp.\r
- *\r
- * @property time\r
- * @type Date\r
- */\r
-YAHOO.widget.LogMsg.prototype.time = null;\r
-\r
-/**\r
- * Log category.\r
- *\r
- * @property category\r
- * @type String\r
- */\r
-YAHOO.widget.LogMsg.prototype.category = null;\r
-\r
-/**\r
- * Log source. The first word passed in as the source argument.\r
- *\r
- * @property source\r
- * @type String\r
- */\r
-YAHOO.widget.LogMsg.prototype.source = null;\r
-\r
-/**\r
- * Log source detail. The remainder of the string passed in as the source argument, not\r
- * including the first word (if any).\r
- *\r
- * @property sourceDetail\r
- * @type String\r
- */\r
-YAHOO.widget.LogMsg.prototype.sourceDetail = null;\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * The LogWriter class provides a mechanism to log messages through\r
- * YAHOO.widget.Logger from a named source.\r
- *\r
- * @class LogWriter\r
- * @constructor\r
- * @param sSource {String} Source of LogWriter instance.\r
- */\r
-YAHOO.widget.LogWriter = function(sSource) {\r
-    if(!sSource) {\r
-        YAHOO.log("Could not instantiate LogWriter due to invalid source.",\r
-            "error", "LogWriter");\r
-        return;\r
-    }\r
-    this._source = sSource;\r
- };\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
- /**\r
- * Public accessor to the unique name of the LogWriter instance.\r
- *\r
- * @method toString\r
- * @return {String} Unique name of the LogWriter instance.\r
- */\r
-YAHOO.widget.LogWriter.prototype.toString = function() {\r
-    return "LogWriter " + this._sSource;\r
-};\r
-\r
-/**\r
- * Logs a message attached to the source of the LogWriter.\r
- *\r
- * @method log\r
- * @param sMsg {String} The log message.\r
- * @param sCategory {String} Category name.\r
- */\r
-YAHOO.widget.LogWriter.prototype.log = function(sMsg, sCategory) {\r
-    YAHOO.widget.Logger.log(sMsg, sCategory, this._source);\r
-};\r
-\r
-/**\r
- * Public accessor to get the source name.\r
- *\r
- * @method getSource\r
- * @return {String} The LogWriter source.\r
- */\r
-YAHOO.widget.LogWriter.prototype.getSource = function() {\r
-    return this._sSource;\r
-};\r
-\r
-/**\r
- * Public accessor to set the source name.\r
- *\r
- * @method setSource\r
- * @param sSource {String} Source of LogWriter instance.\r
- */\r
-YAHOO.widget.LogWriter.prototype.setSource = function(sSource) {\r
-    if(!sSource) {\r
-        YAHOO.log("Could not set source due to invalid source.", "error", this.toString());\r
-        return;\r
-    }\r
-    else {\r
-        this._sSource = sSource;\r
-    }\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Source of the LogWriter instance.\r
- *\r
- * @property _source\r
- * @type String\r
- * @private\r
- */\r
-YAHOO.widget.LogWriter.prototype._source = null;\r
-\r
-\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * The LogReader class provides UI to read messages logged to YAHOO.widget.Logger.\r
- *\r
- * @class LogReader\r
- * @constructor\r
- * @param elContainer {HTMLElement} (optional) DOM element reference of an existing DIV.\r
- * @param elContainer {String} (optional) String ID of an existing DIV.\r
- * @param oConfigs {Object} (optional) Object literal of configuration params.\r
- */\r
-YAHOO.widget.LogReader = function(elContainer, oConfigs) {\r
-    var oSelf = this;\r
-    this._sName = YAHOO.widget.LogReader._index;\r
-    YAHOO.widget.LogReader._index++;\r
-\r
-    // Parse config vars here\r
-    if (typeof oConfigs == "object") {\r
-        for(var param in oConfigs) {\r
-            this[param] = oConfigs[param];\r
-        }\r
-    }\r
-\r
-    // Attach container...\r
-    if(elContainer) {\r
-        if(typeof elContainer == "string") {\r
-            this._elContainer = document.getElementById(elContainer);\r
-        }\r
-        else if(elContainer.tagName) {\r
-            this._elContainer = elContainer;\r
-        }\r
-        this._elContainer.className = "yui-log";\r
-    }\r
-    // ...or create container from scratch\r
-    if(!this._elContainer) {\r
-        if(YAHOO.widget.LogReader._elDefaultContainer) {\r
-            this._elContainer =  YAHOO.widget.LogReader._elDefaultContainer;\r
-        }\r
-        else {\r
-            this._elContainer = document.body.appendChild(document.createElement("div"));\r
-            this._elContainer.id = "yui-log";\r
-            this._elContainer.className = "yui-log";\r
-\r
-            YAHOO.widget.LogReader._elDefaultContainer = this._elContainer;\r
-        }\r
-\r
-        // If implementer has provided container values, trust and set those\r
-        var containerStyle = this._elContainer.style;\r
-        if(this.width) {\r
-            containerStyle.width = this.width;\r
-        }\r
-        if(this.right) {\r
-            containerStyle.right = this.right;\r
-        }\r
-        if(this.top) {\r
-            containerStyle.top = this.top;\r
-        }\r
-         if(this.left) {\r
-            containerStyle.left = this.left;\r
-            containerStyle.right = "auto";\r
-        }\r
-        if(this.bottom) {\r
-            containerStyle.bottom = this.bottom;\r
-            containerStyle.top = "auto";\r
-        }\r
-       if(this.fontSize) {\r
-            containerStyle.fontSize = this.fontSize;\r
-        }\r
-        if(window.opera) {\r
-            document.body.style += '';\r
-        }\r
-    }\r
-\r
-    if(this._elContainer) {\r
-        // Create header\r
-        if(!this._elHd) {\r
-            this._elHd = this._elContainer.appendChild(document.createElement("div"));\r
-            this._elHd.id = "yui-log-hd" + this._sName;\r
-            this._elHd.className = "yui-log-hd";\r
-\r
-            this._elCollapse = this._elHd.appendChild(document.createElement("div"));\r
-            this._elCollapse.className = "yui-log-btns";\r
-\r
-            this._btnCollapse = document.createElement("input");\r
-            this._btnCollapse.type = "button";\r
-            this._btnCollapse.style.fontSize =\r
-                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r
-            this._btnCollapse.className = "yui-log-button";\r
-            this._btnCollapse.value = "Collapse";\r
-            this._btnCollapse = this._elCollapse.appendChild(this._btnCollapse);\r
-            YAHOO.util.Event.addListener(\r
-                oSelf._btnCollapse,'click',oSelf._onClickCollapseBtn,oSelf);\r
-\r
-            this._title = this._elHd.appendChild(document.createElement("h4"));\r
-            this._title.innerHTML = "Logger Console";\r
-\r
-            // If Drag and Drop utility is available...\r
-            // ...and this container was created from scratch...\r
-            // ...then make the header draggable\r
-            if(YAHOO.util.DD &&\r
-            (YAHOO.widget.LogReader._elDefaultContainer == this._elContainer)) {\r
-                var ylog_dd = new YAHOO.util.DD(this._elContainer.id);\r
-                ylog_dd.setHandleElId(this._elHd.id);\r
-                this._elHd.style.cursor = "move";\r
-            }\r
-        }\r
-        // Ceate console\r
-        if(!this._elConsole) {\r
-            this._elConsole =\r
-                this._elContainer.appendChild(document.createElement("div"));\r
-            this._elConsole.className = "yui-log-bd";\r
-\r
-            // If implementer has provided console, trust and set those\r
-            if(this.height) {\r
-                this._elConsole.style.height = this.height;\r
-            }\r
-        }\r
-        // Don't create footer if disabled\r
-        if(!this._elFt && this.footerEnabled) {\r
-            this._elFt = this._elContainer.appendChild(document.createElement("div"));\r
-            this._elFt.className = "yui-log-ft";\r
-\r
-            this._elBtns = this._elFt.appendChild(document.createElement("div"));\r
-            this._elBtns.className = "yui-log-btns";\r
-\r
-            this._btnPause = document.createElement("input");\r
-            this._btnPause.type = "button";\r
-            this._btnPause.style.fontSize =\r
-                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r
-            this._btnPause.className = "yui-log-button";\r
-            this._btnPause.value = "Pause";\r
-            this._btnPause = this._elBtns.appendChild(this._btnPause);\r
-            YAHOO.util.Event.addListener(\r
-                oSelf._btnPause,'click',oSelf._onClickPauseBtn,oSelf);\r
-\r
-            this._btnClear = document.createElement("input");\r
-            this._btnClear.type = "button";\r
-            this._btnClear.style.fontSize =\r
-                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r
-            this._btnClear.className = "yui-log-button";\r
-            this._btnClear.value = "Clear";\r
-            this._btnClear = this._elBtns.appendChild(this._btnClear);\r
-            YAHOO.util.Event.addListener(\r
-                oSelf._btnClear,'click',oSelf._onClickClearBtn,oSelf);\r
-\r
-            this._elCategoryFilters = this._elFt.appendChild(document.createElement("div"));\r
-            this._elCategoryFilters.className = "yui-log-categoryfilters";\r
-            this._elSourceFilters = this._elFt.appendChild(document.createElement("div"));\r
-            this._elSourceFilters.className = "yui-log-sourcefilters";\r
-        }\r
-    }\r
-\r
-    // Initialize internal vars\r
-    if(!this._buffer) {\r
-        this._buffer = []; // output buffer\r
-    }\r
-    // Timestamp of last log message to console\r
-    this._lastTime = YAHOO.widget.Logger.getStartTime(); \r
-    \r
-    // Subscribe to Logger custom events\r
-    YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog, this);\r
-    YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset, this);\r
-\r
-    // Initialize category filters\r
-    this._categoryFilters = [];\r
-    var catsLen = YAHOO.widget.Logger.categories.length;\r
-    if(this._elCategoryFilters) {\r
-        for(var i=0; i < catsLen; i++) {\r
-            this._createCategoryCheckbox(YAHOO.widget.Logger.categories[i]);\r
-        }\r
-    }\r
-    // Initialize source filters\r
-    this._sourceFilters = [];\r
-    var sourcesLen = YAHOO.widget.Logger.sources.length;\r
-    if(this._elSourceFilters) {\r
-        for(var j=0; j < sourcesLen; j++) {\r
-            this._createSourceCheckbox(YAHOO.widget.Logger.sources[j]);\r
-        }\r
-    }\r
-    YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate, this);\r
-    YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate, this);\r
-\r
-    this._filterLogs();\r
-    YAHOO.log("LogReader initialized", null, this.toString());\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Whether or not the log reader is enabled to output log messages.\r
- *\r
- * @property logReaderEnabled\r
- * @type Boolean\r
- * @default true\r
- */\r
-YAHOO.widget.LogReader.prototype.logReaderEnabled = true;\r
-\r
-/**\r
- * Public member to access CSS width of the log reader container.\r
- *\r
- * @property width\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.width = null;\r
-\r
-/**\r
- * Public member to access CSS height of the log reader container.\r
- *\r
- * @property height\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.height = null;\r
-\r
-/**\r
- * Public member to access CSS top position of the log reader container.\r
- *\r
- * @property top\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.top = null;\r
-\r
-/**\r
- * Public member to access CSS left position of the log reader container.\r
- *\r
- * @property left\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.left = null;\r
-\r
-/**\r
- * Public member to access CSS right position of the log reader container.\r
- *\r
- * @property right\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.right = null;\r
-\r
-/**\r
- * Public member to access CSS bottom position of the log reader container.\r
- *\r
- * @property bottom\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.bottom = null;\r
-\r
-/**\r
- * Public member to access CSS font size of the log reader container.\r
- *\r
- * @property fontSize\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.fontSize = null;\r
-\r
-/**\r
- * Whether or not the footer UI is enabled for the log reader.\r
- *\r
- * @property footerEnabled\r
- * @type Boolean\r
- * @default true\r
- */\r
-YAHOO.widget.LogReader.prototype.footerEnabled = true;\r
-\r
-/**\r
- * Whether or not output is verbose (more readable). Setting to true will make\r
- * output more compact (less readable).\r
- *\r
- * @property verboseOutput\r
- * @type Boolean\r
- * @default true\r
- */\r
-YAHOO.widget.LogReader.prototype.verboseOutput = true;\r
-\r
-/**\r
- * Whether or not newest message is printed on top.\r
- *\r
- * @property newestOnTop\r
- * @type Boolean\r
- */\r
-YAHOO.widget.LogReader.prototype.newestOnTop = true;\r
-\r
-/**\r
- * Maximum number of messages a LogReader console will display.\r
- *\r
- * @property thresholdMax\r
- * @type Number\r
- * @default 500\r
- */\r
-YAHOO.widget.LogReader.prototype.thresholdMax = 500;\r
-\r
-/**\r
- * When a LogReader console reaches its thresholdMax, it will clear out messages\r
- * and print out the latest thresholdMin number of messages.\r
- *\r
- * @property thresholdMin\r
- * @type Number\r
- * @default 100\r
- */\r
-YAHOO.widget.LogReader.prototype.thresholdMin = 100;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
- /**\r
- * Public accessor to the unique name of the LogReader instance.\r
- *\r
- * @method toString\r
- * @return {String} Unique name of the LogReader instance.\r
- */\r
-YAHOO.widget.LogReader.prototype.toString = function() {\r
-    return "LogReader instance" + this._sName;\r
-};\r
-/**\r
- * Pauses output of log messages. While paused, log messages are not lost, but\r
- * get saved to a buffer and then output upon resume of log reader.\r
- *\r
- * @method pause\r
- */\r
-YAHOO.widget.LogReader.prototype.pause = function() {\r
-    this._timeout = null;\r
-    this.logReaderEnabled = false;\r
-};\r
-\r
-/**\r
- * Resumes output of log messages, including outputting any log messages that\r
- * have been saved to buffer while paused.\r
- *\r
- * @method resume\r
- */\r
-YAHOO.widget.LogReader.prototype.resume = function() {\r
-    this.logReaderEnabled = true;\r
-    this._printBuffer();\r
-};\r
-\r
-/**\r
- * Hides UI of log reader. Logging functionality is not disrupted.\r
- *\r
- * @method hide\r
- */\r
-YAHOO.widget.LogReader.prototype.hide = function() {\r
-    this._elContainer.style.display = "none";\r
-};\r
-\r
-/**\r
- * Shows UI of log reader. Logging functionality is not disrupted.\r
- *\r
- * @method show\r
- */\r
-YAHOO.widget.LogReader.prototype.show = function() {\r
-    this._elContainer.style.display = "block";\r
-};\r
-\r
-/**\r
- * Updates title to given string.\r
- *\r
- * @method setTitle\r
- * @param sTitle {String} New title.\r
- */\r
-YAHOO.widget.LogReader.prototype.setTitle = function(sTitle) {\r
-    this._title.innerHTML = this.html2Text(sTitle);\r
-};\r
-\r
-/**\r
- * Gets timestamp of the last log.\r
- *\r
- * @method getLastTime\r
- * @return {Date} Timestamp of the last log.\r
- */\r
-YAHOO.widget.LogReader.prototype.getLastTime = function() {\r
-    return this._lastTime;\r
-};\r
-\r
-/**\r
- * Formats message string to HTML for output to console.\r
- *\r
- * @method formatMsg\r
- * @param oLogMsg {Object} Log message object.\r
- * @return {String} HTML-formatted message for output to console.\r
- */\r
-YAHOO.widget.LogReader.prototype.formatMsg = function(oLogMsg) {\r
-    var category = oLogMsg.category;\r
-    \r
-    // Label for color-coded display\r
-    var label = category.substring(0,4).toUpperCase();\r
-\r
-    // Calculate the elapsed time to be from the last item that passed through the filter,\r
-    // not the absolute previous item in the stack\r
-\r
-    var time = oLogMsg.time;\r
-    if (time.toLocaleTimeString) {\r
-        var localTime  = time.toLocaleTimeString();\r
-    }\r
-    else {\r
-        localTime = time.toString();\r
-    }\r
-\r
-    var msecs = time.getTime();\r
-    var startTime = YAHOO.widget.Logger.getStartTime();\r
-    var totalTime = msecs - startTime;\r
-    var elapsedTime = msecs - this.getLastTime();\r
-\r
-    var source = oLogMsg.source;\r
-    var sourceDetail = oLogMsg.sourceDetail;\r
-    var sourceAndDetail = (sourceDetail) ?\r
-        source + " " + sourceDetail : source;\r
-        \r
-    // Escape HTML entities in the log message itself for output to console\r
-    var msg = this.html2Text(oLogMsg.msg);\r
-\r
-    // Verbose output includes extra line breaks\r
-    var output =  (this.verboseOutput) ?\r
-        ["<p><span class='", category, "'>", label, "</span> ",\r
-        totalTime, "ms (+", elapsedTime, ") ",\r
-        localTime, ": ",\r
-        "</p><p>",\r
-        sourceAndDetail,\r
-        ": </p><p>",\r
-        msg,\r
-        "</p>"] :\r
-\r
-        ["<p><span class='", category, "'>", label, "</span> ",\r
-        totalTime, "ms (+", elapsedTime, ") ",\r
-        localTime, ": ",\r
-        sourceAndDetail, ": ",\r
-        msg,"</p>"];\r
-\r
-    return output.join("");\r
-};\r
-\r
-/**\r
- * Converts input chars "<", ">", and "&" to HTML entities.\r
- *\r
- * @method html2Text\r
- * @param sHtml {String} String to convert.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype.html2Text = function(sHtml) {\r
-    if(sHtml) {\r
-        sHtml += "";\r
-        return sHtml.replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");\r
-    }\r
-    return "";\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Internal class member to index multiple log reader instances.\r
- *\r
- * @property _memberName\r
- * @static\r
- * @type Number\r
- * @default 0\r
- * @private\r
- */\r
-YAHOO.widget.LogReader._index = 0;\r
-\r
-/**\r
- * Name of LogReader instance.\r
- *\r
- * @property _sName\r
- * @type String\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._sName = null;\r
-\r
-/**\r
- * A class member shared by all log readers if a container needs to be\r
- * created during instantiation. Will be null if a container element never needs to\r
- * be created on the fly, such as when the implementer passes in their own element.\r
- *\r
- * @property _elDefaultContainer\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader._elDefaultContainer = null;\r
-\r
-/**\r
- * Buffer of log message objects for batch output.\r
- *\r
- * @property _buffer\r
- * @type Object[]\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._buffer = null;\r
-\r
-/**\r
- * Number of log messages output to console.\r
- *\r
- * @property _consoleMsgCount\r
- * @type Number\r
- * @default 0\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._consoleMsgCount = 0;\r
-\r
-/**\r
- * Date of last output log message.\r
- *\r
- * @property _lastTime\r
- * @type Date\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._lastTime = null;\r
-\r
-/**\r
- * Batched output timeout ID.\r
- *\r
- * @property _timeout\r
- * @type Number\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._timeout = null;\r
-\r
-/**\r
- * Array of filters for log message categories.\r
- *\r
- * @property _categoryFilters\r
- * @type String[]\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._categoryFilters = null;\r
-\r
-/**\r
- * Array of filters for log message sources.\r
- *\r
- * @property _sourceFilters\r
- * @type String[]\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._sourceFilters = null;\r
-\r
-/**\r
- * Log reader container element.\r
- *\r
- * @property _elContainer\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elContainer = null;\r
-\r
-/**\r
- * Log reader header element.\r
- *\r
- * @property _elHd\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elHd = null;\r
-\r
-/**\r
- * Log reader collapse element.\r
- *\r
- * @property _elCollapse\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elCollapse = null;\r
-\r
-/**\r
- * Log reader collapse button element.\r
- *\r
- * @property _btnCollapse\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._btnCollapse = null;\r
-\r
-/**\r
- * Log reader title header element.\r
- *\r
- * @property _title\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._title = null;\r
-\r
-/**\r
- * Log reader console element.\r
- *\r
- * @property _elConsole\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elConsole = null;\r
-\r
-/**\r
- * Log reader footer element.\r
- *\r
- * @property _elFt\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elFt = null;\r
-\r
-/**\r
- * Log reader buttons container element.\r
- *\r
- * @property _elBtns\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elBtns = null;\r
-\r
-/**\r
- * Container element for log reader category filter checkboxes.\r
- *\r
- * @property _elCategoryFilters\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elCategoryFilters = null;\r
-\r
-/**\r
- * Container element for log reader source filter checkboxes.\r
- *\r
- * @property _elSourceFilters\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elSourceFilters = null;\r
-\r
-/**\r
- * Log reader pause button element.\r
- *\r
- * @property _btnPause\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._btnPause = null;\r
-\r
-/**\r
- * Clear button element.\r
- *\r
- * @property _btnClear\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._btnClear = null;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Creates the UI for a category filter in the log reader footer element.\r
- *\r
- * @method _createCategoryCheckbox\r
- * @param sCategory {String} Category name.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._createCategoryCheckbox = function(sCategory) {\r
-    var oSelf = this;\r
-\r
-    if(this._elFt) {\r
-        var elParent = this._elCategoryFilters;\r
-        var filters = this._categoryFilters;\r
-\r
-        var elFilter = elParent.appendChild(document.createElement("span"));\r
-        elFilter.className = "yui-log-filtergrp";\r
-            // Append el at the end so IE 5.5 can set "type" attribute\r
-            // and THEN set checked property\r
-            var chkCategory = document.createElement("input");\r
-            chkCategory.id = "yui-log-filter-" + sCategory + this._sName;\r
-            chkCategory.className = "yui-log-filter-" + sCategory;\r
-            chkCategory.type = "checkbox";\r
-            chkCategory.category = sCategory;\r
-            chkCategory = elFilter.appendChild(chkCategory);\r
-            chkCategory.checked = true;\r
-\r
-            // Add this checked filter to the internal array of filters\r
-            filters.push(sCategory);\r
-            // Subscribe to the click event\r
-            YAHOO.util.Event.addListener(chkCategory,'click',oSelf._onCheckCategory,oSelf);\r
-\r
-            // Create and class the text label\r
-            var lblCategory = elFilter.appendChild(document.createElement("label"));\r
-            lblCategory.htmlFor = chkCategory.id;\r
-            lblCategory.className = sCategory;\r
-            lblCategory.innerHTML = sCategory;\r
-    }\r
-};\r
-\r
-/**\r
- * Creates a checkbox in the log reader footer element to filter by source.\r
- *\r
- * @method _createSourceCheckbox\r
- * @param sSource {String} Source name.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._createSourceCheckbox = function(sSource) {\r
-    var oSelf = this;\r
-\r
-    if(this._elFt) {\r
-        var elParent = this._elSourceFilters;\r
-        var filters = this._sourceFilters;\r
-\r
-        var elFilter = elParent.appendChild(document.createElement("span"));\r
-        elFilter.className = "yui-log-filtergrp";\r
-\r
-        // Append el at the end so IE 5.5 can set "type" attribute\r
-        // and THEN set checked property\r
-        var chkSource = document.createElement("input");\r
-        chkSource.id = "yui-log-filter" + sSource + this._sName;\r
-        chkSource.className = "yui-log-filter" + sSource;\r
-        chkSource.type = "checkbox";\r
-        chkSource.source = sSource;\r
-        chkSource = elFilter.appendChild(chkSource);\r
-        chkSource.checked = true;\r
-\r
-        // Add this checked filter to the internal array of filters\r
-        filters.push(sSource);\r
-        // Subscribe to the click event\r
-        YAHOO.util.Event.addListener(chkSource,'click',oSelf._onCheckSource,oSelf);\r
-\r
-        // Create and class the text label\r
-        var lblSource = elFilter.appendChild(document.createElement("label"));\r
-        lblSource.htmlFor = chkSource.id;\r
-        lblSource.className = sSource;\r
-        lblSource.innerHTML = sSource;\r
-    }\r
-};\r
-\r
-/**\r
- * Reprints all log messages in the stack through filters.\r
- *\r
- * @method _filterLogs\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._filterLogs = function() {\r
-    // Reprint stack with new filters\r
-    if (this._elConsole !== null) {\r
-        this._clearConsole();\r
-        this._printToConsole(YAHOO.widget.Logger.getStack());\r
-    }\r
-};\r
-\r
-/**\r
- * Clears all outputted log messages from the console and resets the time of the\r
- * last output log message.\r
- *\r
- * @method _clearConsole\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._clearConsole = function() {\r
-    // Clear the buffer of any pending messages\r
-    this._timeout = null;\r
-    this._buffer = [];\r
-    this._consoleMsgCount = 0;\r
-\r
-    // Reset the rolling timer\r
-    this._lastTime = YAHOO.widget.Logger.getStartTime();\r
-\r
-    var elConsole = this._elConsole;\r
-    while(elConsole.hasChildNodes()) {\r
-        elConsole.removeChild(elConsole.firstChild);\r
-    }\r
-};\r
-\r
-/**\r
- * Sends buffer of log messages to output and clears buffer.\r
- *\r
- * @method _printBuffer\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._printBuffer = function() {\r
-    this._timeout = null;\r
-\r
-    if(this._elConsole !== null) {\r
-        var thresholdMax = this.thresholdMax;\r
-        thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500;\r
-        if(this._consoleMsgCount < thresholdMax) {\r
-            var entries = [];\r
-            for (var i=0; i<this._buffer.length; i++) {\r
-                entries[i] = this._buffer[i];\r
-            }\r
-            this._buffer = [];\r
-            this._printToConsole(entries);\r
-        }\r
-        else {\r
-            this._filterLogs();\r
-        }\r
-        \r
-        if(!this.newestOnTop) {\r
-            this._elConsole.scrollTop = this._elConsole.scrollHeight;\r
-        }\r
-    }\r
-};\r
-\r
-/**\r
- * Cycles through an array of log messages, and outputs each one to the console\r
- * if its category has not been filtered out.\r
- *\r
- * @method _printToConsole\r
- * @param aEntries {Object[]} Array of LogMsg objects to output to console.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._printToConsole = function(aEntries) {\r
-    // Manage the number of messages displayed in the console\r
-    var entriesLen = aEntries.length;\r
-    var thresholdMin = this.thresholdMin;\r
-    if(isNaN(thresholdMin) || (thresholdMin > this.thresholdMax)) {\r
-        thresholdMin = 0;\r
-    }\r
-    var entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0;\r
-    \r
-    // Iterate through all log entries \r
-    var sourceFiltersLen = this._sourceFilters.length;\r
-    var categoryFiltersLen = this._categoryFilters.length;\r
-    for(var i=entriesStartIndex; i<entriesLen; i++) {\r
-        // Print only the ones that filter through\r
-        var okToPrint = false;\r
-        var okToFilterCats = false;\r
-\r
-        // Get log message details\r
-        var entry = aEntries[i];\r
-        var source = entry.source;\r
-        var category = entry.category;\r
-\r
-        for(var j=0; j<sourceFiltersLen; j++) {\r
-            if(source == this._sourceFilters[j]) {\r
-                okToFilterCats = true;\r
-                break;\r
-            }\r
-        }\r
-        if(okToFilterCats) {\r
-            for(var k=0; k<categoryFiltersLen; k++) {\r
-                if(category == this._categoryFilters[k]) {\r
-                    okToPrint = true;\r
-                    break;\r
-                }\r
-            }\r
-        }\r
-        if(okToPrint) {\r
-            var output = this.formatMsg(entry);\r
-\r
-            // Verbose output uses <code> tag instead of <pre> tag (for wrapping)\r
-            var container = (this.verboseOutput) ? "CODE" : "PRE";\r
-            var oNewElement = (this.newestOnTop) ?\r
-                this._elConsole.insertBefore(\r
-                    document.createElement(container),this._elConsole.firstChild):\r
-                this._elConsole.appendChild(document.createElement(container));\r
-\r
-            oNewElement.innerHTML = output;\r
-            this._consoleMsgCount++;\r
-            this._lastTime = entry.time.getTime();\r
-        }\r
-    }\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private event handlers\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Handles Logger's categoryCreateEvent.\r
- *\r
- * @method _onCategoryCreate\r
- * @param sType {String} The event.\r
- * @param aArgs {Object[]} Data passed from event firer.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onCategoryCreate = function(sType, aArgs, oSelf) {\r
-    var category = aArgs[0];\r
-    if(oSelf._elFt) {\r
-        oSelf._createCategoryCheckbox(category);\r
-    }\r
-};\r
-\r
-/**\r
- * Handles Logger's sourceCreateEvent.\r
- *\r
- * @method _onSourceCreate\r
- * @param sType {String} The event.\r
- * @param aArgs {Object[]} Data passed from event firer.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onSourceCreate = function(sType, aArgs, oSelf) {\r
-    var source = aArgs[0];\r
-    if(oSelf._elFt) {\r
-        oSelf._createSourceCheckbox(source);\r
-    }\r
-};\r
-\r
-/**\r
- * Handles check events on the category filter checkboxes.\r
- *\r
- * @method _onCheckCategory\r
- * @param v {HTMLEvent} The click event.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onCheckCategory = function(v, oSelf) {\r
-    var newFilter = this.category;\r
-    var filtersArray = oSelf._categoryFilters;\r
-\r
-    if(!this.checked) { // Remove category from filters\r
-        for(var i=0; i<filtersArray.length; i++) {\r
-            if(newFilter == filtersArray[i]) {\r
-                filtersArray.splice(i, 1);\r
-                break;\r
-            }\r
-        }\r
-    }\r
-    else { // Add category to filters\r
-        filtersArray.push(newFilter);\r
-    }\r
-    oSelf._filterLogs();\r
-};\r
-\r
-/**\r
- * Handles check events on the category filter checkboxes.\r
- *\r
- * @method _onCheckSource\r
- * @param v {HTMLEvent} The click event.\r
- * @param oSelf {Object} The log reader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onCheckSource = function(v, oSelf) {\r
-    var newFilter = this.source;\r
-    var filtersArray = oSelf._sourceFilters;\r
-\r
-    if(!this.checked) { // Remove category from filters\r
-        for(var i=0; i<filtersArray.length; i++) {\r
-            if(newFilter == filtersArray[i]) {\r
-                filtersArray.splice(i, 1);\r
-                break;\r
-            }\r
-        }\r
-    }\r
-    else { // Add category to filters\r
-        filtersArray.push(newFilter);\r
-    }\r
-    oSelf._filterLogs();\r
-};\r
-\r
-/**\r
- * Handles click events on the collapse button.\r
- *\r
- * @method _onClickCollapseBtn\r
- * @param v {HTMLEvent} The click event.\r
- * @param oSelf {Object} The LogReader instance\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onClickCollapseBtn = function(v, oSelf) {\r
-    var btn = oSelf._btnCollapse;\r
-    if(btn.value == "Expand") {\r
-        oSelf._elConsole.style.display = "block";\r
-        if(oSelf._elFt) {\r
-            oSelf._elFt.style.display = "block";\r
-        }\r
-        btn.value = "Collapse";\r
-    }\r
-    else {\r
-        oSelf._elConsole.style.display = "none";\r
-        if(oSelf._elFt) {\r
-            oSelf._elFt.style.display = "none";\r
-        }\r
-        btn.value = "Expand";\r
-    }\r
-};\r
-\r
-/**\r
- * Handles click events on the pause button.\r
- *\r
- * @method _onClickPauseBtn\r
- * @param v {HTMLEvent} The click event.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onClickPauseBtn = function(v, oSelf) {\r
-    var btn = oSelf._btnPause;\r
-    if(btn.value == "Resume") {\r
-        oSelf.resume();\r
-        btn.value = "Pause";\r
-    }\r
-    else {\r
-        oSelf.pause();\r
-        btn.value = "Resume";\r
-    }\r
-};\r
-\r
-/**\r
- * Handles click events on the clear button.\r
- *\r
- * @method _onClickClearBtn\r
- * @param v {HTMLEvent} The click event.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onClickClearBtn = function(v, oSelf) {\r
-    oSelf._clearConsole();\r
-};\r
-\r
-/**\r
- * Handles Logger's newLogEvent.\r
- *\r
- * @method _onNewLog\r
- * @param sType {String} The event.\r
- * @param aArgs {Object[]} Data passed from event firer.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onNewLog = function(sType, aArgs, oSelf) {\r
-    var logEntry = aArgs[0];\r
-    oSelf._buffer.push(logEntry);\r
-\r
-    if (oSelf.logReaderEnabled === true && oSelf._timeout === null) {\r
-        oSelf._timeout = setTimeout(function(){oSelf._printBuffer();}, 100);\r
-    }\r
-};\r
-\r
-/**\r
- * Handles Logger's resetEvent.\r
- *\r
- * @method _onReset\r
- * @param sType {String} The event.\r
- * @param aArgs {Object[]} Data passed from event firer.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onReset = function(sType, aArgs, oSelf) {\r
-    oSelf._filterLogs();\r
-};\r
- /**\r
- * The Logger widget provides a simple way to read or write log messages in\r
- * JavaScript code. Integration with the YUI Library's debug builds allow\r
- * implementers to access under-the-hood events, errors, and debugging messages.\r
- * Output may be read through a LogReader console and/or output to a browser\r
- * console.\r
- *\r
- * @module logger\r
- * @requires yahoo, event, dom\r
- * @optional dragdrop\r
- * @namespace YAHOO.widget\r
- * @title Logger Widget\r
- */\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * The singleton Logger class provides core log management functionality. Saves\r
- * logs written through the global YAHOO.log function or written by a LogWriter\r
- * instance. Provides access to logs for reading by a LogReader instance or\r
- * native browser console such as the Firebug extension to Firefox or Safari's\r
- * JavaScript console through integration with the console.log() method.\r
- *\r
- * @class Logger\r
- * @static\r
- */\r
-YAHOO.widget.Logger = {\r
-    // Initialize members\r
-    loggerEnabled: true,\r
-    _browserConsoleEnabled: false,\r
-    categories: ["info","warn","error","time","window"],\r
-    sources: ["global"],\r
-    _stack: [], // holds all log msgs\r
-    maxStackEntries: 2500,\r
-    _startTime: new Date().getTime(), // static start timestamp\r
-    _lastTime: null // timestamp of last logged message\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-/**\r
- * Saves a log message to the stack and fires newLogEvent. If the log message is\r
- * assigned to an unknown category, creates a new category. If the log message is\r
- * from an unknown source, creates a new source.  If browser console is enabled,\r
- * outputs the log message to browser console.\r
- *\r
- * @method log\r
- * @param sMsg {String} The log message.\r
- * @param sCategory {String} Category of log message, or null.\r
- * @param sSource {String} Source of LogWriter, or null if global.\r
- */\r
-YAHOO.widget.Logger.log = function(sMsg, sCategory, sSource) {\r
-    if(this.loggerEnabled) {\r
-        if(!sCategory) {\r
-            sCategory = "info"; // default category\r
-        }\r
-        else {\r
-            sCategory = sCategory.toLocaleLowerCase();\r
-            if(this._isNewCategory(sCategory)) {\r
-                this._createNewCategory(sCategory);\r
-            }\r
-        }\r
-        var sClass = "global"; // default source\r
-        var sDetail = null;\r
-        if(sSource) {\r
-            var spaceIndex = sSource.indexOf(" ");\r
-            if(spaceIndex > 0) {\r
-                // Substring until first space\r
-                sClass = sSource.substring(0,spaceIndex);\r
-                // The rest of the source\r
-                sDetail = sSource.substring(spaceIndex,sSource.length);\r
-            }\r
-            else {\r
-                sClass = sSource;\r
-            }\r
-            if(this._isNewSource(sClass)) {\r
-                this._createNewSource(sClass);\r
-            }\r
-        }\r
-\r
-        var timestamp = new Date();\r
-        var logEntry = new YAHOO.widget.LogMsg({\r
-            msg: sMsg,\r
-            time: timestamp,\r
-            category: sCategory,\r
-            source: sClass,\r
-            sourceDetail: sDetail\r
-        });\r
-\r
-        var stack = this._stack;\r
-        var maxStackEntries = this.maxStackEntries;\r
-        if(maxStackEntries && !isNaN(maxStackEntries) &&\r
-            (stack.length >= maxStackEntries)) {\r
-            stack.shift();\r
-        }\r
-        stack.push(logEntry);\r
-        this.newLogEvent.fire(logEntry);\r
-\r
-        if(this._browserConsoleEnabled) {\r
-            this._printToBrowserConsole(logEntry);\r
-        }\r
-        return true;\r
-    }\r
-    else {\r
-        return false;\r
-    }\r
-};\r
-\r
-/**\r
- * Resets internal stack and startTime, enables Logger, and fires logResetEvent.\r
- *\r
- * @method reset\r
- */\r
-YAHOO.widget.Logger.reset = function() {\r
-    this._stack = [];\r
-    this._startTime = new Date().getTime();\r
-    this.loggerEnabled = true;\r
-    this.log("Logger reset");\r
-    this.logResetEvent.fire();\r
-};\r
-\r
-/**\r
- * Public accessor to internal stack of log message objects.\r
- *\r
- * @method getStack\r
- * @return {Object[]} Array of log message objects.\r
- */\r
-YAHOO.widget.Logger.getStack = function() {\r
-    return this._stack;\r
-};\r
-\r
-/**\r
- * Public accessor to internal start time.\r
- *\r
- * @method getStartTime\r
- * @return {Date} Internal date of when Logger singleton was initialized.\r
- */\r
-YAHOO.widget.Logger.getStartTime = function() {\r
-    return this._startTime;\r
-};\r
-\r
-/**\r
- * Disables output to the browser's global console.log() function, which is used\r
- * by the Firebug extension to Firefox as well as Safari.\r
- *\r
- * @method disableBrowserConsole\r
- */\r
-YAHOO.widget.Logger.disableBrowserConsole = function() {\r
-    YAHOO.log("Logger output to the function console.log() has been disabled.");\r
-    this._browserConsoleEnabled = false;\r
-};\r
-\r
-/**\r
- * Enables output to the browser's global console.log() function, which is used\r
- * by the Firebug extension to Firefox as well as Safari.\r
- *\r
- * @method enableBrowserConsole\r
- */\r
-YAHOO.widget.Logger.enableBrowserConsole = function() {\r
-    this._browserConsoleEnabled = true;\r
-    YAHOO.log("Logger output to the function console.log() has been enabled.");\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public events\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
- /**\r
- * Fired when a new category has been created.\r
- *\r
- * @event categoryCreateEvent\r
- * @param sCategory {String} Category name.\r
- */\r
-YAHOO.widget.Logger.categoryCreateEvent =\r
-    new YAHOO.util.CustomEvent("categoryCreate", this, true);\r
-\r
- /**\r
- * Fired when a new source has been named.\r
- *\r
- * @event sourceCreateEvent\r
- * @param sSource {String} Source name.\r
- */\r
-YAHOO.widget.Logger.sourceCreateEvent =\r
-    new YAHOO.util.CustomEvent("sourceCreate", this, true);\r
-\r
- /**\r
- * Fired when a new log message has been created.\r
- *\r
- * @event newLogEvent\r
- * @param sMsg {String} Log message.\r
- */\r
-YAHOO.widget.Logger.newLogEvent = new YAHOO.util.CustomEvent("newLog", this, true);\r
-\r
-/**\r
- * Fired when the Logger has been reset has been created.\r
- *\r
- * @event logResetEvent\r
- */\r
-YAHOO.widget.Logger.logResetEvent = new YAHOO.util.CustomEvent("logReset", this, true);\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Creates a new category of log messages and fires categoryCreateEvent.\r
- *\r
- * @method _createNewCategory\r
- * @param sCategory {String} Category name.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._createNewCategory = function(sCategory) {\r
-    this.categories.push(sCategory);\r
-    this.categoryCreateEvent.fire(sCategory);\r
-};\r
-\r
-/**\r
- * Checks to see if a category has already been created.\r
- *\r
- * @method _isNewCategory\r
- * @param sCategory {String} Category name.\r
- * @return {Boolean} Returns true if category is unknown, else returns false.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._isNewCategory = function(sCategory) {\r
-    for(var i=0; i < this.categories.length; i++) {\r
-        if(sCategory == this.categories[i]) {\r
-            return false;\r
-        }\r
-    }\r
-    return true;\r
-};\r
-\r
-/**\r
- * Creates a new source of log messages and fires sourceCreateEvent.\r
- *\r
- * @method _createNewSource\r
- * @param sSource {String} Source name.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._createNewSource = function(sSource) {\r
-    this.sources.push(sSource);\r
-    this.sourceCreateEvent.fire(sSource);\r
-};\r
-\r
-/**\r
- * Checks to see if a source already exists.\r
- *\r
- * @method _isNewSource\r
- * @param sSource {String} Source name.\r
- * @return {Boolean} Returns true if source is unknown, else returns false.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._isNewSource = function(sSource) {\r
-    if(sSource) {\r
-        for(var i=0; i < this.sources.length; i++) {\r
-            if(sSource == this.sources[i]) {\r
-                return false;\r
-            }\r
-        }\r
-        return true;\r
-    }\r
-};\r
-\r
-/**\r
- * Outputs a log message to global console.log() function.\r
- *\r
- * @method _printToBrowserConsole\r
- * @param oEntry {Object} Log entry object.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._printToBrowserConsole = function(oEntry) {\r
-    if(window.console && console.log) {\r
-        var category = oEntry.category;\r
-        var label = oEntry.category.substring(0,4).toUpperCase();\r
-\r
-        var time = oEntry.time;\r
-        if (time.toLocaleTimeString) {\r
-            var localTime  = time.toLocaleTimeString();\r
-        }\r
-        else {\r
-            localTime = time.toString();\r
-        }\r
-\r
-        var msecs = time.getTime();\r
-        var elapsedTime = (YAHOO.widget.Logger._lastTime) ?\r
-            (msecs - YAHOO.widget.Logger._lastTime) : 0;\r
-        YAHOO.widget.Logger._lastTime = msecs;\r
-\r
-        var output =\r
-            localTime + " (" +\r
-            elapsedTime + "ms): " +\r
-            oEntry.source + ": " +\r
-            oEntry.msg;\r
-\r
-        console.log(output);\r
-    }\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private event handlers\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Handles logging of messages due to window error events.\r
- *\r
- * @method _onWindowError\r
- * @param sMsg {String} The error message.\r
- * @param sUrl {String} URL of the error.\r
- * @param sLine {String} Line number of the error.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._onWindowError = function(sMsg,sUrl,sLine) {\r
-    // Logger is not in scope of this event handler\r
-    try {\r
-        YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')', "window");\r
-        if(YAHOO.widget.Logger._origOnWindowError) {\r
-            YAHOO.widget.Logger._origOnWindowError();\r
-        }\r
-    }\r
-    catch(e) {\r
-        return false;\r
-    }\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Enable handling of native JavaScript errors\r
-// NB: Not all browsers support the window.onerror event\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-if(window.onerror) {\r
-    // Save any previously defined handler to call\r
-    YAHOO.widget.Logger._origOnWindowError = window.onerror;\r
-}\r
-window.onerror = YAHOO.widget.Logger._onWindowError;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// First log\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-YAHOO.widget.Logger.log("Logger initialized");\r
-\r
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The LogMsg class defines a single log message.
+ *
+ * @class LogMsg
+ * @constructor
+ * @param oConfigs {Object} Object literal of configuration params.
+ */
+ YAHOO.widget.LogMsg = function(oConfigs) {
+    // Parse configs
+    if (oConfigs && (oConfigs.constructor == Object)) {
+        for(var param in oConfigs) {
+            this[param] = oConfigs[param];
+        }
+    }
+ };
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Log message.
+ *
+ * @property msg
+ * @type String
+ */
+YAHOO.widget.LogMsg.prototype.msg = null;
+/**
+ * Log timestamp.
+ *
+ * @property time
+ * @type Date
+ */
+YAHOO.widget.LogMsg.prototype.time = null;
+
+/**
+ * Log category.
+ *
+ * @property category
+ * @type String
+ */
+YAHOO.widget.LogMsg.prototype.category = null;
+
+/**
+ * Log source. The first word passed in as the source argument.
+ *
+ * @property source
+ * @type String
+ */
+YAHOO.widget.LogMsg.prototype.source = null;
+
+/**
+ * Log source detail. The remainder of the string passed in as the source argument, not
+ * including the first word (if any).
+ *
+ * @property sourceDetail
+ * @type String
+ */
+YAHOO.widget.LogMsg.prototype.sourceDetail = null;
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The LogWriter class provides a mechanism to log messages through
+ * YAHOO.widget.Logger from a named source.
+ *
+ * @class LogWriter
+ * @constructor
+ * @param sSource {String} Source of LogWriter instance.
+ */
+YAHOO.widget.LogWriter = function(sSource) {
+    if(!sSource) {
+        YAHOO.log("Could not instantiate LogWriter due to invalid source.",
+            "error", "LogWriter");
+        return;
+    }
+    this._source = sSource;
+ };
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Public accessor to the unique name of the LogWriter instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the LogWriter instance.
+ */
+YAHOO.widget.LogWriter.prototype.toString = function() {
+    return "LogWriter " + this._sSource;
+};
+
+/**
+ * Logs a message attached to the source of the LogWriter.
+ *
+ * @method log
+ * @param sMsg {String} The log message.
+ * @param sCategory {String} Category name.
+ */
+YAHOO.widget.LogWriter.prototype.log = function(sMsg, sCategory) {
+    YAHOO.widget.Logger.log(sMsg, sCategory, this._source);
+};
+
+/**
+ * Public accessor to get the source name.
+ *
+ * @method getSource
+ * @return {String} The LogWriter source.
+ */
+YAHOO.widget.LogWriter.prototype.getSource = function() {
+    return this._sSource;
+};
+
+/**
+ * Public accessor to set the source name.
+ *
+ * @method setSource
+ * @param sSource {String} Source of LogWriter instance.
+ */
+YAHOO.widget.LogWriter.prototype.setSource = function(sSource) {
+    if(!sSource) {
+        YAHOO.log("Could not set source due to invalid source.", "error", this.toString());
+        return;
+    }
+    else {
+        this._sSource = sSource;
+    }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Source of the LogWriter instance.
+ *
+ * @property _source
+ * @type String
+ * @private
+ */
+YAHOO.widget.LogWriter.prototype._source = null;
+
+
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The LogReader class provides UI to read messages logged to YAHOO.widget.Logger.
+ *
+ * @class LogReader
+ * @constructor
+ * @param elContainer {HTMLElement} (optional) DOM element reference of an existing DIV.
+ * @param elContainer {String} (optional) String ID of an existing DIV.
+ * @param oConfigs {Object} (optional) Object literal of configuration params.
+ */
+YAHOO.widget.LogReader = function(elContainer, oConfigs) {
+    this._sName = YAHOO.widget.LogReader._index;
+    YAHOO.widget.LogReader._index++;
+    
+    // Internal vars
+    this._buffer = []; // output buffer
+    this._filterCheckboxes = {}; // pointers to checkboxes
+    this._lastTime = YAHOO.widget.Logger.getStartTime(); // timestamp of last log message to console
+
+    // Parse config vars here
+    if (oConfigs && (oConfigs.constructor == Object)) {
+        for(var param in oConfigs) {
+            this[param] = oConfigs[param];
+        }
+    }
+
+    this._initContainerEl(elContainer);
+    if(!this._elContainer) {
+        YAHOO.log("Could not instantiate LogReader due to an invalid container element " +
+                elContainer, "error", this.toString());
+        return;
+    }
+    
+    this._initHeaderEl();
+    this._initConsoleEl();
+    this._initFooterEl();
+
+    this._initDragDrop();
+
+    this._initCategories();
+    this._initSources();
+
+    // Subscribe to Logger custom events
+    YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog, this);
+    YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset, this);
+
+    YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate, this);
+    YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate, this);
+
+    this._filterLogs();
+    YAHOO.log("LogReader initialized", null, this.toString());
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Whether or not LogReader is enabled to output log messages.
+ *
+ * @property logReaderEnabled
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.LogReader.prototype.logReaderEnabled = true;
+
+/**
+ * Public member to access CSS width of the LogReader container.
+ *
+ * @property width
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.width = null;
+
+/**
+ * Public member to access CSS height of the LogReader container.
+ *
+ * @property height
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.height = null;
+
+/**
+ * Public member to access CSS top position of the LogReader container.
+ *
+ * @property top
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.top = null;
+
+/**
+ * Public member to access CSS left position of the LogReader container.
+ *
+ * @property left
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.left = null;
+
+/**
+ * Public member to access CSS right position of the LogReader container.
+ *
+ * @property right
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.right = null;
+
+/**
+ * Public member to access CSS bottom position of the LogReader container.
+ *
+ * @property bottom
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.bottom = null;
+
+/**
+ * Public member to access CSS font size of the LogReader container.
+ *
+ * @property fontSize
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.fontSize = null;
+
+/**
+ * Whether or not the footer UI is enabled for the LogReader.
+ *
+ * @property footerEnabled
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.LogReader.prototype.footerEnabled = true;
+
+/**
+ * Whether or not output is verbose (more readable). Setting to true will make
+ * output more compact (less readable).
+ *
+ * @property verboseOutput
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.LogReader.prototype.verboseOutput = true;
+
+/**
+ * Whether or not newest message is printed on top.
+ *
+ * @property newestOnTop
+ * @type Boolean
+ */
+YAHOO.widget.LogReader.prototype.newestOnTop = true;
+
+/**
+ * Output timeout buffer in milliseconds.
+ *
+ * @property outputBuffer
+ * @type Number
+ * @default 100
+ */
+YAHOO.widget.LogReader.prototype.outputBuffer = 100;
+
+/**
+ * Maximum number of messages a LogReader console will display.
+ *
+ * @property thresholdMax
+ * @type Number
+ * @default 500
+ */
+YAHOO.widget.LogReader.prototype.thresholdMax = 500;
+
+/**
+ * When a LogReader console reaches its thresholdMax, it will clear out messages
+ * and print out the latest thresholdMin number of messages.
+ *
+ * @property thresholdMin
+ * @type Number
+ * @default 100
+ */
+YAHOO.widget.LogReader.prototype.thresholdMin = 100;
+
+/**
+ * True when LogReader is in a collapsed state, false otherwise.
+ *
+ * @property isCollapsed
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.LogReader.prototype.isCollapsed = false;
+
+/**
+ * True when LogReader is in a paused state, false otherwise.
+ *
+ * @property isPaused
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.LogReader.prototype.isPaused = false;
+
+/**
+ * Enables draggable LogReader if DragDrop Utility is present.
+ *
+ * @property draggable
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.LogReader.prototype.draggable = true;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Public accessor to the unique name of the LogReader instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the LogReader instance.
+ */
+YAHOO.widget.LogReader.prototype.toString = function() {
+    return "LogReader instance" + this._sName;
+};
+/**
+ * Pauses output of log messages. While paused, log messages are not lost, but
+ * get saved to a buffer and then output upon resume of LogReader.
+ *
+ * @method pause
+ */
+YAHOO.widget.LogReader.prototype.pause = function() {
+    this.isPaused = true;
+    this._btnPause.value = "Resume";
+    this._timeout = null;
+    this.logReaderEnabled = false;
+};
+
+/**
+ * Resumes output of log messages, including outputting any log messages that
+ * have been saved to buffer while paused.
+ *
+ * @method resume
+ */
+YAHOO.widget.LogReader.prototype.resume = function() {
+    this.isPaused = false;
+    this._btnPause.value = "Pause";
+    this.logReaderEnabled = true;
+    this._printBuffer();
+};
+
+/**
+ * Hides UI of LogReader. Logging functionality is not disrupted.
+ *
+ * @method hide
+ */
+YAHOO.widget.LogReader.prototype.hide = function() {
+    this._elContainer.style.display = "none";
+};
+
+/**
+ * Shows UI of LogReader. Logging functionality is not disrupted.
+ *
+ * @method show
+ */
+YAHOO.widget.LogReader.prototype.show = function() {
+    this._elContainer.style.display = "block";
+};
+
+/**
+ * Collapses UI of LogReader. Logging functionality is not disrupted.
+ *
+ * @method collapse
+ */
+YAHOO.widget.LogReader.prototype.collapse = function() {
+    this._elConsole.style.display = "none";
+    if(this._elFt) {
+        this._elFt.style.display = "none";
+    }
+    this._btnCollapse.value = "Expand";
+    this.isCollapsed = true;
+};
+
+/**
+ * Expands UI of LogReader. Logging functionality is not disrupted.
+ *
+ * @method expand
+ */
+YAHOO.widget.LogReader.prototype.expand = function() {
+    this._elConsole.style.display = "block";
+    if(this._elFt) {
+        this._elFt.style.display = "block";
+    }
+    this._btnCollapse.value = "Collapse";
+    this.isCollapsed = false;
+};
+
+/**
+ * Returns related checkbox element for given filter (i.e., category or source).
+ *
+ * @method getCheckbox
+ * @param {String} Category or source name.
+ * @return {Array} Array of all filter checkboxes.
+ */
+YAHOO.widget.LogReader.prototype.getCheckbox = function(filter) {
+    return this._filterCheckboxes[filter];
+};
+
+/**
+ * Returns array of enabled categories.
+ *
+ * @method getCategories
+ * @return {String[]} Array of enabled categories.
+ */
+YAHOO.widget.LogReader.prototype.getCategories = function() {
+    return this._categoryFilters;
+};
+
+/**
+ * Shows log messages associated with given category.
+ *
+ * @method showCategory
+ * @param {String} Category name.
+ */
+YAHOO.widget.LogReader.prototype.showCategory = function(sCategory) {
+    var filtersArray = this._categoryFilters;
+    // Don't do anything if category is already enabled
+    // Use Array.indexOf if available...
+    if(filtersArray.indexOf) {
+         if(filtersArray.indexOf(sCategory) >  -1) {
+            return;
+        }
+    }
+    // ...or do it the old-fashioned way
+    else {
+        for(var i=0; i<filtersArray.length; i++) {
+           if(filtersArray[i] === sCategory){
+                return;
+            }
+        }
+    }
+
+    this._categoryFilters.push(sCategory);
+    this._filterLogs();
+    var elCheckbox = this.getCheckbox(sCategory);
+    if(elCheckbox) {
+        elCheckbox.checked = true;
+    }
+};
+
+/**
+ * Hides log messages associated with given category.
+ *
+ * @method hideCategory
+ * @param {String} Category name.
+ */
+YAHOO.widget.LogReader.prototype.hideCategory = function(sCategory) {
+    var filtersArray = this._categoryFilters;
+    for(var i=0; i<filtersArray.length; i++) {
+        if(sCategory == filtersArray[i]) {
+            filtersArray.splice(i, 1);
+            break;
+        }
+    }
+    this._filterLogs();
+    var elCheckbox = this.getCheckbox(sCategory);
+    if(elCheckbox) {
+        elCheckbox.checked = false;
+    }
+};
+
+/**
+ * Returns array of enabled sources.
+ *
+ * @method getSources
+ * @return {Array} Array of enabled sources.
+ */
+YAHOO.widget.LogReader.prototype.getSources = function() {
+    return this._sourceFilters;
+};
+
+/**
+ * Shows log messages associated with given source.
+ *
+ * @method showSource
+ * @param {String} Source name.
+ */
+YAHOO.widget.LogReader.prototype.showSource = function(sSource) {
+    var filtersArray = this._sourceFilters;
+    // Don't do anything if category is already enabled
+    // Use Array.indexOf if available...
+    if(filtersArray.indexOf) {
+         if(filtersArray.indexOf(sSource) >  -1) {
+            return;
+        }
+    }
+    // ...or do it the old-fashioned way
+    else {
+        for(var i=0; i<filtersArray.length; i++) {
+           if(sSource == filtersArray[i]){
+                return;
+            }
+        }
+    }
+    filtersArray.push(sSource);
+    this._filterLogs();
+    var elCheckbox = this.getCheckbox(sSource);
+    if(elCheckbox) {
+        elCheckbox.checked = true;
+    }
+};
+
+/**
+ * Hides log messages associated with given source.
+ *
+ * @method hideSource
+ * @param {String} Source name.
+ */
+YAHOO.widget.LogReader.prototype.hideSource = function(sSource) {
+    var filtersArray = this._sourceFilters;
+    for(var i=0; i<filtersArray.length; i++) {
+        if(sSource == filtersArray[i]) {
+            filtersArray.splice(i, 1);
+            break;
+        }
+    }
+    this._filterLogs();
+    var elCheckbox = this.getCheckbox(sSource);
+    if(elCheckbox) {
+        elCheckbox.checked = false;
+    }
+};
+
+/**
+ * Does not delete any log messages, but clears all printed log messages from
+ * the console. Log messages will be printed out again if user re-filters. The
+ * static method YAHOO.widget.Logger.reset() should be called in order to
+ * actually delete log messages.
+ *
+ * @method clearConsole
+ */
+YAHOO.widget.LogReader.prototype.clearConsole = function() {
+    // Clear the buffer of any pending messages
+    this._timeout = null;
+    this._buffer = [];
+    this._consoleMsgCount = 0;
+
+    var elConsole = this._elConsole;
+    while(elConsole.hasChildNodes()) {
+        elConsole.removeChild(elConsole.firstChild);
+    }
+};
+
+/**
+ * Updates title to given string.
+ *
+ * @method setTitle
+ * @param sTitle {String} New title.
+ */
+YAHOO.widget.LogReader.prototype.setTitle = function(sTitle) {
+    this._title.innerHTML = this.html2Text(sTitle);
+};
+
+/**
+ * Gets timestamp of the last log.
+ *
+ * @method getLastTime
+ * @return {Date} Timestamp of the last log.
+ */
+YAHOO.widget.LogReader.prototype.getLastTime = function() {
+    return this._lastTime;
+};
+
+/**
+ * Formats message string to HTML for output to console.
+ *
+ * @method formatMsg
+ * @param oLogMsg {Object} Log message object.
+ * @return {String} HTML-formatted message for output to console.
+ */
+YAHOO.widget.LogReader.prototype.formatMsg = function(oLogMsg) {
+    var category = oLogMsg.category;
+    
+    // Label for color-coded display
+    var label = category.substring(0,4).toUpperCase();
+
+    // Calculate the elapsed time to be from the last item that passed through the filter,
+    // not the absolute previous item in the stack
+
+    var time = oLogMsg.time;
+    if (time.toLocaleTimeString) {
+        var localTime  = time.toLocaleTimeString();
+    }
+    else {
+        localTime = time.toString();
+    }
+
+    var msecs = time.getTime();
+    var startTime = YAHOO.widget.Logger.getStartTime();
+    var totalTime = msecs - startTime;
+    var elapsedTime = msecs - this.getLastTime();
+
+    var source = oLogMsg.source;
+    var sourceDetail = oLogMsg.sourceDetail;
+    var sourceAndDetail = (sourceDetail) ?
+        source + " " + sourceDetail : source;
+        
+    
+    // Escape HTML entities in the log message itself for output to console
+    //var msg = this.html2Text(oLogMsg.msg); //TODO: delete
+    var msg = this.html2Text(YAHOO.lang.dump(oLogMsg.msg));
+
+    // Verbose output includes extra line breaks
+    var output =  (this.verboseOutput) ?
+        ["<pre class=\"yui-log-verbose\"><p><span class='", category, "'>", label, "</span> ",
+        totalTime, "ms (+", elapsedTime, ") ",
+        localTime, ": ",
+        "</p><p>",
+        sourceAndDetail,
+        ": </p><p>",
+        msg,
+        "</p></pre>"] :
+
+        ["<pre><p><span class='", category, "'>", label, "</span> ",
+        totalTime, "ms (+", elapsedTime, ") ",
+        localTime, ": ",
+        sourceAndDetail, ": ",
+        msg, "</p></pre>"];
+
+    return output.join("");
+};
+
+/**
+ * Converts input chars "<", ">", and "&" to HTML entities.
+ *
+ * @method html2Text
+ * @param sHtml {String} String to convert.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype.html2Text = function(sHtml) {
+    if(sHtml) {
+        sHtml += "";
+        return sHtml.replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");
+    }
+    return "";
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class member to index multiple LogReader instances.
+ *
+ * @property _memberName
+ * @static
+ * @type Number
+ * @default 0
+ * @private
+ */
+YAHOO.widget.LogReader._index = 0;
+
+/**
+ * Name of LogReader instance.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._sName = null;
+
+//TODO: remove
+/**
+ * A class member shared by all LogReaders if a container needs to be
+ * created during instantiation. Will be null if a container element never needs to
+ * be created on the fly, such as when the implementer passes in their own element.
+ *
+ * @property _elDefaultContainer
+ * @type HTMLElement
+ * @private
+ */
+//YAHOO.widget.LogReader._elDefaultContainer = null;
+
+/**
+ * Buffer of log message objects for batch output.
+ *
+ * @property _buffer
+ * @type Object[]
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._buffer = null;
+
+/**
+ * Number of log messages output to console.
+ *
+ * @property _consoleMsgCount
+ * @type Number
+ * @default 0
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._consoleMsgCount = 0;
+
+/**
+ * Date of last output log message.
+ *
+ * @property _lastTime
+ * @type Date
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._lastTime = null;
+
+/**
+ * Batched output timeout ID.
+ *
+ * @property _timeout
+ * @type Number
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._timeout = null;
+
+/**
+ * Hash of filters and their related checkbox elements.
+ *
+ * @property _filterCheckboxes
+ * @type Object
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._filterCheckboxes = null;
+
+/**
+ * Array of filters for log message categories.
+ *
+ * @property _categoryFilters
+ * @type String[]
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._categoryFilters = null;
+
+/**
+ * Array of filters for log message sources.
+ *
+ * @property _sourceFilters
+ * @type String[]
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._sourceFilters = null;
+
+/**
+ * LogReader container element.
+ *
+ * @property _elContainer
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elContainer = null;
+
+/**
+ * LogReader header element.
+ *
+ * @property _elHd
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elHd = null;
+
+/**
+ * LogReader collapse element.
+ *
+ * @property _elCollapse
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elCollapse = null;
+
+/**
+ * LogReader collapse button element.
+ *
+ * @property _btnCollapse
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._btnCollapse = null;
+
+/**
+ * LogReader title header element.
+ *
+ * @property _title
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._title = null;
+
+/**
+ * LogReader console element.
+ *
+ * @property _elConsole
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elConsole = null;
+
+/**
+ * LogReader footer element.
+ *
+ * @property _elFt
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elFt = null;
+
+/**
+ * LogReader buttons container element.
+ *
+ * @property _elBtns
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elBtns = null;
+
+/**
+ * Container element for LogReader category filter checkboxes.
+ *
+ * @property _elCategoryFilters
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elCategoryFilters = null;
+
+/**
+ * Container element for LogReader source filter checkboxes.
+ *
+ * @property _elSourceFilters
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elSourceFilters = null;
+
+/**
+ * LogReader pause button element.
+ *
+ * @property _btnPause
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._btnPause = null;
+
+/**
+ * Clear button element.
+ *
+ * @property _btnClear
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._btnClear = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Initializes the primary container element.
+ *
+ * @method _initContainerEl
+ * @param elContainer {HTMLElement} Container element by reference or string ID.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initContainerEl = function(elContainer) {
+    // Validate container
+    elContainer = YAHOO.util.Dom.get(elContainer);
+    // Attach to existing container...
+    if(elContainer && elContainer.tagName && (elContainer.tagName.toLowerCase() == "div")) {
+        this._elContainer = elContainer;
+        YAHOO.util.Dom.addClass(this._elContainer,"yui-log");
+    }
+    // ...or create container from scratch
+    else {
+        this._elContainer = document.body.appendChild(document.createElement("div"));
+        //this._elContainer.id = "yui-log" + this._sName;
+        YAHOO.util.Dom.addClass(this._elContainer,"yui-log");
+        YAHOO.util.Dom.addClass(this._elContainer,"yui-log-container");
+
+        //YAHOO.widget.LogReader._elDefaultContainer = this._elContainer;
+
+        // If implementer has provided container values, trust and set those
+        var containerStyle = this._elContainer.style;
+        if(this.width) {
+            containerStyle.width = this.width;
+        }
+        if(this.right) {
+            containerStyle.right = this.right;
+        }
+        if(this.top) {
+            containerStyle.top = this.top;
+        }
+         if(this.left) {
+            containerStyle.left = this.left;
+            containerStyle.right = "auto";
+        }
+        if(this.bottom) {
+            containerStyle.bottom = this.bottom;
+            containerStyle.top = "auto";
+        }
+       if(this.fontSize) {
+            containerStyle.fontSize = this.fontSize;
+        }
+        // For Opera
+        if(navigator.userAgent.toLowerCase().indexOf("opera") != -1) {
+            document.body.style += '';
+        }
+    }
+};
+
+/**
+ * Initializes the header element.
+ *
+ * @method _initHeaderEl
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initHeaderEl = function() {
+    var oSelf = this;
+
+    // Destroy header
+    if(this._elHd) {
+        // Unhook DOM events
+        YAHOO.util.Event.purgeElement(this._elHd, true);
+
+        // Remove DOM elements
+        this._elHd.innerHTML = "";
+    }
+    
+    // Create header
+    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";
+};
+
+/**
+ * Initializes the console element.
+ *
+ * @method _initConsoleEl
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initConsoleEl = function() {
+    // Destroy console
+    if(this._elConsole) {
+        // Unhook DOM events
+        YAHOO.util.Event.purgeElement(this._elConsole, true);
+
+        // Remove DOM elements
+        this._elConsole.innerHTML = "";
+    }
+
+    // Ceate console
+    this._elConsole = this._elContainer.appendChild(document.createElement("div"));
+    this._elConsole.className = "yui-log-bd";
+
+    // If implementer has provided console, trust and set those
+    if(this.height) {
+        this._elConsole.style.height = this.height;
+    }
+};
+
+/**
+ * Initializes the footer element.
+ *
+ * @method _initFooterEl
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initFooterEl = function() {
+    var oSelf = this;
+
+    // Don't create footer elements if footer is disabled
+    if(this.footerEnabled) {
+        // Destroy console
+        if(this._elFt) {
+            // Unhook DOM events
+            YAHOO.util.Event.purgeElement(this._elFt, true);
+
+            // Remove DOM elements
+            this._elFt.innerHTML = "";
+        }
+
+        this._elFt = this._elContainer.appendChild(document.createElement("div"));
+        this._elFt.className = "yui-log-ft";
+
+        this._elBtns = this._elFt.appendChild(document.createElement("div"));
+        this._elBtns.className = "yui-log-btns";
+
+        this._btnPause = document.createElement("input");
+        this._btnPause.type = "button";
+        //this._btnPause.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";
+    }
+};
+
+/**
+ * Initializes Drag and Drop on the header element.
+ *
+ * @method _initDragDrop
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initDragDrop = function() {
+    // If Drag and Drop utility is available...
+    // ...and draggable is true...
+    // ...then make the header draggable
+    if(YAHOO.util.DD && this.draggable && this._elHd) {
+        var ylog_dd = new YAHOO.util.DD(this._elContainer);
+        ylog_dd.setHandleElId(this._elHd.id);
+        //TODO: use class name
+        this._elHd.style.cursor = "move";
+    }
+};
+
+/**
+ * Initializes category filters.
+ *
+ * @method _initCategories
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initCategories = function() {
+    // Initialize category filters
+    this._categoryFilters = [];
+    var aInitialCategories = YAHOO.widget.Logger.categories;
+
+    for(var j=0; j < aInitialCategories.length; j++) {
+        var sCategory = aInitialCategories[j];
+
+        // Add category to the internal array of filters
+        this._categoryFilters.push(sCategory);
+
+        // Add checkbox element if UI is enabled
+        if(this._elCategoryFilters) {
+            this._createCategoryCheckbox(sCategory);
+        }
+    }
+};
+
+/**
+ * Initializes source filters.
+ *
+ * @method _initSources
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initSources = function() {
+    // Initialize source filters
+    this._sourceFilters = [];
+    var aInitialSources = YAHOO.widget.Logger.sources;
+
+    for(var j=0; j < aInitialSources.length; j++) {
+        var sSource = aInitialSources[j];
+
+        // Add source to the internal array of filters
+        this._sourceFilters.push(sSource);
+
+        // Add checkbox element if UI is enabled
+        if(this._elSourceFilters) {
+            this._createSourceCheckbox(sSource);
+        }
+    }}
+;
+
+/**
+ * Creates the UI for a category filter in the LogReader footer element.
+ *
+ * @method _createCategoryCheckbox
+ * @param sCategory {String} Category name.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._createCategoryCheckbox = function(sCategory) {
+    var oSelf = this;
+
+    if(this._elFt) {
+        var elParent = this._elCategoryFilters;
+        var elFilter = elParent.appendChild(document.createElement("span"));
+        elFilter.className = "yui-log-filtergrp";
+        
+        // Append el at the end so IE 5.5 can set "type" attribute
+        // and THEN set checked property
+        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;
+
+        // Subscribe to the click event
+        YAHOO.util.Event.addListener(chkCategory,'click',oSelf._onCheckCategory,oSelf);
+
+        // Create and class the text label
+        var lblCategory = elFilter.appendChild(document.createElement("label"));
+        lblCategory.htmlFor = chkCategory.id;
+        lblCategory.className = sCategory;
+        lblCategory.innerHTML = sCategory;
+        
+        this._filterCheckboxes[sCategory] = chkCategory;
+    }
+};
+
+/**
+ * Creates a checkbox in the LogReader footer element to filter by source.
+ *
+ * @method _createSourceCheckbox
+ * @param sSource {String} Source name.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._createSourceCheckbox = function(sSource) {
+    var oSelf = this;
+
+    if(this._elFt) {
+        var elParent = this._elSourceFilters;
+        var elFilter = elParent.appendChild(document.createElement("span"));
+        elFilter.className = "yui-log-filtergrp";
+
+        // Append el at the end so IE 5.5 can set "type" attribute
+        // and THEN set checked property
+        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;
+
+        // Subscribe to the click event
+        YAHOO.util.Event.addListener(chkSource,'click',oSelf._onCheckSource,oSelf);
+
+        // Create and class the text label
+        var lblSource = elFilter.appendChild(document.createElement("label"));
+        lblSource.htmlFor = chkSource.id;
+        lblSource.className = sSource;
+        lblSource.innerHTML = sSource;
+        
+        this._filterCheckboxes[sSource] = chkSource;
+    }
+};
+
+/**
+ * Reprints all log messages in the stack through filters.
+ *
+ * @method _filterLogs
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._filterLogs = function() {
+    // Reprint stack with new filters
+    if (this._elConsole !== null) {
+        this.clearConsole();
+        this._printToConsole(YAHOO.widget.Logger.getStack());
+    }
+};
+
+/**
+ * Sends buffer of log messages to output and clears buffer.
+ *
+ * @method _printBuffer
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._printBuffer = function() {
+    this._timeout = null;
+
+    if(this._elConsole !== null) {
+        var thresholdMax = this.thresholdMax;
+        thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500;
+        if(this._consoleMsgCount < thresholdMax) {
+            var entries = [];
+            for (var i=0; i<this._buffer.length; i++) {
+                entries[i] = this._buffer[i];
+            }
+            this._buffer = [];
+            this._printToConsole(entries);
+        }
+        else {
+            this._filterLogs();
+        }
+        
+        if(!this.newestOnTop) {
+            this._elConsole.scrollTop = this._elConsole.scrollHeight;
+        }
+    }
+};
+
+/**
+ * Cycles through an array of log messages, and outputs each one to the console
+ * if its category has not been filtered out.
+ *
+ * @method _printToConsole
+ * @param aEntries {Object[]} Array of LogMsg objects to output to console.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._printToConsole = function(aEntries) {
+    // Manage the number of messages displayed in the console
+    var entriesLen = aEntries.length;
+    var thresholdMin = this.thresholdMin;
+    if(isNaN(thresholdMin) || (thresholdMin > this.thresholdMax)) {
+        thresholdMin = 0;
+    }
+    var entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0;
+    
+    // Iterate through all log entries 
+    var sourceFiltersLen = this._sourceFilters.length;
+    var categoryFiltersLen = this._categoryFilters.length;
+    for(var i=entriesStartIndex; i<entriesLen; i++) {
+        // Print only the ones that filter through
+        var okToPrint = false;
+        var okToFilterCats = false;
+
+        // Get log message details
+        var entry = aEntries[i];
+        var source = entry.source;
+        var category = entry.category;
+
+        for(var j=0; j<sourceFiltersLen; j++) {
+            if(source == this._sourceFilters[j]) {
+                okToFilterCats = true;
+                break;
+            }
+        }
+        if(okToFilterCats) {
+            for(var k=0; k<categoryFiltersLen; k++) {
+                if(category == this._categoryFilters[k]) {
+                    okToPrint = true;
+                    break;
+                }
+            }
+        }
+        if(okToPrint) {
+            var output = this.formatMsg(entry);
+            if(this.newestOnTop) {
+                this._elConsole.innerHTML = output + this._elConsole.innerHTML;
+            }
+            else {
+                this._elConsole.innerHTML += output;
+            }
+            this._consoleMsgCount++;
+            this._lastTime = entry.time.getTime();
+        }
+    }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private event handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Handles Logger's categoryCreateEvent.
+ *
+ * @method _onCategoryCreate
+ * @param sType {String} The event.
+ * @param aArgs {Object[]} Data passed from event firer.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onCategoryCreate = function(sType, aArgs, oSelf) {
+    var category = aArgs[0];
+    
+    // Add category to the internal array of filters
+    oSelf._categoryFilters.push(category);
+
+    if(oSelf._elFt) {
+        oSelf._createCategoryCheckbox(category);
+    }
+};
+
+/**
+ * Handles Logger's sourceCreateEvent.
+ *
+ * @method _onSourceCreate
+ * @param sType {String} The event.
+ * @param aArgs {Object[]} Data passed from event firer.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onSourceCreate = function(sType, aArgs, oSelf) {
+    var source = aArgs[0];
+    
+    // Add source to the internal array of filters
+    oSelf._sourceFilters.push(source);
+
+    if(oSelf._elFt) {
+        oSelf._createSourceCheckbox(source);
+    }
+};
+
+/**
+ * Handles check events on the category filter checkboxes.
+ *
+ * @method _onCheckCategory
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onCheckCategory = function(v, oSelf) {
+    var category = this.category;
+    if(!this.checked) {
+        oSelf.hideCategory(category);
+    }
+    else {
+        oSelf.showCategory(category);
+    }
+};
+
+/**
+ * Handles check events on the category filter checkboxes.
+ *
+ * @method _onCheckSource
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onCheckSource = function(v, oSelf) {
+    var source = this.source;
+    if(!this.checked) {
+        oSelf.hideSource(source);
+    }
+    else {
+        oSelf.showSource(source);
+    }
+};
+
+/**
+ * Handles click events on the collapse button.
+ *
+ * @method _onClickCollapseBtn
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {Object} The LogReader instance
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onClickCollapseBtn = function(v, oSelf) {
+    if(!oSelf.isCollapsed) {
+        oSelf.collapse();
+    }
+    else {
+        oSelf.expand();
+    }
+};
+
+/**
+ * Handles click events on the pause button.
+ *
+ * @method _onClickPauseBtn
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onClickPauseBtn = function(v, oSelf) {
+    if(!oSelf.isPaused) {
+        oSelf.pause();
+    }
+    else {
+        oSelf.resume();
+    }
+};
+
+/**
+ * Handles click events on the clear button.
+ *
+ * @method _onClickClearBtn
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onClickClearBtn = function(v, oSelf) {
+    oSelf.clearConsole();
+};
+
+/**
+ * Handles Logger's newLogEvent.
+ *
+ * @method _onNewLog
+ * @param sType {String} The event.
+ * @param aArgs {Object[]} Data passed from event firer.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onNewLog = function(sType, aArgs, oSelf) {
+    var logEntry = aArgs[0];
+    oSelf._buffer.push(logEntry);
+
+    if (oSelf.logReaderEnabled === true && oSelf._timeout === null) {
+        oSelf._timeout = setTimeout(function(){oSelf._printBuffer();}, oSelf.outputBuffer);
+    }
+};
+
+/**
+ * Handles Logger's resetEvent.
+ *
+ * @method _onReset
+ * @param sType {String} The event.
+ * @param aArgs {Object[]} Data passed from event firer.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onReset = function(sType, aArgs, oSelf) {
+    oSelf._filterLogs();
+};
+
+ /**
+ * The Logger widget provides a simple way to read or write log messages in
+ * JavaScript code. Integration with the YUI Library's debug builds allow
+ * implementers to access under-the-hood events, errors, and debugging messages.
+ * Output may be read through a LogReader console and/or output to a browser
+ * console.
+ *
+ * @module logger
+ * @requires yahoo, event, dom
+ * @optional dragdrop
+ * @namespace YAHOO.widget
+ * @title Logger Widget
+ */
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+// Define once
+if(!YAHOO.widget.Logger) {
+    /**
+     * The singleton Logger class provides core log management functionality. Saves
+     * logs written through the global YAHOO.log function or written by a LogWriter
+     * instance. Provides access to logs for reading by a LogReader instance or
+     * native browser console such as the Firebug extension to Firefox or Safari's
+     * JavaScript console through integration with the console.log() method.
+     *
+     * @class Logger
+     * @static
+     */
+    YAHOO.widget.Logger = {
+        // Initialize properties
+        loggerEnabled: true,
+        _browserConsoleEnabled: false,
+        categories: ["info","warn","error","time","window"],
+        sources: ["global"],
+        _stack: [], // holds all log msgs
+        maxStackEntries: 2500,
+        _startTime: new Date().getTime(), // static start timestamp
+        _lastTime: null // timestamp of last logged message
+    };
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public properties
+    //
+    /////////////////////////////////////////////////////////////////////////////
+    /**
+     * True if Logger is enabled, false otherwise.
+     *
+     * @property loggerEnabled
+     * @type Boolean
+     * @static
+     * @default true
+     */
+
+    /**
+     * Array of categories.
+     *
+     * @property categories
+     * @type String[]
+     * @static
+     * @default ["info","warn","error","time","window"]
+     */
+
+    /**
+     * Array of sources.
+     *
+     * @property sources
+     * @type String[]
+     * @static
+     * @default ["global"]
+     */
+
+    /**
+     * Upper limit on size of internal stack.
+     *
+     * @property maxStackEntries
+     * @type Number
+     * @static
+     * @default 2500
+     */
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private properties
+    //
+    /////////////////////////////////////////////////////////////////////////////
+    /**
+     * Internal property to track whether output to browser console is enabled.
+     *
+     * @property _browserConsoleEnabled
+     * @type Boolean
+     * @static
+     * @default false
+     * @private
+     */
+
+    /**
+     * Array to hold all log messages.
+     *
+     * @property _stack
+     * @type Array
+     * @static
+     * @private
+     */
+    /**
+     * Static timestamp of Logger initialization.
+     *
+     * @property _startTime
+     * @type Date
+     * @static
+     * @private
+     */
+    /**
+     * Timestamp of last logged message.
+     *
+     * @property _lastTime
+     * @type Date
+     * @static
+     * @private
+     */
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
+    /**
+     * Saves a log message to the stack and fires newLogEvent. If the log message is
+     * assigned to an unknown category, creates a new category. If the log message is
+     * from an unknown source, creates a new source.  If browser console is enabled,
+     * outputs the log message to browser console.
+     *
+     * @method log
+     * @param sMsg {String} The log message.
+     * @param sCategory {String} Category of log message, or null.
+     * @param sSource {String} Source of LogWriter, or null if global.
+     */
+    YAHOO.widget.Logger.log = function(sMsg, sCategory, sSource) {
+        if(this.loggerEnabled) {
+            if(!sCategory) {
+                sCategory = "info"; // default category
+            }
+            else {
+                sCategory = sCategory.toLocaleLowerCase();
+                if(this._isNewCategory(sCategory)) {
+                    this._createNewCategory(sCategory);
+                }
+            }
+            var sClass = "global"; // default source
+            var sDetail = null;
+            if(sSource) {
+                var spaceIndex = sSource.indexOf(" ");
+                if(spaceIndex > 0) {
+                    // Substring until first space
+                    sClass = sSource.substring(0,spaceIndex);
+                    // The rest of the source
+                    sDetail = sSource.substring(spaceIndex,sSource.length);
+                }
+                else {
+                    sClass = sSource;
+                }
+                if(this._isNewSource(sClass)) {
+                    this._createNewSource(sClass);
+                }
+            }
+
+            var timestamp = new Date();
+            var logEntry = new YAHOO.widget.LogMsg({
+                msg: sMsg,
+                time: timestamp,
+                category: sCategory,
+                source: sClass,
+                sourceDetail: sDetail
+            });
+
+            var stack = this._stack;
+            var maxStackEntries = this.maxStackEntries;
+            if(maxStackEntries && !isNaN(maxStackEntries) &&
+                (stack.length >= maxStackEntries)) {
+                stack.shift();
+            }
+            stack.push(logEntry);
+            this.newLogEvent.fire(logEntry);
+
+            if(this._browserConsoleEnabled) {
+                this._printToBrowserConsole(logEntry);
+            }
+            return true;
+        }
+        else {
+            return false;
+        }
+    };
+
+    /**
+     * Resets internal stack and startTime, enables Logger, and fires logResetEvent.
+     *
+     * @method reset
+     */
+    YAHOO.widget.Logger.reset = function() {
+        this._stack = [];
+        this._startTime = new Date().getTime();
+        this.loggerEnabled = true;
+        this.log("Logger reset");
+        this.logResetEvent.fire();
+    };
+
+    /**
+     * Public accessor to internal stack of log message objects.
+     *
+     * @method getStack
+     * @return {Object[]} Array of log message objects.
+     */
+    YAHOO.widget.Logger.getStack = function() {
+        return this._stack;
+    };
+
+    /**
+     * Public accessor to internal start time.
+     *
+     * @method getStartTime
+     * @return {Date} Internal date of when Logger singleton was initialized.
+     */
+    YAHOO.widget.Logger.getStartTime = function() {
+        return this._startTime;
+    };
+
+    /**
+     * Disables output to the browser's global console.log() function, which is used
+     * by the Firebug extension to Firefox as well as Safari.
+     *
+     * @method disableBrowserConsole
+     */
+    YAHOO.widget.Logger.disableBrowserConsole = function() {
+        YAHOO.log("Logger output to the function console.log() has been disabled.");
+        this._browserConsoleEnabled = false;
+    };
+
+    /**
+     * Enables output to the browser's global console.log() function, which is used
+     * by the Firebug extension to Firefox as well as Safari.
+     *
+     * @method enableBrowserConsole
+     */
+    YAHOO.widget.Logger.enableBrowserConsole = function() {
+        this._browserConsoleEnabled = true;
+        YAHOO.log("Logger output to the function console.log() has been enabled.");
+    };
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public events
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+     /**
+     * Fired when a new category has been created.
+     *
+     * @event categoryCreateEvent
+     * @param sCategory {String} Category name.
+     */
+    YAHOO.widget.Logger.categoryCreateEvent =
+        new YAHOO.util.CustomEvent("categoryCreate", this, true);
+
+     /**
+     * Fired when a new source has been named.
+     *
+     * @event sourceCreateEvent
+     * @param sSource {String} Source name.
+     */
+    YAHOO.widget.Logger.sourceCreateEvent =
+        new YAHOO.util.CustomEvent("sourceCreate", this, true);
+
+     /**
+     * Fired when a new log message has been created.
+     *
+     * @event newLogEvent
+     * @param sMsg {String} Log message.
+     */
+    YAHOO.widget.Logger.newLogEvent = new YAHOO.util.CustomEvent("newLog", this, true);
+
+    /**
+     * Fired when the Logger has been reset has been created.
+     *
+     * @event logResetEvent
+     */
+    YAHOO.widget.Logger.logResetEvent = new YAHOO.util.CustomEvent("logReset", this, true);
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Creates a new category of log messages and fires categoryCreateEvent.
+     *
+     * @method _createNewCategory
+     * @param sCategory {String} Category name.
+     * @private
+     */
+    YAHOO.widget.Logger._createNewCategory = function(sCategory) {
+        this.categories.push(sCategory);
+        this.categoryCreateEvent.fire(sCategory);
+    };
+
+    /**
+     * Checks to see if a category has already been created.
+     *
+     * @method _isNewCategory
+     * @param sCategory {String} Category name.
+     * @return {Boolean} Returns true if category is unknown, else returns false.
+     * @private
+     */
+    YAHOO.widget.Logger._isNewCategory = function(sCategory) {
+        for(var i=0; i < this.categories.length; i++) {
+            if(sCategory == this.categories[i]) {
+                return false;
+            }
+        }
+        return true;
+    };
+
+    /**
+     * Creates a new source of log messages and fires sourceCreateEvent.
+     *
+     * @method _createNewSource
+     * @param sSource {String} Source name.
+     * @private
+     */
+    YAHOO.widget.Logger._createNewSource = function(sSource) {
+        this.sources.push(sSource);
+        this.sourceCreateEvent.fire(sSource);
+    };
+
+    /**
+     * Checks to see if a source already exists.
+     *
+     * @method _isNewSource
+     * @param sSource {String} Source name.
+     * @return {Boolean} Returns true if source is unknown, else returns false.
+     * @private
+     */
+    YAHOO.widget.Logger._isNewSource = function(sSource) {
+        if(sSource) {
+            for(var i=0; i < this.sources.length; i++) {
+                if(sSource == this.sources[i]) {
+                    return false;
+                }
+            }
+            return true;
+        }
+    };
+
+    /**
+     * Outputs a log message to global console.log() function.
+     *
+     * @method _printToBrowserConsole
+     * @param oEntry {Object} Log entry object.
+     * @private
+     */
+    YAHOO.widget.Logger._printToBrowserConsole = function(oEntry) {
+        if(window.console && console.log) {
+            var category = oEntry.category;
+            var label = oEntry.category.substring(0,4).toUpperCase();
+
+            var time = oEntry.time;
+            if (time.toLocaleTimeString) {
+                var localTime  = time.toLocaleTimeString();
+            }
+            else {
+                localTime = time.toString();
+            }
+
+            var msecs = time.getTime();
+            var elapsedTime = (YAHOO.widget.Logger._lastTime) ?
+                (msecs - YAHOO.widget.Logger._lastTime) : 0;
+            YAHOO.widget.Logger._lastTime = msecs;
+
+            var output =
+                localTime + " (" +
+                elapsedTime + "ms): " +
+                oEntry.source + ": " +
+                oEntry.msg;
+
+            console.log(output);
+        }
+    };
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private event handlers
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Handles logging of messages due to window error events.
+     *
+     * @method _onWindowError
+     * @param sMsg {String} The error message.
+     * @param sUrl {String} URL of the error.
+     * @param sLine {String} Line number of the error.
+     * @private
+     */
+    YAHOO.widget.Logger._onWindowError = function(sMsg,sUrl,sLine) {
+        // Logger is not in scope of this event handler
+        try {
+            YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')', "window");
+            if(YAHOO.widget.Logger._origOnWindowError) {
+                YAHOO.widget.Logger._origOnWindowError();
+            }
+        }
+        catch(e) {
+            return false;
+        }
+    };
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Enable handling of native JavaScript errors
+    // NB: Not all browsers support the window.onerror event
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    if(window.onerror) {
+        // Save any previously defined handler to call
+        YAHOO.widget.Logger._origOnWindowError = window.onerror;
+    }
+    window.onerror = YAHOO.widget.Logger._onWindowError;
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // First log
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    YAHOO.widget.Logger.log("Logger initialized");
+}
+
+
+YAHOO.register("logger", YAHOO.widget.Logger, {version: "2.3.0", build: "442"});
index f41d323f30142355fb7d9a709610d06cf0130642..ceddbdade34304211e0bb3c5e72c30c4266cef0c 100755 (executable)
@@ -1,63 +1,64 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-\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
-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
-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
-if(elContainer){if(typeof elContainer=="string"){this._elContainer=document.getElementById(elContainer);}\r
-else if(elContainer.tagName){this._elContainer=elContainer;}\r
-this._elContainer.className="yui-log";}\r
-if(!this._elContainer){if(YAHOO.widget.LogReader._elDefaultContainer){this._elContainer=YAHOO.widget.LogReader._elDefaultContainer;}\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
-var containerStyle=this._elContainer.style;if(this.width){containerStyle.width=this.width;}\r
-if(this.right){containerStyle.right=this.right;}\r
-if(this.top){containerStyle.top=this.top;}\r
-if(this.left){containerStyle.left=this.left;containerStyle.right="auto";}\r
-if(this.bottom){containerStyle.bottom=this.bottom;containerStyle.top="auto";}\r
-if(this.fontSize){containerStyle.fontSize=this.fontSize;}\r
-if(window.opera){document.body.style+='';}}\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
-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
-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
-if(!this._buffer){this._buffer=[];}\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
-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
-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
-else{localTime=time.toString();}\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
-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
-this._buffer=[];this._printToConsole(entries);}\r
-else{this._filterLogs();}\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
-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
-if(okToFilterCats){for(var k=0;k<categoryFiltersLen;k++){if(category==this._categoryFilters[k]){okToPrint=true;break;}}}\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
-else{filtersArray.push(newFilter);}\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
-else{filtersArray.push(newFilter);}\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
-btn.value="Collapse";}\r
-else{oSelf._elConsole.style.display="none";if(oSelf._elFt){oSelf._elFt.style.display="none";}\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
-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
-else{sCategory=sCategory.toLocaleLowerCase();if(this._isNewCategory(sCategory)){this._createNewCategory(sCategory);}}\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
-else{sClass=sSource;}\r
-if(this._isNewSource(sClass)){this._createNewSource(sClass);}}\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
-stack.push(logEntry);this.newLogEvent.fire(logEntry);if(this._browserConsoleEnabled){this._printToBrowserConsole(logEntry);}\r
-return true;}\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
-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
-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
-else{localTime=time.toString();}\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
-elapsedTime+"ms): "+\r
-oEntry.source+": "+\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
-catch(e){return false;}};if(window.onerror){YAHOO.widget.Logger._origOnWindowError=window.onerror;}\r
-window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger.log("Logger initialized");
\ No newline at end of file
+
+YAHOO.widget.LogMsg=function(oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var param in oConfigs){this[param]=oConfigs[param];}}};YAHOO.widget.LogMsg.prototype.msg=null;YAHOO.widget.LogMsg.prototype.time=null;YAHOO.widget.LogMsg.prototype.category=null;YAHOO.widget.LogMsg.prototype.source=null;YAHOO.widget.LogMsg.prototype.sourceDetail=null;YAHOO.widget.LogWriter=function(sSource){if(!sSource){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return;}
+this._source=sSource;};YAHOO.widget.LogWriter.prototype.toString=function(){return"LogWriter "+this._sSource;};YAHOO.widget.LogWriter.prototype.log=function(sMsg,sCategory){YAHOO.widget.Logger.log(sMsg,sCategory,this._source);};YAHOO.widget.LogWriter.prototype.getSource=function(){return this._sSource;};YAHOO.widget.LogWriter.prototype.setSource=function(sSource){if(!sSource){YAHOO.log("Could not set source due to invalid source.","error",this.toString());return;}
+else{this._sSource=sSource;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(elContainer,oConfigs){this._sName=YAHOO.widget.LogReader._index;YAHOO.widget.LogReader._index++;this._buffer=[];this._filterCheckboxes={};this._lastTime=YAHOO.widget.Logger.getStartTime();if(oConfigs&&(oConfigs.constructor==Object)){for(var param in oConfigs){this[param]=oConfigs[param];}}
+this._initContainerEl(elContainer);if(!this._elContainer){YAHOO.log("Could not instantiate LogReader due to an invalid container element "+
+elContainer,"error",this.toString());return;}
+this._initHeaderEl();this._initConsoleEl();this._initFooterEl();this._initDragDrop();this._initCategories();this._initSources();YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset,this);YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate,this);YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate,this);this._filterLogs();YAHOO.log("LogReader initialized",null,this.toString());};YAHOO.widget.LogReader.prototype.logReaderEnabled=true;YAHOO.widget.LogReader.prototype.width=null;YAHOO.widget.LogReader.prototype.height=null;YAHOO.widget.LogReader.prototype.top=null;YAHOO.widget.LogReader.prototype.left=null;YAHOO.widget.LogReader.prototype.right=null;YAHOO.widget.LogReader.prototype.bottom=null;YAHOO.widget.LogReader.prototype.fontSize=null;YAHOO.widget.LogReader.prototype.footerEnabled=true;YAHOO.widget.LogReader.prototype.verboseOutput=true;YAHOO.widget.LogReader.prototype.newestOnTop=true;YAHOO.widget.LogReader.prototype.outputBuffer=100;YAHOO.widget.LogReader.prototype.thresholdMax=500;YAHOO.widget.LogReader.prototype.thresholdMin=100;YAHOO.widget.LogReader.prototype.isCollapsed=false;YAHOO.widget.LogReader.prototype.isPaused=false;YAHOO.widget.LogReader.prototype.draggable=true;YAHOO.widget.LogReader.prototype.toString=function(){return"LogReader instance"+this._sName;};YAHOO.widget.LogReader.prototype.pause=function(){this.isPaused=true;this._btnPause.value="Resume";this._timeout=null;this.logReaderEnabled=false;};YAHOO.widget.LogReader.prototype.resume=function(){this.isPaused=false;this._btnPause.value="Pause";this.logReaderEnabled=true;this._printBuffer();};YAHOO.widget.LogReader.prototype.hide=function(){this._elContainer.style.display="none";};YAHOO.widget.LogReader.prototype.show=function(){this._elContainer.style.display="block";};YAHOO.widget.LogReader.prototype.collapse=function(){this._elConsole.style.display="none";if(this._elFt){this._elFt.style.display="none";}
+this._btnCollapse.value="Expand";this.isCollapsed=true;};YAHOO.widget.LogReader.prototype.expand=function(){this._elConsole.style.display="block";if(this._elFt){this._elFt.style.display="block";}
+this._btnCollapse.value="Collapse";this.isCollapsed=false;};YAHOO.widget.LogReader.prototype.getCheckbox=function(filter){return this._filterCheckboxes[filter];};YAHOO.widget.LogReader.prototype.getCategories=function(){return this._categoryFilters;};YAHOO.widget.LogReader.prototype.showCategory=function(sCategory){var filtersArray=this._categoryFilters;if(filtersArray.indexOf){if(filtersArray.indexOf(sCategory)>-1){return;}}
+else{for(var i=0;i<filtersArray.length;i++){if(filtersArray[i]===sCategory){return;}}}
+this._categoryFilters.push(sCategory);this._filterLogs();var elCheckbox=this.getCheckbox(sCategory);if(elCheckbox){elCheckbox.checked=true;}};YAHOO.widget.LogReader.prototype.hideCategory=function(sCategory){var filtersArray=this._categoryFilters;for(var i=0;i<filtersArray.length;i++){if(sCategory==filtersArray[i]){filtersArray.splice(i,1);break;}}
+this._filterLogs();var elCheckbox=this.getCheckbox(sCategory);if(elCheckbox){elCheckbox.checked=false;}};YAHOO.widget.LogReader.prototype.getSources=function(){return this._sourceFilters;};YAHOO.widget.LogReader.prototype.showSource=function(sSource){var filtersArray=this._sourceFilters;if(filtersArray.indexOf){if(filtersArray.indexOf(sSource)>-1){return;}}
+else{for(var i=0;i<filtersArray.length;i++){if(sSource==filtersArray[i]){return;}}}
+filtersArray.push(sSource);this._filterLogs();var elCheckbox=this.getCheckbox(sSource);if(elCheckbox){elCheckbox.checked=true;}};YAHOO.widget.LogReader.prototype.hideSource=function(sSource){var filtersArray=this._sourceFilters;for(var i=0;i<filtersArray.length;i++){if(sSource==filtersArray[i]){filtersArray.splice(i,1);break;}}
+this._filterLogs();var elCheckbox=this.getCheckbox(sSource);if(elCheckbox){elCheckbox.checked=false;}};YAHOO.widget.LogReader.prototype.clearConsole=function(){this._timeout=null;this._buffer=[];this._consoleMsgCount=0;var elConsole=this._elConsole;while(elConsole.hasChildNodes()){elConsole.removeChild(elConsole.firstChild);}};YAHOO.widget.LogReader.prototype.setTitle=function(sTitle){this._title.innerHTML=this.html2Text(sTitle);};YAHOO.widget.LogReader.prototype.getLastTime=function(){return this._lastTime;};YAHOO.widget.LogReader.prototype.formatMsg=function(oLogMsg){var category=oLogMsg.category;var label=category.substring(0,4).toUpperCase();var time=oLogMsg.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
+else{localTime=time.toString();}
+var msecs=time.getTime();var startTime=YAHOO.widget.Logger.getStartTime();var totalTime=msecs-startTime;var elapsedTime=msecs-this.getLastTime();var source=oLogMsg.source;var sourceDetail=oLogMsg.sourceDetail;var sourceAndDetail=(sourceDetail)?source+" "+sourceDetail:source;var msg=this.html2Text(YAHOO.lang.dump(oLogMsg.msg));var output=(this.verboseOutput)?["<pre class=\"yui-log-verbose\"><p><span class='",category,"'>",label,"</span> ",totalTime,"ms (+",elapsedTime,") ",localTime,": ","</p><p>",sourceAndDetail,": </p><p>",msg,"</p></pre>"]:["<pre><p><span class='",category,"'>",label,"</span> ",totalTime,"ms (+",elapsedTime,") ",localTime,": ",sourceAndDetail,": ",msg,"</p></pre>"];return output.join("");};YAHOO.widget.LogReader.prototype.html2Text=function(sHtml){if(sHtml){sHtml+="";return sHtml.replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");}
+return"";};YAHOO.widget.LogReader._index=0;YAHOO.widget.LogReader.prototype._sName=null;YAHOO.widget.LogReader.prototype._buffer=null;YAHOO.widget.LogReader.prototype._consoleMsgCount=0;YAHOO.widget.LogReader.prototype._lastTime=null;YAHOO.widget.LogReader.prototype._timeout=null;YAHOO.widget.LogReader.prototype._filterCheckboxes=null;YAHOO.widget.LogReader.prototype._categoryFilters=null;YAHOO.widget.LogReader.prototype._sourceFilters=null;YAHOO.widget.LogReader.prototype._elContainer=null;YAHOO.widget.LogReader.prototype._elHd=null;YAHOO.widget.LogReader.prototype._elCollapse=null;YAHOO.widget.LogReader.prototype._btnCollapse=null;YAHOO.widget.LogReader.prototype._title=null;YAHOO.widget.LogReader.prototype._elConsole=null;YAHOO.widget.LogReader.prototype._elFt=null;YAHOO.widget.LogReader.prototype._elBtns=null;YAHOO.widget.LogReader.prototype._elCategoryFilters=null;YAHOO.widget.LogReader.prototype._elSourceFilters=null;YAHOO.widget.LogReader.prototype._btnPause=null;YAHOO.widget.LogReader.prototype._btnClear=null;YAHOO.widget.LogReader.prototype._initContainerEl=function(elContainer){elContainer=YAHOO.util.Dom.get(elContainer);if(elContainer&&elContainer.tagName&&(elContainer.tagName.toLowerCase()=="div")){this._elContainer=elContainer;YAHOO.util.Dom.addClass(this._elContainer,"yui-log");}
+else{this._elContainer=document.body.appendChild(document.createElement("div"));YAHOO.util.Dom.addClass(this._elContainer,"yui-log");YAHOO.util.Dom.addClass(this._elContainer,"yui-log-container");var containerStyle=this._elContainer.style;if(this.width){containerStyle.width=this.width;}
+if(this.right){containerStyle.right=this.right;}
+if(this.top){containerStyle.top=this.top;}
+if(this.left){containerStyle.left=this.left;containerStyle.right="auto";}
+if(this.bottom){containerStyle.bottom=this.bottom;containerStyle.top="auto";}
+if(this.fontSize){containerStyle.fontSize=this.fontSize;}
+if(navigator.userAgent.toLowerCase().indexOf("opera")!=-1){document.body.style+='';}}};YAHOO.widget.LogReader.prototype._initHeaderEl=function(){var oSelf=this;if(this._elHd){YAHOO.util.Event.purgeElement(this._elHd,true);this._elHd.innerHTML="";}
+this._elHd=this._elContainer.appendChild(document.createElement("div"));this._elHd.id="yui-log-hd"+this._sName;this._elHd.className="yui-log-hd";this._elCollapse=this._elHd.appendChild(document.createElement("div"));this._elCollapse.className="yui-log-btns";this._btnCollapse=document.createElement("input");this._btnCollapse.type="button";this._btnCollapse.className="yui-log-button";this._btnCollapse.value="Collapse";this._btnCollapse=this._elCollapse.appendChild(this._btnCollapse);YAHOO.util.Event.addListener(oSelf._btnCollapse,'click',oSelf._onClickCollapseBtn,oSelf);this._title=this._elHd.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console";};YAHOO.widget.LogReader.prototype._initConsoleEl=function(){if(this._elConsole){YAHOO.util.Event.purgeElement(this._elConsole,true);this._elConsole.innerHTML="";}
+this._elConsole=this._elContainer.appendChild(document.createElement("div"));this._elConsole.className="yui-log-bd";if(this.height){this._elConsole.style.height=this.height;}};YAHOO.widget.LogReader.prototype._initFooterEl=function(){var oSelf=this;if(this.footerEnabled){if(this._elFt){YAHOO.util.Event.purgeElement(this._elFt,true);this._elFt.innerHTML="";}
+this._elFt=this._elContainer.appendChild(document.createElement("div"));this._elFt.className="yui-log-ft";this._elBtns=this._elFt.appendChild(document.createElement("div"));this._elBtns.className="yui-log-btns";this._btnPause=document.createElement("input");this._btnPause.type="button";this._btnPause.className="yui-log-button";this._btnPause.value="Pause";this._btnPause=this._elBtns.appendChild(this._btnPause);YAHOO.util.Event.addListener(oSelf._btnPause,'click',oSelf._onClickPauseBtn,oSelf);this._btnClear=document.createElement("input");this._btnClear.type="button";this._btnClear.className="yui-log-button";this._btnClear.value="Clear";this._btnClear=this._elBtns.appendChild(this._btnClear);YAHOO.util.Event.addListener(oSelf._btnClear,'click',oSelf._onClickClearBtn,oSelf);this._elCategoryFilters=this._elFt.appendChild(document.createElement("div"));this._elCategoryFilters.className="yui-log-categoryfilters";this._elSourceFilters=this._elFt.appendChild(document.createElement("div"));this._elSourceFilters.className="yui-log-sourcefilters";}};YAHOO.widget.LogReader.prototype._initDragDrop=function(){if(YAHOO.util.DD&&this.draggable&&this._elHd){var ylog_dd=new YAHOO.util.DD(this._elContainer);ylog_dd.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}};YAHOO.widget.LogReader.prototype._initCategories=function(){this._categoryFilters=[];var aInitialCategories=YAHOO.widget.Logger.categories;for(var j=0;j<aInitialCategories.length;j++){var sCategory=aInitialCategories[j];this._categoryFilters.push(sCategory);if(this._elCategoryFilters){this._createCategoryCheckbox(sCategory);}}};YAHOO.widget.LogReader.prototype._initSources=function(){this._sourceFilters=[];var aInitialSources=YAHOO.widget.Logger.sources;for(var j=0;j<aInitialSources.length;j++){var sSource=aInitialSources[j];this._sourceFilters.push(sSource);if(this._elSourceFilters){this._createSourceCheckbox(sSource);}}};YAHOO.widget.LogReader.prototype._createCategoryCheckbox=function(sCategory){var oSelf=this;if(this._elFt){var elParent=this._elCategoryFilters;var elFilter=elParent.appendChild(document.createElement("span"));elFilter.className="yui-log-filtergrp";var chkCategory=document.createElement("input");chkCategory.id="yui-log-filter-"+sCategory+this._sName;chkCategory.className="yui-log-filter-"+sCategory;chkCategory.type="checkbox";chkCategory.category=sCategory;chkCategory=elFilter.appendChild(chkCategory);chkCategory.checked=true;YAHOO.util.Event.addListener(chkCategory,'click',oSelf._onCheckCategory,oSelf);var lblCategory=elFilter.appendChild(document.createElement("label"));lblCategory.htmlFor=chkCategory.id;lblCategory.className=sCategory;lblCategory.innerHTML=sCategory;this._filterCheckboxes[sCategory]=chkCategory;}};YAHOO.widget.LogReader.prototype._createSourceCheckbox=function(sSource){var oSelf=this;if(this._elFt){var elParent=this._elSourceFilters;var elFilter=elParent.appendChild(document.createElement("span"));elFilter.className="yui-log-filtergrp";var chkSource=document.createElement("input");chkSource.id="yui-log-filter"+sSource+this._sName;chkSource.className="yui-log-filter"+sSource;chkSource.type="checkbox";chkSource.source=sSource;chkSource=elFilter.appendChild(chkSource);chkSource.checked=true;YAHOO.util.Event.addListener(chkSource,'click',oSelf._onCheckSource,oSelf);var lblSource=elFilter.appendChild(document.createElement("label"));lblSource.htmlFor=chkSource.id;lblSource.className=sSource;lblSource.innerHTML=sSource;this._filterCheckboxes[sSource]=chkSource;}};YAHOO.widget.LogReader.prototype._filterLogs=function(){if(this._elConsole!==null){this.clearConsole();this._printToConsole(YAHOO.widget.Logger.getStack());}};YAHOO.widget.LogReader.prototype._printBuffer=function(){this._timeout=null;if(this._elConsole!==null){var thresholdMax=this.thresholdMax;thresholdMax=(thresholdMax&&!isNaN(thresholdMax))?thresholdMax:500;if(this._consoleMsgCount<thresholdMax){var entries=[];for(var i=0;i<this._buffer.length;i++){entries[i]=this._buffer[i];}
+this._buffer=[];this._printToConsole(entries);}
+else{this._filterLogs();}
+if(!this.newestOnTop){this._elConsole.scrollTop=this._elConsole.scrollHeight;}}};YAHOO.widget.LogReader.prototype._printToConsole=function(aEntries){var entriesLen=aEntries.length;var thresholdMin=this.thresholdMin;if(isNaN(thresholdMin)||(thresholdMin>this.thresholdMax)){thresholdMin=0;}
+var entriesStartIndex=(entriesLen>thresholdMin)?(entriesLen-thresholdMin):0;var sourceFiltersLen=this._sourceFilters.length;var categoryFiltersLen=this._categoryFilters.length;for(var i=entriesStartIndex;i<entriesLen;i++){var okToPrint=false;var okToFilterCats=false;var entry=aEntries[i];var source=entry.source;var category=entry.category;for(var j=0;j<sourceFiltersLen;j++){if(source==this._sourceFilters[j]){okToFilterCats=true;break;}}
+if(okToFilterCats){for(var k=0;k<categoryFiltersLen;k++){if(category==this._categoryFilters[k]){okToPrint=true;break;}}}
+if(okToPrint){var output=this.formatMsg(entry);if(this.newestOnTop){this._elConsole.innerHTML=output+this._elConsole.innerHTML;}
+else{this._elConsole.innerHTML+=output;}
+this._consoleMsgCount++;this._lastTime=entry.time.getTime();}}};YAHOO.widget.LogReader.prototype._onCategoryCreate=function(sType,aArgs,oSelf){var category=aArgs[0];oSelf._categoryFilters.push(category);if(oSelf._elFt){oSelf._createCategoryCheckbox(category);}};YAHOO.widget.LogReader.prototype._onSourceCreate=function(sType,aArgs,oSelf){var source=aArgs[0];oSelf._sourceFilters.push(source);if(oSelf._elFt){oSelf._createSourceCheckbox(source);}};YAHOO.widget.LogReader.prototype._onCheckCategory=function(v,oSelf){var category=this.category;if(!this.checked){oSelf.hideCategory(category);}
+else{oSelf.showCategory(category);}};YAHOO.widget.LogReader.prototype._onCheckSource=function(v,oSelf){var source=this.source;if(!this.checked){oSelf.hideSource(source);}
+else{oSelf.showSource(source);}};YAHOO.widget.LogReader.prototype._onClickCollapseBtn=function(v,oSelf){if(!oSelf.isCollapsed){oSelf.collapse();}
+else{oSelf.expand();}};YAHOO.widget.LogReader.prototype._onClickPauseBtn=function(v,oSelf){if(!oSelf.isPaused){oSelf.pause();}
+else{oSelf.resume();}};YAHOO.widget.LogReader.prototype._onClickClearBtn=function(v,oSelf){oSelf.clearConsole();};YAHOO.widget.LogReader.prototype._onNewLog=function(sType,aArgs,oSelf){var logEntry=aArgs[0];oSelf._buffer.push(logEntry);if(oSelf.logReaderEnabled===true&&oSelf._timeout===null){oSelf._timeout=setTimeout(function(){oSelf._printBuffer();},oSelf.outputBuffer);}};YAHOO.widget.LogReader.prototype._onReset=function(sType,aArgs,oSelf){oSelf._filterLogs();};if(!YAHOO.widget.Logger){YAHOO.widget.Logger={loggerEnabled:true,_browserConsoleEnabled:false,categories:["info","warn","error","time","window"],sources:["global"],_stack:[],maxStackEntries:2500,_startTime:new Date().getTime(),_lastTime:null};YAHOO.widget.Logger.log=function(sMsg,sCategory,sSource){if(this.loggerEnabled){if(!sCategory){sCategory="info";}
+else{sCategory=sCategory.toLocaleLowerCase();if(this._isNewCategory(sCategory)){this._createNewCategory(sCategory);}}
+var sClass="global";var sDetail=null;if(sSource){var spaceIndex=sSource.indexOf(" ");if(spaceIndex>0){sClass=sSource.substring(0,spaceIndex);sDetail=sSource.substring(spaceIndex,sSource.length);}
+else{sClass=sSource;}
+if(this._isNewSource(sClass)){this._createNewSource(sClass);}}
+var timestamp=new Date();var logEntry=new YAHOO.widget.LogMsg({msg:sMsg,time:timestamp,category:sCategory,source:sClass,sourceDetail:sDetail});var stack=this._stack;var maxStackEntries=this.maxStackEntries;if(maxStackEntries&&!isNaN(maxStackEntries)&&(stack.length>=maxStackEntries)){stack.shift();}
+stack.push(logEntry);this.newLogEvent.fire(logEntry);if(this._browserConsoleEnabled){this._printToBrowserConsole(logEntry);}
+return true;}
+else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log("Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableBrowserConsole=function(){YAHOO.log("Logger output to the function console.log() has been disabled.");this._browserConsoleEnabled=false;};YAHOO.widget.Logger.enableBrowserConsole=function(){this._browserConsoleEnabled=true;YAHOO.log("Logger output to the function console.log() has been enabled.");};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger._createNewCategory=function(sCategory){this.categories.push(sCategory);this.categoryCreateEvent.fire(sCategory);};YAHOO.widget.Logger._isNewCategory=function(sCategory){for(var i=0;i<this.categories.length;i++){if(sCategory==this.categories[i]){return false;}}
+return true;};YAHOO.widget.Logger._createNewSource=function(sSource){this.sources.push(sSource);this.sourceCreateEvent.fire(sSource);};YAHOO.widget.Logger._isNewSource=function(sSource){if(sSource){for(var i=0;i<this.sources.length;i++){if(sSource==this.sources[i]){return false;}}
+return true;}};YAHOO.widget.Logger._printToBrowserConsole=function(oEntry){if(window.console&&console.log){var category=oEntry.category;var label=oEntry.category.substring(0,4).toUpperCase();var time=oEntry.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
+else{localTime=time.toString();}
+var msecs=time.getTime();var elapsedTime=(YAHOO.widget.Logger._lastTime)?(msecs-YAHOO.widget.Logger._lastTime):0;YAHOO.widget.Logger._lastTime=msecs;var output=localTime+" ("+
+elapsedTime+"ms): "+
+oEntry.source+": "+
+oEntry.msg;console.log(output);}};YAHOO.widget.Logger._onWindowError=function(sMsg,sUrl,sLine){try{YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')',"window");if(YAHOO.widget.Logger._origOnWindowError){YAHOO.widget.Logger._origOnWindowError();}}
+catch(e){return false;}};if(window.onerror){YAHOO.widget.Logger._origOnWindowError=window.onerror;}
+window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger.log("Logger initialized");}
+YAHOO.register("logger",YAHOO.widget.Logger,{version:"2.3.0",build:"442"});
\ No newline at end of file
index 3134716e596c132ce8fec722243c73e3ce90be14..583eda200fde4326696ad4cc0790ed861e3e8c86 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * The LogMsg class defines a single log message.\r
- *\r
- * @class LogMsg\r
- * @constructor\r
- * @param oConfigs {Object} Object literal of configuration params.\r
- */\r
- YAHOO.widget.LogMsg = function(oConfigs) {\r
-    // Parse configs\r
-    if (typeof oConfigs == "object") {\r
-        for(var param in oConfigs) {\r
-            this[param] = oConfigs[param];\r
-        }\r
-    }\r
- };\r
\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Log message.\r
- *\r
- * @property msg\r
- * @type String\r
- */\r
-YAHOO.widget.LogMsg.prototype.msg = null;\r
\r
-/**\r
- * Log timestamp.\r
- *\r
- * @property time\r
- * @type Date\r
- */\r
-YAHOO.widget.LogMsg.prototype.time = null;\r
-\r
-/**\r
- * Log category.\r
- *\r
- * @property category\r
- * @type String\r
- */\r
-YAHOO.widget.LogMsg.prototype.category = null;\r
-\r
-/**\r
- * Log source. The first word passed in as the source argument.\r
- *\r
- * @property source\r
- * @type String\r
- */\r
-YAHOO.widget.LogMsg.prototype.source = null;\r
-\r
-/**\r
- * Log source detail. The remainder of the string passed in as the source argument, not\r
- * including the first word (if any).\r
- *\r
- * @property sourceDetail\r
- * @type String\r
- */\r
-YAHOO.widget.LogMsg.prototype.sourceDetail = null;\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * The LogWriter class provides a mechanism to log messages through\r
- * YAHOO.widget.Logger from a named source.\r
- *\r
- * @class LogWriter\r
- * @constructor\r
- * @param sSource {String} Source of LogWriter instance.\r
- */\r
-YAHOO.widget.LogWriter = function(sSource) {\r
-    if(!sSource) {\r
-        YAHOO.log("Could not instantiate LogWriter due to invalid source.",\r
-            "error", "LogWriter");\r
-        return;\r
-    }\r
-    this._source = sSource;\r
- };\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
- /**\r
- * Public accessor to the unique name of the LogWriter instance.\r
- *\r
- * @method toString\r
- * @return {String} Unique name of the LogWriter instance.\r
- */\r
-YAHOO.widget.LogWriter.prototype.toString = function() {\r
-    return "LogWriter " + this._sSource;\r
-};\r
-\r
-/**\r
- * Logs a message attached to the source of the LogWriter.\r
- *\r
- * @method log\r
- * @param sMsg {String} The log message.\r
- * @param sCategory {String} Category name.\r
- */\r
-YAHOO.widget.LogWriter.prototype.log = function(sMsg, sCategory) {\r
-    YAHOO.widget.Logger.log(sMsg, sCategory, this._source);\r
-};\r
-\r
-/**\r
- * Public accessor to get the source name.\r
- *\r
- * @method getSource\r
- * @return {String} The LogWriter source.\r
- */\r
-YAHOO.widget.LogWriter.prototype.getSource = function() {\r
-    return this._sSource;\r
-};\r
-\r
-/**\r
- * Public accessor to set the source name.\r
- *\r
- * @method setSource\r
- * @param sSource {String} Source of LogWriter instance.\r
- */\r
-YAHOO.widget.LogWriter.prototype.setSource = function(sSource) {\r
-    if(!sSource) {\r
-        YAHOO.log("Could not set source due to invalid source.", "error", this.toString());\r
-        return;\r
-    }\r
-    else {\r
-        this._sSource = sSource;\r
-    }\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Source of the LogWriter instance.\r
- *\r
- * @property _source\r
- * @type String\r
- * @private\r
- */\r
-YAHOO.widget.LogWriter.prototype._source = null;\r
-\r
-\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * The LogReader class provides UI to read messages logged to YAHOO.widget.Logger.\r
- *\r
- * @class LogReader\r
- * @constructor\r
- * @param elContainer {HTMLElement} (optional) DOM element reference of an existing DIV.\r
- * @param elContainer {String} (optional) String ID of an existing DIV.\r
- * @param oConfigs {Object} (optional) Object literal of configuration params.\r
- */\r
-YAHOO.widget.LogReader = function(elContainer, oConfigs) {\r
-    var oSelf = this;\r
-    this._sName = YAHOO.widget.LogReader._index;\r
-    YAHOO.widget.LogReader._index++;\r
-\r
-    // Parse config vars here\r
-    if (typeof oConfigs == "object") {\r
-        for(var param in oConfigs) {\r
-            this[param] = oConfigs[param];\r
-        }\r
-    }\r
-\r
-    // Attach container...\r
-    if(elContainer) {\r
-        if(typeof elContainer == "string") {\r
-            this._elContainer = document.getElementById(elContainer);\r
-        }\r
-        else if(elContainer.tagName) {\r
-            this._elContainer = elContainer;\r
-        }\r
-        this._elContainer.className = "yui-log";\r
-    }\r
-    // ...or create container from scratch\r
-    if(!this._elContainer) {\r
-        if(YAHOO.widget.LogReader._elDefaultContainer) {\r
-            this._elContainer =  YAHOO.widget.LogReader._elDefaultContainer;\r
-        }\r
-        else {\r
-            this._elContainer = document.body.appendChild(document.createElement("div"));\r
-            this._elContainer.id = "yui-log";\r
-            this._elContainer.className = "yui-log";\r
-\r
-            YAHOO.widget.LogReader._elDefaultContainer = this._elContainer;\r
-        }\r
-\r
-        // If implementer has provided container values, trust and set those\r
-        var containerStyle = this._elContainer.style;\r
-        if(this.width) {\r
-            containerStyle.width = this.width;\r
-        }\r
-        if(this.right) {\r
-            containerStyle.right = this.right;\r
-        }\r
-        if(this.top) {\r
-            containerStyle.top = this.top;\r
-        }\r
-         if(this.left) {\r
-            containerStyle.left = this.left;\r
-            containerStyle.right = "auto";\r
-        }\r
-        if(this.bottom) {\r
-            containerStyle.bottom = this.bottom;\r
-            containerStyle.top = "auto";\r
-        }\r
-       if(this.fontSize) {\r
-            containerStyle.fontSize = this.fontSize;\r
-        }\r
-        if(window.opera) {\r
-            document.body.style += '';\r
-        }\r
-    }\r
-\r
-    if(this._elContainer) {\r
-        // Create header\r
-        if(!this._elHd) {\r
-            this._elHd = this._elContainer.appendChild(document.createElement("div"));\r
-            this._elHd.id = "yui-log-hd" + this._sName;\r
-            this._elHd.className = "yui-log-hd";\r
-\r
-            this._elCollapse = this._elHd.appendChild(document.createElement("div"));\r
-            this._elCollapse.className = "yui-log-btns";\r
-\r
-            this._btnCollapse = document.createElement("input");\r
-            this._btnCollapse.type = "button";\r
-            this._btnCollapse.style.fontSize =\r
-                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r
-            this._btnCollapse.className = "yui-log-button";\r
-            this._btnCollapse.value = "Collapse";\r
-            this._btnCollapse = this._elCollapse.appendChild(this._btnCollapse);\r
-            YAHOO.util.Event.addListener(\r
-                oSelf._btnCollapse,'click',oSelf._onClickCollapseBtn,oSelf);\r
-\r
-            this._title = this._elHd.appendChild(document.createElement("h4"));\r
-            this._title.innerHTML = "Logger Console";\r
-\r
-            // If Drag and Drop utility is available...\r
-            // ...and this container was created from scratch...\r
-            // ...then make the header draggable\r
-            if(YAHOO.util.DD &&\r
-            (YAHOO.widget.LogReader._elDefaultContainer == this._elContainer)) {\r
-                var ylog_dd = new YAHOO.util.DD(this._elContainer.id);\r
-                ylog_dd.setHandleElId(this._elHd.id);\r
-                this._elHd.style.cursor = "move";\r
-            }\r
-        }\r
-        // Ceate console\r
-        if(!this._elConsole) {\r
-            this._elConsole =\r
-                this._elContainer.appendChild(document.createElement("div"));\r
-            this._elConsole.className = "yui-log-bd";\r
-\r
-            // If implementer has provided console, trust and set those\r
-            if(this.height) {\r
-                this._elConsole.style.height = this.height;\r
-            }\r
-        }\r
-        // Don't create footer if disabled\r
-        if(!this._elFt && this.footerEnabled) {\r
-            this._elFt = this._elContainer.appendChild(document.createElement("div"));\r
-            this._elFt.className = "yui-log-ft";\r
-\r
-            this._elBtns = this._elFt.appendChild(document.createElement("div"));\r
-            this._elBtns.className = "yui-log-btns";\r
-\r
-            this._btnPause = document.createElement("input");\r
-            this._btnPause.type = "button";\r
-            this._btnPause.style.fontSize =\r
-                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r
-            this._btnPause.className = "yui-log-button";\r
-            this._btnPause.value = "Pause";\r
-            this._btnPause = this._elBtns.appendChild(this._btnPause);\r
-            YAHOO.util.Event.addListener(\r
-                oSelf._btnPause,'click',oSelf._onClickPauseBtn,oSelf);\r
-\r
-            this._btnClear = document.createElement("input");\r
-            this._btnClear.type = "button";\r
-            this._btnClear.style.fontSize =\r
-                YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");\r
-            this._btnClear.className = "yui-log-button";\r
-            this._btnClear.value = "Clear";\r
-            this._btnClear = this._elBtns.appendChild(this._btnClear);\r
-            YAHOO.util.Event.addListener(\r
-                oSelf._btnClear,'click',oSelf._onClickClearBtn,oSelf);\r
-\r
-            this._elCategoryFilters = this._elFt.appendChild(document.createElement("div"));\r
-            this._elCategoryFilters.className = "yui-log-categoryfilters";\r
-            this._elSourceFilters = this._elFt.appendChild(document.createElement("div"));\r
-            this._elSourceFilters.className = "yui-log-sourcefilters";\r
-        }\r
-    }\r
-\r
-    // Initialize internal vars\r
-    if(!this._buffer) {\r
-        this._buffer = []; // output buffer\r
-    }\r
-    // Timestamp of last log message to console\r
-    this._lastTime = YAHOO.widget.Logger.getStartTime(); \r
-    \r
-    // Subscribe to Logger custom events\r
-    YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog, this);\r
-    YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset, this);\r
-\r
-    // Initialize category filters\r
-    this._categoryFilters = [];\r
-    var catsLen = YAHOO.widget.Logger.categories.length;\r
-    if(this._elCategoryFilters) {\r
-        for(var i=0; i < catsLen; i++) {\r
-            this._createCategoryCheckbox(YAHOO.widget.Logger.categories[i]);\r
-        }\r
-    }\r
-    // Initialize source filters\r
-    this._sourceFilters = [];\r
-    var sourcesLen = YAHOO.widget.Logger.sources.length;\r
-    if(this._elSourceFilters) {\r
-        for(var j=0; j < sourcesLen; j++) {\r
-            this._createSourceCheckbox(YAHOO.widget.Logger.sources[j]);\r
-        }\r
-    }\r
-    YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate, this);\r
-    YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate, this);\r
-\r
-    this._filterLogs();\r
-    YAHOO.log("LogReader initialized", null, this.toString());\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Whether or not the log reader is enabled to output log messages.\r
- *\r
- * @property logReaderEnabled\r
- * @type Boolean\r
- * @default true\r
- */\r
-YAHOO.widget.LogReader.prototype.logReaderEnabled = true;\r
-\r
-/**\r
- * Public member to access CSS width of the log reader container.\r
- *\r
- * @property width\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.width = null;\r
-\r
-/**\r
- * Public member to access CSS height of the log reader container.\r
- *\r
- * @property height\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.height = null;\r
-\r
-/**\r
- * Public member to access CSS top position of the log reader container.\r
- *\r
- * @property top\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.top = null;\r
-\r
-/**\r
- * Public member to access CSS left position of the log reader container.\r
- *\r
- * @property left\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.left = null;\r
-\r
-/**\r
- * Public member to access CSS right position of the log reader container.\r
- *\r
- * @property right\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.right = null;\r
-\r
-/**\r
- * Public member to access CSS bottom position of the log reader container.\r
- *\r
- * @property bottom\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.bottom = null;\r
-\r
-/**\r
- * Public member to access CSS font size of the log reader container.\r
- *\r
- * @property fontSize\r
- * @type String\r
- */\r
-YAHOO.widget.LogReader.prototype.fontSize = null;\r
-\r
-/**\r
- * Whether or not the footer UI is enabled for the log reader.\r
- *\r
- * @property footerEnabled\r
- * @type Boolean\r
- * @default true\r
- */\r
-YAHOO.widget.LogReader.prototype.footerEnabled = true;\r
-\r
-/**\r
- * Whether or not output is verbose (more readable). Setting to true will make\r
- * output more compact (less readable).\r
- *\r
- * @property verboseOutput\r
- * @type Boolean\r
- * @default true\r
- */\r
-YAHOO.widget.LogReader.prototype.verboseOutput = true;\r
-\r
-/**\r
- * Whether or not newest message is printed on top.\r
- *\r
- * @property newestOnTop\r
- * @type Boolean\r
- */\r
-YAHOO.widget.LogReader.prototype.newestOnTop = true;\r
-\r
-/**\r
- * Maximum number of messages a LogReader console will display.\r
- *\r
- * @property thresholdMax\r
- * @type Number\r
- * @default 500\r
- */\r
-YAHOO.widget.LogReader.prototype.thresholdMax = 500;\r
-\r
-/**\r
- * When a LogReader console reaches its thresholdMax, it will clear out messages\r
- * and print out the latest thresholdMin number of messages.\r
- *\r
- * @property thresholdMin\r
- * @type Number\r
- * @default 100\r
- */\r
-YAHOO.widget.LogReader.prototype.thresholdMin = 100;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
- /**\r
- * Public accessor to the unique name of the LogReader instance.\r
- *\r
- * @method toString\r
- * @return {String} Unique name of the LogReader instance.\r
- */\r
-YAHOO.widget.LogReader.prototype.toString = function() {\r
-    return "LogReader instance" + this._sName;\r
-};\r
-/**\r
- * Pauses output of log messages. While paused, log messages are not lost, but\r
- * get saved to a buffer and then output upon resume of log reader.\r
- *\r
- * @method pause\r
- */\r
-YAHOO.widget.LogReader.prototype.pause = function() {\r
-    this._timeout = null;\r
-    this.logReaderEnabled = false;\r
-};\r
-\r
-/**\r
- * Resumes output of log messages, including outputting any log messages that\r
- * have been saved to buffer while paused.\r
- *\r
- * @method resume\r
- */\r
-YAHOO.widget.LogReader.prototype.resume = function() {\r
-    this.logReaderEnabled = true;\r
-    this._printBuffer();\r
-};\r
-\r
-/**\r
- * Hides UI of log reader. Logging functionality is not disrupted.\r
- *\r
- * @method hide\r
- */\r
-YAHOO.widget.LogReader.prototype.hide = function() {\r
-    this._elContainer.style.display = "none";\r
-};\r
-\r
-/**\r
- * Shows UI of log reader. Logging functionality is not disrupted.\r
- *\r
- * @method show\r
- */\r
-YAHOO.widget.LogReader.prototype.show = function() {\r
-    this._elContainer.style.display = "block";\r
-};\r
-\r
-/**\r
- * Updates title to given string.\r
- *\r
- * @method setTitle\r
- * @param sTitle {String} New title.\r
- */\r
-YAHOO.widget.LogReader.prototype.setTitle = function(sTitle) {\r
-    this._title.innerHTML = this.html2Text(sTitle);\r
-};\r
-\r
-/**\r
- * Gets timestamp of the last log.\r
- *\r
- * @method getLastTime\r
- * @return {Date} Timestamp of the last log.\r
- */\r
-YAHOO.widget.LogReader.prototype.getLastTime = function() {\r
-    return this._lastTime;\r
-};\r
-\r
-/**\r
- * Formats message string to HTML for output to console.\r
- *\r
- * @method formatMsg\r
- * @param oLogMsg {Object} Log message object.\r
- * @return {String} HTML-formatted message for output to console.\r
- */\r
-YAHOO.widget.LogReader.prototype.formatMsg = function(oLogMsg) {\r
-    var category = oLogMsg.category;\r
-    \r
-    // Label for color-coded display\r
-    var label = category.substring(0,4).toUpperCase();\r
-\r
-    // Calculate the elapsed time to be from the last item that passed through the filter,\r
-    // not the absolute previous item in the stack\r
-\r
-    var time = oLogMsg.time;\r
-    if (time.toLocaleTimeString) {\r
-        var localTime  = time.toLocaleTimeString();\r
-    }\r
-    else {\r
-        localTime = time.toString();\r
-    }\r
-\r
-    var msecs = time.getTime();\r
-    var startTime = YAHOO.widget.Logger.getStartTime();\r
-    var totalTime = msecs - startTime;\r
-    var elapsedTime = msecs - this.getLastTime();\r
-\r
-    var source = oLogMsg.source;\r
-    var sourceDetail = oLogMsg.sourceDetail;\r
-    var sourceAndDetail = (sourceDetail) ?\r
-        source + " " + sourceDetail : source;\r
-        \r
-    // Escape HTML entities in the log message itself for output to console\r
-    var msg = this.html2Text(oLogMsg.msg);\r
-\r
-    // Verbose output includes extra line breaks\r
-    var output =  (this.verboseOutput) ?\r
-        ["<p><span class='", category, "'>", label, "</span> ",\r
-        totalTime, "ms (+", elapsedTime, ") ",\r
-        localTime, ": ",\r
-        "</p><p>",\r
-        sourceAndDetail,\r
-        ": </p><p>",\r
-        msg,\r
-        "</p>"] :\r
-\r
-        ["<p><span class='", category, "'>", label, "</span> ",\r
-        totalTime, "ms (+", elapsedTime, ") ",\r
-        localTime, ": ",\r
-        sourceAndDetail, ": ",\r
-        msg,"</p>"];\r
-\r
-    return output.join("");\r
-};\r
-\r
-/**\r
- * Converts input chars "<", ">", and "&" to HTML entities.\r
- *\r
- * @method html2Text\r
- * @param sHtml {String} String to convert.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype.html2Text = function(sHtml) {\r
-    if(sHtml) {\r
-        sHtml += "";\r
-        return sHtml.replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");\r
-    }\r
-    return "";\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private member variables\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Internal class member to index multiple log reader instances.\r
- *\r
- * @property _memberName\r
- * @static\r
- * @type Number\r
- * @default 0\r
- * @private\r
- */\r
-YAHOO.widget.LogReader._index = 0;\r
-\r
-/**\r
- * Name of LogReader instance.\r
- *\r
- * @property _sName\r
- * @type String\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._sName = null;\r
-\r
-/**\r
- * A class member shared by all log readers if a container needs to be\r
- * created during instantiation. Will be null if a container element never needs to\r
- * be created on the fly, such as when the implementer passes in their own element.\r
- *\r
- * @property _elDefaultContainer\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader._elDefaultContainer = null;\r
-\r
-/**\r
- * Buffer of log message objects for batch output.\r
- *\r
- * @property _buffer\r
- * @type Object[]\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._buffer = null;\r
-\r
-/**\r
- * Number of log messages output to console.\r
- *\r
- * @property _consoleMsgCount\r
- * @type Number\r
- * @default 0\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._consoleMsgCount = 0;\r
-\r
-/**\r
- * Date of last output log message.\r
- *\r
- * @property _lastTime\r
- * @type Date\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._lastTime = null;\r
-\r
-/**\r
- * Batched output timeout ID.\r
- *\r
- * @property _timeout\r
- * @type Number\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._timeout = null;\r
-\r
-/**\r
- * Array of filters for log message categories.\r
- *\r
- * @property _categoryFilters\r
- * @type String[]\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._categoryFilters = null;\r
-\r
-/**\r
- * Array of filters for log message sources.\r
- *\r
- * @property _sourceFilters\r
- * @type String[]\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._sourceFilters = null;\r
-\r
-/**\r
- * Log reader container element.\r
- *\r
- * @property _elContainer\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elContainer = null;\r
-\r
-/**\r
- * Log reader header element.\r
- *\r
- * @property _elHd\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elHd = null;\r
-\r
-/**\r
- * Log reader collapse element.\r
- *\r
- * @property _elCollapse\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elCollapse = null;\r
-\r
-/**\r
- * Log reader collapse button element.\r
- *\r
- * @property _btnCollapse\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._btnCollapse = null;\r
-\r
-/**\r
- * Log reader title header element.\r
- *\r
- * @property _title\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._title = null;\r
-\r
-/**\r
- * Log reader console element.\r
- *\r
- * @property _elConsole\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elConsole = null;\r
-\r
-/**\r
- * Log reader footer element.\r
- *\r
- * @property _elFt\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elFt = null;\r
-\r
-/**\r
- * Log reader buttons container element.\r
- *\r
- * @property _elBtns\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elBtns = null;\r
-\r
-/**\r
- * Container element for log reader category filter checkboxes.\r
- *\r
- * @property _elCategoryFilters\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elCategoryFilters = null;\r
-\r
-/**\r
- * Container element for log reader source filter checkboxes.\r
- *\r
- * @property _elSourceFilters\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._elSourceFilters = null;\r
-\r
-/**\r
- * Log reader pause button element.\r
- *\r
- * @property _btnPause\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._btnPause = null;\r
-\r
-/**\r
- * Clear button element.\r
- *\r
- * @property _btnClear\r
- * @type HTMLElement\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._btnClear = null;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Creates the UI for a category filter in the log reader footer element.\r
- *\r
- * @method _createCategoryCheckbox\r
- * @param sCategory {String} Category name.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._createCategoryCheckbox = function(sCategory) {\r
-    var oSelf = this;\r
-\r
-    if(this._elFt) {\r
-        var elParent = this._elCategoryFilters;\r
-        var filters = this._categoryFilters;\r
-\r
-        var elFilter = elParent.appendChild(document.createElement("span"));\r
-        elFilter.className = "yui-log-filtergrp";\r
-            // Append el at the end so IE 5.5 can set "type" attribute\r
-            // and THEN set checked property\r
-            var chkCategory = document.createElement("input");\r
-            chkCategory.id = "yui-log-filter-" + sCategory + this._sName;\r
-            chkCategory.className = "yui-log-filter-" + sCategory;\r
-            chkCategory.type = "checkbox";\r
-            chkCategory.category = sCategory;\r
-            chkCategory = elFilter.appendChild(chkCategory);\r
-            chkCategory.checked = true;\r
-\r
-            // Add this checked filter to the internal array of filters\r
-            filters.push(sCategory);\r
-            // Subscribe to the click event\r
-            YAHOO.util.Event.addListener(chkCategory,'click',oSelf._onCheckCategory,oSelf);\r
-\r
-            // Create and class the text label\r
-            var lblCategory = elFilter.appendChild(document.createElement("label"));\r
-            lblCategory.htmlFor = chkCategory.id;\r
-            lblCategory.className = sCategory;\r
-            lblCategory.innerHTML = sCategory;\r
-    }\r
-};\r
-\r
-/**\r
- * Creates a checkbox in the log reader footer element to filter by source.\r
- *\r
- * @method _createSourceCheckbox\r
- * @param sSource {String} Source name.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._createSourceCheckbox = function(sSource) {\r
-    var oSelf = this;\r
-\r
-    if(this._elFt) {\r
-        var elParent = this._elSourceFilters;\r
-        var filters = this._sourceFilters;\r
-\r
-        var elFilter = elParent.appendChild(document.createElement("span"));\r
-        elFilter.className = "yui-log-filtergrp";\r
-\r
-        // Append el at the end so IE 5.5 can set "type" attribute\r
-        // and THEN set checked property\r
-        var chkSource = document.createElement("input");\r
-        chkSource.id = "yui-log-filter" + sSource + this._sName;\r
-        chkSource.className = "yui-log-filter" + sSource;\r
-        chkSource.type = "checkbox";\r
-        chkSource.source = sSource;\r
-        chkSource = elFilter.appendChild(chkSource);\r
-        chkSource.checked = true;\r
-\r
-        // Add this checked filter to the internal array of filters\r
-        filters.push(sSource);\r
-        // Subscribe to the click event\r
-        YAHOO.util.Event.addListener(chkSource,'click',oSelf._onCheckSource,oSelf);\r
-\r
-        // Create and class the text label\r
-        var lblSource = elFilter.appendChild(document.createElement("label"));\r
-        lblSource.htmlFor = chkSource.id;\r
-        lblSource.className = sSource;\r
-        lblSource.innerHTML = sSource;\r
-    }\r
-};\r
-\r
-/**\r
- * Reprints all log messages in the stack through filters.\r
- *\r
- * @method _filterLogs\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._filterLogs = function() {\r
-    // Reprint stack with new filters\r
-    if (this._elConsole !== null) {\r
-        this._clearConsole();\r
-        this._printToConsole(YAHOO.widget.Logger.getStack());\r
-    }\r
-};\r
-\r
-/**\r
- * Clears all outputted log messages from the console and resets the time of the\r
- * last output log message.\r
- *\r
- * @method _clearConsole\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._clearConsole = function() {\r
-    // Clear the buffer of any pending messages\r
-    this._timeout = null;\r
-    this._buffer = [];\r
-    this._consoleMsgCount = 0;\r
-\r
-    // Reset the rolling timer\r
-    this._lastTime = YAHOO.widget.Logger.getStartTime();\r
-\r
-    var elConsole = this._elConsole;\r
-    while(elConsole.hasChildNodes()) {\r
-        elConsole.removeChild(elConsole.firstChild);\r
-    }\r
-};\r
-\r
-/**\r
- * Sends buffer of log messages to output and clears buffer.\r
- *\r
- * @method _printBuffer\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._printBuffer = function() {\r
-    this._timeout = null;\r
-\r
-    if(this._elConsole !== null) {\r
-        var thresholdMax = this.thresholdMax;\r
-        thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500;\r
-        if(this._consoleMsgCount < thresholdMax) {\r
-            var entries = [];\r
-            for (var i=0; i<this._buffer.length; i++) {\r
-                entries[i] = this._buffer[i];\r
-            }\r
-            this._buffer = [];\r
-            this._printToConsole(entries);\r
-        }\r
-        else {\r
-            this._filterLogs();\r
-        }\r
-        \r
-        if(!this.newestOnTop) {\r
-            this._elConsole.scrollTop = this._elConsole.scrollHeight;\r
-        }\r
-    }\r
-};\r
-\r
-/**\r
- * Cycles through an array of log messages, and outputs each one to the console\r
- * if its category has not been filtered out.\r
- *\r
- * @method _printToConsole\r
- * @param aEntries {Object[]} Array of LogMsg objects to output to console.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._printToConsole = function(aEntries) {\r
-    // Manage the number of messages displayed in the console\r
-    var entriesLen = aEntries.length;\r
-    var thresholdMin = this.thresholdMin;\r
-    if(isNaN(thresholdMin) || (thresholdMin > this.thresholdMax)) {\r
-        thresholdMin = 0;\r
-    }\r
-    var entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0;\r
-    \r
-    // Iterate through all log entries \r
-    var sourceFiltersLen = this._sourceFilters.length;\r
-    var categoryFiltersLen = this._categoryFilters.length;\r
-    for(var i=entriesStartIndex; i<entriesLen; i++) {\r
-        // Print only the ones that filter through\r
-        var okToPrint = false;\r
-        var okToFilterCats = false;\r
-\r
-        // Get log message details\r
-        var entry = aEntries[i];\r
-        var source = entry.source;\r
-        var category = entry.category;\r
-\r
-        for(var j=0; j<sourceFiltersLen; j++) {\r
-            if(source == this._sourceFilters[j]) {\r
-                okToFilterCats = true;\r
-                break;\r
-            }\r
-        }\r
-        if(okToFilterCats) {\r
-            for(var k=0; k<categoryFiltersLen; k++) {\r
-                if(category == this._categoryFilters[k]) {\r
-                    okToPrint = true;\r
-                    break;\r
-                }\r
-            }\r
-        }\r
-        if(okToPrint) {\r
-            var output = this.formatMsg(entry);\r
-\r
-            // Verbose output uses <code> tag instead of <pre> tag (for wrapping)\r
-            var container = (this.verboseOutput) ? "CODE" : "PRE";\r
-            var oNewElement = (this.newestOnTop) ?\r
-                this._elConsole.insertBefore(\r
-                    document.createElement(container),this._elConsole.firstChild):\r
-                this._elConsole.appendChild(document.createElement(container));\r
-\r
-            oNewElement.innerHTML = output;\r
-            this._consoleMsgCount++;\r
-            this._lastTime = entry.time.getTime();\r
-        }\r
-    }\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private event handlers\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Handles Logger's categoryCreateEvent.\r
- *\r
- * @method _onCategoryCreate\r
- * @param sType {String} The event.\r
- * @param aArgs {Object[]} Data passed from event firer.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onCategoryCreate = function(sType, aArgs, oSelf) {\r
-    var category = aArgs[0];\r
-    if(oSelf._elFt) {\r
-        oSelf._createCategoryCheckbox(category);\r
-    }\r
-};\r
-\r
-/**\r
- * Handles Logger's sourceCreateEvent.\r
- *\r
- * @method _onSourceCreate\r
- * @param sType {String} The event.\r
- * @param aArgs {Object[]} Data passed from event firer.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onSourceCreate = function(sType, aArgs, oSelf) {\r
-    var source = aArgs[0];\r
-    if(oSelf._elFt) {\r
-        oSelf._createSourceCheckbox(source);\r
-    }\r
-};\r
-\r
-/**\r
- * Handles check events on the category filter checkboxes.\r
- *\r
- * @method _onCheckCategory\r
- * @param v {HTMLEvent} The click event.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onCheckCategory = function(v, oSelf) {\r
-    var newFilter = this.category;\r
-    var filtersArray = oSelf._categoryFilters;\r
-\r
-    if(!this.checked) { // Remove category from filters\r
-        for(var i=0; i<filtersArray.length; i++) {\r
-            if(newFilter == filtersArray[i]) {\r
-                filtersArray.splice(i, 1);\r
-                break;\r
-            }\r
-        }\r
-    }\r
-    else { // Add category to filters\r
-        filtersArray.push(newFilter);\r
-    }\r
-    oSelf._filterLogs();\r
-};\r
-\r
-/**\r
- * Handles check events on the category filter checkboxes.\r
- *\r
- * @method _onCheckSource\r
- * @param v {HTMLEvent} The click event.\r
- * @param oSelf {Object} The log reader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onCheckSource = function(v, oSelf) {\r
-    var newFilter = this.source;\r
-    var filtersArray = oSelf._sourceFilters;\r
-\r
-    if(!this.checked) { // Remove category from filters\r
-        for(var i=0; i<filtersArray.length; i++) {\r
-            if(newFilter == filtersArray[i]) {\r
-                filtersArray.splice(i, 1);\r
-                break;\r
-            }\r
-        }\r
-    }\r
-    else { // Add category to filters\r
-        filtersArray.push(newFilter);\r
-    }\r
-    oSelf._filterLogs();\r
-};\r
-\r
-/**\r
- * Handles click events on the collapse button.\r
- *\r
- * @method _onClickCollapseBtn\r
- * @param v {HTMLEvent} The click event.\r
- * @param oSelf {Object} The LogReader instance\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onClickCollapseBtn = function(v, oSelf) {\r
-    var btn = oSelf._btnCollapse;\r
-    if(btn.value == "Expand") {\r
-        oSelf._elConsole.style.display = "block";\r
-        if(oSelf._elFt) {\r
-            oSelf._elFt.style.display = "block";\r
-        }\r
-        btn.value = "Collapse";\r
-    }\r
-    else {\r
-        oSelf._elConsole.style.display = "none";\r
-        if(oSelf._elFt) {\r
-            oSelf._elFt.style.display = "none";\r
-        }\r
-        btn.value = "Expand";\r
-    }\r
-};\r
-\r
-/**\r
- * Handles click events on the pause button.\r
- *\r
- * @method _onClickPauseBtn\r
- * @param v {HTMLEvent} The click event.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onClickPauseBtn = function(v, oSelf) {\r
-    var btn = oSelf._btnPause;\r
-    if(btn.value == "Resume") {\r
-        oSelf.resume();\r
-        btn.value = "Pause";\r
-    }\r
-    else {\r
-        oSelf.pause();\r
-        btn.value = "Resume";\r
-    }\r
-};\r
-\r
-/**\r
- * Handles click events on the clear button.\r
- *\r
- * @method _onClickClearBtn\r
- * @param v {HTMLEvent} The click event.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onClickClearBtn = function(v, oSelf) {\r
-    oSelf._clearConsole();\r
-};\r
-\r
-/**\r
- * Handles Logger's newLogEvent.\r
- *\r
- * @method _onNewLog\r
- * @param sType {String} The event.\r
- * @param aArgs {Object[]} Data passed from event firer.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onNewLog = function(sType, aArgs, oSelf) {\r
-    var logEntry = aArgs[0];\r
-    oSelf._buffer.push(logEntry);\r
-\r
-    if (oSelf.logReaderEnabled === true && oSelf._timeout === null) {\r
-        oSelf._timeout = setTimeout(function(){oSelf._printBuffer();}, 100);\r
-    }\r
-};\r
-\r
-/**\r
- * Handles Logger's resetEvent.\r
- *\r
- * @method _onReset\r
- * @param sType {String} The event.\r
- * @param aArgs {Object[]} Data passed from event firer.\r
- * @param oSelf {Object} The LogReader instance.\r
- * @private\r
- */\r
-YAHOO.widget.LogReader.prototype._onReset = function(sType, aArgs, oSelf) {\r
-    oSelf._filterLogs();\r
-};\r
- /**\r
- * The Logger widget provides a simple way to read or write log messages in\r
- * JavaScript code. Integration with the YUI Library's debug builds allow\r
- * implementers to access under-the-hood events, errors, and debugging messages.\r
- * Output may be read through a LogReader console and/or output to a browser\r
- * console.\r
- *\r
- * @module logger\r
- * @requires yahoo, event, dom\r
- * @optional dragdrop\r
- * @namespace YAHOO.widget\r
- * @title Logger Widget\r
- */\r
-\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-/****************************************************************************/\r
-\r
-/**\r
- * The singleton Logger class provides core log management functionality. Saves\r
- * logs written through the global YAHOO.log function or written by a LogWriter\r
- * instance. Provides access to logs for reading by a LogReader instance or\r
- * native browser console such as the Firebug extension to Firefox or Safari's\r
- * JavaScript console through integration with the console.log() method.\r
- *\r
- * @class Logger\r
- * @static\r
- */\r
-YAHOO.widget.Logger = {\r
-    // Initialize members\r
-    loggerEnabled: true,\r
-    _browserConsoleEnabled: false,\r
-    categories: ["info","warn","error","time","window"],\r
-    sources: ["global"],\r
-    _stack: [], // holds all log msgs\r
-    maxStackEntries: 2500,\r
-    _startTime: new Date().getTime(), // static start timestamp\r
-    _lastTime: null // timestamp of last logged message\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-/**\r
- * Saves a log message to the stack and fires newLogEvent. If the log message is\r
- * assigned to an unknown category, creates a new category. If the log message is\r
- * from an unknown source, creates a new source.  If browser console is enabled,\r
- * outputs the log message to browser console.\r
- *\r
- * @method log\r
- * @param sMsg {String} The log message.\r
- * @param sCategory {String} Category of log message, or null.\r
- * @param sSource {String} Source of LogWriter, or null if global.\r
- */\r
-YAHOO.widget.Logger.log = function(sMsg, sCategory, sSource) {\r
-    if(this.loggerEnabled) {\r
-        if(!sCategory) {\r
-            sCategory = "info"; // default category\r
-        }\r
-        else {\r
-            sCategory = sCategory.toLocaleLowerCase();\r
-            if(this._isNewCategory(sCategory)) {\r
-                this._createNewCategory(sCategory);\r
-            }\r
-        }\r
-        var sClass = "global"; // default source\r
-        var sDetail = null;\r
-        if(sSource) {\r
-            var spaceIndex = sSource.indexOf(" ");\r
-            if(spaceIndex > 0) {\r
-                // Substring until first space\r
-                sClass = sSource.substring(0,spaceIndex);\r
-                // The rest of the source\r
-                sDetail = sSource.substring(spaceIndex,sSource.length);\r
-            }\r
-            else {\r
-                sClass = sSource;\r
-            }\r
-            if(this._isNewSource(sClass)) {\r
-                this._createNewSource(sClass);\r
-            }\r
-        }\r
-\r
-        var timestamp = new Date();\r
-        var logEntry = new YAHOO.widget.LogMsg({\r
-            msg: sMsg,\r
-            time: timestamp,\r
-            category: sCategory,\r
-            source: sClass,\r
-            sourceDetail: sDetail\r
-        });\r
-\r
-        var stack = this._stack;\r
-        var maxStackEntries = this.maxStackEntries;\r
-        if(maxStackEntries && !isNaN(maxStackEntries) &&\r
-            (stack.length >= maxStackEntries)) {\r
-            stack.shift();\r
-        }\r
-        stack.push(logEntry);\r
-        this.newLogEvent.fire(logEntry);\r
-\r
-        if(this._browserConsoleEnabled) {\r
-            this._printToBrowserConsole(logEntry);\r
-        }\r
-        return true;\r
-    }\r
-    else {\r
-        return false;\r
-    }\r
-};\r
-\r
-/**\r
- * Resets internal stack and startTime, enables Logger, and fires logResetEvent.\r
- *\r
- * @method reset\r
- */\r
-YAHOO.widget.Logger.reset = function() {\r
-    this._stack = [];\r
-    this._startTime = new Date().getTime();\r
-    this.loggerEnabled = true;\r
-    this.log("Logger reset");\r
-    this.logResetEvent.fire();\r
-};\r
-\r
-/**\r
- * Public accessor to internal stack of log message objects.\r
- *\r
- * @method getStack\r
- * @return {Object[]} Array of log message objects.\r
- */\r
-YAHOO.widget.Logger.getStack = function() {\r
-    return this._stack;\r
-};\r
-\r
-/**\r
- * Public accessor to internal start time.\r
- *\r
- * @method getStartTime\r
- * @return {Date} Internal date of when Logger singleton was initialized.\r
- */\r
-YAHOO.widget.Logger.getStartTime = function() {\r
-    return this._startTime;\r
-};\r
-\r
-/**\r
- * Disables output to the browser's global console.log() function, which is used\r
- * by the Firebug extension to Firefox as well as Safari.\r
- *\r
- * @method disableBrowserConsole\r
- */\r
-YAHOO.widget.Logger.disableBrowserConsole = function() {\r
-    YAHOO.log("Logger output to the function console.log() has been disabled.");\r
-    this._browserConsoleEnabled = false;\r
-};\r
-\r
-/**\r
- * Enables output to the browser's global console.log() function, which is used\r
- * by the Firebug extension to Firefox as well as Safari.\r
- *\r
- * @method enableBrowserConsole\r
- */\r
-YAHOO.widget.Logger.enableBrowserConsole = function() {\r
-    this._browserConsoleEnabled = true;\r
-    YAHOO.log("Logger output to the function console.log() has been enabled.");\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Public events\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
- /**\r
- * Fired when a new category has been created.\r
- *\r
- * @event categoryCreateEvent\r
- * @param sCategory {String} Category name.\r
- */\r
-YAHOO.widget.Logger.categoryCreateEvent =\r
-    new YAHOO.util.CustomEvent("categoryCreate", this, true);\r
-\r
- /**\r
- * Fired when a new source has been named.\r
- *\r
- * @event sourceCreateEvent\r
- * @param sSource {String} Source name.\r
- */\r
-YAHOO.widget.Logger.sourceCreateEvent =\r
-    new YAHOO.util.CustomEvent("sourceCreate", this, true);\r
-\r
- /**\r
- * Fired when a new log message has been created.\r
- *\r
- * @event newLogEvent\r
- * @param sMsg {String} Log message.\r
- */\r
-YAHOO.widget.Logger.newLogEvent = new YAHOO.util.CustomEvent("newLog", this, true);\r
-\r
-/**\r
- * Fired when the Logger has been reset has been created.\r
- *\r
- * @event logResetEvent\r
- */\r
-YAHOO.widget.Logger.logResetEvent = new YAHOO.util.CustomEvent("logReset", this, true);\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private methods\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Creates a new category of log messages and fires categoryCreateEvent.\r
- *\r
- * @method _createNewCategory\r
- * @param sCategory {String} Category name.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._createNewCategory = function(sCategory) {\r
-    this.categories.push(sCategory);\r
-    this.categoryCreateEvent.fire(sCategory);\r
-};\r
-\r
-/**\r
- * Checks to see if a category has already been created.\r
- *\r
- * @method _isNewCategory\r
- * @param sCategory {String} Category name.\r
- * @return {Boolean} Returns true if category is unknown, else returns false.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._isNewCategory = function(sCategory) {\r
-    for(var i=0; i < this.categories.length; i++) {\r
-        if(sCategory == this.categories[i]) {\r
-            return false;\r
-        }\r
-    }\r
-    return true;\r
-};\r
-\r
-/**\r
- * Creates a new source of log messages and fires sourceCreateEvent.\r
- *\r
- * @method _createNewSource\r
- * @param sSource {String} Source name.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._createNewSource = function(sSource) {\r
-    this.sources.push(sSource);\r
-    this.sourceCreateEvent.fire(sSource);\r
-};\r
-\r
-/**\r
- * Checks to see if a source already exists.\r
- *\r
- * @method _isNewSource\r
- * @param sSource {String} Source name.\r
- * @return {Boolean} Returns true if source is unknown, else returns false.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._isNewSource = function(sSource) {\r
-    if(sSource) {\r
-        for(var i=0; i < this.sources.length; i++) {\r
-            if(sSource == this.sources[i]) {\r
-                return false;\r
-            }\r
-        }\r
-        return true;\r
-    }\r
-};\r
-\r
-/**\r
- * Outputs a log message to global console.log() function.\r
- *\r
- * @method _printToBrowserConsole\r
- * @param oEntry {Object} Log entry object.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._printToBrowserConsole = function(oEntry) {\r
-    if(window.console && console.log) {\r
-        var category = oEntry.category;\r
-        var label = oEntry.category.substring(0,4).toUpperCase();\r
-\r
-        var time = oEntry.time;\r
-        if (time.toLocaleTimeString) {\r
-            var localTime  = time.toLocaleTimeString();\r
-        }\r
-        else {\r
-            localTime = time.toString();\r
-        }\r
-\r
-        var msecs = time.getTime();\r
-        var elapsedTime = (YAHOO.widget.Logger._lastTime) ?\r
-            (msecs - YAHOO.widget.Logger._lastTime) : 0;\r
-        YAHOO.widget.Logger._lastTime = msecs;\r
-\r
-        var output =\r
-            localTime + " (" +\r
-            elapsedTime + "ms): " +\r
-            oEntry.source + ": " +\r
-            oEntry.msg;\r
-\r
-        console.log(output);\r
-    }\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Private event handlers\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-/**\r
- * Handles logging of messages due to window error events.\r
- *\r
- * @method _onWindowError\r
- * @param sMsg {String} The error message.\r
- * @param sUrl {String} URL of the error.\r
- * @param sLine {String} Line number of the error.\r
- * @private\r
- */\r
-YAHOO.widget.Logger._onWindowError = function(sMsg,sUrl,sLine) {\r
-    // Logger is not in scope of this event handler\r
-    try {\r
-        YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')', "window");\r
-        if(YAHOO.widget.Logger._origOnWindowError) {\r
-            YAHOO.widget.Logger._origOnWindowError();\r
-        }\r
-    }\r
-    catch(e) {\r
-        return false;\r
-    }\r
-};\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Enable handling of native JavaScript errors\r
-// NB: Not all browsers support the window.onerror event\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-if(window.onerror) {\r
-    // Save any previously defined handler to call\r
-    YAHOO.widget.Logger._origOnWindowError = window.onerror;\r
-}\r
-window.onerror = YAHOO.widget.Logger._onWindowError;\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// First log\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-YAHOO.widget.Logger.log("Logger initialized");\r
-\r
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The LogMsg class defines a single log message.
+ *
+ * @class LogMsg
+ * @constructor
+ * @param oConfigs {Object} Object literal of configuration params.
+ */
+ YAHOO.widget.LogMsg = function(oConfigs) {
+    // Parse configs
+    if (oConfigs && (oConfigs.constructor == Object)) {
+        for(var param in oConfigs) {
+            this[param] = oConfigs[param];
+        }
+    }
+ };
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Log message.
+ *
+ * @property msg
+ * @type String
+ */
+YAHOO.widget.LogMsg.prototype.msg = null;
+/**
+ * Log timestamp.
+ *
+ * @property time
+ * @type Date
+ */
+YAHOO.widget.LogMsg.prototype.time = null;
+
+/**
+ * Log category.
+ *
+ * @property category
+ * @type String
+ */
+YAHOO.widget.LogMsg.prototype.category = null;
+
+/**
+ * Log source. The first word passed in as the source argument.
+ *
+ * @property source
+ * @type String
+ */
+YAHOO.widget.LogMsg.prototype.source = null;
+
+/**
+ * Log source detail. The remainder of the string passed in as the source argument, not
+ * including the first word (if any).
+ *
+ * @property sourceDetail
+ * @type String
+ */
+YAHOO.widget.LogMsg.prototype.sourceDetail = null;
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The LogWriter class provides a mechanism to log messages through
+ * YAHOO.widget.Logger from a named source.
+ *
+ * @class LogWriter
+ * @constructor
+ * @param sSource {String} Source of LogWriter instance.
+ */
+YAHOO.widget.LogWriter = function(sSource) {
+    if(!sSource) {
+        YAHOO.log("Could not instantiate LogWriter due to invalid source.",
+            "error", "LogWriter");
+        return;
+    }
+    this._source = sSource;
+ };
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Public accessor to the unique name of the LogWriter instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the LogWriter instance.
+ */
+YAHOO.widget.LogWriter.prototype.toString = function() {
+    return "LogWriter " + this._sSource;
+};
+
+/**
+ * Logs a message attached to the source of the LogWriter.
+ *
+ * @method log
+ * @param sMsg {String} The log message.
+ * @param sCategory {String} Category name.
+ */
+YAHOO.widget.LogWriter.prototype.log = function(sMsg, sCategory) {
+    YAHOO.widget.Logger.log(sMsg, sCategory, this._source);
+};
+
+/**
+ * Public accessor to get the source name.
+ *
+ * @method getSource
+ * @return {String} The LogWriter source.
+ */
+YAHOO.widget.LogWriter.prototype.getSource = function() {
+    return this._sSource;
+};
+
+/**
+ * Public accessor to set the source name.
+ *
+ * @method setSource
+ * @param sSource {String} Source of LogWriter instance.
+ */
+YAHOO.widget.LogWriter.prototype.setSource = function(sSource) {
+    if(!sSource) {
+        YAHOO.log("Could not set source due to invalid source.", "error", this.toString());
+        return;
+    }
+    else {
+        this._sSource = sSource;
+    }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Source of the LogWriter instance.
+ *
+ * @property _source
+ * @type String
+ * @private
+ */
+YAHOO.widget.LogWriter.prototype._source = null;
+
+
+
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+/**
+ * The LogReader class provides UI to read messages logged to YAHOO.widget.Logger.
+ *
+ * @class LogReader
+ * @constructor
+ * @param elContainer {HTMLElement} (optional) DOM element reference of an existing DIV.
+ * @param elContainer {String} (optional) String ID of an existing DIV.
+ * @param oConfigs {Object} (optional) Object literal of configuration params.
+ */
+YAHOO.widget.LogReader = function(elContainer, oConfigs) {
+    this._sName = YAHOO.widget.LogReader._index;
+    YAHOO.widget.LogReader._index++;
+    
+    // Internal vars
+    this._buffer = []; // output buffer
+    this._filterCheckboxes = {}; // pointers to checkboxes
+    this._lastTime = YAHOO.widget.Logger.getStartTime(); // timestamp of last log message to console
+
+    // Parse config vars here
+    if (oConfigs && (oConfigs.constructor == Object)) {
+        for(var param in oConfigs) {
+            this[param] = oConfigs[param];
+        }
+    }
+
+    this._initContainerEl(elContainer);
+    if(!this._elContainer) {
+        YAHOO.log("Could not instantiate LogReader due to an invalid container element " +
+                elContainer, "error", this.toString());
+        return;
+    }
+    
+    this._initHeaderEl();
+    this._initConsoleEl();
+    this._initFooterEl();
+
+    this._initDragDrop();
+
+    this._initCategories();
+    this._initSources();
+
+    // Subscribe to Logger custom events
+    YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog, this);
+    YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset, this);
+
+    YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate, this);
+    YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate, this);
+
+    this._filterLogs();
+    YAHOO.log("LogReader initialized", null, this.toString());
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Whether or not LogReader is enabled to output log messages.
+ *
+ * @property logReaderEnabled
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.LogReader.prototype.logReaderEnabled = true;
+
+/**
+ * Public member to access CSS width of the LogReader container.
+ *
+ * @property width
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.width = null;
+
+/**
+ * Public member to access CSS height of the LogReader container.
+ *
+ * @property height
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.height = null;
+
+/**
+ * Public member to access CSS top position of the LogReader container.
+ *
+ * @property top
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.top = null;
+
+/**
+ * Public member to access CSS left position of the LogReader container.
+ *
+ * @property left
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.left = null;
+
+/**
+ * Public member to access CSS right position of the LogReader container.
+ *
+ * @property right
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.right = null;
+
+/**
+ * Public member to access CSS bottom position of the LogReader container.
+ *
+ * @property bottom
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.bottom = null;
+
+/**
+ * Public member to access CSS font size of the LogReader container.
+ *
+ * @property fontSize
+ * @type String
+ */
+YAHOO.widget.LogReader.prototype.fontSize = null;
+
+/**
+ * Whether or not the footer UI is enabled for the LogReader.
+ *
+ * @property footerEnabled
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.LogReader.prototype.footerEnabled = true;
+
+/**
+ * Whether or not output is verbose (more readable). Setting to true will make
+ * output more compact (less readable).
+ *
+ * @property verboseOutput
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.LogReader.prototype.verboseOutput = true;
+
+/**
+ * Whether or not newest message is printed on top.
+ *
+ * @property newestOnTop
+ * @type Boolean
+ */
+YAHOO.widget.LogReader.prototype.newestOnTop = true;
+
+/**
+ * Output timeout buffer in milliseconds.
+ *
+ * @property outputBuffer
+ * @type Number
+ * @default 100
+ */
+YAHOO.widget.LogReader.prototype.outputBuffer = 100;
+
+/**
+ * Maximum number of messages a LogReader console will display.
+ *
+ * @property thresholdMax
+ * @type Number
+ * @default 500
+ */
+YAHOO.widget.LogReader.prototype.thresholdMax = 500;
+
+/**
+ * When a LogReader console reaches its thresholdMax, it will clear out messages
+ * and print out the latest thresholdMin number of messages.
+ *
+ * @property thresholdMin
+ * @type Number
+ * @default 100
+ */
+YAHOO.widget.LogReader.prototype.thresholdMin = 100;
+
+/**
+ * True when LogReader is in a collapsed state, false otherwise.
+ *
+ * @property isCollapsed
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.LogReader.prototype.isCollapsed = false;
+
+/**
+ * True when LogReader is in a paused state, false otherwise.
+ *
+ * @property isPaused
+ * @type Boolean
+ * @default false
+ */
+YAHOO.widget.LogReader.prototype.isPaused = false;
+
+/**
+ * Enables draggable LogReader if DragDrop Utility is present.
+ *
+ * @property draggable
+ * @type Boolean
+ * @default true
+ */
+YAHOO.widget.LogReader.prototype.draggable = true;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Public methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Public accessor to the unique name of the LogReader instance.
+ *
+ * @method toString
+ * @return {String} Unique name of the LogReader instance.
+ */
+YAHOO.widget.LogReader.prototype.toString = function() {
+    return "LogReader instance" + this._sName;
+};
+/**
+ * Pauses output of log messages. While paused, log messages are not lost, but
+ * get saved to a buffer and then output upon resume of LogReader.
+ *
+ * @method pause
+ */
+YAHOO.widget.LogReader.prototype.pause = function() {
+    this.isPaused = true;
+    this._btnPause.value = "Resume";
+    this._timeout = null;
+    this.logReaderEnabled = false;
+};
+
+/**
+ * Resumes output of log messages, including outputting any log messages that
+ * have been saved to buffer while paused.
+ *
+ * @method resume
+ */
+YAHOO.widget.LogReader.prototype.resume = function() {
+    this.isPaused = false;
+    this._btnPause.value = "Pause";
+    this.logReaderEnabled = true;
+    this._printBuffer();
+};
+
+/**
+ * Hides UI of LogReader. Logging functionality is not disrupted.
+ *
+ * @method hide
+ */
+YAHOO.widget.LogReader.prototype.hide = function() {
+    this._elContainer.style.display = "none";
+};
+
+/**
+ * Shows UI of LogReader. Logging functionality is not disrupted.
+ *
+ * @method show
+ */
+YAHOO.widget.LogReader.prototype.show = function() {
+    this._elContainer.style.display = "block";
+};
+
+/**
+ * Collapses UI of LogReader. Logging functionality is not disrupted.
+ *
+ * @method collapse
+ */
+YAHOO.widget.LogReader.prototype.collapse = function() {
+    this._elConsole.style.display = "none";
+    if(this._elFt) {
+        this._elFt.style.display = "none";
+    }
+    this._btnCollapse.value = "Expand";
+    this.isCollapsed = true;
+};
+
+/**
+ * Expands UI of LogReader. Logging functionality is not disrupted.
+ *
+ * @method expand
+ */
+YAHOO.widget.LogReader.prototype.expand = function() {
+    this._elConsole.style.display = "block";
+    if(this._elFt) {
+        this._elFt.style.display = "block";
+    }
+    this._btnCollapse.value = "Collapse";
+    this.isCollapsed = false;
+};
+
+/**
+ * Returns related checkbox element for given filter (i.e., category or source).
+ *
+ * @method getCheckbox
+ * @param {String} Category or source name.
+ * @return {Array} Array of all filter checkboxes.
+ */
+YAHOO.widget.LogReader.prototype.getCheckbox = function(filter) {
+    return this._filterCheckboxes[filter];
+};
+
+/**
+ * Returns array of enabled categories.
+ *
+ * @method getCategories
+ * @return {String[]} Array of enabled categories.
+ */
+YAHOO.widget.LogReader.prototype.getCategories = function() {
+    return this._categoryFilters;
+};
+
+/**
+ * Shows log messages associated with given category.
+ *
+ * @method showCategory
+ * @param {String} Category name.
+ */
+YAHOO.widget.LogReader.prototype.showCategory = function(sCategory) {
+    var filtersArray = this._categoryFilters;
+    // Don't do anything if category is already enabled
+    // Use Array.indexOf if available...
+    if(filtersArray.indexOf) {
+         if(filtersArray.indexOf(sCategory) >  -1) {
+            return;
+        }
+    }
+    // ...or do it the old-fashioned way
+    else {
+        for(var i=0; i<filtersArray.length; i++) {
+           if(filtersArray[i] === sCategory){
+                return;
+            }
+        }
+    }
+
+    this._categoryFilters.push(sCategory);
+    this._filterLogs();
+    var elCheckbox = this.getCheckbox(sCategory);
+    if(elCheckbox) {
+        elCheckbox.checked = true;
+    }
+};
+
+/**
+ * Hides log messages associated with given category.
+ *
+ * @method hideCategory
+ * @param {String} Category name.
+ */
+YAHOO.widget.LogReader.prototype.hideCategory = function(sCategory) {
+    var filtersArray = this._categoryFilters;
+    for(var i=0; i<filtersArray.length; i++) {
+        if(sCategory == filtersArray[i]) {
+            filtersArray.splice(i, 1);
+            break;
+        }
+    }
+    this._filterLogs();
+    var elCheckbox = this.getCheckbox(sCategory);
+    if(elCheckbox) {
+        elCheckbox.checked = false;
+    }
+};
+
+/**
+ * Returns array of enabled sources.
+ *
+ * @method getSources
+ * @return {Array} Array of enabled sources.
+ */
+YAHOO.widget.LogReader.prototype.getSources = function() {
+    return this._sourceFilters;
+};
+
+/**
+ * Shows log messages associated with given source.
+ *
+ * @method showSource
+ * @param {String} Source name.
+ */
+YAHOO.widget.LogReader.prototype.showSource = function(sSource) {
+    var filtersArray = this._sourceFilters;
+    // Don't do anything if category is already enabled
+    // Use Array.indexOf if available...
+    if(filtersArray.indexOf) {
+         if(filtersArray.indexOf(sSource) >  -1) {
+            return;
+        }
+    }
+    // ...or do it the old-fashioned way
+    else {
+        for(var i=0; i<filtersArray.length; i++) {
+           if(sSource == filtersArray[i]){
+                return;
+            }
+        }
+    }
+    filtersArray.push(sSource);
+    this._filterLogs();
+    var elCheckbox = this.getCheckbox(sSource);
+    if(elCheckbox) {
+        elCheckbox.checked = true;
+    }
+};
+
+/**
+ * Hides log messages associated with given source.
+ *
+ * @method hideSource
+ * @param {String} Source name.
+ */
+YAHOO.widget.LogReader.prototype.hideSource = function(sSource) {
+    var filtersArray = this._sourceFilters;
+    for(var i=0; i<filtersArray.length; i++) {
+        if(sSource == filtersArray[i]) {
+            filtersArray.splice(i, 1);
+            break;
+        }
+    }
+    this._filterLogs();
+    var elCheckbox = this.getCheckbox(sSource);
+    if(elCheckbox) {
+        elCheckbox.checked = false;
+    }
+};
+
+/**
+ * Does not delete any log messages, but clears all printed log messages from
+ * the console. Log messages will be printed out again if user re-filters. The
+ * static method YAHOO.widget.Logger.reset() should be called in order to
+ * actually delete log messages.
+ *
+ * @method clearConsole
+ */
+YAHOO.widget.LogReader.prototype.clearConsole = function() {
+    // Clear the buffer of any pending messages
+    this._timeout = null;
+    this._buffer = [];
+    this._consoleMsgCount = 0;
+
+    var elConsole = this._elConsole;
+    while(elConsole.hasChildNodes()) {
+        elConsole.removeChild(elConsole.firstChild);
+    }
+};
+
+/**
+ * Updates title to given string.
+ *
+ * @method setTitle
+ * @param sTitle {String} New title.
+ */
+YAHOO.widget.LogReader.prototype.setTitle = function(sTitle) {
+    this._title.innerHTML = this.html2Text(sTitle);
+};
+
+/**
+ * Gets timestamp of the last log.
+ *
+ * @method getLastTime
+ * @return {Date} Timestamp of the last log.
+ */
+YAHOO.widget.LogReader.prototype.getLastTime = function() {
+    return this._lastTime;
+};
+
+/**
+ * Formats message string to HTML for output to console.
+ *
+ * @method formatMsg
+ * @param oLogMsg {Object} Log message object.
+ * @return {String} HTML-formatted message for output to console.
+ */
+YAHOO.widget.LogReader.prototype.formatMsg = function(oLogMsg) {
+    var category = oLogMsg.category;
+    
+    // Label for color-coded display
+    var label = category.substring(0,4).toUpperCase();
+
+    // Calculate the elapsed time to be from the last item that passed through the filter,
+    // not the absolute previous item in the stack
+
+    var time = oLogMsg.time;
+    if (time.toLocaleTimeString) {
+        var localTime  = time.toLocaleTimeString();
+    }
+    else {
+        localTime = time.toString();
+    }
+
+    var msecs = time.getTime();
+    var startTime = YAHOO.widget.Logger.getStartTime();
+    var totalTime = msecs - startTime;
+    var elapsedTime = msecs - this.getLastTime();
+
+    var source = oLogMsg.source;
+    var sourceDetail = oLogMsg.sourceDetail;
+    var sourceAndDetail = (sourceDetail) ?
+        source + " " + sourceDetail : source;
+        
+    
+    // Escape HTML entities in the log message itself for output to console
+    //var msg = this.html2Text(oLogMsg.msg); //TODO: delete
+    var msg = this.html2Text(YAHOO.lang.dump(oLogMsg.msg));
+
+    // Verbose output includes extra line breaks
+    var output =  (this.verboseOutput) ?
+        ["<pre class=\"yui-log-verbose\"><p><span class='", category, "'>", label, "</span> ",
+        totalTime, "ms (+", elapsedTime, ") ",
+        localTime, ": ",
+        "</p><p>",
+        sourceAndDetail,
+        ": </p><p>",
+        msg,
+        "</p></pre>"] :
+
+        ["<pre><p><span class='", category, "'>", label, "</span> ",
+        totalTime, "ms (+", elapsedTime, ") ",
+        localTime, ": ",
+        sourceAndDetail, ": ",
+        msg, "</p></pre>"];
+
+    return output.join("");
+};
+
+/**
+ * Converts input chars "<", ">", and "&" to HTML entities.
+ *
+ * @method html2Text
+ * @param sHtml {String} String to convert.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype.html2Text = function(sHtml) {
+    if(sHtml) {
+        sHtml += "";
+        return sHtml.replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;");
+    }
+    return "";
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private member variables
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Internal class member to index multiple LogReader instances.
+ *
+ * @property _memberName
+ * @static
+ * @type Number
+ * @default 0
+ * @private
+ */
+YAHOO.widget.LogReader._index = 0;
+
+/**
+ * Name of LogReader instance.
+ *
+ * @property _sName
+ * @type String
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._sName = null;
+
+//TODO: remove
+/**
+ * A class member shared by all LogReaders if a container needs to be
+ * created during instantiation. Will be null if a container element never needs to
+ * be created on the fly, such as when the implementer passes in their own element.
+ *
+ * @property _elDefaultContainer
+ * @type HTMLElement
+ * @private
+ */
+//YAHOO.widget.LogReader._elDefaultContainer = null;
+
+/**
+ * Buffer of log message objects for batch output.
+ *
+ * @property _buffer
+ * @type Object[]
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._buffer = null;
+
+/**
+ * Number of log messages output to console.
+ *
+ * @property _consoleMsgCount
+ * @type Number
+ * @default 0
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._consoleMsgCount = 0;
+
+/**
+ * Date of last output log message.
+ *
+ * @property _lastTime
+ * @type Date
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._lastTime = null;
+
+/**
+ * Batched output timeout ID.
+ *
+ * @property _timeout
+ * @type Number
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._timeout = null;
+
+/**
+ * Hash of filters and their related checkbox elements.
+ *
+ * @property _filterCheckboxes
+ * @type Object
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._filterCheckboxes = null;
+
+/**
+ * Array of filters for log message categories.
+ *
+ * @property _categoryFilters
+ * @type String[]
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._categoryFilters = null;
+
+/**
+ * Array of filters for log message sources.
+ *
+ * @property _sourceFilters
+ * @type String[]
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._sourceFilters = null;
+
+/**
+ * LogReader container element.
+ *
+ * @property _elContainer
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elContainer = null;
+
+/**
+ * LogReader header element.
+ *
+ * @property _elHd
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elHd = null;
+
+/**
+ * LogReader collapse element.
+ *
+ * @property _elCollapse
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elCollapse = null;
+
+/**
+ * LogReader collapse button element.
+ *
+ * @property _btnCollapse
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._btnCollapse = null;
+
+/**
+ * LogReader title header element.
+ *
+ * @property _title
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._title = null;
+
+/**
+ * LogReader console element.
+ *
+ * @property _elConsole
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elConsole = null;
+
+/**
+ * LogReader footer element.
+ *
+ * @property _elFt
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elFt = null;
+
+/**
+ * LogReader buttons container element.
+ *
+ * @property _elBtns
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elBtns = null;
+
+/**
+ * Container element for LogReader category filter checkboxes.
+ *
+ * @property _elCategoryFilters
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elCategoryFilters = null;
+
+/**
+ * Container element for LogReader source filter checkboxes.
+ *
+ * @property _elSourceFilters
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._elSourceFilters = null;
+
+/**
+ * LogReader pause button element.
+ *
+ * @property _btnPause
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._btnPause = null;
+
+/**
+ * Clear button element.
+ *
+ * @property _btnClear
+ * @type HTMLElement
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._btnClear = null;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private methods
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Initializes the primary container element.
+ *
+ * @method _initContainerEl
+ * @param elContainer {HTMLElement} Container element by reference or string ID.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initContainerEl = function(elContainer) {
+    // Validate container
+    elContainer = YAHOO.util.Dom.get(elContainer);
+    // Attach to existing container...
+    if(elContainer && elContainer.tagName && (elContainer.tagName.toLowerCase() == "div")) {
+        this._elContainer = elContainer;
+        YAHOO.util.Dom.addClass(this._elContainer,"yui-log");
+    }
+    // ...or create container from scratch
+    else {
+        this._elContainer = document.body.appendChild(document.createElement("div"));
+        //this._elContainer.id = "yui-log" + this._sName;
+        YAHOO.util.Dom.addClass(this._elContainer,"yui-log");
+        YAHOO.util.Dom.addClass(this._elContainer,"yui-log-container");
+
+        //YAHOO.widget.LogReader._elDefaultContainer = this._elContainer;
+
+        // If implementer has provided container values, trust and set those
+        var containerStyle = this._elContainer.style;
+        if(this.width) {
+            containerStyle.width = this.width;
+        }
+        if(this.right) {
+            containerStyle.right = this.right;
+        }
+        if(this.top) {
+            containerStyle.top = this.top;
+        }
+         if(this.left) {
+            containerStyle.left = this.left;
+            containerStyle.right = "auto";
+        }
+        if(this.bottom) {
+            containerStyle.bottom = this.bottom;
+            containerStyle.top = "auto";
+        }
+       if(this.fontSize) {
+            containerStyle.fontSize = this.fontSize;
+        }
+        // For Opera
+        if(navigator.userAgent.toLowerCase().indexOf("opera") != -1) {
+            document.body.style += '';
+        }
+    }
+};
+
+/**
+ * Initializes the header element.
+ *
+ * @method _initHeaderEl
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initHeaderEl = function() {
+    var oSelf = this;
+
+    // Destroy header
+    if(this._elHd) {
+        // Unhook DOM events
+        YAHOO.util.Event.purgeElement(this._elHd, true);
+
+        // Remove DOM elements
+        this._elHd.innerHTML = "";
+    }
+    
+    // Create header
+    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";
+};
+
+/**
+ * Initializes the console element.
+ *
+ * @method _initConsoleEl
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initConsoleEl = function() {
+    // Destroy console
+    if(this._elConsole) {
+        // Unhook DOM events
+        YAHOO.util.Event.purgeElement(this._elConsole, true);
+
+        // Remove DOM elements
+        this._elConsole.innerHTML = "";
+    }
+
+    // Ceate console
+    this._elConsole = this._elContainer.appendChild(document.createElement("div"));
+    this._elConsole.className = "yui-log-bd";
+
+    // If implementer has provided console, trust and set those
+    if(this.height) {
+        this._elConsole.style.height = this.height;
+    }
+};
+
+/**
+ * Initializes the footer element.
+ *
+ * @method _initFooterEl
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initFooterEl = function() {
+    var oSelf = this;
+
+    // Don't create footer elements if footer is disabled
+    if(this.footerEnabled) {
+        // Destroy console
+        if(this._elFt) {
+            // Unhook DOM events
+            YAHOO.util.Event.purgeElement(this._elFt, true);
+
+            // Remove DOM elements
+            this._elFt.innerHTML = "";
+        }
+
+        this._elFt = this._elContainer.appendChild(document.createElement("div"));
+        this._elFt.className = "yui-log-ft";
+
+        this._elBtns = this._elFt.appendChild(document.createElement("div"));
+        this._elBtns.className = "yui-log-btns";
+
+        this._btnPause = document.createElement("input");
+        this._btnPause.type = "button";
+        //this._btnPause.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";
+    }
+};
+
+/**
+ * Initializes Drag and Drop on the header element.
+ *
+ * @method _initDragDrop
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initDragDrop = function() {
+    // If Drag and Drop utility is available...
+    // ...and draggable is true...
+    // ...then make the header draggable
+    if(YAHOO.util.DD && this.draggable && this._elHd) {
+        var ylog_dd = new YAHOO.util.DD(this._elContainer);
+        ylog_dd.setHandleElId(this._elHd.id);
+        //TODO: use class name
+        this._elHd.style.cursor = "move";
+    }
+};
+
+/**
+ * Initializes category filters.
+ *
+ * @method _initCategories
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initCategories = function() {
+    // Initialize category filters
+    this._categoryFilters = [];
+    var aInitialCategories = YAHOO.widget.Logger.categories;
+
+    for(var j=0; j < aInitialCategories.length; j++) {
+        var sCategory = aInitialCategories[j];
+
+        // Add category to the internal array of filters
+        this._categoryFilters.push(sCategory);
+
+        // Add checkbox element if UI is enabled
+        if(this._elCategoryFilters) {
+            this._createCategoryCheckbox(sCategory);
+        }
+    }
+};
+
+/**
+ * Initializes source filters.
+ *
+ * @method _initSources
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._initSources = function() {
+    // Initialize source filters
+    this._sourceFilters = [];
+    var aInitialSources = YAHOO.widget.Logger.sources;
+
+    for(var j=0; j < aInitialSources.length; j++) {
+        var sSource = aInitialSources[j];
+
+        // Add source to the internal array of filters
+        this._sourceFilters.push(sSource);
+
+        // Add checkbox element if UI is enabled
+        if(this._elSourceFilters) {
+            this._createSourceCheckbox(sSource);
+        }
+    }}
+;
+
+/**
+ * Creates the UI for a category filter in the LogReader footer element.
+ *
+ * @method _createCategoryCheckbox
+ * @param sCategory {String} Category name.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._createCategoryCheckbox = function(sCategory) {
+    var oSelf = this;
+
+    if(this._elFt) {
+        var elParent = this._elCategoryFilters;
+        var elFilter = elParent.appendChild(document.createElement("span"));
+        elFilter.className = "yui-log-filtergrp";
+        
+        // Append el at the end so IE 5.5 can set "type" attribute
+        // and THEN set checked property
+        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;
+
+        // Subscribe to the click event
+        YAHOO.util.Event.addListener(chkCategory,'click',oSelf._onCheckCategory,oSelf);
+
+        // Create and class the text label
+        var lblCategory = elFilter.appendChild(document.createElement("label"));
+        lblCategory.htmlFor = chkCategory.id;
+        lblCategory.className = sCategory;
+        lblCategory.innerHTML = sCategory;
+        
+        this._filterCheckboxes[sCategory] = chkCategory;
+    }
+};
+
+/**
+ * Creates a checkbox in the LogReader footer element to filter by source.
+ *
+ * @method _createSourceCheckbox
+ * @param sSource {String} Source name.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._createSourceCheckbox = function(sSource) {
+    var oSelf = this;
+
+    if(this._elFt) {
+        var elParent = this._elSourceFilters;
+        var elFilter = elParent.appendChild(document.createElement("span"));
+        elFilter.className = "yui-log-filtergrp";
+
+        // Append el at the end so IE 5.5 can set "type" attribute
+        // and THEN set checked property
+        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;
+
+        // Subscribe to the click event
+        YAHOO.util.Event.addListener(chkSource,'click',oSelf._onCheckSource,oSelf);
+
+        // Create and class the text label
+        var lblSource = elFilter.appendChild(document.createElement("label"));
+        lblSource.htmlFor = chkSource.id;
+        lblSource.className = sSource;
+        lblSource.innerHTML = sSource;
+        
+        this._filterCheckboxes[sSource] = chkSource;
+    }
+};
+
+/**
+ * Reprints all log messages in the stack through filters.
+ *
+ * @method _filterLogs
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._filterLogs = function() {
+    // Reprint stack with new filters
+    if (this._elConsole !== null) {
+        this.clearConsole();
+        this._printToConsole(YAHOO.widget.Logger.getStack());
+    }
+};
+
+/**
+ * Sends buffer of log messages to output and clears buffer.
+ *
+ * @method _printBuffer
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._printBuffer = function() {
+    this._timeout = null;
+
+    if(this._elConsole !== null) {
+        var thresholdMax = this.thresholdMax;
+        thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500;
+        if(this._consoleMsgCount < thresholdMax) {
+            var entries = [];
+            for (var i=0; i<this._buffer.length; i++) {
+                entries[i] = this._buffer[i];
+            }
+            this._buffer = [];
+            this._printToConsole(entries);
+        }
+        else {
+            this._filterLogs();
+        }
+        
+        if(!this.newestOnTop) {
+            this._elConsole.scrollTop = this._elConsole.scrollHeight;
+        }
+    }
+};
+
+/**
+ * Cycles through an array of log messages, and outputs each one to the console
+ * if its category has not been filtered out.
+ *
+ * @method _printToConsole
+ * @param aEntries {Object[]} Array of LogMsg objects to output to console.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._printToConsole = function(aEntries) {
+    // Manage the number of messages displayed in the console
+    var entriesLen = aEntries.length;
+    var thresholdMin = this.thresholdMin;
+    if(isNaN(thresholdMin) || (thresholdMin > this.thresholdMax)) {
+        thresholdMin = 0;
+    }
+    var entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0;
+    
+    // Iterate through all log entries 
+    var sourceFiltersLen = this._sourceFilters.length;
+    var categoryFiltersLen = this._categoryFilters.length;
+    for(var i=entriesStartIndex; i<entriesLen; i++) {
+        // Print only the ones that filter through
+        var okToPrint = false;
+        var okToFilterCats = false;
+
+        // Get log message details
+        var entry = aEntries[i];
+        var source = entry.source;
+        var category = entry.category;
+
+        for(var j=0; j<sourceFiltersLen; j++) {
+            if(source == this._sourceFilters[j]) {
+                okToFilterCats = true;
+                break;
+            }
+        }
+        if(okToFilterCats) {
+            for(var k=0; k<categoryFiltersLen; k++) {
+                if(category == this._categoryFilters[k]) {
+                    okToPrint = true;
+                    break;
+                }
+            }
+        }
+        if(okToPrint) {
+            var output = this.formatMsg(entry);
+            if(this.newestOnTop) {
+                this._elConsole.innerHTML = output + this._elConsole.innerHTML;
+            }
+            else {
+                this._elConsole.innerHTML += output;
+            }
+            this._consoleMsgCount++;
+            this._lastTime = entry.time.getTime();
+        }
+    }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Private event handlers
+//
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Handles Logger's categoryCreateEvent.
+ *
+ * @method _onCategoryCreate
+ * @param sType {String} The event.
+ * @param aArgs {Object[]} Data passed from event firer.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onCategoryCreate = function(sType, aArgs, oSelf) {
+    var category = aArgs[0];
+    
+    // Add category to the internal array of filters
+    oSelf._categoryFilters.push(category);
+
+    if(oSelf._elFt) {
+        oSelf._createCategoryCheckbox(category);
+    }
+};
+
+/**
+ * Handles Logger's sourceCreateEvent.
+ *
+ * @method _onSourceCreate
+ * @param sType {String} The event.
+ * @param aArgs {Object[]} Data passed from event firer.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onSourceCreate = function(sType, aArgs, oSelf) {
+    var source = aArgs[0];
+    
+    // Add source to the internal array of filters
+    oSelf._sourceFilters.push(source);
+
+    if(oSelf._elFt) {
+        oSelf._createSourceCheckbox(source);
+    }
+};
+
+/**
+ * Handles check events on the category filter checkboxes.
+ *
+ * @method _onCheckCategory
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onCheckCategory = function(v, oSelf) {
+    var category = this.category;
+    if(!this.checked) {
+        oSelf.hideCategory(category);
+    }
+    else {
+        oSelf.showCategory(category);
+    }
+};
+
+/**
+ * Handles check events on the category filter checkboxes.
+ *
+ * @method _onCheckSource
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onCheckSource = function(v, oSelf) {
+    var source = this.source;
+    if(!this.checked) {
+        oSelf.hideSource(source);
+    }
+    else {
+        oSelf.showSource(source);
+    }
+};
+
+/**
+ * Handles click events on the collapse button.
+ *
+ * @method _onClickCollapseBtn
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {Object} The LogReader instance
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onClickCollapseBtn = function(v, oSelf) {
+    if(!oSelf.isCollapsed) {
+        oSelf.collapse();
+    }
+    else {
+        oSelf.expand();
+    }
+};
+
+/**
+ * Handles click events on the pause button.
+ *
+ * @method _onClickPauseBtn
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onClickPauseBtn = function(v, oSelf) {
+    if(!oSelf.isPaused) {
+        oSelf.pause();
+    }
+    else {
+        oSelf.resume();
+    }
+};
+
+/**
+ * Handles click events on the clear button.
+ *
+ * @method _onClickClearBtn
+ * @param v {HTMLEvent} The click event.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onClickClearBtn = function(v, oSelf) {
+    oSelf.clearConsole();
+};
+
+/**
+ * Handles Logger's newLogEvent.
+ *
+ * @method _onNewLog
+ * @param sType {String} The event.
+ * @param aArgs {Object[]} Data passed from event firer.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onNewLog = function(sType, aArgs, oSelf) {
+    var logEntry = aArgs[0];
+    oSelf._buffer.push(logEntry);
+
+    if (oSelf.logReaderEnabled === true && oSelf._timeout === null) {
+        oSelf._timeout = setTimeout(function(){oSelf._printBuffer();}, oSelf.outputBuffer);
+    }
+};
+
+/**
+ * Handles Logger's resetEvent.
+ *
+ * @method _onReset
+ * @param sType {String} The event.
+ * @param aArgs {Object[]} Data passed from event firer.
+ * @param oSelf {Object} The LogReader instance.
+ * @private
+ */
+YAHOO.widget.LogReader.prototype._onReset = function(sType, aArgs, oSelf) {
+    oSelf._filterLogs();
+};
+
+ /**
+ * The Logger widget provides a simple way to read or write log messages in
+ * JavaScript code. Integration with the YUI Library's debug builds allow
+ * implementers to access under-the-hood events, errors, and debugging messages.
+ * Output may be read through a LogReader console and/or output to a browser
+ * console.
+ *
+ * @module logger
+ * @requires yahoo, event, dom
+ * @optional dragdrop
+ * @namespace YAHOO.widget
+ * @title Logger Widget
+ */
+
+/****************************************************************************/
+/****************************************************************************/
+/****************************************************************************/
+
+// Define once
+if(!YAHOO.widget.Logger) {
+    /**
+     * The singleton Logger class provides core log management functionality. Saves
+     * logs written through the global YAHOO.log function or written by a LogWriter
+     * instance. Provides access to logs for reading by a LogReader instance or
+     * native browser console such as the Firebug extension to Firefox or Safari's
+     * JavaScript console through integration with the console.log() method.
+     *
+     * @class Logger
+     * @static
+     */
+    YAHOO.widget.Logger = {
+        // Initialize properties
+        loggerEnabled: true,
+        _browserConsoleEnabled: false,
+        categories: ["info","warn","error","time","window"],
+        sources: ["global"],
+        _stack: [], // holds all log msgs
+        maxStackEntries: 2500,
+        _startTime: new Date().getTime(), // static start timestamp
+        _lastTime: null // timestamp of last logged message
+    };
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public properties
+    //
+    /////////////////////////////////////////////////////////////////////////////
+    /**
+     * True if Logger is enabled, false otherwise.
+     *
+     * @property loggerEnabled
+     * @type Boolean
+     * @static
+     * @default true
+     */
+
+    /**
+     * Array of categories.
+     *
+     * @property categories
+     * @type String[]
+     * @static
+     * @default ["info","warn","error","time","window"]
+     */
+
+    /**
+     * Array of sources.
+     *
+     * @property sources
+     * @type String[]
+     * @static
+     * @default ["global"]
+     */
+
+    /**
+     * Upper limit on size of internal stack.
+     *
+     * @property maxStackEntries
+     * @type Number
+     * @static
+     * @default 2500
+     */
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private properties
+    //
+    /////////////////////////////////////////////////////////////////////////////
+    /**
+     * Internal property to track whether output to browser console is enabled.
+     *
+     * @property _browserConsoleEnabled
+     * @type Boolean
+     * @static
+     * @default false
+     * @private
+     */
+
+    /**
+     * Array to hold all log messages.
+     *
+     * @property _stack
+     * @type Array
+     * @static
+     * @private
+     */
+    /**
+     * Static timestamp of Logger initialization.
+     *
+     * @property _startTime
+     * @type Date
+     * @static
+     * @private
+     */
+    /**
+     * Timestamp of last logged message.
+     *
+     * @property _lastTime
+     * @type Date
+     * @static
+     * @private
+     */
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
+    /**
+     * Saves a log message to the stack and fires newLogEvent. If the log message is
+     * assigned to an unknown category, creates a new category. If the log message is
+     * from an unknown source, creates a new source.  If browser console is enabled,
+     * outputs the log message to browser console.
+     *
+     * @method log
+     * @param sMsg {String} The log message.
+     * @param sCategory {String} Category of log message, or null.
+     * @param sSource {String} Source of LogWriter, or null if global.
+     */
+    YAHOO.widget.Logger.log = function(sMsg, sCategory, sSource) {
+        if(this.loggerEnabled) {
+            if(!sCategory) {
+                sCategory = "info"; // default category
+            }
+            else {
+                sCategory = sCategory.toLocaleLowerCase();
+                if(this._isNewCategory(sCategory)) {
+                    this._createNewCategory(sCategory);
+                }
+            }
+            var sClass = "global"; // default source
+            var sDetail = null;
+            if(sSource) {
+                var spaceIndex = sSource.indexOf(" ");
+                if(spaceIndex > 0) {
+                    // Substring until first space
+                    sClass = sSource.substring(0,spaceIndex);
+                    // The rest of the source
+                    sDetail = sSource.substring(spaceIndex,sSource.length);
+                }
+                else {
+                    sClass = sSource;
+                }
+                if(this._isNewSource(sClass)) {
+                    this._createNewSource(sClass);
+                }
+            }
+
+            var timestamp = new Date();
+            var logEntry = new YAHOO.widget.LogMsg({
+                msg: sMsg,
+                time: timestamp,
+                category: sCategory,
+                source: sClass,
+                sourceDetail: sDetail
+            });
+
+            var stack = this._stack;
+            var maxStackEntries = this.maxStackEntries;
+            if(maxStackEntries && !isNaN(maxStackEntries) &&
+                (stack.length >= maxStackEntries)) {
+                stack.shift();
+            }
+            stack.push(logEntry);
+            this.newLogEvent.fire(logEntry);
+
+            if(this._browserConsoleEnabled) {
+                this._printToBrowserConsole(logEntry);
+            }
+            return true;
+        }
+        else {
+            return false;
+        }
+    };
+
+    /**
+     * Resets internal stack and startTime, enables Logger, and fires logResetEvent.
+     *
+     * @method reset
+     */
+    YAHOO.widget.Logger.reset = function() {
+        this._stack = [];
+        this._startTime = new Date().getTime();
+        this.loggerEnabled = true;
+        this.log("Logger reset");
+        this.logResetEvent.fire();
+    };
+
+    /**
+     * Public accessor to internal stack of log message objects.
+     *
+     * @method getStack
+     * @return {Object[]} Array of log message objects.
+     */
+    YAHOO.widget.Logger.getStack = function() {
+        return this._stack;
+    };
+
+    /**
+     * Public accessor to internal start time.
+     *
+     * @method getStartTime
+     * @return {Date} Internal date of when Logger singleton was initialized.
+     */
+    YAHOO.widget.Logger.getStartTime = function() {
+        return this._startTime;
+    };
+
+    /**
+     * Disables output to the browser's global console.log() function, which is used
+     * by the Firebug extension to Firefox as well as Safari.
+     *
+     * @method disableBrowserConsole
+     */
+    YAHOO.widget.Logger.disableBrowserConsole = function() {
+        YAHOO.log("Logger output to the function console.log() has been disabled.");
+        this._browserConsoleEnabled = false;
+    };
+
+    /**
+     * Enables output to the browser's global console.log() function, which is used
+     * by the Firebug extension to Firefox as well as Safari.
+     *
+     * @method enableBrowserConsole
+     */
+    YAHOO.widget.Logger.enableBrowserConsole = function() {
+        this._browserConsoleEnabled = true;
+        YAHOO.log("Logger output to the function console.log() has been enabled.");
+    };
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Public events
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+     /**
+     * Fired when a new category has been created.
+     *
+     * @event categoryCreateEvent
+     * @param sCategory {String} Category name.
+     */
+    YAHOO.widget.Logger.categoryCreateEvent =
+        new YAHOO.util.CustomEvent("categoryCreate", this, true);
+
+     /**
+     * Fired when a new source has been named.
+     *
+     * @event sourceCreateEvent
+     * @param sSource {String} Source name.
+     */
+    YAHOO.widget.Logger.sourceCreateEvent =
+        new YAHOO.util.CustomEvent("sourceCreate", this, true);
+
+     /**
+     * Fired when a new log message has been created.
+     *
+     * @event newLogEvent
+     * @param sMsg {String} Log message.
+     */
+    YAHOO.widget.Logger.newLogEvent = new YAHOO.util.CustomEvent("newLog", this, true);
+
+    /**
+     * Fired when the Logger has been reset has been created.
+     *
+     * @event logResetEvent
+     */
+    YAHOO.widget.Logger.logResetEvent = new YAHOO.util.CustomEvent("logReset", this, true);
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private methods
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Creates a new category of log messages and fires categoryCreateEvent.
+     *
+     * @method _createNewCategory
+     * @param sCategory {String} Category name.
+     * @private
+     */
+    YAHOO.widget.Logger._createNewCategory = function(sCategory) {
+        this.categories.push(sCategory);
+        this.categoryCreateEvent.fire(sCategory);
+    };
+
+    /**
+     * Checks to see if a category has already been created.
+     *
+     * @method _isNewCategory
+     * @param sCategory {String} Category name.
+     * @return {Boolean} Returns true if category is unknown, else returns false.
+     * @private
+     */
+    YAHOO.widget.Logger._isNewCategory = function(sCategory) {
+        for(var i=0; i < this.categories.length; i++) {
+            if(sCategory == this.categories[i]) {
+                return false;
+            }
+        }
+        return true;
+    };
+
+    /**
+     * Creates a new source of log messages and fires sourceCreateEvent.
+     *
+     * @method _createNewSource
+     * @param sSource {String} Source name.
+     * @private
+     */
+    YAHOO.widget.Logger._createNewSource = function(sSource) {
+        this.sources.push(sSource);
+        this.sourceCreateEvent.fire(sSource);
+    };
+
+    /**
+     * Checks to see if a source already exists.
+     *
+     * @method _isNewSource
+     * @param sSource {String} Source name.
+     * @return {Boolean} Returns true if source is unknown, else returns false.
+     * @private
+     */
+    YAHOO.widget.Logger._isNewSource = function(sSource) {
+        if(sSource) {
+            for(var i=0; i < this.sources.length; i++) {
+                if(sSource == this.sources[i]) {
+                    return false;
+                }
+            }
+            return true;
+        }
+    };
+
+    /**
+     * Outputs a log message to global console.log() function.
+     *
+     * @method _printToBrowserConsole
+     * @param oEntry {Object} Log entry object.
+     * @private
+     */
+    YAHOO.widget.Logger._printToBrowserConsole = function(oEntry) {
+        if(window.console && console.log) {
+            var category = oEntry.category;
+            var label = oEntry.category.substring(0,4).toUpperCase();
+
+            var time = oEntry.time;
+            if (time.toLocaleTimeString) {
+                var localTime  = time.toLocaleTimeString();
+            }
+            else {
+                localTime = time.toString();
+            }
+
+            var msecs = time.getTime();
+            var elapsedTime = (YAHOO.widget.Logger._lastTime) ?
+                (msecs - YAHOO.widget.Logger._lastTime) : 0;
+            YAHOO.widget.Logger._lastTime = msecs;
+
+            var output =
+                localTime + " (" +
+                elapsedTime + "ms): " +
+                oEntry.source + ": " +
+                oEntry.msg;
+
+            console.log(output);
+        }
+    };
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Private event handlers
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Handles logging of messages due to window error events.
+     *
+     * @method _onWindowError
+     * @param sMsg {String} The error message.
+     * @param sUrl {String} URL of the error.
+     * @param sLine {String} Line number of the error.
+     * @private
+     */
+    YAHOO.widget.Logger._onWindowError = function(sMsg,sUrl,sLine) {
+        // Logger is not in scope of this event handler
+        try {
+            YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')', "window");
+            if(YAHOO.widget.Logger._origOnWindowError) {
+                YAHOO.widget.Logger._origOnWindowError();
+            }
+        }
+        catch(e) {
+            return false;
+        }
+    };
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // Enable handling of native JavaScript errors
+    // NB: Not all browsers support the window.onerror event
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    if(window.onerror) {
+        // Save any previously defined handler to call
+        YAHOO.widget.Logger._origOnWindowError = window.onerror;
+    }
+    window.onerror = YAHOO.widget.Logger._onWindowError;
+
+    /////////////////////////////////////////////////////////////////////////////
+    //
+    // First log
+    //
+    /////////////////////////////////////////////////////////////////////////////
+
+    YAHOO.widget.Logger.log("Logger initialized");
+}
+
+
+YAHOO.register("logger", YAHOO.widget.Logger, {version: "2.3.0", build: "442"});
index 30e675ccb97ee8682291ec9392b4773501621082..ee978b3037d70d9e4fea3dd6a3ef8a29e02534ba 100755 (executable)
@@ -1,4 +1,523 @@
-Menu Release Notes
+*** version 2.3.0 ***
+
+Fixed the following bugs:
+-------------------------
+
++ Pressing the Esc key when an item in a MenuBar has focus will now result
+  in the item blurring in IE.
+
++ Clicking a YAHOO.widget.MenuItem instance with a "url" configuration property 
+  set will now result in the hiding of its parent YAHOO.widget.Menu instance.
+
++ Creating an empty YAHOO.widget.Menu instance from existing markup will no 
+  longer result in a JavaScript error.
+  
++ The "constraintoviewport" configuration property now correctly keeps a 
+  YAHOO.widget.Menu instance inside the boundaries of the browser viewport.
+
++ Tuned scrolling behavior so that when the user has scrolled to the bottom of 
+  a YAHOO.widget.Menu instance and starts pressing the up arrow key, the 
+  contents begin scrolling only when the next item to be selected is out of 
+  view of the scrollable area.
+
++ Modified "removeMenu" method of YAHOO.widget.MenuManager so that it removes
+  the specified YAHOO.widget.Menu instance from the collection of visible menus.
++ Calling the "destroy" method of a visible YAHOO.widget.Menu instance now
+  purges it from the YAHOO.widget.Manager's collection of visible Menus.
++ YAHOO.widget.Menu instances now blur before hiding.
+
++ The debug version of YAHOO.widget.Menu now correctly logs as "Menu" rather 
+  than "Overlay" in IE.
+  
++ Setting a YAHOO.widget.MenuItem instance's "checked" configuration property 
+  to "true" two or more times followed by "false" will no longer result in some 
+  of the DOM elements used to render the checkmark icon will no longer remain 
+  in the item's DOM.
+
++ It is now possible to click anywhere on a YAHOO.widget.MenuItem instance 
+  and have it navigate to the URL specified by its "url" configuration property 
+  - even if the MenuItem has a value specified for its "target"
+  configuation property.
+
++ The "toString" method of YAHOO.widget.MenuItem now returns the instance's id.
+
++ Setting the YAHOO.widget.MenuItem.prototype.COLLAPSED_SUBMENU_INDICATOR_TEXT 
+  constant to empty string no longer results in JavaScript error.
+
++ YAHOO.widget.MenuBar instances behave the same regardless of the value
+  of their "position" configuration property.
+
++ It is now possible to ctr or shift-click on YAHOO.widget.MenuItem instances 
+  without the browser automatically redirecting to the URL specified by the 
+  MenuItem's "url" configuration property.
+
+
+Added the following features:
+-----------------------------
+
++ Prototype of all classes (Menu, ContextMenu, MenuBar, MenuItem, 
+  ContextMenuItem, MenuBarItem) are augmented with YAHOO.util.EventProvider.
+
++ Added the following methods to YAHOO.widget.MenuManager:
+
+    - "getMenuItem"
+    - "getMenuItemGroup"
+
++ Added the following methods to YAHOO.widget.Menu:
+
+    - "subscribe" 
+    - "getSubmenus"
+    - "onRender"
+
++ Added a "disabled" configuration property to YAHOO.widget.Menu.
+
++ Added the constant "CSS_LABEL_CLASS_NAME" to YAHOO.widget.MenuItem that 
+  represents the name of the CSS class applied to the <A/> node that is the 
+  first child of its root <LI/> node.
+
++ Added the constant "CSS_LABEL_CLASS_NAME" to YAHOO.widget.MenuBarItem that 
+  represents the name of the CSS class applied to the <A/> node that is the 
+  first child of its root <LI/> node.
+
++ Added ability for YAHOO.widget.Menu instances to have shadow:
+
+    - The shadow for a Menu is implemented by appending a new element as the 
+      last child of its root <DIV/> element:
+
+        <DIV class="yuimenu">
+            <DIV class="bd">
+                <UL>
+                    <LI class="yuimenuitem"/>
+                    <LI class="yuimenuitem"/>
+                    <LI class="yuimenuitem"/>
+                </UL>
+            </DIV>
+            <DIV class="yui-menu-shadow"/>
+        </DIV>
+
+    - The code that creates the shadow element resides inside the Menu's 
+      public "onRender" prototype method.  To disable the creation of a Menu's 
+      shadow override the prototype of the "onRender" method:
+      
+      YAHOO.widget.Menu.prototype.onRender = function () { };
+      
+    - The actual creation of the shadow element is deferred until the Menu is 
+      made visible for the first time.
+      
+    - The shadow element is only created for Menu instances whose
+      "position" configuration property is set to "dynamic."
+
+    - A Menu's shadow element can be styled via two CSS classes:
+
+        + "yui-menu-shadow"  - Applied to the shadow element when it is created.
+        + "yui-menu-shadow-visible" - Applied to the shadow element when the 
+        Menu is visible; it is removed when hidden.
+
+    - The shadow element is only styled when using the new "Sam" skin, for
+      the previous default skin its "display" property is set to "none."
+
+
+Changes:
+--------
+
++ Deprecated "browser" property of YAHOO.widget.MenuItem in favor 
+  of the YAHOO.env.ua.
+
++ Modified the DOM structure for a YAHOO.widget.MenuItem instance so that its
+  root <LI/> node only has only two direct descendants: 
+  
+    - The <A/> node for its text label
+    - The <DIV/> node for its submenu
+  
+  The submenu indicator node (<EM class="submenuindicator" />), checked 
+  indicator node (<EM class="checkedindicator" />), and help text node
+  (<EM class="helptext" />) that were previously direct descendants of a
+  YAHOO.widget.MenuItem instance's root <LI/> are now direct descendants of 
+  its <A/> node:
+
+    <LI class="yuimenuitem || yuimenubaritem">
+
+        <A class="yuimenuitemlabel || yuimenubaritemlabel">
+
+            Text Label
+
+            <EM class="helptext"> Help Text </EM>   (Optional)
+            <EM class="checkedindicator"> ... </EM> (Optional)
+            <EM class="submenuindicator"> ... </EM> (Optional)
+
+        </A>
+
+        <DIV class="yuimenu"> ... </DIV> (Optional submenu node)
+
+    </LI>
+
++ As a result of the DOM structure changes for YAHOO.widget.MenuItem, the
+  following CSS class are now only applied to a YAHOO.widget.MenuItem 
+  instance's <A/> node:
+
+    - "selected"
+    - "disabled"
+    - "checked"
+    - "hashelptext"
+    - "hassubmenu"
+
++ The "text" configuration property of YAHOO.widget.MenuItem now accepts a 
+  string of HTML (previously only accepted plain text).
+
++ The "emphasis" and "strongemphasis" configuration properties of 
+  YAHOO.widget.MenuItem are no longer interpreted when building from 
+  existing markup.
+
++ All YAHOO.widget.MenuItem instances built from markup must have an <A> node 
+  as the first child of its root <LI> node.
+
++ When building YAHOO.widget.MenuItem instances from existing markup, the value 
+  of the "text" property is set to the innerHTML of the menu item's <A> node.
+
++ Deprecated the following YAHOO.widget.MenuItem configuration properties:
+
+    - "strongemphasis"
+    - "emphasis"
+    - "helptext"
+
+
+Known Issues
+------------
+
++ ContextMenu works differently in Opera
+  --------------------------------------
+  Opera doesn't support the "contextmenu" DOM event used to trigger the display
+  of YAHOO.widget.ContextMenu instances.  As a result, clicking the right mouse 
+  button in Opera will not result in the display of a ContextMenu instance 
+  as it would in IE, Gecko, and Safari.  To work around this shortcoming, users 
+  will need to do the following to trigger the display of 
+  YAHOO.widget.ContextMenu instances in Opera:
+
+    - Opera for Windows: Hold down the control key while clicking with the 
+      left mouse button.
+
+    - Opera for Mac OS X: Hold down the command/Apple key while clicking with  
+      the left mouse button.
+
++ Focus highlight sticks in Opera 
+  -------------------------------
+  In Opera focus is designated via the application of a background color 
+  to an element's text node.  When a Menu instance has focus in Opera, the 
+  focus highlight can remain on a MenuItem instance even after it has blurred.
+
++ ContextMenu instances cannot be invoked by clicking on Java Applets
+  -------------------------------------------------------------------
+  When a Java Applet is specified as the "trigger" element for a ContextMenu 
+  instance it will not display when the Applet is clicked.  This is not a 
+  bug in the ContextMenu class, but rather a result of DOM events not bubbling 
+  up from inside Java Applets.  For more information on this issue see:
+  http://tech.groups.yahoo.com/group/ydn-javascript/message/12128
+
++ Flash Movies appear on top of Menu instances
+  --------------------------------------------
+  Flash movies can appear on top of Menu instances in IE and Gecko-based
+  browsers.  To fix this problem, set the "wmode" of the Flash movie to either
+  "transparent" or "opaque" as indicated below: 
+
+  Via the <object> tag:
+
+    <object>
+        <param name="wmode" value="opaque">
+    </object>
+
+    <object>
+        <param name="wmode" value="transparent"> 
+    </object>
+
+  Via the <embed> tag:
+    
+    <embed wmode="transparent"> ... </embed>
+    <embed wmode="opaque"> ... </embed>
+
+    ** For more information see 
+       http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15523
+
++ Menu instances not rendered at correct z-index in IE
+  -------------------------------------------------------
+  In IE, when a Menu instance is rendered inside a relatively positioned 
+  element the z-index of the Menu instance is now relative to its 
+  relatively positioned parent element.  This is not a bug in the 
+  Menu class, but rather a bug in IE where relatively positioned elements 
+  establish a new stacking context for their child nodes.  To avoid this 
+  bug is recommend that all Menu instances that need to be able to float
+  above any other element in the document be made direct descendants of the 
+  <body> element.
+  
+  ** For more information see 
+   http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html
+
++ Elements with scrollbars poke through Menu instances floating above them
+  ------------------------------------------------------------------------
+  There is a bug in Gecko-based browsers for Mac OS X where an element's 
+  scrollbars will poke through absolutely positioned elements floating above
+  them.  To fix this problem the "overflow" property of a Menu instance's 
+  shadow element is toggled between "hidden" and "auto" (through the application 
+  and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes) as its 
+  "visibility" configuration property is toggled between "false" and "true."
+  Therefore, the shadow element acts like a shim, blocking scrollbars from
+  poking through the Menu.
+
+  PLEASE NOTE:  
+
+  1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are 
+     applied only for Gecko on Mac OS X and are added/removed to/from the 
+     Menu's root HTML element (DIV) via the "hideMacGeckoScrollbars" and 
+     "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.  
+  
+  2) This fix is only applied when using the "Sam" skin; the CSS for the 
+     original Menu skin does not contain any rules for rendering the 
+     shadow element.  
+  
+  3) Once the fix is applied the bug will reappear if the window loses focus.  
+     This can be fixed via Javascript by hiding and showing the Menu instance 
+     when the window receives focus:
+
+        YAHOO.util.Event.on(window, "focus", function () {
+        
+            oMyMenu.hide();
+            oMyMenu.show();
+        
+        });
+
+    ** For more information see 
+       https://bugzilla.mozilla.org/show_bug.cgi?id=187435
+
+
+*** version 2.2.2 ***
+
+Fixed the following bugs:
+-------------------------
+
++ "toString" method of MenuItem, MenuBarItem and ContextMenuItem classes will
+  no longer throw a JavaScript error when using the debug version 
+  of the Event utility.
+
++ "toString" method of Menu, MenuBar and ContextMenu classes will
+  no longer attempt to output the instance's id if it is not available.
+
++ Logger statements output by debug version of MenuManager are now properly 
+  categorized as "MenuManager"
+
+
+
+*** version 2.2.1 ***
+
+Added the following features:
+-----------------------------
+
++ Added the following methods to YAHOO.widget.Menu:
+  - "focus"
+  - "blur"
+  - "hasFocus"
+
++ Added the following Custom Events to YAHOO.widget.Menu:
+    + "focusEvent"
+    + "blurEvent"
+
++ Added the following methods to YAHOO.widget.MenuManager:
+  - "getFocusedMenuItem"
+  - "getFocusedMenu"
+
++ Added "hasFocus" method to YAHOO.widget.MenuItem
+
+
+Fixed the following bugs:
+-------------------------
+
++ Menu instances no longer set focus to themselves by default when made 
+  visible.  Menus only receive focus in response to the following events: 
+    - The user mouses down on a MenuItem instance
+    - The user tabs into a MenuItem instance
+
++ Application of the "maxheight" configuration property is now correctly 
+  deferred until the "render" event fires when Menu instance is being 
+  lazy loaded.
+
++ The "maxheight" configuration property can now be set multiple times without 
+  a Menu instance restoring itself to its original default height.
+
++ The "maxheight" configuration property can now be set on hidden Menu 
+  instances that use lazy loading. 
+
++ Menu instances with a "width" configuration property set will now render 
+  at the specified width rather than shrink wrapping to their contents.
+
++ Menu item help text no longer wraps to the next line in Opera 9.
+
++ Immediate submenus of a Menubar instance will no longer shift their position 
+  to try and remain inside the confines of the browser's viewport.
+
++ Lazy loaded ContextMenu instances now appear in the correct position when 
+  they are made visible for the first time.
+
++ MenuBar instances no longer throw JavaScript errors when navigating items with
+  submenus containing no active items using the keyboard.
+
++ Replaced use of native "hasOwnProperty" method 
+  with YAHOO.lang.hasOwnProperty.
+
++ Rendered Menu instances will now update their width when items are added 
+  or removed.
+
++ Mousing over a Menu instance in an IE window that does not have focus will 
+  no longer cause the window to receive focus.
+
+
+Changes:
+--------
+
++ "activeItem" property of YAHOO.widget.Menu now returns a reference to the 
+  Menu's currently selected item.
+
++ Added a "visible" CSS class that is applied to visible Menu instances.
+
++ Refactored the Menu family to improve performance, especially when working 
+  with a large number of instances in IE6.
+
+
+
+*** version 2.2.0 ***
+
+Added the following features:
+-----------------------------
+
+* Added two new methods to YAHOO.widget.Menu:
+
+    * "getItems" - Returns a flat array of the items in a menu.
+
+    * "clearContent" - Removes all of the content from the menu, including the 
+      menu items, group titles, header and footer.
+
+
+* Added three new configuration attributes to YAHOO.widget.Menu:
+
+    * "submenuhidedelay" - Number indicating the time (in milliseconds) that 
+      should expire before a submenu is hidden when the user mouses out of a 
+      menu item heading in the direction of a submenu. The value must be 
+      greater than or equal to the value specified for the "showdelay" 
+      configuration property.
+
+    * "maxheight" - Defines the maximum height (in pixels) for a menu before 
+      the contents of the body are scrolled. 
+
+    * "classname" - CSS class to be applied to the menu's root <div> element. 
+      The specified class(es) are appended in addition to the default class as 
+      specified by the menu's CSS_CLASS_NAME constant.
+
+
+* Added new constants to YAHOO.widget.MenuItem:
+
+    * COLLAPSED_SUBMENU_INDICATOR_TEXT - String representing the text for the 
+      <em> element used for the submenu arrow indicator.
+
+    * EXPANDED_SUBMENU_INDICATOR_TEXT - String representing the text for the 
+      submenu arrow indicator element (<em>) when the submenu is visible.
+
+    * DISABLED_SUBMENU_INDICATOR_ALT_TEXT - String representing the text for 
+      the submenu arrow indicator element (<em>) when the menu item is disabled.
+
+    * CHECKED_TEXT - String representing the text to be used for the checked 
+      indicator element (<em>).
+
+    * DISABLED_CHECKED_TEXT - String representing the text to be used for the 
+      checked indicator element (<em>) when the menu item is disabled.
+
+
+* Added two new configuration attributes to YAHOO.widget.MenuItem:
+
+    * "onclick" - Object literal representing the code to be executed when the 
+      button is clicked. Format:
+
+        {
+            fn: Function, // The handler to call when the event fires.
+            obj: Object, // An object to pass back to the handler.
+            scope: Object // The object to use for the scope of the handler.
+        }
+    
+    * "classname" - CSS class to be applied to the menu item's root <li> 
+      element. The specified class(es) are appended in addition to the default 
+      class as specified by the menu item's CSS_CLASS_NAME constant.
+
+
+* Added an "id" property to YAHOO.widget.MenuItem that represents the id of
+  the menu item's root <li> node.  Although not a configuration attribute, this
+  property should be set via the object literal of configuration attributes 
+  passed as the second argument to the constructor.  If no value is 
+  specified, then one will be generated using the "generateId" method of the 
+  Dom utility (YAHOO.widget.Dom).
+
+* Added a "trigger context menu event" 
+  (YAHOO.widget.ContextMenu.triggerContextMenuEvent) that fires when the DOM 
+  "contextmenu" event ("mousedown" for Opera) is fired by one of the elemeents
+  defined as a YAHOO.widget.ContextMenu instance's trigger.
+
+* Added a "cancel" method to YAHOO.widget.ContextMenu that can be used to 
+  cancel the display of a YAHOO.widget.ContextMen instance.  This method 
+  should be called within the scope of a "context menu" event handler for 
+  one of the context menu's triggers 
+  (YAHOO.widget.ContextMenu.triggerContextMenuEvent).
+
+
+Fixed the following bugs:
+-------------------------
+
+* Users can now move diagonally from a menu item to its corresponding submenu 
+  without the submenu hiding immediately.
+
+* "destroy" method of YAHOO.widget.Menu now unsubscribes from the "text resize"  
+  event (YAHOO.widget.Module.textResizeEvent).
+
+* Browser progress bar no longer flashes when hovering over checked menu items 
+  or menu items with submenus.
+
+* Menu item submenu indicator image no longer jumps to the next line in 
+  quirks mode.
+
+* Mouse events no longer fire in Firefox if a YAHOO.widget.Menu instance is 
+  moved by script into a stationary mouse pointer.
+
+* Modified "toString" method of YAHOO.widget.ContextMenuItem to return the 
+  correct class name, as it was reporting as YAHOO.widget.MenuBarItem.
+
+
+Changes:
+--------
+
+* Default value for the "showdelay" configuration attribute is now 250
+
+* Modified code so that all Menu images are added via CSS background images.  
+  As a result, the following constants and properties have been deprecated:
+
+    * YAHOO.widget.MenuItem.SUBMENU_INDICATOR_IMAGE_PATH
+    * YAHOO.widget.MenuItem.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH
+    * YAHOO.widget.MenuItem.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH
+    * YAHOO.widget.MenuItem.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT
+    * YAHOO.widget.MenuItem.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT
+    * YAHOO.widget.MenuItem.DISABLED_SUBMENU_INDICATOR_ALT_TEXT
+    * YAHOO.widget.MenuItem.CHECKED_IMAGE_PATH
+    * YAHOO.widget.MenuItem.SELECTED_CHECKED_IMAGE_PATH
+    * YAHOO.widget.MenuItem.DISABLED_CHECKED_IMAGE_PATH
+    * YAHOO.widget.MenuItem.CHECKED_IMAGE_ALT_TEXT
+    * YAHOO.widget.MenuItem.DISABLED_CHECKED_IMAGE_ALT_TEXT
+    * YAHOO.widget.MenuItem.IMG_ROOT
+    * YAHOO.widget.MenuItem.IMG_ROOT_SSL
+    * YAHOO.widget.MenuItem.imageRoot
+    * YAHOO.widget.MenuItem.isSecure
+
+
+
+*** version 0.12.2 ***
+
+* No changes
+
+
 
 *** version 0.12.1 ***
 
@@ -20,9 +539,9 @@ Fixed the following bugs:
   mouse simultaneously.
 
 * Calling the "destory" method on a menu will now unregister all of the menu's 
-  submenus from the MenuManager.
-  
-  
+  submenus from the MenuManager.  
+
+
 
 *** version 0.12 ***
 
diff --git a/lib/yui/menu/assets/map.gif b/lib/yui/menu/assets/map.gif
new file mode 100755 (executable)
index 0000000..88dae00
Binary files /dev/null and b/lib/yui/menu/assets/map.gif differ
diff --git a/lib/yui/menu/assets/menu-core.css b/lib/yui/menu/assets/menu-core.css
new file mode 100755 (executable)
index 0000000..5dee704
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* Menu & MenuBar styles */
+
+.yuimenu .yuimenu,
+.yuimenubar .yuimenu {
+
+    position: absolute;
+    visibility: hidden;
+
+}
+
+.yuimenubar ul, 
+.yuimenu ul {
+
+    list-style-type: none;    
+
+}
+
+.yuimenubar ul, 
+.yuimenu ul,
+.yuimenubar li, 
+.yuimenu li,
+.yuimenu h6,
+.yuimenubar h6 { 
+
+    margin: 0;
+    padding: 0;
+
+}
+
+.yuimenuitemlabel,
+.yuimenubaritemlabel {
+
+    white-space: nowrap;
+
+}
+
+
+/*
+    PLEASE NOTE: The <DIV> element used for a menu's shadow is appended 
+    to its root element via JavaScript once it has been rendered.  The 
+    code that creates the shadow lives in the menu's public "onRender" 
+    event handler that is a prototype method of YAHOO.widget.Menu.  
+    Implementers wishing to remove a menu's shadow or add any other markup
+    required for a given skin for menu should override the "onRender" method.
+*/
+
+.yui-menu-shadow {
+
+    position: absolute;
+
+}
+
+
+
+/*
+
+There are two known issues with YAHOO.widget.Overlay (the superclass class of 
+Menu) that manifest in Gecko-based browsers on Mac OS X:
+
+    1) Elements with scrollbars will poke through Overlay instances floating 
+       above them.
+    
+    2) An Overlay's scrollbars and the scrollbars of its child nodes remain  
+       visible when the Overlay is hidden.
+
+To fix these bugs in Menu (a subclass of YAHOO.widget.Overlay):
+
+    1) The "overflow" property of a Menu instance's shadow element and child 
+       nodes is toggled between "hidden" and "auto" (through the application  
+       and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes)
+       as its "visibility" configuration property is toggled between 
+       "false" and "true."
+    
+    2) The "display" property of <SELECT> elements that are child nodes of the 
+       Menu instance's root element is set to "none" when it is hidden.
+
+PLEASE NOTE:  
+  
+    1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are 
+       applied only for Gecko on Mac OS X and are added/removed to/from the 
+       Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and 
+       "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.
+    
+    2) There may be instances where the CSS for a web page or application 
+       contains style rules whose specificity override the rules implemented by 
+       the Menu CSS files to fix this bug.  In such cases, is necessary to 
+       leverage the provided "hide-scrollbars" and "show-scrollbars" classes to 
+       write custom style rules to guard against this bug.
+
+** For more information on this issue, see:
+
+   + https://bugzilla.mozilla.org/show_bug.cgi?id=187435
+   + SourceForge bug #1723530
+
+*/
+
+.hide-scrollbars * {
+
+       overflow: hidden;
+
+}
+
+.hide-scrollbars select {
+
+       display: none;
+
+}
+
+
+/*
+
+The following style rule (".yuimenu.show-scrollbars") overrides the 
+".show-scrollbars" rule defined in container-core.css which sets the 
+"overflow" property of a YAHOO.widget.Overlay instance's root HTML element to 
+"auto" when it is visible.  Without this override, a Menu would have scrollbars
+when one of its submenus is visible.
+
+*/
+
+.yuimenu.show-scrollbars {
+
+       overflow: visible; 
+
+}
+
+.yuimenu.hide-scrollbars .yui-menu-shadow {
+
+    overflow: hidden;
+
+}
+
+.yuimenu.show-scrollbars .yui-menu-shadow {
+
+    overflow: auto;
+
+}
\ No newline at end of file
index d341474dc184897eeed5b1e45e9efc75bec203b0..21a0ab9693bed9097eafeaafeea0ca15a5ae309c 100755 (executable)
@@ -1,15 +1,12 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
-http://developer.yahoo.com/yui/license.txt
-Version: 0.12.1
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
 */
+/* Menu & MenuBar styles */
 
-
-
-/* Menu styles */
-
-div.yuimenu {
+.yuimenu {
 
     background-color:#f6f7ee;
     border:solid 1px #c4c4be;
@@ -17,83 +14,92 @@ div.yuimenu {
     
 }
 
-/* Submenus are positioned absolute and hidden by default */
+/*
+
+The following style rule (".yuimenu.show-scrollbars") overrides the 
+".show-scrollbars" rule defined in container.css which sets the 
+"overflow" property of a YAHOO.widget.Overlay instance's root HTML element to 
+"auto" when it is visible.  Without this override, a Menu would have scrollbars
+when one of its submenus is visible.
+
+*/
+
+.yuimenu.show-scrollbars {
+
+       overflow: visible; 
+
+}
+
+.yui-menu-shadow {
 
-div.yuimenu div.yuimenu,
-div.yuimenubar div.yuimenu {
+    display: none;
+
+}
+
+.yuimenu .yuimenu,
+.yuimenubar .yuimenu {
 
     position:absolute;
     visibility:hidden;
 
 }
 
-/* MenuBar Styles */
-
-div.yuimenubar {
+.yuimenubar {
 
     background-color:#f6f7ee;
     
 }
 
-/*
-    Applying a width triggers "haslayout" in IE so that the module's
-    body clears its floated elements
-*/
-div.yuimenubar div.bd {
+.yuimenubar ul {
 
-    width:100%;
+    *zoom:1;
 
 }
 
-/*
-    Clear the module body for other browsers
-*/
-div.yuimenubar div.bd:after {
+.yuimenubar ul:after {
 
-    content:'.';
+    content:".";
     display:block;
     clear:both;
     visibility:hidden;
     height:0;
+    line-height:0;
 
 }
 
-
-/* Matches the group title (H6) inside a Menu or MenuBar instance */
-
-div.yuimenu h6,
-div.yuimenubar h6 { 
+.yuimenu h6,
+.yuimenubar h6 { 
 
     font-size:100%;
-    font-weight:normal;    
+    font-weight:normal;
     margin:0;
     border:solid 1px #c4c4be;
     color:#b9b9b9;    
 
 }
 
-div.yuimenubar h6 {
+.yuimenubar h6 {
 
     float:left;
-    display:inline; /* Prevent margin doubling in IE */
     padding:4px 12px;
     border-width:0 1px 0 0;
-    
+
 }
 
-div.yuimenu h6 {
+.yuimenubar .yuimenu h6 {
 
     float:none;
-    display:block;
-    border-width:1px 0 0 0;
-    padding:5px 10px 0 10px;
 
 }
 
+.yuimenu h6 {
 
-/* Matches the UL inside a Menu or MenuBar instance */
+    border-width:1px 0 0 0;
+    padding:5px 10px 0 10px;
+
+}
 
-div.yuimenubar ul {
+.yuimenubar ul {
 
     list-style-type:none;
     margin:0;
@@ -101,7 +107,7 @@ div.yuimenubar ul {
 
 }
 
-div.yuimenu ul {
+.yuimenu ul {
 
     list-style-type:none;
     border:solid 1px #c4c4be;
@@ -111,187 +117,228 @@ div.yuimenu ul {
 
 }
 
-
-div.yuimenu ul.first-of-type, 
-div.yuimenu ul.hastitle,
-div.yuimenu h6.first-of-type {
+.yuimenu ul.first-of-type, 
+.yuimenu ul.hastitle,
+.yuimenu h6.first-of-type {
 
     border-width:0;
 
 }
 
+.yuimenu .topscrollbar,
+.yuimenu .bottomscrollbar {
+
+    height:16px;
+    background-image:url(map.gif);
+    background-repeat:no-repeat;
+
+}
+
+.yuimenu .topscrollbar {
+
+    background-image:url(map.gif);
+    background-position:center -72px;
+
+}
+
+.yuimenu .topscrollbar_disabled {
+
+    background-image:url(map.gif);
+    background-position:center -88px;
+
+}
+
+.yuimenu .bottomscrollbar {
+
+    background-image:url(map.gif);
+    background-position:center -104px;
+
+}
+
+.yuimenu .bottomscrollbar_disabled {
+
+    background-image:url(map.gif);
+    background-position:center -120px;
+
+}
+
 
 /* MenuItem and MenuBarItem styles */
 
-div.yuimenu li,
-div.yuimenubar li {
+.yuimenubaritem {
+
+    float:left;
+
+}
+
+.yuimenuitemlabel,
+.yuimenubaritemlabel {
 
+    white-space: nowrap;
     font-size:85%;
-    cursor:pointer;
-    cursor:hand;
-    white-space:nowrap;
-    text-align:left;
+    display:block;
+    color:#000;
+    text-decoration:none;
 
 }
 
-div.yuimenu li.yuimenuitem {
+.yuimenuitemlabel {
 
     padding:2px 24px;
+    outline:none;
     
 }
 
-div.yuimenu li li,
-div.yuimenubar li li {
+.yuimenubaritemlabel {
 
-    font-size:100%;
+    border-width:0 0 0 1px;
+    border-style:solid;
+    border-color:#c4c4be;
+    padding:4px 24px;
 
 }
 
+li.first-of-type .yuimenubaritemlabel {
+
+    border-width:0;
 
-/* Matches the help text for a menu item */
+}
 
-div.yuimenu li em {
+.yuimenuitemlabel .helptext {
 
     font-style:normal;
     margin:0 0 0 40px;
+    
+}
+
+.yuimenuitemlabel .submenuindicator,
+.yuimenuitemlabel .checkedindicator, 
+.yuimenubaritemlabel .submenuindicator {
+    
+    display:block;
+    height:8px;
+    width:8px;
+    overflow:hidden;
+    vertical-align:middle;
+    text-indent:9px;
+    background-image:url(http://yui.yahooapis.com/2.2.2/build/menu/assets/map.gif);
+    background-repeat:no-repeat;
 
 }
 
-div.yuimenu li a em {
+.yuimenubaritemlabel .submenuindicator {
 
-    margin:0;
+    display:-moz-inline-stack; /* Gecko */
+    display:inline-block; /* IE, Opera and Safari */
+    font:0/0 arial; /* Gecko */
 
 }
 
-div.yuimenu li a,
-div.yuimenubar li a {
-    
-    /*
-        "zoom:1" triggers "haslayout" in IE to ensure that the mouseover and 
-        mouseout events bubble to the parent LI in IE.
-    */
-    zoom:1;
-    color:#000;
-    text-decoration:none;
-    
+.yuimenuitemlabel .submenuindicator {
+
+    background-position:0 0;
+
 }
 
-div.yuimenu li.hassubmenu,
-div.yuimenu li.hashelptext {
+.yuimenubaritemlabel .submenuindicator {
 
-    text-align:right;
+    background-position:0 -24px;
+    margin:0 0 0 10px;
 
 }
 
-div.yuimenu li.hassubmenu a.hassubmenu,
-div.yuimenu li.hashelptext a.hashelptext {
+.yuimenuitemlabel .checkedindicator {
 
-    float:left;
-    display:inline; /* Prevent margin doubling in IE */
-    text-align:left;
+    background-position:0 -48px;
 
 }
 
+.visible .yuimenuitem,
+.visible .yuimenuitemlabel {
+
+    *zoom:1;
 
-/* Matches focused and selected menu items */
+}
 
-div.yuimenu li.selected,
-div.yuimenubar li.selected {
+.visible .yuimenuitemlabel .helptext {
 
-    background-color:#8c8ad0;
+    float:right;
+    width:100%;
+    text-align:right;
+    margin:-1.2em 0 0 0;
+    *cursor:hand; /* Required to restore the style of the cursor in IE */
 
 }
 
-div.yuimenu li.selected a.selected,
-div.yuimenubar li.selected a.selected {
+.visible .yuimenuitemlabel .submenuindicator {
 
-    text-decoration:underline;
+    margin:-.9em -16px 4px auto;
+    *margin:-.9em -16px 0 105%;
 
 }
 
-div.yuimenu li.selected a.selected,
-div.yuimenu li.selected em.selected, 
-div.yuimenubar li.selected a.selected {
+.visible .yuimenuitemlabel .checkedindicator {
 
-    color:#fff;
+    margin:-.9em auto 4px -16px;
+    *margin-bottom:0;
 
 }
 
 
-/* Matches disabled menu items */
 
-div.yuimenu li.disabled, 
-div.yuimenubar li.disabled {
+/* Matches selected menu items */
 
-    cursor:default;
+.yuimenuitem a.selected,
+.yuimenubaritem a.selected {
+
+    background-color:#8c8ad0;
+    text-decoration:underline;
+    color:#fff;
 
 }
 
-div.yuimenu li.disabled a.disabled,
-div.yuimenu li.disabled em.disabled,
-div.yuimenubar li.disabled a.disabled {
+.yuimenubaritem a.selected .submenuindicator {
+
+    background-position:0 -32px;
 
-    color:#b9b9b9;
-    cursor:default;
-    
 }
 
-div.yuimenubar li.yuimenubaritem {
+.yuimenuitem a.selected .submenuindicator {
 
-    float:left;
-    display:inline; /* Prevent margin doubling in IE */
-    border-width:0 0 0 1px;
-    border-style:solid;
-    border-color:#c4c4be;
-    padding:4px 24px;
-    margin:0;
+    background-position:0 -8px;
 
 }
 
-div.yuimenubar li.yuimenubaritem.first-of-type {
+.yuimenuitem a.selected .checkedindicator {
 
-    border-width:0;
+    background-position:0 -56px;
 
 }
 
 
-/* Matches the submenu indicator for menu items */
+/* Matches disabled menu items */
 
-div.yuimenubar li.yuimenubaritem img {
+.yuimenubaritem a.disabled .submenuindicator {
 
-    height:8px;
-    width:8px;
-    margin:0 0 0 10px;
-    vertical-align:middle;
+    background-position:0 -40px;
 
 }
 
-div.yuimenu li.yuimenuitem img {
+.yuimenuitem a.disabled {
 
-    height:8px;
-    width:8px;
-    margin:0 -16px 0 0;
-    padding-left:10px;
-    border:0;
+    cursor:default;
+    color:#b9b9b9;
 
 }
 
-div.yuimenu li.checked {
+.yuimenuitem a.disabled .submenuindicator {
 
-    position:relative;
+    background-position:0 -16px;
 
 }
 
-div.yuimenu li.checked img.checked {
+.yuimenuitem a.disabled .checkedindicator {
+
+    background-position:0 -64px;
 
-    height:8px;
-    width:8px;
-    margin:0;
-    padding:0;
-    border:0;
-    position:absolute;
-    left:6px;
-    _left:-16px; /* Underscore hack b/c this is for IE 6 only */
-    top:.5em;
-    
 }
\ No newline at end of file
diff --git a/lib/yui/menu/assets/skins/sam/menu-skin.css b/lib/yui/menu/assets/skins/sam/menu-skin.css
new file mode 100755 (executable)
index 0000000..5524977
--- /dev/null
@@ -0,0 +1,418 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* MenuBar style rules */
+
+.yui-skin-sam .yuimenubar {
+
+    border: solid 1px #808080;
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;
+
+}
+
+/* 
+    The following two style rules cause a MenuBar's UL to clear its 
+    floating LIs.
+*/
+
+.yui-skin-sam .yuimenubar .bd,
+.yui-skin-sam .yuimenubar ul {
+
+    *zoom: 1;   /* For IE */
+
+}
+
+.yui-skin-sam .yuimenubar>.bd>ul:after {
+
+    content: ".";
+    display: block;
+    clear: both;
+    visibility: hidden;
+    height: 0;
+    line-height: 0;
+
+}
+
+
+/* MenuBarItem style rules */
+
+.yui-skin-sam .yuimenubaritem {
+
+    float: left;
+
+}
+
+.yui-skin-sam .yuimenubarnav .yuimenubaritem {
+
+    border-right: solid 1px #ccc;
+
+}
+
+.yui-skin-sam .yuimenubaritemlabel {
+
+    display: block;
+    *display: inline-block; /* For IE */
+    font-size: 93%;  /* 12px */
+    line-height: 2;  /* ~24px */
+    *line-height: 1.9; /* For IE */
+    padding: 0 10px;
+    color: #000;
+    text-decoration: none;
+    outline: none;
+    cursor: default;
+    border-style: solid;
+    border-color: #808080;
+    border-width: 1px 0;
+    position: relative;
+    margin: -1px 0;
+
+}
+
+.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel {
+
+    padding-right: 20px;
+
+}
+
+.yui-skin-sam .yuimenubaritemlabel .submenuindicator {
+    
+    /*
+        Set height and width to 1px so screen readers announce the content of 
+        the element.
+    */
+
+    width: 1px;
+    height: 1px;
+    top: 0;
+    left: 0;
+
+}
+
+.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel .submenuindicator {
+    
+    top: 50%;
+    right: 8px;
+    left: auto; /* Override "left" property set by previous style rule */
+    margin-top: -3px;
+    height: 4px;
+    width: 7px;
+    text-indent: 8px;
+    background-position: -16px -856px;
+
+}
+
+
+/* MenuBarItem states */
+
+/* Selected MenuBarItem */
+
+.yui-skin-sam .yuimenubaritem a.selected {
+
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;
+    border-color: #7D98B8;
+
+}
+
+.yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected {
+
+    border-left-width: 1px;
+    margin-left: -1px;
+    *left: -1px;    /* For IE */
+
+}
+
+.yui-skin-sam .yuimenubar a.selected .submenuindicator {
+
+    background: transparent;
+
+}
+
+.yui-skin-sam .yuimenubarnav a.selected .submenuindicator {
+
+    /*
+        Reset the value of the "background" property since it is set to 
+        "transparent" by the previous rule.
+    */
+
+    background: url(../../../../assets/skins/sam/sprite.png) repeat-x -16px -856px;
+
+}
+
+
+/* Disabled  MenuBarItem */
+
+.yui-skin-sam .yuimenubaritem a.disabled {
+
+    cursor: default;
+    color: #A6A6A6;
+
+}
+
+.yui-skin-sam .yuimenubarnav .yuimenubaritem a.disabled .submenuindicator {
+
+    background-position: -16px -881px;
+
+}
+
+
+/* Menu style rules */
+
+.yui-skin-sam .yuimenu .bd {
+
+    position: relative;
+    top: 0;
+    left: 0;
+    border: solid 1px #808080;
+    background-color: #fff;
+    z-index: 1;
+    
+}
+
+.yui-skin-sam .yuimenu ul {
+
+    padding: 3px 0;
+    border-width: 1px 0 0 0;
+    border-color: #ccc;
+    border-style: solid;
+
+}
+
+.yui-skin-sam .yuimenu ul.first-of-type {
+
+    border-width: 0;
+
+}
+
+
+/* Group titles */
+
+.yui-skin-sam .yuimenu h6 { 
+
+    font-size: 93%;  /* 12px */
+    font-weight: bold;
+    line-height: 1.5;  /* 18px */
+    *line-height: 1.45; /* For IE */
+    border-style: solid;
+    border-color: #ccc;
+    border-width: 1px 0 0 0;
+    color: #a4a4a4;    
+    padding: 3px 10px 0 10px;
+
+}
+
+.yui-skin-sam .yuimenu ul.hastitle,
+.yui-skin-sam .yuimenu h6.first-of-type {
+
+    border-width: 0;
+
+}
+
+
+/* Top and bottom scroll controls */
+
+.yui-skin-sam .yuimenu .topscrollbar,
+.yui-skin-sam .yuimenu .bottomscrollbar {
+
+    position: relative;
+    height: 16px;
+    border: solid 1px #808080;
+    background: #fff url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;
+
+}
+
+.yui-skin-sam .yuimenu .topscrollbar {
+
+    z-index: 2;
+    border-bottom-color: #ccc;
+    margin-bottom: -1px;
+    background-position: center -950px;
+
+}
+
+.yui-skin-sam .yuimenu .topscrollbar_disabled {
+
+    background-position: center -975px;
+
+}
+
+.yui-skin-sam .yuimenu .bottomscrollbar {
+
+    z-index: 3;
+    border-top-color: #ccc;
+    margin-top: -1px;
+    background-position: center -850px;
+
+}
+
+.yui-skin-sam .yuimenu .bottomscrollbar_disabled {
+
+    background-position: center -875px;
+
+}
+
+
+/* MenuItem style rules */
+
+.yui-skin-sam .yuimenuitemlabel {
+
+    font-size: 93%;  /* 12px */
+    line-height: 1.5;  /* 18px */
+    *line-height: 1.45; /* For IE */
+    padding: 0 20px;
+    display: block;
+    color: #000;
+    text-decoration: none;
+    outline: none;
+    position: relative;
+    cursor: default;
+
+}
+
+.yui-skin-sam .yuimenuitemlabel .helptext {
+
+    font-style: normal;
+    margin: 0 0 0 40px;
+    
+}
+
+.yui-skin-sam .yuimenuitemlabel .submenuindicator,
+.yui-skin-sam .yuimenuitemlabel .checkedindicator,
+.yui-skin-sam .yuimenubaritemlabel .submenuindicator {
+    
+    position: absolute;
+    overflow: hidden;
+    background: url(../../../../assets/skins/sam/sprite.png) no-repeat;
+
+}
+
+.yui-skin-sam .yuimenuitemlabel .submenuindicator {
+
+    top: 50%;
+    right: 8px;
+    margin-top: -3px;
+    height: 7px;
+    width: 4px;
+    text-indent: 5px;
+    background-position: 0 -906px;
+
+}
+
+.yui-skin-sam .yuimenuitemlabel .checkedindicator {
+
+    top: 50%;
+    left: 8px;
+    margin-top: -3px;
+    height: 7px;
+    width: 7px;
+    text-indent: 8px;
+    background-position: 0 -1006px;
+
+}
+
+
+/* Menu states */
+
+/* Visible Menu */
+
+.yui-skin-sam .yui-menu-shadow-visible {
+
+    top: 2px;
+    right: -3px;
+    left: -3px;
+    bottom: -3px;
+    background-color: #000;
+    opacity: .12;
+    *filter: alpha(opacity=12);  /* For IE */
+    visibility: visible;
+
+}
+
+.yui-skin-sam .visible .bd,
+.yui-skin-sam .visible .yuimenuitem {
+
+    _zoom: 1;   /* For IE 7 Quirks Mode and IE 6 Standards and Quirks Mode */
+
+}
+
+.yui-skin-sam .visible .yuimenuitemlabel {
+
+    *zoom: 1;   /* For IE */
+
+}
+
+.yui-skin-sam .visible .yuimenuitemlabel .helptext {
+
+    float: right;
+    width: 100%;
+    text-align: right;
+    margin: -1.5em 0 0 0;
+    *margin: -1.45em 0 0 0;  /* For IE*/
+
+}
+
+
+/* MenuItem states */
+
+/* Selected MenuItem */
+
+.yui-skin-sam .yuimenuitem a.selected {
+
+    /*
+        Use "background" over "background-color" to clear background image 
+        set by the ".yuimenubaritem a.selected" rule.
+    */
+
+    background: #B3D4FF;
+
+}
+
+/*
+    Redefine the background for MenuItem instances that are children of
+    a Menubar since the 
+    ".yui-skin-sam .yuimenubar a.selected .submenuindicator" rule sets the 
+    "background" property to "transparent"
+*/
+
+.yui-skin-sam .yuimenubar .yuimenuitem a.selected .submenuindicator {
+
+    background: url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -906px;
+
+}
+
+/*
+    Remove borders and margin added by the style rule 
+    ".yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected"
+*/
+
+.yui-skin-sam .yuimenubarnav .yuimenuitem a.selected {
+
+    border-width: 0;
+    margin: 0;
+    *left: 0;   /* For IE */
+
+}
+
+
+/* Disabled MenuItem */
+
+.yui-skin-sam .yuimenuitem a.disabled {
+
+    cursor: default;
+    color: #A6A6A6;
+
+}
+
+.yui-skin-sam .yuimenuitem a.disabled .submenuindicator {
+
+    background-position: 0 -931px;
+
+}
+
+.yui-skin-sam .yuimenuitem a.disabled .checkedindicator {
+
+    background-position: 0 -1031px;
+
+}
\ No newline at end of file
diff --git a/lib/yui/menu/assets/skins/sam/menu.css b/lib/yui/menu/assets/skins/sam/menu.css
new file mode 100755 (executable)
index 0000000..61d063b
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yuimenu .yuimenu,.yuimenubar .yuimenu{position:absolute;visibility:hidden;}.yuimenubar ul,.yuimenu ul{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{white-space:nowrap;}.yui-menu-shadow{position:absolute;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{border:solid 1px #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubar .bd,.yui-skin-sam .yuimenubar ul{*zoom:1;}.yui-skin-sam .yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yui-skin-sam .yuimenubaritem{float:left;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{display:block;*display:inline-block;font-size:93%;line-height:2;*line-height:1.9;padding:0 10px;color:#000;text-decoration:none;outline:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;}.yui-skin-sam .yuimenubaritemlabel .submenuindicator{width:1px;height:1px;top:0;left:0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel .submenuindicator{top:50%;right:8px;left:auto;margin-top:-3px;height:4px;width:7px;text-indent:8px;background-position:-16px -856px;}.yui-skin-sam .yuimenubaritem a.selected{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubar a.selected .submenuindicator{background:transparent;}.yui-skin-sam .yuimenubarnav a.selected .submenuindicator{background:url(../../../../assets/skins/sam/sprite.png) repeat-x -16px -856px;}.yui-skin-sam .yuimenubaritem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritem a.disabled .submenuindicator{background-position:-16px -881px;}.yui-skin-sam .yuimenu .bd{position:relative;top:0;left:0;border:solid 1px #808080;background-color:#fff;z-index:1;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-size:93%;font-weight:bold;line-height:1.5;*line-height:1.45;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{position:relative;height:16px;border:solid 1px #808080;background:#fff url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{z-index:2;border-bottom-color:#ccc;margin-bottom:-1px;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{z-index:3;border-top-color:#ccc;margin-top:-1px;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitemlabel{font-size:93%;line-height:1.5;*line-height:1.45;padding:0 20px;display:block;color:#000;text-decoration:none;outline:none;position:relative;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{font-style:normal;margin:0 0 0 40px;}.yui-skin-sam .yuimenuitemlabel .submenuindicator,.yui-skin-sam .yuimenuitemlabel .checkedindicator,.yui-skin-sam .yuimenubaritemlabel .submenuindicator{position:absolute;overflow:hidden;background:url(../../../../assets/skins/sam/sprite.png) no-repeat;}.yui-skin-sam .yuimenuitemlabel .submenuindicator{top:50%;right:8px;margin-top:-3px;height:7px;width:4px;text-indent:5px;background-position:0 -906px;}.yui-skin-sam .yuimenuitemlabel .checkedindicator{top:50%;left:8px;margin-top:-3px;height:7px;width:7px;text-indent:8px;background-position:0 -1006px;}.yui-skin-sam .yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);visibility:visible;}.yui-skin-sam .visible .bd,.yui-skin-sam .visible .yuimenuitem{_zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel{*zoom:1;}.yui-skin-sam .visible .yuimenuitemlabel .helptext{float:right;width:100%;text-align:right;margin:-1.5em 0 0 0;*margin:-1.45em 0 0 0;}.yui-skin-sam .yuimenuitem a.selected{background:#B3D4FF;}.yui-skin-sam .yuimenubar .yuimenuitem a.selected .submenuindicator{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -906px;}.yui-skin-sam .yuimenubarnav .yuimenuitem a.selected{border-width:0;margin:0;*left:0;}.yui-skin-sam .yuimenuitem a.disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem a.disabled .submenuindicator{background-position:0 -931px;}.yui-skin-sam .yuimenuitem a.disabled .checkedindicator{background-position:0 -1031px;}
index a6bc83a6ba3cda204238541eaafb5e1e70439835..44fdcfe426f5b9966c2a125f704412b51e401fbb 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
-*/
-/**\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
-    Event = YAHOO.util.Event;\r
-\r
-/**\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.MenuManager = function() {\r
-\r
-    // Private member variables\r
-\r
-\r
-    // Flag indicating if the DOM event handlers have been attached\r
-\r
-    var m_bInitializedEventHandlers = false,\r
-\r
-\r
-        // Collection of menus\r
-\r
-        m_oMenus = {},\r
-    \r
-    \r
-        //  Collection of menu items \r
-\r
-        m_oItems = {},\r
-\r
-\r
-        // Collection of visible menus\r
-    \r
-        m_oVisibleMenus = {},\r
-\r
-\r
-        // Logger\r
-\r
-        m_oLogger = new YAHOO.widget.LogWriter(this.toString()),\r
-\r
-\r
-        me = this;\r
-\r
-\r
-    // Private methods\r
-\r
-\r
-    /**\r
-    * @method addItem\r
-    * @description 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
-    function addItem(p_oItem) {\r
-\r
-        var sYUIId = Dom.generateId();\r
-\r
-        if(p_oItem && m_oItems[sYUIId] != p_oItem) {\r
-\r
-            p_oItem.element.setAttribute("yuiid", sYUIId);\r
-    \r
-            m_oItems[sYUIId] = p_oItem;\r
-    \r
-            p_oItem.destroyEvent.subscribe(onItemDestroy, p_oItem);\r
-\r
-            m_oLogger.log("Item: " + \r
-                p_oItem.toString() + " successfully registered.");\r
-\r
-        }\r
-    \r
-    }\r
-\r
-\r
-    /**\r
-    * @method removeItem\r
-    * @description 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
-    function removeItem(p_oItem) {\r
-    \r
-        var sYUIId = p_oItem.element.getAttribute("yuiid");\r
-\r
-        if(sYUIId && m_oItems[sYUIId]) {\r
-\r
-            delete m_oItems[sYUIId];\r
-\r
-            m_oLogger.log("Item: " + \r
-                p_oItem.toString() + " successfully unregistered.");\r
-\r
-        }\r
-    \r
-    }\r
-\r
-\r
-    /**\r
-    * @method getMenuRootElement\r
-    * @description Finds the root DIV node of a menu or the root LI node of a \r
-    * 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
-    function getMenuRootElement(p_oElement) {\r
-    \r
-        var oParentNode;\r
-\r
-        if(p_oElement && p_oElement.tagName) {\r
-        \r
-            switch(p_oElement.tagName.toUpperCase()) {\r
-                    \r
-                case "DIV":\r
-    \r
-                    oParentNode = p_oElement.parentNode;\r
-    \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
-                        return oParentNode;\r
-                    \r
-                    }\r
-                    else {\r
-                    \r
-                        return p_oElement;\r
-                    \r
-                    }\r
-                \r
-                break;\r
-\r
-                case "LI":\r
-    \r
-                    return p_oElement;\r
-\r
-                default:\r
-    \r
-                    oParentNode = p_oElement.parentNode;\r
-    \r
-                    if(oParentNode) {\r
-                    \r
-                        return getMenuRootElement(oParentNode);\r
-                    \r
-                    }\r
-                \r
-                break;\r
-            \r
-            }\r
-\r
-        }\r
-        \r
-    }\r
-\r
-\r
-\r
-    // Private event handlers\r
-\r
-\r
-    /**\r
-    * @method onDOMEvent\r
-    * @description 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
-    function onDOMEvent(p_oEvent) {\r
-\r
-        // Get the target node of the DOM event\r
-    \r
-        var oTarget = Event.getTarget(p_oEvent),\r
-\r
-\r
-        // See if the target of the event was a menu, or a menu item\r
-\r
-            oElement = getMenuRootElement(oTarget),\r
-            oMenuItem,\r
-            oMenu; \r
-\r
-\r
-        if(oElement) {\r
-\r
-            var sTagName = oElement.tagName.toUpperCase();\r
-    \r
-            if(sTagName == "LI") {\r
-        \r
-                var sYUIId = oElement.getAttribute("yuiid");\r
-        \r
-                if(sYUIId) {\r
-        \r
-                    oMenuItem = m_oItems[sYUIId];\r
-                    oMenu = oMenuItem.parent;\r
-        \r
-                }\r
-            \r
-            }\r
-            else if(sTagName == "DIV") {\r
-            \r
-                if(oElement.id) {\r
-                \r
-                    oMenu = m_oMenus[oElement.id];\r
-                \r
-                }\r
-            \r
-            }\r
-\r
-        }\r
-\r
-        if(oMenu) {\r
-\r
-            // Map of DOM event names to CustomEvent names\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
-                sCustomEventType = oEventTypes[p_oEvent.type];\r
-\r
-\r
-            // Fire the Custom Even that corresponds the current DOM event    \r
-    \r
-            if(oMenuItem && !oMenuItem.cfg.getProperty("disabled")) {\r
-            \r
-                oMenuItem[sCustomEventType].fire(p_oEvent);                   \r
-            \r
-            }\r
-    \r
-            oMenu[sCustomEventType].fire(p_oEvent, oMenuItem);\r
-        \r
-        }\r
-        else if(p_oEvent.type == "mousedown") {\r
-\r
-\r
-            /*\r
-                If the target of the event wasn't a menu, hide all \r
-                dynamically positioned menus\r
-            */\r
-            \r
-            var oActiveItem;\r
-    \r
-            for(var i in m_oMenus) {\r
-    \r
-                if(m_oMenus.hasOwnProperty(i)) {\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
-                    }\r
-                    else {\r
-\r
-                        oMenu.clearActiveItem(true);\r
-    \r
-                    }\r
-    \r
-                }\r
-    \r
-            } \r
-\r
-        }\r
-\r
-    }\r
-\r
-\r
-    /**\r
-    * @method onMenuDestroy\r
-    * @description "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
-    function onMenuDestroy(p_sType, p_aArgs, p_oMenu) {\r
-\r
-        if(p_oMenu && m_oMenus[p_oMenu.id]) {\r
-\r
-            delete m_oMenus[p_oMenu.id];\r
-\r
-            m_oLogger.log("Menu: " + \r
-                p_oMenu.toString() + " successfully unregistered.");\r
-\r
-        }\r
-\r
-    }\r
-\r
-\r
-    /**\r
-    * @method onItemDestroy\r
-    * @description "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
-    function onItemDestroy(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var sYUIId = p_oItem.element.getAttribute("yuiid");\r
-\r
-        if(sYUIId) {\r
-\r
-            delete m_oItems[sYUIId];\r
-\r
-        }\r
-\r
-    }\r
-\r
-\r
-    /**\r
-    * @method onMenuVisibleConfigChange\r
-    * @description 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
-    function onMenuVisibleConfigChange(p_sType, p_aArgs, p_oMenu) {\r
-\r
-        var bVisible = p_aArgs[0];\r
-        \r
-        if(bVisible) {\r
-\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
-            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
-        }\r
-    \r
-    }\r
-\r
-\r
-    /**\r
-    * @method onItemAdded\r
-    * @description "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
-    function onItemAdded(p_sType, p_aArgs) {\r
-    \r
-        addItem(p_aArgs[0]);\r
-    \r
-    }\r
-    \r
-\r
-    /**\r
-    * @method onItemRemoved\r
-    * @description "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
-    function onItemRemoved(p_sType, p_aArgs) {\r
-\r
-        removeItem(p_aArgs[0]);\r
-    \r
-    }\r
-\r
-\r
-\r
-    return {\r
-\r
-        // Privileged methods\r
-\r
-\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  \r
-        * instance to be added.\r
-        */\r
-        addMenu: function(p_oMenu) {\r
-    \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, me, true);\r
-                    Event.addListener(oDoc, "mouseout", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "mousedown", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "mouseup", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "click", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "keydown", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "keyup", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "keypress", onDOMEvent, me, true);\r
-        \r
-                    m_bInitializedEventHandlers = true;\r
-                    \r
-                    m_oLogger.log("DOM event handlers initialized.");\r
-        \r
-                }\r
-        \r
-                p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, me);\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
-                m_oLogger.log("Menu: " + \r
-                    p_oMenu.toString() + " successfully registered.");\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  \r
-        * instance to be removed.\r
-        */\r
-        removeMenu: function(p_oMenu) {\r
-    \r
-            if(p_oMenu && m_oMenus[p_oMenu.id]) {\r
-    \r
-                delete m_oMenus[p_oMenu.id];\r
-    \r
-                m_oLogger.log("Menu: " + \r
-                    p_oMenu.toString() + " successfully unregistered.");\r
-    \r
-            }\r
-    \r
-        },\r
-    \r
-    \r
-        /**\r
-        * @method hideVisible\r
-        * @description Hides all visible, dynamically positioned menus.\r
-        */\r
-        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
-        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
-        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
-        toString: function() {\r
-        \r
-            return ("MenuManager");\r
-        \r
-        }\r
-\r
-    };\r
-\r
-}();\r
-\r
-})();\r
-\r
-\r
-(function() {\r
-\r
-var Dom = YAHOO.util.Dom,\r
-    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
-        YAHOO.widget.Module.textResizeEvent.subscribe(\r
-            this._onTextResize, \r
-            this, \r
-            true\r
-        );\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
-            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
-        var sSrcElementTagName = this.srcElement.tagName.toUpperCase();\r
-\r
-\r
-        switch(sSrcElementTagName) {\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(\r
-                                oNode && \r
-                                oNode.tagName && \r
-                                oNode.tagName.toUpperCase() == "LI"\r
-                            ) {\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
-                            }\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
-        oItem,\r
-        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
-/**\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") {\r
-\r
-        p_oItem.parent = this;\r
-\r
-        oItem = new this.ITEM_TYPE(p_oItem.text, p_oItem);\r
-\r
-    }\r
-\r
-\r
-    if(oItem) {\r
-\r
-        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,\r
-            aGroup = this._getItemGroup(nGroupIndex),\r
-            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
-                    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(\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
-        aGroup = this._getItemGroup(nGroupIndex);\r
-\r
-    if(aGroup) {\r
-\r
-        var aArray = aGroup.splice(p_nItemIndex, 1),\r
-            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
-            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
-        nItems = aGroup.length;\r
-\r
-    if(nItems > 0) {\r
-\r
-        var i = nItems - 1,\r
-            oItem,\r
-            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
-        me = this;\r
-\r
-    function hideMenu() {\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
-    var oRoot = this.getRoot();\r
-\r
-    function showMenu() {\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
-        oItem = p_aArgs[1],\r
-        oTarget = Event.getTarget(oEvent);\r
-\r
-\r
-    if(\r
-        !this._bHandledMouseOverEvent && \r
-        (oTarget == this.element || Dom.isAncestor(this.element, oTarget))\r
-    ) {\r
-\r
-        this.clearActiveItem();\r
-\r
-        this._bHandledMouseOverEvent = true;\r
-        this._bHandledMouseOutEvent = false;\r
-    \r
-    }\r
-\r
-\r
-    if(\r
-        oItem && !oItem.handledMouseOverEvent && \r
-        !oItem.cfg.getProperty("disabled") && \r
-        (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))\r
-    ) {\r
-\r
-        var nShowDelay = this.cfg.getProperty("showdelay"),\r
-            bShowDelay = (nShowDelay > 0);\r
-\r
-\r
-        if(bShowDelay) {\r
-        \r
-            this._cancelShowDelay();\r
-        \r
-        }\r
-    \r
-    \r
-        var oActiveItem = this.activeItem;\r
-    \r
-        if(oActiveItem) {\r
-    \r
-            oActiveItem.cfg.setProperty("selected", false);\r
-    \r
-            var oActiveSubmenu = oActiveItem.cfg.getProperty("submenu");\r
-    \r
-            if(oActiveSubmenu) {\r
-                                               \r
-                oActiveSubmenu.hide();\r
-    \r
-            }\r
-    \r
-        }\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(bShowDelay) {\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
-        oItem = p_aArgs[1],\r
-        oRelatedTarget = Event.getRelatedTarget(oEvent),\r
-        bMovingToSubmenu = false;\r
-\r
-\r
-    if(oItem && !oItem.cfg.getProperty("disabled")) {\r
-\r
-        var oItemCfg = oItem.cfg,\r
-            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
-            if(\r
-                !oSubmenu || \r
-                (oSubmenu && !oSubmenu.cfg.getProperty("visible"))\r
-            ) {\r
-\r
-                oItem.cfg.setProperty("selected", false);\r
-\r
-                if(\r
-                    oSubmenu && \r
-                    oSubmenu.cfg.getProperty("showdelay") && \r
-                    !oSubmenu.cfg.getProperty("visible")\r
-                ) {\r
-                \r
-                     this._cancelShowDelay();\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
-        oItem = p_aArgs[1],\r
-        oTarget = Event.getTarget(oEvent);\r
-\r
-    if(oItem && !oItem.cfg.getProperty("disabled")) {\r
-\r
-        var oItemCfg = oItem.cfg,\r
-            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
-                bCurrentPageURL = (sURL.substr((sURL.length-1),1) == "#"),\r
-                sTarget = oItemCfg.getProperty("target"),\r
-                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
-        oItem = p_aArgs[1],\r
-        oSubmenu;\r
-\r
-    if(oItem && !oItem.cfg.getProperty("disabled")) {\r
-\r
-        var oItemCfg = oItem.cfg,\r
-            oParentItem = this.parent,\r
-            oRoot,\r
-            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
-                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
-* @method _onTextResize\r
-* @description "textresize" 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
-_onTextResize: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-    if(this.browser == "gecko" && !this._handleResize) {\r
-\r
-        this._handleResize = true;\r
-        return;\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
-},\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
-        oEl = this.element,\r
-        nListElements = this._aListElements.length;\r
-\r
-\r
-    if(nListElements > 0) {\r
-\r
-        var i = 0,\r
-            bFirstList = true,\r
-            oUL,\r
-            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
-        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
-* @method _onShow\r
-* @description "show" 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 fired \r
-* the event.\r
-*/\r
-_onShow: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-    this.setInitialFocus();\r
-    \r
-    var oParent = this.parent;\r
-    \r
-    if(oParent) {\r
-\r
-        var oParentMenu = oParent.parent,\r
-            aParentAlignment = oParentMenu.cfg.getProperty("submenualignment"),\r
-            aAlignment = this.cfg.getProperty("submenualignment");\r
-\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
-\r
-        if(\r
-            !oParentMenu.cfg.getProperty("autosubmenudisplay") && \r
-            oParentMenu.cfg.getProperty("position") == "static"\r
-        ) {\r
-\r
-            oParentMenu.cfg.setProperty("autosubmenudisplay", true);\r
-\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
-            function disableAutoSubmenuDisplay(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
-                        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
-\r
-            Event.addListener(document, "mousedown", disableAutoSubmenuDisplay);                             \r
-            Event.addListener(document, "keydown", disableAutoSubmenuDisplay);\r
-\r
-        }\r
-\r
-    }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onBeforeHide\r
-* @description "beforehide" 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 fired \r
-* the event.\r
-*/\r
-_onBeforeHide: function(p_sType, p_aArgs, p_oMenu) {\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
-        oActiveItem.blur();\r
-\r
-    }\r
-\r
-},\r
-\r
-\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 sPropertyName = p_aArgs[0][0],\r
-        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
-/**\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 {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
-_onParentMenuRender: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
-    var oParentMenu = p_oSubmenu.parent.parent,\r
-\r
-        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
-            showdelay:\r
-                oParentMenu.cfg.getProperty("showdelay"),\r
-            \r
-            hidedelay:\r
-                oParentMenu.cfg.getProperty("hidedelay")\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
-        }\r
-        else {\r
-\r
-            this.render(this.parent.element);\r
-    \r
-        }\r
-\r
-    }\r
-    \r
-},\r
-\r
-\r
-/**\r
-* @method _onSubmenuBeforeShow\r
-* @description "beforeshow" 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
-_onSubmenuBeforeShow: function(p_sType, p_aArgs, p_oSubmenu) {\r
-    \r
-    var oParent = this.parent,\r
-        aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r
-\r
-    this.cfg.setProperty(\r
-        "context", \r
-        [oParent.element, aAlignment[0], aAlignment[1]]\r
-    );\r
-    \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
-         pos = args[0],\r
-    \r
-         x = pos[0],\r
-         y = pos[1],\r
-    \r
-         offsetHeight = this.element.offsetHeight,\r
-         offsetWidth = this.element.offsetWidth,\r
-    \r
-         viewPortWidth = YAHOO.util.Dom.getViewportWidth(),\r
-         viewPortHeight = YAHOO.util.Dom.getViewportHeight(),\r
-    \r
-         scrollX = Math.max(\r
-                        document.documentElement.scrollLeft, \r
-                        document.body.scrollLeft\r
-                    ),\r
-\r
-         scrollY = Math.max(\r
-                        document.documentElement.scrollTop, \r
-                        document.body.scrollTop\r
-                    ),\r
-    \r
-         topConstraint = scrollY + 10,\r
-         leftConstraint = scrollX + 10,\r
-         bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,\r
-         rightConstraint = scrollX + viewPortWidth - offsetWidth - 10,\r
-    \r
-         aContext = oConfig.getProperty("context"),\r
-         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
-    oConfig.setProperty("xy", [x,y], true);\r
-\r
-},\r
-\r
-\r
-/**\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
-configVisible: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-    if(this.cfg.getProperty("position") == "dynamic") {\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
-           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
-        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
-/**\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
-configPosition: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-    var sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute",\r
-        oCfg = this.cfg;\r
-\r
-    Dom.setStyle(this.element, "position", sCSSPosition);\r
-\r
-\r
-    if(sCSSPosition == "static") {\r
-\r
-        /*\r
-            Remove the iframe for statically positioned menus since it will \r
-            intercept mouse events.\r
-        */\r
-\r
-        oCfg.setProperty("iframe", false);\r
-\r
-\r
-        // Statically positioned menus are visible by default\r
-        \r
-        Dom.setStyle(this.element, "display", "block");\r
-\r
-        oCfg.setProperty("visible", true);\r
-\r
-    }\r
-    else {\r
-\r
-        /*\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
-        Dom.setStyle(this.element, "visibility", "hidden");\r
-    \r
-    }\r
-\r
-\r
-    if(sCSSPosition == "absolute") {\r
-\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
-        }\r
-\r
-    }\r
-\r
-},\r
-\r
-\r
-/**\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 {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
-configIframe: function(p_sType, p_aArgs, p_oMenu) {    \r
-\r
-    if(this.cfg.getProperty("position") == "dynamic") {\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
-* @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 {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
-configHideDelay: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-    var nHideDelay = p_aArgs[0],\r
-        oMouseOutEvent = this.mouseOutEvent,\r
-        oMouseOverEvent = this.mouseOverEvent,\r
-        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
-        }\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
-* @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 {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
-configContainer: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-       var oElement = p_aArgs[0];\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
-* @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
-/**\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
-* @method toString\r
-* @description Returns a string representing the menu.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
-    return ("Menu " + this.id);\r
-\r
-},\r
-\r
-\r
-/**\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
-setItemGroupTitle: function(p_sGroupTitle, p_nGroupIndex) {\r
-        \r
-    if(typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {\r
-\r
-        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,\r
-            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
-            nFirstIndex;\r
-\r
-        do {\r
-\r
-            if(this._aGroupTitleElements[i]) {\r
-\r
-                Dom.removeClass(this._aGroupTitleElements[i], "first-of-type");\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
-        }\r
-\r
-    }\r
-\r
-},\r
-\r
-\r
-\r
-/**\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
-addItem: function(p_oItem, p_nGroupIndex) {\r
-\r
-    if(p_oItem) {\r
-\r
-        return this._addItemToGroup(p_nGroupIndex, p_oItem);\r
-        \r
-    }\r
-\r
-},\r
-\r
-\r
-/**\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
-addItems: function(p_aItems, p_nGroupIndex) {\r
-\r
-    function isArray(p_oValue) {\r
-    \r
-        return (typeof p_oValue == "object" && p_oValue.constructor == Array);\r
-    \r
-    }\r
-\r
-\r
-    if(isArray(p_aItems)) {\r
-\r
-        var nItems = p_aItems.length,\r
-            aItems = [],\r
-            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
-            else {\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
-* @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 {YAHOO.widget.MenuItem}\r
-*/\r
-insertItem: 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
-    }\r
-\r
-},\r
-\r
-\r
-/**\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
-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
-        else if(typeof p_oObject == "number") {\r
-\r
-            oItem = 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
-\r
-/**\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
-* @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 {YAHOO.widget.MenuItem}\r
-*/\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
-        }\r
-\r
-    }\r
-    \r
-},\r
-\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
-    this.mouseOverEvent.unsubscribeAll();\r
-    this.mouseOutEvent.unsubscribeAll();\r
-    this.mouseDownEvent.unsubscribeAll();\r
-    this.mouseUpEvent.unsubscribeAll();\r
-    this.clickEvent.unsubscribeAll();\r
-    this.keyPressEvent.unsubscribeAll();\r
-    this.keyDownEvent.unsubscribeAll();\r
-    this.keyUpEvent.unsubscribeAll();\r
-    this.itemAddedEvent.unsubscribeAll();\r
-    this.itemRemovedEvent.unsubscribeAll();\r
-\r
-    var nItemGroups = this._aItemGroups.length,\r
-        nItems,\r
-        oItemGroup,\r
-        oItem,\r
-        i,\r
-        n;\r
-\r
-\r
-    // Remove all items\r
-\r
-    if(nItemGroups > 0) {\r
-\r
-        i = nItemGroups - 1;\r
-\r
-        do {\r
-\r
-            oItemGroup = this._aItemGroups[i];\r
-\r
-            if(oItemGroup) {\r
-\r
-                nItems = oItemGroup.length;\r
-    \r
-                if(nItems > 0) {\r
-    \r
-                    n = nItems - 1;\r
-        \r
-                    do {\r
-\r
-                        oItem = this._aItemGroups[i][n];\r
-\r
-                        if(oItem) {\r
-        \r
-                            oItem.destroy();\r
-                        }\r
-        \r
-                    }\r
-                    while(n--);\r
-    \r
-                }\r
-\r
-            }\r
-\r
-        }\r
-        while(i--);\r
-\r
-    }        \r
-\r
-\r
-    // Continue with the superclass implementation of this method\r
-\r
-    YAHOO.widget.Menu.superclass.destroy.call(this);\r
-    \r
-    this.logger.log("Destroyed.");\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method setInitialFocus\r
-* @description Sets focus to the menu's first enabled item.\r
-*/\r
-setInitialFocus: function() {\r
-\r
-    var oItem = this._getFirstEnabledItem();\r
-    \r
-    if(oItem) {\r
-    \r
-        oItem.focus();\r
-    }\r
-    \r
-},\r
-\r
-\r
-/**\r
-* @method setInitialSelection\r
-* @description Sets the "selected" configuration property of the menu's first \r
-* enabled item to "true."\r
-*/\r
-setInitialSelection: function() {\r
-\r
-    var oItem = this._getFirstEnabledItem();\r
-    \r
-    if(oItem) {\r
-    \r
-        oItem.cfg.setProperty("selected", true);\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
-    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
-* @description Initializes the class's configurable properties which can be\r
-* changed using the menu's Config object ("cfg").\r
-* @method initDefaultConfig\r
-*/\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
-    /**\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
-\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
-\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
-\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
-       * @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
-}); // END YAHOO.extend\r
-\r
-})();\r
-\r
-\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
-\r
-(function() {\r
-\r
-var Dom = YAHOO.util.Dom,\r
-    Module = YAHOO.widget.Module,\r
-    Menu = YAHOO.widget.Menu;\r
-\r
-\r
-/**\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
-*/\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.MenuItem.prototype = {\r
-\r
-    // Constants\r
-\r
-    /**\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
-    /**\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
-        "nt/ic/ut/alt1/menuarorght8_hov_1.gif",\r
-\r
-\r
-    /**\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
-        "nt/ic/ut/alt1/menuarorght8_dim_1.gif",\r
-\r
-\r
-    /**\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
-    /**\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
-    /**\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
-    /**\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
-    CHECKED_IMAGE_PATH: "nt/ic/ut/bsc/menuchk8_nrm_1.gif",\r
-    \r
-\r
-    /**\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 String\r
-    */\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
-    * @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.Menu\r
-    */\r
-    SUBMENU_TYPE: null,\r
-\r
-\r
-    /**\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
-    * @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
-    * @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 <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
-    * @property _oText\r
-    * @description Object reference to the menu item's text node.\r
-    * @default null\r
-    * @private\r
-    * @type TextNode\r
-    */\r
-    _oText: null,\r
-    \r
-    \r
-    /**\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 <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
-    * @property _oSubmenu\r
-    * @description Object reference to the menu item's submenu.\r
-    * @default null\r
-    * @private\r
-    * @type YAHOO.widget.Menu\r
-    */\r
-    _oSubmenu: null,\r
-\r
-\r
-    /**\r
-    * @property _checkImage\r
-    * @description Object reference to the menu item's checkmark image.\r
-    * @default null\r
-    * @private\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
-    _checkImage: null,\r
-\r
-\r
-\r
-    // Public properties\r
-\r
-       /**\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.MenuItem,\r
-\r
-\r
-       /**\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
-    * @property isSecure\r
-       * @description Boolean representing whether or not the current browsing \r
-       * context is secure (HTTPS).\r
-       * @type Boolean\r
-       */\r
-       isSecure: Module.prototype.isSecure,\r
-\r
-\r
-    /**\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
-    * @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
-    * @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
-    * @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
-    * @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
-    * @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
-    * @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
-    * @property browser\r
-       * @description String representing the browser.\r
-       * @type String\r
-       */\r
-       browser: Module.prototype.browser,\r
-\r
-\r
-\r
-    // Events\r
-\r
-\r
-    /**\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
-    * @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
-    */\r
-    mouseOverEvent: null,\r
-\r
-\r
-    /**\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
-    */\r
-    mouseOutEvent: null,\r
-\r
-\r
-    /**\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
-    */\r
-    mouseDownEvent: null,\r
-\r
-\r
-    /**\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
-    * @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
-    */\r
-    clickEvent: null,\r
-\r
-\r
-    /**\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
-    * @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
-    * @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
-    * @event focusEvent\r
-    * @description Fires when the menu item receives focus.\r
-    * @type YAHOO.util.CustomEvent\r
-    */\r
-    focusEvent: null,\r
-\r
-\r
-    /**\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
-    * @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} 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
-\r
-        if(!this.SUBMENU_TYPE) {\r
-    \r
-            this.SUBMENU_TYPE = Menu;\r
-    \r
-        }\r
-\r
-\r
-        // Create the config object\r
-\r
-        this.cfg = new YAHOO.util.Config(this);\r
-\r
-        this.initDefaultConfig();\r
-\r
-        var oConfig = this.cfg;\r
-\r
-\r
-        if(this._checkString(p_oObject)) {\r
-\r
-            this._createRootNodeStructure();\r
-\r
-            oConfig.setProperty("text", p_oObject);\r
-\r
-        }\r
-        else if(this._checkDOMNode(p_oObject)) {\r
-\r
-            switch(p_oObject.tagName.toUpperCase()) {\r
-\r
-                case "OPTION":\r
-\r
-                    this._createRootNodeStructure();\r
-\r
-                    oConfig.setProperty("text", p_oObject.text);\r
-\r
-                    this.srcElement = p_oObject;\r
-\r
-                break;\r
-\r
-                case "OPTGROUP":\r
-\r
-                    this._createRootNodeStructure();\r
-\r
-                    oConfig.setProperty("text", p_oObject.label);\r
-\r
-                    this.srcElement = p_oObject;\r
-\r
-                    this._initSubTree();\r
-\r
-                break;\r
-\r
-                case "LI":\r
-\r
-                    // Get the anchor node (if it exists)\r
-\r
-                    var oAnchor = this._getFirstElement(p_oObject, "A"),\r
-                        sURL = "#",\r
-                        sTarget,\r
-                        sText;\r
-\r
-\r
-                    // Capture the "text" and/or the "URL"\r
-\r
-                    if(oAnchor) {\r
-\r
-                        sURL = oAnchor.getAttribute("href");\r
-                        sTarget = oAnchor.getAttribute("target");\r
-\r
-                        if(oAnchor.innerText) {\r
-                \r
-                            sText = oAnchor.innerText;\r
-                \r
-                        }\r
-                        else {\r
-                \r
-                            var oRange = oAnchor.ownerDocument.createRange();\r
-                \r
-                            oRange.selectNodeContents(oAnchor);\r
-                \r
-                            sText = oRange.toString();             \r
-                \r
-                        }\r
-\r
-                    }\r
-                    else {\r
-\r
-                        var oText = p_oObject.firstChild;\r
-\r
-                        sText = oText.nodeValue;\r
-\r
-                        oAnchor = document.createElement("a");\r
-                        \r
-                        oAnchor.setAttribute("href", sURL);\r
-\r
-                        p_oObject.replaceChild(oAnchor, oText);\r
-                        \r
-                        oAnchor.appendChild(oText);\r
-\r
-                    }\r
-\r
-\r
-                    this.srcElement = p_oObject;\r
-                    this.element = p_oObject;\r
-                    this._oAnchor = oAnchor;\r
-    \r
-\r
-                    // Check if emphasis has been applied to the MenuItem\r
-\r
-                    var oEmphasisNode = this._getFirstElement(oAnchor),\r
-                        bEmphasis = false,\r
-                        bStrongEmphasis = false;\r
-\r
-                    if(oEmphasisNode) {\r
-\r
-                        // Set a reference to the text node \r
-\r
-                        this._oText = oEmphasisNode.firstChild;\r
-\r
-                        switch(oEmphasisNode.tagName.toUpperCase()) {\r
-\r
-                            case "EM":\r
-\r
-                                bEmphasis = true;\r
-\r
-                            break;\r
-\r
-                            case "STRONG":\r
-\r
-                                bStrongEmphasis = true;\r
-\r
-                            break;\r
-\r
-                        }\r
-\r
-                    }\r
-                    else {\r
-\r
-                        // Set a reference to the text node \r
-\r
-                        this._oText = oAnchor.firstChild;\r
-\r
-                    }\r
-\r
-\r
-                    /*\r
-                        Set these properties silently to sync up the \r
-                        configuration object without making changes to the \r
-                        element's DOM\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
-                        true\r
-                    );\r
-\r
-                    this._initSubTree();\r
-\r
-                break;\r
-\r
-            }            \r
-\r
-        }\r
-\r
-\r
-        if(this.element) {\r
-\r
-\r
-            Dom.addClass(this.element, this.CSS_CLASS_NAME);\r
-\r
-\r
-            // Create custom events\r
-    \r
-            var CustomEvent = YAHOO.util.CustomEvent;\r
-    \r
-            this.destroyEvent = new CustomEvent("destroyEvent", this);\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.focusEvent = new CustomEvent("focusEvent", this);\r
-            this.blurEvent = new CustomEvent("blurEvent", this);\r
-\r
-\r
-            if(p_oConfig) {\r
-    \r
-                oConfig.applyConfig(p_oConfig);\r
-    \r
-            }        \r
-\r
-            oConfig.fireQueue();\r
-\r
-        }\r
-\r
-    },\r
-\r
-\r
-\r
-    // Private methods\r
-\r
-    /**\r
-    * @method _getFirstElement\r
-    * @description Returns an HTML element's first HTML element node.\r
-    * @private\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
-        var oElement;\r
-\r
-        if(p_oElement.firstChild && p_oElement.firstChild.nodeType == 1) {\r
-\r
-            oElement = p_oElement.firstChild;\r
-\r
-        }\r
-        else if(\r
-            p_oElement.firstChild && \r
-            p_oElement.firstChild.nextSibling && \r
-            p_oElement.firstChild.nextSibling.nodeType == 1\r
-        ) {\r
-\r
-            oElement = p_oElement.firstChild.nextSibling;\r
-\r
-        }\r
-\r
-\r
-        if(p_sTagName) {\r
-\r
-            return (oElement && oElement.tagName.toUpperCase() == p_sTagName) ? \r
-                oElement : false;\r
-\r
-        }\r
-\r
-        return oElement;\r
-\r
-    },\r
-\r
-\r
-    /**\r
-    * @method _checkString\r
-    * @description Determines if an object is a string.\r
-    * @private\r
-    * @param {Object} p_oObject Object to be evaluated.\r
-    * @return {Boolean}\r
-    */\r
-    _checkString: function(p_oObject) {\r
-\r
-        return (typeof p_oObject == "string");\r
-\r
-    },\r
-\r
-\r
-    /**\r
-    * @method _checkDOMNode\r
-    * @description Determines if an object is an HTML element.\r
-    * @private\r
-    * @param {Object} p_oObject Object to be evaluated.\r
-    * @return {Boolean}\r
-    */\r
-    _checkDOMNode: function(p_oObject) {\r
-\r
-        return (p_oObject && p_oObject.tagName);\r
-\r
-    },\r
-\r
-\r
-    /**\r
-    * @method _createRootNodeStructure\r
-    * @description Creates the core DOM structure for the menu item.\r
-    * @private\r
-    */\r
-    _createRootNodeStructure: function () {\r
-\r
-        this.element = document.createElement("li");\r
-\r
-        this._oText = document.createTextNode("");\r
-\r
-        this._oAnchor = document.createElement("a");\r
-        this._oAnchor.appendChild(this._oText);\r
-        \r
-        this.cfg.refireEvent("url");\r
-\r
-        this.element.appendChild(this._oAnchor);            \r
-\r
-    },\r
-\r
-\r
-    /**\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 oSrcEl = this.srcElement,\r
-            oConfig = this.cfg;\r
-\r
-\r
-        if(oSrcEl.childNodes.length > 0) {\r
-\r
-            if(\r
-                this.parent.lazyLoad && \r
-                this.parent.srcElement && \r
-                this.parent.srcElement.tagName.toUpperCase() == "SELECT"\r
-            ) {\r
-\r
-                oConfig.setProperty(\r
-                        "submenu", \r
-                        { id: Dom.generateId(), itemdata: oSrcEl.childNodes }\r
-                    );\r
-\r
-            }\r
-            else {\r
-\r
-                var oNode = oSrcEl.firstChild,\r
-                    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
-                }        \r
-                while((oNode = oNode.nextSibling));\r
-    \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
-\r
-\r
-    // Event handlers for configuration properties\r
-\r
-\r
-    /**\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
-\r
-        var sText = p_aArgs[0];\r
-\r
-\r
-        if(this._oText) {\r
-\r
-            this._oText.nodeValue = sText;\r
-\r
-        }\r
-\r
-    },\r
-\r
-\r
-    /**\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
-    configHelpText: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var me = this,\r
-            oHelpText = p_aArgs[0],\r
-            oEl = this.element,\r
-            oConfig = this.cfg,\r
-            aNodes = [oEl, this._oAnchor],\r
-            oImg = this.submenuIndicator;\r
-\r
-\r
-        /**\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
-\r
-            Dom.addClass(aNodes, "hashelptext");\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
-\r
-\r
-        /**\r
-        * Removes the "hashelptext" class and corresponding DOM element (EM).\r
-        * @private\r
-        */\r
-        function removeHelpText() {\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
-                    this._oHelpTextEM\r
-                );\r
-\r
-            }\r
-            else {\r
-\r
-                this._oHelpTextEM = oHelpText;\r
-\r
-                oEl.insertBefore(this._oHelpTextEM, oImg);\r
-\r
-            }\r
-\r
-            initHelpText();\r
-\r
-        }\r
-        else if(this._checkString(oHelpText)) {\r
-\r
-            if(oHelpText.length === 0) {\r
-\r
-                removeHelpText();\r
-\r
-            }\r
-            else {\r
-\r
-                if(!this._oHelpTextEM) {\r
-\r
-                    this._oHelpTextEM = document.createElement("em");\r
-\r
-                    oEl.insertBefore(this._oHelpTextEM, oImg);\r
-\r
-                }\r
-\r
-                this._oHelpTextEM.innerHTML = oHelpText;\r
-\r
-                initHelpText();\r
-\r
-            }\r
-\r
-        }\r
-        else if(!oHelpText && this._oHelpTextEM) {\r
-\r
-            removeHelpText();\r
-\r
-        }\r
-\r
-    },\r
-\r
-\r
-    /**\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
-    configURL: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var sURL = p_aArgs[0];\r
-\r
-        if(!sURL) {\r
-\r
-            sURL = "#";\r
-\r
-        }\r
-\r
-        this._oAnchor.setAttribute("href", sURL);\r
-\r
-    },\r
-\r
-\r
-    /**\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
-            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
-    configEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var bEmphasis = p_aArgs[0],\r
-            oAnchor = this._oAnchor,\r
-            oText = this._oText,\r
-            oConfig = this.cfg,\r
-            oEM;\r
-\r
-\r
-        if(bEmphasis && oConfig.getProperty("strongemphasis")) {\r
-\r
-            oConfig.setProperty("strongemphasis", false);\r
-\r
-        }\r
-\r
-\r
-        if(oAnchor) {\r
-\r
-            if(bEmphasis) {\r
-\r
-                oEM = document.createElement("em");\r
-                oEM.appendChild(oText);\r
-\r
-                oAnchor.appendChild(oEM);\r
-\r
-            }\r
-            else {\r
-\r
-                oEM = this._getFirstElement(oAnchor, "EM");\r
-\r
-                if(oEM) {\r
-\r
-                    oAnchor.removeChild(oEM);\r
-                    oAnchor.appendChild(oText);\r
-\r
-                }\r
-\r
-            }\r
-\r
-        }\r
-\r
-    },\r
-\r
-\r
-    /**\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
-    configStrongEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var bStrongEmphasis = p_aArgs[0],\r
-            oAnchor = this._oAnchor,\r
-            oText = this._oText,\r
-            oConfig = this.cfg,\r
-            oStrong;\r
-\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
-                if(oStrong) {\r
-\r
-                    oAnchor.removeChild(oStrong);\r
-                    oAnchor.appendChild(oText);\r
-\r
-                }\r
-\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
-            oEl = this.element,\r
-            oConfig = this.cfg,\r
-            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
-    configDisabled: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var bDisabled = p_aArgs[0],\r
-            oAnchor = this._oAnchor,\r
-            aNodes = [this.element, oAnchor],\r
-            oEM = this._oHelpTextEM,\r
-            oConfig = this.cfg,\r
-            oImg,\r
-            sImgSrc,\r
-            sImgAlt;\r
-\r
-\r
-        if(oEM) {\r
-\r
-            aNodes[2] = oEM;\r
-\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
-\r
-                oConfig.setProperty("selected", false);\r
-\r
-            }\r
-\r
-            oAnchor.removeAttribute("href");\r
-\r
-            Dom.addClass(aNodes, "disabled");\r
-\r
-            sImgSrc = this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH;\r
-            sImgAlt = this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;\r
-\r
-        }\r
-        else {\r
-\r
-            oAnchor.setAttribute("href", oConfig.getProperty("url"));\r
-\r
-            Dom.removeClass(aNodes, "disabled");\r
-\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 + sImgSrc;\r
-            oImg.alt = sImgAlt;\r
-\r
-        }\r
-\r
-    },\r
-\r
-\r
-    /**\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
-    configSelected: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        if(!this.cfg.getProperty("disabled")) {\r
-\r
-            var bSelected = p_aArgs[0],\r
-                oEM = this._oHelpTextEM,\r
-                aNodes = [this.element, this._oAnchor],\r
-                oImg = this.submenuIndicator,\r
-                sImgSrc;\r
-\r
-\r
-            if(oEM) {\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
-                Dom.addClass(aNodes, "selected");\r
-                sImgSrc = this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH;\r
-    \r
-            }\r
-            else {\r
-    \r
-                Dom.removeClass(aNodes, "selected");\r
-                sImgSrc = this.SUBMENU_INDICATOR_IMAGE_PATH;\r
-    \r
-            }\r
-    \r
-            if(oImg) {\r
-    \r
-                oImg.src = document.images[(this.imageRoot + sImgSrc)].src;\r
-\r
-            }\r
-\r
-        }\r
-\r
-    },\r
-\r
-\r
-    /**\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 oEl = this.element,\r
-            oSubmenu = p_aArgs[0],\r
-            oImg = this.submenuIndicator,\r
-            oConfig = this.cfg,\r
-            aNodes = [this.element, this._oAnchor],\r
-            oMenu,\r
-            bLazyLoad = this.parent && this.parent.lazyLoad;\r
-\r
-\r
-        if(oSubmenu) {\r
-\r
-            if(oSubmenu instanceof Menu) {\r
-\r
-                oMenu = oSubmenu;\r
-                oMenu.parent = this;\r
-                oMenu.lazyLoad = bLazyLoad;\r
-\r
-            }\r
-            else if(\r
-                typeof oSubmenu == "object" && \r
-                oSubmenu.id && \r
-                !oSubmenu.nodeType\r
-            ) {\r
-\r
-                var sSubmenuId = oSubmenu.id,\r
-                    oSubmenuConfig = oSubmenu;\r
-\r
-                oSubmenuConfig.lazyload = bLazyLoad;\r
-                oSubmenuConfig.parent = this;\r
-\r
-                oMenu = new this.SUBMENU_TYPE(sSubmenuId, oSubmenuConfig);\r
-\r
-\r
-                // Set the value of the property to the Menu instance\r
-                \r
-                this.cfg.setProperty("submenu", oMenu, true);\r
-\r
-            }\r
-            else {\r
-\r
-                oMenu = new this.SUBMENU_TYPE(\r
-                                oSubmenu,\r
-                                { lazyload: bLazyLoad, parent: this }                \r
-                            );\r
-\r
-\r
-                // Set the value of the property to the Menu instance\r
-                \r
-                this.cfg.setProperty("submenu", oMenu, true);\r
-\r
-            }\r
-\r
-\r
-            if(oMenu) {\r
-\r
-                this._oSubmenu = oMenu;\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
-                        oConfig.refireEvent("disabled");\r
-\r
-                    }\r
-\r
-                    if(oConfig.getProperty("selected")) {\r
-    \r
-                        oConfig.refireEvent("selected");\r
-    \r
-                    }                \r
-    \r
-                }\r
-            \r
-            }\r
-\r
-        }\r
-        else {\r
-\r
-            Dom.removeClass(aNodes, "hassubmenu");\r
-\r
-            if(oImg) {\r
-\r
-                oEl.removeChild(oImg);\r
-\r
-            }\r
-\r
-            if(this._oSubmenu) {\r
-\r
-                this._oSubmenu.destroy();\r
-\r
-            }\r
-\r
-        }\r
-\r
-    },\r
-\r
-\r
-    // Public methods\r
-\r
-       /**\r
-    * @method initDefaultConfig\r
-       * @description Initializes an item's configurable properties.\r
-       */\r
-       initDefaultConfig : function() {\r
-\r
-        var oConfig = this.cfg,\r
-            CheckBoolean = oConfig.checkBoolean;\r
-\r
-\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
-            }\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
-            { 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
-        /**\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
-            }\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
-                value: false,\r
-                handler: this.configStrongEmphasis,\r
-                validator: CheckBoolean,\r
-                suppressEvent: true\r
-            }\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
-                value: false,\r
-                handler: this.configDisabled,\r
-                validator: CheckBoolean,\r
-                suppressEvent: true\r
-            }\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
-                value: false,\r
-                handler: this.configSelected,\r
-                validator: CheckBoolean,\r
-                suppressEvent: true\r
-            }\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
-    * @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 Menu) {\r
-\r
-            var nGroupIndex = this.groupIndex;\r
-\r
-            /**\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
-                    getNextArrayItem(p_aArray, (p_nStartIndex+1));\r
-    \r
-            }\r
-    \r
-    \r
-            var aItemGroups = this.parent.getItemGroups(),\r
-                oNextItem;\r
-    \r
-    \r
-            if(this.index < (aItemGroups[nGroupIndex].length - 1)) {\r
-    \r
-                oNextItem = getNextArrayItem(\r
-                        aItemGroups[nGroupIndex], \r
-                        (this.index+1)\r
-                    );\r
-    \r
-            }\r
-            else {\r
-    \r
-                var nNextGroupIndex;\r
-    \r
-                if(nGroupIndex < (aItemGroups.length - 1)) {\r
-    \r
-                    nNextGroupIndex = nGroupIndex + 1;\r
-    \r
-                }\r
-                else {\r
-    \r
-                    nNextGroupIndex = 0;\r
-    \r
-                }\r
-    \r
-                var aNextGroup = getNextArrayItem(aItemGroups, nNextGroupIndex);\r
-    \r
-                // Retrieve the first menu item in the next group\r
-    \r
-                oNextItem = getNextArrayItem(aNextGroup, 0);\r
-    \r
-            }\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
-    /**\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 Menu) {\r
-\r
-            var nGroupIndex = this.groupIndex;\r
-\r
-            /**\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
-                    getPreviousArrayItem(p_aArray, (p_nStartIndex-1));\r
-    \r
-            }\r
-\r
-\r
-            /**\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
-            function getFirstItemIndex(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
-            var aItemGroups = this.parent.getItemGroups(),\r
-                oPreviousItem;\r
-    \r
-            if(\r
-                this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)\r
-            ) {\r
-    \r
-                oPreviousItem = \r
-                    getPreviousArrayItem(\r
-                        aItemGroups[nGroupIndex], \r
-                        (this.index-1)\r
-                    );\r
-    \r
-            }\r
-            else {\r
-    \r
-                var nPreviousGroupIndex;\r
-    \r
-                if(nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {\r
-    \r
-                    nPreviousGroupIndex = nGroupIndex - 1;\r
-    \r
-                }\r
-                else {\r
-    \r
-                    nPreviousGroupIndex = aItemGroups.length - 1;\r
-    \r
-                }\r
-    \r
-                var aPreviousGroup = \r
-                        getPreviousArrayItem(aItemGroups, nPreviousGroupIndex);\r
-    \r
-                oPreviousItem = \r
-                    getPreviousArrayItem(\r
-                        aPreviousGroup, \r
-                        (aPreviousGroup.length - 1)\r
-                    );\r
-    \r
-            }\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
-    /**\r
-    * @method focus\r
-    * @description Causes the menu item to receive the focus and fires the \r
-    * focus event.\r
-    */\r
-    focus: function() {\r
-\r
-        var oParent = this.parent,\r
-            oAnchor = this._oAnchor,\r
-            oActiveItem = oParent.activeItem;\r
-\r
-\r
-        function setFocus() {\r
-\r
-            try {\r
-\r
-                oAnchor.focus();\r
-\r
-            }\r
-            catch(e) {\r
-            \r
-            }\r
-\r
-        }\r
-\r
-\r
-        if(\r
-            !this.cfg.getProperty("disabled") && \r
-            oParent && \r
-            oParent.cfg.getProperty("visible") && \r
-            this.element.style.display != "none"\r
-        ) {\r
-\r
-            if(oActiveItem) {\r
-\r
-                oActiveItem.blur();\r
-\r
-            }\r
-\r
-\r
-            /*\r
-                Setting focus via a timer fixes a race condition in Firefox, IE \r
-                and Opera where the browser viewport jumps as it trys to \r
-                position and focus the menu.\r
-            */\r
-\r
-            window.setTimeout(setFocus, 0);\r
-            \r
-            this.focusEvent.fire();\r
-\r
-        }\r
-\r
-    },\r
-\r
-\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
-            Dom.getStyle(oParent.element, "visibility") == "visible"\r
-        ) {\r
-\r
-            this._oAnchor.blur();\r
-\r
-            this.blurEvent.fire();\r
-\r
-        }\r
-\r
-    },\r
-\r
-\r
-       /**\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
-        var oEl = this.element;\r
-\r
-        if(oEl) {\r
-\r
-\r
-            // If the item has a submenu, destroy it first\r
-\r
-            var oSubmenu = this.cfg.getProperty("submenu");\r
-\r
-            if(oSubmenu) {\r
-            \r
-                oSubmenu.destroy();\r
-            \r
-            }\r
-\r
-\r
-            // Remove CustomEvent listeners\r
-    \r
-            this.mouseOverEvent.unsubscribeAll();\r
-            this.mouseOutEvent.unsubscribeAll();\r
-            this.mouseDownEvent.unsubscribeAll();\r
-            this.mouseUpEvent.unsubscribeAll();\r
-            this.clickEvent.unsubscribeAll();\r
-            this.keyPressEvent.unsubscribeAll();\r
-            this.keyDownEvent.unsubscribeAll();\r
-            this.keyUpEvent.unsubscribeAll();\r
-            this.focusEvent.unsubscribeAll();\r
-            this.blurEvent.unsubscribeAll();\r
-            this.cfg.configChangedEvent.unsubscribeAll();\r
-\r
-\r
-            // Remove the element from the parent node\r
-\r
-            var oParentNode = oEl.parentNode;\r
-\r
-            if(oParentNode) {\r
-\r
-                oParentNode.removeChild(oEl);\r
-\r
-                this.destroyEvent.fire();\r
-\r
-            }\r
-\r
-            this.destroyEvent.unsubscribeAll();\r
-\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
-* 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
-/**\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
-\r
-YAHOO.extend(YAHOO.widget.ContextMenu, YAHOO.widget.Menu, {\r
-\r
-\r
-\r
-// Private properties\r
-\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
-\r
-\r
-// Public properties\r
-\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
-/**\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
-\r
-    // Call the init of the superclass (YAHOO.widget.Menu)\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
-\r
-        this.cfg.applyConfig(p_oConfig, true);\r
-\r
-    }\r
-    \r
-    \r
-    this.initEvent.fire(YAHOO.widget.ContextMenu);\r
-    \r
-},\r
-\r
-\r
-\r
-// Private methods\r
-\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
-        oTrigger = this._oTrigger,\r
-        bOpera = (this.browser == "opera");\r
-\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
-        Event.removeListener(oTrigger, "click", this._onTriggerClick);\r
-\r
-    }\r
-\r
-},\r
-\r
-\r
-\r
-// Private event handlers\r
-\r
-\r
-/**\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
-_onTriggerClick: function(p_oEvent, p_oMenu) {\r
-\r
-    if(p_oEvent.ctrlKey) {\r
-    \r
-        YAHOO.util.Event.stopEvent(p_oEvent);\r
-\r
-    }\r
-    \r
-},\r
-\r
-\r
-/**\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
-_onTriggerContextMenu: function(p_oEvent, p_oMenu) {\r
-\r
-    // Hide any other ContextMenu instances that might be visible\r
-\r
-    YAHOO.widget.MenuManager.hideVisible();\r
-\r
-\r
-    var Event = YAHOO.util.Event,\r
-        oConfig = this.cfg;\r
-\r
-    if(p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {\r
-\r
-        return;\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
-        nY = Event.getPageY(p_oEvent);\r
-\r
-\r
-    oConfig.applyConfig( { xy:[nX, nY], visible:true } );\r
-    oConfig.fireQueue();\r
-\r
-\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
-    Event.stopEvent(p_oEvent);\r
-    \r
-},\r
-\r
-\r
-\r
-// Public methods\r
-\r
-\r
-/**\r
-* @method toString\r
-* @description Returns a string representing the context menu.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
-    return ("ContextMenu " + this.id);\r
-\r
-},\r
-\r
-\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
-    YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);\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
-/**\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
-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
-\r
-// Public event handlers for configuration properties\r
-\r
-\r
-/**\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 {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
-configTrigger: function(p_sType, p_aArgs, p_oMenu) {\r
-    \r
-    var Event = YAHOO.util.Event,\r
-        oTrigger = p_aArgs[0];\r
-\r
-    if(oTrigger) {\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
-        if(this._oTrigger) {\r
-        \r
-            this._removeEventHandlers();\r
-\r
-        }\r
-\r
-        this._oTrigger = oTrigger;\r
-\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
-    else {\r
-    \r
-        this._removeEventHandlers();\r
-    \r
-    }\r
-    \r
-}\r
-\r
-}); // END YAHOO.extend\r
-\r
-\r
-/**\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.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
-* @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
-init: function(p_oObject, p_oConfig) {\r
-    \r
-    if(!this.SUBMENU_TYPE) {\r
-\r
-        this.SUBMENU_TYPE = YAHOO.widget.ContextMenu;\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
-    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
-// Public methods\r
-\r
-\r
-/**\r
-* @method toString\r
-* @description Returns a string representing the context menu item.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
-    return ("MenuBarItem: " + this.cfg.getProperty("text"));\r
-\r
-}\r
-    \r
-}); // END YAHOO.extend\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
-};\r
-\r
-YAHOO.extend(YAHOO.widget.MenuBar, YAHOO.widget.Menu, {\r
-\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
-    if(!this.ITEM_TYPE) {\r
-\r
-        this.ITEM_TYPE = YAHOO.widget.MenuBarItem;\r
-\r
-    }\r
-\r
-\r
-    // Call the init of the superclass (YAHOO.widget.Menu)\r
-\r
-    YAHOO.widget.MenuBar.superclass.init.call(this, p_oElement);\r
-\r
-\r
-    this.beforeInitEvent.fire(YAHOO.widget.MenuBar);\r
-\r
-\r
-    if(p_oConfig) {\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
-* @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
-_onKeyDown: function(p_sType, p_aArgs, p_oMenuBar) {\r
-\r
-    var Event = YAHOO.util.Event,\r
-        oEvent = p_aArgs[0],\r
-        oItem = p_aArgs[1],\r
-        oSubmenu;\r
-\r
-\r
-    if(oItem && !oItem.cfg.getProperty("disabled")) {\r
-\r
-        var oItemCfg = oItem.cfg;\r
-\r
-        switch(oEvent.keyCode) {\r
-    \r
-            case 37:    // Left arrow\r
-            case 39:    // Right 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
-                    var oNextItem = (oEvent.keyCode == 37) ? \r
-                            oItem.getPreviousEnabledSibling() : \r
-                            oItem.getNextEnabledSibling();\r
-            \r
-                    if(oNextItem) {\r
-    \r
-                        this.clearActiveItem();\r
-    \r
-                        oNextItem.cfg.setProperty("selected", true);\r
-    \r
-    \r
-                        if(this.cfg.getProperty("autosubmenudisplay")) {\r
-                        \r
-                            oSubmenu = oNextItem.cfg.getProperty("submenu");\r
-                            \r
-                            if(oSubmenu) {\r
-                        \r
-                                oSubmenu.show();\r
-                                oSubmenu.activeItem.blur();\r
-                                oSubmenu.activeItem = null;\r
-                            \r
-                            }\r
-                \r
-                        }           \r
-    \r
-                        oNextItem.focus();\r
-    \r
-                    }\r
-    \r
-                }\r
-    \r
-                Event.preventDefault(oEvent);\r
-    \r
-            break;\r
-    \r
-            case 40:    // Down arrow\r
-    \r
-                if(this.activeItem != oItem) {\r
-    \r
-                    this.clearActiveItem();\r
-    \r
-                    oItemCfg.setProperty("selected", true);\r
-                    oItem.focus();\r
-                \r
-                }\r
-    \r
-                oSubmenu = oItemCfg.getProperty("submenu");\r
-    \r
-                if(oSubmenu) {\r
-    \r
-                    if(oSubmenu.cfg.getProperty("visible")) {\r
-    \r
-                        oSubmenu.setInitialSelection();\r
-                        oSubmenu.setInitialFocus();\r
-                    \r
-                    }\r
-                    else {\r
-    \r
-                        oSubmenu.show();\r
-                    \r
-                    }\r
-    \r
-                }\r
-    \r
-                Event.preventDefault(oEvent);\r
-    \r
-            break;\r
-    \r
-        }\r
-\r
-    }\r
-\r
-\r
-    if(oEvent.keyCode == 27 && this.activeItem) { // Esc key\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
-        Event.preventDefault(oEvent);\r
-    \r
-    }\r
-\r
-},\r
-\r
-\r
-/**\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
-_onClick: function(p_sType, p_aArgs, p_oMenuBar) {\r
-\r
-    YAHOO.widget.MenuBar.superclass._onClick.call(\r
-        this, \r
-        p_sType, \r
-        p_aArgs, \r
-        p_oMenuBar\r
-    );\r
-\r
-\r
-    var oItem = p_aArgs[1];\r
-    \r
-    if(oItem && !oItem.cfg.getProperty("disabled")) {\r
-\r
-         var Event = YAHOO.util.Event,\r
-             Dom = YAHOO.util.Dom,\r
-    \r
-             oEvent = p_aArgs[0],\r
-             oTarget = Event.getTarget(oEvent),\r
-    \r
-             oActiveItem = this.activeItem,\r
-             oConfig = this.cfg;\r
-\r
-\r
-        // Hide any other submenus that might be visible\r
-    \r
-        if(oActiveItem && oActiveItem != oItem) {\r
-    \r
-            this.clearActiveItem();\r
-    \r
-        }\r
-    \r
-    \r
-        // Select and focus the current item\r
-    \r
-        oItem.cfg.setProperty("selected", true);\r
-        oItem.focus();\r
-    \r
-\r
-        // Show the submenu for the item\r
-    \r
-        var oSubmenu = oItem.cfg.getProperty("submenu");\r
-\r
-\r
-        if(oSubmenu && oTarget != oItem.submenuIndicator) {\r
-        \r
-            if(oSubmenu.cfg.getProperty("visible")) {\r
-            \r
-                oSubmenu.hide();\r
-            \r
-            }\r
-            else {\r
-            \r
-                oSubmenu.show();                    \r
-            \r
-            }\r
-        \r
-        }\r
-    \r
-    }\r
-\r
-},\r
-\r
-\r
-\r
-// Public methods\r
-\r
-\r
-/**\r
-* @method toString\r
-* @description Returns a string representing the menu bar.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
-    return ("MenuBar " + this.id);\r
-\r
-},\r
-\r
-\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.initDefaultConfig.call(this);\r
-\r
-    var oConfig = this.cfg;\r
-\r
-       // Add configuration properties\r
-\r
-\r
-    /*\r
-        Set the default value for the "position" configuration property\r
-        to "static" by re-adding the property.\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
-    /*\r
-        Set the default value for the "submenualignment" configuration property\r
-        to ["tl","bl"] by re-adding the property.\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
-\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
-}\r
\r
-}); // END YAHOO.extend\r
-\r
-\r
-/**\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.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
-        p_oConfig\r
-    );\r
-\r
-};\r
-\r
-YAHOO.extend(YAHOO.widget.MenuBarItem, YAHOO.widget.MenuItem, {\r
-\r
-\r
-/**\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
-init: function(p_oObject, p_oConfig) {\r
-\r
-    if(!this.SUBMENU_TYPE) {\r
-\r
-        this.SUBMENU_TYPE = YAHOO.widget.Menu;\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.MenuBarItem.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
-\r
-\r
-\r
-// Constants\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 bar item.\r
-* @default "yuimenubaritem"\r
-* @final\r
-* @type String\r
-*/\r
-CSS_CLASS_NAME: "yuimenubaritem",\r
-\r
-\r
-/**\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
-SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_nrm_1.gif",\r
-\r
-\r
-/**\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
-SELECTED_SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_hov_1.gif",\r
-\r
-\r
-/**\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
-DISABLED_SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_dim_1.gif",\r
-\r
-\r
-\r
-// Public methods\r
-\r
-\r
-/**\r
-* @method toString\r
-* @description Returns a string representing the menu bar item.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
-    return ("MenuBarItem: " + this.cfg.getProperty("text"));\r
-\r
-}\r
-    \r
-}); // END YAHOO.extend
\ No newline at end of file
+version: 2.3.0
+*/
+
+
+/**
+* @module menu
+* @description <p>The Menu family of components features a collection of 
+* controls that make it easy to add menus to your website or web application.  
+* With the Menu Controls you can create website fly-out menus, customized 
+* context menus, or application-style menu bars with just a small amount of 
+* scripting.</p><p>The Menu family of controls features:</p>
+* <ul>
+*    <li>Screen-reader accessibility.</li>
+*    <li>Keyboard and mouse navigation.</li>
+*    <li>A rich event model that provides access to all of a menu's 
+*    interesting moments.</li>
+*    <li>Support for 
+*    <a href="http://en.wikipedia.org/wiki/Progressive_Enhancement">Progressive
+*    Enhancement</a>; Menus can be created from simple, 
+*    semantic markup on the page or purely through JavaScript.</li>
+* </ul>
+* @title Menu
+* @namespace YAHOO.widget
+* @requires Event, Dom, Container
+*/
+(function () {
+
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event;
+
+
+    /**
+    * Singleton that manages a collection of all menus and menu items.  Listens 
+    * for DOM events at the document level and dispatches the events to the 
+    * corresponding menu or menu item.
+    *
+    * @namespace YAHOO.widget
+    * @class MenuManager
+    * @static
+    */
+    YAHOO.widget.MenuManager = function () {
+    
+        // Private member variables
+    
+    
+        // Flag indicating if the DOM event handlers have been attached
+    
+        var m_bInitializedEventHandlers = false,
+    
+    
+        // Collection of menus
+
+        m_oMenus = {},
+
+
+        // Collection of visible menus
+    
+        m_oVisibleMenus = {},
+    
+    
+        //  Collection of menu items 
+
+        m_oItems = {},
+
+
+        // Map of DOM event types to their equivalent CustomEvent types
+        
+        m_oEventTypes = {
+            "click": "clickEvent",
+            "mousedown": "mouseDownEvent",
+            "mouseup": "mouseUpEvent",
+            "mouseover": "mouseOverEvent",
+            "mouseout": "mouseOutEvent",
+            "keydown": "keyDownEvent",
+            "keyup": "keyUpEvent",
+            "keypress": "keyPressEvent"
+        },
+    
+    
+        m_oFocusedMenuItem = null;
+    
+    
+        var m_oLogger = new YAHOO.widget.LogWriter("MenuManager");
+    
+    
+    
+        // Private methods
+    
+    
+        /**
+        * @method getMenuRootElement
+        * @description Finds the root DIV node of a menu or the root LI node of 
+        * a menu item.
+        * @private
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object 
+        * specifying an HTML element.
+        */
+        function getMenuRootElement(p_oElement) {
+        
+            var oParentNode;
+    
+            if (p_oElement && p_oElement.tagName) {
+            
+                switch (p_oElement.tagName.toUpperCase()) {
+                        
+                case "DIV":
+    
+                    oParentNode = p_oElement.parentNode;
+    
+                    // Check if the DIV is the inner "body" node of a menu
+
+                    if (
+                        (
+                            Dom.hasClass(p_oElement, "hd") ||
+                            Dom.hasClass(p_oElement, "bd") ||
+                            Dom.hasClass(p_oElement, "ft")
+                        ) && 
+                        oParentNode && 
+                        oParentNode.tagName && 
+                        oParentNode.tagName.toUpperCase() == "DIV") 
+                    {
+                    
+                        return oParentNode;
+                    
+                    }
+                    else {
+                    
+                        return p_oElement;
+                    
+                    }
+                
+                    break;
+
+                case "LI":
+    
+                    return p_oElement;
+
+                default:
+    
+                    oParentNode = p_oElement.parentNode;
+    
+                    if (oParentNode) {
+                    
+                        return getMenuRootElement(oParentNode);
+                    
+                    }
+                
+                    break;
+                
+                }
+    
+            }
+            
+        }
+    
+    
+    
+        // Private event handlers
+    
+    
+        /**
+        * @method onDOMEvent
+        * @description Generic, global event handler for all of a menu's 
+        * DOM-based events.  This listens for events against the document 
+        * object.  If the target of a given event is a member of a menu or 
+        * menu item's DOM, the instance's corresponding Custom Event is fired.
+        * @private
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        function onDOMEvent(p_oEvent) {
+    
+            // Get the target node of the DOM event
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                
+            // See if the target of the event was a menu, or a menu item
+    
+            oElement = getMenuRootElement(oTarget),
+            sCustomEventType,
+            sTagName,
+            sId,
+            oMenuItem,
+            oMenu; 
+    
+    
+            if (oElement) {
+    
+                sTagName = oElement.tagName.toUpperCase();
+        
+                if (sTagName == "LI") {
+            
+                    sId = oElement.id;
+            
+                    if (sId && m_oItems[sId]) {
+            
+                        oMenuItem = m_oItems[sId];
+                        oMenu = oMenuItem.parent;
+            
+                    }
+                
+                }
+                else if (sTagName == "DIV") {
+                
+                    if (oElement.id) {
+                    
+                        oMenu = m_oMenus[oElement.id];
+                    
+                    }
+                
+                }
+    
+            }
+    
+    
+            if (oMenu) {
+    
+                sCustomEventType = m_oEventTypes[p_oEvent.type];
+    
+    
+                // Fire the Custom Event that corresponds the current DOM event    
+        
+                if (oMenuItem && !oMenuItem.cfg.getProperty("disabled")) {
+    
+                    oMenuItem[sCustomEventType].fire(p_oEvent);                   
+    
+    
+                    if (
+                            p_oEvent.type == "keyup" || 
+                            p_oEvent.type == "mousedown") 
+                    {
+    
+                        if (m_oFocusedMenuItem != oMenuItem) {
+                        
+                            if (m_oFocusedMenuItem) {
+    
+                                m_oFocusedMenuItem.blurEvent.fire();
+                            
+                            }
+    
+                            oMenuItem.focusEvent.fire();
+                        
+                        }
+                    
+                    }
+    
+                }
+        
+                oMenu[sCustomEventType].fire(p_oEvent, oMenuItem);
+            
+            }
+            else if (p_oEvent.type == "mousedown") {
+    
+                if (m_oFocusedMenuItem) {
+    
+                    m_oFocusedMenuItem.blurEvent.fire();
+    
+                    m_oFocusedMenuItem = null;
+    
+                }
+    
+    
+                /*
+                    If the target of the event wasn't a menu, hide all 
+                    dynamically positioned menus
+                */
+                
+                for (var i in m_oMenus) {
+        
+                    if (YAHOO.lang.hasOwnProperty(m_oMenus,i)) {
+        
+                        oMenu = m_oMenus[i];
+        
+                        if (oMenu.cfg.getProperty("clicktohide") && 
+                            !(oMenu instanceof YAHOO.widget.MenuBar) && 
+                            oMenu.cfg.getProperty("position") == "dynamic") {
+        
+                            oMenu.hide();
+        
+                        }
+                        else {
+    
+                            oMenu.clearActiveItem(true);
+        
+                        }
+        
+                    }
+        
+                } 
+    
+            }
+            else if (p_oEvent.type == "keyup") { 
+    
+                if (m_oFocusedMenuItem) {
+    
+                    m_oFocusedMenuItem.blurEvent.fire();
+    
+                    m_oFocusedMenuItem = null;
+    
+                }
+    
+            }
+    
+        }
+    
+    
+        /**
+        * @method onMenuDestroy
+        * @description "destroy" event handler for a menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event 
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {YAHOO.widget.Menu} p_oMenu The menu that fired the event.
+        */
+        function onMenuDestroy(p_sType, p_aArgs, p_oMenu) {
+    
+            if (m_oMenus[p_oMenu.id]) {
+    
+                this.removeMenu(p_oMenu);
+    
+            }
+    
+        }
+    
+    
+        /**
+        * @method onMenuFocus
+        * @description "focus" event handler for a MenuItem instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event 
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onMenuFocus(p_sType, p_aArgs) {
+    
+            var oItem = p_aArgs[0];
+    
+            if (oItem) {
+    
+                m_oFocusedMenuItem = oItem;
+            
+            }
+    
+        }
+    
+    
+        /**
+        * @method onMenuBlur
+        * @description "blur" event handler for a MenuItem instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onMenuBlur(p_sType, p_aArgs) {
+    
+            m_oFocusedMenuItem = null;
+    
+        }
+    
+    
+    
+        /**
+        * @method onMenuVisibleConfigChange
+        * @description Event handler for when the "visible" configuration  
+        * property of a Menu instance changes.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onMenuVisibleConfigChange(p_sType, p_aArgs) {
+    
+            var bVisible = p_aArgs[0],
+                sId = this.id;
+            
+            if (bVisible) {
+    
+                m_oVisibleMenus[sId] = this;
+                
+                m_oLogger.log(
+                            this + 
+                            " added to the collection of visible menus.");
+            
+            }
+            else if (m_oVisibleMenus[sId]) {
+            
+                delete m_oVisibleMenus[sId];
+                
+                m_oLogger.log( 
+                            this + 
+                            " removed from the collection of visible menus.");
+            
+            }
+        
+        }
+    
+    
+        /**
+        * @method onItemDestroy
+        * @description "destroy" event handler for a MenuItem instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onItemDestroy(p_sType, p_aArgs) {
+    
+            var sId = this.id;
+    
+            if (sId && m_oItems[sId]) {
+    
+                if (m_oFocusedMenuItem == this) {
+    
+                    m_oFocusedMenuItem = null;
+    
+                }
+    
+                delete m_oItems[sId];
+    
+                m_oLogger.log(this + " successfully unregistered.");
+    
+            }
+    
+        }
+    
+    
+        /**
+        * @method onItemAdded
+        * @description "itemadded" event handler for a Menu instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onItemAdded(p_sType, p_aArgs) {
+    
+            var oItem = p_aArgs[0],
+                sId;
+    
+            if (oItem instanceof YAHOO.widget.MenuItem) { 
+    
+                sId = oItem.id;
+        
+                if (!m_oItems[sId]) {
+            
+                    m_oItems[sId] = oItem;
+        
+                    oItem.destroyEvent.subscribe(onItemDestroy);
+        
+                    m_oLogger.log(oItem + " successfully registered.");
+        
+                }
+    
+            }
+        
+        }
+    
+    
+        return {
+    
+            // Privileged methods
+    
+    
+            /**
+            * @method addMenu
+            * @description Adds a menu to the collection of known menus.
+            * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu  
+            * instance to be added.
+            */
+            addMenu: function (p_oMenu) {
+    
+                var oDoc;
+    
+                if (
+                    p_oMenu instanceof YAHOO.widget.Menu && 
+                    p_oMenu.id && 
+                    !m_oMenus[p_oMenu.id]
+                ) {
+        
+                    m_oMenus[p_oMenu.id] = p_oMenu;
+                
+            
+                    if (!m_bInitializedEventHandlers) {
+            
+                        oDoc = document;
+                
+                        Event.on(oDoc, "mouseover", onDOMEvent, this, true);
+                        Event.on(oDoc, "mouseout", onDOMEvent, this, true);
+                        Event.on(oDoc, "mousedown", onDOMEvent, this, true);
+                        Event.on(oDoc, "mouseup", onDOMEvent, this, true);
+                        Event.on(oDoc, "click", onDOMEvent, this, true);
+                        Event.on(oDoc, "keydown", onDOMEvent, this, true);
+                        Event.on(oDoc, "keyup", onDOMEvent, this, true);
+                        Event.on(oDoc, "keypress", onDOMEvent, this, true);
+    
+    
+                        m_bInitializedEventHandlers = true;
+                        
+                        m_oLogger.log("DOM event handlers initialized.");
+            
+                    }
+            
+                    p_oMenu.destroyEvent.subscribe(
+                                            onMenuDestroy, 
+                                            p_oMenu, 
+                                            this);
+    
+                    p_oMenu.cfg.subscribeToConfigEvent(
+                        "visible", 
+                        onMenuVisibleConfigChange);
+            
+                    p_oMenu.itemAddedEvent.subscribe(onItemAdded);
+                    p_oMenu.focusEvent.subscribe(onMenuFocus);
+                    p_oMenu.blurEvent.subscribe(onMenuBlur);
+        
+                    m_oLogger.log(p_oMenu + " successfully registered.");
+        
+                }
+        
+            },
+    
+        
+            /**
+            * @method removeMenu
+            * @description Removes a menu from the collection of known menus.
+            * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu  
+            * instance to be removed.
+            */
+            removeMenu: function (p_oMenu) {
+    
+                var sId;
+        
+                if (p_oMenu) {
+    
+                    sId = p_oMenu.id;
+        
+                    if (m_oMenus[sId] == p_oMenu) {
+            
+                        delete m_oMenus[sId];
+            
+                        m_oLogger.log(p_oMenu + " successfully unregistered.");
+        
+        
+                        if (m_oVisibleMenus[sId] == p_oMenu) {
+            
+                            delete m_oVisibleMenus[sId];
+                            
+                            m_oLogger.log( 
+                                        p_oMenu + 
+                                        " unregistered from the" + 
+                                        " collection of visible menus.");
+                                
+                        }
+            
+                    }
+                
+                }
+    
+            },
+        
+        
+            /**
+            * @method hideVisible
+            * @description Hides all visible, dynamically positioned menus 
+            * (excluding instances of YAHOO.widget.MenuBar).
+            */
+            hideVisible: function () {
+        
+                var oMenu;
+        
+                for (var i in m_oVisibleMenus) {
+        
+                    if (YAHOO.lang.hasOwnProperty(m_oVisibleMenus,i)) {
+        
+                        oMenu = m_oVisibleMenus[i];
+        
+                        if (!(oMenu instanceof YAHOO.widget.MenuBar) && 
+                            oMenu.cfg.getProperty("position") == "dynamic") {
+        
+                            oMenu.hide();
+        
+                        }
+        
+                    }
+        
+                }        
+    
+            },
+    
+    
+            /**
+            * @method getMenus
+            * @description Returns an array of all menus registered with the 
+            * menu manger.
+            * @return {Array}
+            */
+            getMenus: function () {
+    
+                return m_oMenus;
+            
+            },
+    
+    
+            /**
+            * @method getMenu
+            * @description Returns a menu with the specified id.
+            * @param {String} p_sId String specifying the id of the 
+            * <code>&#60;div&#62;</code> element representing the menu to
+            * be retrieved.
+            * @return {YAHOO.widget.Menu}
+            */
+            getMenu: function (p_sId) {
+    
+                var oMenu = m_oMenus[p_sId];
+        
+                if (oMenu) {
+                
+                    return oMenu;
+                
+                }
+            
+            },
+    
+    
+            /**
+            * @method getMenuItem
+            * @description Returns a menu item with the specified id.
+            * @param {String} p_sId String specifying the id of the 
+            * <code>&#60;li&#62;</code> element representing the menu item to
+            * be retrieved.
+            * @return {YAHOO.widget.MenuItem}
+            */
+            getMenuItem: function (p_sId) {
+    
+                var oItem = m_oItems[p_sId];
+        
+                if (oItem) {
+                
+                    return oItem;
+                
+                }
+            
+            },
+
+
+            /**
+            * @method getMenuItemGroup
+            * @description Returns an array of menu item instances whose 
+            * corresponding <code>&#60;li&#62;</code> elements are child 
+            * nodes of the <code>&#60;ul&#62;</code> element with the 
+            * specified id.
+            * @param {String} p_sId String specifying the id of the 
+            * <code>&#60;ul&#62;</code> element representing the group of 
+            * menu items to be retrieved.
+            * @return {Array}
+            */
+            getMenuItemGroup: function (p_sId) {
+
+                var oUL = Dom.get(p_sId),
+                    aItems,
+                    oNode,
+                    oItem,
+                    sId;
+    
+
+                if (oUL && oUL.tagName && 
+                    oUL.tagName.toUpperCase() == "UL") {
+
+                    oNode = oUL.firstChild;
+
+                    if (oNode) {
+
+                        aItems = [];
+                        
+                        do {
+
+                            sId = oNode.id;
+
+                            if (sId) {
+                            
+                                oItem = this.getMenuItem(sId);
+                                
+                                if (oItem) {
+                                
+                                    aItems[aItems.length] = oItem;
+                                
+                                }
+                            
+                            }
+                        
+                        }
+                        while ((oNode = oNode.nextSibling));
+
+
+                        if (aItems.length > 0) {
+
+                            return aItems;
+                        
+                        }
+
+                    }
+                
+                }
+            
+            },
+
+    
+            /**
+            * @method getFocusedMenuItem
+            * @description Returns a reference to the menu item that currently 
+            * has focus.
+            * @return {YAHOO.widget.MenuItem}
+            */
+            getFocusedMenuItem: function () {
+    
+                return m_oFocusedMenuItem;
+    
+            },
+    
+    
+            /**
+            * @method getFocusedMenu
+            * @description Returns a reference to the menu that currently 
+            * has focus.
+            * @return {YAHOO.widget.Menu}
+            */
+            getFocusedMenu: function () {
+    
+                if (m_oFocusedMenuItem) {
+    
+                    return (m_oFocusedMenuItem.parent.getRoot());
+                
+                }
+    
+            },
+    
+        
+            /**
+            * @method toString
+            * @description Returns a string representing the menu manager.
+            * @return {String}
+            */
+            toString: function () {
+            
+                return "MenuManager";
+            
+            }
+    
+        };
+    
+    }();
+
+})();
+
+
+
+(function () {
+
+
+/**
+* The Menu class creates a container that holds a vertical list representing 
+* a set of options or commands.  Menu is the base class for all 
+* menu containers. 
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the menu.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source 
+* for the menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+* specifying the <code>&#60;div&#62;</code> element of the menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement 
+* Object specifying the <code>&#60;select&#62;</code> element to be used as 
+* the data source for the menu.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu. See configuration class documentation for 
+* more details.
+* @namespace YAHOO.widget
+* @class Menu
+* @constructor
+* @extends YAHOO.widget.Overlay
+*/
+YAHOO.widget.Menu = function (p_oElement, p_oConfig) {
+
+    if (p_oConfig) {
+
+        this.parent = p_oConfig.parent;
+        this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload;
+        this.itemData = p_oConfig.itemData || p_oConfig.itemdata;
+
+    }
+
+
+    YAHOO.widget.Menu.superclass.constructor.call(this, p_oElement, p_oConfig);
+
+};
+
+
+
+/**
+* @method checkPosition
+* @description Checks to make sure that the value of the "position" property 
+* is one of the supported strings. Returns true if the position is supported.
+* @private
+* @param {Object} p_sPosition String specifying the position of the menu.
+* @return {Boolean}
+*/
+function checkPosition(p_sPosition) {
+
+    if (typeof p_sPosition == "string") {
+
+        return ("dynamic,static".indexOf((p_sPosition.toLowerCase())) != -1);
+
+    }
+
+}
+
+
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Module = YAHOO.widget.Module,
+    Overlay = YAHOO.widget.Overlay,
+    Menu = YAHOO.widget.Menu,
+    MenuManager = YAHOO.widget.MenuManager,
+    CustomEvent = YAHOO.util.CustomEvent,
+    Lang = YAHOO.lang,
+    
+    m_oShadowTemplate,
+
+    /**
+    * Constant representing the name of the Menu's events
+    * @property EVENT_TYPES
+    * @private
+    * @final
+    * @type Object
+    */
+    EVENT_TYPES = {
+    
+        "MOUSE_OVER": "mouseover",
+        "MOUSE_OUT": "mouseout",
+        "MOUSE_DOWN": "mousedown",
+        "MOUSE_UP": "mouseup",
+        "CLICK": "click",
+        "KEY_PRESS": "keypress",
+        "KEY_DOWN": "keydown",
+        "KEY_UP": "keyup",
+        "FOCUS": "focus",
+        "BLUR": "blur",
+        "ITEM_ADDED": "itemAdded",
+        "ITEM_REMOVED": "itemRemoved"
+    
+    },
+
+
+    /**
+    * Constant representing the Menu's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
+    * @final
+    * @type Object
+    */
+    DEFAULT_CONFIG = {
+
+        "VISIBLE": { 
+            key: "visible", 
+            value: false, 
+            validator: Lang.isBoolean
+        }, 
+    
+        "CONSTRAIN_TO_VIEWPORT": {
+            key: "constraintoviewport", 
+            value: true, 
+            validator: Lang.isBoolean, 
+            supercedes: ["iframe","x","y","xy"]
+        }, 
+    
+        "POSITION": { 
+            key: "position", 
+            value: "dynamic", 
+            validator: checkPosition, 
+            supercedes: ["visible", "iframe"]
+        }, 
+    
+        "SUBMENU_ALIGNMENT": { 
+            key: "submenualignment", 
+            value: ["tl","tr"]
+        },
+    
+        "AUTO_SUBMENU_DISPLAY": { 
+            key: "autosubmenudisplay", 
+            value: true, 
+            validator: Lang.isBoolean 
+        }, 
+    
+        "SHOW_DELAY": { 
+            key: "showdelay", 
+            value: 250, 
+            validator: Lang.isNumber 
+        }, 
+    
+        "HIDE_DELAY": { 
+            key: "hidedelay", 
+            value: 0, 
+            validator: Lang.isNumber, 
+            suppressEvent: true
+        }, 
+    
+        "SUBMENU_HIDE_DELAY": { 
+            key: "submenuhidedelay", 
+            value: 250, 
+            validator: Lang.isNumber
+        }, 
+    
+        "CLICK_TO_HIDE": { 
+            key: "clicktohide", 
+            value: true, 
+            validator: Lang.isBoolean
+        },
+    
+        "CONTAINER": { 
+            key: "container"
+        }, 
+    
+        "MAX_HEIGHT": { 
+            key: "maxheight", 
+            value: 0, 
+            validator: Lang.isNumber,
+            supercedes: ["iframe"]
+        }, 
+    
+        "CLASS_NAME": { 
+            key: "classname", 
+            value: null, 
+            validator: Lang.isString
+        }, 
+    
+        "DISABLED": { 
+            key: "disabled", 
+            value: false, 
+            validator: Lang.isBoolean
+        }
+    
+    };
+
+
+
+YAHOO.lang.extend(Menu, Overlay, {
+
+
+// Constants
+
+
+/**
+* @property CSS_CLASS_NAME
+* @description String representing the CSS class(es) to be applied to the 
+* menu's <code>&#60;div&#62;</code> element.
+* @default "yuimenu"
+* @final
+* @type String
+*/
+CSS_CLASS_NAME: "yuimenu",
+
+
+/**
+* @property ITEM_TYPE
+* @description Object representing the type of menu item to instantiate and 
+* add when parsing the child nodes (either <code>&#60;li&#62;</code> element, 
+* <code>&#60;optgroup&#62;</code> element or <code>&#60;option&#62;</code>) 
+* of the menu's source HTML element.
+* @default YAHOO.widget.MenuItem
+* @final
+* @type YAHOO.widget.MenuItem
+*/
+ITEM_TYPE: null,
+
+
+/**
+* @property GROUP_TITLE_TAG_NAME
+* @description String representing the tagname of the HTML element used to 
+* title the menu's item groups.
+* @default H6
+* @final
+* @type String
+*/
+GROUP_TITLE_TAG_NAME: "h6",
+
+
+
+// Private properties
+
+
+/** 
+* @property _nHideDelayId
+* @description Number representing the time-out setting used to cancel the 
+* hiding of a menu.
+* @default null
+* @private
+* @type Number
+*/
+_nHideDelayId: null,
+
+
+/** 
+* @property _nShowDelayId
+* @description Number representing the time-out setting used to cancel the 
+* showing of a menu.
+* @default null
+* @private
+* @type Number
+*/
+_nShowDelayId: null,
+
+
+/** 
+* @property _nSubmenuHideDelayId
+* @description Number representing the time-out setting used to cancel the 
+* hiding of a submenu.
+* @default null
+* @private
+* @type Number
+*/
+_nSubmenuHideDelayId: null,
+
+
+/** 
+* @property _nBodyScrollId
+* @description Number representing the time-out setting used to cancel the 
+* scrolling of the menu's body element.
+* @default null
+* @private
+* @type Number
+*/
+_nBodyScrollId: null,
+
+
+/** 
+* @property _bHideDelayEventHandlersAssigned
+* @description Boolean indicating if the "mouseover" and "mouseout" event 
+* handlers used for hiding the menu via a call to "window.setTimeout" have 
+* already been assigned.
+* @default false
+* @private
+* @type Boolean
+*/
+_bHideDelayEventHandlersAssigned: false,
+
+
+/**
+* @property _bHandledMouseOverEvent
+* @description Boolean indicating the current state of the menu's 
+* "mouseover" event.
+* @default false
+* @private
+* @type Boolean
+*/
+_bHandledMouseOverEvent: false,
+
+
+/**
+* @property _bHandledMouseOutEvent
+* @description Boolean indicating the current state of the menu's
+* "mouseout" event.
+* @default false
+* @private
+* @type Boolean
+*/
+_bHandledMouseOutEvent: false,
+
+
+/**
+* @property _aGroupTitleElements
+* @description Array of HTML element used to title groups of menu items.
+* @default []
+* @private
+* @type Array
+*/
+_aGroupTitleElements: null,
+
+
+/**
+* @property _aItemGroups
+* @description Multi-dimensional Array representing the menu items as they
+* are grouped in the menu.
+* @default []
+* @private
+* @type Array
+*/
+_aItemGroups: null,
+
+
+/**
+* @property _aListElements
+* @description Array of <code>&#60;ul&#62;</code> elements, each of which is 
+* the parent node for each item's <code>&#60;li&#62;</code> element.
+* @default []
+* @private
+* @type Array
+*/
+_aListElements: null,
+
+
+/**
+* @property _nCurrentMouseX
+* @description The current x coordinate of the mouse inside the area of 
+* the menu.
+* @default 0
+* @private
+* @type Number
+*/
+_nCurrentMouseX: 0,
+
+
+/**
+* @property _nMaxHeight
+* @description The original value of the "maxheight" configuration property 
+* as set by the user.
+* @default -1
+* @private
+* @type Number
+*/
+_nMaxHeight: -1,
+
+
+/**
+* @property _bStopMouseEventHandlers
+* @description Stops "mouseover," "mouseout," and "mousemove" event handlers 
+* from executing.
+* @default false
+* @private
+* @type Boolean
+*/
+_bStopMouseEventHandlers: false,
+
+
+/**
+* @property _sClassName
+* @description The current value of the "classname" configuration attribute.
+* @default null
+* @private
+* @type String
+*/
+_sClassName: null,
+
+
+/**
+* @property _bDisabled
+* @description The current value of the "disabled" configuration attribute.
+* @default false
+* @private
+* @type Boolean
+*/
+_bDisabled: false,
+
+
+// Public properties
+
+
+/**
+* @property lazyLoad
+* @description Boolean indicating if the menu's "lazy load" feature is 
+* enabled.  If set to "true," initialization and rendering of the menu's 
+* items will be deferred until the first time it is made visible.  This 
+* property should be set via the constructor using the configuration 
+* object literal.
+* @default false
+* @type Boolean
+*/
+lazyLoad: false,
+
+
+/**
+* @property itemData
+* @description Array of items to be added to the menu.  The array can contain 
+* strings representing the text for each item to be created, object literals 
+* representing the menu item configuration properties, or MenuItem instances.  
+* This property should be set via the constructor using the configuration 
+* object literal.
+* @default null
+* @type Array
+*/
+itemData: null,
+
+
+/**
+* @property activeItem
+* @description Object reference to the item in the menu that has is selected.
+* @default null
+* @type YAHOO.widget.MenuItem
+*/
+activeItem: null,
+
+
+/**
+* @property parent
+* @description Object reference to the menu's parent menu or menu item.  
+* This property can be set via the constructor using the configuration 
+* object literal.
+* @default null
+* @type YAHOO.widget.MenuItem
+*/
+parent: null,
+
+
+/**
+* @property srcElement
+* @description Object reference to the HTML element (either 
+* <code>&#60;select&#62;</code> or <code>&#60;div&#62;</code>) used to 
+* create the menu.
+* @default null
+* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>|<a 
+* href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.
+* html#ID-22445964">HTMLDivElement</a>
+*/
+srcElement: null,
+
+
+
+// Events
+
+
+/**
+* @event mouseOverEvent
+* @description Fires when the mouse has entered the menu.  Passes back 
+* the DOM Event object as an argument.
+*/
+mouseOverEvent: null,
+
+
+/**
+* @event mouseOutEvent
+* @description Fires when the mouse has left the menu.  Passes back the DOM 
+* Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+mouseOutEvent: null,
+
+
+/**
+* @event mouseDownEvent
+* @description Fires when the user mouses down on the menu.  Passes back the 
+* DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+mouseDownEvent: null,
+
+
+/**
+* @event mouseUpEvent
+* @description Fires when the user releases a mouse button while the mouse is 
+* over the menu.  Passes back the DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+mouseUpEvent: null,
+
+
+/**
+* @event clickEvent
+* @description Fires when the user clicks the on the menu.  Passes back the 
+* DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+clickEvent: null,
+
+
+/**
+* @event keyPressEvent
+* @description Fires when the user presses an alphanumeric key when one of the
+* menu's items has focus.  Passes back the DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+keyPressEvent: null,
+
+
+/**
+* @event keyDownEvent
+* @description Fires when the user presses a key when one of the menu's items 
+* has focus.  Passes back the DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+keyDownEvent: null,
+
+
+/**
+* @event keyUpEvent
+* @description Fires when the user releases a key when one of the menu's items 
+* has focus.  Passes back the DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+keyUpEvent: null,
+
+
+/**
+* @event itemAddedEvent
+* @description Fires when an item is added to the menu.
+* @type YAHOO.util.CustomEvent
+*/
+itemAddedEvent: null,
+
+
+/**
+* @event itemRemovedEvent
+* @description Fires when an item is removed to the menu.
+* @type YAHOO.util.CustomEvent
+*/
+itemRemovedEvent: null,
+
+
+/**
+* @method init
+* @description The Menu class's initialization method. This method is 
+* automatically called by the constructor, and sets up all DOM references 
+* for pre-existing markup, and creates required markup if it is not 
+* already present.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the menu.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source 
+* for the menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+* specifying the <code>&#60;div&#62;</code> element of the menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement 
+* Object specifying the <code>&#60;select&#62;</code> element to be used as 
+* the data source for the menu.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu. See configuration class documentation for 
+* more details.
+*/
+init: function (p_oElement, p_oConfig) {
+
+    this._aItemGroups = [];
+    this._aListElements = [];
+    this._aGroupTitleElements = [];
+
+    if (!this.ITEM_TYPE) {
+
+        this.ITEM_TYPE = YAHOO.widget.MenuItem;
+
+    }
+
+
+    var oElement;
+
+    if (typeof p_oElement == "string") {
+
+        oElement = document.getElementById(p_oElement);
+
+    }
+    else if (p_oElement.tagName) {
+
+        oElement = p_oElement;
+
+    }
+
+
+    if (oElement && oElement.tagName) {
+
+        switch(oElement.tagName.toUpperCase()) {
+    
+            case "DIV":
+
+                this.srcElement = oElement;
+
+                if (!oElement.id) {
+
+                    oElement.setAttribute("id", Dom.generateId());
+
+                }
+
+
+                /* 
+                    Note: we don't pass the user config in here yet 
+                    because we only want it executed once, at the lowest 
+                    subclass level.
+                */ 
+            
+                Menu.superclass.init.call(this, oElement);
+
+                this.beforeInitEvent.fire(Menu);
+
+                this.logger = new YAHOO.widget.LogWriter(this.toString());
+
+                this.logger.log("Source element: " + this.srcElement.tagName);
+    
+            break;
+    
+            case "SELECT":
+    
+                this.srcElement = oElement;
+
+    
+                /*
+                    The source element is not something that we can use 
+                    outright, so we need to create a new Overlay
+
+                    Note: we don't pass the user config in here yet 
+                    because we only want it executed once, at the lowest 
+                    subclass level.
+                */ 
+
+                Menu.superclass.init.call(this, Dom.generateId());
+
+                this.beforeInitEvent.fire(Menu);
+
+                this.logger = new YAHOO.widget.LogWriter(this.toString());
+
+                this.logger.log("Source element: " + this.srcElement.tagName);
+
+            break;
+
+        }
+
+    }
+    else {
+
+        /* 
+            Note: we don't pass the user config in here yet 
+            because we only want it executed once, at the lowest 
+            subclass level.
+        */ 
+    
+        Menu.superclass.init.call(this, p_oElement);
+
+        this.beforeInitEvent.fire(Menu);
+
+        this.logger = new YAHOO.widget.LogWriter(this.toString());
+
+        this.logger.log("No source element found.  " +
+            "Created element with id: " + this.id);
+
+    }
+
+
+    if (this.element) {
+
+        Dom.addClass(this.element, this.CSS_CLASS_NAME);
+
+
+        // Subscribe to Custom Events
+
+        this.initEvent.subscribe(this._onInit);
+        this.beforeRenderEvent.subscribe(this._onBeforeRender);
+        this.renderEvent.subscribe(this._onRender);
+        this.renderEvent.subscribe(this.onRender);
+        this.beforeShowEvent.subscribe(this._onBeforeShow);
+        this.showEvent.subscribe(this._onShow);
+        this.beforeHideEvent.subscribe(this._onBeforeHide);
+        this.hideEvent.subscribe(this._onHide);
+        this.mouseOverEvent.subscribe(this._onMouseOver);
+        this.mouseOutEvent.subscribe(this._onMouseOut);
+        this.clickEvent.subscribe(this._onClick);
+        this.keyDownEvent.subscribe(this._onKeyDown);
+        this.keyPressEvent.subscribe(this._onKeyPress);
+
+        Module.textResizeEvent.subscribe(this._onTextResize, this, true);
+
+
+        if (p_oConfig) {
+    
+            this.cfg.applyConfig(p_oConfig, true);
+    
+        }
+
+
+        // Register the Menu instance with the MenuManager
+
+        MenuManager.addMenu(this);
+        
+
+        this.initEvent.fire(Menu);
+
+    }
+
+},
+
+
+
+// Private methods
+
+
+/**
+* @method _initSubTree
+* @description Iterates the childNodes of the source element to find nodes 
+* used to instantiate menu and menu items.
+* @private
+*/
+_initSubTree: function () {
+
+    var oSrcElement = this.srcElement,
+        sSrcElementTagName,
+        nGroup,
+        sGroupTitleTagName,
+        oNode,
+        aListElements,
+        nListElements,
+        i;
+
+
+    if (oSrcElement) {
+    
+        sSrcElementTagName = 
+            (oSrcElement.tagName && oSrcElement.tagName.toUpperCase());
+
+
+        if (sSrcElementTagName == "DIV") {
+    
+            //  Populate the collection of item groups and item group titles
+    
+            oNode = this.body.firstChild;
+    
+
+            if (oNode) {
+    
+                nGroup = 0;
+                sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase();
+        
+                do {
+        
+
+                    if (oNode && oNode.tagName) {
+        
+                        switch (oNode.tagName.toUpperCase()) {
+        
+                            case sGroupTitleTagName:
+                            
+                                this._aGroupTitleElements[nGroup] = oNode;
+        
+                            break;
+        
+                            case "UL":
+        
+                                this._aListElements[nGroup] = oNode;
+                                this._aItemGroups[nGroup] = [];
+                                nGroup++;
+        
+                            break;
+        
+                        }
+                    
+                    }
+        
+                }
+                while ((oNode = oNode.nextSibling));
+        
+        
+                /*
+                    Apply the "first-of-type" class to the first UL to mimic 
+                    the "first-of-type" CSS3 psuedo class.
+                */
+        
+                if (this._aListElements[0]) {
+        
+                    Dom.addClass(this._aListElements[0], "first-of-type");
+        
+                }
+            
+            }
+    
+        }
+    
+    
+        oNode = null;
+    
+        this.logger.log("Searching DOM for items to initialize.");
+    
+
+        if (sSrcElementTagName) {
+    
+            switch (sSrcElementTagName) {
+        
+                case "DIV":
+
+                    aListElements = this._aListElements;
+                    nListElements = aListElements.length;
+        
+                    if (nListElements > 0) {
+        
+                        this.logger.log("Found " + nListElements + 
+                            " item groups to initialize.");
+        
+                        i = nListElements - 1;
+        
+                        do {
+        
+                            oNode = aListElements[i].firstChild;
+            
+                            if (oNode) {
+
+                                this.logger.log("Scanning " + 
+                                    aListElements[i].childNodes.length + 
+                                    " child nodes for items to initialize.");
+            
+                                do {
+                
+                                    if (oNode && oNode.tagName && 
+                                        oNode.tagName.toUpperCase() == "LI") {
+                
+                                        this.logger.log("Initializing " + 
+                                            oNode.tagName + " node.");
+        
+                                        this.addItem(new this.ITEM_TYPE(oNode, 
+                                                    { parent: this }), i);
+            
+                                    }
+                        
+                                }
+                                while ((oNode = oNode.nextSibling));
+                            
+                            }
+                    
+                        }
+                        while (i--);
+        
+                    }
+        
+                break;
+        
+                case "SELECT":
+        
+                    this.logger.log("Scanning " +  
+                        oSrcElement.childNodes.length + 
+                        " child nodes for items to initialize.");
+        
+                    oNode = oSrcElement.firstChild;
+        
+                    do {
+        
+                        if (oNode && oNode.tagName) {
+                        
+                            switch (oNode.tagName.toUpperCase()) {
+            
+                                case "OPTGROUP":
+                                case "OPTION":
+            
+                                    this.logger.log("Initializing " +  
+                                        oNode.tagName + " node.");
+            
+                                    this.addItem(
+                                            new this.ITEM_TYPE(
+                                                    oNode, 
+                                                    { parent: this }
+                                                )
+                                            );
+            
+                                break;
+            
+                            }
+    
+                        }
+        
+                    }
+                    while ((oNode = oNode.nextSibling));
+        
+                break;
+        
+            }
+    
+        }    
+    
+    }
+
+},
+
+
+/**
+* @method _getFirstEnabledItem
+* @description Returns the first enabled item in the menu.
+* @return {YAHOO.widget.MenuItem}
+* @private
+*/
+_getFirstEnabledItem: function () {
+
+    var aItems = this.getItems(),
+        nItems = aItems.length,
+        oItem;
+    
+    for(var i=0; i<nItems; i++) {
+
+        oItem = aItems[i];
+
+        if (oItem && !oItem.cfg.getProperty("disabled") && 
+            oItem.element.style.display != "none") {
+
+            return oItem;
+
+        }
+    
+    }
+    
+},
+
+
+/**
+* @method _addItemToGroup
+* @description Adds a menu item to a group.
+* @private
+* @param {Number} p_nGroupIndex Number indicating the group to which the 
+* item belongs.
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance to be added to the menu.
+* @param {String} p_oItem String specifying the text of the item to be added 
+* to the menu.
+* @param {Object} p_oItem Object literal containing a set of menu item 
+* configuration properties.
+* @param {Number} p_nItemIndex Optional. Number indicating the index at 
+* which the menu item should be added.
+* @return {YAHOO.widget.MenuItem}
+*/
+_addItemToGroup: function (p_nGroupIndex, p_oItem, p_nItemIndex) {
+
+    var oItem,
+        bDisabled = this.cfg.getProperty("disabled"),
+        nGroupIndex,
+        aGroup,
+        oGroupItem,
+        bAppend,
+        oNextItemSibling,
+        nItemIndex;
+
+    function getNextItemSibling(p_aArray, p_nStartIndex) {
+
+        return (p_aArray[p_nStartIndex] || getNextItemSibling(p_aArray, 
+                (p_nStartIndex+1)));
+
+    }
+
+    if (p_oItem instanceof this.ITEM_TYPE) {
+
+        oItem = p_oItem;
+        oItem.parent = this;
+
+    }
+    else if (typeof p_oItem == "string") {
+
+        oItem = new this.ITEM_TYPE(p_oItem, { parent: this });
+    
+    }
+    else if (typeof p_oItem == "object") {
+
+        p_oItem.parent = this;
+
+        oItem = new this.ITEM_TYPE(p_oItem.text, p_oItem);
+
+    }
+
+
+    if (oItem) {
+
+        if (oItem.cfg.getProperty("selected")) {
+
+            this.activeItem = oItem;
+        
+        }
+
+
+        nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;
+        aGroup = this._getItemGroup(nGroupIndex);
+
+
+
+        if (!aGroup) {
+
+            aGroup = this._createItemGroup(nGroupIndex);
+
+        }
+
+
+        if (typeof p_nItemIndex == "number") {
+
+            bAppend = (p_nItemIndex >= aGroup.length);            
+
+
+            if (aGroup[p_nItemIndex]) {
+    
+                aGroup.splice(p_nItemIndex, 0, oItem);
+    
+            }
+            else {
+    
+                aGroup[p_nItemIndex] = oItem;
+    
+            }
+
+
+            oGroupItem = aGroup[p_nItemIndex];
+
+            if (oGroupItem) {
+
+                if (bAppend && (!oGroupItem.element.parentNode || 
+                        oGroupItem.element.parentNode.nodeType == 11)) {
+        
+                    this._aListElements[nGroupIndex].appendChild(
+                        oGroupItem.element);
+    
+                }
+                else {
+    
+                    oNextItemSibling = getNextItemSibling(aGroup, 
+                        (p_nItemIndex+1));
+    
+                    if (oNextItemSibling && (!oGroupItem.element.parentNode || 
+                            oGroupItem.element.parentNode.nodeType == 11)) {
+            
+                        this._aListElements[nGroupIndex].insertBefore(
+                                oGroupItem.element, 
+                                oNextItemSibling.element);
+        
+                    }
+    
+                }
+    
+
+                oGroupItem.parent = this;
+        
+                this._subscribeToItemEvents(oGroupItem);
+    
+                this._configureSubmenu(oGroupItem);
+                
+                this._updateItemProperties(nGroupIndex);
+        
+                this.logger.log("Item inserted." + 
+                    " Text: " + oGroupItem.cfg.getProperty("text") + ", " + 
+                    " Index: " + oGroupItem.index + ", " + 
+                    " Group Index: " + oGroupItem.groupIndex);
+
+                this.itemAddedEvent.fire(oGroupItem);
+                this.changeContentEvent.fire();
+
+                return oGroupItem;
+    
+            }
+
+        }
+        else {
+    
+            nItemIndex = aGroup.length;
+    
+            aGroup[nItemIndex] = oItem;
+
+            oGroupItem = aGroup[nItemIndex];
+    
+
+            if (oGroupItem) {
+    
+                if (!Dom.isAncestor(this._aListElements[nGroupIndex], 
+                        oGroupItem.element)) {
+    
+                    this._aListElements[nGroupIndex].appendChild(
+                        oGroupItem.element);
+    
+                }
+    
+                oGroupItem.element.setAttribute("groupindex", nGroupIndex);
+                oGroupItem.element.setAttribute("index", nItemIndex);
+        
+                oGroupItem.parent = this;
+    
+                oGroupItem.index = nItemIndex;
+                oGroupItem.groupIndex = nGroupIndex;
+        
+                this._subscribeToItemEvents(oGroupItem);
+    
+                this._configureSubmenu(oGroupItem);
+    
+                if (nItemIndex === 0) {
+        
+                    Dom.addClass(oGroupItem.element, "first-of-type");
+        
+                }
+
+                this.logger.log("Item added." + 
+                    " Text: " + oGroupItem.cfg.getProperty("text") + ", " + 
+                    " Index: " + oGroupItem.index + ", " + 
+                    " Group Index: " + oGroupItem.groupIndex);
+        
+
+                this.itemAddedEvent.fire(oGroupItem);
+                this.changeContentEvent.fire();
+
+                return oGroupItem;
+    
+            }
+    
+        }
+
+    }
+    
+},
+
+
+/**
+* @method _removeItemFromGroupByIndex
+* @description Removes a menu item from a group by index.  Returns the menu 
+* item that was removed.
+* @private
+* @param {Number} p_nGroupIndex Number indicating the group to which the menu 
+* item belongs.
+* @param {Number} p_nItemIndex Number indicating the index of the menu item 
+* to be removed.
+* @return {YAHOO.widget.MenuItem}
+*/
+_removeItemFromGroupByIndex: function (p_nGroupIndex, p_nItemIndex) {
+
+    var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,
+        aGroup = this._getItemGroup(nGroupIndex),
+        aArray,
+        oItem,
+        oUL;
+
+    if (aGroup) {
+
+        aArray = aGroup.splice(p_nItemIndex, 1);
+        oItem = aArray[0];
+    
+        if (oItem) {
+    
+            // Update the index and className properties of each member        
+            
+            this._updateItemProperties(nGroupIndex);
+    
+            if (aGroup.length === 0) {
+    
+                // Remove the UL
+    
+                oUL = this._aListElements[nGroupIndex];
+    
+                if (this.body && oUL) {
+    
+                    this.body.removeChild(oUL);
+    
+                }
+    
+                // Remove the group from the array of items
+    
+                this._aItemGroups.splice(nGroupIndex, 1);
+    
+    
+                // Remove the UL from the array of ULs
+    
+                this._aListElements.splice(nGroupIndex, 1);
+    
+    
+                /*
+                     Assign the "first-of-type" class to the new first UL 
+                     in the collection
+                */
+    
+                oUL = this._aListElements[0];
+    
+                if (oUL) {
+    
+                    Dom.addClass(oUL, "first-of-type");
+    
+                }            
+    
+            }
+    
+
+            this.itemRemovedEvent.fire(oItem);
+            this.changeContentEvent.fire();
+
+
+            // Return a reference to the item that was removed
+        
+            return oItem;
+    
+        }
+
+    }
+    
+},
+
+
+/**
+* @method _removeItemFromGroupByValue
+* @description Removes a menu item from a group by reference.  Returns the 
+* menu item that was removed.
+* @private
+* @param {Number} p_nGroupIndex Number indicating the group to which the
+* menu item belongs.
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance to be removed.
+* @return {YAHOO.widget.MenuItem}
+*/    
+_removeItemFromGroupByValue: function (p_nGroupIndex, p_oItem) {
+
+    var aGroup = this._getItemGroup(p_nGroupIndex),
+        nItems,
+        nItemIndex,
+        i;
+
+    if (aGroup) {
+
+        nItems = aGroup.length;
+        nItemIndex = -1;
+    
+        if (nItems > 0) {
+    
+            i = nItems-1;
+        
+            do {
+        
+                if (aGroup[i] == p_oItem) {
+        
+                    nItemIndex = i;
+                    break;    
+        
+                }
+        
+            }
+            while(i--);
+        
+            if (nItemIndex > -1) {
+        
+                return (this._removeItemFromGroupByIndex(p_nGroupIndex, 
+                            nItemIndex));
+        
+            }
+    
+        }
+    
+    }
+
+},
+
+
+/**
+* @method _updateItemProperties
+* @description Updates the "index," "groupindex," and "className" properties 
+* of the menu items in the specified group. 
+* @private
+* @param {Number} p_nGroupIndex Number indicating the group of items to update.
+*/
+_updateItemProperties: function (p_nGroupIndex) {
+
+    var aGroup = this._getItemGroup(p_nGroupIndex),
+        nItems = aGroup.length,
+        oItem,
+        oLI,
+        i;
+
+
+    if (nItems > 0) {
+
+        i = nItems - 1;
+
+        // Update the index and className properties of each member
+    
+        do {
+
+            oItem = aGroup[i];
+
+            if (oItem) {
+    
+                oLI = oItem.element;
+
+                oItem.index = i;
+                oItem.groupIndex = p_nGroupIndex;
+
+                oLI.setAttribute("groupindex", p_nGroupIndex);
+                oLI.setAttribute("index", i);
+
+                Dom.removeClass(oLI, "first-of-type");
+
+            }
+    
+        }
+        while(i--);
+
+
+        if (oLI) {
+
+            Dom.addClass(oLI, "first-of-type");
+
+        }
+
+    }
+
+},
+
+
+/**
+* @method _createItemGroup
+* @description Creates a new menu item group (array) and its associated 
+* <code>&#60;ul&#62;</code> element. Returns an aray of menu item groups.
+* @private
+* @param {Number} p_nIndex Number indicating the group to create.
+* @return {Array}
+*/
+_createItemGroup: function (p_nIndex) {
+
+    var oUL;
+
+    if (!this._aItemGroups[p_nIndex]) {
+
+        this._aItemGroups[p_nIndex] = [];
+
+        oUL = document.createElement("ul");
+
+        this._aListElements[p_nIndex] = oUL;
+
+        return this._aItemGroups[p_nIndex];
+
+    }
+
+},
+
+
+/**
+* @method _getItemGroup
+* @description Returns the menu item group at the specified index.
+* @private
+* @param {Number} p_nIndex Number indicating the index of the menu item group 
+* to be retrieved.
+* @return {Array}
+*/
+_getItemGroup: function (p_nIndex) {
+
+    var nIndex = ((typeof p_nIndex == "number") ? p_nIndex : 0);
+
+    return this._aItemGroups[nIndex];
+
+},
+
+
+/**
+* @method _configureSubmenu
+* @description Subscribes the menu item's submenu to its parent menu's events.
+* @private
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance with the submenu to be configured.
+*/
+_configureSubmenu: function (p_oItem) {
+
+    var oSubmenu = p_oItem.cfg.getProperty("submenu");
+
+    if (oSubmenu) {
+            
+        /*
+            Listen for configuration changes to the parent menu 
+            so they they can be applied to the submenu.
+        */
+
+        this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange, 
+                oSubmenu, true);
+
+        this.renderEvent.subscribe(this._onParentMenuRender, oSubmenu, true);
+
+        oSubmenu.beforeShowEvent.subscribe(this._onSubmenuBeforeShow, null, 
+            oSubmenu);
+
+        oSubmenu.showEvent.subscribe(this._onSubmenuShow, null, p_oItem);
+        oSubmenu.hideEvent.subscribe(this._onSubmenuHide, null, p_oItem);
+
+    }
+
+},
+
+
+/**
+* @method _subscribeToItemEvents
+* @description Subscribes a menu to a menu item's event.
+* @private
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance whose events should be subscribed to.
+*/
+_subscribeToItemEvents: function (p_oItem) {
+
+    p_oItem.focusEvent.subscribe(this._onMenuItemFocus);
+
+    p_oItem.blurEvent.subscribe(this._onMenuItemBlur);
+
+    p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,
+        p_oItem, this);
+
+},
+
+
+/**
+* @method _getOffsetWidth
+* @description Returns the offset width of the menu's 
+* <code>&#60;div&#62;</code> element.
+* @private
+*/
+_getOffsetWidth: function () {
+
+    var oClone = this.element.cloneNode(true);
+
+    Dom.removeClass(oClone, "visible");
+
+    Dom.setStyle(oClone, "width", "");
+
+    document.body.appendChild(oClone);
+
+    var sWidth = oClone.offsetWidth;
+
+    document.body.removeChild(oClone);
+
+    return sWidth;
+
+},
+
+
+/**
+* @method _setWidth
+* @description Sets the width of the menu's root <code>&#60;div&#62;</code> 
+* element to its offsetWidth.
+* @private
+*/
+_setWidth: function () {
+
+    var oElement = this.element,
+        bVisible = false,
+        sWidth;
+
+    if (oElement.parentNode.tagName.toUpperCase() == "BODY") {
+
+        if (YAHOO.env.ua.opera) {
+
+            sWidth = this._getOffsetWidth();
+        
+        }
+        else {
+
+            if (Dom.hasClass(oElement, "visible")) {
+
+                bVisible = true;
+                
+                Dom.removeClass(oElement, "visible");
+
+            }
+
+            Dom.setStyle(oElement, "width", "auto");
+            
+            sWidth = oElement.offsetWidth;
+        
+        }
+
+    }
+    else {
+    
+        sWidth = this._getOffsetWidth();
+    
+    }
+
+    this.cfg.setProperty("width", (sWidth + "px"));
+    
+
+    if (bVisible) {
+    
+        Dom.addClass(oElement, "visible");
+    
+    }
+
+},
+
+
+/**
+* @method _onWidthChange
+* @description Change event handler for the the menu's "width" configuration
+* property.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onWidthChange: function (p_sType, p_aArgs) {
+
+    var sWidth = p_aArgs[0];
+    
+    if (sWidth && !this._hasSetWidthHandlers) {
+
+        this.itemAddedEvent.subscribe(this._setWidth);
+        this.itemRemovedEvent.subscribe(this._setWidth);
+
+        this._hasSetWidthHandlers = true;
+
+    }
+    else if (this._hasSetWidthHandlers) {
+
+        this.itemAddedEvent.unsubscribe(this._setWidth);
+        this.itemRemovedEvent.unsubscribe(this._setWidth);
+
+        this._hasSetWidthHandlers = false;
+
+    }
+
+},
+
+
+/**
+* @method _onVisibleChange
+* @description Change event handler for the the menu's "visible" configuration
+* property.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onVisibleChange: function (p_sType, p_aArgs) {
+
+    var bVisible = p_aArgs[0];
+    
+    if (bVisible) {
+
+        Dom.addClass(this.element, "visible");
+
+    }
+    else {
+
+        Dom.removeClass(this.element, "visible");
+
+    }
+
+},
+
+
+/**
+* @method _cancelHideDelay
+* @description Cancels the call to "hideMenu."
+* @private
+*/
+_cancelHideDelay: function () {
+
+    var oRoot = this.getRoot();
+
+    if (oRoot._nHideDelayId) {
+
+        window.clearTimeout(oRoot._nHideDelayId);
+
+    }
+
+},
+
+
+/**
+* @method _execHideDelay
+* @description Hides the menu after the number of milliseconds specified by 
+* the "hidedelay" configuration property.
+* @private
+*/
+_execHideDelay: function () {
+
+    this._cancelHideDelay();
+
+    var oRoot = this.getRoot(),
+        me = this;
+
+    function hideMenu() {
+    
+        if (oRoot.activeItem) {
+
+            oRoot.clearActiveItem();
+
+        }
+
+        if (oRoot == me && !(me instanceof YAHOO.widget.MenuBar) && 
+            me.cfg.getProperty("position") == "dynamic") {
+
+            me.hide();
+        
+        }
+    
+    }
+
+
+    oRoot._nHideDelayId = 
+        window.setTimeout(hideMenu, oRoot.cfg.getProperty("hidedelay"));
+
+},
+
+
+/**
+* @method _cancelShowDelay
+* @description Cancels the call to the "showMenu."
+* @private
+*/
+_cancelShowDelay: function () {
+
+    var oRoot = this.getRoot();
+
+    if (oRoot._nShowDelayId) {
+
+        window.clearTimeout(oRoot._nShowDelayId);
+
+    }
+
+},
+
+
+/**
+* @method _execShowDelay
+* @description Shows the menu after the number of milliseconds specified by 
+* the "showdelay" configuration property have ellapsed.
+* @private
+* @param {YAHOO.widget.Menu} p_oMenu Object specifying the menu that should 
+* be made visible.
+*/
+_execShowDelay: function (p_oMenu) {
+
+    var oRoot = this.getRoot();
+
+    function showMenu() {
+
+        if (p_oMenu.parent.cfg.getProperty("selected")) {
+
+            p_oMenu.show();
+
+        }
+
+    }
+
+
+    oRoot._nShowDelayId = 
+        window.setTimeout(showMenu, oRoot.cfg.getProperty("showdelay"));
+
+},
+
+
+/**
+* @method _execSubmenuHideDelay
+* @description Hides a submenu after the number of milliseconds specified by 
+* the "submenuhidedelay" configuration property have ellapsed.
+* @private
+* @param {YAHOO.widget.Menu} p_oSubmenu Object specifying the submenu that  
+* should be hidden.
+* @param {Number} p_nMouseX The x coordinate of the mouse when it left 
+* the specified submenu's parent menu item.
+* @param {Number} p_nHideDelay The number of milliseconds that should ellapse
+* before the submenu is hidden.
+*/
+_execSubmenuHideDelay: function (p_oSubmenu, p_nMouseX, p_nHideDelay) {
+
+    var me = this;
+
+    p_oSubmenu._nSubmenuHideDelayId = window.setTimeout(function () {
+
+        if (me._nCurrentMouseX > (p_nMouseX + 10)) {
+
+            p_oSubmenu._nSubmenuHideDelayId = window.setTimeout(function () {
+        
+                p_oSubmenu.hide();
+
+            }, p_nHideDelay);
+
+        }
+        else {
+
+            p_oSubmenu.hide();
+        
+        }
+
+    }, 50);
+
+},
+
+
+
+// Protected methods
+
+
+/**
+* @method _disableScrollHeader
+* @description Disables the header used for scrolling the body of the menu.
+* @protected
+*/
+_disableScrollHeader: function () {
+
+    if (!this._bHeaderDisabled) {
+
+        Dom.addClass(this.header, "topscrollbar_disabled");
+        this._bHeaderDisabled = true;
+
+    }
+
+},
+
+
+/**
+* @method _disableScrollFooter
+* @description Disables the footer used for scrolling the body of the menu.
+* @protected
+*/
+_disableScrollFooter: function () {
+
+    if (!this._bFooterDisabled) {
+
+        Dom.addClass(this.footer, "bottomscrollbar_disabled");
+        this._bFooterDisabled = true;
+
+    }
+
+},
+
+
+/**
+* @method _enableScrollHeader
+* @description Enables the header used for scrolling the body of the menu.
+* @protected
+*/
+_enableScrollHeader: function () {
+
+    if (this._bHeaderDisabled) {
+
+        Dom.removeClass(this.header, "topscrollbar_disabled");
+        this._bHeaderDisabled = false;
+
+    }
+
+},
+
+
+/**
+* @method _enableScrollFooter
+* @description Enables the footer used for scrolling the body of the menu.
+* @protected
+*/
+_enableScrollFooter: function () {
+
+    if (this._bFooterDisabled) {
+
+        Dom.removeClass(this.footer, "bottomscrollbar_disabled");
+        this._bFooterDisabled = false;
+
+    }
+
+},
+
+
+/**
+* @method _onMouseOver
+* @description "mouseover" event handler for the menu.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onMouseOver: function (p_sType, p_aArgs) {
+
+    if (this._bStopMouseEventHandlers) {
+    
+        return false;
+    
+    }
+
+
+    var oEvent = p_aArgs[0],
+        oItem = p_aArgs[1],
+        oTarget = Event.getTarget(oEvent),
+        oParentMenu,
+        nShowDelay,
+        bShowDelay,
+        oActiveItem,
+        oItemCfg,
+        oSubmenu;
+
+
+    if (!this._bHandledMouseOverEvent && (oTarget == this.element || 
+        Dom.isAncestor(this.element, oTarget))) {
+
+        // Menu mouseover logic
+
+        this._nCurrentMouseX = 0;
+
+        Event.on(this.element, "mousemove", this._onMouseMove, this, true);
+
+
+        this.clearActiveItem();
+
+
+        if (this.parent && this._nSubmenuHideDelayId) {
+
+            window.clearTimeout(this._nSubmenuHideDelayId);
+
+            this.parent.cfg.setProperty("selected", true);
+
+            oParentMenu = this.parent.parent;
+
+            oParentMenu._bHandledMouseOutEvent = true;
+            oParentMenu._bHandledMouseOverEvent = false;
+
+        }
+
+
+        this._bHandledMouseOverEvent = true;
+        this._bHandledMouseOutEvent = false;
+    
+    }
+
+
+    if (oItem && !oItem.handledMouseOverEvent && 
+        !oItem.cfg.getProperty("disabled") && 
+        (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))) {
+
+        // Menu Item mouseover logic
+
+        nShowDelay = this.cfg.getProperty("showdelay");
+        bShowDelay = (nShowDelay > 0);
+
+
+        if (bShowDelay) {
+        
+            this._cancelShowDelay();
+        
+        }
+
+
+        oActiveItem = this.activeItem;
+    
+        if (oActiveItem) {
+    
+            oActiveItem.cfg.setProperty("selected", false);
+    
+        }
+
+
+        oItemCfg = oItem.cfg;
+    
+        // Select and focus the current menu item
+    
+        oItemCfg.setProperty("selected", true);
+
+
+        if (this.hasFocus()) {
+        
+            oItem.focus();
+        
+        }
+
+
+        if (this.cfg.getProperty("autosubmenudisplay")) {
+
+            // Show the submenu this menu item
+
+            oSubmenu = oItemCfg.getProperty("submenu");
+        
+            if (oSubmenu) {
+        
+                if (bShowDelay) {
+
+                    this._execShowDelay(oSubmenu);
+        
+                }
+                else {
+
+                    oSubmenu.show();
+
+                }
+
+            }
+
+        }                        
+
+        oItem.handledMouseOverEvent = true;
+        oItem.handledMouseOutEvent = false;
+
+    }
+
+},
+
+
+/**
+* @method _onMouseOut
+* @description "mouseout" event handler for the menu.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onMouseOut: function (p_sType, p_aArgs) {
+
+    if (this._bStopMouseEventHandlers) {
+    
+        return false;
+    
+    }
+
+
+    var oEvent = p_aArgs[0],
+        oItem = p_aArgs[1],
+        oRelatedTarget = Event.getRelatedTarget(oEvent),
+        bMovingToSubmenu = false,
+        oItemCfg,
+        oSubmenu,
+        nSubmenuHideDelay,
+        nShowDelay;
+
+
+    if (oItem && !oItem.cfg.getProperty("disabled")) {
+
+        oItemCfg = oItem.cfg;
+        oSubmenu = oItemCfg.getProperty("submenu");
+
+
+        if (oSubmenu && (oRelatedTarget == oSubmenu.element ||
+                Dom.isAncestor(oSubmenu.element, oRelatedTarget))) {
+
+            bMovingToSubmenu = true;
+
+        }
+
+
+        if (!oItem.handledMouseOutEvent && ((oRelatedTarget != oItem.element &&  
+            !Dom.isAncestor(oItem.element, oRelatedTarget)) || 
+            bMovingToSubmenu)) {
+
+            // Menu Item mouseout logic
+
+            if (!bMovingToSubmenu) {
+
+                oItem.cfg.setProperty("selected", false);
+
+
+                if (oSubmenu) {
+
+                    nSubmenuHideDelay = 
+                        this.cfg.getProperty("submenuhidedelay");
+
+                    nShowDelay = this.cfg.getProperty("showdelay");
+
+                    if (!(this instanceof YAHOO.widget.MenuBar) && 
+                        nSubmenuHideDelay > 0 && 
+                        nShowDelay >= nSubmenuHideDelay) {
+
+                        this._execSubmenuHideDelay(oSubmenu, 
+                                Event.getPageX(oEvent),
+                                nSubmenuHideDelay);
+
+                    }
+                    else {
+
+                        oSubmenu.hide();
+
+                    }
+
+                }
+
+            }
+
+
+            oItem.handledMouseOutEvent = true;
+            oItem.handledMouseOverEvent = false;
+    
+        }
+
+    }
+
+
+    if (!this._bHandledMouseOutEvent && ((oRelatedTarget != this.element &&  
+        !Dom.isAncestor(this.element, oRelatedTarget)) || bMovingToSubmenu)) {
+
+        // Menu mouseout logic
+
+        Event.removeListener(this.element, "mousemove", this._onMouseMove);
+
+        this._nCurrentMouseX = Event.getPageX(oEvent);
+
+        this._bHandledMouseOutEvent = true;
+        this._bHandledMouseOverEvent = false;
+
+    }
+
+},
+
+
+/**
+* @method _onMouseMove
+* @description "click" event handler for the menu.
+* @protected
+* @param {Event} p_oEvent Object representing the DOM event object passed 
+* back by the event utility (YAHOO.util.Event).
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+_onMouseMove: function (p_oEvent, p_oMenu) {
+
+    if (this._bStopMouseEventHandlers) {
+    
+        return false;
+    
+    }
+
+    this._nCurrentMouseX = Event.getPageX(p_oEvent);
+
+},
+
+
+/**
+* @method _onClick
+* @description "click" event handler for the menu.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onClick: function (p_sType, p_aArgs) {
+
+    var oEvent = p_aArgs[0],
+        oItem = p_aArgs[1],
+        oTarget,
+        oItemCfg,
+        oSubmenu,
+        sURL,
+        oRoot;
+
+
+    if (oItem && !oItem.cfg.getProperty("disabled")) {
+
+        oTarget = Event.getTarget(oEvent);
+        oItemCfg = oItem.cfg;
+        oSubmenu = oItemCfg.getProperty("submenu");
+
+
+        /*
+            ACCESSIBILITY FEATURE FOR SCREEN READERS: 
+            Expand/collapse the submenu when the user clicks 
+            on the submenu indicator image.
+        */        
+
+        if (oTarget == oItem.submenuIndicator && oSubmenu) {
+
+            if (oSubmenu.cfg.getProperty("visible")) {
+
+                oSubmenu.hide();
+                
+                oSubmenu.parent.focus();
+    
+            }
+            else {
+
+                this.clearActiveItem();
+
+                oItemCfg.setProperty("selected", true);
+
+                oSubmenu.show();
+                
+                oSubmenu.setInitialFocus();
+    
+            }
+
+            Event.preventDefault(oEvent);
+    
+        }
+        else {
+
+            sURL = oItemCfg.getProperty("url");
+
+            //  Prevent the browser from following links equal to "#"
+            
+            if ((sURL.substr((sURL.length-1),1) == "#")) {
+
+                Event.preventDefault(oEvent);
+
+                oItem.focus();
+            
+            }
+
+
+            if (!oSubmenu) {
+    
+                oRoot = this.getRoot();
+                
+                if (oRoot instanceof YAHOO.widget.MenuBar || 
+                    oRoot.cfg.getProperty("position") == "static") {
+    
+                    oRoot.clearActiveItem();
+    
+                }
+                else if (oRoot.cfg.getProperty("clicktohide")) {
+
+                    oRoot.hide();
+                
+                }
+    
+            }
+
+        }                    
+    
+    }
+
+},
+
+
+/**
+* @method _onKeyDown
+* @description "keydown" event handler for the menu.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onKeyDown: function (p_sType, p_aArgs) {
+
+    var oEvent = p_aArgs[0],
+        oItem = p_aArgs[1],
+        me = this,
+        oSubmenu,
+        oItemCfg,
+        oParentItem,
+        oRoot,
+        oNextItem,
+        oBody,
+        nBodyScrollTop,
+        nBodyOffsetHeight,
+        aItems,
+        nItems,
+        nNextItemOffsetTop,
+        nScrollTarget,
+        oParentMenu;
+
+
+    /*
+        This function is called to prevent a bug in Firefox.  In Firefox,
+        moving a DOM element into a stationary mouse pointer will cause the 
+        browser to fire mouse events.  This can result in the menu mouse
+        event handlers being called uncessarily, especially when menus are 
+        moved into a stationary mouse pointer as a result of a 
+        key event handler.
+    */
+    function stopMouseEventHandlers() {
+
+        me._bStopMouseEventHandlers = true;
+        
+        window.setTimeout(function () {
+        
+            me._bStopMouseEventHandlers = false;
+        
+        }, 10);
+
+    }
+
+
+    if (oItem && !oItem.cfg.getProperty("disabled")) {
+
+        oItemCfg = oItem.cfg;
+        oParentItem = this.parent;
+
+        switch(oEvent.keyCode) {
+    
+            case 38:    // Up arrow
+            case 40:    // Down arrow
+    
+                oNextItem = (oEvent.keyCode == 38) ? 
+                    oItem.getPreviousEnabledSibling() : 
+                    oItem.getNextEnabledSibling();
+        
+                if (oNextItem) {
+
+                    this.clearActiveItem();
+
+                    oNextItem.cfg.setProperty("selected", true);
+                    oNextItem.focus();
+
+
+                    if (this.cfg.getProperty("maxheight") > 0) {
+
+                        oBody = this.body;
+                        nBodyScrollTop = oBody.scrollTop;
+                        nBodyOffsetHeight = oBody.offsetHeight;
+                        aItems = this.getItems();
+                        nItems = aItems.length - 1;
+                        nNextItemOffsetTop = oNextItem.element.offsetTop;
+
+
+                        if (oEvent.keyCode == 40 ) {    // Down
+                       
+                            if (nNextItemOffsetTop >= (nBodyOffsetHeight + nBodyScrollTop)) {
+
+                                oBody.scrollTop = nNextItemOffsetTop - nBodyOffsetHeight;
+
+                            }
+                            else if (nNextItemOffsetTop <= nBodyScrollTop) {
+                            
+                                oBody.scrollTop = 0;
+                            
+                            }
+
+
+                            if (oNextItem == aItems[nItems]) {
+
+                                oBody.scrollTop = oNextItem.element.offsetTop;
+
+                            }
+
+                        }
+                        else {  // Up
+
+                            if (nNextItemOffsetTop <= nBodyScrollTop) {
+
+                                oBody.scrollTop = nNextItemOffsetTop - oNextItem.element.offsetHeight;
+                            
+                            }
+                            else if (nNextItemOffsetTop >= (nBodyScrollTop + nBodyOffsetHeight)) {
+                            
+                                oBody.scrollTop = nNextItemOffsetTop;
+                            
+                            }
+
+
+                            if (oNextItem == aItems[0]) {
+                            
+                                oBody.scrollTop = 0;
+                            
+                            }
+
+                        }
+
+
+                        nBodyScrollTop = oBody.scrollTop;
+                        nScrollTarget = oBody.scrollHeight - oBody.offsetHeight;
+
+                        if (nBodyScrollTop === 0) {
+
+                            this._disableScrollHeader();
+                            this._enableScrollFooter();
+
+                        }
+                        else if (nBodyScrollTop == nScrollTarget) {
+
+                             this._enableScrollHeader();
+                             this._disableScrollFooter();
+
+                        }
+                        else {
+
+                            this._enableScrollHeader();
+                            this._enableScrollFooter();
+
+                        }
+
+                    }
+
+                }
+
+    
+                Event.preventDefault(oEvent);
+
+                stopMouseEventHandlers();
+    
+            break;
+            
+    
+            case 39:    // Right arrow
+    
+                oSubmenu = oItemCfg.getProperty("submenu");
+    
+                if (oSubmenu) {
+    
+                    if (!oItemCfg.getProperty("selected")) {
+        
+                        oItemCfg.setProperty("selected", true);
+        
+                    }
+    
+                    oSubmenu.show();
+                    oSubmenu.setInitialFocus();
+                    oSubmenu.setInitialSelection();
+    
+                }
+                else {
+    
+                    oRoot = this.getRoot();
+                    
+                    if (oRoot instanceof YAHOO.widget.MenuBar) {
+    
+                        oNextItem = oRoot.activeItem.getNextEnabledSibling();
+    
+                        if (oNextItem) {
+                        
+                            oRoot.clearActiveItem();
+    
+                            oNextItem.cfg.setProperty("selected", true);
+    
+                            oSubmenu = oNextItem.cfg.getProperty("submenu");
+    
+                            if (oSubmenu) {
+    
+                                oSubmenu.show();
+                            
+                            }
+    
+                            oNextItem.focus();
+                        
+                        }
+                    
+                    }
+                
+                }
+    
+    
+                Event.preventDefault(oEvent);
+
+                stopMouseEventHandlers();
+
+            break;
+    
+    
+            case 37:    // Left arrow
+    
+                if (oParentItem) {
+    
+                    oParentMenu = oParentItem.parent;
+    
+                    if (oParentMenu instanceof YAHOO.widget.MenuBar) {
+    
+                        oNextItem = 
+                            oParentMenu.activeItem.getPreviousEnabledSibling();
+    
+                        if (oNextItem) {
+                        
+                            oParentMenu.clearActiveItem();
+    
+                            oNextItem.cfg.setProperty("selected", true);
+    
+                            oSubmenu = oNextItem.cfg.getProperty("submenu");
+    
+                            if (oSubmenu) {
+                            
+                                oSubmenu.show();
+                            
+                            }
+    
+                            oNextItem.focus();
+                        
+                        } 
+                    
+                    }
+                    else {
+    
+                        this.hide();
+    
+                        oParentItem.focus();
+                    
+                    }
+    
+                }
+    
+                Event.preventDefault(oEvent);
+
+                stopMouseEventHandlers();
+
+            break;        
+    
+        }
+
+
+    }
+
+
+    if (oEvent.keyCode == 27) { // Esc key
+
+        if (this.cfg.getProperty("position") == "dynamic") {
+        
+            this.hide();
+
+            if (this.parent) {
+
+                this.parent.focus();
+            
+            }
+
+        }
+        else if (this.activeItem) {
+
+            oSubmenu = this.activeItem.cfg.getProperty("submenu");
+
+            if (oSubmenu && oSubmenu.cfg.getProperty("visible")) {
+            
+                oSubmenu.hide();
+                this.activeItem.focus();
+            
+            }
+            else {
+
+                this.activeItem.blur();
+                this.activeItem.cfg.setProperty("selected", false);
+        
+            }
+        
+        }
+
+
+        Event.preventDefault(oEvent);
+    
+    }
+    
+},
+
+
+/**
+* @method _onKeyPress
+* @description "keypress" event handler for a Menu instance.
+* @protected
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
+* was fired.
+*/
+_onKeyPress: function (p_sType, p_aArgs) {
+    
+    var oEvent = p_aArgs[0];
+
+
+    if (oEvent.keyCode == 40 || oEvent.keyCode == 38) {
+
+        Event.preventDefault(oEvent);
+
+    }
+
+},
+
+
+/**
+* @method _onTextResize
+* @description "textresize" event handler for the menu.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+_onTextResize: function (p_sType, p_aArgs, p_oMenu) {
+
+    if (YAHOO.env.ua.gecko && !this._handleResize) {
+
+        this._handleResize = true;
+        return;
+    
+    }
+
+
+    var oConfig = this.cfg;
+
+    if (oConfig.getProperty("position") == "dynamic") {
+
+        oConfig.setProperty("width", (this._getOffsetWidth() + "px"));
+
+    }
+
+},
+
+
+/**
+* @method _onScrollTargetMouseOver
+* @description "mouseover" event handler for the menu's "header" and "footer" 
+* elements.  Used to scroll the body of the menu up and down when the 
+* menu's "maxheight" configuration property is set to a value greater than 0.
+* @protected
+* @param {Event} p_oEvent Object representing the DOM event object passed 
+* back by the event utility (YAHOO.util.Event).
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+_onScrollTargetMouseOver: function (p_oEvent, p_oMenu) {
+
+    this._cancelHideDelay();
+
+    var oTarget = Event.getTarget(p_oEvent),
+        oBody = this.body,
+        me = this,
+        nScrollTarget,
+        fnScrollFunction;
+
+
+    function scrollBodyDown() {
+
+        var nScrollTop = oBody.scrollTop;
+
+
+        if (nScrollTop < nScrollTarget) {
+
+            oBody.scrollTop = (nScrollTop + 1);
+
+            me._enableScrollHeader();
+
+        }
+        else {
+
+            oBody.scrollTop = nScrollTarget;
+            
+            window.clearInterval(me._nBodyScrollId);
+
+            me._disableScrollFooter();
+
+        }
+
+    }
+
+
+    function scrollBodyUp() {
+
+        var nScrollTop = oBody.scrollTop;
+
+
+        if (nScrollTop > 0) {
+
+            oBody.scrollTop = (nScrollTop - 1);
+
+            me._enableScrollFooter();
+
+        }
+        else {
+
+            oBody.scrollTop = 0;
+            
+            window.clearInterval(me._nBodyScrollId);
+
+            me._disableScrollHeader();
+
+        }
+
+    }
+
+    
+    if (Dom.hasClass(oTarget, "hd")) {
+
+        fnScrollFunction = scrollBodyUp;
+    
+    }
+    else {
+
+        nScrollTarget = oBody.scrollHeight - oBody.offsetHeight;
+
+        fnScrollFunction = scrollBodyDown;
+    
+    }
+
+
+    this._nBodyScrollId = window.setInterval(fnScrollFunction, 10);
+
+},
+
+
+/**
+* @method _onScrollTargetMouseOut
+* @description "mouseout" event handler for the menu's "header" and "footer" 
+* elements.  Used to stop scrolling the body of the menu up and down when the 
+* menu's "maxheight" configuration property is set to a value greater than 0.
+* @protected
+* @param {Event} p_oEvent Object representing the DOM event object passed 
+* back by the event utility (YAHOO.util.Event).
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+_onScrollTargetMouseOut: function (p_oEvent, p_oMenu) {
+
+    window.clearInterval(this._nBodyScrollId);
+
+    this._cancelHideDelay();
+
+},
+
+
+
+// Private methods
+
+
+/**
+* @method _onInit
+* @description "init" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onInit: function (p_sType, p_aArgs) {
+
+    this.cfg.subscribeToConfigEvent("width", this._onWidthChange);
+    this.cfg.subscribeToConfigEvent("visible", this._onVisibleChange);
+
+    var bRootMenu = !this.parent,
+        bLazyLoad = this.lazyLoad;
+
+
+    /*
+        Automatically initialize a menu's subtree if:
+
+        1) This is the root menu and lazyload is off
+        
+        2) This is the root menu, lazyload is on, but the menu is 
+           already visible
+
+        3) This menu is a submenu and lazyload is off
+    */
+
+
+
+    if (((bRootMenu && !bLazyLoad) || 
+        (bRootMenu && (this.cfg.getProperty("visible") || 
+        this.cfg.getProperty("position") == "static")) || 
+        (!bRootMenu && !bLazyLoad)) && this.getItemGroups().length === 0) {
+
+        if (this.srcElement) {
+
+            this._initSubTree();
+        
+        }
+
+
+        if (this.itemData) {
+
+            this.addItems(this.itemData);
+
+        }
+    
+    }
+    else if (bLazyLoad) {
+
+        this.cfg.fireQueue();
+    
+    }
+
+},
+
+
+/**
+* @method _onBeforeRender
+* @description "beforerender" event handler for the menu.  Appends all of the 
+* <code>&#60;ul&#62;</code>, <code>&#60;li&#62;</code> and their accompanying 
+* title elements to the body element of the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onBeforeRender: function (p_sType, p_aArgs) {
+
+    var oConfig = this.cfg,
+        oEl = this.element,
+        nListElements = this._aListElements.length,
+        bFirstList = true,
+        i = 0,
+        oUL,
+        oGroupTitle;
+
+    if (nListElements > 0) {
+
+        do {
+
+            oUL = this._aListElements[i];
+
+            if (oUL) {
+
+                if (bFirstList) {
+        
+                    Dom.addClass(oUL, "first-of-type");
+                    bFirstList = false;
+        
+                }
+
+
+                if (!Dom.isAncestor(oEl, oUL)) {
+
+                    this.appendToBody(oUL);
+
+                }
+
+
+                oGroupTitle = this._aGroupTitleElements[i];
+
+                if (oGroupTitle) {
+
+                    if (!Dom.isAncestor(oEl, oGroupTitle)) {
+
+                        oUL.parentNode.insertBefore(oGroupTitle, oUL);
+
+                    }
+
+
+                    Dom.addClass(oUL, "hastitle");
+
+                }
+
+            }
+
+            i++;
+
+        }
+        while(i < nListElements);
+
+    }
+
+},
+
+
+/**
+* @method _onRender
+* @description "render" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onRender: function (p_sType, p_aArgs) {
+
+    if (this.cfg.getProperty("position") == "dynamic" && 
+        !this.cfg.getProperty("width")) {
+
+        this._setWidth();
+    
+    }
+
+},
+
+
+/**
+* @method _onBeforeShow
+* @description "beforeshow" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onBeforeShow: function (p_sType, p_aArgs) {
+
+    var nOptions,
+        n,
+        nViewportHeight,
+        oRegion,
+        nMaxHeight,
+        oBody,
+        oSrcElement;
+
+
+    if (this.lazyLoad && this.getItemGroups().length === 0) {
+
+        if (this.srcElement) {
+        
+            this._initSubTree();
+
+        }
+
+
+        if (this.itemData) {
+
+            if (this.parent && this.parent.parent && 
+                this.parent.parent.srcElement && 
+                this.parent.parent.srcElement.tagName.toUpperCase() == 
+                "SELECT") {
+
+                nOptions = this.itemData.length;
+    
+                for(n=0; n<nOptions; n++) {
+
+                    if (this.itemData[n].tagName) {
+
+                        this.addItem((new this.ITEM_TYPE(this.itemData[n])));
+    
+                    }
+    
+                }
+            
+            }
+            else {
+
+                this.addItems(this.itemData);
+            
+            }
+        
+        }
+
+
+        oSrcElement = this.srcElement;
+
+        if (oSrcElement) {
+
+            if (oSrcElement.tagName.toUpperCase() == "SELECT") {
+
+                if (Dom.inDocument(oSrcElement)) {
+
+                    this.render(oSrcElement.parentNode);
+                
+                }
+                else {
+                
+                    this.render(this.cfg.getProperty("container"));
+                
+                }
+
+            }
+            else {
+
+                this.render();
+
+            }
+
+        }
+        else {
+
+            if (this.parent) {
+
+                this.render(this.parent.element);            
+
+            }
+            else {
+
+                this.render(this.cfg.getProperty("container"));
+                this.cfg.refireEvent("xy");
+
+            }                
+
+        }
+
+    }
+
+
+    if (!(this instanceof YAHOO.widget.MenuBar) && 
+        this.cfg.getProperty("position") == "dynamic") {
+
+        nViewportHeight = Dom.getViewportHeight();
+
+
+        if (this.parent && this.parent.parent instanceof YAHOO.widget.MenuBar) {
+           
+            oRegion = YAHOO.util.Region.getRegion(this.parent.element);
+            
+            nViewportHeight = (nViewportHeight - oRegion.bottom);
+
+        }
+
+
+        if (this.element.offsetHeight >= nViewportHeight) {
+    
+            nMaxHeight = this.cfg.getProperty("maxheight");
+
+            /*
+                Cache the original value for the "maxheight" configuration  
+                property so that we can set it back when the menu is hidden.
+            */
+    
+            this._nMaxHeight = nMaxHeight;
+
+            this.cfg.setProperty("maxheight", (nViewportHeight - 20));
+        
+        }
+    
+    
+        if (this.cfg.getProperty("maxheight") > 0) {
+    
+            oBody = this.body;
+    
+            if (oBody.scrollTop > 0) {
+    
+                oBody.scrollTop = 0;
+    
+            }
+
+            this._disableScrollHeader();
+            this._enableScrollFooter();
+    
+        }
+
+    }
+
+
+},
+
+
+/**
+* @method _onShow
+* @description "show" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onShow: function (p_sType, p_aArgs) {
+
+    var oParent = this.parent,
+        oParentMenu,
+        aParentAlignment,
+        aAlignment;
+
+
+    function disableAutoSubmenuDisplay(p_oEvent) {
+
+        var oTarget;
+
+        if (p_oEvent.type == "mousedown" || (p_oEvent.type == "keydown" && 
+            p_oEvent.keyCode == 27)) {
+
+            /*  
+                Set the "autosubmenudisplay" to "false" if the user
+                clicks outside the menu bar.
+            */
+
+            oTarget = Event.getTarget(p_oEvent);
+
+            if (oTarget != oParentMenu.element || 
+                !Dom.isAncestor(oParentMenu.element, oTarget)) {
+
+                oParentMenu.cfg.setProperty("autosubmenudisplay", false);
+
+                Event.removeListener(document, "mousedown", 
+                        disableAutoSubmenuDisplay);
+
+                Event.removeListener(document, "keydown", 
+                        disableAutoSubmenuDisplay);
+
+            }
+        
+        }
+
+    }
+
+
+    if (oParent) {
+
+        oParentMenu = oParent.parent;
+        aParentAlignment = oParentMenu.cfg.getProperty("submenualignment");
+        aAlignment = this.cfg.getProperty("submenualignment");
+
+
+        if ((aParentAlignment[0] != aAlignment[0]) &&
+            (aParentAlignment[1] != aAlignment[1])) {
+
+            this.cfg.setProperty("submenualignment", 
+                [aParentAlignment[0], aParentAlignment[1]]);
+        
+        }
+
+
+        if (!oParentMenu.cfg.getProperty("autosubmenudisplay") && 
+            (oParentMenu instanceof YAHOO.widget.MenuBar || 
+            oParentMenu.cfg.getProperty("position") == "static")) {
+
+            oParentMenu.cfg.setProperty("autosubmenudisplay", true);
+
+            Event.on(document, "mousedown", disableAutoSubmenuDisplay);                             
+            Event.on(document, "keydown", disableAutoSubmenuDisplay);
+
+        }
+
+    }
+
+},
+
+
+/**
+* @method _onBeforeHide
+* @description "beforehide" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onBeforeHide: function (p_sType, p_aArgs) {
+
+    var oActiveItem = this.activeItem,
+        oConfig,
+        oSubmenu;
+
+    if (oActiveItem) {
+
+        oConfig = oActiveItem.cfg;
+
+        oConfig.setProperty("selected", false);
+
+        oSubmenu = oConfig.getProperty("submenu");
+
+        if (oSubmenu) {
+
+            oSubmenu.hide();
+
+        }
+
+    }
+
+    if (this.getRoot() == this) {
+
+        this.blur();
+    
+    }
+
+},
+
+
+/**
+* @method _onHide
+* @description "hide" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onHide: function (p_sType, p_aArgs) {
+
+    if (this._nMaxHeight != -1) {
+
+        this.cfg.setProperty("maxheight", this._nMaxHeight);
+
+        this._nMaxHeight = -1;
+
+    }
+
+},
+
+
+/**
+* @method _onParentMenuConfigChange
+* @description "configchange" event handler for a submenu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that 
+* subscribed to the event.
+*/
+_onParentMenuConfigChange: function (p_sType, p_aArgs, p_oSubmenu) {
+    
+    var sPropertyName = p_aArgs[0][0],
+        oPropertyValue = p_aArgs[0][1];
+
+    switch(sPropertyName) {
+
+        case "iframe":
+        case "constraintoviewport":
+        case "hidedelay":
+        case "showdelay":
+        case "submenuhidedelay":
+        case "clicktohide":
+        case "effect":
+        case "classname":
+
+            p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);
+                
+        break;        
+        
+    }
+    
+},
+
+
+/**
+* @method _onParentMenuRender
+* @description "render" event handler for a submenu.  Renders a  
+* submenu in response to the firing of its parent's "render" event.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that 
+* subscribed to the event.
+*/
+_onParentMenuRender: function (p_sType, p_aArgs, p_oSubmenu) {
+
+    var oParentMenu = p_oSubmenu.parent.parent,
+
+        oConfig = {
+
+            constraintoviewport: 
+                oParentMenu.cfg.getProperty("constraintoviewport"),
+
+            xy: [0,0],
+                
+            clicktohide: oParentMenu.cfg.getProperty("clicktohide"),
+                
+            effect: oParentMenu.cfg.getProperty("effect"),
+
+            showdelay: oParentMenu.cfg.getProperty("showdelay"),
+            
+            hidedelay: oParentMenu.cfg.getProperty("hidedelay"),
+
+            submenuhidedelay: oParentMenu.cfg.getProperty("submenuhidedelay"),
+
+            classname: oParentMenu.cfg.getProperty("classname")
+
+        },
+        
+        oLI;
+
+
+    /*
+        Only sync the "iframe" configuration property if the parent
+        menu's "position" configuration is the same.
+    */
+
+    if (this.cfg.getProperty("position") == 
+        oParentMenu.cfg.getProperty("position")) {
+
+        oConfig.iframe = oParentMenu.cfg.getProperty("iframe");
+    
+    }
+               
+
+    p_oSubmenu.cfg.applyConfig(oConfig);
+
+
+    if (!this.lazyLoad) {
+
+        oLI = this.parent.element;
+
+        if (this.element.parentNode == oLI) {
+    
+            this.render();
+    
+        }
+        else {
+
+            this.render(oLI);
+    
+        }
+
+    }
+    
+},
+
+
+/**
+* @method _onSubmenuBeforeShow
+* @description "beforeshow" event handler for a submenu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onSubmenuBeforeShow: function (p_sType, p_aArgs) {
+    
+    var oParent = this.parent,
+        aAlignment = oParent.parent.cfg.getProperty("submenualignment");
+
+    this.cfg.setProperty("context", 
+        [oParent.element, aAlignment[0], aAlignment[1]]);
+
+
+    var nScrollTop = oParent.parent.body.scrollTop;
+
+    if ((YAHOO.env.ua.gecko || YAHOO.env.ua.webkit) && nScrollTop > 0) {
+
+         this.cfg.setProperty("y", (this.cfg.getProperty("y") - nScrollTop));
+    
+    }
+
+},
+
+
+/**
+* @method _onSubmenuShow
+* @description "show" event handler for a submenu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onSubmenuShow: function (p_sType, p_aArgs) {
+    
+    this.submenuIndicator.innerHTML = this.EXPANDED_SUBMENU_INDICATOR_TEXT;
+
+},
+
+
+/**
+* @method _onSubmenuHide
+* @description "hide" Custom Event handler for a submenu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onSubmenuHide: function (p_sType, p_aArgs) {
+    
+    this.submenuIndicator.innerHTML = this.COLLAPSED_SUBMENU_INDICATOR_TEXT;
+
+},
+
+
+/**
+* @method _onMenuItemFocus
+* @description "focus" event handler for the menu's items.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onMenuItemFocus: function (p_sType, p_aArgs) {
+
+    this.parent.focusEvent.fire(this);
+
+},
+
+
+/**
+* @method _onMenuItemBlur
+* @description "blur" event handler for the menu's items.
+* @private
+* @param {String} p_sType String representing the name of the event 
+* that was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onMenuItemBlur: function (p_sType, p_aArgs) {
+
+    this.parent.blurEvent.fire(this);
+
+},
+
+
+/**
+* @method _onMenuItemConfigChange
+* @description "configchange" event handler for the menu's items.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item 
+* that fired the event.
+*/
+_onMenuItemConfigChange: function (p_sType, p_aArgs, p_oItem) {
+
+    var sPropertyName = p_aArgs[0][0],
+        oPropertyValue = p_aArgs[0][1],
+        sWidth,
+        oSubmenu;
+
+    switch(sPropertyName) {
+
+        case "selected":
+
+            if (oPropertyValue === true) {
+
+                this.activeItem = p_oItem;
+            
+            }
+
+        break;
+
+        case "submenu":
+
+            oSubmenu = p_aArgs[0][1];
+
+            if (oSubmenu) {
+
+                this._configureSubmenu(p_oItem);
+
+            }
+
+        break;
+
+        case "text":
+        case "helptext":
+
+            /*
+                A change to an item's "text" or "helptext"
+                configuration properties requires the width of the parent
+                menu to be recalculated.
+            */
+
+            if (this.element.style.width) {
+    
+                sWidth = this._getOffsetWidth() + "px";
+
+                Dom.setStyle(this.element, "width", sWidth);
+
+            }
+
+        break;
+
+    }
+
+},
+
+
+
+// Public event handlers for configuration properties
+
+
+/**
+* @method enforceConstraints
+* @description The default event handler executed when the moveEvent is fired,  
+* if the "constraintoviewport" configuration property is set to true.
+* @param {String} type The name of the event that was fired.
+* @param {Array} args Collection of arguments sent when the 
+* event was fired.
+* @param {Array} obj Array containing the current Menu instance 
+* and the item that fired the event.
+*/
+enforceConstraints: function (type, args, obj) {
+
+    var oParentMenuItem = this.parent,
+        oElement,
+        oConfig,
+        pos,
+        x,
+        y,
+        offsetHeight,
+        offsetWidth,
+        viewPortWidth,
+        viewPortHeight,
+        scrollX,
+        scrollY,
+        nPadding,
+        topConstraint,
+        leftConstraint,
+        bottomConstraint,
+        rightConstraint,
+        aContext,
+        oContextElement;
+
+
+    if (oParentMenuItem && 
+        !(oParentMenuItem.parent instanceof YAHOO.widget.MenuBar)) {
+
+        oElement = this.element;
+    
+        oConfig = this.cfg;
+        pos = args[0];
+        
+        x = pos[0];
+        y = pos[1];
+        
+        offsetHeight = oElement.offsetHeight;
+        offsetWidth = oElement.offsetWidth;
+        
+        viewPortWidth = Dom.getViewportWidth();
+        viewPortHeight = Dom.getViewportHeight();
+        
+        scrollX = Dom.getDocumentScrollLeft();
+        scrollY = Dom.getDocumentScrollTop();
+        
+        nPadding = 
+            (oParentMenuItem.parent instanceof YAHOO.widget.MenuBar) ? 0 : 10;
+        
+        topConstraint = scrollY + nPadding;
+        leftConstraint = scrollX + nPadding;
+        
+        bottomConstraint = scrollY + viewPortHeight - offsetHeight - nPadding;
+        rightConstraint = scrollX + viewPortWidth - offsetWidth - nPadding;
+        
+        aContext = oConfig.getProperty("context");
+        oContextElement = aContext ? aContext[0] : null;
+    
+    
+        if (x < 10) {
+    
+            x = leftConstraint;
+    
+        } else if ((x + offsetWidth) > viewPortWidth) {
+    
+            if (oContextElement &&
+                ((x - oContextElement.offsetWidth) > offsetWidth)) {
+    
+                x = (x - (oContextElement.offsetWidth + offsetWidth));
+    
+            }
+            else {
+    
+                x = rightConstraint;
+    
+            }
+    
+        }
+    
+        if (y < 10) {
+    
+            y = topConstraint;
+    
+        } else if (y > bottomConstraint) {
+    
+            if (oContextElement && (y > offsetHeight)) {
+    
+                y = ((y + oContextElement.offsetHeight) - offsetHeight);
+    
+            }
+            else {
+    
+                y = bottomConstraint;
+    
+            }
+    
+        }
+    
+        oConfig.setProperty("x", x, true);
+        oConfig.setProperty("y", y, true);
+        oConfig.setProperty("xy", [x,y], true);
+    
+    }
+    else if (this == this.getRoot() && 
+        this.cfg.getProperty("position") == "dynamic") {
+    
+        Menu.superclass.enforceConstraints.call(this, type, args, obj);
+    
+    }
+
+},
+
+
+/**
+* @method configVisible
+* @description Event handler for when the "visible" configuration property 
+* the menu changes.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+configVisible: function (p_sType, p_aArgs, p_oMenu) {
+
+    var bVisible,
+        sDisplay;
+
+    if (this.cfg.getProperty("position") == "dynamic") {
+
+        Menu.superclass.configVisible.call(this, p_sType, p_aArgs, p_oMenu);
+
+    }
+    else {
+
+        bVisible = p_aArgs[0];
+        sDisplay = Dom.getStyle(this.element, "display");
+
+        if (bVisible) {
+
+            if (sDisplay != "block") {
+                this.beforeShowEvent.fire();
+                Dom.setStyle(this.element, "display", "block");
+                this.showEvent.fire();
+            }
+        
+        }
+        else {
+
+                       if (sDisplay == "block") {
+                               this.beforeHideEvent.fire();
+                               Dom.setStyle(this.element, "display", "none");
+                               this.hideEvent.fire();
+                       }
+        
+        }
+
+    }
+
+},
+
+
+/**
+* @method configPosition
+* @description Event handler for when the "position" configuration property 
+* of the menu changes.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+configPosition: function (p_sType, p_aArgs, p_oMenu) {
+
+    var oElement = this.element,
+        sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute",
+        sCurrentPosition = Dom.getStyle(oElement, "position"),
+        oCfg = this.cfg,
+        nZIndex;
+
+
+    Dom.setStyle(this.element, "position", sCSSPosition);
+
+
+    if (sCSSPosition == "static") {
+
+        /*
+            Remove the iframe for statically positioned menus since it will 
+            intercept mouse events.
+        */
+
+        oCfg.setProperty("iframe", false);
+
+
+        // Statically positioned menus are visible by default
+        
+        Dom.setStyle(this.element, "display", "block");
+
+        oCfg.setProperty("visible", true);
+
+    }
+    else {
+
+        if (sCurrentPosition != "absolute") {
+
+            oCfg.setProperty("iframe", (YAHOO.env.ua.ie == 6 ? true : false));
+
+        }
+
+        /*
+            Even though the "visible" property is queued to 
+            "false" by default, we need to set the "visibility" property to 
+            "hidden" since Overlay's "configVisible" implementation checks the 
+            element's "visibility" style property before deciding whether 
+            or not to show an Overlay instance.
+        */
+
+        Dom.setStyle(this.element, "visibility", "hidden");
+    
+    }
+
+
+    if (sCSSPosition == "absolute") {
+
+        nZIndex = oCfg.getProperty("zindex");
+
+        if (!nZIndex || nZIndex === 0) {
+
+            nZIndex = this.parent ? 
+                (this.parent.parent.cfg.getProperty("zindex") + 1) : 1;
+
+            oCfg.setProperty("zindex", nZIndex);
+
+        }
+
+    }
+
+},
+
+
+/**
+* @method configIframe
+* @description Event handler for when the "iframe" configuration property of 
+* the menu changes.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+configIframe: function (p_sType, p_aArgs, p_oMenu) {    
+
+    if (this.cfg.getProperty("position") == "dynamic") {
+
+        Menu.superclass.configIframe.call(this, p_sType, p_aArgs, p_oMenu);
+
+    }
+
+},
+
+
+/**
+* @method configHideDelay
+* @description Event handler for when the "hidedelay" configuration property 
+* of the menu changes.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+configHideDelay: function (p_sType, p_aArgs, p_oMenu) {
+
+    var nHideDelay = p_aArgs[0],
+        oMouseOutEvent = this.mouseOutEvent,
+        oMouseOverEvent = this.mouseOverEvent,
+        oKeyDownEvent = this.keyDownEvent;
+
+    if (nHideDelay > 0) {
+
+        /*
+            Only assign event handlers once. This way the user change 
+            the value for the hidedelay as many times as they want.
+        */
+
+        if (!this._bHideDelayEventHandlersAssigned) {
+
+            oMouseOutEvent.subscribe(this._execHideDelay);
+            oMouseOverEvent.subscribe(this._cancelHideDelay);
+            oKeyDownEvent.subscribe(this._cancelHideDelay);
+
+            this._bHideDelayEventHandlersAssigned = true;
+        
+        }
+
+    }
+    else {
+
+        oMouseOutEvent.unsubscribe(this._execHideDelay);
+        oMouseOverEvent.unsubscribe(this._cancelHideDelay);
+        oKeyDownEvent.unsubscribe(this._cancelHideDelay);
+
+        this._bHideDelayEventHandlersAssigned = false;
+
+    }
+
+},
+
+
+/**
+* @method configContainer
+* @description Event handler for when the "container" configuration property 
+of the menu changes.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+configContainer: function (p_sType, p_aArgs, p_oMenu) {
+
+       var oElement = p_aArgs[0];
+
+       if (typeof oElement == 'string') {
+
+        this.cfg.setProperty("container", document.getElementById(oElement), 
+                true);
+
+       }
+
+},
+
+
+/**
+* @method _setMaxHeight
+* @description "renderEvent" handler used to defer the setting of the 
+* "maxheight" configuration property until the menu is rendered in lazy 
+* load scenarios.
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
+* was fired.
+* @param {Number} p_nMaxHeight Number representing the value to set for the 
+* "maxheight" configuration property.
+* @private
+*/
+_setMaxHeight: function (p_sType, p_aArgs, p_nMaxHeight) {
+
+    this.cfg.setProperty("maxheight", p_nMaxHeight);
+    this.renderEvent.unsubscribe(this._setMaxHeight);
+
+},
+
+
+/**
+* @method configMaxHeight
+* @description Event handler for when the "maxheight" configuration property of 
+* a Menu changes.
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
+* was fired.
+* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired
+* the event.
+*/
+configMaxHeight: function (p_sType, p_aArgs, p_oMenu) {
+
+    var nMaxHeight = p_aArgs[0],
+        oBody = this.body,
+        oHeader = this.header,
+        oFooter = this.footer,
+        fnMouseOver = this._onScrollTargetMouseOver,
+        fnMouseOut = this._onScrollTargetMouseOut,
+        nHeight;
+
+
+    if (this.lazyLoad && !oBody) {
+
+        this.renderEvent.unsubscribe(this._setMaxHeight);
+    
+        if (nMaxHeight > 0) {
+
+            this.renderEvent.subscribe(this._setMaxHeight, nMaxHeight, this);
+
+        }
+
+        return;
+    
+    }
+
+    Dom.setStyle(oBody, "height", "auto");
+    Dom.setStyle(oBody, "overflow", "visible");    
+
+
+    if ((nMaxHeight > 0) && (oBody.offsetHeight > nMaxHeight)) {
+
+        if (!this.cfg.getProperty("width")) {
+
+            this._setWidth();
+
+        }
+
+        if (!oHeader && !oFooter) {
+
+            this.setHeader("&#32;");
+            this.setFooter("&#32;");
+
+            oHeader = this.header;
+            oFooter = this.footer;
+
+            Dom.addClass(oHeader, "topscrollbar");
+            Dom.addClass(oFooter, "bottomscrollbar");
+            
+            this.element.insertBefore(oHeader, oBody);
+            this.element.appendChild(oFooter);
+
+            Event.on(oHeader, "mouseover", fnMouseOver, this, true);
+            Event.on(oHeader, "mouseout", fnMouseOut, this, true);
+            Event.on(oFooter, "mouseover", fnMouseOver, this, true);
+            Event.on(oFooter, "mouseout", fnMouseOut, this, true);
+        
+        }
+
+        nHeight = (nMaxHeight - (this.footer.offsetHeight + 
+                    this.header.offsetHeight));
+
+        Dom.setStyle(oBody, "height", (nHeight + "px"));
+        Dom.setStyle(oBody, "overflow", "hidden");
+
+    }
+    else if (oHeader && oFooter) {
+
+        Dom.setStyle(oBody, "height", "auto");
+        Dom.setStyle(oBody, "overflow", "visible");
+
+        Event.removeListener(oHeader, "mouseover", fnMouseOver);
+        Event.removeListener(oHeader, "mouseout", fnMouseOut);
+        Event.removeListener(oFooter, "mouseover", fnMouseOver);
+        Event.removeListener(oFooter, "mouseout", fnMouseOut);
+
+        this.element.removeChild(oHeader);
+        this.element.removeChild(oFooter);
+    
+        this.header = null;
+        this.footer = null;
+    
+    }
+
+    this.cfg.refireEvent("iframe");
+
+},
+
+
+/**
+* @method configClassName
+* @description Event handler for when the "classname" configuration property of 
+* a menu changes.
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event.
+*/
+configClassName: function (p_sType, p_aArgs, p_oMenu) {
+
+    var sClassName = p_aArgs[0];
+
+    if (this._sClassName) {
+
+        Dom.removeClass(this.element, this._sClassName);
+
+    }
+
+    Dom.addClass(this.element, sClassName);
+    this._sClassName = sClassName;
+
+},
+
+
+/**
+* @method _onItemAdded
+* @description "itemadded" event handler for a Menu instance.
+* @private
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
+* was fired.
+*/
+_onItemAdded: function (p_sType, p_aArgs) {
+
+    var oItem = p_aArgs[0];
+    
+    if (oItem) {
+
+        oItem.cfg.setProperty("disabled", true);
+    
+    }
+
+},
+
+
+/**
+* @method configDisabled
+* @description Event handler for when the "disabled" configuration property of 
+* a menu changes.
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event.
+*/
+configDisabled: function (p_sType, p_aArgs, p_oMenu) {
+
+    var bDisabled = p_aArgs[0],
+        aItems,
+        nItems,
+        i;
+
+    if (this._bDisabled != bDisabled) {
+
+        aItems = this.getItems();
+        nItems = aItems.length;
+
+        if (nItems > 0) {
+        
+            i = nItems - 1;
+    
+            do {
+    
+                aItems[i].cfg.setProperty("disabled", bDisabled);
+            
+            }
+            while (i--);
+        
+        }
+    
+        Dom[(bDisabled ? "addClass" : "removeClass")](this.element, "disabled");    
+
+        this.itemAddedEvent[(bDisabled ? "subscribe" : "unsubscribe")](
+            this._onItemAdded);
+    
+        this._bDisabled = bDisabled;
+    
+    }
+
+},
+
+
+/**
+* @method onRender
+* @description "render" event handler for the menu.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+onRender: function (p_sType, p_aArgs) {
+
+    function sizeShadow() {
+
+        var oElement = this.element,
+            oShadow = this._shadow;
+    
+        if (oShadow) {
+
+            oShadow.style.width = (oElement.offsetWidth + 6) + "px";
+            oShadow.style.height = (oElement.offsetHeight + 1) + "px";
+            
+        }
+    
+    }
+
+
+    function addShadowVisibleClass() {
+    
+        Dom.addClass(this._shadow, "yui-menu-shadow-visible");
+    
+    }
+    
+
+    function removeShadowVisibleClass() {
+
+        Dom.removeClass(this._shadow, "yui-menu-shadow-visible");
+    
+    }
+
+
+    function createShadow() {
+
+        var oShadow = this._shadow,
+            oElement,
+            me;
+
+        if (!oShadow) {
+
+            oElement = this.element;
+            me = this;
+
+            if (!m_oShadowTemplate) {
+
+                m_oShadowTemplate = document.createElement("div");
+                m_oShadowTemplate.className = "yui-menu-shadow";
+            
+            }
+
+            oShadow = m_oShadowTemplate.cloneNode(false);
+
+            oElement.appendChild(oShadow);
+            
+            this._shadow = oShadow;
+
+            addShadowVisibleClass.call(this);
+
+            this.beforeShowEvent.subscribe(addShadowVisibleClass);
+            this.beforeHideEvent.subscribe(removeShadowVisibleClass);
+
+            if (YAHOO.env.ua.ie) {
+        
+                /*
+                     Need to call sizeShadow & syncIframe via setTimeout for 
+                     IE 7 Quirks Mode and IE 6 Standards Mode and Quirks Mode 
+                     or the shadow and iframe shim will not be sized and 
+                     positioned properly.
+                */
+        
+                window.setTimeout(function () { 
+        
+                    sizeShadow.call(me); 
+                    me.syncIframe();
+        
+                }, 0);
+
+                this.cfg.subscribeToConfigEvent("width", sizeShadow);
+                this.cfg.subscribeToConfigEvent("height", sizeShadow);
+                this.changeContentEvent.subscribe(sizeShadow);
+
+                Module.textResizeEvent.subscribe(sizeShadow, me, true);
+                
+                this.destroyEvent.subscribe(function () {
+                
+                    Module.textResizeEvent.unsubscribe(sizeShadow, me);
+                
+                });
+        
+            }
+        
+        }
+
+    }
+
+
+    function onBeforeShow() {
+    
+        createShadow.call(this);
+
+        this.beforeShowEvent.unsubscribe(onBeforeShow);
+    
+    }
+
+
+    if (this.cfg.getProperty("position") == "dynamic") {
+
+        if (this.cfg.getProperty("visible")) {
+
+            createShadow.call(this);
+        
+        }
+        else {
+
+            this.beforeShowEvent.subscribe(onBeforeShow);
+        
+        }
+    
+    }
+
+},
+
+
+// Public methods
+
+
+/**
+* @method initEvents
+* @description Initializes the custom events for the menu.
+*/
+initEvents: function () {
+
+       Menu.superclass.initEvents.call(this);
+
+    // Create custom events
+
+    var SIGNATURE = CustomEvent.LIST;
+
+    this.mouseOverEvent = this.createEvent(EVENT_TYPES.MOUSE_OVER);
+    this.mouseOverEvent.signature = SIGNATURE;
+
+    this.mouseOutEvent = this.createEvent(EVENT_TYPES.MOUSE_OUT);
+    this.mouseOutEvent.signature = SIGNATURE;
+    
+    this.mouseDownEvent = this.createEvent(EVENT_TYPES.MOUSE_DOWN);
+    this.mouseDownEvent.signature = SIGNATURE;
+
+    this.mouseUpEvent = this.createEvent(EVENT_TYPES.MOUSE_UP);
+    this.mouseUpEvent.signature = SIGNATURE;
+    
+    this.clickEvent = this.createEvent(EVENT_TYPES.CLICK);
+    this.clickEvent.signature = SIGNATURE;
+    
+    this.keyPressEvent = this.createEvent(EVENT_TYPES.KEY_PRESS);
+    this.keyPressEvent.signature = SIGNATURE;
+    
+    this.keyDownEvent = this.createEvent(EVENT_TYPES.KEY_DOWN);
+    this.keyDownEvent.signature = SIGNATURE;
+    
+    this.keyUpEvent = this.createEvent(EVENT_TYPES.KEY_UP);
+    this.keyUpEvent.signature = SIGNATURE;
+    
+    this.focusEvent = this.createEvent(EVENT_TYPES.FOCUS);
+    this.focusEvent.signature = SIGNATURE;
+    
+    this.blurEvent = this.createEvent(EVENT_TYPES.BLUR);
+    this.blurEvent.signature = SIGNATURE;
+    
+    this.itemAddedEvent = this.createEvent(EVENT_TYPES.ITEM_ADDED);
+    this.itemAddedEvent.signature = SIGNATURE;
+    
+    this.itemRemovedEvent = this.createEvent(EVENT_TYPES.ITEM_REMOVED);
+    this.itemRemovedEvent.signature = SIGNATURE;
+
+},
+
+
+/**
+* @method getRoot
+* @description Finds the menu's root menu.
+*/
+getRoot: function () {
+
+    var oItem = this.parent,
+        oParentMenu;
+
+    if (oItem) {
+
+        oParentMenu = oItem.parent;
+
+        return oParentMenu ? oParentMenu.getRoot() : this;
+
+    }
+    else {
+    
+        return this;
+    
+    }
+
+},
+
+
+/**
+* @method toString
+* @description Returns a string representing the menu.
+* @return {String}
+*/
+toString: function () {
+
+    var sReturnVal = "Menu",
+        sId = this.id;
+
+    if (sId) {
+
+        sReturnVal += (" " + sId);
+    
+    }
+
+    return sReturnVal;
+
+},
+
+
+/**
+* @method setItemGroupTitle
+* @description Sets the title of a group of menu items.
+* @param {String} p_sGroupTitle String specifying the title of the group.
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to which
+* the title belongs.
+*/
+setItemGroupTitle: function (p_sGroupTitle, p_nGroupIndex) {
+
+    var nGroupIndex,
+        oTitle,
+        i,
+        nFirstIndex;
+        
+    if (typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {
+
+        nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;
+        oTitle = this._aGroupTitleElements[nGroupIndex];
+
+
+        if (oTitle) {
+
+            oTitle.innerHTML = p_sGroupTitle;
+            
+        }
+        else {
+
+            oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME);
+                    
+            oTitle.innerHTML = p_sGroupTitle;
+
+            this._aGroupTitleElements[nGroupIndex] = oTitle;
+
+        }
+
+
+        i = this._aGroupTitleElements.length - 1;
+
+        do {
+
+            if (this._aGroupTitleElements[i]) {
+
+                Dom.removeClass(this._aGroupTitleElements[i], "first-of-type");
+
+                nFirstIndex = i;
+
+            }
+
+        }
+        while(i--);
+
+
+        if (nFirstIndex !== null) {
+
+            Dom.addClass(this._aGroupTitleElements[nFirstIndex], 
+                "first-of-type");
+
+        }
+
+        this.changeContentEvent.fire();
+
+    }
+
+},
+
+
+
+/**
+* @method addItem
+* @description Appends an item to the menu.
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance to be added to the menu.
+* @param {String} p_oItem String specifying the text of the item to be added 
+* to the menu.
+* @param {Object} p_oItem Object literal containing a set of menu item 
+* configuration properties.
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to
+* which the item belongs.
+* @return {YAHOO.widget.MenuItem}
+*/
+addItem: function (p_oItem, p_nGroupIndex) {
+
+    if (p_oItem) {
+
+        return this._addItemToGroup(p_nGroupIndex, p_oItem);
+        
+    }
+
+},
+
+
+/**
+* @method addItems
+* @description Adds an array of items to the menu.
+* @param {Array} p_aItems Array of items to be added to the menu.  The array 
+* can contain strings specifying the text for each item to be created, object
+* literals specifying each of the menu item configuration properties, 
+* or MenuItem instances.
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to 
+* which the items belongs.
+* @return {Array}
+*/
+addItems: function (p_aItems, p_nGroupIndex) {
+
+    var nItems,
+        aItems,
+        oItem,
+        i;
+
+    if (Lang.isArray(p_aItems)) {
+
+        nItems = p_aItems.length;
+        aItems = [];
+
+        for(i=0; i<nItems; i++) {
+
+            oItem = p_aItems[i];
+
+            if (oItem) {
+
+                if (Lang.isArray(oItem)) {
+    
+                    aItems[aItems.length] = this.addItems(oItem, i);
+    
+                }
+                else {
+    
+                    aItems[aItems.length] = 
+                        this._addItemToGroup(p_nGroupIndex, oItem);
+                
+                }
+
+            }
+    
+        }
+
+
+        if (aItems.length) {
+        
+            return aItems;
+        
+        }
+
+    }
+
+},
+
+
+/**
+* @method insertItem
+* @description Inserts an item into the menu at the specified index.
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance to be added to the menu.
+* @param {String} p_oItem String specifying the text of the item to be added 
+* to the menu.
+* @param {Object} p_oItem Object literal containing a set of menu item 
+* configuration properties.
+* @param {Number} p_nItemIndex Number indicating the ordinal position at which
+* the item should be added.
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to which 
+* the item belongs.
+* @return {YAHOO.widget.MenuItem}
+*/
+insertItem: function (p_oItem, p_nItemIndex, p_nGroupIndex) {
+    
+    if (p_oItem) {
+
+        return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex);
+
+    }
+
+},
+
+
+/**
+* @method removeItem
+* @description Removes the specified item from the menu.
+* @param {YAHOO.widget.MenuItem} p_oObject Object reference for the MenuItem 
+* instance to be removed from the menu.
+* @param {Number} p_oObject Number specifying the index of the item 
+* to be removed.
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to 
+* which the item belongs.
+* @return {YAHOO.widget.MenuItem}
+*/
+removeItem: function (p_oObject, p_nGroupIndex) {
+
+    var oItem;
+    
+    if (typeof p_oObject != "undefined") {
+
+        if (p_oObject instanceof YAHOO.widget.MenuItem) {
+
+            oItem = this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject);           
+
+        }
+        else if (typeof p_oObject == "number") {
+
+            oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);
+
+        }
+
+        if (oItem) {
+
+            oItem.destroy();
+
+            this.logger.log("Item removed." + 
+                " Text: " + oItem.cfg.getProperty("text") + ", " + 
+                " Index: " + oItem.index + ", " + 
+                " Group Index: " + oItem.groupIndex);
+
+            return oItem;
+
+        }
+
+    }
+
+},
+
+
+/**
+* @method getItems
+* @description Returns an array of all of the items in the menu.
+* @return {Array}
+*/
+getItems: function () {
+
+    var aGroups = this._aItemGroups,
+        nGroups = aGroups.length;
+
+    return ((nGroups == 1) ? aGroups[0] : 
+                (Array.prototype.concat.apply([], aGroups)));
+
+},
+
+
+/**
+* @method getItemGroups
+* @description Multi-dimensional Array representing the menu items as they 
+* are grouped in the menu.
+* @return {Array}
+*/        
+getItemGroups: function () {
+
+    return this._aItemGroups;
+
+},
+
+
+/**
+* @method getItem
+* @description Returns the item at the specified index.
+* @param {Number} p_nItemIndex Number indicating the ordinal position of the 
+* item to be retrieved.
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to which 
+* the item belongs.
+* @return {YAHOO.widget.MenuItem}
+*/
+getItem: function (p_nItemIndex, p_nGroupIndex) {
+    
+    var aGroup;
+    
+    if (typeof p_nItemIndex == "number") {
+
+        aGroup = this._getItemGroup(p_nGroupIndex);
+
+        if (aGroup) {
+
+            return aGroup[p_nItemIndex];
+        
+        }
+
+    }
+    
+},
+
+
+/**
+* @method getSubmenus
+* @description Returns an array of all of the submenus that are immediate 
+* children of the menu.
+* @return {Array}
+*/
+getSubmenus: function () {
+
+    var aItems = this.getItems(),
+        nItems = aItems.length,
+        aSubmenus,
+        oSubmenu,
+        oItem,
+        i;
+
+
+    if (nItems > 0) {
+        
+        aSubmenus = [];
+
+        for(i=0; i<nItems; i++) {
+
+            oItem = aItems[i];
+            
+            if (oItem) {
+
+                oSubmenu = oItem.cfg.getProperty("submenu");
+                
+                if (oSubmenu) {
+
+                    aSubmenus[aSubmenus.length] = oSubmenu;
+
+                }
+            
+            }
+        
+        }
+    
+    }
+
+    return aSubmenus;
+
+},
+
+/**
+* @method clearContent
+* @description Removes all of the content from the menu, including the menu 
+* items, group titles, header and footer.
+*/
+clearContent: function () {
+
+    var aItems = this.getItems(),
+        nItems = aItems.length,
+        oElement = this.element,
+        oBody = this.body,
+        oHeader = this.header,
+        oFooter = this.footer,
+        oItem,
+        oSubmenu,
+        i;
+
+
+    if (nItems > 0) {
+
+        i = nItems - 1;
+
+        do {
+
+            oItem = aItems[i];
+
+            if (oItem) {
+
+                oSubmenu = oItem.cfg.getProperty("submenu");
+
+                if (oSubmenu) {
+
+                    this.cfg.configChangedEvent.unsubscribe(
+                        this._onParentMenuConfigChange, oSubmenu);
+
+                    this.renderEvent.unsubscribe(this._onParentMenuRender, 
+                        oSubmenu);
+
+                }
+                
+                this.removeItem(oItem);
+
+            }
+        
+        }
+        while(i--);
+
+    }
+
+
+    if (oHeader) {
+
+        Event.purgeElement(oHeader);
+        oElement.removeChild(oHeader);
+
+    }
+    
+
+    if (oFooter) {
+
+        Event.purgeElement(oFooter);
+        oElement.removeChild(oFooter);
+    }
+
+
+    if (oBody) {
+
+        Event.purgeElement(oBody);
+
+        oBody.innerHTML = "";
+
+    }
+
+
+    this._aItemGroups = [];
+    this._aListElements = [];
+    this._aGroupTitleElements = [];
+    
+    this.cfg.setProperty("width", null);
+
+},
+
+
+/**
+* @method destroy
+* @description Removes the menu's <code>&#60;div&#62;</code> element 
+* (and accompanying child nodes) from the document.
+*/
+destroy: function () {
+
+    Module.textResizeEvent.unsubscribe(this._onTextResize, this);
+
+
+    // Remove all items
+
+    this.clearContent();
+
+    this._aItemGroups = null;
+    this._aListElements = null;
+    this._aGroupTitleElements = null;
+
+
+    // Continue with the superclass implementation of this method
+
+    Menu.superclass.destroy.call(this);
+    
+    this.logger.log("Destroyed.");
+
+},
+
+
+/**
+* @method setInitialFocus
+* @description Sets focus to the menu's first enabled item.
+*/
+setInitialFocus: function () {
+
+    var oItem = this._getFirstEnabledItem();
+    
+    if (oItem) {
+
+        oItem.focus();
+
+    }
+    
+},
+
+
+/**
+* @method setInitialSelection
+* @description Sets the "selected" configuration property of the menu's first 
+* enabled item to "true."
+*/
+setInitialSelection: function () {
+
+    var oItem = this._getFirstEnabledItem();
+    
+    if (oItem) {
+    
+        oItem.cfg.setProperty("selected", true);
+    }        
+
+},
+
+
+/**
+* @method clearActiveItem
+* @description Sets the "selected" configuration property of the menu's active
+* item to "false" and hides the item's submenu.
+* @param {Boolean} p_bBlur Boolean indicating if the menu's active item 
+* should be blurred.  
+*/
+clearActiveItem: function (p_bBlur) {
+
+    if (this.cfg.getProperty("showdelay") > 0) {
+    
+        this._cancelShowDelay();
+    
+    }
+
+
+    var oActiveItem = this.activeItem,
+        oConfig,
+        oSubmenu;
+
+    if (oActiveItem) {
+
+        oConfig = oActiveItem.cfg;
+
+        if (p_bBlur) {
+
+            oActiveItem.blur();
+        
+        }
+
+        oConfig.setProperty("selected", false);
+
+        oSubmenu = oConfig.getProperty("submenu");
+
+        if (oSubmenu) {
+
+            oSubmenu.hide();
+
+        }
+
+        this.activeItem = null;            
+
+    }
+
+},
+
+
+/**
+* @method focus
+* @description Causes the menu to receive focus and fires the "focus" event.
+*/
+focus: function () {
+
+    if (!this.hasFocus()) {
+
+        this.setInitialFocus();
+    
+    }
+
+},
+
+
+/**
+* @method blur
+* @description Causes the menu to lose focus and fires the "blur" event.
+*/    
+blur: function () {
+
+    var oItem;
+
+    if (this.hasFocus()) {
+    
+        oItem = MenuManager.getFocusedMenuItem();
+        
+        if (oItem) {
+
+            oItem.blur();
+
+        }
+
+    }
+
+},
+
+
+/**
+* @method hasFocus
+* @description Returns a boolean indicating whether or not the menu has focus.
+* @return {Boolean}
+*/
+hasFocus: function () {
+
+    return (MenuManager.getFocusedMenu() == this.getRoot());
+
+},
+
+
+/**
+* Adds the specified CustomEvent subscriber to the menu and each of 
+* its submenus.
+* @method subscribe
+* @param p_type     {string}   the type, or name of the event
+* @param p_fn       {function} the function to exectute when the event fires
+* @param p_obj      {Object}   An object to be passed along when the event 
+*                              fires
+* @param p_override {boolean}  If true, the obj passed in becomes the 
+*                              execution scope of the listener
+*/
+subscribe: function () {
+
+    function onItemAdded(p_sType, p_aArgs, p_oObject) {
+
+        var oItem = p_aArgs[0],
+            oSubmenu = oItem.cfg.getProperty("submenu");
+
+        if (oSubmenu) {
+
+            oSubmenu.subscribe.apply(oSubmenu, p_oObject);
+
+        }
+    
+    }
+
+
+    Menu.superclass.subscribe.apply(this, arguments);
+    Menu.superclass.subscribe.call(this, "itemAdded", onItemAdded, arguments);
+
+
+    var aSubmenus = this.getSubmenus(),
+        nSubmenus,
+        oSubmenu,
+        i;
+
+    if (aSubmenus) {
+
+        nSubmenus = aSubmenus.length;
+
+        if (nSubmenus > 0) {
+        
+            i = nSubmenus - 1;
+            
+            do {
+    
+                oSubmenu = aSubmenus[i];
+                
+                oSubmenu.subscribe.apply(oSubmenu, arguments);
+    
+            }
+            while(i--);
+        
+        }
+    
+    }
+
+},
+
+
+/**
+* @description Initializes the class's configurable properties which can be
+* changed using the menu's Config object ("cfg").
+* @method initDefaultConfig
+*/
+initDefaultConfig: function () {
+
+    Menu.superclass.initDefaultConfig.call(this);
+
+    var oConfig = this.cfg;
+
+       // Add configuration attributes
+
+    /*
+        Change the default value for the "visible" configuration 
+        property to "false" by re-adding the property.
+    */
+
+    /**
+    * @config visible
+    * @description Boolean indicating whether or not the menu is visible.  If 
+    * the menu's "position" configuration property is set to "dynamic" (the 
+    * default), this property toggles the menu's <code>&#60;div&#62;</code> 
+    * element's "visibility" style property between "visible" (true) or 
+    * "hidden" (false).  If the menu's "position" configuration property is 
+    * set to "static" this property toggles the menu's 
+    * <code>&#60;div&#62;</code> element's "display" style property 
+    * between "block" (true) or "none" (false).
+    * @default false
+    * @type Boolean
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.VISIBLE.key, 
+        {
+            handler: this.configVisible, 
+            value: DEFAULT_CONFIG.VISIBLE.value, 
+            validator: DEFAULT_CONFIG.VISIBLE.validator
+         }
+     );
+
+
+    /*
+        Change the default value for the "constraintoviewport" configuration 
+        property to "true" by re-adding the property.
+    */
+
+    /**
+    * @config constraintoviewport
+    * @description Boolean indicating if the menu will try to remain inside 
+    * the boundaries of the size of viewport.
+    * @default true
+    * @type Boolean
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, 
+        {
+            handler: this.configConstrainToViewport, 
+            value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
+            validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
+            supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes 
+        } 
+    );
+
+
+    /**
+    * @config position
+    * @description String indicating how a menu should be positioned on the 
+    * screen.  Possible values are "static" and "dynamic."  Static menus are 
+    * visible by default and reside in the normal flow of the document 
+    * (CSS position: static).  Dynamic menus are hidden by default, reside 
+    * out of the normal flow of the document (CSS position: absolute), and 
+    * can overlay other elements on the screen.
+    * @default dynamic
+    * @type String
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.POSITION.key, 
+        {
+            handler: this.configPosition,
+            value: DEFAULT_CONFIG.POSITION.value, 
+            validator: DEFAULT_CONFIG.POSITION.validator,
+            supercedes: DEFAULT_CONFIG.POSITION.supercedes
+        }
+    );
+
+
+    /**
+    * @config submenualignment
+    * @description Array defining how submenus should be aligned to their 
+    * parent menu item. The format is: [itemCorner, submenuCorner]. By default
+    * a submenu's top left corner is aligned to its parent menu item's top 
+    * right corner.
+    * @default ["tl","tr"]
+    * @type Array
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key, 
+        { 
+            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value 
+        }
+    );
+
+
+    /**
+    * @config autosubmenudisplay
+    * @description Boolean indicating if submenus are automatically made 
+    * visible when the user mouses over the menu's items.
+    * @default true
+    * @type Boolean
+    */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key, 
+          { 
+              value: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value, 
+              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator
+       } 
+    );
+
+
+    /**
+    * @config showdelay
+    * @description Number indicating the time (in milliseconds) that should 
+    * expire before a submenu is made visible when the user mouses over 
+    * the menu's items.
+    * @default 250
+    * @type Number
+    */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.SHOW_DELAY.key, 
+          { 
+              value: DEFAULT_CONFIG.SHOW_DELAY.value, 
+              validator: DEFAULT_CONFIG.SHOW_DELAY.validator
+       } 
+    );
+
+
+    /**
+    * @config hidedelay
+    * @description Number indicating the time (in milliseconds) that should 
+    * expire before the menu is hidden.
+    * @default 0
+    * @type Number
+    */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.HIDE_DELAY.key, 
+          { 
+              handler: this.configHideDelay,
+              value: DEFAULT_CONFIG.HIDE_DELAY.value, 
+              validator: DEFAULT_CONFIG.HIDE_DELAY.validator, 
+              suppressEvent: DEFAULT_CONFIG.HIDE_DELAY.suppressEvent
+       } 
+    );
+
+
+    /**
+    * @config submenuhidedelay
+    * @description Number indicating the time (in milliseconds) that should 
+    * expire before a submenu is hidden when the user mouses out of a menu item 
+    * heading in the direction of a submenu.  The value must be greater than or 
+    * equal to the value specified for the "showdelay" configuration property.
+    * @default 250
+    * @type Number
+    */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.key, 
+          { 
+              value: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.value, 
+              validator: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.validator
+       } 
+    );
+
+
+    /**
+    * @config clicktohide
+    * @description Boolean indicating if the menu will automatically be 
+    * hidden if the user clicks outside of it.
+    * @default true
+    * @type Boolean
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.CLICK_TO_HIDE.key,
+        {
+            value: DEFAULT_CONFIG.CLICK_TO_HIDE.value,
+            validator: DEFAULT_CONFIG.CLICK_TO_HIDE.validator
+        }
+    );
+
+
+       /**
+       * @config container
+       * @description HTML element reference or string specifying the id 
+       * attribute of the HTML element that the menu's markup should be 
+       * rendered into.
+       * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+       * level-one-html.html#ID-58190037">HTMLElement</a>|String
+       * @default document.body
+       */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.CONTAINER.key, 
+          { 
+              handler: this.configContainer,
+              value: document.body
+       } 
+   );
+
+
+    /**
+    * @config maxheight
+    * @description Defines the maximum height (in pixels) for a menu before the
+    * contents of the body are scrolled.
+    * @default 0
+    * @type Number
+    */
+    oConfig.addProperty(
+       DEFAULT_CONFIG.MAX_HEIGHT.key, 
+       {
+            handler: this.configMaxHeight,
+            value: DEFAULT_CONFIG.MAX_HEIGHT.value,
+            validator: DEFAULT_CONFIG.MAX_HEIGHT.validator
+       } 
+    );
+
+
+    /**
+    * @config classname
+    * @description CSS class to be applied to the menu's root 
+    * <code>&#60;div&#62;</code> element.  The specified class(es) are 
+    * appended in addition to the default class as specified by the menu's
+    * CSS_CLASS_NAME constant.
+    * @default null
+    * @type String
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.CLASS_NAME.key, 
+        { 
+            handler: this.configClassName,
+            value: DEFAULT_CONFIG.CLASS_NAME.value, 
+            validator: DEFAULT_CONFIG.CLASS_NAME.validator
+        }
+    );
+
+
+    /**
+    * @config disabled
+    * @description Boolean indicating if the menu should be disabled.  
+    * Disabling a menu disables each of its items.  (Disabled menu items are 
+    * dimmed and will not respond to user input or fire events.)  Disabled
+    * menus have a corresponding "disabled" CSS class applied to their root
+    * <code>&#60;div&#62;</code> element.
+    * @default false
+    * @type Boolean
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.DISABLED.key, 
+        { 
+            handler: this.configDisabled,
+            value: DEFAULT_CONFIG.DISABLED.value, 
+            validator: DEFAULT_CONFIG.DISABLED.validator
+        }
+    );
+
+}
+
+}); // END YAHOO.lang.extend
+
+})();
+
+
+
+(function() {
+
+
+/**
+* Creates an item for a menu.
+* 
+* @param {String} p_oObject String specifying the text of the menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying 
+* the <code>&#60;li&#62;</code> element of the menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object 
+* specifying the <code>&#60;option&#62;</code> element of the menu item.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu item. See configuration class documentation 
+* for more details.
+* @class MenuItem
+* @constructor
+*/
+YAHOO.widget.MenuItem = function(p_oObject, p_oConfig) {
+
+    if(p_oObject) {
+
+        if(p_oConfig) {
+    
+            this.parent = p_oConfig.parent;
+            this.value = p_oConfig.value;
+            this.id = p_oConfig.id;
+
+        }
+
+        this.init(p_oObject, p_oConfig);
+
+    }
+
+};
+
+var Dom = YAHOO.util.Dom,
+    Module = YAHOO.widget.Module,
+    Menu = YAHOO.widget.Menu,
+    MenuItem = YAHOO.widget.MenuItem,
+    CustomEvent = YAHOO.util.CustomEvent,
+    Lang = YAHOO.lang,
+
+    m_oMenuItemTemplate,
+
+    /**
+    * Constant representing the name of the MenuItem's events
+    * @property EVENT_TYPES
+    * @private
+    * @final
+    * @type Object
+    */
+    EVENT_TYPES = {
+    
+        "MOUSE_OVER": "mouseover",
+        "MOUSE_OUT": "mouseout",
+        "MOUSE_DOWN": "mousedown",
+        "MOUSE_UP": "mouseup",
+        "CLICK": "click",
+        "KEY_PRESS": "keypress",
+        "KEY_DOWN": "keydown",
+        "KEY_UP": "keyup",
+        "ITEM_ADDED": "itemAdded",
+        "ITEM_REMOVED": "itemRemoved",
+        "FOCUS": "focus",
+        "BLUR": "blur",
+        "DESTROY": "destroy"
+    
+    },
+
+    /**
+    * Constant representing the MenuItem's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
+    * @final
+    * @type Object
+    */
+    DEFAULT_CONFIG = {
+    
+        "TEXT": { 
+            key: "text", 
+            value: "", 
+            validator: Lang.isString, 
+            suppressEvent: true 
+        }, 
+    
+        "HELP_TEXT": { 
+            key: "helptext",
+            supercedes: ["text"]
+        },
+    
+        "URL": { 
+            key: "url", 
+            value: "#", 
+            suppressEvent: true 
+        }, 
+    
+        "TARGET": { 
+            key: "target", 
+            suppressEvent: true 
+        }, 
+    
+        "EMPHASIS": { 
+            key: "emphasis", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true, 
+            supercedes: ["text"]
+        }, 
+    
+        "STRONG_EMPHASIS": { 
+            key: "strongemphasis", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true,
+            supercedes: ["text"]
+        },
+    
+        "CHECKED": { 
+            key: "checked", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true, 
+            supercedes: ["text"]
+        }, 
+    
+        "DISABLED": { 
+            key: "disabled", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true,
+            supercedes: ["text"]
+        },
+    
+        "SELECTED": { 
+            key: "selected", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true
+        },
+    
+        "SUBMENU": { 
+            key: "submenu",
+            supercedes: ["text"]
+        },
+    
+        "ONCLICK": { 
+            key: "onclick"
+        },
+    
+        "CLASS_NAME": { 
+            key: "classname", 
+            value: null, 
+            validator: Lang.isString
+        }
+    
+    };
+
+
+MenuItem.prototype = {
+
+    // Constants
+
+    /**
+    * @property COLLAPSED_SUBMENU_INDICATOR_TEXT
+    * @description String representing the text for the <code>&#60;em&#62;</code>
+    * element used for the submenu arrow indicator.
+    * @default "Submenu collapsed.  Click to expand submenu."
+    * @final
+    * @type String
+    */
+    COLLAPSED_SUBMENU_INDICATOR_TEXT: 
+        "Submenu collapsed.  Click to expand submenu.",
+
+
+    /**
+    * @property EXPANDED_SUBMENU_INDICATOR_TEXT
+    * @description String representing the text for the submenu arrow indicator 
+    * element (<code>&#60;em&#62;</code>) when the submenu is visible.
+    * @default "Submenu expanded.  Click to collapse submenu."
+    * @final
+    * @type String
+    */
+    EXPANDED_SUBMENU_INDICATOR_TEXT: 
+        "Submenu expanded.  Click to collapse submenu.",
+
+
+    /**
+    * @property DISABLED_SUBMENU_INDICATOR_TEXT
+    * @description String representing the text for the submenu arrow indicator 
+    * element (<code>&#60;em&#62;</code>) when the menu item is disabled.
+    * @default "Submenu collapsed.  (Item disabled.)."
+    * @final
+    * @type String
+    */
+    DISABLED_SUBMENU_INDICATOR_TEXT: "Submenu collapsed.  (Item disabled.)",
+
+
+    /**
+    * @property CHECKED_TEXT
+    * @description String representing the text to be used for the checked 
+    * indicator element (<code>&#60;em&#62;</code>).
+    * @default "Checked."
+    * @final
+    * @type String
+    */
+    CHECKED_TEXT: "Menu item checked.",
+    
+    
+    /**
+    * @property DISABLED_CHECKED_TEXT
+    * @description String representing the text to be used for the checked 
+    * indicator element (<code>&#60;em&#62;</code>) when the menu item 
+    * is disabled.
+    * @default "Checked. (Item disabled.)"
+    * @final
+    * @type String
+    */
+    DISABLED_CHECKED_TEXT: "Checked. (Item disabled.)",
+
+
+    /**
+    * @property CSS_CLASS_NAME
+    * @description String representing the CSS class(es) to be applied to the 
+    * <code>&#60;li&#62;</code> element of the menu item.
+    * @default "yuimenuitem"
+    * @final
+    * @type String
+    */
+    CSS_CLASS_NAME: "yuimenuitem",
+
+
+    /**
+    * @property CSS_LABEL_CLASS_NAME
+    * @description String representing the CSS class(es) to be applied to the 
+    * menu item's <code>&#60;a&#62;</code> element.
+    * @default "yuimenuitemlabel"
+    * @final
+    * @type String
+    */
+    CSS_LABEL_CLASS_NAME: "yuimenuitemlabel",
+
+
+    /**
+    * @property SUBMENU_TYPE
+    * @description Object representing the type of menu to instantiate and 
+    * add when parsing the child nodes of the menu item's source HTML element.
+    * @final
+    * @type YAHOO.widget.Menu
+    */
+    SUBMENU_TYPE: null,
+
+
+
+    // Private member variables
+    
+
+    /**
+    * @property _oAnchor
+    * @description Object reference to the menu item's 
+    * <code>&#60;a&#62;</code> element.
+    * @default null 
+    * @private
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-48250443">HTMLAnchorElement</a>
+    */
+    _oAnchor: null,
+    
+    
+    /**
+    * @property _oHelpTextEM
+    * @description Object reference to the menu item's help text 
+    * <code>&#60;em&#62;</code> element.
+    * @default null
+    * @private
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-58190037">HTMLElement</a>
+    */
+    _oHelpTextEM: null,
+    
+    
+    /**
+    * @property _oSubmenu
+    * @description Object reference to the menu item's submenu.
+    * @default null
+    * @private
+    * @type YAHOO.widget.Menu
+    */
+    _oSubmenu: null,
+    
+
+    /**
+    * @property _oCheckedIndicator
+    * @description Object reference to the menu item's checkmark image.
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-58190037">HTMLElement</a>
+    * @private
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-58190037">HTMLElement</a>
+    */
+    _oCheckedIndicator: null,
+
+
+    /** 
+    * @property _oOnclickAttributeValue
+    * @description Object reference to the menu item's current value for the 
+    * "onclick" configuration attribute.
+    * @default null
+    * @private
+    * @type Object
+    */
+    _oOnclickAttributeValue: null,
+
+
+    /**
+    * @property _sClassName
+    * @description The current value of the "classname" configuration attribute.
+    * @default null
+    * @private
+    * @type String
+    */
+    _sClassName: null,
+
+
+
+    // Public properties
+
+
+       /**
+    * @property constructor
+       * @description Object reference to the menu item's constructor function.
+    * @default YAHOO.widget.MenuItem
+       * @type YAHOO.widget.MenuItem
+       */
+       constructor: MenuItem,
+
+
+    /**
+    * @property index
+    * @description Number indicating the ordinal position of the menu item in 
+    * its group.
+    * @default null
+    * @type Number
+    */
+    index: null,
+
+
+    /**
+    * @property groupIndex
+    * @description Number indicating the index of the group to which the menu 
+    * item belongs.
+    * @default null
+    * @type Number
+    */
+    groupIndex: null,
+
+
+    /**
+    * @property parent
+    * @description Object reference to the menu item's parent menu.
+    * @default null
+    * @type YAHOO.widget.Menu
+    */
+    parent: null,
+
+
+    /**
+    * @property element
+    * @description Object reference to the menu item's 
+    * <code>&#60;li&#62;</code> element.
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level
+    * -one-html.html#ID-74680021">HTMLLIElement</a>
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-74680021">HTMLLIElement</a>
+    */
+    element: null,
+
+
+    /**
+    * @property srcElement
+    * @description Object reference to the HTML element (either 
+    * <code>&#60;li&#62;</code>, <code>&#60;optgroup&#62;</code> or 
+    * <code>&#60;option&#62;</code>) used create the menu item.
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www.
+    * w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247"
+    * >HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM-
+    * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a>
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www.w3.
+    * org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247">
+    * HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM-
+    * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a>
+    */
+    srcElement: null,
+
+
+    /**
+    * @property value
+    * @description Object reference to the menu item's value.
+    * @default null
+    * @type Object
+    */
+    value: null,
+
+
+    /**
+    * @property submenuIndicator
+    * @description Object reference to the <code>&#60;em&#62;</code> element 
+    * used to create the submenu indicator for the menu item.
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-58190037">HTMLElement</a>
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-58190037">HTMLElement</a>
+    */
+    submenuIndicator: null,
+
+
+       /**
+    * @property browser
+    * @deprecated Use YAHOO.env.ua
+       * @description String representing the browser.
+       * @type String
+       */
+       browser: Module.prototype.browser,
+
+
+    /**
+    * @property id
+    * @description Id of the menu item's root <code>&#60;li&#62;</code> 
+    * element.  This property should be set via the constructor using the 
+    * configuration object literal.  If an id is not specified, then one will 
+    * be created using the "generateId" method of the Dom utility.
+    * @default null
+    * @type String
+    */
+    id: null,
+
+
+
+    // Events
+
+
+    /**
+    * @event destroyEvent
+    * @description Fires when the menu item's <code>&#60;li&#62;</code> 
+    * element is removed from its parent <code>&#60;ul&#62;</code> element.
+    * @type YAHOO.util.CustomEvent
+    */
+    destroyEvent: null,
+
+
+    /**
+    * @event mouseOverEvent
+    * @description Fires when the mouse has entered the menu item.  Passes 
+    * back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    mouseOverEvent: null,
+
+
+    /**
+    * @event mouseOutEvent
+    * @description Fires when the mouse has left the menu item.  Passes back 
+    * the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    mouseOutEvent: null,
+
+
+    /**
+    * @event mouseDownEvent
+    * @description Fires when the user mouses down on the menu item.  Passes 
+    * back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    mouseDownEvent: null,
+
+
+    /**
+    * @event mouseUpEvent
+    * @description Fires when the user releases a mouse button while the mouse 
+    * is over the menu item.  Passes back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    mouseUpEvent: null,
+
+
+    /**
+    * @event clickEvent
+    * @description Fires when the user clicks the on the menu item.  Passes 
+    * back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    clickEvent: null,
+
+
+    /**
+    * @event keyPressEvent
+    * @description Fires when the user presses an alphanumeric key when the 
+    * menu item has focus.  Passes back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    keyPressEvent: null,
+
+
+    /**
+    * @event keyDownEvent
+    * @description Fires when the user presses a key when the menu item has 
+    * focus.  Passes back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    keyDownEvent: null,
+
+
+    /**
+    * @event keyUpEvent
+    * @description Fires when the user releases a key when the menu item has 
+    * focus.  Passes back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    keyUpEvent: null,
+
+
+    /**
+    * @event focusEvent
+    * @description Fires when the menu item receives focus.
+    * @type YAHOO.util.CustomEvent
+    */
+    focusEvent: null,
+
+
+    /**
+    * @event blurEvent
+    * @description Fires when the menu item loses the input focus.
+    * @type YAHOO.util.CustomEvent
+    */
+    blurEvent: null,
+
+
+    /**
+    * @method init
+    * @description The MenuItem class's initialization method. This method is 
+    * automatically called by the constructor, and sets up all DOM references 
+    * for pre-existing markup, and creates required markup if it is not 
+    * already present.
+    * @param {String} p_oObject String specifying the text of the menu item.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying 
+    * the <code>&#60;li&#62;</code> element of the menu item.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+    * specifying the <code>&#60;optgroup&#62;</code> element of the menu item.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object 
+    * specifying the <code>&#60;option&#62;</code> element of the menu item.
+    * @param {Object} p_oConfig Optional. Object literal specifying the 
+    * configuration for the menu item. See configuration class documentation 
+    * for more details.
+    */
+    init: function(p_oObject, p_oConfig) {
+
+
+        if(!this.SUBMENU_TYPE) {
+    
+            this.SUBMENU_TYPE = Menu;
+    
+        }
+
+
+        // Create the config object
+
+        this.cfg = new YAHOO.util.Config(this);
+
+        this.initDefaultConfig();
+
+        var SIGNATURE = CustomEvent.LIST,
+            oConfig = this.cfg,
+            sURL = "#",
+            oAnchor,
+            sTarget,
+            sText,
+            sId;
+
+
+        if(Lang.isString(p_oObject)) {
+
+            this._createRootNodeStructure();
+
+            oConfig.queueProperty("text", p_oObject);
+
+        }
+        else if(p_oObject && p_oObject.tagName) {
+
+            switch(p_oObject.tagName.toUpperCase()) {
+
+                case "OPTION":
+
+                    this._createRootNodeStructure();
+
+                    oConfig.queueProperty("text", p_oObject.text);
+
+                    this.srcElement = p_oObject;
+
+                break;
+
+                case "OPTGROUP":
+
+                    this._createRootNodeStructure();
+
+                    oConfig.queueProperty("text", p_oObject.label);
+
+                    this.srcElement = p_oObject;
+
+                    this._initSubTree();
+
+                break;
+
+                case "LI":
+
+                    // Get the anchor node (if it exists)
+                    
+                    oAnchor = Dom.getFirstChild(p_oObject);
+
+
+                    // Capture the "text" and/or the "URL"
+
+                    if(oAnchor) {
+
+                        sURL = oAnchor.getAttribute("href");
+                        sTarget = oAnchor.getAttribute("target");
+                        sText = oAnchor.innerHTML;
+
+                    }
+
+                    this.srcElement = p_oObject;
+                    this.element = p_oObject;
+                    this._oAnchor = oAnchor;
+
+                    /*
+                        Set these properties silently to sync up the 
+                        configuration object without making changes to the 
+                        element's DOM
+                    */ 
+
+                    oConfig.setProperty("text", sText, true);
+                    oConfig.setProperty("url", sURL, true);
+                    oConfig.setProperty("target", sTarget, true);
+
+                    this._initSubTree();
+
+                break;
+
+            }            
+
+        }
+
+
+        if(this.element) {
+
+            sId = this.element.id;
+
+            if(!sId) {
+
+                sId = this.id || Dom.generateId();
+
+                this.element.id = sId;
+
+            }
+
+            this.id = sId;
+
+
+            Dom.addClass(this.element, this.CSS_CLASS_NAME);
+            Dom.addClass(this._oAnchor, this.CSS_LABEL_CLASS_NAME);
+
+
+            // Create custom events
+
+            this.mouseOverEvent = this.createEvent(EVENT_TYPES.MOUSE_OVER);
+            this.mouseOverEvent.signature = SIGNATURE;
+
+            this.mouseOutEvent = this.createEvent(EVENT_TYPES.MOUSE_OUT);
+            this.mouseOutEvent.signature = SIGNATURE;
+
+            this.mouseDownEvent = this.createEvent(EVENT_TYPES.MOUSE_DOWN);
+            this.mouseDownEvent.signature = SIGNATURE;
+
+            this.mouseUpEvent = this.createEvent(EVENT_TYPES.MOUSE_UP);
+            this.mouseUpEvent.signature = SIGNATURE;
+
+            this.clickEvent = this.createEvent(EVENT_TYPES.CLICK);
+            this.clickEvent.signature = SIGNATURE;
+
+            this.keyPressEvent = this.createEvent(EVENT_TYPES.KEY_PRESS);
+            this.keyPressEvent.signature = SIGNATURE;
+
+            this.keyDownEvent = this.createEvent(EVENT_TYPES.KEY_DOWN);
+            this.keyDownEvent.signature = SIGNATURE;
+
+            this.keyUpEvent = this.createEvent(EVENT_TYPES.KEY_UP);
+            this.keyUpEvent.signature = SIGNATURE;
+
+            this.focusEvent = this.createEvent(EVENT_TYPES.FOCUS);
+            this.focusEvent.signature = SIGNATURE;
+
+            this.blurEvent = this.createEvent(EVENT_TYPES.BLUR);
+            this.blurEvent.signature = SIGNATURE;
+
+            this.destroyEvent = this.createEvent(EVENT_TYPES.DESTROY);
+            this.destroyEvent.signature = SIGNATURE;
+
+            if(p_oConfig) {
+    
+                oConfig.applyConfig(p_oConfig);
+    
+            }        
+
+            oConfig.fireQueue();
+
+        }
+
+    },
+
+
+
+    // Private methods
+
+
+    /**
+    * @method _createRootNodeStructure
+    * @description Creates the core DOM structure for the menu item.
+    * @private
+    */
+    _createRootNodeStructure: function () {
+
+        var oElement,
+            oAnchor;
+
+        if(!m_oMenuItemTemplate) {
+
+            m_oMenuItemTemplate = document.createElement("li");
+            m_oMenuItemTemplate.innerHTML = "<a href=\"#\"></a>";
+
+        }
+
+        oElement = m_oMenuItemTemplate.cloneNode(true);
+        oElement.className = this.CSS_CLASS_NAME;
+
+        oAnchor = oElement.firstChild;
+        oAnchor.className = this.CSS_LABEL_CLASS_NAME;
+        
+        this.element = oElement;
+        this._oAnchor = oAnchor;
+
+    },
+
+
+    /**
+    * @method _initSubTree
+    * @description Iterates the source element's childNodes collection and uses 
+    * the child nodes to instantiate other menus.
+    * @private
+    */
+    _initSubTree: function() {
+
+        var oSrcEl = this.srcElement,
+            oConfig = this.cfg,
+            oNode,
+            aOptions,
+            nOptions,
+            oMenu,
+            n;
+
+
+        if(oSrcEl.childNodes.length > 0) {
+
+            if(this.parent.lazyLoad && this.parent.srcElement && 
+                this.parent.srcElement.tagName.toUpperCase() == "SELECT") {
+
+                oConfig.setProperty(
+                        "submenu", 
+                        { id: Dom.generateId(), itemdata: oSrcEl.childNodes }
+                    );
+
+            }
+            else {
+
+                oNode = oSrcEl.firstChild;
+                aOptions = [];
+    
+                do {
+    
+                    if(oNode && oNode.tagName) {
+    
+                        switch(oNode.tagName.toUpperCase()) {
+                
+                            case "DIV":
+                
+                                oConfig.setProperty("submenu", oNode);
+                
+                            break;
+         
+                            case "OPTION":
+        
+                                aOptions[aOptions.length] = oNode;
+        
+                            break;
+               
+                        }
+                    
+                    }
+                
+                }        
+                while((oNode = oNode.nextSibling));
+    
+    
+                nOptions = aOptions.length;
+    
+                if(nOptions > 0) {
+    
+                    oMenu = new this.SUBMENU_TYPE(Dom.generateId());
+                    
+                    oConfig.setProperty("submenu", oMenu);
+    
+                    for(n=0; n<nOptions; n++) {
+        
+                        oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n])));
+        
+                    }
+        
+                }
+            
+            }
+
+        }
+
+    },
+
+
+
+    // Event handlers for configuration properties
+
+
+    /**
+    * @method configText
+    * @description Event handler for when the "text" configuration property of 
+    * the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */
+    configText: function(p_sType, p_aArgs, p_oItem) {
+
+        var sText = p_aArgs[0],
+            oConfig = this.cfg,
+            oAnchor = this._oAnchor,
+            sHelpText = oConfig.getProperty("helptext"),
+            sHelpTextHTML = "",
+            sCheckHTML = "",
+            oSubmenu = oConfig.getProperty("submenu"),
+            sSubmenuIndicatorHTML = "",
+            sEmphasisStartTag = "",
+            sEmphasisEndTag = "";
+
+
+        if (sText) {
+
+
+            if (sHelpText) {
+                    
+                sHelpTextHTML = "<em class=\"helptext\">" + sHelpText + "</em>";
+            
+            }
+
+
+            if (oConfig.getProperty("checked")) {
+
+                sCheckHTML = "<em class=\"checkedindicator\">" + 
+                    this.CHECKED_TEXT + "</em>";
+            
+            }
+            
+            
+            if (oSubmenu) {
+
+                sSubmenuIndicatorHTML =  "<em class=\"submenuindicator\">" + 
+                    ((oSubmenu instanceof Menu && 
+                    oSubmenu.cfg.getProperty("visible")) ? 
+                    this.EXPANDED_SUBMENU_INDICATOR_TEXT : 
+                    this.COLLAPSED_SUBMENU_INDICATOR_TEXT) + "</em>";
+            
+            }
+            
+
+            if (oConfig.getProperty("emphasis")) {
+
+                sEmphasisStartTag = "<em>";
+                sEmphasisEndTag = "</em>";
+
+            }
+
+
+            if (oConfig.getProperty("strongemphasis")) {
+
+                sEmphasisStartTag = "<strong>";
+                sEmphasisEndTag = "</strong>";
+            
+            }
+
+
+            oAnchor.innerHTML = (sEmphasisStartTag + sText + 
+                sEmphasisEndTag + sHelpTextHTML + 
+                sCheckHTML + sSubmenuIndicatorHTML);
+
+
+            if (oSubmenu) {
+
+                this.submenuIndicator = oAnchor.lastChild;
+            
+            }
+
+        }
+
+    },
+
+
+    /**
+    * @method configHelpText
+    * @description Event handler for when the "helptext" configuration property 
+    * of the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configHelpText: function(p_sType, p_aArgs, p_oItem) {
+
+        var sHelpText = p_aArgs[0],
+            oAnchor = this._oAnchor;
+
+        if (sHelpText) {
+
+            Dom.addClass(oAnchor, "hashelptext");
+
+        }
+        else {
+
+            Dom.removeClass(oAnchor, "hashelptext");
+        
+        }
+
+        this.cfg.refireEvent("text");
+
+    },
+
+
+    /**
+    * @method configURL
+    * @description Event handler for when the "url" configuration property of 
+    * the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configURL: function(p_sType, p_aArgs, p_oItem) {
+
+        var sURL = p_aArgs[0];
+
+        if(!sURL) {
+
+            sURL = "#";
+
+        }
+
+        this._oAnchor.setAttribute("href", sURL);
+
+    },
+
+
+    /**
+    * @method configTarget
+    * @description Event handler for when the "target" configuration property 
+    * of the menu item changes.  
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configTarget: function(p_sType, p_aArgs, p_oItem) {
+
+        var sTarget = p_aArgs[0],
+            oAnchor = this._oAnchor;
+
+        if(sTarget && sTarget.length > 0) {
+
+            oAnchor.setAttribute("target", sTarget);
+
+        }
+        else {
+
+            oAnchor.removeAttribute("target");
+        
+        }
+
+    },
+
+
+    /**
+    * @method configEmphasis
+    * @description Event handler for when the "emphasis" configuration property
+    * of the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configEmphasis: function(p_sType, p_aArgs, p_oItem) {
+
+        var bEmphasis = p_aArgs[0],
+            oConfig = this.cfg;
+
+
+        if(bEmphasis && oConfig.getProperty("strongemphasis")) {
+
+            oConfig.setProperty("strongemphasis", false);
+
+        }
+
+
+        oConfig.refireEvent("text");
+
+    },
+
+
+    /**
+    * @method configStrongEmphasis
+    * @description Event handler for when the "strongemphasis" configuration 
+    * property of the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configStrongEmphasis: function(p_sType, p_aArgs, p_oItem) {
+
+        var bStrongEmphasis = p_aArgs[0],
+            oConfig = this.cfg;
+
+
+        if(bStrongEmphasis && oConfig.getProperty("emphasis")) {
+
+            oConfig.setProperty("emphasis", false);
+
+        }
+
+        oConfig.refireEvent("text");
+
+    },
+
+
+    /**
+    * @method configChecked
+    * @description Event handler for when the "checked" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configChecked: function(p_sType, p_aArgs, p_oItem) {
+
+        var bChecked = p_aArgs[0],
+            oAnchor = this._oAnchor;
+
+        if (bChecked) {
+
+            Dom.addClass(oAnchor, "checked");
+
+        }
+        else {
+
+            Dom.removeClass(oAnchor, "checked");
+        
+        }
+
+        this.cfg.refireEvent("text");
+
+    },
+
+
+
+    /**
+    * @method configDisabled
+    * @description Event handler for when the "disabled" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configDisabled: function(p_sType, p_aArgs, p_oItem) {
+
+        var bDisabled = p_aArgs[0],
+            oConfig = this.cfg,
+            oAnchor = this._oAnchor;
+
+
+        if(bDisabled) {
+
+            if(oConfig.getProperty("selected")) {
+
+                oConfig.setProperty("selected", false);
+
+            }
+
+            oAnchor.removeAttribute("href");
+
+            Dom.addClass(oAnchor, "disabled");
+
+        }
+        else {
+
+            oAnchor.setAttribute("href", oConfig.getProperty("url"));
+
+            Dom.removeClass(oAnchor, "disabled");
+
+        }
+
+    },
+
+
+    /**
+    * @method configSelected
+    * @description Event handler for when the "selected" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configSelected: function(p_sType, p_aArgs, p_oItem) {
+
+        var bSelected,
+            oAnchor;
+
+        if(!this.cfg.getProperty("disabled")) {
+
+            bSelected = p_aArgs[0];
+            oAnchor = this._oAnchor;
+
+
+            if(bSelected) {
+    
+                Dom.addClass(oAnchor, "selected");
+    
+            }
+            else {
+    
+                Dom.removeClass(oAnchor, "selected");
+    
+            }
+
+        }
+
+    },
+
+
+    /**
+    * @method configSubmenu
+    * @description Event handler for when the "submenu" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */
+    configSubmenu: function(p_sType, p_aArgs, p_oItem) {
+
+        var oAnchor = this._oAnchor,
+            oSubmenu = p_aArgs[0],
+            oSubmenuIndicator = this.submenuIndicator,
+            oConfig = this.cfg,
+            bLazyLoad = this.parent && this.parent.lazyLoad,
+            oMenu,
+            sSubmenuId,
+            oSubmenuConfig;
+
+
+        if(oSubmenu) {
+
+            if(oSubmenu instanceof Menu) {
+
+                oMenu = oSubmenu;
+                oMenu.parent = this;
+                oMenu.lazyLoad = bLazyLoad;
+
+            }
+            else if(typeof oSubmenu == "object" && oSubmenu.id && 
+                !oSubmenu.nodeType) {
+
+                sSubmenuId = oSubmenu.id;
+                oSubmenuConfig = oSubmenu;
+
+                oSubmenuConfig.lazyload = bLazyLoad;
+                oSubmenuConfig.parent = this;
+
+                oMenu = new this.SUBMENU_TYPE(sSubmenuId, oSubmenuConfig);
+
+
+                // Set the value of the property to the Menu instance
+
+                this.cfg.setProperty("submenu", oMenu, true);
+
+            }
+            else {
+
+                oMenu = new this.SUBMENU_TYPE(oSubmenu,
+                                { lazyload: bLazyLoad, parent: this });
+
+
+                // Set the value of the property to the Menu instance
+                
+                this.cfg.setProperty("submenu", oMenu, true);
+
+            }
+
+
+            if(oMenu) {
+
+                Dom.addClass(oAnchor, "hassubmenu");
+
+                this._oSubmenu = oMenu;
+            
+            }
+
+        }
+        else {
+
+            Dom.removeClass(oAnchor, "hassubmenu");
+
+            if(oSubmenuIndicator) {
+
+                oAnchor.removeChild(oSubmenuIndicator);
+
+            }
+
+            if(this._oSubmenu) {
+
+                this._oSubmenu.destroy();
+
+            }
+
+        }
+        
+        oConfig.refireEvent("text");
+
+    },
+
+
+    /**
+    * @method configOnClick
+    * @description Event handler for when the "onclick" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */
+    configOnClick: function(p_sType, p_aArgs, p_oItem) {
+
+        var oObject = p_aArgs[0];
+
+        /*
+            Remove any existing listeners if a "click" event handler has 
+            already been specified.
+        */
+
+        if(this._oOnclickAttributeValue && 
+            (this._oOnclickAttributeValue != oObject)) {
+
+            this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn, 
+                                this._oOnclickAttributeValue.obj);
+
+            this._oOnclickAttributeValue = null;
+
+        }
+
+
+        if(!this._oOnclickAttributeValue && typeof oObject == "object" && 
+            typeof oObject.fn == "function") {
+            
+            this.clickEvent.subscribe(oObject.fn, 
+                ((!YAHOO.lang.isUndefined(oObject.obj)) ? oObject.obj : this), 
+                oObject.scope);
+
+            this._oOnclickAttributeValue = oObject;
+
+        }
+    
+    },
+
+
+    /**
+    * @method configClassName
+    * @description Event handler for when the "classname" configuration 
+    * property of a menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */
+    configClassName: function(p_sType, p_aArgs, p_oItem) {
+    
+        var sClassName = p_aArgs[0];
+    
+        if(this._sClassName) {
+    
+            Dom.removeClass(this.element, this._sClassName);
+    
+        }
+    
+        Dom.addClass(this.element, sClassName);
+        this._sClassName = sClassName;
+    
+    },
+
+
+
+    // Public methods
+
+
+       /**
+    * @method initDefaultConfig
+       * @description Initializes an item's configurable properties.
+       */
+       initDefaultConfig : function() {
+
+        var oConfig = this.cfg;
+
+
+        // Define the configuration attributes
+
+        /**
+        * @config text
+        * @description String specifying the text label for the menu item.  
+        * When building a menu from existing HTML the value of this property
+        * will be interpreted from the menu's markup.
+        * @default ""
+        * @type String
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.TEXT.key, 
+            { 
+                handler: this.configText, 
+                value: DEFAULT_CONFIG.TEXT.value, 
+                validator: DEFAULT_CONFIG.TEXT.validator, 
+                suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent 
+            }
+        );
+        
+
+        /**
+        * @config helptext
+        * @description String specifying additional instructional text to 
+        * accompany the text for the menu item.
+        * @deprecated Use "text" configuration property to add help text markup.  
+        * For example: <code>oMenuItem.cfg.setProperty("text", "Copy &#60;em 
+        * class=\"helptext\"&#62;Ctrl + C&#60;/em&#60;");</code>
+        * @default null
+        * @type String|<a href="http://www.w3.org/TR/
+        * 2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037">
+        * HTMLElement</a>
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.HELP_TEXT.key,
+            { handler: this.configHelpText }
+        );
+
+
+        /**
+        * @config url
+        * @description String specifying the URL for the menu item's anchor's 
+        * "href" attribute.  When building a menu from existing HTML the value 
+        * of this property will be interpreted from the menu's markup.
+        * @default "#"
+        * @type String
+        */        
+        oConfig.addProperty(
+            DEFAULT_CONFIG.URL.key, 
+            {
+                handler: this.configURL, 
+                value: DEFAULT_CONFIG.URL.value, 
+                suppressEvent: DEFAULT_CONFIG.URL.suppressEvent
+            }
+        );
+
+
+        /**
+        * @config target
+        * @description String specifying the value for the "target" attribute 
+        * of the menu item's anchor element. <strong>Specifying a target will 
+        * require the user to click directly on the menu item's anchor node in
+        * order to cause the browser to navigate to the specified URL.</strong> 
+        * When building a menu from existing HTML the value of this property 
+        * will be interpreted from the menu's markup.
+        * @default null
+        * @type String
+        */        
+        oConfig.addProperty(
+            DEFAULT_CONFIG.TARGET.key, 
+            {
+                handler: this.configTarget, 
+                suppressEvent: DEFAULT_CONFIG.TARGET.suppressEvent
+            }
+        );
+
+
+        /**
+        * @config emphasis
+        * @description Boolean indicating if the text of the menu item will be 
+        * rendered with emphasis.
+        * @deprecated Use "text" configuration property to add emphasis.  
+        * For example: <code>oMenuItem.cfg.setProperty("text", "&#60;em&#62;Some 
+        * Text&#60;/em&#60;");</code>
+        * @default false
+        * @type Boolean
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.EMPHASIS.key, 
+            { 
+                handler: this.configEmphasis, 
+                value: DEFAULT_CONFIG.EMPHASIS.value, 
+                validator: DEFAULT_CONFIG.EMPHASIS.validator, 
+                suppressEvent: DEFAULT_CONFIG.EMPHASIS.suppressEvent 
+            }
+        );
+
+
+        /**
+        * @config strongemphasis
+        * @description Boolean indicating if the text of the menu item will be 
+        * rendered with strong emphasis.
+        * @deprecated Use "text" configuration property to add strong emphasis.  
+        * For example: <code>oMenuItem.cfg.setProperty("text", "&#60;strong&#62; 
+        * Some Text&#60;/strong&#60;");</code>
+        * @default false
+        * @type Boolean
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.STRONG_EMPHASIS.key,
+            {
+                handler: this.configStrongEmphasis,
+                value: DEFAULT_CONFIG.STRONG_EMPHASIS.value,
+                validator: DEFAULT_CONFIG.STRONG_EMPHASIS.validator,
+                suppressEvent: DEFAULT_CONFIG.STRONG_EMPHASIS.suppressEvent
+            }
+        );
+
+
+        /**
+        * @config checked
+        * @description Boolean indicating if the menu item should be rendered 
+        * with a checkmark.
+        * @default false
+        * @type Boolean
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.CHECKED.key, 
+            {
+                handler: this.configChecked, 
+                value: DEFAULT_CONFIG.CHECKED.value, 
+                validator: DEFAULT_CONFIG.CHECKED.validator, 
+                suppressEvent: DEFAULT_CONFIG.CHECKED.suppressEvent,
+                supercedes: DEFAULT_CONFIG.CHECKED.supercedes
+            } 
+        );
+
+
+        /**
+        * @config disabled
+        * @description Boolean indicating if the menu item should be disabled.  
+        * (Disabled menu items are  dimmed and will not respond to user input 
+        * or fire events.)
+        * @default false
+        * @type Boolean
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.DISABLED.key,
+            {
+                handler: this.configDisabled,
+                value: DEFAULT_CONFIG.DISABLED.value,
+                validator: DEFAULT_CONFIG.DISABLED.validator,
+                suppressEvent: DEFAULT_CONFIG.DISABLED.suppressEvent
+            }
+        );
+
+
+        /**
+        * @config selected
+        * @description Boolean indicating if the menu item should 
+        * be highlighted.
+        * @default false
+        * @type Boolean
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.SELECTED.key,
+            {
+                handler: this.configSelected,
+                value: DEFAULT_CONFIG.SELECTED.value,
+                validator: DEFAULT_CONFIG.SELECTED.validator,
+                suppressEvent: DEFAULT_CONFIG.SELECTED.suppressEvent
+            }
+        );
+
+
+        /**
+        * @config submenu
+        * @description Object specifying the submenu to be appended to the 
+        * menu item.  The value can be one of the following: <ul><li>Object 
+        * specifying a Menu instance.</li><li>Object literal specifying the
+        * menu to be created.  Format: <code>{ id: [menu id], itemdata: 
+        * [<a href="YAHOO.widget.Menu.html#itemData">array of values for 
+        * items</a>] }</code>.</li><li>String specifying the id attribute 
+        * of the <code>&#60;div&#62;</code> element of the menu.</li><li>
+        * Object specifying the <code>&#60;div&#62;</code> element of the 
+        * menu.</li></ul>
+        * @default null
+        * @type Menu|String|Object|<a href="http://www.w3.org/TR/2000/
+        * WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037">
+        * HTMLElement</a>
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.SUBMENU.key, 
+            { handler: this.configSubmenu }
+        );
+
+
+        /**
+        * @config onclick
+        * @description Object literal representing the code to be executed when 
+        * the item is clicked.  Format:<br> <code> {<br> 
+        * <strong>fn:</strong> Function,   &#47;&#47; The handler to call when 
+        * the event fires.<br> <strong>obj:</strong> Object, &#47;&#47; An 
+        * object to  pass back to the handler.<br> <strong>scope:</strong> 
+        * Object &#47;&#47; The object to use for the scope of the handler.
+        * <br> } </code>
+        * @type Object
+        * @default null
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.ONCLICK.key, 
+            { handler: this.configOnClick }
+        );
+
+
+        /**
+        * @config classname
+        * @description CSS class to be applied to the menu item's root 
+        * <code>&#60;li&#62;</code> element.  The specified class(es) are 
+        * appended in addition to the default class as specified by the menu 
+        * item's CSS_CLASS_NAME constant.
+        * @default null
+        * @type String
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.CLASS_NAME.key, 
+            { 
+                handler: this.configClassName,
+                value: DEFAULT_CONFIG.CLASS_NAME.value, 
+                validator: DEFAULT_CONFIG.CLASS_NAME.validator
+            }
+        );
+
+       },
+
+
+    /**
+    * @method getNextEnabledSibling
+    * @description Finds the menu item's next enabled sibling.
+    * @return YAHOO.widget.MenuItem
+    */
+    getNextEnabledSibling: function() {
+
+        var nGroupIndex,
+            aItemGroups,
+            oNextItem,
+            nNextGroupIndex,
+            aNextGroup;
+
+        function getNextArrayItem(p_aArray, p_nStartIndex) {
+
+            return p_aArray[p_nStartIndex] || 
+                getNextArrayItem(p_aArray, (p_nStartIndex+1));
+
+        }
+
+        if(this.parent instanceof Menu) {
+
+            nGroupIndex = this.groupIndex;
+    
+            aItemGroups = this.parent.getItemGroups();
+    
+            if(this.index < (aItemGroups[nGroupIndex].length - 1)) {
+    
+                oNextItem = getNextArrayItem(aItemGroups[nGroupIndex], 
+                        (this.index+1));
+    
+            }
+            else {
+    
+                if(nGroupIndex < (aItemGroups.length - 1)) {
+    
+                    nNextGroupIndex = nGroupIndex + 1;
+    
+                }
+                else {
+    
+                    nNextGroupIndex = 0;
+    
+                }
+    
+                aNextGroup = getNextArrayItem(aItemGroups, nNextGroupIndex);
+    
+                // Retrieve the first menu item in the next group
+    
+                oNextItem = getNextArrayItem(aNextGroup, 0);
+    
+            }
+    
+            return (oNextItem.cfg.getProperty("disabled") || 
+                oNextItem.element.style.display == "none") ? 
+                oNextItem.getNextEnabledSibling() : oNextItem;
+
+        }
+
+    },
+
+
+    /**
+    * @method getPreviousEnabledSibling
+    * @description Finds the menu item's previous enabled sibling.
+    * @return {YAHOO.widget.MenuItem}
+    */
+    getPreviousEnabledSibling: function() {
+
+        var nGroupIndex,
+            aItemGroups,
+            oPreviousItem,
+            nPreviousGroupIndex,
+            aPreviousGroup;
+
+        function getPreviousArrayItem(p_aArray, p_nStartIndex) {
+
+            return p_aArray[p_nStartIndex] ||  
+                getPreviousArrayItem(p_aArray, (p_nStartIndex-1));
+
+        }
+
+        function getFirstItemIndex(p_aArray, p_nStartIndex) {
+
+            return p_aArray[p_nStartIndex] ? p_nStartIndex : 
+                getFirstItemIndex(p_aArray, (p_nStartIndex+1));
+
+        }
+
+       if(this.parent instanceof Menu) {
+
+            nGroupIndex = this.groupIndex;
+            aItemGroups = this.parent.getItemGroups();
+
+    
+            if(this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)) {
+    
+                oPreviousItem = getPreviousArrayItem(aItemGroups[nGroupIndex], 
+                        (this.index-1));
+    
+            }
+            else {
+    
+                if(nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {
+    
+                    nPreviousGroupIndex = nGroupIndex - 1;
+    
+                }
+                else {
+    
+                    nPreviousGroupIndex = aItemGroups.length - 1;
+    
+                }
+    
+                aPreviousGroup = getPreviousArrayItem(aItemGroups, 
+                    nPreviousGroupIndex);
+    
+                oPreviousItem = getPreviousArrayItem(aPreviousGroup, 
+                        (aPreviousGroup.length - 1));
+    
+            }
+
+            return (oPreviousItem.cfg.getProperty("disabled") || 
+                oPreviousItem.element.style.display == "none") ? 
+                oPreviousItem.getPreviousEnabledSibling() : oPreviousItem;
+
+        }
+
+    },
+
+
+    /**
+    * @method focus
+    * @description Causes the menu item to receive the focus and fires the 
+    * focus event.
+    */
+    focus: function() {
+
+        var oParent = this.parent,
+            oAnchor = this._oAnchor,
+            oActiveItem = oParent.activeItem,
+            me = this;
+
+
+        function setFocus() {
+
+            try {
+
+                if (YAHOO.env.ua.ie && !document.hasFocus()) {
+                
+                    return;
+                
+                }
+
+                oAnchor.focus();
+
+            }
+            catch(e) {
+            
+            }
+
+        }
+
+
+        if(!this.cfg.getProperty("disabled") && oParent && 
+            oParent.cfg.getProperty("visible") && 
+            this.element.style.display != "none") {
+
+            if(oActiveItem) {
+
+                oActiveItem.blur();
+
+            }
+
+
+            /*
+                Setting focus via a timer fixes a race condition in Firefox, IE 
+                and Opera where the browser viewport jumps as it trys to 
+                position and focus the menu.
+            */
+
+            window.setTimeout(setFocus, 0);
+            
+            this.focusEvent.fire();
+
+        }
+
+    },
+
+
+    /**
+    * @method blur
+    * @description Causes the menu item to lose focus and fires the 
+    * blur event.
+    */    
+    blur: function() {
+
+        var oParent = this.parent;
+
+        if(!this.cfg.getProperty("disabled") && oParent && 
+            oParent.cfg.getProperty("visible")) {
+
+            this._oAnchor.blur();
+
+            this.blurEvent.fire();
+
+        }
+
+    },
+
+
+    /**
+    * @method hasFocus
+    * @description Returns a boolean indicating whether or not the menu item
+    * has focus.
+    * @return {Boolean}
+    */
+    hasFocus: function() {
+    
+        return (YAHOO.widget.MenuManager.getFocusedMenuItem() == this);
+    
+    },
+
+
+       /**
+    * @method destroy
+       * @description Removes the menu item's <code>&#60;li&#62;</code> element 
+       * from its parent <code>&#60;ul&#62;</code> element.
+       */
+    destroy: function() {
+
+        var oEl = this.element,
+            oSubmenu,
+            oParentNode;
+
+        if(oEl) {
+
+
+            // If the item has a submenu, destroy it first
+
+            oSubmenu = this.cfg.getProperty("submenu");
+
+            if(oSubmenu) {
+            
+                oSubmenu.destroy();
+            
+            }
+
+
+            // Remove CustomEvent listeners
+    
+            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();
+
+
+            // Remove the element from the parent node
+
+            oParentNode = oEl.parentNode;
+
+            if(oParentNode) {
+
+                oParentNode.removeChild(oEl);
+
+                this.destroyEvent.fire();
+
+            }
+
+            this.destroyEvent.unsubscribeAll();
+
+        }
+
+    },
+
+
+    /**
+    * @method toString
+    * @description Returns a string representing the menu item.
+    * @return {String}
+    */
+    toString: function() {
+
+        var sReturnVal = "MenuItem",
+            sId = this.id;
+
+        if(sId) {
+    
+            sReturnVal += (" " + sId);
+        
+        }
+
+        return sReturnVal;
+    
+    }
+
+};
+
+Lang.augmentProto(MenuItem, YAHOO.util.EventProvider);
+
+})();
+(function () {
+
+
+/**
+* Creates a list of options or commands which are made visible in response to 
+* an HTML element's "contextmenu" event ("mousedown" for Opera).
+*
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the context menu.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source for the 
+* context menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-
+* html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying the 
+* <code>&#60;div&#62;</code> element of the context menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-
+* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying 
+* the <code>&#60;select&#62;</code> element to be used as the data source for 
+* the context menu.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the context menu. See configuration class documentation 
+* for more details.
+* @class ContextMenu
+* @constructor
+* @extends YAHOO.widget.Menu
+* @namespace YAHOO.widget
+*/
+YAHOO.widget.ContextMenu = function(p_oElement, p_oConfig) {
+
+    YAHOO.widget.ContextMenu.superclass.constructor.call(this, 
+            p_oElement, p_oConfig);
+
+};
+
+var Event = YAHOO.util.Event,
+    ContextMenu = YAHOO.widget.ContextMenu,
+
+/**
+* Constant representing the name of the ContextMenu's events
+* @property EVENT_TYPES
+* @private
+* @final
+* @type Object
+*/
+    EVENT_TYPES = {
+
+        "TRIGGER_CONTEXT_MENU": "triggerContextMenu",
+        "CONTEXT_MENU": (YAHOO.env.ua.opera ? "mousedown" : "contextmenu"),
+        "CLICK": "click"
+
+    },
+    
+    
+    /**
+    * Constant representing the ContextMenu's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
+    * @final
+    * @type Object
+    */
+    DEFAULT_CONFIG = {
+    
+        "TRIGGER": { 
+            key: "trigger" 
+        }
+    
+    };
+
+
+YAHOO.lang.extend(ContextMenu, YAHOO.widget.Menu, {
+
+
+
+// Private properties
+
+
+/**
+* @property _oTrigger
+* @description Object reference to the current value of the "trigger" 
+* configuration property.
+* @default null
+* @private
+* @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/leve
+* l-one-html.html#ID-58190037">HTMLElement</a>|Array
+*/
+_oTrigger: null,
+
+
+/**
+* @property _bCancelled
+* @description Boolean indicating if the display of the context menu should 
+* be cancelled.
+* @default false
+* @private
+* @type Boolean
+*/
+_bCancelled: false,
+
+
+
+// Public properties
+
+
+/**
+* @property contextEventTarget
+* @description Object reference for the HTML element that was the target of the
+* "contextmenu" DOM event ("mousedown" for Opera) that triggered the display of 
+* the context menu.
+* @default null
+* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-
+* html.html#ID-58190037">HTMLElement</a>
+*/
+contextEventTarget: null,
+
+
+
+// Events
+
+
+/**
+* @event triggerContextMenuEvent
+* @description Custom Event wrapper for the "contextmenu" DOM event 
+* ("mousedown" for Opera) fired by the element(s) that trigger the display of 
+* the context menu.
+*/
+triggerContextMenuEvent: null,
+
+
+
+/**
+* @method init
+* @description The ContextMenu class's initialization method. This method is 
+* automatically called by the constructor, and sets up all DOM references for 
+* pre-existing markup, and creates required markup if it is not already present.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the context menu.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source for 
+* the context menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-
+* html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying the 
+* <code>&#60;div&#62;</code> element of the context menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-
+* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying 
+* the <code>&#60;select&#62;</code> element to be used as the data source for 
+* the context menu.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the context menu. See configuration class documentation 
+* for more details.
+*/
+init: function(p_oElement, p_oConfig) {
+
+    if(!this.ITEM_TYPE) {
+
+        this.ITEM_TYPE = YAHOO.widget.ContextMenuItem;
+
+    }
+
+
+    // Call the init of the superclass (YAHOO.widget.Menu)
+
+    ContextMenu.superclass.init.call(this, p_oElement);
+
+
+    this.beforeInitEvent.fire(ContextMenu);
+
+
+    if(p_oConfig) {
+
+        this.cfg.applyConfig(p_oConfig, true);
+
+    }
+    
+    
+    this.initEvent.fire(ContextMenu);
+    
+},
+
+
+/**
+* @method initEvents
+* @description Initializes the custom events for the context menu.
+*/
+initEvents: function() {
+
+       ContextMenu.superclass.initEvents.call(this);
+
+    // Create custom events
+
+    this.triggerContextMenuEvent = 
+        this.createEvent(EVENT_TYPES.TRIGGER_CONTEXT_MENU);
+
+    this.triggerContextMenuEvent.signature = YAHOO.util.CustomEvent.LIST;
+
+},
+
+
+/**
+* @method cancel
+* @description Cancels the display of the context menu.
+*/
+cancel: function() {
+
+    this._bCancelled = true;
+
+},
+
+
+
+// Private methods
+
+
+/**
+* @method _removeEventHandlers
+* @description Removes all of the DOM event handlers from the HTML element(s) 
+* whose "context menu" event ("click" for Opera) trigger the display of 
+* the context menu.
+* @private
+*/
+_removeEventHandlers: function() {
+
+    var oTrigger = this._oTrigger;
+
+
+    // Remove the event handlers from the trigger(s)
+
+    if (oTrigger) {
+
+        Event.removeListener(oTrigger, EVENT_TYPES.CONTEXT_MENU, 
+            this._onTriggerContextMenu);    
+        
+        if(YAHOO.env.ua.opera) {
+        
+            Event.removeListener(oTrigger, EVENT_TYPES.CLICK, 
+                this._onTriggerClick);
+    
+        }
+
+    }
+
+},
+
+
+
+// Private event handlers
+
+
+/**
+* @method _onTriggerClick
+* @description "click" event handler for the HTML element(s) identified as the 
+* "trigger" for the context menu.  Used to cancel default behaviors in Opera.
+* @private
+* @param {Event} p_oEvent Object representing the DOM event object passed back 
+* by the event utility (YAHOO.util.Event).
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context 
+* menu that is handling the event.
+*/
+_onTriggerClick: function(p_oEvent, p_oMenu) {
+
+    if(p_oEvent.ctrlKey) {
+    
+        Event.stopEvent(p_oEvent);
+
+    }
+    
+},
+
+
+/**
+* @method _onTriggerContextMenu
+* @description "contextmenu" event handler ("mousedown" for Opera) for the HTML 
+* element(s) that trigger the display of the context menu.
+* @private
+* @param {Event} p_oEvent Object representing the DOM event object passed back 
+* by the event utility (YAHOO.util.Event).
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context 
+* menu that is handling the event.
+*/
+_onTriggerContextMenu: function(p_oEvent, p_oMenu) {
+
+    if(p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {
+
+        return;
+
+    }
+
+
+    /*
+        Prevent the browser's default context menu from appearing and 
+        stop the propagation of the "contextmenu" event so that 
+        other ContextMenu instances are not displayed.
+    */
+
+    Event.stopEvent(p_oEvent);
+
+
+    // Hide any other ContextMenu instances that might be visible
+
+    YAHOO.widget.MenuManager.hideVisible();
+
+
+    this.contextEventTarget = Event.getTarget(p_oEvent);
+
+    this.triggerContextMenuEvent.fire(p_oEvent);
+
+
+    if(!this._bCancelled) {
+
+        // Position and display the context menu
+    
+        this.cfg.setProperty("xy", Event.getXY(p_oEvent));
+
+        this.show();
+
+    }
+
+    this._bCancelled = false;
+
+},
+
+
+
+// Public methods
+
+
+/**
+* @method toString
+* @description Returns a string representing the context menu.
+* @return {String}
+*/
+toString: function() {
+
+    var sReturnVal = "ContextMenu",
+        sId = this.id;
+
+    if(sId) {
+
+        sReturnVal += (" " + sId);
+    
+    }
+
+    return sReturnVal;
+
+},
+
+
+/**
+* @method initDefaultConfig
+* @description Initializes the class's configurable properties which can be 
+* changed using the context menu's Config object ("cfg").
+*/
+initDefaultConfig: function() {
+
+    ContextMenu.superclass.initDefaultConfig.call(this);
+
+    /**
+    * @config trigger
+    * @description The HTML element(s) whose "contextmenu" event ("mousedown" 
+    * for Opera) trigger the display of the context menu.  Can be a string 
+    * representing the id attribute of the HTML element, an object reference 
+    * for the HTML element, or an array of strings or HTML element references.
+    * @default null
+    * @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-58190037">HTMLElement</a>|Array
+    */
+    this.cfg.addProperty(DEFAULT_CONFIG.TRIGGER.key, 
+        { handler: this.configTrigger });
+
+},
+
+
+/**
+* @method destroy
+* @description Removes the context menu's <code>&#60;div&#62;</code> element 
+* (and accompanying child nodes) from the document.
+*/
+destroy: function() {
+
+    // Remove the DOM event handlers from the current trigger(s)
+
+    this._removeEventHandlers();
+    
+
+    // Continue with the superclass implementation of this method
+
+    ContextMenu.superclass.destroy.call(this);
+
+},
+
+
+
+// Public event handlers for configuration properties
+
+
+/**
+* @method configTrigger
+* @description Event handler for when the value of the "trigger" configuration 
+* property changes. 
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context 
+* menu that fired the event.
+*/
+configTrigger: function(p_sType, p_aArgs, p_oMenu) {
+    
+    var oTrigger = p_aArgs[0];
+
+    if(oTrigger) {
+
+        /*
+            If there is a current "trigger" - remove the event handlers 
+            from that element(s) before assigning new ones
+        */
+
+        if(this._oTrigger) {
+        
+            this._removeEventHandlers();
+
+        }
+
+        this._oTrigger = oTrigger;
+
+
+        /*
+            Listen for the "mousedown" event in Opera b/c it does not 
+            support the "contextmenu" event
+        */ 
+  
+        Event.on(oTrigger, EVENT_TYPES.CONTEXT_MENU, 
+            this._onTriggerContextMenu, this, true);
+
+
+        /*
+            Assign a "click" event handler to the trigger element(s) for
+            Opera to prevent default browser behaviors.
+        */
+
+        if(YAHOO.env.ua.opera) {
+        
+            Event.on(oTrigger, EVENT_TYPES.CLICK, this._onTriggerClick, 
+                this, true);
+
+        }
+
+    }
+    else {
+   
+        this._removeEventHandlers();
+    
+    }
+    
+}
+
+}); // END YAHOO.lang.extend
+
+}());
+
+
+
+/**
+* Creates an item for a context menu.
+* 
+* @param {String} p_oObject String specifying the text of the context menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the 
+* <code>&#60;li&#62;</code> element of the context menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+* specifying the <code>&#60;optgroup&#62;</code> element of the context 
+* menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying 
+* the <code>&#60;option&#62;</code> element of the context menu item.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the context menu item. See configuration class 
+* documentation for more details.
+* @class ContextMenuItem
+* @constructor
+* @extends YAHOO.widget.MenuItem
+*/
+YAHOO.widget.ContextMenuItem = function(p_oObject, p_oConfig) {
+
+    YAHOO.widget.ContextMenuItem.superclass.constructor.call(this, 
+        p_oObject, p_oConfig);
+
+};
+
+YAHOO.lang.extend(YAHOO.widget.ContextMenuItem, YAHOO.widget.MenuItem, {
+
+
+/**
+* @method init
+* @description The ContextMenuItem class's initialization method. This method 
+* is automatically called by the constructor, and sets up all DOM references 
+* for pre-existing markup, and creates required markup if it is not 
+* already present.
+* @param {String} p_oObject String specifying the text of the context menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the 
+* <code>&#60;li&#62;</code> element of the context menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+* specifying the <code>&#60;optgroup&#62;</code> element of the context 
+* menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying 
+* the <code>&#60;option&#62;</code> element of the context menu item.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the context menu item. See configuration class 
+* documentation for more details.
+*/
+init: function(p_oObject, p_oConfig) {
+    
+    if(!this.SUBMENU_TYPE) {
+
+        this.SUBMENU_TYPE = YAHOO.widget.ContextMenu;
+
+    }
+
+
+    /* 
+        Call the init of the superclass (YAHOO.widget.MenuItem)
+        Note: We don't pass the user config in here yet 
+        because we only want it executed once, at the lowest 
+        subclass level.
+    */ 
+
+    YAHOO.widget.ContextMenuItem.superclass.init.call(this, p_oObject);
+
+    var oConfig = this.cfg;
+
+    if(p_oConfig) {
+
+        oConfig.applyConfig(p_oConfig, true);
+
+    }
+
+    oConfig.fireQueue();
+
+},
+
+
+
+// Public methods
+
+
+/**
+* @method toString
+* @description Returns a string representing the context menu item.
+* @return {String}
+*/
+toString: function() {
+
+    var sReturnVal = "ContextMenuItem";
+
+    if(this.cfg && this.cfg.getProperty("text")) {
+
+        sReturnVal += (": " + this.cfg.getProperty("text"));
+
+    }
+
+    return sReturnVal;
+
+}
+    
+}); // END YAHOO.lang.extend
+(function () {
+
+
+/**
+* Horizontal collection of items, each of which can contain a submenu.
+* 
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the menu bar.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source for the 
+* menu bar.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying 
+* the <code>&#60;div&#62;</code> element of the menu bar.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object 
+* specifying the <code>&#60;select&#62;</code> element to be used as the data 
+* source for the menu bar.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu bar. See configuration class documentation for
+* more details.
+* @class MenuBar
+* @constructor
+* @extends YAHOO.widget.Menu
+* @namespace YAHOO.widget
+*/
+YAHOO.widget.MenuBar = function(p_oElement, p_oConfig) {
+
+    YAHOO.widget.MenuBar.superclass.constructor.call(this, 
+        p_oElement, p_oConfig);
+
+};
+
+
+/**
+* @method checkPosition
+* @description Checks to make sure that the value of the "position" property 
+* is one of the supported strings. Returns true if the position is supported.
+* @private
+* @param {Object} p_sPosition String specifying the position of the menu.
+* @return {Boolean}
+*/
+function checkPosition(p_sPosition) {
+
+    if (typeof p_sPosition == "string") {
+
+        return ("dynamic,static".indexOf((p_sPosition.toLowerCase())) != -1);
+
+    }
+
+}
+
+
+var Event = YAHOO.util.Event,
+    Dom = YAHOO.util.Dom,
+    MenuBar = YAHOO.widget.MenuBar,
+
+    /**
+    * Constant representing the MenuBar's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
+    * @final
+    * @type Object
+    */
+    DEFAULT_CONFIG = {
+    
+        "POSITION": { 
+            key: "position", 
+            value: "static", 
+            validator: checkPosition, 
+            supercedes: ["visible"] 
+        }, 
+    
+        "SUBMENU_ALIGNMENT": { 
+            key: "submenualignment", 
+            value: ["tl","bl"] 
+        },
+    
+        "AUTO_SUBMENU_DISPLAY": { 
+            key: "autosubmenudisplay", 
+            value: false, 
+            validator: YAHOO.lang.isBoolean 
+        }
+    
+    };
+
+
+
+YAHOO.lang.extend(MenuBar, YAHOO.widget.Menu, {
+
+/**
+* @method init
+* @description The MenuBar class's initialization method. This method is 
+* automatically called by the constructor, and sets up all DOM references for 
+* pre-existing markup, and creates required markup if it is not already present.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the menu bar.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source for the 
+* menu bar.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying 
+* the <code>&#60;div&#62;</code> element of the menu bar.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object 
+* specifying the <code>&#60;select&#62;</code> element to be used as the data 
+* source for the menu bar.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu bar. See configuration class documentation for
+* more details.
+*/
+init: function(p_oElement, p_oConfig) {
+
+    if(!this.ITEM_TYPE) {
+
+        this.ITEM_TYPE = YAHOO.widget.MenuBarItem;
+
+    }
+
+
+    // Call the init of the superclass (YAHOO.widget.Menu)
+
+    MenuBar.superclass.init.call(this, p_oElement);
+
+
+    this.beforeInitEvent.fire(MenuBar);
+
+
+    if(p_oConfig) {
+
+        this.cfg.applyConfig(p_oConfig, true);
+
+    }
+
+    this.initEvent.fire(MenuBar);
+
+},
+
+
+
+// Constants
+
+
+/**
+* @property CSS_CLASS_NAME
+* @description String representing the CSS class(es) to be applied to the menu 
+* bar's <code>&#60;div&#62;</code> element.
+* @default "yuimenubar"
+* @final
+* @type String
+*/
+CSS_CLASS_NAME: "yuimenubar",
+
+
+
+// Protected event handlers
+
+
+/**
+* @method _onKeyDown
+* @description "keydown" Custom Event handler for the menu bar.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar 
+* that fired the event.
+*/
+_onKeyDown: function(p_sType, p_aArgs, p_oMenuBar) {
+
+    var oEvent = p_aArgs[0],
+        oItem = p_aArgs[1],
+        oSubmenu,
+        oItemCfg,
+        oNextItem;
+
+
+    if(oItem && !oItem.cfg.getProperty("disabled")) {
+
+        oItemCfg = oItem.cfg;
+
+        switch(oEvent.keyCode) {
+    
+            case 37:    // Left arrow
+            case 39:    // Right arrow
+    
+                if(oItem == this.activeItem && 
+                    !oItemCfg.getProperty("selected")) {
+    
+                    oItemCfg.setProperty("selected", true);
+    
+                }
+                else {
+    
+                    oNextItem = (oEvent.keyCode == 37) ? 
+                        oItem.getPreviousEnabledSibling() : 
+                        oItem.getNextEnabledSibling();
+            
+                    if(oNextItem) {
+    
+                        this.clearActiveItem();
+    
+                        oNextItem.cfg.setProperty("selected", true);
+    
+    
+                        if(this.cfg.getProperty("autosubmenudisplay")) {
+                        
+                            oSubmenu = oNextItem.cfg.getProperty("submenu");
+                            
+                            if(oSubmenu) {
+                        
+                                oSubmenu.show();
+                            
+                            }
+                
+                        }           
+    
+                        oNextItem.focus();
+    
+                    }
+    
+                }
+    
+                Event.preventDefault(oEvent);
+    
+            break;
+    
+            case 40:    // Down arrow
+    
+                if(this.activeItem != oItem) {
+    
+                    this.clearActiveItem();
+    
+                    oItemCfg.setProperty("selected", true);
+                    oItem.focus();
+                
+                }
+    
+                oSubmenu = oItemCfg.getProperty("submenu");
+    
+                if(oSubmenu) {
+    
+                    if(oSubmenu.cfg.getProperty("visible")) {
+    
+                        oSubmenu.setInitialSelection();
+                        oSubmenu.setInitialFocus();
+                    
+                    }
+                    else {
+    
+                        oSubmenu.show();
+                    
+                    }
+    
+                }
+    
+                Event.preventDefault(oEvent);
+    
+            break;
+    
+        }
+
+    }
+
+
+    if(oEvent.keyCode == 27 && this.activeItem) { // Esc key
+
+        oSubmenu = this.activeItem.cfg.getProperty("submenu");
+
+        if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {
+        
+            oSubmenu.hide();
+            this.activeItem.focus();
+        
+        }
+        else {
+
+            this.activeItem.cfg.setProperty("selected", false);
+            this.activeItem.blur();
+    
+        }
+
+        Event.preventDefault(oEvent);
+    
+    }
+
+},
+
+
+/**
+* @method _onClick
+* @description "click" event handler for the menu bar.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar 
+* that fired the event.
+*/
+_onClick: function(p_sType, p_aArgs, p_oMenuBar) {
+
+    MenuBar.superclass._onClick.call(this, p_sType, p_aArgs, p_oMenuBar);
+
+    var oItem = p_aArgs[1],
+        oEvent,
+        oTarget,
+        oActiveItem,
+        oConfig,
+        oSubmenu;
+    
+
+    if(oItem && !oItem.cfg.getProperty("disabled")) {
+
+        oEvent = p_aArgs[0];
+        oTarget = Event.getTarget(oEvent);
+        oActiveItem = this.activeItem;
+        oConfig = this.cfg;
+
+
+        // Hide any other submenus that might be visible
+    
+        if(oActiveItem && oActiveItem != oItem) {
+    
+            this.clearActiveItem();
+    
+        }
+
+    
+        oItem.cfg.setProperty("selected", true);
+    
+
+        // Show the submenu for the item
+    
+        oSubmenu = oItem.cfg.getProperty("submenu");
+
+
+        if(oSubmenu && oTarget != oItem.submenuIndicator) {
+        
+            if(oSubmenu.cfg.getProperty("visible")) {
+            
+                oSubmenu.hide();
+            
+            }
+            else {
+            
+                oSubmenu.show();                    
+            
+            }
+        
+        }
+    
+    }
+
+},
+
+
+
+// Public methods
+
+
+/**
+* @method toString
+* @description Returns a string representing the menu bar.
+* @return {String}
+*/
+toString: function() {
+
+    var sReturnVal = "MenuBar",
+        sId = this.id;
+
+    if(sId) {
+
+        sReturnVal += (" " + sId);
+    
+    }
+
+    return sReturnVal;
+
+},
+
+
+/**
+* @description Initializes the class's configurable properties which can be
+* changed using the menu bar's Config object ("cfg").
+* @method initDefaultConfig
+*/
+initDefaultConfig: function() {
+
+    MenuBar.superclass.initDefaultConfig.call(this);
+
+    var oConfig = this.cfg;
+
+       // Add configuration properties
+
+
+    /*
+        Set the default value for the "position" configuration property
+        to "static" by re-adding the property.
+    */
+
+
+    /**
+    * @config position
+    * @description String indicating how a menu bar should be positioned on the 
+    * screen.  Possible values are "static" and "dynamic."  Static menu bars 
+    * are visible by default and reside in the normal flow of the document 
+    * (CSS position: static).  Dynamic menu bars are hidden by default, reside
+    * out of the normal flow of the document (CSS position: absolute), and can 
+    * overlay other elements on the screen.
+    * @default static
+    * @type String
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.POSITION.key, 
+        {
+            handler: this.configPosition, 
+            value: DEFAULT_CONFIG.POSITION.value, 
+            validator: DEFAULT_CONFIG.POSITION.validator,
+            supercedes: DEFAULT_CONFIG.POSITION.supercedes
+        }
+    );
+
+
+    /*
+        Set the default value for the "submenualignment" configuration property
+        to ["tl","bl"] by re-adding the property.
+    */
+
+    /**
+    * @config submenualignment
+    * @description Array defining how submenus should be aligned to their 
+    * parent menu bar item. The format is: [itemCorner, submenuCorner].
+    * @default ["tl","bl"]
+    * @type Array
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key, 
+        {
+            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value
+        }
+    );
+
+
+    /*
+        Change the default value for the "autosubmenudisplay" configuration 
+        property to "false" by re-adding the property.
+    */
+
+    /**
+    * @config autosubmenudisplay
+    * @description Boolean indicating if submenus are automatically made 
+    * visible when the user mouses over the menu bar's items.
+    * @default false
+    * @type Boolean
+    */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key, 
+          {
+              value: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value, 
+              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator
+       } 
+    );
+
+}
+}); // END YAHOO.lang.extend
+
+}());
+
+
+
+/**
+* Creates an item for a menu bar.
+* 
+* @param {String} p_oObject String specifying the text of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the 
+* <code>&#60;li&#62;</code> element of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying 
+* the <code>&#60;option&#62;</code> element of the menu bar item.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu bar item. See configuration class documentation 
+* for more details.
+* @class MenuBarItem
+* @constructor
+* @extends YAHOO.widget.MenuItem
+*/
+YAHOO.widget.MenuBarItem = function(p_oObject, p_oConfig) {
+
+    YAHOO.widget.MenuBarItem.superclass.constructor.call(this, 
+        p_oObject, p_oConfig);
+
+};
+
+YAHOO.lang.extend(YAHOO.widget.MenuBarItem, YAHOO.widget.MenuItem, {
+
+
+
+/**
+* @method init
+* @description The MenuBarItem class's initialization method. This method is 
+* automatically called by the constructor, and sets up all DOM references for 
+* pre-existing markup, and creates required markup if it is not already present.
+* @param {String} p_oObject String specifying the text of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the 
+* <code>&#60;li&#62;</code> element of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying 
+* the <code>&#60;option&#62;</code> element of the menu bar item.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu bar item. See configuration class documentation 
+* for more details.
+*/
+init: function(p_oObject, p_oConfig) {
+
+    if(!this.SUBMENU_TYPE) {
+
+        this.SUBMENU_TYPE = YAHOO.widget.Menu;
+
+    }
+
+
+    /* 
+        Call the init of the superclass (YAHOO.widget.MenuItem)
+        Note: We don't pass the user config in here yet 
+        because we only want it executed once, at the lowest 
+        subclass level.
+    */ 
+
+    YAHOO.widget.MenuBarItem.superclass.init.call(this, p_oObject);  
+
+
+    var oConfig = this.cfg;
+
+    if(p_oConfig) {
+
+        oConfig.applyConfig(p_oConfig, true);
+
+    }
+
+    oConfig.fireQueue();
+
+},
+
+
+
+// Constants
+
+
+/**
+* @property CSS_CLASS_NAME
+* @description String representing the CSS class(es) to be applied to the 
+* <code>&#60;li&#62;</code> element of the menu bar item.
+* @default "yuimenubaritem"
+* @final
+* @type String
+*/
+CSS_CLASS_NAME: "yuimenubaritem",
+
+
+/**
+* @property CSS_LABEL_CLASS_NAME
+* @description String representing the CSS class(es) to be applied to the 
+* menu bar item's <code>&#60;a&#62;</code> element.
+* @default "yuimenubaritemlabel"
+* @final
+* @type String
+*/
+CSS_LABEL_CLASS_NAME: "yuimenubaritemlabel",
+
+
+
+// Public methods
+
+
+/**
+* @method toString
+* @description Returns a string representing the menu bar item.
+* @return {String}
+*/
+toString: function() {
+
+    var sReturnVal = "MenuBarItem";
+
+    if(this.cfg && this.cfg.getProperty("text")) {
+
+        sReturnVal += (": " + this.cfg.getProperty("text"));
+
+    }
+
+    return sReturnVal;
+
+}
+    
+}); // END YAHOO.lang.extend
+YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.3.0", build: "442"});
index 2625725bb05a6aac33a607ebae3c10729e535a0b..c49713ded14cdbc2ec377ad51fda256e141e9d44 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 
-(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event;YAHOO.widget.MenuManager=function(){var m_bInitializedEventHandlers=false,m_oMenus={},m_oItems={},m_oVisibleMenus={},me=this;function addItem(p_oItem){var sYUIId=Dom.generateId();if(p_oItem&&m_oItems[sYUIId]!=p_oItem){p_oItem.element.setAttribute("yuiid",sYUIId);m_oItems[sYUIId]=p_oItem;p_oItem.destroyEvent.subscribe(onItemDestroy,p_oItem);}}
-function removeItem(p_oItem){var sYUIId=p_oItem.element.getAttribute("yuiid");if(sYUIId&&m_oItems[sYUIId]){delete m_oItems[sYUIId];}}
-function getMenuRootElement(p_oElement){var oParentNode;if(p_oElement&&p_oElement.tagName){switch(p_oElement.tagName.toUpperCase()){case"DIV":oParentNode=p_oElement.parentNode;if(Dom.hasClass(p_oElement,"bd")&&oParentNode&&oParentNode.tagName&&oParentNode.tagName.toUpperCase()=="DIV"){return oParentNode;}
+(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event;YAHOO.widget.MenuManager=function(){var m_bInitializedEventHandlers=false,m_oMenus={},m_oVisibleMenus={},m_oItems={},m_oEventTypes={"click":"clickEvent","mousedown":"mouseDownEvent","mouseup":"mouseUpEvent","mouseover":"mouseOverEvent","mouseout":"mouseOutEvent","keydown":"keyDownEvent","keyup":"keyUpEvent","keypress":"keyPressEvent"},m_oFocusedMenuItem=null;function getMenuRootElement(p_oElement){var oParentNode;if(p_oElement&&p_oElement.tagName){switch(p_oElement.tagName.toUpperCase()){case"DIV":oParentNode=p_oElement.parentNode;if((Dom.hasClass(p_oElement,"hd")||Dom.hasClass(p_oElement,"bd")||Dom.hasClass(p_oElement,"ft"))&&oParentNode&&oParentNode.tagName&&oParentNode.tagName.toUpperCase()=="DIV")
+{return oParentNode;}
 else{return p_oElement;}
 break;case"LI":return p_oElement;default:oParentNode=p_oElement.parentNode;if(oParentNode){return getMenuRootElement(oParentNode);}
 break;}}}
-function onDOMEvent(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oElement=getMenuRootElement(oTarget),oMenuItem,oMenu;if(oElement){var sTagName=oElement.tagName.toUpperCase();if(sTagName=="LI"){var sYUIId=oElement.getAttribute("yuiid");if(sYUIId){oMenuItem=m_oItems[sYUIId];oMenu=oMenuItem.parent;}}
+function onDOMEvent(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oElement=getMenuRootElement(oTarget),sCustomEventType,sTagName,sId,oMenuItem,oMenu;if(oElement){sTagName=oElement.tagName.toUpperCase();if(sTagName=="LI"){sId=oElement.id;if(sId&&m_oItems[sId]){oMenuItem=m_oItems[sId];oMenu=oMenuItem.parent;}}
 else if(sTagName=="DIV"){if(oElement.id){oMenu=m_oMenus[oElement.id];}}}
-if(oMenu){var oEventTypes={"click":"clickEvent","mousedown":"mouseDownEvent","mouseup":"mouseUpEvent","mouseover":"mouseOverEvent","mouseout":"mouseOutEvent","keydown":"keyDownEvent","keyup":"keyUpEvent","keypress":"keyPressEvent"},sCustomEventType=oEventTypes[p_oEvent.type];if(oMenuItem&&!oMenuItem.cfg.getProperty("disabled")){oMenuItem[sCustomEventType].fire(p_oEvent);}
+if(oMenu){sCustomEventType=m_oEventTypes[p_oEvent.type];if(oMenuItem&&!oMenuItem.cfg.getProperty("disabled")){oMenuItem[sCustomEventType].fire(p_oEvent);if(p_oEvent.type=="keyup"||p_oEvent.type=="mousedown")
+{if(m_oFocusedMenuItem!=oMenuItem){if(m_oFocusedMenuItem){m_oFocusedMenuItem.blurEvent.fire();}
+oMenuItem.focusEvent.fire();}}}
 oMenu[sCustomEventType].fire(p_oEvent,oMenuItem);}
-else if(p_oEvent.type=="mousedown"){var oActiveItem;for(var i in m_oMenus){if(m_oMenus.hasOwnProperty(i)){oMenu=m_oMenus[i];if(oMenu.cfg.getProperty("clicktohide")&&oMenu.cfg.getProperty("position")=="dynamic"){oMenu.hide();}
-else{oMenu.clearActiveItem(true);}}}}}
-function onMenuDestroy(p_sType,p_aArgs,p_oMenu){if(p_oMenu&&m_oMenus[p_oMenu.id]){delete m_oMenus[p_oMenu.id];}}
-function onItemDestroy(p_sType,p_aArgs,p_oItem){var sYUIId=p_oItem.element.getAttribute("yuiid");if(sYUIId){delete m_oItems[sYUIId];}}
-function onMenuVisibleConfigChange(p_sType,p_aArgs,p_oMenu){var bVisible=p_aArgs[0];if(bVisible){m_oVisibleMenus[p_oMenu.id]=p_oMenu;}
-else if(m_oVisibleMenus[p_oMenu.id]){delete m_oVisibleMenus[p_oMenu.id];}}
-function onItemAdded(p_sType,p_aArgs){addItem(p_aArgs[0]);}
-function onItemRemoved(p_sType,p_aArgs){removeItem(p_aArgs[0]);}
-return{addMenu:function(p_oMenu){if(p_oMenu&&p_oMenu.id&&!m_oMenus[p_oMenu.id]){m_oMenus[p_oMenu.id]=p_oMenu;if(!m_bInitializedEventHandlers){var oDoc=document;Event.addListener(oDoc,"mouseover",onDOMEvent,me,true);Event.addListener(oDoc,"mouseout",onDOMEvent,me,true);Event.addListener(oDoc,"mousedown",onDOMEvent,me,true);Event.addListener(oDoc,"mouseup",onDOMEvent,me,true);Event.addListener(oDoc,"click",onDOMEvent,me,true);Event.addListener(oDoc,"keydown",onDOMEvent,me,true);Event.addListener(oDoc,"keyup",onDOMEvent,me,true);Event.addListener(oDoc,"keypress",onDOMEvent,me,true);m_bInitializedEventHandlers=true;}
-p_oMenu.destroyEvent.subscribe(onMenuDestroy,p_oMenu,me);p_oMenu.cfg.subscribeToConfigEvent("visible",onMenuVisibleConfigChange,p_oMenu);p_oMenu.itemAddedEvent.subscribe(onItemAdded);p_oMenu.itemRemovedEvent.subscribe(onItemRemoved);}},removeMenu:function(p_oMenu){if(p_oMenu&&m_oMenus[p_oMenu.id]){delete m_oMenus[p_oMenu.id];}},hideVisible:function(){var oMenu;for(var i in m_oVisibleMenus){if(m_oVisibleMenus.hasOwnProperty(i)){oMenu=m_oVisibleMenus[i];if(oMenu.cfg.getProperty("position")=="dynamic"){oMenu.hide();}}}},getMenus:function(){return m_oMenus;},getMenu:function(p_sId){if(m_oMenus[p_sId]){return m_oMenus[p_sId];}},toString:function(){return("MenuManager");}};}();})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event;YAHOO.widget.Menu=function(p_oElement,p_oConfig){if(p_oConfig){this.parent=p_oConfig.parent;this.lazyLoad=p_oConfig.lazyLoad||p_oConfig.lazyload;this.itemData=p_oConfig.itemData||p_oConfig.itemdata;}
-YAHOO.widget.Menu.superclass.constructor.call(this,p_oElement,p_oConfig);};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(p_oElement,p_oConfig){this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}
+else if(p_oEvent.type=="mousedown"){if(m_oFocusedMenuItem){m_oFocusedMenuItem.blurEvent.fire();m_oFocusedMenuItem=null;}
+for(var i in m_oMenus){if(YAHOO.lang.hasOwnProperty(m_oMenus,i)){oMenu=m_oMenus[i];if(oMenu.cfg.getProperty("clicktohide")&&!(oMenu instanceof YAHOO.widget.MenuBar)&&oMenu.cfg.getProperty("position")=="dynamic"){oMenu.hide();}
+else{oMenu.clearActiveItem(true);}}}}
+else if(p_oEvent.type=="keyup"){if(m_oFocusedMenuItem){m_oFocusedMenuItem.blurEvent.fire();m_oFocusedMenuItem=null;}}}
+function onMenuDestroy(p_sType,p_aArgs,p_oMenu){if(m_oMenus[p_oMenu.id]){this.removeMenu(p_oMenu);}}
+function onMenuFocus(p_sType,p_aArgs){var oItem=p_aArgs[0];if(oItem){m_oFocusedMenuItem=oItem;}}
+function onMenuBlur(p_sType,p_aArgs){m_oFocusedMenuItem=null;}
+function onMenuVisibleConfigChange(p_sType,p_aArgs){var bVisible=p_aArgs[0],sId=this.id;if(bVisible){m_oVisibleMenus[sId]=this;}
+else if(m_oVisibleMenus[sId]){delete m_oVisibleMenus[sId];}}
+function onItemDestroy(p_sType,p_aArgs){var sId=this.id;if(sId&&m_oItems[sId]){if(m_oFocusedMenuItem==this){m_oFocusedMenuItem=null;}
+delete m_oItems[sId];}}
+function onItemAdded(p_sType,p_aArgs){var oItem=p_aArgs[0],sId;if(oItem instanceof YAHOO.widget.MenuItem){sId=oItem.id;if(!m_oItems[sId]){m_oItems[sId]=oItem;oItem.destroyEvent.subscribe(onItemDestroy);}}}
+return{addMenu:function(p_oMenu){var oDoc;if(p_oMenu instanceof YAHOO.widget.Menu&&p_oMenu.id&&!m_oMenus[p_oMenu.id]){m_oMenus[p_oMenu.id]=p_oMenu;if(!m_bInitializedEventHandlers){oDoc=document;Event.on(oDoc,"mouseover",onDOMEvent,this,true);Event.on(oDoc,"mouseout",onDOMEvent,this,true);Event.on(oDoc,"mousedown",onDOMEvent,this,true);Event.on(oDoc,"mouseup",onDOMEvent,this,true);Event.on(oDoc,"click",onDOMEvent,this,true);Event.on(oDoc,"keydown",onDOMEvent,this,true);Event.on(oDoc,"keyup",onDOMEvent,this,true);Event.on(oDoc,"keypress",onDOMEvent,this,true);m_bInitializedEventHandlers=true;}
+p_oMenu.destroyEvent.subscribe(onMenuDestroy,p_oMenu,this);p_oMenu.cfg.subscribeToConfigEvent("visible",onMenuVisibleConfigChange);p_oMenu.itemAddedEvent.subscribe(onItemAdded);p_oMenu.focusEvent.subscribe(onMenuFocus);p_oMenu.blurEvent.subscribe(onMenuBlur);}},removeMenu:function(p_oMenu){var sId;if(p_oMenu){sId=p_oMenu.id;if(m_oMenus[sId]==p_oMenu){delete m_oMenus[sId];if(m_oVisibleMenus[sId]==p_oMenu){delete m_oVisibleMenus[sId];}}}},hideVisible:function(){var oMenu;for(var i in m_oVisibleMenus){if(YAHOO.lang.hasOwnProperty(m_oVisibleMenus,i)){oMenu=m_oVisibleMenus[i];if(!(oMenu instanceof YAHOO.widget.MenuBar)&&oMenu.cfg.getProperty("position")=="dynamic"){oMenu.hide();}}}},getMenus:function(){return m_oMenus;},getMenu:function(p_sId){var oMenu=m_oMenus[p_sId];if(oMenu){return oMenu;}},getMenuItem:function(p_sId){var oItem=m_oItems[p_sId];if(oItem){return oItem;}},getMenuItemGroup:function(p_sId){var oUL=Dom.get(p_sId),aItems,oNode,oItem,sId;if(oUL&&oUL.tagName&&oUL.tagName.toUpperCase()=="UL"){oNode=oUL.firstChild;if(oNode){aItems=[];do{sId=oNode.id;if(sId){oItem=this.getMenuItem(sId);if(oItem){aItems[aItems.length]=oItem;}}}
+while((oNode=oNode.nextSibling));if(aItems.length>0){return aItems;}}}},getFocusedMenuItem:function(){return m_oFocusedMenuItem;},getFocusedMenu:function(){if(m_oFocusedMenuItem){return(m_oFocusedMenuItem.parent.getRoot());}},toString:function(){return"MenuManager";}};}();})();(function(){YAHOO.widget.Menu=function(p_oElement,p_oConfig){if(p_oConfig){this.parent=p_oConfig.parent;this.lazyLoad=p_oConfig.lazyLoad||p_oConfig.lazyload;this.itemData=p_oConfig.itemData||p_oConfig.itemdata;}
+YAHOO.widget.Menu.superclass.constructor.call(this,p_oElement,p_oConfig);};function checkPosition(p_sPosition){if(typeof p_sPosition=="string"){return("dynamic,static".indexOf((p_sPosition.toLowerCase()))!=-1);}}
+var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Module=YAHOO.widget.Module,Overlay=YAHOO.widget.Overlay,Menu=YAHOO.widget.Menu,MenuManager=YAHOO.widget.MenuManager,CustomEvent=YAHOO.util.CustomEvent,Lang=YAHOO.lang,m_oShadowTemplate,EVENT_TYPES={"MOUSE_OVER":"mouseover","MOUSE_OUT":"mouseout","MOUSE_DOWN":"mousedown","MOUSE_UP":"mouseup","CLICK":"click","KEY_PRESS":"keypress","KEY_DOWN":"keydown","KEY_UP":"keyup","FOCUS":"focus","BLUR":"blur","ITEM_ADDED":"itemAdded","ITEM_REMOVED":"itemRemoved"},DEFAULT_CONFIG={"VISIBLE":{key:"visible",value:false,validator:Lang.isBoolean},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:true,validator:Lang.isBoolean,supercedes:["iframe","x","y","xy"]},"POSITION":{key:"position",value:"dynamic",validator:checkPosition,supercedes:["visible","iframe"]},"SUBMENU_ALIGNMENT":{key:"submenualignment",value:["tl","tr"]},"AUTO_SUBMENU_DISPLAY":{key:"autosubmenudisplay",value:true,validator:Lang.isBoolean},"SHOW_DELAY":{key:"showdelay",value:250,validator:Lang.isNumber},"HIDE_DELAY":{key:"hidedelay",value:0,validator:Lang.isNumber,suppressEvent:true},"SUBMENU_HIDE_DELAY":{key:"submenuhidedelay",value:250,validator:Lang.isNumber},"CLICK_TO_HIDE":{key:"clicktohide",value:true,validator:Lang.isBoolean},"CONTAINER":{key:"container"},"MAX_HEIGHT":{key:"maxheight",value:0,validator:Lang.isNumber,supercedes:["iframe"]},"CLASS_NAME":{key:"classname",value:null,validator:Lang.isString},"DISABLED":{key:"disabled",value:false,validator:Lang.isBoolean}};YAHOO.lang.extend(Menu,Overlay,{CSS_CLASS_NAME:"yuimenu",ITEM_TYPE:null,GROUP_TITLE_TAG_NAME:"h6",_nHideDelayId:null,_nShowDelayId:null,_nSubmenuHideDelayId:null,_nBodyScrollId:null,_bHideDelayEventHandlersAssigned:false,_bHandledMouseOverEvent:false,_bHandledMouseOutEvent:false,_aGroupTitleElements:null,_aItemGroups:null,_aListElements:null,_nCurrentMouseX:0,_nMaxHeight:-1,_bStopMouseEventHandlers:false,_sClassName:null,_bDisabled:false,lazyLoad:false,itemData:null,activeItem:null,parent:null,srcElement:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,itemAddedEvent:null,itemRemovedEvent:null,init:function(p_oElement,p_oConfig){this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}
 var oElement;if(typeof p_oElement=="string"){oElement=document.getElementById(p_oElement);}
 else if(p_oElement.tagName){oElement=p_oElement;}
 if(oElement&&oElement.tagName){switch(oElement.tagName.toUpperCase()){case"DIV":this.srcElement=oElement;if(!oElement.id){oElement.setAttribute("id",Dom.generateId());}
-YAHOO.widget.Menu.superclass.init.call(this,oElement);this.beforeInitEvent.fire(YAHOO.widget.Menu);break;case"SELECT":this.srcElement=oElement;YAHOO.widget.Menu.superclass.init.call(this,Dom.generateId());this.beforeInitEvent.fire(YAHOO.widget.Menu);break;}}
-else{YAHOO.widget.Menu.superclass.init.call(this,p_oElement);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);YAHOO.widget.Module.textResizeEvent.subscribe(this._onTextResize,this,true);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}
-YAHOO.widget.MenuManager.addMenu(this);this.initEvent.fire(YAHOO.widget.Menu);}},_initSubTree:function(){var oNode;if(this.srcElement.tagName=="DIV"){oNode=this.body.firstChild;var nGroup=0,sGroupTitleTagName=this.GROUP_TITLE_TAG_NAME.toUpperCase();do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case sGroupTitleTagName:this._aGroupTitleElements[nGroup]=oNode;break;case"UL":this._aListElements[nGroup]=oNode;this._aItemGroups[nGroup]=[];nGroup++;break;}}}
-while((oNode=oNode.nextSibling));if(this._aListElements[0]){Dom.addClass(this._aListElements[0],"first-of-type");}}
-oNode=null;if(this.srcElement.tagName){var sSrcElementTagName=this.srcElement.tagName.toUpperCase();switch(sSrcElementTagName){case"DIV":if(this._aListElements.length>0){var i=this._aListElements.length-1;do{oNode=this._aListElements[i].firstChild;do{if(oNode&&oNode.tagName&&oNode.tagName.toUpperCase()=="LI"){this.addItem(new this.ITEM_TYPE(oNode,{parent:this}),i);}}
-while((oNode=oNode.nextSibling));}
+Menu.superclass.init.call(this,oElement);this.beforeInitEvent.fire(Menu);break;case"SELECT":this.srcElement=oElement;Menu.superclass.init.call(this,Dom.generateId());this.beforeInitEvent.fire(Menu);break;}}
+else{Menu.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(Menu);}
+if(this.element){Dom.addClass(this.element,this.CSS_CLASS_NAME);this.initEvent.subscribe(this._onInit);this.beforeRenderEvent.subscribe(this._onBeforeRender);this.renderEvent.subscribe(this._onRender);this.renderEvent.subscribe(this.onRender);this.beforeShowEvent.subscribe(this._onBeforeShow);this.showEvent.subscribe(this._onShow);this.beforeHideEvent.subscribe(this._onBeforeHide);this.hideEvent.subscribe(this._onHide);this.mouseOverEvent.subscribe(this._onMouseOver);this.mouseOutEvent.subscribe(this._onMouseOut);this.clickEvent.subscribe(this._onClick);this.keyDownEvent.subscribe(this._onKeyDown);this.keyPressEvent.subscribe(this._onKeyPress);Module.textResizeEvent.subscribe(this._onTextResize,this,true);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}
+MenuManager.addMenu(this);this.initEvent.fire(Menu);}},_initSubTree:function(){var oSrcElement=this.srcElement,sSrcElementTagName,nGroup,sGroupTitleTagName,oNode,aListElements,nListElements,i;if(oSrcElement){sSrcElementTagName=(oSrcElement.tagName&&oSrcElement.tagName.toUpperCase());if(sSrcElementTagName=="DIV"){oNode=this.body.firstChild;if(oNode){nGroup=0;sGroupTitleTagName=this.GROUP_TITLE_TAG_NAME.toUpperCase();do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case sGroupTitleTagName:this._aGroupTitleElements[nGroup]=oNode;break;case"UL":this._aListElements[nGroup]=oNode;this._aItemGroups[nGroup]=[];nGroup++;break;}}}
+while((oNode=oNode.nextSibling));if(this._aListElements[0]){Dom.addClass(this._aListElements[0],"first-of-type");}}}
+oNode=null;if(sSrcElementTagName){switch(sSrcElementTagName){case"DIV":aListElements=this._aListElements;nListElements=aListElements.length;if(nListElements>0){i=nListElements-1;do{oNode=aListElements[i].firstChild;if(oNode){do{if(oNode&&oNode.tagName&&oNode.tagName.toUpperCase()=="LI"){this.addItem(new this.ITEM_TYPE(oNode,{parent:this}),i);}}
+while((oNode=oNode.nextSibling));}}
 while(i--);}
-break;case"SELECT":oNode=this.srcElement.firstChild;do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case"OPTGROUP":case"OPTION":this.addItem(new this.ITEM_TYPE(oNode,{parent:this}));break;}}}
-while((oNode=oNode.nextSibling));break;}}},_getFirstEnabledItem:function(){var nGroups=this._aItemGroups.length,oItem,aItemGroup;for(var i=0;i<nGroups;i++){aItemGroup=this._aItemGroups[i];if(aItemGroup){var nItems=aItemGroup.length;for(var n=0;n<nItems;n++){oItem=aItemGroup[n];if(!oItem.cfg.getProperty("disabled")&&oItem.element.style.display!="none"){return oItem;}
-oItem=null;}}}},_checkPosition:function(p_sPosition){if(typeof p_sPosition=="string"){var sPosition=p_sPosition.toLowerCase();return("dynamic,static".indexOf(sPosition)!=-1);}},_addItemToGroup:function(p_nGroupIndex,p_oItem,p_nItemIndex){var oItem;if(p_oItem instanceof this.ITEM_TYPE){oItem=p_oItem;oItem.parent=this;}
+break;case"SELECT":oNode=oSrcElement.firstChild;do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case"OPTGROUP":case"OPTION":this.addItem(new this.ITEM_TYPE(oNode,{parent:this}));break;}}}
+while((oNode=oNode.nextSibling));break;}}}},_getFirstEnabledItem:function(){var aItems=this.getItems(),nItems=aItems.length,oItem;for(var i=0;i<nItems;i++){oItem=aItems[i];if(oItem&&!oItem.cfg.getProperty("disabled")&&oItem.element.style.display!="none"){return oItem;}}},_addItemToGroup:function(p_nGroupIndex,p_oItem,p_nItemIndex){var oItem,bDisabled=this.cfg.getProperty("disabled"),nGroupIndex,aGroup,oGroupItem,bAppend,oNextItemSibling,nItemIndex;function getNextItemSibling(p_aArray,p_nStartIndex){return(p_aArray[p_nStartIndex]||getNextItemSibling(p_aArray,(p_nStartIndex+1)));}
+if(p_oItem instanceof this.ITEM_TYPE){oItem=p_oItem;oItem.parent=this;}
 else if(typeof p_oItem=="string"){oItem=new this.ITEM_TYPE(p_oItem,{parent:this});}
 else if(typeof p_oItem=="object"){p_oItem.parent=this;oItem=new this.ITEM_TYPE(p_oItem.text,p_oItem);}
-if(oItem){var nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0,aGroup=this._getItemGroup(nGroupIndex),oGroupItem;if(!aGroup){aGroup=this._createItemGroup(nGroupIndex);}
-if(typeof p_nItemIndex=="number"){var bAppend=(p_nItemIndex>=aGroup.length);if(aGroup[p_nItemIndex]){aGroup.splice(p_nItemIndex,0,oItem);}
+if(oItem){if(oItem.cfg.getProperty("selected")){this.activeItem=oItem;}
+nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0;aGroup=this._getItemGroup(nGroupIndex);if(!aGroup){aGroup=this._createItemGroup(nGroupIndex);}
+if(typeof p_nItemIndex=="number"){bAppend=(p_nItemIndex>=aGroup.length);if(aGroup[p_nItemIndex]){aGroup.splice(p_nItemIndex,0,oItem);}
 else{aGroup[p_nItemIndex]=oItem;}
 oGroupItem=aGroup[p_nItemIndex];if(oGroupItem){if(bAppend&&(!oGroupItem.element.parentNode||oGroupItem.element.parentNode.nodeType==11)){this._aListElements[nGroupIndex].appendChild(oGroupItem.element);}
-else{function getNextItemSibling(p_aArray,p_nStartIndex){return(p_aArray[p_nStartIndex]||getNextItemSibling(p_aArray,(p_nStartIndex+1)));}
-var oNextItemSibling=getNextItemSibling(aGroup,(p_nItemIndex+1));if(oNextItemSibling&&(!oGroupItem.element.parentNode||oGroupItem.element.parentNode.nodeType==11)){this._aListElements[nGroupIndex].insertBefore(oGroupItem.element,oNextItemSibling.element);}}
-oGroupItem.parent=this;this._subscribeToItemEvents(oGroupItem);this._configureSubmenu(oGroupItem);this._updateItemProperties(nGroupIndex);this.itemAddedEvent.fire(oGroupItem);return oGroupItem;}}
-else{var nItemIndex=aGroup.length;aGroup[nItemIndex]=oItem;oGroupItem=aGroup[nItemIndex];if(oGroupItem){if(!Dom.isAncestor(this._aListElements[nGroupIndex],oGroupItem.element)){this._aListElements[nGroupIndex].appendChild(oGroupItem.element);}
+else{oNextItemSibling=getNextItemSibling(aGroup,(p_nItemIndex+1));if(oNextItemSibling&&(!oGroupItem.element.parentNode||oGroupItem.element.parentNode.nodeType==11)){this._aListElements[nGroupIndex].insertBefore(oGroupItem.element,oNextItemSibling.element);}}
+oGroupItem.parent=this;this._subscribeToItemEvents(oGroupItem);this._configureSubmenu(oGroupItem);this._updateItemProperties(nGroupIndex);this.itemAddedEvent.fire(oGroupItem);this.changeContentEvent.fire();return oGroupItem;}}
+else{nItemIndex=aGroup.length;aGroup[nItemIndex]=oItem;oGroupItem=aGroup[nItemIndex];if(oGroupItem){if(!Dom.isAncestor(this._aListElements[nGroupIndex],oGroupItem.element)){this._aListElements[nGroupIndex].appendChild(oGroupItem.element);}
 oGroupItem.element.setAttribute("groupindex",nGroupIndex);oGroupItem.element.setAttribute("index",nItemIndex);oGroupItem.parent=this;oGroupItem.index=nItemIndex;oGroupItem.groupIndex=nGroupIndex;this._subscribeToItemEvents(oGroupItem);this._configureSubmenu(oGroupItem);if(nItemIndex===0){Dom.addClass(oGroupItem.element,"first-of-type");}
-this.itemAddedEvent.fire(oGroupItem);return oGroupItem;}}}},_removeItemFromGroupByIndex:function(p_nGroupIndex,p_nItemIndex){var nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0,aGroup=this._getItemGroup(nGroupIndex);if(aGroup){var aArray=aGroup.splice(p_nItemIndex,1),oItem=aArray[0];if(oItem){this._updateItemProperties(nGroupIndex);if(aGroup.length===0){var oUL=this._aListElements[nGroupIndex];if(this.body&&oUL){this.body.removeChild(oUL);}
+this.itemAddedEvent.fire(oGroupItem);this.changeContentEvent.fire();return oGroupItem;}}}},_removeItemFromGroupByIndex:function(p_nGroupIndex,p_nItemIndex){var nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0,aGroup=this._getItemGroup(nGroupIndex),aArray,oItem,oUL;if(aGroup){aArray=aGroup.splice(p_nItemIndex,1);oItem=aArray[0];if(oItem){this._updateItemProperties(nGroupIndex);if(aGroup.length===0){oUL=this._aListElements[nGroupIndex];if(this.body&&oUL){this.body.removeChild(oUL);}
 this._aItemGroups.splice(nGroupIndex,1);this._aListElements.splice(nGroupIndex,1);oUL=this._aListElements[0];if(oUL){Dom.addClass(oUL,"first-of-type");}}
-this.itemRemovedEvent.fire(oItem);return oItem;}}},_removeItemFromGroupByValue:function(p_nGroupIndex,p_oItem){var aGroup=this._getItemGroup(p_nGroupIndex);if(aGroup){var nItems=aGroup.length,nItemIndex=-1;if(nItems>0){var i=nItems-1;do{if(aGroup[i]==p_oItem){nItemIndex=i;break;}}
-while(i--);if(nItemIndex>-1){return this._removeItemFromGroupByIndex(p_nGroupIndex,nItemIndex);}}}},_updateItemProperties:function(p_nGroupIndex){var aGroup=this._getItemGroup(p_nGroupIndex),nItems=aGroup.length;if(nItems>0){var i=nItems-1,oItem,oLI;do{oItem=aGroup[i];if(oItem){oLI=oItem.element;oItem.index=i;oItem.groupIndex=p_nGroupIndex;oLI.setAttribute("groupindex",p_nGroupIndex);oLI.setAttribute("index",i);Dom.removeClass(oLI,"first-of-type");}}
-while(i--);if(oLI){Dom.addClass(oLI,"first-of-type");}}},_createItemGroup:function(p_nIndex){if(!this._aItemGroups[p_nIndex]){this._aItemGroups[p_nIndex]=[];var oUL=document.createElement("ul");this._aListElements[p_nIndex]=oUL;return this._aItemGroups[p_nIndex];}},_getItemGroup:function(p_nIndex){var nIndex=((typeof p_nIndex=="number")?p_nIndex:0);return this._aItemGroups[nIndex];},_configureSubmenu:function(p_oItem){var oSubmenu=p_oItem.cfg.getProperty("submenu");if(oSubmenu){this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange,oSubmenu,true);this.renderEvent.subscribe(this._onParentMenuRender,oSubmenu,true);oSubmenu.beforeShowEvent.subscribe(this._onSubmenuBeforeShow,oSubmenu,true);oSubmenu.showEvent.subscribe(this._onSubmenuShow,oSubmenu,true);oSubmenu.hideEvent.subscribe(this._onSubmenuHide,oSubmenu,true);}},_subscribeToItemEvents:function(p_oItem){p_oItem.focusEvent.subscribe(this._onMenuItemFocus,p_oItem,this);p_oItem.blurEvent.subscribe(this._onMenuItemBlur,this,true);p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,p_oItem,this);},_getOffsetWidth:function(){var oClone=this.element.cloneNode(true);Dom.setStyle(oClone,"width","");document.body.appendChild(oClone);var sWidth=oClone.offsetWidth;document.body.removeChild(oClone);return sWidth;},_cancelHideDelay:function(){var oRoot=this.getRoot();if(oRoot._nHideDelayId){window.clearTimeout(oRoot._nHideDelayId);}},_execHideDelay:function(){this._cancelHideDelay();var oRoot=this.getRoot(),me=this;function hideMenu(){if(oRoot.activeItem){oRoot.clearActiveItem();}
-if(oRoot==me&&me.cfg.getProperty("position")=="dynamic"){me.hide();}}
-oRoot._nHideDelayId=window.setTimeout(hideMenu,oRoot.cfg.getProperty("hidedelay"));},_cancelShowDelay:function(){var oRoot=this.getRoot();if(oRoot._nShowDelayId){window.clearTimeout(oRoot._nShowDelayId);}},_execShowDelay:function(p_oMenu){var oRoot=this.getRoot();function showMenu(){p_oMenu.show();}
-oRoot._nShowDelayId=window.setTimeout(showMenu,oRoot.cfg.getProperty("showdelay"));},_onMouseOver:function(p_sType,p_aArgs,p_oMenu){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oTarget=Event.getTarget(oEvent);if(!this._bHandledMouseOverEvent&&(oTarget==this.element||Dom.isAncestor(this.element,oTarget))){this.clearActiveItem();this._bHandledMouseOverEvent=true;this._bHandledMouseOutEvent=false;}
-if(oItem&&!oItem.handledMouseOverEvent&&!oItem.cfg.getProperty("disabled")&&(oTarget==oItem.element||Dom.isAncestor(oItem.element,oTarget))){var nShowDelay=this.cfg.getProperty("showdelay"),bShowDelay=(nShowDelay>0);if(bShowDelay){this._cancelShowDelay();}
-var oActiveItem=this.activeItem;if(oActiveItem){oActiveItem.cfg.setProperty("selected",false);var oActiveSubmenu=oActiveItem.cfg.getProperty("submenu");if(oActiveSubmenu){oActiveSubmenu.hide();}}
-var oItemCfg=oItem.cfg;oItemCfg.setProperty("selected",true);oItem.focus();if(this.cfg.getProperty("autosubmenudisplay")){var oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu){if(bShowDelay){this._execShowDelay(oSubmenu);}
+this.itemRemovedEvent.fire(oItem);this.changeContentEvent.fire();return oItem;}}},_removeItemFromGroupByValue:function(p_nGroupIndex,p_oItem){var aGroup=this._getItemGroup(p_nGroupIndex),nItems,nItemIndex,i;if(aGroup){nItems=aGroup.length;nItemIndex=-1;if(nItems>0){i=nItems-1;do{if(aGroup[i]==p_oItem){nItemIndex=i;break;}}
+while(i--);if(nItemIndex>-1){return(this._removeItemFromGroupByIndex(p_nGroupIndex,nItemIndex));}}}},_updateItemProperties:function(p_nGroupIndex){var aGroup=this._getItemGroup(p_nGroupIndex),nItems=aGroup.length,oItem,oLI,i;if(nItems>0){i=nItems-1;do{oItem=aGroup[i];if(oItem){oLI=oItem.element;oItem.index=i;oItem.groupIndex=p_nGroupIndex;oLI.setAttribute("groupindex",p_nGroupIndex);oLI.setAttribute("index",i);Dom.removeClass(oLI,"first-of-type");}}
+while(i--);if(oLI){Dom.addClass(oLI,"first-of-type");}}},_createItemGroup:function(p_nIndex){var oUL;if(!this._aItemGroups[p_nIndex]){this._aItemGroups[p_nIndex]=[];oUL=document.createElement("ul");this._aListElements[p_nIndex]=oUL;return this._aItemGroups[p_nIndex];}},_getItemGroup:function(p_nIndex){var nIndex=((typeof p_nIndex=="number")?p_nIndex:0);return this._aItemGroups[nIndex];},_configureSubmenu:function(p_oItem){var oSubmenu=p_oItem.cfg.getProperty("submenu");if(oSubmenu){this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange,oSubmenu,true);this.renderEvent.subscribe(this._onParentMenuRender,oSubmenu,true);oSubmenu.beforeShowEvent.subscribe(this._onSubmenuBeforeShow,null,oSubmenu);oSubmenu.showEvent.subscribe(this._onSubmenuShow,null,p_oItem);oSubmenu.hideEvent.subscribe(this._onSubmenuHide,null,p_oItem);}},_subscribeToItemEvents:function(p_oItem){p_oItem.focusEvent.subscribe(this._onMenuItemFocus);p_oItem.blurEvent.subscribe(this._onMenuItemBlur);p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,p_oItem,this);},_getOffsetWidth:function(){var oClone=this.element.cloneNode(true);Dom.removeClass(oClone,"visible");Dom.setStyle(oClone,"width","");document.body.appendChild(oClone);var sWidth=oClone.offsetWidth;document.body.removeChild(oClone);return sWidth;},_setWidth:function(){var oElement=this.element,bVisible=false,sWidth;if(oElement.parentNode.tagName.toUpperCase()=="BODY"){if(YAHOO.env.ua.opera){sWidth=this._getOffsetWidth();}
+else{if(Dom.hasClass(oElement,"visible")){bVisible=true;Dom.removeClass(oElement,"visible");}
+Dom.setStyle(oElement,"width","auto");sWidth=oElement.offsetWidth;}}
+else{sWidth=this._getOffsetWidth();}
+this.cfg.setProperty("width",(sWidth+"px"));if(bVisible){Dom.addClass(oElement,"visible");}},_onWidthChange:function(p_sType,p_aArgs){var sWidth=p_aArgs[0];if(sWidth&&!this._hasSetWidthHandlers){this.itemAddedEvent.subscribe(this._setWidth);this.itemRemovedEvent.subscribe(this._setWidth);this._hasSetWidthHandlers=true;}
+else if(this._hasSetWidthHandlers){this.itemAddedEvent.unsubscribe(this._setWidth);this.itemRemovedEvent.unsubscribe(this._setWidth);this._hasSetWidthHandlers=false;}},_onVisibleChange:function(p_sType,p_aArgs){var bVisible=p_aArgs[0];if(bVisible){Dom.addClass(this.element,"visible");}
+else{Dom.removeClass(this.element,"visible");}},_cancelHideDelay:function(){var oRoot=this.getRoot();if(oRoot._nHideDelayId){window.clearTimeout(oRoot._nHideDelayId);}},_execHideDelay:function(){this._cancelHideDelay();var oRoot=this.getRoot(),me=this;function hideMenu(){if(oRoot.activeItem){oRoot.clearActiveItem();}
+if(oRoot==me&&!(me instanceof YAHOO.widget.MenuBar)&&me.cfg.getProperty("position")=="dynamic"){me.hide();}}
+oRoot._nHideDelayId=window.setTimeout(hideMenu,oRoot.cfg.getProperty("hidedelay"));},_cancelShowDelay:function(){var oRoot=this.getRoot();if(oRoot._nShowDelayId){window.clearTimeout(oRoot._nShowDelayId);}},_execShowDelay:function(p_oMenu){var oRoot=this.getRoot();function showMenu(){if(p_oMenu.parent.cfg.getProperty("selected")){p_oMenu.show();}}
+oRoot._nShowDelayId=window.setTimeout(showMenu,oRoot.cfg.getProperty("showdelay"));},_execSubmenuHideDelay:function(p_oSubmenu,p_nMouseX,p_nHideDelay){var me=this;p_oSubmenu._nSubmenuHideDelayId=window.setTimeout(function(){if(me._nCurrentMouseX>(p_nMouseX+10)){p_oSubmenu._nSubmenuHideDelayId=window.setTimeout(function(){p_oSubmenu.hide();},p_nHideDelay);}
+else{p_oSubmenu.hide();}},50);},_disableScrollHeader:function(){if(!this._bHeaderDisabled){Dom.addClass(this.header,"topscrollbar_disabled");this._bHeaderDisabled=true;}},_disableScrollFooter:function(){if(!this._bFooterDisabled){Dom.addClass(this.footer,"bottomscrollbar_disabled");this._bFooterDisabled=true;}},_enableScrollHeader:function(){if(this._bHeaderDisabled){Dom.removeClass(this.header,"topscrollbar_disabled");this._bHeaderDisabled=false;}},_enableScrollFooter:function(){if(this._bFooterDisabled){Dom.removeClass(this.footer,"bottomscrollbar_disabled");this._bFooterDisabled=false;}},_onMouseOver:function(p_sType,p_aArgs){if(this._bStopMouseEventHandlers){return false;}
+var oEvent=p_aArgs[0],oItem=p_aArgs[1],oTarget=Event.getTarget(oEvent),oParentMenu,nShowDelay,bShowDelay,oActiveItem,oItemCfg,oSubmenu;if(!this._bHandledMouseOverEvent&&(oTarget==this.element||Dom.isAncestor(this.element,oTarget))){this._nCurrentMouseX=0;Event.on(this.element,"mousemove",this._onMouseMove,this,true);this.clearActiveItem();if(this.parent&&this._nSubmenuHideDelayId){window.clearTimeout(this._nSubmenuHideDelayId);this.parent.cfg.setProperty("selected",true);oParentMenu=this.parent.parent;oParentMenu._bHandledMouseOutEvent=true;oParentMenu._bHandledMouseOverEvent=false;}
+this._bHandledMouseOverEvent=true;this._bHandledMouseOutEvent=false;}
+if(oItem&&!oItem.handledMouseOverEvent&&!oItem.cfg.getProperty("disabled")&&(oTarget==oItem.element||Dom.isAncestor(oItem.element,oTarget))){nShowDelay=this.cfg.getProperty("showdelay");bShowDelay=(nShowDelay>0);if(bShowDelay){this._cancelShowDelay();}
+oActiveItem=this.activeItem;if(oActiveItem){oActiveItem.cfg.setProperty("selected",false);}
+oItemCfg=oItem.cfg;oItemCfg.setProperty("selected",true);if(this.hasFocus()){oItem.focus();}
+if(this.cfg.getProperty("autosubmenudisplay")){oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu){if(bShowDelay){this._execShowDelay(oSubmenu);}
 else{oSubmenu.show();}}}
-oItem.handledMouseOverEvent=true;oItem.handledMouseOutEvent=false;}},_onMouseOut:function(p_sType,p_aArgs,p_oMenu){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oRelatedTarget=Event.getRelatedTarget(oEvent),bMovingToSubmenu=false;if(oItem&&!oItem.cfg.getProperty("disabled")){var oItemCfg=oItem.cfg,oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu&&(oRelatedTarget==oSubmenu.element||Dom.isAncestor(oSubmenu.element,oRelatedTarget))){bMovingToSubmenu=true;}
-if(!oItem.handledMouseOutEvent&&((oRelatedTarget!=oItem.element&&!Dom.isAncestor(oItem.element,oRelatedTarget))||bMovingToSubmenu)){if(!oSubmenu||(oSubmenu&&!oSubmenu.cfg.getProperty("visible"))){oItem.cfg.setProperty("selected",false);if(oSubmenu&&oSubmenu.cfg.getProperty("showdelay")&&!oSubmenu.cfg.getProperty("visible")){this._cancelShowDelay();}}
+oItem.handledMouseOverEvent=true;oItem.handledMouseOutEvent=false;}},_onMouseOut:function(p_sType,p_aArgs){if(this._bStopMouseEventHandlers){return false;}
+var oEvent=p_aArgs[0],oItem=p_aArgs[1],oRelatedTarget=Event.getRelatedTarget(oEvent),bMovingToSubmenu=false,oItemCfg,oSubmenu,nSubmenuHideDelay,nShowDelay;if(oItem&&!oItem.cfg.getProperty("disabled")){oItemCfg=oItem.cfg;oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu&&(oRelatedTarget==oSubmenu.element||Dom.isAncestor(oSubmenu.element,oRelatedTarget))){bMovingToSubmenu=true;}
+if(!oItem.handledMouseOutEvent&&((oRelatedTarget!=oItem.element&&!Dom.isAncestor(oItem.element,oRelatedTarget))||bMovingToSubmenu)){if(!bMovingToSubmenu){oItem.cfg.setProperty("selected",false);if(oSubmenu){nSubmenuHideDelay=this.cfg.getProperty("submenuhidedelay");nShowDelay=this.cfg.getProperty("showdelay");if(!(this instanceof YAHOO.widget.MenuBar)&&nSubmenuHideDelay>0&&nShowDelay>=nSubmenuHideDelay){this._execSubmenuHideDelay(oSubmenu,Event.getPageX(oEvent),nSubmenuHideDelay);}
+else{oSubmenu.hide();}}}
 oItem.handledMouseOutEvent=true;oItem.handledMouseOverEvent=false;}}
-if(!this._bHandledMouseOutEvent&&((oRelatedTarget!=this.element&&!Dom.isAncestor(this.element,oRelatedTarget))||bMovingToSubmenu)){this._bHandledMouseOutEvent=true;this._bHandledMouseOverEvent=false;}},_onClick:function(p_sType,p_aArgs,p_oMenu){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oTarget=Event.getTarget(oEvent);if(oItem&&!oItem.cfg.getProperty("disabled")){var oItemCfg=oItem.cfg,oSubmenu=oItemCfg.getProperty("submenu");if(oTarget==oItem.submenuIndicator&&oSubmenu){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();}
-else{this.clearActiveItem();this.activeItem=oItem;oItem.cfg.setProperty("selected",true);oSubmenu.show();}}
-else{var sURL=oItemCfg.getProperty("url"),bCurrentPageURL=(sURL.substr((sURL.length-1),1)=="#"),sTarget=oItemCfg.getProperty("target"),bHasTarget=(sTarget&&sTarget.length>0);if(oTarget.tagName.toUpperCase()=="A"&&bCurrentPageURL&&!bHasTarget){Event.preventDefault(oEvent);}
-if(oTarget.tagName.toUpperCase()!="A"&&!bCurrentPageURL&&!bHasTarget){document.location=sURL;}
-if(bCurrentPageURL&&!oSubmenu){var oRoot=this.getRoot();if(oRoot.cfg.getProperty("position")=="static"){oRoot.clearActiveItem();}
-else{oRoot.hide();}}}}},_onKeyDown:function(p_sType,p_aArgs,p_oMenu){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oSubmenu;if(oItem&&!oItem.cfg.getProperty("disabled")){var oItemCfg=oItem.cfg,oParentItem=this.parent,oRoot,oNextItem;switch(oEvent.keyCode){case 38:case 40:if(oItem==this.activeItem&&!oItemCfg.getProperty("selected")){oItemCfg.setProperty("selected",true);}
-else{oNextItem=(oEvent.keyCode==38)?oItem.getPreviousEnabledSibling():oItem.getNextEnabledSibling();if(oNextItem){this.clearActiveItem();oNextItem.cfg.setProperty("selected",true);oNextItem.focus();}}
-Event.preventDefault(oEvent);break;case 39:oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu){if(!oItemCfg.getProperty("selected")){oItemCfg.setProperty("selected",true);}
-oSubmenu.show();oSubmenu.setInitialSelection();}
+if(!this._bHandledMouseOutEvent&&((oRelatedTarget!=this.element&&!Dom.isAncestor(this.element,oRelatedTarget))||bMovingToSubmenu)){Event.removeListener(this.element,"mousemove",this._onMouseMove);this._nCurrentMouseX=Event.getPageX(oEvent);this._bHandledMouseOutEvent=true;this._bHandledMouseOverEvent=false;}},_onMouseMove:function(p_oEvent,p_oMenu){if(this._bStopMouseEventHandlers){return false;}
+this._nCurrentMouseX=Event.getPageX(p_oEvent);},_onClick:function(p_sType,p_aArgs){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oTarget,oItemCfg,oSubmenu,sURL,oRoot;if(oItem&&!oItem.cfg.getProperty("disabled")){oTarget=Event.getTarget(oEvent);oItemCfg=oItem.cfg;oSubmenu=oItemCfg.getProperty("submenu");if(oTarget==oItem.submenuIndicator&&oSubmenu){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();oSubmenu.parent.focus();}
+else{this.clearActiveItem();oItemCfg.setProperty("selected",true);oSubmenu.show();oSubmenu.setInitialFocus();}
+Event.preventDefault(oEvent);}
+else{sURL=oItemCfg.getProperty("url");if((sURL.substr((sURL.length-1),1)=="#")){Event.preventDefault(oEvent);oItem.focus();}
+if(!oSubmenu){oRoot=this.getRoot();if(oRoot instanceof YAHOO.widget.MenuBar||oRoot.cfg.getProperty("position")=="static"){oRoot.clearActiveItem();}
+else if(oRoot.cfg.getProperty("clicktohide")){oRoot.hide();}}}}},_onKeyDown:function(p_sType,p_aArgs){var oEvent=p_aArgs[0],oItem=p_aArgs[1],me=this,oSubmenu,oItemCfg,oParentItem,oRoot,oNextItem,oBody,nBodyScrollTop,nBodyOffsetHeight,aItems,nItems,nNextItemOffsetTop,nScrollTarget,oParentMenu;function stopMouseEventHandlers(){me._bStopMouseEventHandlers=true;window.setTimeout(function(){me._bStopMouseEventHandlers=false;},10);}
+if(oItem&&!oItem.cfg.getProperty("disabled")){oItemCfg=oItem.cfg;oParentItem=this.parent;switch(oEvent.keyCode){case 38:case 40:oNextItem=(oEvent.keyCode==38)?oItem.getPreviousEnabledSibling():oItem.getNextEnabledSibling();if(oNextItem){this.clearActiveItem();oNextItem.cfg.setProperty("selected",true);oNextItem.focus();if(this.cfg.getProperty("maxheight")>0){oBody=this.body;nBodyScrollTop=oBody.scrollTop;nBodyOffsetHeight=oBody.offsetHeight;aItems=this.getItems();nItems=aItems.length-1;nNextItemOffsetTop=oNextItem.element.offsetTop;if(oEvent.keyCode==40){if(nNextItemOffsetTop>=(nBodyOffsetHeight+nBodyScrollTop)){oBody.scrollTop=nNextItemOffsetTop-nBodyOffsetHeight;}
+else if(nNextItemOffsetTop<=nBodyScrollTop){oBody.scrollTop=0;}
+if(oNextItem==aItems[nItems]){oBody.scrollTop=oNextItem.element.offsetTop;}}
+else{if(nNextItemOffsetTop<=nBodyScrollTop){oBody.scrollTop=nNextItemOffsetTop-oNextItem.element.offsetHeight;}
+else if(nNextItemOffsetTop>=(nBodyScrollTop+nBodyOffsetHeight)){oBody.scrollTop=nNextItemOffsetTop;}
+if(oNextItem==aItems[0]){oBody.scrollTop=0;}}
+nBodyScrollTop=oBody.scrollTop;nScrollTarget=oBody.scrollHeight-oBody.offsetHeight;if(nBodyScrollTop===0){this._disableScrollHeader();this._enableScrollFooter();}
+else if(nBodyScrollTop==nScrollTarget){this._enableScrollHeader();this._disableScrollFooter();}
+else{this._enableScrollHeader();this._enableScrollFooter();}}}
+Event.preventDefault(oEvent);stopMouseEventHandlers();break;case 39:oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu){if(!oItemCfg.getProperty("selected")){oItemCfg.setProperty("selected",true);}
+oSubmenu.show();oSubmenu.setInitialFocus();oSubmenu.setInitialSelection();}
 else{oRoot=this.getRoot();if(oRoot instanceof YAHOO.widget.MenuBar){oNextItem=oRoot.activeItem.getNextEnabledSibling();if(oNextItem){oRoot.clearActiveItem();oNextItem.cfg.setProperty("selected",true);oSubmenu=oNextItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.show();}
 oNextItem.focus();}}}
-Event.preventDefault(oEvent);break;case 37:if(oParentItem){var oParentMenu=oParentItem.parent;if(oParentMenu instanceof YAHOO.widget.MenuBar){oNextItem=oParentMenu.activeItem.getPreviousEnabledSibling();if(oNextItem){oParentMenu.clearActiveItem();oNextItem.cfg.setProperty("selected",true);oSubmenu=oNextItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.show();}
+Event.preventDefault(oEvent);stopMouseEventHandlers();break;case 37:if(oParentItem){oParentMenu=oParentItem.parent;if(oParentMenu instanceof YAHOO.widget.MenuBar){oNextItem=oParentMenu.activeItem.getPreviousEnabledSibling();if(oNextItem){oParentMenu.clearActiveItem();oNextItem.cfg.setProperty("selected",true);oSubmenu=oNextItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.show();}
 oNextItem.focus();}}
 else{this.hide();oParentItem.focus();}}
-Event.preventDefault(oEvent);break;}}
+Event.preventDefault(oEvent);stopMouseEventHandlers();break;}}
 if(oEvent.keyCode==27){if(this.cfg.getProperty("position")=="dynamic"){this.hide();if(this.parent){this.parent.focus();}}
 else if(this.activeItem){oSubmenu=this.activeItem.cfg.getProperty("submenu");if(oSubmenu&&oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();this.activeItem.focus();}
-else{this.activeItem.cfg.setProperty("selected",false);this.activeItem.blur();}}
-Event.preventDefault(oEvent);}},_onTextResize:function(p_sType,p_aArgs,p_oMenu){if(this.browser=="gecko"&&!this._handleResize){this._handleResize=true;return;}
-var oConfig=this.cfg;if(oConfig.getProperty("position")=="dynamic"){oConfig.setProperty("width",(this._getOffsetWidth()+"px"));}},_onInit:function(p_sType,p_aArgs,p_oMenu){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();}
+else{this.activeItem.blur();this.activeItem.cfg.setProperty("selected",false);}}
+Event.preventDefault(oEvent);}},_onKeyPress:function(p_sType,p_aArgs){var oEvent=p_aArgs[0];if(oEvent.keyCode==40||oEvent.keyCode==38){Event.preventDefault(oEvent);}},_onTextResize:function(p_sType,p_aArgs,p_oMenu){if(YAHOO.env.ua.gecko&&!this._handleResize){this._handleResize=true;return;}
+var oConfig=this.cfg;if(oConfig.getProperty("position")=="dynamic"){oConfig.setProperty("width",(this._getOffsetWidth()+"px"));}},_onScrollTargetMouseOver:function(p_oEvent,p_oMenu){this._cancelHideDelay();var oTarget=Event.getTarget(p_oEvent),oBody=this.body,me=this,nScrollTarget,fnScrollFunction;function scrollBodyDown(){var nScrollTop=oBody.scrollTop;if(nScrollTop<nScrollTarget){oBody.scrollTop=(nScrollTop+1);me._enableScrollHeader();}
+else{oBody.scrollTop=nScrollTarget;window.clearInterval(me._nBodyScrollId);me._disableScrollFooter();}}
+function scrollBodyUp(){var nScrollTop=oBody.scrollTop;if(nScrollTop>0){oBody.scrollTop=(nScrollTop-1);me._enableScrollFooter();}
+else{oBody.scrollTop=0;window.clearInterval(me._nBodyScrollId);me._disableScrollHeader();}}
+if(Dom.hasClass(oTarget,"hd")){fnScrollFunction=scrollBodyUp;}
+else{nScrollTarget=oBody.scrollHeight-oBody.offsetHeight;fnScrollFunction=scrollBodyDown;}
+this._nBodyScrollId=window.setInterval(fnScrollFunction,10);},_onScrollTargetMouseOut:function(p_oEvent,p_oMenu){window.clearInterval(this._nBodyScrollId);this._cancelHideDelay();},_onInit:function(p_sType,p_aArgs){this.cfg.subscribeToConfigEvent("width",this._onWidthChange);this.cfg.subscribeToConfigEvent("visible",this._onVisibleChange);var bRootMenu=!this.parent,bLazyLoad=this.lazyLoad;if(((bRootMenu&&!bLazyLoad)||(bRootMenu&&(this.cfg.getProperty("visible")||this.cfg.getProperty("position")=="static"))||(!bRootMenu&&!bLazyLoad))&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}
 if(this.itemData){this.addItems(this.itemData);}}
-else if(this.lazyLoad){this.cfg.fireQueue();}},_onBeforeRender:function(p_sType,p_aArgs,p_oMenu){var oConfig=this.cfg,oEl=this.element,nListElements=this._aListElements.length;if(nListElements>0){var i=0,bFirstList=true,oUL,oGroupTitle;do{oUL=this._aListElements[i];if(oUL){if(bFirstList){Dom.addClass(oUL,"first-of-type");bFirstList=false;}
+else if(bLazyLoad){this.cfg.fireQueue();}},_onBeforeRender:function(p_sType,p_aArgs){var oConfig=this.cfg,oEl=this.element,nListElements=this._aListElements.length,bFirstList=true,i=0,oUL,oGroupTitle;if(nListElements>0){do{oUL=this._aListElements[i];if(oUL){if(bFirstList){Dom.addClass(oUL,"first-of-type");bFirstList=false;}
 if(!Dom.isAncestor(oEl,oUL)){this.appendToBody(oUL);}
 oGroupTitle=this._aGroupTitleElements[i];if(oGroupTitle){if(!Dom.isAncestor(oEl,oGroupTitle)){oUL.parentNode.insertBefore(oGroupTitle,oUL);}
 Dom.addClass(oUL,"hastitle");}}
 i++;}
-while(i<nListElements);}},_onRender:function(p_sType,p_aArgs,p_oMenu){if(this.cfg.getProperty("position")=="dynamic"){var sWidth=this.element.parentNode.tagName.toUpperCase()=="BODY"?this.element.offsetWidth:this._getOffsetWidth();this.cfg.setProperty("width",(sWidth+"px"));}},_onBeforeShow:function(p_sType,p_aArgs,p_oMenu){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 nOptions=this.itemData.length;for(var n=0;n<nOptions;n++){if(this.itemData[n].tagName){this.addItem((new this.ITEM_TYPE(this.itemData[n])));}}}
+while(i<nListElements);}},_onRender:function(p_sType,p_aArgs){if(this.cfg.getProperty("position")=="dynamic"&&!this.cfg.getProperty("width")){this._setWidth();}},_onBeforeShow:function(p_sType,p_aArgs){var nOptions,n,nViewportHeight,oRegion,nMaxHeight,oBody,oSrcElement;if(this.lazyLoad&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}
+if(this.itemData){if(this.parent&&this.parent.parent&&this.parent.parent.srcElement&&this.parent.parent.srcElement.tagName.toUpperCase()=="SELECT"){nOptions=this.itemData.length;for(n=0;n<nOptions;n++){if(this.itemData[n].tagName){this.addItem((new this.ITEM_TYPE(this.itemData[n])));}}}
 else{this.addItems(this.itemData);}}
-if(this.srcElement){this.render();}
+oSrcElement=this.srcElement;if(oSrcElement){if(oSrcElement.tagName.toUpperCase()=="SELECT"){if(Dom.inDocument(oSrcElement)){this.render(oSrcElement.parentNode);}
+else{this.render(this.cfg.getProperty("container"));}}
+else{this.render();}}
 else{if(this.parent){this.render(this.parent.element);}
-else{this.render(this.cfg.getProperty("container"));}}}},_onShow:function(p_sType,p_aArgs,p_oMenu){this.setInitialFocus();var oParent=this.parent;if(oParent){var oParentMenu=oParent.parent,aParentAlignment=oParentMenu.cfg.getProperty("submenualignment"),aAlignment=this.cfg.getProperty("submenualignment");if((aParentAlignment[0]!=aAlignment[0])&&(aParentAlignment[1]!=aAlignment[1])){this.cfg.setProperty("submenualignment",[aParentAlignment[0],aParentAlignment[1]]);}
-if(!oParentMenu.cfg.getProperty("autosubmenudisplay")&&oParentMenu.cfg.getProperty("position")=="static"){oParentMenu.cfg.setProperty("autosubmenudisplay",true);function disableAutoSubmenuDisplay(p_oEvent){if(p_oEvent.type=="mousedown"||(p_oEvent.type=="keydown"&&p_oEvent.keyCode==27)){var oTarget=Event.getTarget(p_oEvent);if(oTarget!=oParentMenu.element||!YAHOO.util.Dom.isAncestor(oParentMenu.element,oTarget)){oParentMenu.cfg.setProperty("autosubmenudisplay",false);Event.removeListener(document,"mousedown",disableAutoSubmenuDisplay);Event.removeListener(document,"keydown",disableAutoSubmenuDisplay);}}}
-Event.addListener(document,"mousedown",disableAutoSubmenuDisplay);Event.addListener(document,"keydown",disableAutoSubmenuDisplay);}}},_onBeforeHide:function(p_sType,p_aArgs,p_oMenu){var oActiveItem=this.activeItem;if(oActiveItem){var oConfig=oActiveItem.cfg;oConfig.setProperty("selected",false);var oSubmenu=oConfig.getProperty("submenu");if(oSubmenu){oSubmenu.hide();}
-oActiveItem.blur();}},_onParentMenuConfigChange:function(p_sType,p_aArgs,p_oSubmenu){var sPropertyName=p_aArgs[0][0],oPropertyValue=p_aArgs[0][1];switch(sPropertyName){case"iframe":case"constraintoviewport":case"hidedelay":case"showdelay":case"clicktohide":case"effect":p_oSubmenu.cfg.setProperty(sPropertyName,oPropertyValue);break;}},_onParentMenuRender:function(p_sType,p_aArgs,p_oSubmenu){var oParentMenu=p_oSubmenu.parent.parent,oConfig={constraintoviewport:oParentMenu.cfg.getProperty("constraintoviewport"),xy:[0,0],clicktohide:oParentMenu.cfg.getProperty("clicktohide"),effect:oParentMenu.cfg.getProperty("effect"),showdelay:oParentMenu.cfg.getProperty("showdelay"),hidedelay:oParentMenu.cfg.getProperty("hidedelay")};if(this.cfg.getProperty("position")==oParentMenu.cfg.getProperty("position")){oConfig.iframe=oParentMenu.cfg.getProperty("iframe");}
-p_oSubmenu.cfg.applyConfig(oConfig);if(!this.lazyLoad){if(Dom.inDocument(this.element)){this.render();}
-else{this.render(this.parent.element);}}},_onSubmenuBeforeShow:function(p_sType,p_aArgs,p_oSubmenu){var oParent=this.parent,aAlignment=oParent.parent.cfg.getProperty("submenualignment");this.cfg.setProperty("context",[oParent.element,aAlignment[0],aAlignment[1]]);},_onSubmenuShow:function(p_sType,p_aArgs,p_oSubmenu){var oParent=this.parent;oParent.submenuIndicator.alt=oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;},_onSubmenuHide:function(p_sType,p_aArgs,p_oSubmenu){var oParent=this.parent;oParent.submenuIndicator.alt=oParent.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;},_onMenuItemFocus:function(p_sType,p_aArgs,p_oItem){this.activeItem=p_oItem;},_onMenuItemBlur:function(p_sType,p_aArgs){this.activeItem=null;},_onMenuItemConfigChange:function(p_sType,p_aArgs,p_oItem){var sProperty=p_aArgs[0][0];switch(sProperty){case"submenu":var oSubmenu=p_aArgs[0][1];if(oSubmenu){this._configureSubmenu(p_oItem);}
-break;case"text":case"helptext":if(this.element.style.width){var sWidth=this._getOffsetWidth()+"px";Dom.setStyle(this.element,"width",sWidth);}
-break;}},enforceConstraints:function(type,args,obj){var oConfig=this.cfg,pos=args[0],x=pos[0],y=pos[1],offsetHeight=this.element.offsetHeight,offsetWidth=this.element.offsetWidth,viewPortWidth=YAHOO.util.Dom.getViewportWidth(),viewPortHeight=YAHOO.util.Dom.getViewportHeight(),scrollX=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollY=Math.max(document.documentElement.scrollTop,document.body.scrollTop),topConstraint=scrollY+10,leftConstraint=scrollX+10,bottomConstraint=scrollY+viewPortHeight-offsetHeight-10,rightConstraint=scrollX+viewPortWidth-offsetWidth-10,aContext=oConfig.getProperty("context"),oContextElement=aContext?aContext[0]:null;if(x<10){x=leftConstraint;}else if((x+offsetWidth)>viewPortWidth){if(oContextElement&&((x-oContextElement.offsetWidth)>offsetWidth)){x=(x-(oContextElement.offsetWidth+offsetWidth));}
+else{this.render(this.cfg.getProperty("container"));this.cfg.refireEvent("xy");}}}
+if(!(this instanceof YAHOO.widget.MenuBar)&&this.cfg.getProperty("position")=="dynamic"){nViewportHeight=Dom.getViewportHeight();if(this.parent&&this.parent.parent instanceof YAHOO.widget.MenuBar){oRegion=YAHOO.util.Region.getRegion(this.parent.element);nViewportHeight=(nViewportHeight-oRegion.bottom);}
+if(this.element.offsetHeight>=nViewportHeight){nMaxHeight=this.cfg.getProperty("maxheight");this._nMaxHeight=nMaxHeight;this.cfg.setProperty("maxheight",(nViewportHeight-20));}
+if(this.cfg.getProperty("maxheight")>0){oBody=this.body;if(oBody.scrollTop>0){oBody.scrollTop=0;}
+this._disableScrollHeader();this._enableScrollFooter();}}},_onShow:function(p_sType,p_aArgs){var oParent=this.parent,oParentMenu,aParentAlignment,aAlignment;function disableAutoSubmenuDisplay(p_oEvent){var oTarget;if(p_oEvent.type=="mousedown"||(p_oEvent.type=="keydown"&&p_oEvent.keyCode==27)){oTarget=Event.getTarget(p_oEvent);if(oTarget!=oParentMenu.element||!Dom.isAncestor(oParentMenu.element,oTarget)){oParentMenu.cfg.setProperty("autosubmenudisplay",false);Event.removeListener(document,"mousedown",disableAutoSubmenuDisplay);Event.removeListener(document,"keydown",disableAutoSubmenuDisplay);}}}
+if(oParent){oParentMenu=oParent.parent;aParentAlignment=oParentMenu.cfg.getProperty("submenualignment");aAlignment=this.cfg.getProperty("submenualignment");if((aParentAlignment[0]!=aAlignment[0])&&(aParentAlignment[1]!=aAlignment[1])){this.cfg.setProperty("submenualignment",[aParentAlignment[0],aParentAlignment[1]]);}
+if(!oParentMenu.cfg.getProperty("autosubmenudisplay")&&(oParentMenu instanceof YAHOO.widget.MenuBar||oParentMenu.cfg.getProperty("position")=="static")){oParentMenu.cfg.setProperty("autosubmenudisplay",true);Event.on(document,"mousedown",disableAutoSubmenuDisplay);Event.on(document,"keydown",disableAutoSubmenuDisplay);}}},_onBeforeHide:function(p_sType,p_aArgs){var oActiveItem=this.activeItem,oConfig,oSubmenu;if(oActiveItem){oConfig=oActiveItem.cfg;oConfig.setProperty("selected",false);oSubmenu=oConfig.getProperty("submenu");if(oSubmenu){oSubmenu.hide();}}
+if(this.getRoot()==this){this.blur();}},_onHide:function(p_sType,p_aArgs){if(this._nMaxHeight!=-1){this.cfg.setProperty("maxheight",this._nMaxHeight);this._nMaxHeight=-1;}},_onParentMenuConfigChange:function(p_sType,p_aArgs,p_oSubmenu){var sPropertyName=p_aArgs[0][0],oPropertyValue=p_aArgs[0][1];switch(sPropertyName){case"iframe":case"constraintoviewport":case"hidedelay":case"showdelay":case"submenuhidedelay":case"clicktohide":case"effect":case"classname":p_oSubmenu.cfg.setProperty(sPropertyName,oPropertyValue);break;}},_onParentMenuRender:function(p_sType,p_aArgs,p_oSubmenu){var oParentMenu=p_oSubmenu.parent.parent,oConfig={constraintoviewport:oParentMenu.cfg.getProperty("constraintoviewport"),xy:[0,0],clicktohide:oParentMenu.cfg.getProperty("clicktohide"),effect:oParentMenu.cfg.getProperty("effect"),showdelay:oParentMenu.cfg.getProperty("showdelay"),hidedelay:oParentMenu.cfg.getProperty("hidedelay"),submenuhidedelay:oParentMenu.cfg.getProperty("submenuhidedelay"),classname:oParentMenu.cfg.getProperty("classname")},oLI;if(this.cfg.getProperty("position")==oParentMenu.cfg.getProperty("position")){oConfig.iframe=oParentMenu.cfg.getProperty("iframe");}
+p_oSubmenu.cfg.applyConfig(oConfig);if(!this.lazyLoad){oLI=this.parent.element;if(this.element.parentNode==oLI){this.render();}
+else{this.render(oLI);}}},_onSubmenuBeforeShow:function(p_sType,p_aArgs){var oParent=this.parent,aAlignment=oParent.parent.cfg.getProperty("submenualignment");this.cfg.setProperty("context",[oParent.element,aAlignment[0],aAlignment[1]]);var nScrollTop=oParent.parent.body.scrollTop;if((YAHOO.env.ua.gecko||YAHOO.env.ua.webkit)&&nScrollTop>0){this.cfg.setProperty("y",(this.cfg.getProperty("y")-nScrollTop));}},_onSubmenuShow:function(p_sType,p_aArgs){this.submenuIndicator.innerHTML=this.EXPANDED_SUBMENU_INDICATOR_TEXT;},_onSubmenuHide:function(p_sType,p_aArgs){this.submenuIndicator.innerHTML=this.COLLAPSED_SUBMENU_INDICATOR_TEXT;},_onMenuItemFocus:function(p_sType,p_aArgs){this.parent.focusEvent.fire(this);},_onMenuItemBlur:function(p_sType,p_aArgs){this.parent.blurEvent.fire(this);},_onMenuItemConfigChange:function(p_sType,p_aArgs,p_oItem){var sPropertyName=p_aArgs[0][0],oPropertyValue=p_aArgs[0][1],sWidth,oSubmenu;switch(sPropertyName){case"selected":if(oPropertyValue===true){this.activeItem=p_oItem;}
+break;case"submenu":oSubmenu=p_aArgs[0][1];if(oSubmenu){this._configureSubmenu(p_oItem);}
+break;case"text":case"helptext":if(this.element.style.width){sWidth=this._getOffsetWidth()+"px";Dom.setStyle(this.element,"width",sWidth);}
+break;}},enforceConstraints:function(type,args,obj){var oParentMenuItem=this.parent,oElement,oConfig,pos,x,y,offsetHeight,offsetWidth,viewPortWidth,viewPortHeight,scrollX,scrollY,nPadding,topConstraint,leftConstraint,bottomConstraint,rightConstraint,aContext,oContextElement;if(oParentMenuItem&&!(oParentMenuItem.parent instanceof YAHOO.widget.MenuBar)){oElement=this.element;oConfig=this.cfg;pos=args[0];x=pos[0];y=pos[1];offsetHeight=oElement.offsetHeight;offsetWidth=oElement.offsetWidth;viewPortWidth=Dom.getViewportWidth();viewPortHeight=Dom.getViewportHeight();scrollX=Dom.getDocumentScrollLeft();scrollY=Dom.getDocumentScrollTop();nPadding=(oParentMenuItem.parent instanceof YAHOO.widget.MenuBar)?0:10;topConstraint=scrollY+nPadding;leftConstraint=scrollX+nPadding;bottomConstraint=scrollY+viewPortHeight-offsetHeight-nPadding;rightConstraint=scrollX+viewPortWidth-offsetWidth-nPadding;aContext=oConfig.getProperty("context");oContextElement=aContext?aContext[0]:null;if(x<10){x=leftConstraint;}else if((x+offsetWidth)>viewPortWidth){if(oContextElement&&((x-oContextElement.offsetWidth)>offsetWidth)){x=(x-(oContextElement.offsetWidth+offsetWidth));}
 else{x=rightConstraint;}}
 if(y<10){y=topConstraint;}else if(y>bottomConstraint){if(oContextElement&&(y>offsetHeight)){y=((y+oContextElement.offsetHeight)-offsetHeight);}
 else{y=bottomConstraint;}}
-oConfig.setProperty("x",x,true);oConfig.setProperty("y",y,true);oConfig.setProperty("xy",[x,y],true);},configVisible:function(p_sType,p_aArgs,p_oMenu){if(this.cfg.getProperty("position")=="dynamic"){YAHOO.widget.Menu.superclass.configVisible.call(this,p_sType,p_aArgs,p_oMenu);}
-else{var bVisible=p_aArgs[0],sDisplay=Dom.getStyle(this.element,"display");if(bVisible){if(sDisplay!="block"){this.beforeShowEvent.fire();Dom.setStyle(this.element,"display","block");this.showEvent.fire();}}
-else{if(sDisplay=="block"){this.beforeHideEvent.fire();Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}}}},configPosition:function(p_sType,p_aArgs,p_oMenu){var sCSSPosition=p_aArgs[0]=="static"?"static":"absolute",oCfg=this.cfg;Dom.setStyle(this.element,"position",sCSSPosition);if(sCSSPosition=="static"){oCfg.setProperty("iframe",false);Dom.setStyle(this.element,"display","block");oCfg.setProperty("visible",true);}
-else{Dom.setStyle(this.element,"visibility","hidden");}
-if(sCSSPosition=="absolute"){var nZIndex=oCfg.getProperty("zindex");if(!nZIndex||nZIndex===0){nZIndex=this.parent?(this.parent.parent.cfg.getProperty("zindex")+1):1;oCfg.setProperty("zindex",nZIndex);}}},configIframe:function(p_sType,p_aArgs,p_oMenu){if(this.cfg.getProperty("position")=="dynamic"){YAHOO.widget.Menu.superclass.configIframe.call(this,p_sType,p_aArgs,p_oMenu);}},configHideDelay:function(p_sType,p_aArgs,p_oMenu){var nHideDelay=p_aArgs[0],oMouseOutEvent=this.mouseOutEvent,oMouseOverEvent=this.mouseOverEvent,oKeyDownEvent=this.keyDownEvent;if(nHideDelay>0){if(!this._hideDelayEventHandlersAssigned){oMouseOutEvent.subscribe(this._execHideDelay,true);oMouseOverEvent.subscribe(this._cancelHideDelay,this,true);oKeyDownEvent.subscribe(this._cancelHideDelay,this,true);this._hideDelayEventHandlersAssigned=true;}}
-else{oMouseOutEvent.unsubscribe(this._execHideDelay,this);oMouseOverEvent.unsubscribe(this._cancelHideDelay,this);oKeyDownEvent.unsubscribe(this._cancelHideDelay,this);this._hideDelayEventHandlersAssigned=false;}},configContainer:function(p_sType,p_aArgs,p_oMenu){var oElement=p_aArgs[0];if(typeof oElement=='string'){this.cfg.setProperty("container",document.getElementById(oElement),true);}},initEvents:function(){YAHOO.widget.Menu.superclass.initEvents.call(this);var CustomEvent=YAHOO.util.CustomEvent;this.mouseOverEvent=new CustomEvent("mouseOverEvent",this);this.mouseOutEvent=new CustomEvent("mouseOutEvent",this);this.mouseDownEvent=new CustomEvent("mouseDownEvent",this);this.mouseUpEvent=new CustomEvent("mouseUpEvent",this);this.clickEvent=new CustomEvent("clickEvent",this);this.keyPressEvent=new CustomEvent("keyPressEvent",this);this.keyDownEvent=new CustomEvent("keyDownEvent",this);this.keyUpEvent=new CustomEvent("keyUpEvent",this);this.itemAddedEvent=new CustomEvent("itemAddedEvent",this);this.itemRemovedEvent=new CustomEvent("itemRemovedEvent",this);},getRoot:function(){var oItem=this.parent;if(oItem){var oParentMenu=oItem.parent;return oParentMenu?oParentMenu.getRoot():this;}
-else{return this;}},toString:function(){return("Menu "+this.id);},setItemGroupTitle:function(p_sGroupTitle,p_nGroupIndex){if(typeof p_sGroupTitle=="string"&&p_sGroupTitle.length>0){var nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0,oTitle=this._aGroupTitleElements[nGroupIndex];if(oTitle){oTitle.innerHTML=p_sGroupTitle;}
+oConfig.setProperty("x",x,true);oConfig.setProperty("y",y,true);oConfig.setProperty("xy",[x,y],true);}
+else if(this==this.getRoot()&&this.cfg.getProperty("position")=="dynamic"){Menu.superclass.enforceConstraints.call(this,type,args,obj);}},configVisible:function(p_sType,p_aArgs,p_oMenu){var bVisible,sDisplay;if(this.cfg.getProperty("position")=="dynamic"){Menu.superclass.configVisible.call(this,p_sType,p_aArgs,p_oMenu);}
+else{bVisible=p_aArgs[0];sDisplay=Dom.getStyle(this.element,"display");if(bVisible){if(sDisplay!="block"){this.beforeShowEvent.fire();Dom.setStyle(this.element,"display","block");this.showEvent.fire();}}
+else{if(sDisplay=="block"){this.beforeHideEvent.fire();Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}}}},configPosition:function(p_sType,p_aArgs,p_oMenu){var oElement=this.element,sCSSPosition=p_aArgs[0]=="static"?"static":"absolute",sCurrentPosition=Dom.getStyle(oElement,"position"),oCfg=this.cfg,nZIndex;Dom.setStyle(this.element,"position",sCSSPosition);if(sCSSPosition=="static"){oCfg.setProperty("iframe",false);Dom.setStyle(this.element,"display","block");oCfg.setProperty("visible",true);}
+else{if(sCurrentPosition!="absolute"){oCfg.setProperty("iframe",(YAHOO.env.ua.ie==6?true:false));}
+Dom.setStyle(this.element,"visibility","hidden");}
+if(sCSSPosition=="absolute"){nZIndex=oCfg.getProperty("zindex");if(!nZIndex||nZIndex===0){nZIndex=this.parent?(this.parent.parent.cfg.getProperty("zindex")+1):1;oCfg.setProperty("zindex",nZIndex);}}},configIframe:function(p_sType,p_aArgs,p_oMenu){if(this.cfg.getProperty("position")=="dynamic"){Menu.superclass.configIframe.call(this,p_sType,p_aArgs,p_oMenu);}},configHideDelay:function(p_sType,p_aArgs,p_oMenu){var nHideDelay=p_aArgs[0],oMouseOutEvent=this.mouseOutEvent,oMouseOverEvent=this.mouseOverEvent,oKeyDownEvent=this.keyDownEvent;if(nHideDelay>0){if(!this._bHideDelayEventHandlersAssigned){oMouseOutEvent.subscribe(this._execHideDelay);oMouseOverEvent.subscribe(this._cancelHideDelay);oKeyDownEvent.subscribe(this._cancelHideDelay);this._bHideDelayEventHandlersAssigned=true;}}
+else{oMouseOutEvent.unsubscribe(this._execHideDelay);oMouseOverEvent.unsubscribe(this._cancelHideDelay);oKeyDownEvent.unsubscribe(this._cancelHideDelay);this._bHideDelayEventHandlersAssigned=false;}},configContainer:function(p_sType,p_aArgs,p_oMenu){var oElement=p_aArgs[0];if(typeof oElement=='string'){this.cfg.setProperty("container",document.getElementById(oElement),true);}},_setMaxHeight:function(p_sType,p_aArgs,p_nMaxHeight){this.cfg.setProperty("maxheight",p_nMaxHeight);this.renderEvent.unsubscribe(this._setMaxHeight);},configMaxHeight:function(p_sType,p_aArgs,p_oMenu){var nMaxHeight=p_aArgs[0],oBody=this.body,oHeader=this.header,oFooter=this.footer,fnMouseOver=this._onScrollTargetMouseOver,fnMouseOut=this._onScrollTargetMouseOut,nHeight;if(this.lazyLoad&&!oBody){this.renderEvent.unsubscribe(this._setMaxHeight);if(nMaxHeight>0){this.renderEvent.subscribe(this._setMaxHeight,nMaxHeight,this);}
+return;}
+Dom.setStyle(oBody,"height","auto");Dom.setStyle(oBody,"overflow","visible");if((nMaxHeight>0)&&(oBody.offsetHeight>nMaxHeight)){if(!this.cfg.getProperty("width")){this._setWidth();}
+if(!oHeader&&!oFooter){this.setHeader("&#32;");this.setFooter("&#32;");oHeader=this.header;oFooter=this.footer;Dom.addClass(oHeader,"topscrollbar");Dom.addClass(oFooter,"bottomscrollbar");this.element.insertBefore(oHeader,oBody);this.element.appendChild(oFooter);Event.on(oHeader,"mouseover",fnMouseOver,this,true);Event.on(oHeader,"mouseout",fnMouseOut,this,true);Event.on(oFooter,"mouseover",fnMouseOver,this,true);Event.on(oFooter,"mouseout",fnMouseOut,this,true);}
+nHeight=(nMaxHeight-(this.footer.offsetHeight+
+this.header.offsetHeight));Dom.setStyle(oBody,"height",(nHeight+"px"));Dom.setStyle(oBody,"overflow","hidden");}
+else if(oHeader&&oFooter){Dom.setStyle(oBody,"height","auto");Dom.setStyle(oBody,"overflow","visible");Event.removeListener(oHeader,"mouseover",fnMouseOver);Event.removeListener(oHeader,"mouseout",fnMouseOut);Event.removeListener(oFooter,"mouseover",fnMouseOver);Event.removeListener(oFooter,"mouseout",fnMouseOut);this.element.removeChild(oHeader);this.element.removeChild(oFooter);this.header=null;this.footer=null;}
+this.cfg.refireEvent("iframe");},configClassName:function(p_sType,p_aArgs,p_oMenu){var sClassName=p_aArgs[0];if(this._sClassName){Dom.removeClass(this.element,this._sClassName);}
+Dom.addClass(this.element,sClassName);this._sClassName=sClassName;},_onItemAdded:function(p_sType,p_aArgs){var oItem=p_aArgs[0];if(oItem){oItem.cfg.setProperty("disabled",true);}},configDisabled:function(p_sType,p_aArgs,p_oMenu){var bDisabled=p_aArgs[0],aItems,nItems,i;if(this._bDisabled!=bDisabled){aItems=this.getItems();nItems=aItems.length;if(nItems>0){i=nItems-1;do{aItems[i].cfg.setProperty("disabled",bDisabled);}
+while(i--);}
+Dom[(bDisabled?"addClass":"removeClass")](this.element,"disabled");this.itemAddedEvent[(bDisabled?"subscribe":"unsubscribe")](this._onItemAdded);this._bDisabled=bDisabled;}},onRender:function(p_sType,p_aArgs){function sizeShadow(){var oElement=this.element,oShadow=this._shadow;if(oShadow){oShadow.style.width=(oElement.offsetWidth+6)+"px";oShadow.style.height=(oElement.offsetHeight+1)+"px";}}
+function addShadowVisibleClass(){Dom.addClass(this._shadow,"yui-menu-shadow-visible");}
+function removeShadowVisibleClass(){Dom.removeClass(this._shadow,"yui-menu-shadow-visible");}
+function createShadow(){var oShadow=this._shadow,oElement,me;if(!oShadow){oElement=this.element;me=this;if(!m_oShadowTemplate){m_oShadowTemplate=document.createElement("div");m_oShadowTemplate.className="yui-menu-shadow";}
+oShadow=m_oShadowTemplate.cloneNode(false);oElement.appendChild(oShadow);this._shadow=oShadow;addShadowVisibleClass.call(this);this.beforeShowEvent.subscribe(addShadowVisibleClass);this.beforeHideEvent.subscribe(removeShadowVisibleClass);if(YAHOO.env.ua.ie){window.setTimeout(function(){sizeShadow.call(me);me.syncIframe();},0);this.cfg.subscribeToConfigEvent("width",sizeShadow);this.cfg.subscribeToConfigEvent("height",sizeShadow);this.changeContentEvent.subscribe(sizeShadow);Module.textResizeEvent.subscribe(sizeShadow,me,true);this.destroyEvent.subscribe(function(){Module.textResizeEvent.unsubscribe(sizeShadow,me);});}}}
+function onBeforeShow(){createShadow.call(this);this.beforeShowEvent.unsubscribe(onBeforeShow);}
+if(this.cfg.getProperty("position")=="dynamic"){if(this.cfg.getProperty("visible")){createShadow.call(this);}
+else{this.beforeShowEvent.subscribe(onBeforeShow);}}},initEvents:function(){Menu.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.mouseOverEvent=this.createEvent(EVENT_TYPES.MOUSE_OVER);this.mouseOverEvent.signature=SIGNATURE;this.mouseOutEvent=this.createEvent(EVENT_TYPES.MOUSE_OUT);this.mouseOutEvent.signature=SIGNATURE;this.mouseDownEvent=this.createEvent(EVENT_TYPES.MOUSE_DOWN);this.mouseDownEvent.signature=SIGNATURE;this.mouseUpEvent=this.createEvent(EVENT_TYPES.MOUSE_UP);this.mouseUpEvent.signature=SIGNATURE;this.clickEvent=this.createEvent(EVENT_TYPES.CLICK);this.clickEvent.signature=SIGNATURE;this.keyPressEvent=this.createEvent(EVENT_TYPES.KEY_PRESS);this.keyPressEvent.signature=SIGNATURE;this.keyDownEvent=this.createEvent(EVENT_TYPES.KEY_DOWN);this.keyDownEvent.signature=SIGNATURE;this.keyUpEvent=this.createEvent(EVENT_TYPES.KEY_UP);this.keyUpEvent.signature=SIGNATURE;this.focusEvent=this.createEvent(EVENT_TYPES.FOCUS);this.focusEvent.signature=SIGNATURE;this.blurEvent=this.createEvent(EVENT_TYPES.BLUR);this.blurEvent.signature=SIGNATURE;this.itemAddedEvent=this.createEvent(EVENT_TYPES.ITEM_ADDED);this.itemAddedEvent.signature=SIGNATURE;this.itemRemovedEvent=this.createEvent(EVENT_TYPES.ITEM_REMOVED);this.itemRemovedEvent.signature=SIGNATURE;},getRoot:function(){var oItem=this.parent,oParentMenu;if(oItem){oParentMenu=oItem.parent;return oParentMenu?oParentMenu.getRoot():this;}
+else{return this;}},toString:function(){var sReturnVal="Menu",sId=this.id;if(sId){sReturnVal+=(" "+sId);}
+return sReturnVal;},setItemGroupTitle:function(p_sGroupTitle,p_nGroupIndex){var nGroupIndex,oTitle,i,nFirstIndex;if(typeof p_sGroupTitle=="string"&&p_sGroupTitle.length>0){nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0;oTitle=this._aGroupTitleElements[nGroupIndex];if(oTitle){oTitle.innerHTML=p_sGroupTitle;}
 else{oTitle=document.createElement(this.GROUP_TITLE_TAG_NAME);oTitle.innerHTML=p_sGroupTitle;this._aGroupTitleElements[nGroupIndex]=oTitle;}
-var i=this._aGroupTitleElements.length-1,nFirstIndex;do{if(this._aGroupTitleElements[i]){Dom.removeClass(this._aGroupTitleElements[i],"first-of-type");nFirstIndex=i;}}
-while(i--);if(nFirstIndex!==null){Dom.addClass(this._aGroupTitleElements[nFirstIndex],"first-of-type");}}},addItem:function(p_oItem,p_nGroupIndex){if(p_oItem){return this._addItemToGroup(p_nGroupIndex,p_oItem);}},addItems:function(p_aItems,p_nGroupIndex){function isArray(p_oValue){return(typeof p_oValue=="object"&&p_oValue.constructor==Array);}
-if(isArray(p_aItems)){var nItems=p_aItems.length,aItems=[],oItem;for(var i=0;i<nItems;i++){oItem=p_aItems[i];if(isArray(oItem)){aItems[aItems.length]=this.addItems(oItem,i);}
-else{aItems[aItems.length]=this._addItemToGroup(p_nGroupIndex,oItem);}}
-if(aItems.length){return aItems;}}},insertItem:function(p_oItem,p_nItemIndex,p_nGroupIndex){if(p_oItem){return this._addItemToGroup(p_nGroupIndex,p_oItem,p_nItemIndex);}},removeItem:function(p_oObject,p_nGroupIndex){if(typeof p_oObject!="undefined"){var oItem;if(p_oObject instanceof YAHOO.widget.MenuItem){oItem=this._removeItemFromGroupByValue(p_nGroupIndex,p_oObject);}
+i=this._aGroupTitleElements.length-1;do{if(this._aGroupTitleElements[i]){Dom.removeClass(this._aGroupTitleElements[i],"first-of-type");nFirstIndex=i;}}
+while(i--);if(nFirstIndex!==null){Dom.addClass(this._aGroupTitleElements[nFirstIndex],"first-of-type");}
+this.changeContentEvent.fire();}},addItem:function(p_oItem,p_nGroupIndex){if(p_oItem){return this._addItemToGroup(p_nGroupIndex,p_oItem);}},addItems:function(p_aItems,p_nGroupIndex){var nItems,aItems,oItem,i;if(Lang.isArray(p_aItems)){nItems=p_aItems.length;aItems=[];for(i=0;i<nItems;i++){oItem=p_aItems[i];if(oItem){if(Lang.isArray(oItem)){aItems[aItems.length]=this.addItems(oItem,i);}
+else{aItems[aItems.length]=this._addItemToGroup(p_nGroupIndex,oItem);}}}
+if(aItems.length){return aItems;}}},insertItem:function(p_oItem,p_nItemIndex,p_nGroupIndex){if(p_oItem){return this._addItemToGroup(p_nGroupIndex,p_oItem,p_nItemIndex);}},removeItem:function(p_oObject,p_nGroupIndex){var oItem;if(typeof p_oObject!="undefined"){if(p_oObject instanceof YAHOO.widget.MenuItem){oItem=this._removeItemFromGroupByValue(p_nGroupIndex,p_oObject);}
 else if(typeof p_oObject=="number"){oItem=this._removeItemFromGroupByIndex(p_nGroupIndex,p_oObject);}
-if(oItem){oItem.destroy();return oItem;}}},getItemGroups:function(){return this._aItemGroups;},getItem:function(p_nItemIndex,p_nGroupIndex){if(typeof p_nItemIndex=="number"){var aGroup=this._getItemGroup(p_nGroupIndex);if(aGroup){return aGroup[p_nItemIndex];}}},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();this.itemAddedEvent.unsubscribeAll();this.itemRemovedEvent.unsubscribeAll();var nItemGroups=this._aItemGroups.length,nItems,oItemGroup,oItem,i,n;if(nItemGroups>0){i=nItemGroups-1;do{oItemGroup=this._aItemGroups[i];if(oItemGroup){nItems=oItemGroup.length;if(nItems>0){n=nItems-1;do{oItem=this._aItemGroups[i][n];if(oItem){oItem.destroy();}}
-while(n--);}}}
+if(oItem){oItem.destroy();return oItem;}}},getItems:function(){var aGroups=this._aItemGroups,nGroups=aGroups.length;return((nGroups==1)?aGroups[0]:(Array.prototype.concat.apply([],aGroups)));},getItemGroups:function(){return this._aItemGroups;},getItem:function(p_nItemIndex,p_nGroupIndex){var aGroup;if(typeof p_nItemIndex=="number"){aGroup=this._getItemGroup(p_nGroupIndex);if(aGroup){return aGroup[p_nItemIndex];}}},getSubmenus:function(){var aItems=this.getItems(),nItems=aItems.length,aSubmenus,oSubmenu,oItem,i;if(nItems>0){aSubmenus=[];for(i=0;i<nItems;i++){oItem=aItems[i];if(oItem){oSubmenu=oItem.cfg.getProperty("submenu");if(oSubmenu){aSubmenus[aSubmenus.length]=oSubmenu;}}}}
+return aSubmenus;},clearContent:function(){var aItems=this.getItems(),nItems=aItems.length,oElement=this.element,oBody=this.body,oHeader=this.header,oFooter=this.footer,oItem,oSubmenu,i;if(nItems>0){i=nItems-1;do{oItem=aItems[i];if(oItem){oSubmenu=oItem.cfg.getProperty("submenu");if(oSubmenu){this.cfg.configChangedEvent.unsubscribe(this._onParentMenuConfigChange,oSubmenu);this.renderEvent.unsubscribe(this._onParentMenuRender,oSubmenu);}
+this.removeItem(oItem);}}
 while(i--);}
-YAHOO.widget.Menu.superclass.destroy.call(this);},setInitialFocus:function(){var oItem=this._getFirstEnabledItem();if(oItem){oItem.focus();}},setInitialSelection:function(){var oItem=this._getFirstEnabledItem();if(oItem){oItem.cfg.setProperty("selected",true);}},clearActiveItem:function(p_bBlur){if(this.cfg.getProperty("showdelay")>0){this._cancelShowDelay();}
-var oActiveItem=this.activeItem;if(oActiveItem){var oConfig=oActiveItem.cfg;oConfig.setProperty("selected",false);var oSubmenu=oConfig.getProperty("submenu");if(oSubmenu){oSubmenu.hide();}
-if(p_bBlur){oActiveItem.blur();}}},initDefaultConfig:function(){YAHOO.widget.Menu.superclass.initDefaultConfig.call(this);var oConfig=this.cfg;oConfig.addProperty("visible",{value:false,handler:this.configVisible,validator:this.cfg.checkBoolean});oConfig.addProperty("constraintoviewport",{value:true,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});oConfig.addProperty("position",{value:"dynamic",handler:this.configPosition,validator:this._checkPosition,supercedes:["visible"]});oConfig.addProperty("submenualignment",{value:["tl","tr"]});oConfig.addProperty("autosubmenudisplay",{value:true,validator:oConfig.checkBoolean});oConfig.addProperty("showdelay",{value:0,validator:oConfig.checkNumber});oConfig.addProperty("hidedelay",{value:0,validator:oConfig.checkNumber,handler:this.configHideDelay,suppressEvent:true});oConfig.addProperty("clicktohide",{value:true,validator:oConfig.checkBoolean});this.cfg.addProperty("container",{value:document.body,handler:this.configContainer});}});})();YAHOO.widget.MenuModule=YAHOO.widget.Menu;(function(){var Dom=YAHOO.util.Dom,Module=YAHOO.widget.Module,Menu=YAHOO.widget.Menu;YAHOO.widget.MenuItem=function(p_oObject,p_oConfig){if(p_oObject){if(p_oConfig){this.parent=p_oConfig.parent;this.value=p_oConfig.value;}
-this.init(p_oObject,p_oConfig);}};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:Module.prototype.isSecure,index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,submenuIndicator:null,browser: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(p_oObject,p_oConfig){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 oConfig=this.cfg;if(this._checkString(p_oObject)){this._createRootNodeStructure();oConfig.setProperty("text",p_oObject);}
-else if(this._checkDOMNode(p_oObject)){switch(p_oObject.tagName.toUpperCase()){case"OPTION":this._createRootNodeStructure();oConfig.setProperty("text",p_oObject.text);this.srcElement=p_oObject;break;case"OPTGROUP":this._createRootNodeStructure();oConfig.setProperty("text",p_oObject.label);this.srcElement=p_oObject;this._initSubTree();break;case"LI":var oAnchor=this._getFirstElement(p_oObject,"A"),sURL="#",sTarget,sText;if(oAnchor){sURL=oAnchor.getAttribute("href");sTarget=oAnchor.getAttribute("target");if(oAnchor.innerText){sText=oAnchor.innerText;}
-else{var oRange=oAnchor.ownerDocument.createRange();oRange.selectNodeContents(oAnchor);sText=oRange.toString();}}
-else{var oText=p_oObject.firstChild;sText=oText.nodeValue;oAnchor=document.createElement("a");oAnchor.setAttribute("href",sURL);p_oObject.replaceChild(oAnchor,oText);oAnchor.appendChild(oText);}
-this.srcElement=p_oObject;this.element=p_oObject;this._oAnchor=oAnchor;var oEmphasisNode=this._getFirstElement(oAnchor),bEmphasis=false,bStrongEmphasis=false;if(oEmphasisNode){this._oText=oEmphasisNode.firstChild;switch(oEmphasisNode.tagName.toUpperCase()){case"EM":bEmphasis=true;break;case"STRONG":bStrongEmphasis=true;break;}}
-else{this._oText=oAnchor.firstChild;}
-oConfig.setProperty("text",sText,true);oConfig.setProperty("url",sURL,true);oConfig.setProperty("target",sTarget,true);oConfig.setProperty("emphasis",bEmphasis,true);oConfig.setProperty("strongemphasis",bStrongEmphasis,true);this._initSubTree();break;}}
-if(this.element){Dom.addClass(this.element,this.CSS_CLASS_NAME);var CustomEvent=YAHOO.util.CustomEvent;this.destroyEvent=new CustomEvent("destroyEvent",this);this.mouseOverEvent=new CustomEvent("mouseOverEvent",this);this.mouseOutEvent=new CustomEvent("mouseOutEvent",this);this.mouseDownEvent=new CustomEvent("mouseDownEvent",this);this.mouseUpEvent=new CustomEvent("mouseUpEvent",this);this.clickEvent=new CustomEvent("clickEvent",this);this.keyPressEvent=new CustomEvent("keyPressEvent",this);this.keyDownEvent=new CustomEvent("keyDownEvent",this);this.keyUpEvent=new CustomEvent("keyUpEvent",this);this.focusEvent=new CustomEvent("focusEvent",this);this.blurEvent=new CustomEvent("blurEvent",this);if(p_oConfig){oConfig.applyConfig(p_oConfig);}
-oConfig.fireQueue();}},_getFirstElement:function(p_oElement,p_sTagName){var oElement;if(p_oElement.firstChild&&p_oElement.firstChild.nodeType==1){oElement=p_oElement.firstChild;}
-else if(p_oElement.firstChild&&p_oElement.firstChild.nextSibling&&p_oElement.firstChild.nextSibling.nodeType==1){oElement=p_oElement.firstChild.nextSibling;}
-if(p_sTagName){return(oElement&&oElement.tagName.toUpperCase()==p_sTagName)?oElement:false;}
-return oElement;},_checkString:function(p_oObject){return(typeof p_oObject=="string");},_checkDOMNode:function(p_oObject){return(p_oObject&&p_oObject.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 oSrcEl=this.srcElement,oConfig=this.cfg;if(oSrcEl.childNodes.length>0){if(this.parent.lazyLoad&&this.parent.srcElement&&this.parent.srcElement.tagName.toUpperCase()=="SELECT"){oConfig.setProperty("submenu",{id:Dom.generateId(),itemdata:oSrcEl.childNodes});}
-else{var oNode=oSrcEl.firstChild,aOptions=[];do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case"DIV":oConfig.setProperty("submenu",oNode);break;case"OPTION":aOptions[aOptions.length]=oNode;break;}}}
-while((oNode=oNode.nextSibling));var nOptions=aOptions.length;if(nOptions>0){var oMenu=new this.SUBMENU_TYPE(Dom.generateId());oConfig.setProperty("submenu",oMenu);for(var n=0;n<nOptions;n++){oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n])));}}}}},_preloadImage:function(p_sPath){var sPath=this.imageRoot+p_sPath;if(!document.images[sPath]){var oImage=document.createElement("img");oImage.src=sPath;oImage.name=sPath;oImage.id=sPath;oImage.style.display="none";document.body.appendChild(oImage);}},configText:function(p_sType,p_aArgs,p_oItem){var sText=p_aArgs[0];if(this._oText){this._oText.nodeValue=sText;}},configHelpText:function(p_sType,p_aArgs,p_oItem){var me=this,oHelpText=p_aArgs[0],oEl=this.element,oConfig=this.cfg,aNodes=[oEl,this._oAnchor],oImg=this.submenuIndicator;function initHelpText(){Dom.addClass(aNodes,"hashelptext");if(oConfig.getProperty("disabled")){oConfig.refireEvent("disabled");}
-if(oConfig.getProperty("selected")){oConfig.refireEvent("selected");}}
-function removeHelpText(){Dom.removeClass(aNodes,"hashelptext");oEl.removeChild(me._oHelpTextEM);me._oHelpTextEM=null;}
-if(this._checkDOMNode(oHelpText)){if(this._oHelpTextEM){this._oHelpTextEM.parentNode.replaceChild(oHelpText,this._oHelpTextEM);}
-else{this._oHelpTextEM=oHelpText;oEl.insertBefore(this._oHelpTextEM,oImg);}
-initHelpText();}
-else if(this._checkString(oHelpText)){if(oHelpText.length===0){removeHelpText();}
-else{if(!this._oHelpTextEM){this._oHelpTextEM=document.createElement("em");oEl.insertBefore(this._oHelpTextEM,oImg);}
-this._oHelpTextEM.innerHTML=oHelpText;initHelpText();}}
-else if(!oHelpText&&this._oHelpTextEM){removeHelpText();}},configURL:function(p_sType,p_aArgs,p_oItem){var sURL=p_aArgs[0];if(!sURL){sURL="#";}
+if(oHeader){Event.purgeElement(oHeader);oElement.removeChild(oHeader);}
+if(oFooter){Event.purgeElement(oFooter);oElement.removeChild(oFooter);}
+if(oBody){Event.purgeElement(oBody);oBody.innerHTML="";}
+this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];this.cfg.setProperty("width",null);},destroy:function(){Module.textResizeEvent.unsubscribe(this._onTextResize,this);this.clearContent();this._aItemGroups=null;this._aListElements=null;this._aGroupTitleElements=null;Menu.superclass.destroy.call(this);},setInitialFocus:function(){var oItem=this._getFirstEnabledItem();if(oItem){oItem.focus();}},setInitialSelection:function(){var oItem=this._getFirstEnabledItem();if(oItem){oItem.cfg.setProperty("selected",true);}},clearActiveItem:function(p_bBlur){if(this.cfg.getProperty("showdelay")>0){this._cancelShowDelay();}
+var oActiveItem=this.activeItem,oConfig,oSubmenu;if(oActiveItem){oConfig=oActiveItem.cfg;if(p_bBlur){oActiveItem.blur();}
+oConfig.setProperty("selected",false);oSubmenu=oConfig.getProperty("submenu");if(oSubmenu){oSubmenu.hide();}
+this.activeItem=null;}},focus:function(){if(!this.hasFocus()){this.setInitialFocus();}},blur:function(){var oItem;if(this.hasFocus()){oItem=MenuManager.getFocusedMenuItem();if(oItem){oItem.blur();}}},hasFocus:function(){return(MenuManager.getFocusedMenu()==this.getRoot());},subscribe:function(){function onItemAdded(p_sType,p_aArgs,p_oObject){var oItem=p_aArgs[0],oSubmenu=oItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.subscribe.apply(oSubmenu,p_oObject);}}
+Menu.superclass.subscribe.apply(this,arguments);Menu.superclass.subscribe.call(this,"itemAdded",onItemAdded,arguments);var aSubmenus=this.getSubmenus(),nSubmenus,oSubmenu,i;if(aSubmenus){nSubmenus=aSubmenus.length;if(nSubmenus>0){i=nSubmenus-1;do{oSubmenu=aSubmenus[i];oSubmenu.subscribe.apply(oSubmenu,arguments);}
+while(i--);}}},initDefaultConfig:function(){Menu.superclass.initDefaultConfig.call(this);var oConfig=this.cfg;oConfig.addProperty(DEFAULT_CONFIG.VISIBLE.key,{handler:this.configVisible,value:DEFAULT_CONFIG.VISIBLE.value,validator:DEFAULT_CONFIG.VISIBLE.validator});oConfig.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value,validator:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator,supercedes:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes});oConfig.addProperty(DEFAULT_CONFIG.POSITION.key,{handler:this.configPosition,value:DEFAULT_CONFIG.POSITION.value,validator:DEFAULT_CONFIG.POSITION.validator,supercedes:DEFAULT_CONFIG.POSITION.supercedes});oConfig.addProperty(DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key,{value:DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value});oConfig.addProperty(DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key,{value:DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value,validator:DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator});oConfig.addProperty(DEFAULT_CONFIG.SHOW_DELAY.key,{value:DEFAULT_CONFIG.SHOW_DELAY.value,validator:DEFAULT_CONFIG.SHOW_DELAY.validator});oConfig.addProperty(DEFAULT_CONFIG.HIDE_DELAY.key,{handler:this.configHideDelay,value:DEFAULT_CONFIG.HIDE_DELAY.value,validator:DEFAULT_CONFIG.HIDE_DELAY.validator,suppressEvent:DEFAULT_CONFIG.HIDE_DELAY.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.key,{value:DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.value,validator:DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.validator});oConfig.addProperty(DEFAULT_CONFIG.CLICK_TO_HIDE.key,{value:DEFAULT_CONFIG.CLICK_TO_HIDE.value,validator:DEFAULT_CONFIG.CLICK_TO_HIDE.validator});oConfig.addProperty(DEFAULT_CONFIG.CONTAINER.key,{handler:this.configContainer,value:document.body});oConfig.addProperty(DEFAULT_CONFIG.MAX_HEIGHT.key,{handler:this.configMaxHeight,value:DEFAULT_CONFIG.MAX_HEIGHT.value,validator:DEFAULT_CONFIG.MAX_HEIGHT.validator});oConfig.addProperty(DEFAULT_CONFIG.CLASS_NAME.key,{handler:this.configClassName,value:DEFAULT_CONFIG.CLASS_NAME.value,validator:DEFAULT_CONFIG.CLASS_NAME.validator});oConfig.addProperty(DEFAULT_CONFIG.DISABLED.key,{handler:this.configDisabled,value:DEFAULT_CONFIG.DISABLED.value,validator:DEFAULT_CONFIG.DISABLED.validator});}});})();(function(){YAHOO.widget.MenuItem=function(p_oObject,p_oConfig){if(p_oObject){if(p_oConfig){this.parent=p_oConfig.parent;this.value=p_oConfig.value;this.id=p_oConfig.id;}
+this.init(p_oObject,p_oConfig);}};var Dom=YAHOO.util.Dom,Module=YAHOO.widget.Module,Menu=YAHOO.widget.Menu,MenuItem=YAHOO.widget.MenuItem,CustomEvent=YAHOO.util.CustomEvent,Lang=YAHOO.lang,m_oMenuItemTemplate,EVENT_TYPES={"MOUSE_OVER":"mouseover","MOUSE_OUT":"mouseout","MOUSE_DOWN":"mousedown","MOUSE_UP":"mouseup","CLICK":"click","KEY_PRESS":"keypress","KEY_DOWN":"keydown","KEY_UP":"keyup","ITEM_ADDED":"itemAdded","ITEM_REMOVED":"itemRemoved","FOCUS":"focus","BLUR":"blur","DESTROY":"destroy"},DEFAULT_CONFIG={"TEXT":{key:"text",value:"",validator:Lang.isString,suppressEvent:true},"HELP_TEXT":{key:"helptext",supercedes:["text"]},"URL":{key:"url",value:"#",suppressEvent:true},"TARGET":{key:"target",suppressEvent:true},"EMPHASIS":{key:"emphasis",value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:["text"]},"STRONG_EMPHASIS":{key:"strongemphasis",value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:["text"]},"CHECKED":{key:"checked",value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:["text"]},"DISABLED":{key:"disabled",value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:["text"]},"SELECTED":{key:"selected",value:false,validator:Lang.isBoolean,suppressEvent:true},"SUBMENU":{key:"submenu",supercedes:["text"]},"ONCLICK":{key:"onclick"},"CLASS_NAME":{key:"classname",value:null,validator:Lang.isString}};MenuItem.prototype={COLLAPSED_SUBMENU_INDICATOR_TEXT:"Submenu collapsed.  Click to expand submenu.",EXPANDED_SUBMENU_INDICATOR_TEXT:"Submenu expanded.  Click to collapse submenu.",DISABLED_SUBMENU_INDICATOR_TEXT:"Submenu collapsed.  (Item disabled.)",CHECKED_TEXT:"Menu item checked.",DISABLED_CHECKED_TEXT:"Checked. (Item disabled.)",CSS_CLASS_NAME:"yuimenuitem",CSS_LABEL_CLASS_NAME:"yuimenuitemlabel",SUBMENU_TYPE:null,_oAnchor:null,_oHelpTextEM:null,_oSubmenu:null,_oCheckedIndicator:null,_oOnclickAttributeValue:null,_sClassName:null,constructor:MenuItem,index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,submenuIndicator:null,browser:Module.prototype.browser,id:null,destroyEvent:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,focusEvent:null,blurEvent:null,init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=Menu;}
+this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();var SIGNATURE=CustomEvent.LIST,oConfig=this.cfg,sURL="#",oAnchor,sTarget,sText,sId;if(Lang.isString(p_oObject)){this._createRootNodeStructure();oConfig.queueProperty("text",p_oObject);}
+else if(p_oObject&&p_oObject.tagName){switch(p_oObject.tagName.toUpperCase()){case"OPTION":this._createRootNodeStructure();oConfig.queueProperty("text",p_oObject.text);this.srcElement=p_oObject;break;case"OPTGROUP":this._createRootNodeStructure();oConfig.queueProperty("text",p_oObject.label);this.srcElement=p_oObject;this._initSubTree();break;case"LI":oAnchor=Dom.getFirstChild(p_oObject);if(oAnchor){sURL=oAnchor.getAttribute("href");sTarget=oAnchor.getAttribute("target");sText=oAnchor.innerHTML;}
+this.srcElement=p_oObject;this.element=p_oObject;this._oAnchor=oAnchor;oConfig.setProperty("text",sText,true);oConfig.setProperty("url",sURL,true);oConfig.setProperty("target",sTarget,true);this._initSubTree();break;}}
+if(this.element){sId=this.element.id;if(!sId){sId=this.id||Dom.generateId();this.element.id=sId;}
+this.id=sId;Dom.addClass(this.element,this.CSS_CLASS_NAME);Dom.addClass(this._oAnchor,this.CSS_LABEL_CLASS_NAME);this.mouseOverEvent=this.createEvent(EVENT_TYPES.MOUSE_OVER);this.mouseOverEvent.signature=SIGNATURE;this.mouseOutEvent=this.createEvent(EVENT_TYPES.MOUSE_OUT);this.mouseOutEvent.signature=SIGNATURE;this.mouseDownEvent=this.createEvent(EVENT_TYPES.MOUSE_DOWN);this.mouseDownEvent.signature=SIGNATURE;this.mouseUpEvent=this.createEvent(EVENT_TYPES.MOUSE_UP);this.mouseUpEvent.signature=SIGNATURE;this.clickEvent=this.createEvent(EVENT_TYPES.CLICK);this.clickEvent.signature=SIGNATURE;this.keyPressEvent=this.createEvent(EVENT_TYPES.KEY_PRESS);this.keyPressEvent.signature=SIGNATURE;this.keyDownEvent=this.createEvent(EVENT_TYPES.KEY_DOWN);this.keyDownEvent.signature=SIGNATURE;this.keyUpEvent=this.createEvent(EVENT_TYPES.KEY_UP);this.keyUpEvent.signature=SIGNATURE;this.focusEvent=this.createEvent(EVENT_TYPES.FOCUS);this.focusEvent.signature=SIGNATURE;this.blurEvent=this.createEvent(EVENT_TYPES.BLUR);this.blurEvent.signature=SIGNATURE;this.destroyEvent=this.createEvent(EVENT_TYPES.DESTROY);this.destroyEvent.signature=SIGNATURE;if(p_oConfig){oConfig.applyConfig(p_oConfig);}
+oConfig.fireQueue();}},_createRootNodeStructure:function(){var oElement,oAnchor;if(!m_oMenuItemTemplate){m_oMenuItemTemplate=document.createElement("li");m_oMenuItemTemplate.innerHTML="<a href=\"#\"></a>";}
+oElement=m_oMenuItemTemplate.cloneNode(true);oElement.className=this.CSS_CLASS_NAME;oAnchor=oElement.firstChild;oAnchor.className=this.CSS_LABEL_CLASS_NAME;this.element=oElement;this._oAnchor=oAnchor;},_initSubTree:function(){var oSrcEl=this.srcElement,oConfig=this.cfg,oNode,aOptions,nOptions,oMenu,n;if(oSrcEl.childNodes.length>0){if(this.parent.lazyLoad&&this.parent.srcElement&&this.parent.srcElement.tagName.toUpperCase()=="SELECT"){oConfig.setProperty("submenu",{id:Dom.generateId(),itemdata:oSrcEl.childNodes});}
+else{oNode=oSrcEl.firstChild;aOptions=[];do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case"DIV":oConfig.setProperty("submenu",oNode);break;case"OPTION":aOptions[aOptions.length]=oNode;break;}}}
+while((oNode=oNode.nextSibling));nOptions=aOptions.length;if(nOptions>0){oMenu=new this.SUBMENU_TYPE(Dom.generateId());oConfig.setProperty("submenu",oMenu);for(n=0;n<nOptions;n++){oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n])));}}}}},configText:function(p_sType,p_aArgs,p_oItem){var sText=p_aArgs[0],oConfig=this.cfg,oAnchor=this._oAnchor,sHelpText=oConfig.getProperty("helptext"),sHelpTextHTML="",sCheckHTML="",oSubmenu=oConfig.getProperty("submenu"),sSubmenuIndicatorHTML="",sEmphasisStartTag="",sEmphasisEndTag="";if(sText){if(sHelpText){sHelpTextHTML="<em class=\"helptext\">"+sHelpText+"</em>";}
+if(oConfig.getProperty("checked")){sCheckHTML="<em class=\"checkedindicator\">"+
+this.CHECKED_TEXT+"</em>";}
+if(oSubmenu){sSubmenuIndicatorHTML="<em class=\"submenuindicator\">"+
+((oSubmenu instanceof Menu&&oSubmenu.cfg.getProperty("visible"))?this.EXPANDED_SUBMENU_INDICATOR_TEXT:this.COLLAPSED_SUBMENU_INDICATOR_TEXT)+"</em>";}
+if(oConfig.getProperty("emphasis")){sEmphasisStartTag="<em>";sEmphasisEndTag="</em>";}
+if(oConfig.getProperty("strongemphasis")){sEmphasisStartTag="<strong>";sEmphasisEndTag="</strong>";}
+oAnchor.innerHTML=(sEmphasisStartTag+sText+
+sEmphasisEndTag+sHelpTextHTML+
+sCheckHTML+sSubmenuIndicatorHTML);if(oSubmenu){this.submenuIndicator=oAnchor.lastChild;}}},configHelpText:function(p_sType,p_aArgs,p_oItem){var sHelpText=p_aArgs[0],oAnchor=this._oAnchor;if(sHelpText){Dom.addClass(oAnchor,"hashelptext");}
+else{Dom.removeClass(oAnchor,"hashelptext");}
+this.cfg.refireEvent("text");},configURL:function(p_sType,p_aArgs,p_oItem){var sURL=p_aArgs[0];if(!sURL){sURL="#";}
 this._oAnchor.setAttribute("href",sURL);},configTarget:function(p_sType,p_aArgs,p_oItem){var sTarget=p_aArgs[0],oAnchor=this._oAnchor;if(sTarget&&sTarget.length>0){oAnchor.setAttribute("target",sTarget);}
-else{oAnchor.removeAttribute("target");}},configEmphasis:function(p_sType,p_aArgs,p_oItem){var bEmphasis=p_aArgs[0],oAnchor=this._oAnchor,oText=this._oText,oConfig=this.cfg,oEM;if(bEmphasis&&oConfig.getProperty("strongemphasis")){oConfig.setProperty("strongemphasis",false);}
-if(oAnchor){if(bEmphasis){oEM=document.createElement("em");oEM.appendChild(oText);oAnchor.appendChild(oEM);}
-else{oEM=this._getFirstElement(oAnchor,"EM");if(oEM){oAnchor.removeChild(oEM);oAnchor.appendChild(oText);}}}},configStrongEmphasis:function(p_sType,p_aArgs,p_oItem){var bStrongEmphasis=p_aArgs[0],oAnchor=this._oAnchor,oText=this._oText,oConfig=this.cfg,oStrong;if(bStrongEmphasis&&oConfig.getProperty("emphasis")){oConfig.setProperty("emphasis",false);}
-if(oAnchor){if(bStrongEmphasis){oStrong=document.createElement("strong");oStrong.appendChild(oText);oAnchor.appendChild(oStrong);}
-else{oStrong=this._getFirstElement(oAnchor,"STRONG");if(oStrong){oAnchor.removeChild(oStrong);oAnchor.appendChild(oText);}}}},configChecked:function(p_sType,p_aArgs,p_oItem){var bChecked=p_aArgs[0],oEl=this.element,oConfig=this.cfg,oImg;if(bChecked){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 oSubmenu=this.cfg.getProperty("submenu");if(oSubmenu){oEl.insertBefore(oImg,oSubmenu.element);}
-else{oEl.appendChild(oImg);}
-Dom.addClass([oEl,oImg],"checked");this._checkImage=oImg;if(oConfig.getProperty("disabled")){oConfig.refireEvent("disabled");}
-if(oConfig.getProperty("selected")){oConfig.refireEvent("selected");}}
-else{oImg=this._checkImage;Dom.removeClass([oEl,oImg],"checked");if(oImg){oEl.removeChild(oImg);}
-this._checkImage=null;}},configDisabled:function(p_sType,p_aArgs,p_oItem){var bDisabled=p_aArgs[0],oAnchor=this._oAnchor,aNodes=[this.element,oAnchor],oEM=this._oHelpTextEM,oConfig=this.cfg,oImg,sImgSrc,sImgAlt;if(oEM){aNodes[2]=oEM;}
-if(this.cfg.getProperty("checked")){sImgAlt=this.CHECKED_IMAGE_ALT_TEXT;sImgSrc=this.CHECKED_IMAGE_PATH;oImg=this._checkImage;if(bDisabled){sImgAlt=this.DISABLED_CHECKED_IMAGE_ALT_TEXT;sImgSrc=this.DISABLED_CHECKED_IMAGE_PATH;}
-oImg.src=document.images[(this.imageRoot+sImgSrc)].src;oImg.alt=sImgAlt;}
-oImg=this.submenuIndicator;if(bDisabled){if(oConfig.getProperty("selected")){oConfig.setProperty("selected",false);}
-oAnchor.removeAttribute("href");Dom.addClass(aNodes,"disabled");sImgSrc=this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH;sImgAlt=this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;}
-else{oAnchor.setAttribute("href",oConfig.getProperty("url"));Dom.removeClass(aNodes,"disabled");sImgSrc=this.SUBMENU_INDICATOR_IMAGE_PATH;sImgAlt=this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;}
-if(oImg){oImg.src=this.imageRoot+sImgSrc;oImg.alt=sImgAlt;}},configSelected:function(p_sType,p_aArgs,p_oItem){if(!this.cfg.getProperty("disabled")){var bSelected=p_aArgs[0],oEM=this._oHelpTextEM,aNodes=[this.element,this._oAnchor],oImg=this.submenuIndicator,sImgSrc;if(oEM){aNodes[aNodes.length]=oEM;}
-if(oImg){aNodes[aNodes.length]=oImg;}
-if(this.cfg.getProperty("checked")){sImgSrc=this.imageRoot+(bSelected?this.SELECTED_CHECKED_IMAGE_PATH:this.CHECKED_IMAGE_PATH);this._checkImage.src=document.images[sImgSrc].src;}
-if(bSelected){Dom.addClass(aNodes,"selected");sImgSrc=this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH;}
-else{Dom.removeClass(aNodes,"selected");sImgSrc=this.SUBMENU_INDICATOR_IMAGE_PATH;}
-if(oImg){oImg.src=document.images[(this.imageRoot+sImgSrc)].src;}}},configSubmenu:function(p_sType,p_aArgs,p_oItem){var oEl=this.element,oSubmenu=p_aArgs[0],oImg=this.submenuIndicator,oConfig=this.cfg,aNodes=[this.element,this._oAnchor],oMenu,bLazyLoad=this.parent&&this.parent.lazyLoad;if(oSubmenu){if(oSubmenu instanceof Menu){oMenu=oSubmenu;oMenu.parent=this;oMenu.lazyLoad=bLazyLoad;}
-else if(typeof oSubmenu=="object"&&oSubmenu.id&&!oSubmenu.nodeType){var sSubmenuId=oSubmenu.id,oSubmenuConfig=oSubmenu;oSubmenuConfig.lazyload=bLazyLoad;oSubmenuConfig.parent=this;oMenu=new this.SUBMENU_TYPE(sSubmenuId,oSubmenuConfig);this.cfg.setProperty("submenu",oMenu,true);}
+else{oAnchor.removeAttribute("target");}},configEmphasis:function(p_sType,p_aArgs,p_oItem){var bEmphasis=p_aArgs[0],oConfig=this.cfg;if(bEmphasis&&oConfig.getProperty("strongemphasis")){oConfig.setProperty("strongemphasis",false);}
+oConfig.refireEvent("text");},configStrongEmphasis:function(p_sType,p_aArgs,p_oItem){var bStrongEmphasis=p_aArgs[0],oConfig=this.cfg;if(bStrongEmphasis&&oConfig.getProperty("emphasis")){oConfig.setProperty("emphasis",false);}
+oConfig.refireEvent("text");},configChecked:function(p_sType,p_aArgs,p_oItem){var bChecked=p_aArgs[0],oAnchor=this._oAnchor;if(bChecked){Dom.addClass(oAnchor,"checked");}
+else{Dom.removeClass(oAnchor,"checked");}
+this.cfg.refireEvent("text");},configDisabled:function(p_sType,p_aArgs,p_oItem){var bDisabled=p_aArgs[0],oConfig=this.cfg,oAnchor=this._oAnchor;if(bDisabled){if(oConfig.getProperty("selected")){oConfig.setProperty("selected",false);}
+oAnchor.removeAttribute("href");Dom.addClass(oAnchor,"disabled");}
+else{oAnchor.setAttribute("href",oConfig.getProperty("url"));Dom.removeClass(oAnchor,"disabled");}},configSelected:function(p_sType,p_aArgs,p_oItem){var bSelected,oAnchor;if(!this.cfg.getProperty("disabled")){bSelected=p_aArgs[0];oAnchor=this._oAnchor;if(bSelected){Dom.addClass(oAnchor,"selected");}
+else{Dom.removeClass(oAnchor,"selected");}}},configSubmenu:function(p_sType,p_aArgs,p_oItem){var oAnchor=this._oAnchor,oSubmenu=p_aArgs[0],oSubmenuIndicator=this.submenuIndicator,oConfig=this.cfg,bLazyLoad=this.parent&&this.parent.lazyLoad,oMenu,sSubmenuId,oSubmenuConfig;if(oSubmenu){if(oSubmenu instanceof Menu){oMenu=oSubmenu;oMenu.parent=this;oMenu.lazyLoad=bLazyLoad;}
+else if(typeof oSubmenu=="object"&&oSubmenu.id&&!oSubmenu.nodeType){sSubmenuId=oSubmenu.id;oSubmenuConfig=oSubmenu;oSubmenuConfig.lazyload=bLazyLoad;oSubmenuConfig.parent=this;oMenu=new this.SUBMENU_TYPE(sSubmenuId,oSubmenuConfig);this.cfg.setProperty("submenu",oMenu,true);}
 else{oMenu=new this.SUBMENU_TYPE(oSubmenu,{lazyload:bLazyLoad,parent:this});this.cfg.setProperty("submenu",oMenu,true);}
-if(oMenu){this._oSubmenu=oMenu;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(aNodes,"hassubmenu");if(oConfig.getProperty("disabled")){oConfig.refireEvent("disabled");}
-if(oConfig.getProperty("selected")){oConfig.refireEvent("selected");}}}}
-else{Dom.removeClass(aNodes,"hassubmenu");if(oImg){oEl.removeChild(oImg);}
-if(this._oSubmenu){this._oSubmenu.destroy();}}},initDefaultConfig:function(){var oConfig=this.cfg,CheckBoolean=oConfig.checkBoolean;oConfig.addProperty("text",{value:"",handler:this.configText,validator:this._checkString,suppressEvent:true});oConfig.addProperty("helptext",{handler:this.configHelpText});oConfig.addProperty("url",{value:"#",handler:this.configURL,suppressEvent:true});oConfig.addProperty("target",{handler:this.configTarget,suppressEvent:true});oConfig.addProperty("emphasis",{value:false,handler:this.configEmphasis,validator:CheckBoolean,suppressEvent:true});oConfig.addProperty("strongemphasis",{value:false,handler:this.configStrongEmphasis,validator:CheckBoolean,suppressEvent:true});oConfig.addProperty("checked",{value:false,handler:this.configChecked,validator:this.cfg.checkBoolean,suppressEvent:true,supercedes:["disabled"]});oConfig.addProperty("disabled",{value:false,handler:this.configDisabled,validator:CheckBoolean,suppressEvent:true});oConfig.addProperty("selected",{value:false,handler:this.configSelected,validator:CheckBoolean,suppressEvent:true});oConfig.addProperty("submenu",{handler:this.configSubmenu});},getNextEnabledSibling:function(){if(this.parent instanceof Menu){var nGroupIndex=this.groupIndex;function getNextArrayItem(p_aArray,p_nStartIndex){return p_aArray[p_nStartIndex]||getNextArrayItem(p_aArray,(p_nStartIndex+1));}
-var aItemGroups=this.parent.getItemGroups(),oNextItem;if(this.index<(aItemGroups[nGroupIndex].length-1)){oNextItem=getNextArrayItem(aItemGroups[nGroupIndex],(this.index+1));}
-else{var nNextGroupIndex;if(nGroupIndex<(aItemGroups.length-1)){nNextGroupIndex=nGroupIndex+1;}
+if(oMenu){Dom.addClass(oAnchor,"hassubmenu");this._oSubmenu=oMenu;}}
+else{Dom.removeClass(oAnchor,"hassubmenu");if(oSubmenuIndicator){oAnchor.removeChild(oSubmenuIndicator);}
+if(this._oSubmenu){this._oSubmenu.destroy();}}
+oConfig.refireEvent("text");},configOnClick:function(p_sType,p_aArgs,p_oItem){var oObject=p_aArgs[0];if(this._oOnclickAttributeValue&&(this._oOnclickAttributeValue!=oObject)){this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn,this._oOnclickAttributeValue.obj);this._oOnclickAttributeValue=null;}
+if(!this._oOnclickAttributeValue&&typeof oObject=="object"&&typeof oObject.fn=="function"){this.clickEvent.subscribe(oObject.fn,((!YAHOO.lang.isUndefined(oObject.obj))?oObject.obj:this),oObject.scope);this._oOnclickAttributeValue=oObject;}},configClassName:function(p_sType,p_aArgs,p_oItem){var sClassName=p_aArgs[0];if(this._sClassName){Dom.removeClass(this.element,this._sClassName);}
+Dom.addClass(this.element,sClassName);this._sClassName=sClassName;},initDefaultConfig:function(){var oConfig=this.cfg;oConfig.addProperty(DEFAULT_CONFIG.TEXT.key,{handler:this.configText,value:DEFAULT_CONFIG.TEXT.value,validator:DEFAULT_CONFIG.TEXT.validator,suppressEvent:DEFAULT_CONFIG.TEXT.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.HELP_TEXT.key,{handler:this.configHelpText});oConfig.addProperty(DEFAULT_CONFIG.URL.key,{handler:this.configURL,value:DEFAULT_CONFIG.URL.value,suppressEvent:DEFAULT_CONFIG.URL.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.TARGET.key,{handler:this.configTarget,suppressEvent:DEFAULT_CONFIG.TARGET.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.EMPHASIS.key,{handler:this.configEmphasis,value:DEFAULT_CONFIG.EMPHASIS.value,validator:DEFAULT_CONFIG.EMPHASIS.validator,suppressEvent:DEFAULT_CONFIG.EMPHASIS.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.STRONG_EMPHASIS.key,{handler:this.configStrongEmphasis,value:DEFAULT_CONFIG.STRONG_EMPHASIS.value,validator:DEFAULT_CONFIG.STRONG_EMPHASIS.validator,suppressEvent:DEFAULT_CONFIG.STRONG_EMPHASIS.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.CHECKED.key,{handler:this.configChecked,value:DEFAULT_CONFIG.CHECKED.value,validator:DEFAULT_CONFIG.CHECKED.validator,suppressEvent:DEFAULT_CONFIG.CHECKED.suppressEvent,supercedes:DEFAULT_CONFIG.CHECKED.supercedes});oConfig.addProperty(DEFAULT_CONFIG.DISABLED.key,{handler:this.configDisabled,value:DEFAULT_CONFIG.DISABLED.value,validator:DEFAULT_CONFIG.DISABLED.validator,suppressEvent:DEFAULT_CONFIG.DISABLED.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.SELECTED.key,{handler:this.configSelected,value:DEFAULT_CONFIG.SELECTED.value,validator:DEFAULT_CONFIG.SELECTED.validator,suppressEvent:DEFAULT_CONFIG.SELECTED.suppressEvent});oConfig.addProperty(DEFAULT_CONFIG.SUBMENU.key,{handler:this.configSubmenu});oConfig.addProperty(DEFAULT_CONFIG.ONCLICK.key,{handler:this.configOnClick});oConfig.addProperty(DEFAULT_CONFIG.CLASS_NAME.key,{handler:this.configClassName,value:DEFAULT_CONFIG.CLASS_NAME.value,validator:DEFAULT_CONFIG.CLASS_NAME.validator});},getNextEnabledSibling:function(){var nGroupIndex,aItemGroups,oNextItem,nNextGroupIndex,aNextGroup;function getNextArrayItem(p_aArray,p_nStartIndex){return p_aArray[p_nStartIndex]||getNextArrayItem(p_aArray,(p_nStartIndex+1));}
+if(this.parent instanceof Menu){nGroupIndex=this.groupIndex;aItemGroups=this.parent.getItemGroups();if(this.index<(aItemGroups[nGroupIndex].length-1)){oNextItem=getNextArrayItem(aItemGroups[nGroupIndex],(this.index+1));}
+else{if(nGroupIndex<(aItemGroups.length-1)){nNextGroupIndex=nGroupIndex+1;}
 else{nNextGroupIndex=0;}
-var aNextGroup=getNextArrayItem(aItemGroups,nNextGroupIndex);oNextItem=getNextArrayItem(aNextGroup,0);}
-return(oNextItem.cfg.getProperty("disabled")||oNextItem.element.style.display=="none")?oNextItem.getNextEnabledSibling():oNextItem;}},getPreviousEnabledSibling:function(){if(this.parent instanceof Menu){var nGroupIndex=this.groupIndex;function getPreviousArrayItem(p_aArray,p_nStartIndex){return p_aArray[p_nStartIndex]||getPreviousArrayItem(p_aArray,(p_nStartIndex-1));}
+aNextGroup=getNextArrayItem(aItemGroups,nNextGroupIndex);oNextItem=getNextArrayItem(aNextGroup,0);}
+return(oNextItem.cfg.getProperty("disabled")||oNextItem.element.style.display=="none")?oNextItem.getNextEnabledSibling():oNextItem;}},getPreviousEnabledSibling:function(){var nGroupIndex,aItemGroups,oPreviousItem,nPreviousGroupIndex,aPreviousGroup;function getPreviousArrayItem(p_aArray,p_nStartIndex){return p_aArray[p_nStartIndex]||getPreviousArrayItem(p_aArray,(p_nStartIndex-1));}
 function getFirstItemIndex(p_aArray,p_nStartIndex){return p_aArray[p_nStartIndex]?p_nStartIndex:getFirstItemIndex(p_aArray,(p_nStartIndex+1));}
-var aItemGroups=this.parent.getItemGroups(),oPreviousItem;if(this.index>getFirstItemIndex(aItemGroups[nGroupIndex],0)){oPreviousItem=getPreviousArrayItem(aItemGroups[nGroupIndex],(this.index-1));}
-else{var nPreviousGroupIndex;if(nGroupIndex>getFirstItemIndex(aItemGroups,0)){nPreviousGroupIndex=nGroupIndex-1;}
+if(this.parent instanceof Menu){nGroupIndex=this.groupIndex;aItemGroups=this.parent.getItemGroups();if(this.index>getFirstItemIndex(aItemGroups[nGroupIndex],0)){oPreviousItem=getPreviousArrayItem(aItemGroups[nGroupIndex],(this.index-1));}
+else{if(nGroupIndex>getFirstItemIndex(aItemGroups,0)){nPreviousGroupIndex=nGroupIndex-1;}
 else{nPreviousGroupIndex=aItemGroups.length-1;}
-var aPreviousGroup=getPreviousArrayItem(aItemGroups,nPreviousGroupIndex);oPreviousItem=getPreviousArrayItem(aPreviousGroup,(aPreviousGroup.length-1));}
-return(oPreviousItem.cfg.getProperty("disabled")||oPreviousItem.element.style.display=="none")?oPreviousItem.getPreviousEnabledSibling():oPreviousItem;}},focus:function(){var oParent=this.parent,oAnchor=this._oAnchor,oActiveItem=oParent.activeItem;function setFocus(){try{oAnchor.focus();}
+aPreviousGroup=getPreviousArrayItem(aItemGroups,nPreviousGroupIndex);oPreviousItem=getPreviousArrayItem(aPreviousGroup,(aPreviousGroup.length-1));}
+return(oPreviousItem.cfg.getProperty("disabled")||oPreviousItem.element.style.display=="none")?oPreviousItem.getPreviousEnabledSibling():oPreviousItem;}},focus:function(){var oParent=this.parent,oAnchor=this._oAnchor,oActiveItem=oParent.activeItem,me=this;function setFocus(){try{if(YAHOO.env.ua.ie&&!document.hasFocus()){return;}
+oAnchor.focus();}
 catch(e){}}
 if(!this.cfg.getProperty("disabled")&&oParent&&oParent.cfg.getProperty("visible")&&this.element.style.display!="none"){if(oActiveItem){oActiveItem.blur();}
-window.setTimeout(setFocus,0);this.focusEvent.fire();}},blur:function(){var oParent=this.parent;if(!this.cfg.getProperty("disabled")&&oParent&&Dom.getStyle(oParent.element,"visibility")=="visible"){this._oAnchor.blur();this.blurEvent.fire();}},destroy:function(){var oEl=this.element;if(oEl){var oSubmenu=this.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.destroy();}
-this.mouseOverEvent.unsubscribeAll();this.mouseOutEvent.unsubscribeAll();this.mouseDownEvent.unsubscribeAll();this.mouseUpEvent.unsubscribeAll();this.clickEvent.unsubscribeAll();this.keyPressEvent.unsubscribeAll();this.keyDownEvent.unsubscribeAll();this.keyUpEvent.unsubscribeAll();this.focusEvent.unsubscribeAll();this.blurEvent.unsubscribeAll();this.cfg.configChangedEvent.unsubscribeAll();var oParentNode=oEl.parentNode;if(oParentNode){oParentNode.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(p_oElement,p_oConfig){YAHOO.widget.ContextMenu.superclass.constructor.call(this,p_oElement,p_oConfig);};YAHOO.extend(YAHOO.widget.ContextMenu,YAHOO.widget.Menu,{_oTrigger:null,contextEventTarget:null,init:function(p_oElement,p_oConfig){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.ContextMenuItem;}
-YAHOO.widget.ContextMenu.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(YAHOO.widget.ContextMenu);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}
-this.initEvent.fire(YAHOO.widget.ContextMenu);},_removeEventHandlers:function(){var Event=YAHOO.util.Event,oTrigger=this._oTrigger,bOpera=(this.browser=="opera");Event.removeListener(oTrigger,(bOpera?"mousedown":"contextmenu"),this._onTriggerContextMenu);if(bOpera){Event.removeListener(oTrigger,"click",this._onTriggerClick);}},_onTriggerClick:function(p_oEvent,p_oMenu){if(p_oEvent.ctrlKey){YAHOO.util.Event.stopEvent(p_oEvent);}},_onTriggerContextMenu:function(p_oEvent,p_oMenu){YAHOO.widget.MenuManager.hideVisible();var Event=YAHOO.util.Event,oConfig=this.cfg;if(p_oEvent.type=="mousedown"&&!p_oEvent.ctrlKey){return;}
-this.contextEventTarget=Event.getTarget(p_oEvent);var nX=Event.getPageX(p_oEvent),nY=Event.getPageY(p_oEvent);oConfig.applyConfig({xy:[nX,nY],visible:true});oConfig.fireQueue();Event.stopEvent(p_oEvent);},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(p_sType,p_aArgs,p_oMenu){var Event=YAHOO.util.Event,oTrigger=p_aArgs[0];if(oTrigger){if(this._oTrigger){this._removeEventHandlers();}
-this._oTrigger=oTrigger;var bOpera=(this.browser=="opera");Event.addListener(oTrigger,(bOpera?"mousedown":"contextmenu"),this._onTriggerContextMenu,this,true);if(bOpera){Event.addListener(oTrigger,"click",this._onTriggerClick,this,true);}}
-else{this._removeEventHandlers();}}});YAHOO.widget.ContextMenuItem=function(p_oObject,p_oConfig){YAHOO.widget.ContextMenuItem.superclass.constructor.call(this,p_oObject,p_oConfig);};YAHOO.extend(YAHOO.widget.ContextMenuItem,YAHOO.widget.MenuItem,{init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.ContextMenu;}
+window.setTimeout(setFocus,0);this.focusEvent.fire();}},blur:function(){var oParent=this.parent;if(!this.cfg.getProperty("disabled")&&oParent&&oParent.cfg.getProperty("visible")){this._oAnchor.blur();this.blurEvent.fire();}},hasFocus:function(){return(YAHOO.widget.MenuManager.getFocusedMenuItem()==this);},destroy:function(){var oEl=this.element,oSubmenu,oParentNode;if(oEl){oSubmenu=this.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.destroy();}
+this.mouseOverEvent.unsubscribeAll();this.mouseOutEvent.unsubscribeAll();this.mouseDownEvent.unsubscribeAll();this.mouseUpEvent.unsubscribeAll();this.clickEvent.unsubscribeAll();this.keyPressEvent.unsubscribeAll();this.keyDownEvent.unsubscribeAll();this.keyUpEvent.unsubscribeAll();this.focusEvent.unsubscribeAll();this.blurEvent.unsubscribeAll();this.cfg.configChangedEvent.unsubscribeAll();oParentNode=oEl.parentNode;if(oParentNode){oParentNode.removeChild(oEl);this.destroyEvent.fire();}
+this.destroyEvent.unsubscribeAll();}},toString:function(){var sReturnVal="MenuItem",sId=this.id;if(sId){sReturnVal+=(" "+sId);}
+return sReturnVal;}};Lang.augmentProto(MenuItem,YAHOO.util.EventProvider);})();(function(){YAHOO.widget.ContextMenu=function(p_oElement,p_oConfig){YAHOO.widget.ContextMenu.superclass.constructor.call(this,p_oElement,p_oConfig);};var Event=YAHOO.util.Event,ContextMenu=YAHOO.widget.ContextMenu,EVENT_TYPES={"TRIGGER_CONTEXT_MENU":"triggerContextMenu","CONTEXT_MENU":(YAHOO.env.ua.opera?"mousedown":"contextmenu"),"CLICK":"click"},DEFAULT_CONFIG={"TRIGGER":{key:"trigger"}};YAHOO.lang.extend(ContextMenu,YAHOO.widget.Menu,{_oTrigger:null,_bCancelled:false,contextEventTarget:null,triggerContextMenuEvent:null,init:function(p_oElement,p_oConfig){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.ContextMenuItem;}
+ContextMenu.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(ContextMenu);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}
+this.initEvent.fire(ContextMenu);},initEvents:function(){ContextMenu.superclass.initEvents.call(this);this.triggerContextMenuEvent=this.createEvent(EVENT_TYPES.TRIGGER_CONTEXT_MENU);this.triggerContextMenuEvent.signature=YAHOO.util.CustomEvent.LIST;},cancel:function(){this._bCancelled=true;},_removeEventHandlers:function(){var oTrigger=this._oTrigger;if(oTrigger){Event.removeListener(oTrigger,EVENT_TYPES.CONTEXT_MENU,this._onTriggerContextMenu);if(YAHOO.env.ua.opera){Event.removeListener(oTrigger,EVENT_TYPES.CLICK,this._onTriggerClick);}}},_onTriggerClick:function(p_oEvent,p_oMenu){if(p_oEvent.ctrlKey){Event.stopEvent(p_oEvent);}},_onTriggerContextMenu:function(p_oEvent,p_oMenu){if(p_oEvent.type=="mousedown"&&!p_oEvent.ctrlKey){return;}
+Event.stopEvent(p_oEvent);YAHOO.widget.MenuManager.hideVisible();this.contextEventTarget=Event.getTarget(p_oEvent);this.triggerContextMenuEvent.fire(p_oEvent);if(!this._bCancelled){this.cfg.setProperty("xy",Event.getXY(p_oEvent));this.show();}
+this._bCancelled=false;},toString:function(){var sReturnVal="ContextMenu",sId=this.id;if(sId){sReturnVal+=(" "+sId);}
+return sReturnVal;},initDefaultConfig:function(){ContextMenu.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.TRIGGER.key,{handler:this.configTrigger});},destroy:function(){this._removeEventHandlers();ContextMenu.superclass.destroy.call(this);},configTrigger:function(p_sType,p_aArgs,p_oMenu){var oTrigger=p_aArgs[0];if(oTrigger){if(this._oTrigger){this._removeEventHandlers();}
+this._oTrigger=oTrigger;Event.on(oTrigger,EVENT_TYPES.CONTEXT_MENU,this._onTriggerContextMenu,this,true);if(YAHOO.env.ua.opera){Event.on(oTrigger,EVENT_TYPES.CLICK,this._onTriggerClick,this,true);}}
+else{this._removeEventHandlers();}}});}());YAHOO.widget.ContextMenuItem=function(p_oObject,p_oConfig){YAHOO.widget.ContextMenuItem.superclass.constructor.call(this,p_oObject,p_oConfig);};YAHOO.lang.extend(YAHOO.widget.ContextMenuItem,YAHOO.widget.MenuItem,{init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.ContextMenu;}
 YAHOO.widget.ContextMenuItem.superclass.init.call(this,p_oObject);var oConfig=this.cfg;if(p_oConfig){oConfig.applyConfig(p_oConfig,true);}
-oConfig.fireQueue();},toString:function(){return("MenuBarItem: "+this.cfg.getProperty("text"));}});YAHOO.widget.MenuBar=function(p_oElement,p_oConfig){YAHOO.widget.MenuBar.superclass.constructor.call(this,p_oElement,p_oConfig);};YAHOO.extend(YAHOO.widget.MenuBar,YAHOO.widget.Menu,{init:function(p_oElement,p_oConfig){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}
-YAHOO.widget.MenuBar.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(YAHOO.widget.MenuBar);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}
-this.initEvent.fire(YAHOO.widget.MenuBar);},CSS_CLASS_NAME:"yuimenubar",_onKeyDown:function(p_sType,p_aArgs,p_oMenuBar){var Event=YAHOO.util.Event,oEvent=p_aArgs[0],oItem=p_aArgs[1],oSubmenu;if(oItem&&!oItem.cfg.getProperty("disabled")){var oItemCfg=oItem.cfg;switch(oEvent.keyCode){case 37:case 39:if(oItem==this.activeItem&&!oItemCfg.getProperty("selected")){oItemCfg.setProperty("selected",true);}
-else{var oNextItem=(oEvent.keyCode==37)?oItem.getPreviousEnabledSibling():oItem.getNextEnabledSibling();if(oNextItem){this.clearActiveItem();oNextItem.cfg.setProperty("selected",true);if(this.cfg.getProperty("autosubmenudisplay")){oSubmenu=oNextItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.show();oSubmenu.activeItem.blur();oSubmenu.activeItem=null;}}
+oConfig.fireQueue();},toString:function(){var sReturnVal="ContextMenuItem";if(this.cfg&&this.cfg.getProperty("text")){sReturnVal+=(": "+this.cfg.getProperty("text"));}
+return sReturnVal;}});(function(){YAHOO.widget.MenuBar=function(p_oElement,p_oConfig){YAHOO.widget.MenuBar.superclass.constructor.call(this,p_oElement,p_oConfig);};function checkPosition(p_sPosition){if(typeof p_sPosition=="string"){return("dynamic,static".indexOf((p_sPosition.toLowerCase()))!=-1);}}
+var Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,MenuBar=YAHOO.widget.MenuBar,DEFAULT_CONFIG={"POSITION":{key:"position",value:"static",validator:checkPosition,supercedes:["visible"]},"SUBMENU_ALIGNMENT":{key:"submenualignment",value:["tl","bl"]},"AUTO_SUBMENU_DISPLAY":{key:"autosubmenudisplay",value:false,validator:YAHOO.lang.isBoolean}};YAHOO.lang.extend(MenuBar,YAHOO.widget.Menu,{init:function(p_oElement,p_oConfig){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}
+MenuBar.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(MenuBar);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}
+this.initEvent.fire(MenuBar);},CSS_CLASS_NAME:"yuimenubar",_onKeyDown:function(p_sType,p_aArgs,p_oMenuBar){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oSubmenu,oItemCfg,oNextItem;if(oItem&&!oItem.cfg.getProperty("disabled")){oItemCfg=oItem.cfg;switch(oEvent.keyCode){case 37:case 39:if(oItem==this.activeItem&&!oItemCfg.getProperty("selected")){oItemCfg.setProperty("selected",true);}
+else{oNextItem=(oEvent.keyCode==37)?oItem.getPreviousEnabledSibling():oItem.getNextEnabledSibling();if(oNextItem){this.clearActiveItem();oNextItem.cfg.setProperty("selected",true);if(this.cfg.getProperty("autosubmenudisplay")){oSubmenu=oNextItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.show();}}
 oNextItem.focus();}}
 Event.preventDefault(oEvent);break;case 40:if(this.activeItem!=oItem){this.clearActiveItem();oItemCfg.setProperty("selected",true);oItem.focus();}
 oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.setInitialSelection();oSubmenu.setInitialFocus();}
@@ -213,8 +273,10 @@ else{oSubmenu.show();}}
 Event.preventDefault(oEvent);break;}}
 if(oEvent.keyCode==27&&this.activeItem){oSubmenu=this.activeItem.cfg.getProperty("submenu");if(oSubmenu&&oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();this.activeItem.focus();}
 else{this.activeItem.cfg.setProperty("selected",false);this.activeItem.blur();}
-Event.preventDefault(oEvent);}},_onClick:function(p_sType,p_aArgs,p_oMenuBar){YAHOO.widget.MenuBar.superclass._onClick.call(this,p_sType,p_aArgs,p_oMenuBar);var oItem=p_aArgs[1];if(oItem&&!oItem.cfg.getProperty("disabled")){var Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,oEvent=p_aArgs[0],oTarget=Event.getTarget(oEvent),oActiveItem=this.activeItem,oConfig=this.cfg;if(oActiveItem&&oActiveItem!=oItem){this.clearActiveItem();}
-oItem.cfg.setProperty("selected",true);oItem.focus();var oSubmenu=oItem.cfg.getProperty("submenu");if(oSubmenu&&oTarget!=oItem.submenuIndicator){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();}
-else{oSubmenu.show();}}}},toString:function(){return("MenuBar "+this.id);},initDefaultConfig:function(){YAHOO.widget.MenuBar.superclass.initDefaultConfig.call(this);var oConfig=this.cfg;oConfig.addProperty("position",{value:"static",handler:this.configPosition,validator:this._checkPosition,supercedes:["visible"]});oConfig.addProperty("submenualignment",{value:["tl","bl"]});oConfig.addProperty("autosubmenudisplay",{value:false,validator:oConfig.checkBoolean});}});YAHOO.widget.MenuBarItem=function(p_oObject,p_oConfig){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,p_oObject,p_oConfig);};YAHOO.extend(YAHOO.widget.MenuBarItem,YAHOO.widget.MenuItem,{init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}
+Event.preventDefault(oEvent);}},_onClick:function(p_sType,p_aArgs,p_oMenuBar){MenuBar.superclass._onClick.call(this,p_sType,p_aArgs,p_oMenuBar);var oItem=p_aArgs[1],oEvent,oTarget,oActiveItem,oConfig,oSubmenu;if(oItem&&!oItem.cfg.getProperty("disabled")){oEvent=p_aArgs[0];oTarget=Event.getTarget(oEvent);oActiveItem=this.activeItem;oConfig=this.cfg;if(oActiveItem&&oActiveItem!=oItem){this.clearActiveItem();}
+oItem.cfg.setProperty("selected",true);oSubmenu=oItem.cfg.getProperty("submenu");if(oSubmenu&&oTarget!=oItem.submenuIndicator){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();}
+else{oSubmenu.show();}}}},toString:function(){var sReturnVal="MenuBar",sId=this.id;if(sId){sReturnVal+=(" "+sId);}
+return sReturnVal;},initDefaultConfig:function(){MenuBar.superclass.initDefaultConfig.call(this);var oConfig=this.cfg;oConfig.addProperty(DEFAULT_CONFIG.POSITION.key,{handler:this.configPosition,value:DEFAULT_CONFIG.POSITION.value,validator:DEFAULT_CONFIG.POSITION.validator,supercedes:DEFAULT_CONFIG.POSITION.supercedes});oConfig.addProperty(DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key,{value:DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value});oConfig.addProperty(DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key,{value:DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value,validator:DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator});}});}());YAHOO.widget.MenuBarItem=function(p_oObject,p_oConfig){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,p_oObject,p_oConfig);};YAHOO.lang.extend(YAHOO.widget.MenuBarItem,YAHOO.widget.MenuItem,{init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}
 YAHOO.widget.MenuBarItem.superclass.init.call(this,p_oObject);var oConfig=this.cfg;if(p_oConfig){oConfig.applyConfig(p_oConfig,true);}
-oConfig.fireQueue();},CSS_CLASS_NAME:"yuimenubaritem",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
+oConfig.fireQueue();},CSS_CLASS_NAME:"yuimenubaritem",CSS_LABEL_CLASS_NAME:"yuimenubaritemlabel",toString:function(){var sReturnVal="MenuBarItem";if(this.cfg&&this.cfg.getProperty("text")){sReturnVal+=(": "+this.cfg.getProperty("text"));}
+return sReturnVal;}});YAHOO.register("menu",YAHOO.widget.Menu,{version:"2.3.0",build:"442"});
\ No newline at end of file
index 62b86bad05436911f212566bac3fc1b5bb266c10..f6c776389c15fe08a1b76c25dfd8ff4cbdb5ec82 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
-*/
-/**\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
-    Event = YAHOO.util.Event;\r
-\r
-/**\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.MenuManager = function() {\r
-\r
-    // Private member variables\r
-\r
-    // Flag indicating if the DOM event handlers have been attached\r
-\r
-    var m_bInitializedEventHandlers = false,\r
-\r
-        // Collection of menus\r
-\r
-        m_oMenus = {},\r
-    \r
-    \r
-        //  Collection of menu items \r
-\r
-        m_oItems = {},\r
-\r
-        // Collection of visible menus\r
-    \r
-        m_oVisibleMenus = {},\r
-\r
-        // Logger\r
-\r
-\r
-        me = this;\r
-\r
-    // Private methods\r
-\r
-    /**\r
-    * @method addItem\r
-    * @description 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
-    function addItem(p_oItem) {\r
-\r
-        var sYUIId = Dom.generateId();\r
-\r
-        if(p_oItem && m_oItems[sYUIId] != p_oItem) {\r
-\r
-            p_oItem.element.setAttribute("yuiid", sYUIId);\r
-    \r
-            m_oItems[sYUIId] = p_oItem;\r
-    \r
-            p_oItem.destroyEvent.subscribe(onItemDestroy, p_oItem);\r
-\r
-\r
-        }\r
-    \r
-    }\r
-\r
-    /**\r
-    * @method removeItem\r
-    * @description 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
-    function removeItem(p_oItem) {\r
-    \r
-        var sYUIId = p_oItem.element.getAttribute("yuiid");\r
-\r
-        if(sYUIId && m_oItems[sYUIId]) {\r
-\r
-            delete m_oItems[sYUIId];\r
-\r
-\r
-        }\r
-    \r
-    }\r
-\r
-    /**\r
-    * @method getMenuRootElement\r
-    * @description Finds the root DIV node of a menu or the root LI node of a \r
-    * 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
-    function getMenuRootElement(p_oElement) {\r
-    \r
-        var oParentNode;\r
-\r
-        if(p_oElement && p_oElement.tagName) {\r
-        \r
-            switch(p_oElement.tagName.toUpperCase()) {\r
-                    \r
-                case "DIV":\r
-    \r
-                    oParentNode = p_oElement.parentNode;\r
-    \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
-                        return oParentNode;\r
-                    \r
-                    }\r
-                    else {\r
-                    \r
-                        return p_oElement;\r
-                    \r
-                    }\r
-                \r
-                break;\r
-\r
-                case "LI":\r
-    \r
-                    return p_oElement;\r
-\r
-                default:\r
-    \r
-                    oParentNode = p_oElement.parentNode;\r
-    \r
-                    if(oParentNode) {\r
-                    \r
-                        return getMenuRootElement(oParentNode);\r
-                    \r
-                    }\r
-                \r
-                break;\r
-            \r
-            }\r
-\r
-        }\r
-        \r
-    }\r
-\r
-    // Private event handlers\r
-\r
-    /**\r
-    * @method onDOMEvent\r
-    * @description 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
-    function onDOMEvent(p_oEvent) {\r
-\r
-        // Get the target node of the DOM event\r
-    \r
-        var oTarget = Event.getTarget(p_oEvent),\r
-\r
-        // See if the target of the event was a menu, or a menu item\r
-\r
-            oElement = getMenuRootElement(oTarget),\r
-            oMenuItem,\r
-            oMenu; \r
-\r
-        if(oElement) {\r
-\r
-            var sTagName = oElement.tagName.toUpperCase();\r
-    \r
-            if(sTagName == "LI") {\r
-        \r
-                var sYUIId = oElement.getAttribute("yuiid");\r
-        \r
-                if(sYUIId) {\r
-        \r
-                    oMenuItem = m_oItems[sYUIId];\r
-                    oMenu = oMenuItem.parent;\r
-        \r
-                }\r
-            \r
-            }\r
-            else if(sTagName == "DIV") {\r
-            \r
-                if(oElement.id) {\r
-                \r
-                    oMenu = m_oMenus[oElement.id];\r
-                \r
-                }\r
-            \r
-            }\r
-\r
-        }\r
-\r
-        if(oMenu) {\r
-\r
-            // Map of DOM event names to CustomEvent names\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
-                sCustomEventType = oEventTypes[p_oEvent.type];\r
-\r
-            // Fire the Custom Even that corresponds the current DOM event    \r
-    \r
-            if(oMenuItem && !oMenuItem.cfg.getProperty("disabled")) {\r
-            \r
-                oMenuItem[sCustomEventType].fire(p_oEvent);                   \r
-            \r
-            }\r
-    \r
-            oMenu[sCustomEventType].fire(p_oEvent, oMenuItem);\r
-        \r
-        }\r
-        else if(p_oEvent.type == "mousedown") {\r
-\r
-            /*\r
-                If the target of the event wasn't a menu, hide all \r
-                dynamically positioned menus\r
-            */\r
-            \r
-            var oActiveItem;\r
-    \r
-            for(var i in m_oMenus) {\r
-    \r
-                if(m_oMenus.hasOwnProperty(i)) {\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
-                    }\r
-                    else {\r
-\r
-                        oMenu.clearActiveItem(true);\r
-    \r
-                    }\r
-    \r
-                }\r
-    \r
-            } \r
-\r
-        }\r
-\r
-    }\r
-\r
-    /**\r
-    * @method onMenuDestroy\r
-    * @description "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
-    function onMenuDestroy(p_sType, p_aArgs, 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 onItemDestroy\r
-    * @description "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
-    function onItemDestroy(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var sYUIId = p_oItem.element.getAttribute("yuiid");\r
-\r
-        if(sYUIId) {\r
-\r
-            delete m_oItems[sYUIId];\r
-\r
-        }\r
-\r
-    }\r
-\r
-    /**\r
-    * @method onMenuVisibleConfigChange\r
-    * @description 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
-    function onMenuVisibleConfigChange(p_sType, p_aArgs, p_oMenu) {\r
-\r
-        var bVisible = p_aArgs[0];\r
-        \r
-        if(bVisible) {\r
-\r
-            m_oVisibleMenus[p_oMenu.id] = p_oMenu;\r
-            \r
-        \r
-        }\r
-        else if(m_oVisibleMenus[p_oMenu.id]) {\r
-        \r
-            delete m_oVisibleMenus[p_oMenu.id];\r
-            \r
-        \r
-        }\r
-    \r
-    }\r
-\r
-    /**\r
-    * @method onItemAdded\r
-    * @description "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
-    function onItemAdded(p_sType, p_aArgs) {\r
-    \r
-        addItem(p_aArgs[0]);\r
-    \r
-    }\r
-    \r
-\r
-    /**\r
-    * @method onItemRemoved\r
-    * @description "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
-    function onItemRemoved(p_sType, p_aArgs) {\r
-\r
-        removeItem(p_aArgs[0]);\r
-    \r
-    }\r
-\r
-    return {\r
-\r
-        // Privileged methods\r
-\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  \r
-        * instance to be added.\r
-        */\r
-        addMenu: function(p_oMenu) {\r
-    \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, me, true);\r
-                    Event.addListener(oDoc, "mouseout", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "mousedown", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "mouseup", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "click", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "keydown", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "keyup", onDOMEvent, me, true);\r
-                    Event.addListener(oDoc, "keypress", onDOMEvent, me, true);\r
-        \r
-                    m_bInitializedEventHandlers = true;\r
-                    \r
-        \r
-                }\r
-        \r
-                p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, me);\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
-        /**\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  \r
-        * instance to be removed.\r
-        */\r
-        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
-        /**\r
-        * @method hideVisible\r
-        * @description Hides all visible, dynamically positioned menus.\r
-        */\r
-        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
-        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
-        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
-        toString: function() {\r
-        \r
-            return ("MenuManager");\r
-        \r
-        }\r
-\r
-    };\r
-\r
-}();\r
-\r
-})();\r
-\r
-\r
-(function() {\r
-\r
-var Dom = YAHOO.util.Dom,\r
-    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
-\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
-\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
-    }\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
-        YAHOO.widget.Module.textResizeEvent.subscribe(\r
-            this._onTextResize, \r
-            this, \r
-            true\r
-        );\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
-            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
-\r
-    if(this.srcElement.tagName) {\r
-\r
-        var sSrcElementTagName = this.srcElement.tagName.toUpperCase();\r
-\r
-\r
-        switch(sSrcElementTagName) {\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(\r
-                                oNode && \r
-                                oNode.tagName && \r
-                                oNode.tagName.toUpperCase() == "LI"\r
-                            ) {\r
-        \r
-\r
-                                this.addItem(\r
-                                        new this.ITEM_TYPE(\r
-                                            oNode, \r
-                                            { parent: this }\r
-                                        ), \r
-                                        i\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
-/**\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
-        oItem,\r
-        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
-/**\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") {\r
-\r
-        p_oItem.parent = this;\r
-\r
-        oItem = new this.ITEM_TYPE(p_oItem.text, p_oItem);\r
-\r
-    }\r
-\r
-\r
-    if(oItem) {\r
-\r
-        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,\r
-            aGroup = this._getItemGroup(nGroupIndex),\r
-            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
-                    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(\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
-/**\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
-        aGroup = this._getItemGroup(nGroupIndex);\r
-\r
-    if(aGroup) {\r
-\r
-        var aArray = aGroup.splice(p_nItemIndex, 1),\r
-            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
-            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
-        nItems = aGroup.length;\r
-\r
-    if(nItems > 0) {\r
-\r
-        var i = nItems - 1,\r
-            oItem,\r
-            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
-        me = this;\r
-\r
-    function hideMenu() {\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
-    var oRoot = this.getRoot();\r
-\r
-    function showMenu() {\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
-        oItem = p_aArgs[1],\r
-        oTarget = Event.getTarget(oEvent);\r
-\r
-\r
-    if(\r
-        !this._bHandledMouseOverEvent && \r
-        (oTarget == this.element || Dom.isAncestor(this.element, oTarget))\r
-    ) {\r
-\r
-        this.clearActiveItem();\r
-\r
-        this._bHandledMouseOverEvent = true;\r
-        this._bHandledMouseOutEvent = false;\r
-    \r
-    }\r
-\r
-\r
-    if(\r
-        oItem && !oItem.handledMouseOverEvent && \r
-        !oItem.cfg.getProperty("disabled") && \r
-        (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))\r
-    ) {\r
-\r
-        var nShowDelay = this.cfg.getProperty("showdelay"),\r
-            bShowDelay = (nShowDelay > 0);\r
-\r
-\r
-        if(bShowDelay) {\r
-        \r
-            this._cancelShowDelay();\r
-        \r
-        }\r
-    \r
-    \r
-        var oActiveItem = this.activeItem;\r
-    \r
-        if(oActiveItem) {\r
-    \r
-            oActiveItem.cfg.setProperty("selected", false);\r
-    \r
-            var oActiveSubmenu = oActiveItem.cfg.getProperty("submenu");\r
-    \r
-            if(oActiveSubmenu) {\r
-                                               \r
-                oActiveSubmenu.hide();\r
-    \r
-            }\r
-    \r
-        }\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(bShowDelay) {\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
-        oItem = p_aArgs[1],\r
-        oRelatedTarget = Event.getRelatedTarget(oEvent),\r
-        bMovingToSubmenu = false;\r
-\r
-\r
-    if(oItem && !oItem.cfg.getProperty("disabled")) {\r
-\r
-        var oItemCfg = oItem.cfg,\r
-            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
-            if(\r
-                !oSubmenu || \r
-                (oSubmenu && !oSubmenu.cfg.getProperty("visible"))\r
-            ) {\r
-\r
-                oItem.cfg.setProperty("selected", false);\r
-\r
-                if(\r
-                    oSubmenu && \r
-                    oSubmenu.cfg.getProperty("showdelay") && \r
-                    !oSubmenu.cfg.getProperty("visible")\r
-                ) {\r
-                \r
-                     this._cancelShowDelay();\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
-        oItem = p_aArgs[1],\r
-        oTarget = Event.getTarget(oEvent);\r
-\r
-    if(oItem && !oItem.cfg.getProperty("disabled")) {\r
-\r
-        var oItemCfg = oItem.cfg,\r
-            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
-                bCurrentPageURL = (sURL.substr((sURL.length-1),1) == "#"),\r
-                sTarget = oItemCfg.getProperty("target"),\r
-                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
-        oItem = p_aArgs[1],\r
-        oSubmenu;\r
-\r
-    if(oItem && !oItem.cfg.getProperty("disabled")) {\r
-\r
-        var oItemCfg = oItem.cfg,\r
-            oParentItem = this.parent,\r
-            oRoot,\r
-            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
-                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
-* @method _onTextResize\r
-* @description "textresize" 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
-_onTextResize: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-    if(this.browser == "gecko" && !this._handleResize) {\r
-\r
-        this._handleResize = true;\r
-        return;\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
-},\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
-        oEl = this.element,\r
-        nListElements = this._aListElements.length;\r
-\r
-\r
-    if(nListElements > 0) {\r
-\r
-        var i = 0,\r
-            bFirstList = true,\r
-            oUL,\r
-            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
-        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
-* @method _onShow\r
-* @description "show" 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 fired \r
-* the event.\r
-*/\r
-_onShow: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-    this.setInitialFocus();\r
-    \r
-    var oParent = this.parent;\r
-    \r
-    if(oParent) {\r
-\r
-        var oParentMenu = oParent.parent,\r
-            aParentAlignment = oParentMenu.cfg.getProperty("submenualignment"),\r
-            aAlignment = this.cfg.getProperty("submenualignment");\r
-\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
-\r
-        if(\r
-            !oParentMenu.cfg.getProperty("autosubmenudisplay") && \r
-            oParentMenu.cfg.getProperty("position") == "static"\r
-        ) {\r
-\r
-            oParentMenu.cfg.setProperty("autosubmenudisplay", true);\r
-\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
-            function disableAutoSubmenuDisplay(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
-                        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
-\r
-            Event.addListener(document, "mousedown", disableAutoSubmenuDisplay);                             \r
-            Event.addListener(document, "keydown", disableAutoSubmenuDisplay);\r
-\r
-        }\r
-\r
-    }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onBeforeHide\r
-* @description "beforehide" 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 fired \r
-* the event.\r
-*/\r
-_onBeforeHide: function(p_sType, p_aArgs, p_oMenu) {\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
-        oActiveItem.blur();\r
-\r
-    }\r
-\r
-},\r
-\r
-\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 sPropertyName = p_aArgs[0][0],\r
-        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
-/**\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 {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
-_onParentMenuRender: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
-    var oParentMenu = p_oSubmenu.parent.parent,\r
-\r
-        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
-            showdelay:\r
-                oParentMenu.cfg.getProperty("showdelay"),\r
-            \r
-            hidedelay:\r
-                oParentMenu.cfg.getProperty("hidedelay")\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
-        }\r
-        else {\r
-\r
-            this.render(this.parent.element);\r
-    \r
-        }\r
-\r
-    }\r
-    \r
-},\r
-\r
-\r
-/**\r
-* @method _onSubmenuBeforeShow\r
-* @description "beforeshow" 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
-_onSubmenuBeforeShow: function(p_sType, p_aArgs, p_oSubmenu) {\r
-    \r
-    var oParent = this.parent,\r
-        aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r
-\r
-    this.cfg.setProperty(\r
-        "context", \r
-        [oParent.element, aAlignment[0], aAlignment[1]]\r
-    );\r
-    \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
-         pos = args[0],\r
-    \r
-         x = pos[0],\r
-         y = pos[1],\r
-    \r
-         offsetHeight = this.element.offsetHeight,\r
-         offsetWidth = this.element.offsetWidth,\r
-    \r
-         viewPortWidth = YAHOO.util.Dom.getViewportWidth(),\r
-         viewPortHeight = YAHOO.util.Dom.getViewportHeight(),\r
-    \r
-         scrollX = Math.max(\r
-                        document.documentElement.scrollLeft, \r
-                        document.body.scrollLeft\r
-                    ),\r
-\r
-         scrollY = Math.max(\r
-                        document.documentElement.scrollTop, \r
-                        document.body.scrollTop\r
-                    ),\r
-    \r
-         topConstraint = scrollY + 10,\r
-         leftConstraint = scrollX + 10,\r
-         bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,\r
-         rightConstraint = scrollX + viewPortWidth - offsetWidth - 10,\r
-    \r
-         aContext = oConfig.getProperty("context"),\r
-         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
-    oConfig.setProperty("xy", [x,y], true);\r
-\r
-},\r
-\r
-\r
-/**\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
-configVisible: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-    if(this.cfg.getProperty("position") == "dynamic") {\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
-           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
-        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
-/**\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
-configPosition: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-    var sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute",\r
-        oCfg = this.cfg;\r
-\r
-    Dom.setStyle(this.element, "position", sCSSPosition);\r
-\r
-\r
-    if(sCSSPosition == "static") {\r
-\r
-        /*\r
-            Remove the iframe for statically positioned menus since it will \r
-            intercept mouse events.\r
-        */\r
-\r
-        oCfg.setProperty("iframe", false);\r
-\r
-\r
-        // Statically positioned menus are visible by default\r
-        \r
-        Dom.setStyle(this.element, "display", "block");\r
-\r
-        oCfg.setProperty("visible", true);\r
-\r
-    }\r
-    else {\r
-\r
-        /*\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
-        Dom.setStyle(this.element, "visibility", "hidden");\r
-    \r
-    }\r
-\r
-\r
-    if(sCSSPosition == "absolute") {\r
-\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
-        }\r
-\r
-    }\r
-\r
-},\r
-\r
-\r
-/**\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 {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
-configIframe: function(p_sType, p_aArgs, p_oMenu) {    \r
-\r
-    if(this.cfg.getProperty("position") == "dynamic") {\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
-* @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 {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
-configHideDelay: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-    var nHideDelay = p_aArgs[0],\r
-        oMouseOutEvent = this.mouseOutEvent,\r
-        oMouseOverEvent = this.mouseOverEvent,\r
-        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
-        }\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
-* @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 {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
-configContainer: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
-       var oElement = p_aArgs[0];\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
-* @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
-/**\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
-* @method toString\r
-* @description Returns a string representing the menu.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
-    return ("Menu " + this.id);\r
-\r
-},\r
-\r
-\r
-/**\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
-setItemGroupTitle: function(p_sGroupTitle, p_nGroupIndex) {\r
-        \r
-    if(typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {\r
-\r
-        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,\r
-            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
-            nFirstIndex;\r
-\r
-        do {\r
-\r
-            if(this._aGroupTitleElements[i]) {\r
-\r
-                Dom.removeClass(this._aGroupTitleElements[i], "first-of-type");\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
-        }\r
-\r
-    }\r
-\r
-},\r
-\r
-\r
-\r
-/**\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
-addItem: function(p_oItem, p_nGroupIndex) {\r
-\r
-    if(p_oItem) {\r
-\r
-        return this._addItemToGroup(p_nGroupIndex, p_oItem);\r
-        \r
-    }\r
-\r
-},\r
-\r
-\r
-/**\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
-addItems: function(p_aItems, p_nGroupIndex) {\r
-\r
-    function isArray(p_oValue) {\r
-    \r
-        return (typeof p_oValue == "object" && p_oValue.constructor == Array);\r
-    \r
-    }\r
-\r
-\r
-    if(isArray(p_aItems)) {\r
-\r
-        var nItems = p_aItems.length,\r
-            aItems = [],\r
-            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
-            else {\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
-* @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 {YAHOO.widget.MenuItem}\r
-*/\r
-insertItem: 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
-    }\r
-\r
-},\r
-\r
-\r
-/**\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
-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
-        else if(typeof p_oObject == "number") {\r
-\r
-            oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);\r
-\r
-        }\r
-\r
-        if(oItem) {\r
-\r
-            oItem.destroy();\r
-\r
-\r
-            return oItem;\r
-\r
-        }\r
-\r
-    }\r
-\r
-},\r
-\r
-\r
-/**\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
-* @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 {YAHOO.widget.MenuItem}\r
-*/\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
-        }\r
-\r
-    }\r
-    \r
-},\r
-\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
-    this.mouseOverEvent.unsubscribeAll();\r
-    this.mouseOutEvent.unsubscribeAll();\r
-    this.mouseDownEvent.unsubscribeAll();\r
-    this.mouseUpEvent.unsubscribeAll();\r
-    this.clickEvent.unsubscribeAll();\r
-    this.keyPressEvent.unsubscribeAll();\r
-    this.keyDownEvent.unsubscribeAll();\r
-    this.keyUpEvent.unsubscribeAll();\r
-    this.itemAddedEvent.unsubscribeAll();\r
-    this.itemRemovedEvent.unsubscribeAll();\r
-\r
-    var nItemGroups = this._aItemGroups.length,\r
-        nItems,\r
-        oItemGroup,\r
-        oItem,\r
-        i,\r
-        n;\r
-\r
-\r
-    // Remove all items\r
-\r
-    if(nItemGroups > 0) {\r
-\r
-        i = nItemGroups - 1;\r
-\r
-        do {\r
-\r
-            oItemGroup = this._aItemGroups[i];\r
-\r
-            if(oItemGroup) {\r
-\r
-                nItems = oItemGroup.length;\r
-    \r
-                if(nItems > 0) {\r
-    \r
-                    n = nItems - 1;\r
-        \r
-                    do {\r
-\r
-                        oItem = this._aItemGroups[i][n];\r
-\r
-                        if(oItem) {\r
-        \r
-                            oItem.destroy();\r
-                        }\r
-        \r
-                    }\r
-                    while(n--);\r
-    \r
-                }\r
-\r
-            }\r
-\r
-        }\r
-        while(i--);\r
-\r
-    }        \r
-\r
-\r
-    // Continue with the superclass implementation of this method\r
-\r
-    YAHOO.widget.Menu.superclass.destroy.call(this);\r
-    \r
-\r
-},\r
-\r
-\r
-/**\r
-* @method setInitialFocus\r
-* @description Sets focus to the menu's first enabled item.\r
-*/\r
-setInitialFocus: function() {\r
-\r
-    var oItem = this._getFirstEnabledItem();\r
-    \r
-    if(oItem) {\r
-    \r
-        oItem.focus();\r
-    }\r
-    \r
-},\r
-\r
-\r
-/**\r
-* @method setInitialSelection\r
-* @description Sets the "selected" configuration property of the menu's first \r
-* enabled item to "true."\r
-*/\r
-setInitialSelection: function() {\r
-\r
-    var oItem = this._getFirstEnabledItem();\r
-    \r
-    if(oItem) {\r
-    \r
-        oItem.cfg.setProperty("selected", true);\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
-    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
-* @description Initializes the class's configurable properties which can be\r
-* changed using the menu's Config object ("cfg").\r
-* @method initDefaultConfig\r
-*/\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
-    /**\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
-\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
-\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
-\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
-       * @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
-}); // END YAHOO.extend\r
-\r
-})();\r
-\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
-(function() {\r
-\r
-var Dom = YAHOO.util.Dom,\r
-    Module = YAHOO.widget.Module,\r
-    Menu = YAHOO.widget.Menu;\r
-\r
-/**\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
-*/\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.MenuItem.prototype = {\r
-\r
-    // Constants\r
-\r
-    /**\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
-    * @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
-        "nt/ic/ut/alt1/menuarorght8_hov_1.gif",\r
-\r
-    /**\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
-        "nt/ic/ut/alt1/menuarorght8_dim_1.gif",\r
-\r
-    /**\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
-    * @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
-    * @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
-    * @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
-    CHECKED_IMAGE_PATH: "nt/ic/ut/bsc/menuchk8_nrm_1.gif",\r
-    \r
-\r
-    /**\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 String\r
-    */\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
-    * @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.Menu\r
-    */\r
-    SUBMENU_TYPE: null,\r
-\r
-    /**\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
-    * @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
-    * @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 <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
-    * @property _oText\r
-    * @description Object reference to the menu item's text node.\r
-    * @default null\r
-    * @private\r
-    * @type TextNode\r
-    */\r
-    _oText: null,\r
-    \r
-    \r
-    /**\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 <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
-    * @property _oSubmenu\r
-    * @description Object reference to the menu item's submenu.\r
-    * @default null\r
-    * @private\r
-    * @type YAHOO.widget.Menu\r
-    */\r
-    _oSubmenu: null,\r
-\r
-    /**\r
-    * @property _checkImage\r
-    * @description Object reference to the menu item's checkmark image.\r
-    * @default null\r
-    * @private\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
-    _checkImage: null,\r
-\r
-    // Public properties\r
-\r
-       /**\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.MenuItem,\r
-\r
-       /**\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
-    * @property isSecure\r
-       * @description Boolean representing whether or not the current browsing \r
-       * context is secure (HTTPS).\r
-       * @type Boolean\r
-       */\r
-       isSecure: Module.prototype.isSecure,\r
-\r
-    /**\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
-    * @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
-    * @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
-    * @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
-    * @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
-    * @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
-    * @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
-    * @property browser\r
-       * @description String representing the browser.\r
-       * @type String\r
-       */\r
-       browser: Module.prototype.browser,\r
-\r
-    // Events\r
-\r
-    /**\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
-    * @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
-    */\r
-    mouseOverEvent: null,\r
-\r
-    /**\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
-    */\r
-    mouseOutEvent: null,\r
-\r
-    /**\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
-    */\r
-    mouseDownEvent: null,\r
-\r
-    /**\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
-    * @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
-    */\r
-    clickEvent: null,\r
-\r
-    /**\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
-    * @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
-    * @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
-    * @event focusEvent\r
-    * @description Fires when the menu item receives focus.\r
-    * @type YAHOO.util.CustomEvent\r
-    */\r
-    focusEvent: null,\r
-\r
-    /**\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
-    * @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} 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 = Menu;\r
-    \r
-        }\r
-\r
-        // Create the config object\r
-\r
-        this.cfg = new YAHOO.util.Config(this);\r
-\r
-        this.initDefaultConfig();\r
-\r
-        var oConfig = this.cfg;\r
-\r
-        if(this._checkString(p_oObject)) {\r
-\r
-            this._createRootNodeStructure();\r
-\r
-            oConfig.setProperty("text", p_oObject);\r
-\r
-        }\r
-        else if(this._checkDOMNode(p_oObject)) {\r
-\r
-            switch(p_oObject.tagName.toUpperCase()) {\r
-\r
-                case "OPTION":\r
-\r
-                    this._createRootNodeStructure();\r
-\r
-                    oConfig.setProperty("text", p_oObject.text);\r
-\r
-                    this.srcElement = p_oObject;\r
-\r
-                break;\r
-\r
-                case "OPTGROUP":\r
-\r
-                    this._createRootNodeStructure();\r
-\r
-                    oConfig.setProperty("text", p_oObject.label);\r
-\r
-                    this.srcElement = p_oObject;\r
-\r
-                    this._initSubTree();\r
-\r
-                break;\r
-\r
-                case "LI":\r
-\r
-                    // Get the anchor node (if it exists)\r
-\r
-                    var oAnchor = this._getFirstElement(p_oObject, "A"),\r
-                        sURL = "#",\r
-                        sTarget,\r
-                        sText;\r
-\r
-                    // Capture the "text" and/or the "URL"\r
-\r
-                    if(oAnchor) {\r
-\r
-                        sURL = oAnchor.getAttribute("href");\r
-                        sTarget = oAnchor.getAttribute("target");\r
-\r
-                        if(oAnchor.innerText) {\r
-                \r
-                            sText = oAnchor.innerText;\r
-                \r
-                        }\r
-                        else {\r
-                \r
-                            var oRange = oAnchor.ownerDocument.createRange();\r
-                \r
-                            oRange.selectNodeContents(oAnchor);\r
-                \r
-                            sText = oRange.toString();             \r
-                \r
-                        }\r
-\r
-                    }\r
-                    else {\r
-\r
-                        var oText = p_oObject.firstChild;\r
-\r
-                        sText = oText.nodeValue;\r
-\r
-                        oAnchor = document.createElement("a");\r
-                        \r
-                        oAnchor.setAttribute("href", sURL);\r
-\r
-                        p_oObject.replaceChild(oAnchor, oText);\r
-                        \r
-                        oAnchor.appendChild(oText);\r
-\r
-                    }\r
-\r
-                    this.srcElement = p_oObject;\r
-                    this.element = p_oObject;\r
-                    this._oAnchor = oAnchor;\r
-    \r
-\r
-                    // Check if emphasis has been applied to the MenuItem\r
-\r
-                    var oEmphasisNode = this._getFirstElement(oAnchor),\r
-                        bEmphasis = false,\r
-                        bStrongEmphasis = false;\r
-\r
-                    if(oEmphasisNode) {\r
-\r
-                        // Set a reference to the text node \r
-\r
-                        this._oText = oEmphasisNode.firstChild;\r
-\r
-                        switch(oEmphasisNode.tagName.toUpperCase()) {\r
-\r
-                            case "EM":\r
-\r
-                                bEmphasis = true;\r
-\r
-                            break;\r
-\r
-                            case "STRONG":\r
-\r
-                                bStrongEmphasis = true;\r
-\r
-                            break;\r
-\r
-                        }\r
-\r
-                    }\r
-                    else {\r
-\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
-                        element's DOM\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
-                        true\r
-                    );\r
-\r
-                    this._initSubTree();\r
-\r
-                break;\r
-\r
-            }            \r
-\r
-        }\r
-\r
-        if(this.element) {\r
-\r
-            Dom.addClass(this.element, this.CSS_CLASS_NAME);\r
-\r
-            // Create custom events\r
-    \r
-            var CustomEvent = YAHOO.util.CustomEvent;\r
-    \r
-            this.destroyEvent = new CustomEvent("destroyEvent", this);\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.focusEvent = new CustomEvent("focusEvent", this);\r
-            this.blurEvent = new CustomEvent("blurEvent", this);\r
-\r
-            if(p_oConfig) {\r
-    \r
-                oConfig.applyConfig(p_oConfig);\r
-    \r
-            }        \r
-\r
-            oConfig.fireQueue();\r
-\r
-        }\r
-\r
-    },\r
-\r
-    // Private methods\r
-\r
-    /**\r
-    * @method _getFirstElement\r
-    * @description Returns an HTML element's first HTML element node.\r
-    * @private\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
-        var oElement;\r
-\r
-        if(p_oElement.firstChild && p_oElement.firstChild.nodeType == 1) {\r
-\r
-            oElement = p_oElement.firstChild;\r
-\r
-        }\r
-        else if(\r
-            p_oElement.firstChild && \r
-            p_oElement.firstChild.nextSibling && \r
-            p_oElement.firstChild.nextSibling.nodeType == 1\r
-        ) {\r
-\r
-            oElement = p_oElement.firstChild.nextSibling;\r
-\r
-        }\r
-\r
-        if(p_sTagName) {\r
-\r
-            return (oElement && oElement.tagName.toUpperCase() == p_sTagName) ? \r
-                oElement : false;\r
-\r
-        }\r
-\r
-        return oElement;\r
-\r
-    },\r
-\r
-    /**\r
-    * @method _checkString\r
-    * @description Determines if an object is a string.\r
-    * @private\r
-    * @param {Object} p_oObject Object to be evaluated.\r
-    * @return {Boolean}\r
-    */\r
-    _checkString: function(p_oObject) {\r
-\r
-        return (typeof p_oObject == "string");\r
-\r
-    },\r
-\r
-    /**\r
-    * @method _checkDOMNode\r
-    * @description Determines if an object is an HTML element.\r
-    * @private\r
-    * @param {Object} p_oObject Object to be evaluated.\r
-    * @return {Boolean}\r
-    */\r
-    _checkDOMNode: function(p_oObject) {\r
-\r
-        return (p_oObject && p_oObject.tagName);\r
-\r
-    },\r
-\r
-    /**\r
-    * @method _createRootNodeStructure\r
-    * @description Creates the core DOM structure for the menu item.\r
-    * @private\r
-    */\r
-    _createRootNodeStructure: function () {\r
-\r
-        this.element = document.createElement("li");\r
-\r
-        this._oText = document.createTextNode("");\r
-\r
-        this._oAnchor = document.createElement("a");\r
-        this._oAnchor.appendChild(this._oText);\r
-        \r
-        this.cfg.refireEvent("url");\r
-\r
-        this.element.appendChild(this._oAnchor);            \r
-\r
-    },\r
-\r
-    /**\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 oSrcEl = this.srcElement,\r
-            oConfig = this.cfg;\r
-\r
-        if(oSrcEl.childNodes.length > 0) {\r
-\r
-            if(\r
-                this.parent.lazyLoad && \r
-                this.parent.srcElement && \r
-                this.parent.srcElement.tagName.toUpperCase() == "SELECT"\r
-            ) {\r
-\r
-                oConfig.setProperty(\r
-                        "submenu", \r
-                        { id: Dom.generateId(), itemdata: oSrcEl.childNodes }\r
-                    );\r
-\r
-            }\r
-            else {\r
-\r
-                var oNode = oSrcEl.firstChild,\r
-                    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
-                }        \r
-                while((oNode = oNode.nextSibling));\r
-    \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
-    * @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
-    * @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
-\r
-        var sText = p_aArgs[0];\r
-\r
-        if(this._oText) {\r
-\r
-            this._oText.nodeValue = sText;\r
-\r
-        }\r
-\r
-    },\r
-\r
-    /**\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
-    configHelpText: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var me = this,\r
-            oHelpText = p_aArgs[0],\r
-            oEl = this.element,\r
-            oConfig = this.cfg,\r
-            aNodes = [oEl, this._oAnchor],\r
-            oImg = this.submenuIndicator;\r
-\r
-        /**\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
-\r
-            Dom.addClass(aNodes, "hashelptext");\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
-\r
-        /**\r
-        * Removes the "hashelptext" class and corresponding DOM element (EM).\r
-        * @private\r
-        */\r
-        function removeHelpText() {\r
-\r
-            Dom.removeClass(aNodes, "hashelptext");\r
-\r
-            oEl.removeChild(me._oHelpTextEM);\r
-            me._oHelpTextEM = null;\r
-\r
-        }\r
-\r
-        if(this._checkDOMNode(oHelpText)) {\r
-\r
-            if(this._oHelpTextEM) {\r
-\r
-                this._oHelpTextEM.parentNode.replaceChild(\r
-                    oHelpText, \r
-                    this._oHelpTextEM\r
-                );\r
-\r
-            }\r
-            else {\r
-\r
-                this._oHelpTextEM = oHelpText;\r
-\r
-                oEl.insertBefore(this._oHelpTextEM, oImg);\r
-\r
-            }\r
-\r
-            initHelpText();\r
-\r
-        }\r
-        else if(this._checkString(oHelpText)) {\r
-\r
-            if(oHelpText.length === 0) {\r
-\r
-                removeHelpText();\r
-\r
-            }\r
-            else {\r
-\r
-                if(!this._oHelpTextEM) {\r
-\r
-                    this._oHelpTextEM = document.createElement("em");\r
-\r
-                    oEl.insertBefore(this._oHelpTextEM, oImg);\r
-\r
-                }\r
-\r
-                this._oHelpTextEM.innerHTML = oHelpText;\r
-\r
-                initHelpText();\r
-\r
-            }\r
-\r
-        }\r
-        else if(!oHelpText && this._oHelpTextEM) {\r
-\r
-            removeHelpText();\r
-\r
-        }\r
-\r
-    },\r
-\r
-    /**\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
-    configURL: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var sURL = p_aArgs[0];\r
-\r
-        if(!sURL) {\r
-\r
-            sURL = "#";\r
-\r
-        }\r
-\r
-        this._oAnchor.setAttribute("href", sURL);\r
-\r
-    },\r
-\r
-    /**\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
-            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
-    configEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var bEmphasis = p_aArgs[0],\r
-            oAnchor = this._oAnchor,\r
-            oText = this._oText,\r
-            oConfig = this.cfg,\r
-            oEM;\r
-\r
-        if(bEmphasis && oConfig.getProperty("strongemphasis")) {\r
-\r
-            oConfig.setProperty("strongemphasis", false);\r
-\r
-        }\r
-\r
-        if(oAnchor) {\r
-\r
-            if(bEmphasis) {\r
-\r
-                oEM = document.createElement("em");\r
-                oEM.appendChild(oText);\r
-\r
-                oAnchor.appendChild(oEM);\r
-\r
-            }\r
-            else {\r
-\r
-                oEM = this._getFirstElement(oAnchor, "EM");\r
-\r
-                if(oEM) {\r
-\r
-                    oAnchor.removeChild(oEM);\r
-                    oAnchor.appendChild(oText);\r
-\r
-                }\r
-\r
-            }\r
-\r
-        }\r
-\r
-    },\r
-\r
-    /**\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
-    configStrongEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var bStrongEmphasis = p_aArgs[0],\r
-            oAnchor = this._oAnchor,\r
-            oText = this._oText,\r
-            oConfig = this.cfg,\r
-            oStrong;\r
-\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
-                if(oStrong) {\r
-\r
-                    oAnchor.removeChild(oStrong);\r
-                    oAnchor.appendChild(oText);\r
-\r
-                }\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
-            oEl = this.element,\r
-            oConfig = this.cfg,\r
-            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
-            }\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
-    * @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
-    configDisabled: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        var bDisabled = p_aArgs[0],\r
-            oAnchor = this._oAnchor,\r
-            aNodes = [this.element, oAnchor],\r
-            oEM = this._oHelpTextEM,\r
-            oConfig = this.cfg,\r
-            oImg,\r
-            sImgSrc,\r
-            sImgAlt;\r
-\r
-        if(oEM) {\r
-\r
-            aNodes[2] = oEM;\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
-        oImg = this.submenuIndicator;\r
-\r
-        if(bDisabled) {\r
-\r
-            if(oConfig.getProperty("selected")) {\r
-\r
-                oConfig.setProperty("selected", false);\r
-\r
-            }\r
-\r
-            oAnchor.removeAttribute("href");\r
-\r
-            Dom.addClass(aNodes, "disabled");\r
-\r
-            sImgSrc = this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH;\r
-            sImgAlt = this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;\r
-\r
-        }\r
-        else {\r
-\r
-            oAnchor.setAttribute("href", oConfig.getProperty("url"));\r
-\r
-            Dom.removeClass(aNodes, "disabled");\r
-\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 + sImgSrc;\r
-            oImg.alt = sImgAlt;\r
-\r
-        }\r
-\r
-    },\r
-\r
-    /**\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
-    configSelected: function(p_sType, p_aArgs, p_oItem) {\r
-\r
-        if(!this.cfg.getProperty("disabled")) {\r
-\r
-            var bSelected = p_aArgs[0],\r
-                oEM = this._oHelpTextEM,\r
-                aNodes = [this.element, this._oAnchor],\r
-                oImg = this.submenuIndicator,\r
-                sImgSrc;\r
-\r
-            if(oEM) {\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
-            if(bSelected) {\r
-    \r
-                Dom.addClass(aNodes, "selected");\r
-                sImgSrc = this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH;\r
-    \r
-            }\r
-            else {\r
-    \r
-                Dom.removeClass(aNodes, "selected");\r
-                sImgSrc = this.SUBMENU_INDICATOR_IMAGE_PATH;\r
-    \r
-            }\r
-    \r
-            if(oImg) {\r
-    \r
-                oImg.src = document.images[(this.imageRoot + sImgSrc)].src;\r
-\r
-            }\r
-\r
-        }\r
-\r
-    },\r
-\r
-    /**\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 oEl = this.element,\r
-            oSubmenu = p_aArgs[0],\r
-            oImg = this.submenuIndicator,\r
-            oConfig = this.cfg,\r
-            aNodes = [this.element, this._oAnchor],\r
-            oMenu,\r
-            bLazyLoad = this.parent && this.parent.lazyLoad;\r
-\r
-        if(oSubmenu) {\r
-\r
-            if(oSubmenu instanceof Menu) {\r
-\r
-                oMenu = oSubmenu;\r
-                oMenu.parent = this;\r
-                oMenu.lazyLoad = bLazyLoad;\r
-\r
-            }\r
-            else if(\r
-                typeof oSubmenu == "object" && \r
-                oSubmenu.id && \r
-                !oSubmenu.nodeType\r
-            ) {\r
-\r
-                var sSubmenuId = oSubmenu.id,\r
-                    oSubmenuConfig = oSubmenu;\r
-\r
-                oSubmenuConfig.lazyload = bLazyLoad;\r
-                oSubmenuConfig.parent = this;\r
-\r
-                oMenu = new this.SUBMENU_TYPE(sSubmenuId, oSubmenuConfig);\r
-\r
-                // Set the value of the property to the Menu instance\r
-                \r
-                this.cfg.setProperty("submenu", oMenu, true);\r
-\r
-            }\r
-            else {\r
-\r
-                oMenu = new this.SUBMENU_TYPE(\r
-                                oSubmenu,\r
-                                { lazyload: bLazyLoad, parent: this }                \r
-                            );\r
-\r
-                // Set the value of the property to the Menu instance\r
-                \r
-                this.cfg.setProperty("submenu", oMenu, true);\r
-\r
-            }\r
-\r
-            if(oMenu) {\r
-\r
-                this._oSubmenu = oMenu;\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
-                    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
-            \r
-            }\r
-\r
-        }\r
-        else {\r
-\r
-            Dom.removeClass(aNodes, "hassubmenu");\r
-\r
-            if(oImg) {\r
-\r
-                oEl.removeChild(oImg);\r
-\r
-            }\r
-\r
-            if(this._oSubmenu) {\r
-\r
-                this._oSubmenu.destroy();\r
-\r
-            }\r
-\r
-        }\r
-\r
-    },\r
-\r
-    // Public methods\r
-\r
-       /**\r
-    * @method initDefaultConfig\r
-       * @description Initializes an item's configurable properties.\r
-       */\r
-       initDefaultConfig : function() {\r
-\r
-        var oConfig = this.cfg,\r
-            CheckBoolean = oConfig.checkBoolean;\r
-\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
-            }\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
-        * @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
-            { value: "#", handler: this.configURL, suppressEvent: true }\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
-            }\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
-                value: false,\r
-                handler: this.configStrongEmphasis,\r
-                validator: CheckBoolean,\r
-                suppressEvent: true\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
-        * @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
-                value: false,\r
-                handler: this.configDisabled,\r
-                validator: CheckBoolean,\r
-                suppressEvent: true\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
-                value: false,\r
-                handler: this.configSelected,\r
-                validator: CheckBoolean,\r
-                suppressEvent: true\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
-    * @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 Menu) {\r
-\r
-            var nGroupIndex = this.groupIndex;\r
-\r
-            /**\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
-                    getNextArrayItem(p_aArray, (p_nStartIndex+1));\r
-    \r
-            }\r
-    \r
-    \r
-            var aItemGroups = this.parent.getItemGroups(),\r
-                oNextItem;\r
-    \r
-    \r
-            if(this.index < (aItemGroups[nGroupIndex].length - 1)) {\r
-    \r
-                oNextItem = getNextArrayItem(\r
-                        aItemGroups[nGroupIndex], \r
-                        (this.index+1)\r
-                    );\r
-    \r
-            }\r
-            else {\r
-    \r
-                var nNextGroupIndex;\r
-    \r
-                if(nGroupIndex < (aItemGroups.length - 1)) {\r
-    \r
-                    nNextGroupIndex = nGroupIndex + 1;\r
-    \r
-                }\r
-                else {\r
-    \r
-                    nNextGroupIndex = 0;\r
-    \r
-                }\r
-    \r
-                var aNextGroup = getNextArrayItem(aItemGroups, nNextGroupIndex);\r
-    \r
-                // Retrieve the first menu item in the next group\r
-    \r
-                oNextItem = getNextArrayItem(aNextGroup, 0);\r
-    \r
-            }\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
-    * @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 Menu) {\r
-\r
-            var nGroupIndex = this.groupIndex;\r
-\r
-            /**\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
-                    getPreviousArrayItem(p_aArray, (p_nStartIndex-1));\r
-    \r
-            }\r
-\r
-            /**\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
-            function getFirstItemIndex(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
-            var aItemGroups = this.parent.getItemGroups(),\r
-                oPreviousItem;\r
-    \r
-            if(\r
-                this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)\r
-            ) {\r
-    \r
-                oPreviousItem = \r
-                    getPreviousArrayItem(\r
-                        aItemGroups[nGroupIndex], \r
-                        (this.index-1)\r
-                    );\r
-    \r
-            }\r
-            else {\r
-    \r
-                var nPreviousGroupIndex;\r
-    \r
-                if(nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {\r
-    \r
-                    nPreviousGroupIndex = nGroupIndex - 1;\r
-    \r
-                }\r
-                else {\r
-    \r
-                    nPreviousGroupIndex = aItemGroups.length - 1;\r
-    \r
-                }\r
-    \r
-                var aPreviousGroup = \r
-                        getPreviousArrayItem(aItemGroups, nPreviousGroupIndex);\r
-    \r
-                oPreviousItem = \r
-                    getPreviousArrayItem(\r
-                        aPreviousGroup, \r
-                        (aPreviousGroup.length - 1)\r
-                    );\r
-    \r
-            }\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
-    * @method focus\r
-    * @description Causes the menu item to receive the focus and fires the \r
-    * focus event.\r
-    */\r
-    focus: function() {\r
-\r
-        var oParent = this.parent,\r
-            oAnchor = this._oAnchor,\r
-            oActiveItem = oParent.activeItem;\r
-\r
-        function setFocus() {\r
-\r
-            try {\r
-\r
-                oAnchor.focus();\r
-\r
-            }\r
-            catch(e) {\r
-            \r
-            }\r
-\r
-        }\r
-\r
-        if(\r
-            !this.cfg.getProperty("disabled") && \r
-            oParent && \r
-            oParent.cfg.getProperty("visible") && \r
-            this.element.style.display != "none"\r
-        ) {\r
-\r
-            if(oActiveItem) {\r
-\r
-                oActiveItem.blur();\r
-\r
-            }\r
-\r
-            /*\r
-                Setting focus via a timer fixes a race condition in Firefox, IE \r
-                and Opera where the browser viewport jumps as it trys to \r
-                position and focus the menu.\r
-            */\r
-\r
-            window.setTimeout(setFocus, 0);\r
-            \r
-            this.focusEvent.fire();\r
-\r
-        }\r
-\r
-    },\r
-\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
-            Dom.getStyle(oParent.element, "visibility") == "visible"\r
-        ) {\r
-\r
-            this._oAnchor.blur();\r
-\r
-            this.blurEvent.fire();\r
-\r
-        }\r
-\r
-    },\r
-\r
-       /**\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
-        var oEl = this.element;\r
-\r
-        if(oEl) {\r
-\r
-            // If the item has a submenu, destroy it first\r
-\r
-            var oSubmenu = this.cfg.getProperty("submenu");\r
-\r
-            if(oSubmenu) {\r
-            \r
-                oSubmenu.destroy();\r
-            \r
-            }\r
-\r
-            // Remove CustomEvent listeners\r
-    \r
-            this.mouseOverEvent.unsubscribeAll();\r
-            this.mouseOutEvent.unsubscribeAll();\r
-            this.mouseDownEvent.unsubscribeAll();\r
-            this.mouseUpEvent.unsubscribeAll();\r
-            this.clickEvent.unsubscribeAll();\r
-            this.keyPressEvent.unsubscribeAll();\r
-            this.keyDownEvent.unsubscribeAll();\r
-            this.keyUpEvent.unsubscribeAll();\r
-            this.focusEvent.unsubscribeAll();\r
-            this.blurEvent.unsubscribeAll();\r
-            this.cfg.configChangedEvent.unsubscribeAll();\r
-\r
-            // Remove the element from the parent node\r
-\r
-            var oParentNode = oEl.parentNode;\r
-\r
-            if(oParentNode) {\r
-\r
-                oParentNode.removeChild(oEl);\r
-\r
-                this.destroyEvent.fire();\r
-\r
-            }\r
-\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
-        oTrigger = this._oTrigger,\r
-        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
-        Event.removeListener(oTrigger, "click", this._onTriggerClick);\r
-\r
-    }\r
-\r
-},\r
-\r
-// Private event handlers\r
-\r
-/**\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
-_onTriggerClick: function(p_oEvent, p_oMenu) {\r
-\r
-    if(p_oEvent.ctrlKey) {\r
-    \r
-        YAHOO.util.Event.stopEvent(p_oEvent);\r
-\r
-    }\r
-    \r
-},\r
-\r
-/**\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
-_onTriggerContextMenu: function(p_oEvent, p_oMenu) {\r
-\r
-    // Hide any other ContextMenu instances that might be visible\r
-\r
-    YAHOO.widget.MenuManager.hideVisible();\r
-\r
-    var Event = YAHOO.util.Event,\r
-        oConfig = this.cfg;\r
-\r
-    if(p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {\r
-\r
-        return;\r
-\r
-    }\r
-\r
-    this.contextEventTarget = Event.getTarget(p_oEvent);\r
-\r
-    // Position and display the context menu\r
-\r
-    var nX = Event.getPageX(p_oEvent),\r
-        nY = Event.getPageY(p_oEvent);\r
-\r
-    oConfig.applyConfig( { xy:[nX, nY], visible:true } );\r
-    oConfig.fireQueue();\r
-\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
-    Event.stopEvent(p_oEvent);\r
-    \r
-},\r
-\r
-// Public methods\r
-\r
-/**\r
-* @method toString\r
-* @description Returns a string representing the context menu.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
-    return ("ContextMenu " + this.id);\r
-\r
-},\r
-\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
-    YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);\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
-* @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
-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
-// Public event handlers for configuration properties\r
-\r
-/**\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 {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
-configTrigger: function(p_sType, p_aArgs, p_oMenu) {\r
-    \r
-    var Event = YAHOO.util.Event,\r
-        oTrigger = p_aArgs[0];\r
-\r
-    if(oTrigger) {\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
-        if(this._oTrigger) {\r
-        \r
-            this._removeEventHandlers();\r
-\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 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
-            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
-    else {\r
-    \r
-        this._removeEventHandlers();\r
-    \r
-    }\r
-    \r
-}\r
-\r
-}); // END YAHOO.extend\r
-\r
-/**\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.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
-* @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
-init: function(p_oObject, p_oConfig) {\r
-    \r
-    if(!this.SUBMENU_TYPE) {\r
-\r
-        this.SUBMENU_TYPE = YAHOO.widget.ContextMenu;\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
-    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
-// Public methods\r
-\r
-/**\r
-* @method toString\r
-* @description Returns a string representing the context menu item.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
-    return ("MenuBarItem: " + this.cfg.getProperty("text"));\r
-\r
-}\r
-    \r
-}); // END YAHOO.extend\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
-};\r
-\r
-YAHOO.extend(YAHOO.widget.MenuBar, YAHOO.widget.Menu, {\r
-\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
-    if(!this.ITEM_TYPE) {\r
-\r
-        this.ITEM_TYPE = YAHOO.widget.MenuBarItem;\r
-\r
-    }\r
-\r
-    // Call the init of the superclass (YAHOO.widget.Menu)\r
-\r
-    YAHOO.widget.MenuBar.superclass.init.call(this, p_oElement);\r
-\r
-    this.beforeInitEvent.fire(YAHOO.widget.MenuBar);\r
-\r
-    if(p_oConfig) {\r
-\r
-        this.cfg.applyConfig(p_oConfig, true);\r
-\r
-    }\r
-\r
-    this.initEvent.fire(YAHOO.widget.MenuBar);\r
-\r
-},\r
-\r
-// Constants\r
-\r
-/**\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
-// Protected event handlers\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
-_onKeyDown: function(p_sType, p_aArgs, p_oMenuBar) {\r
-\r
-    var Event = YAHOO.util.Event,\r
-        oEvent = p_aArgs[0],\r
-        oItem = p_aArgs[1],\r
-        oSubmenu;\r
-\r
-    if(oItem && !oItem.cfg.getProperty("disabled")) {\r
-\r
-        var oItemCfg = oItem.cfg;\r
-\r
-        switch(oEvent.keyCode) {\r
-    \r
-            case 37:    // Left arrow\r
-            case 39:    // Right 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
-                    var oNextItem = (oEvent.keyCode == 37) ? \r
-                            oItem.getPreviousEnabledSibling() : \r
-                            oItem.getNextEnabledSibling();\r
-            \r
-                    if(oNextItem) {\r
-    \r
-                        this.clearActiveItem();\r
-    \r
-                        oNextItem.cfg.setProperty("selected", true);\r
-    \r
-    \r
-                        if(this.cfg.getProperty("autosubmenudisplay")) {\r
-                        \r
-                            oSubmenu = oNextItem.cfg.getProperty("submenu");\r
-                            \r
-                            if(oSubmenu) {\r
-                        \r
-                                oSubmenu.show();\r
-                                oSubmenu.activeItem.blur();\r
-                                oSubmenu.activeItem = null;\r
-                            \r
-                            }\r
-                \r
-                        }           \r
-    \r
-                        oNextItem.focus();\r
-    \r
-                    }\r
-    \r
-                }\r
-    \r
-                Event.preventDefault(oEvent);\r
-    \r
-            break;\r
-    \r
-            case 40:    // Down arrow\r
-    \r
-                if(this.activeItem != oItem) {\r
-    \r
-                    this.clearActiveItem();\r
-    \r
-                    oItemCfg.setProperty("selected", true);\r
-                    oItem.focus();\r
-                \r
-                }\r
-    \r
-                oSubmenu = oItemCfg.getProperty("submenu");\r
-    \r
-                if(oSubmenu) {\r
-    \r
-                    if(oSubmenu.cfg.getProperty("visible")) {\r
-    \r
-                        oSubmenu.setInitialSelection();\r
-                        oSubmenu.setInitialFocus();\r
-                    \r
-                    }\r
-                    else {\r
-    \r
-                        oSubmenu.show();\r
-                    \r
-                    }\r
-    \r
-                }\r
-    \r
-                Event.preventDefault(oEvent);\r
-    \r
-            break;\r
-    \r
-        }\r
-\r
-    }\r
-\r
-    if(oEvent.keyCode == 27 && this.activeItem) { // Esc key\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
-        Event.preventDefault(oEvent);\r
-    \r
-    }\r
-\r
-},\r
-\r
-/**\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
-_onClick: function(p_sType, p_aArgs, p_oMenuBar) {\r
-\r
-    YAHOO.widget.MenuBar.superclass._onClick.call(\r
-        this, \r
-        p_sType, \r
-        p_aArgs, \r
-        p_oMenuBar\r
-    );\r
-\r
-    var oItem = p_aArgs[1];\r
-    \r
-    if(oItem && !oItem.cfg.getProperty("disabled")) {\r
-\r
-         var Event = YAHOO.util.Event,\r
-             Dom = YAHOO.util.Dom,\r
-    \r
-             oEvent = p_aArgs[0],\r
-             oTarget = Event.getTarget(oEvent),\r
-    \r
-             oActiveItem = this.activeItem,\r
-             oConfig = this.cfg;\r
-\r
-        // Hide any other submenus that might be visible\r
-    \r
-        if(oActiveItem && oActiveItem != oItem) {\r
-    \r
-            this.clearActiveItem();\r
-    \r
-        }\r
-    \r
-    \r
-        // Select and focus the current item\r
-    \r
-        oItem.cfg.setProperty("selected", true);\r
-        oItem.focus();\r
-    \r
-\r
-        // Show the submenu for the item\r
-    \r
-        var oSubmenu = oItem.cfg.getProperty("submenu");\r
-\r
-        if(oSubmenu && oTarget != oItem.submenuIndicator) {\r
-        \r
-            if(oSubmenu.cfg.getProperty("visible")) {\r
-            \r
-                oSubmenu.hide();\r
-            \r
-            }\r
-            else {\r
-            \r
-                oSubmenu.show();                    \r
-            \r
-            }\r
-        \r
-        }\r
-    \r
-    }\r
-\r
-},\r
-\r
-// Public methods\r
-\r
-/**\r
-* @method toString\r
-* @description Returns a string representing the menu bar.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
-    return ("MenuBar " + this.id);\r
-\r
-},\r
-\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.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" by re-adding the property.\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","bl"] by re-adding the property.\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
-    /*\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
-}\r
\r
-}); // END YAHOO.extend\r
-\r
-/**\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.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
-        p_oConfig\r
-    );\r
-\r
-};\r
-\r
-YAHOO.extend(YAHOO.widget.MenuBarItem, YAHOO.widget.MenuItem, {\r
-\r
-/**\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
-init: function(p_oObject, p_oConfig) {\r
-\r
-    if(!this.SUBMENU_TYPE) {\r
-\r
-        this.SUBMENU_TYPE = YAHOO.widget.Menu;\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.MenuBarItem.superclass.init.call(this, p_oObject);  \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
-// Constants\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 bar item.\r
-* @default "yuimenubaritem"\r
-* @final\r
-* @type String\r
-*/\r
-CSS_CLASS_NAME: "yuimenubaritem",\r
-\r
-/**\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
-SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_nrm_1.gif",\r
-\r
-/**\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
-SELECTED_SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_hov_1.gif",\r
-\r
-/**\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
-DISABLED_SUBMENU_INDICATOR_IMAGE_PATH: "nt/ic/ut/alt1/menuarodwn8_dim_1.gif",\r
-\r
-// Public methods\r
-\r
-/**\r
-* @method toString\r
-* @description Returns a string representing the menu bar item.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
-    return ("MenuBarItem: " + this.cfg.getProperty("text"));\r
-\r
-}\r
-    \r
-}); // END YAHOO.extend
\ No newline at end of file
+version: 2.3.0
+*/
+
+
+/**
+* @module menu
+* @description <p>The Menu family of components features a collection of 
+* controls that make it easy to add menus to your website or web application.  
+* With the Menu Controls you can create website fly-out menus, customized 
+* context menus, or application-style menu bars with just a small amount of 
+* scripting.</p><p>The Menu family of controls features:</p>
+* <ul>
+*    <li>Screen-reader accessibility.</li>
+*    <li>Keyboard and mouse navigation.</li>
+*    <li>A rich event model that provides access to all of a menu's 
+*    interesting moments.</li>
+*    <li>Support for 
+*    <a href="http://en.wikipedia.org/wiki/Progressive_Enhancement">Progressive
+*    Enhancement</a>; Menus can be created from simple, 
+*    semantic markup on the page or purely through JavaScript.</li>
+* </ul>
+* @title Menu
+* @namespace YAHOO.widget
+* @requires Event, Dom, Container
+*/
+(function () {
+
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event;
+
+
+    /**
+    * Singleton that manages a collection of all menus and menu items.  Listens 
+    * for DOM events at the document level and dispatches the events to the 
+    * corresponding menu or menu item.
+    *
+    * @namespace YAHOO.widget
+    * @class MenuManager
+    * @static
+    */
+    YAHOO.widget.MenuManager = function () {
+    
+        // Private member variables
+    
+    
+        // Flag indicating if the DOM event handlers have been attached
+    
+        var m_bInitializedEventHandlers = false,
+    
+    
+        // Collection of menus
+
+        m_oMenus = {},
+
+
+        // Collection of visible menus
+    
+        m_oVisibleMenus = {},
+    
+    
+        //  Collection of menu items 
+
+        m_oItems = {},
+
+
+        // Map of DOM event types to their equivalent CustomEvent types
+        
+        m_oEventTypes = {
+            "click": "clickEvent",
+            "mousedown": "mouseDownEvent",
+            "mouseup": "mouseUpEvent",
+            "mouseover": "mouseOverEvent",
+            "mouseout": "mouseOutEvent",
+            "keydown": "keyDownEvent",
+            "keyup": "keyUpEvent",
+            "keypress": "keyPressEvent"
+        },
+    
+    
+        m_oFocusedMenuItem = null;
+    
+    
+    
+    
+    
+        // Private methods
+    
+    
+        /**
+        * @method getMenuRootElement
+        * @description Finds the root DIV node of a menu or the root LI node of 
+        * a menu item.
+        * @private
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object 
+        * specifying an HTML element.
+        */
+        function getMenuRootElement(p_oElement) {
+        
+            var oParentNode;
+    
+            if (p_oElement && p_oElement.tagName) {
+            
+                switch (p_oElement.tagName.toUpperCase()) {
+                        
+                case "DIV":
+    
+                    oParentNode = p_oElement.parentNode;
+    
+                    // Check if the DIV is the inner "body" node of a menu
+
+                    if (
+                        (
+                            Dom.hasClass(p_oElement, "hd") ||
+                            Dom.hasClass(p_oElement, "bd") ||
+                            Dom.hasClass(p_oElement, "ft")
+                        ) && 
+                        oParentNode && 
+                        oParentNode.tagName && 
+                        oParentNode.tagName.toUpperCase() == "DIV") 
+                    {
+                    
+                        return oParentNode;
+                    
+                    }
+                    else {
+                    
+                        return p_oElement;
+                    
+                    }
+                
+                    break;
+
+                case "LI":
+    
+                    return p_oElement;
+
+                default:
+    
+                    oParentNode = p_oElement.parentNode;
+    
+                    if (oParentNode) {
+                    
+                        return getMenuRootElement(oParentNode);
+                    
+                    }
+                
+                    break;
+                
+                }
+    
+            }
+            
+        }
+    
+    
+    
+        // Private event handlers
+    
+    
+        /**
+        * @method onDOMEvent
+        * @description Generic, global event handler for all of a menu's 
+        * DOM-based events.  This listens for events against the document 
+        * object.  If the target of a given event is a member of a menu or 
+        * menu item's DOM, the instance's corresponding Custom Event is fired.
+        * @private
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        function onDOMEvent(p_oEvent) {
+    
+            // Get the target node of the DOM event
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                
+            // See if the target of the event was a menu, or a menu item
+    
+            oElement = getMenuRootElement(oTarget),
+            sCustomEventType,
+            sTagName,
+            sId,
+            oMenuItem,
+            oMenu; 
+    
+    
+            if (oElement) {
+    
+                sTagName = oElement.tagName.toUpperCase();
+        
+                if (sTagName == "LI") {
+            
+                    sId = oElement.id;
+            
+                    if (sId && m_oItems[sId]) {
+            
+                        oMenuItem = m_oItems[sId];
+                        oMenu = oMenuItem.parent;
+            
+                    }
+                
+                }
+                else if (sTagName == "DIV") {
+                
+                    if (oElement.id) {
+                    
+                        oMenu = m_oMenus[oElement.id];
+                    
+                    }
+                
+                }
+    
+            }
+    
+    
+            if (oMenu) {
+    
+                sCustomEventType = m_oEventTypes[p_oEvent.type];
+    
+    
+                // Fire the Custom Event that corresponds the current DOM event    
+        
+                if (oMenuItem && !oMenuItem.cfg.getProperty("disabled")) {
+    
+                    oMenuItem[sCustomEventType].fire(p_oEvent);                   
+    
+    
+                    if (
+                            p_oEvent.type == "keyup" || 
+                            p_oEvent.type == "mousedown") 
+                    {
+    
+                        if (m_oFocusedMenuItem != oMenuItem) {
+                        
+                            if (m_oFocusedMenuItem) {
+    
+                                m_oFocusedMenuItem.blurEvent.fire();
+                            
+                            }
+    
+                            oMenuItem.focusEvent.fire();
+                        
+                        }
+                    
+                    }
+    
+                }
+        
+                oMenu[sCustomEventType].fire(p_oEvent, oMenuItem);
+            
+            }
+            else if (p_oEvent.type == "mousedown") {
+    
+                if (m_oFocusedMenuItem) {
+    
+                    m_oFocusedMenuItem.blurEvent.fire();
+    
+                    m_oFocusedMenuItem = null;
+    
+                }
+    
+    
+                /*
+                    If the target of the event wasn't a menu, hide all 
+                    dynamically positioned menus
+                */
+                
+                for (var i in m_oMenus) {
+        
+                    if (YAHOO.lang.hasOwnProperty(m_oMenus,i)) {
+        
+                        oMenu = m_oMenus[i];
+        
+                        if (oMenu.cfg.getProperty("clicktohide") && 
+                            !(oMenu instanceof YAHOO.widget.MenuBar) && 
+                            oMenu.cfg.getProperty("position") == "dynamic") {
+        
+                            oMenu.hide();
+        
+                        }
+                        else {
+    
+                            oMenu.clearActiveItem(true);
+        
+                        }
+        
+                    }
+        
+                } 
+    
+            }
+            else if (p_oEvent.type == "keyup") { 
+    
+                if (m_oFocusedMenuItem) {
+    
+                    m_oFocusedMenuItem.blurEvent.fire();
+    
+                    m_oFocusedMenuItem = null;
+    
+                }
+    
+            }
+    
+        }
+    
+    
+        /**
+        * @method onMenuDestroy
+        * @description "destroy" event handler for a menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event 
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {YAHOO.widget.Menu} p_oMenu The menu that fired the event.
+        */
+        function onMenuDestroy(p_sType, p_aArgs, p_oMenu) {
+    
+            if (m_oMenus[p_oMenu.id]) {
+    
+                this.removeMenu(p_oMenu);
+    
+            }
+    
+        }
+    
+    
+        /**
+        * @method onMenuFocus
+        * @description "focus" event handler for a MenuItem instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event 
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onMenuFocus(p_sType, p_aArgs) {
+    
+            var oItem = p_aArgs[0];
+    
+            if (oItem) {
+    
+                m_oFocusedMenuItem = oItem;
+            
+            }
+    
+        }
+    
+    
+        /**
+        * @method onMenuBlur
+        * @description "blur" event handler for a MenuItem instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onMenuBlur(p_sType, p_aArgs) {
+    
+            m_oFocusedMenuItem = null;
+    
+        }
+    
+    
+    
+        /**
+        * @method onMenuVisibleConfigChange
+        * @description Event handler for when the "visible" configuration  
+        * property of a Menu instance changes.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onMenuVisibleConfigChange(p_sType, p_aArgs) {
+    
+            var bVisible = p_aArgs[0],
+                sId = this.id;
+            
+            if (bVisible) {
+    
+                m_oVisibleMenus[sId] = this;
+                
+            
+            }
+            else if (m_oVisibleMenus[sId]) {
+            
+                delete m_oVisibleMenus[sId];
+                
+            
+            }
+        
+        }
+    
+    
+        /**
+        * @method onItemDestroy
+        * @description "destroy" event handler for a MenuItem instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onItemDestroy(p_sType, p_aArgs) {
+    
+            var sId = this.id;
+    
+            if (sId && m_oItems[sId]) {
+    
+                if (m_oFocusedMenuItem == this) {
+    
+                    m_oFocusedMenuItem = null;
+    
+                }
+    
+                delete m_oItems[sId];
+    
+    
+            }
+    
+        }
+    
+    
+        /**
+        * @method onItemAdded
+        * @description "itemadded" event handler for a Menu instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onItemAdded(p_sType, p_aArgs) {
+    
+            var oItem = p_aArgs[0],
+                sId;
+    
+            if (oItem instanceof YAHOO.widget.MenuItem) { 
+    
+                sId = oItem.id;
+        
+                if (!m_oItems[sId]) {
+            
+                    m_oItems[sId] = oItem;
+        
+                    oItem.destroyEvent.subscribe(onItemDestroy);
+        
+        
+                }
+    
+            }
+        
+        }
+    
+    
+        return {
+    
+            // Privileged methods
+    
+    
+            /**
+            * @method addMenu
+            * @description Adds a menu to the collection of known menus.
+            * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu  
+            * instance to be added.
+            */
+            addMenu: function (p_oMenu) {
+    
+                var oDoc;
+    
+                if (
+                    p_oMenu instanceof YAHOO.widget.Menu && 
+                    p_oMenu.id && 
+                    !m_oMenus[p_oMenu.id]
+                ) {
+        
+                    m_oMenus[p_oMenu.id] = p_oMenu;
+                
+            
+                    if (!m_bInitializedEventHandlers) {
+            
+                        oDoc = document;
+                
+                        Event.on(oDoc, "mouseover", onDOMEvent, this, true);
+                        Event.on(oDoc, "mouseout", onDOMEvent, this, true);
+                        Event.on(oDoc, "mousedown", onDOMEvent, this, true);
+                        Event.on(oDoc, "mouseup", onDOMEvent, this, true);
+                        Event.on(oDoc, "click", onDOMEvent, this, true);
+                        Event.on(oDoc, "keydown", onDOMEvent, this, true);
+                        Event.on(oDoc, "keyup", onDOMEvent, this, true);
+                        Event.on(oDoc, "keypress", onDOMEvent, this, true);
+    
+    
+                        m_bInitializedEventHandlers = true;
+                        
+            
+                    }
+            
+                    p_oMenu.destroyEvent.subscribe(
+                                            onMenuDestroy, 
+                                            p_oMenu, 
+                                            this);
+    
+                    p_oMenu.cfg.subscribeToConfigEvent(
+                        "visible", 
+                        onMenuVisibleConfigChange);
+            
+                    p_oMenu.itemAddedEvent.subscribe(onItemAdded);
+                    p_oMenu.focusEvent.subscribe(onMenuFocus);
+                    p_oMenu.blurEvent.subscribe(onMenuBlur);
+        
+        
+                }
+        
+            },
+    
+        
+            /**
+            * @method removeMenu
+            * @description Removes a menu from the collection of known menus.
+            * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu  
+            * instance to be removed.
+            */
+            removeMenu: function (p_oMenu) {
+    
+                var sId;
+        
+                if (p_oMenu) {
+    
+                    sId = p_oMenu.id;
+        
+                    if (m_oMenus[sId] == p_oMenu) {
+            
+                        delete m_oMenus[sId];
+            
+        
+        
+                        if (m_oVisibleMenus[sId] == p_oMenu) {
+            
+                            delete m_oVisibleMenus[sId];
+                            
+                                
+                        }
+            
+                    }
+                
+                }
+    
+            },
+        
+        
+            /**
+            * @method hideVisible
+            * @description Hides all visible, dynamically positioned menus 
+            * (excluding instances of YAHOO.widget.MenuBar).
+            */
+            hideVisible: function () {
+        
+                var oMenu;
+        
+                for (var i in m_oVisibleMenus) {
+        
+                    if (YAHOO.lang.hasOwnProperty(m_oVisibleMenus,i)) {
+        
+                        oMenu = m_oVisibleMenus[i];
+        
+                        if (!(oMenu instanceof YAHOO.widget.MenuBar) && 
+                            oMenu.cfg.getProperty("position") == "dynamic") {
+        
+                            oMenu.hide();
+        
+                        }
+        
+                    }
+        
+                }        
+    
+            },
+    
+    
+            /**
+            * @method getMenus
+            * @description Returns an array of all menus registered with the 
+            * menu manger.
+            * @return {Array}
+            */
+            getMenus: function () {
+    
+                return m_oMenus;
+            
+            },
+    
+    
+            /**
+            * @method getMenu
+            * @description Returns a menu with the specified id.
+            * @param {String} p_sId String specifying the id of the 
+            * <code>&#60;div&#62;</code> element representing the menu to
+            * be retrieved.
+            * @return {YAHOO.widget.Menu}
+            */
+            getMenu: function (p_sId) {
+    
+                var oMenu = m_oMenus[p_sId];
+        
+                if (oMenu) {
+                
+                    return oMenu;
+                
+                }
+            
+            },
+    
+    
+            /**
+            * @method getMenuItem
+            * @description Returns a menu item with the specified id.
+            * @param {String} p_sId String specifying the id of the 
+            * <code>&#60;li&#62;</code> element representing the menu item to
+            * be retrieved.
+            * @return {YAHOO.widget.MenuItem}
+            */
+            getMenuItem: function (p_sId) {
+    
+                var oItem = m_oItems[p_sId];
+        
+                if (oItem) {
+                
+                    return oItem;
+                
+                }
+            
+            },
+
+
+            /**
+            * @method getMenuItemGroup
+            * @description Returns an array of menu item instances whose 
+            * corresponding <code>&#60;li&#62;</code> elements are child 
+            * nodes of the <code>&#60;ul&#62;</code> element with the 
+            * specified id.
+            * @param {String} p_sId String specifying the id of the 
+            * <code>&#60;ul&#62;</code> element representing the group of 
+            * menu items to be retrieved.
+            * @return {Array}
+            */
+            getMenuItemGroup: function (p_sId) {
+
+                var oUL = Dom.get(p_sId),
+                    aItems,
+                    oNode,
+                    oItem,
+                    sId;
+    
+
+                if (oUL && oUL.tagName && 
+                    oUL.tagName.toUpperCase() == "UL") {
+
+                    oNode = oUL.firstChild;
+
+                    if (oNode) {
+
+                        aItems = [];
+                        
+                        do {
+
+                            sId = oNode.id;
+
+                            if (sId) {
+                            
+                                oItem = this.getMenuItem(sId);
+                                
+                                if (oItem) {
+                                
+                                    aItems[aItems.length] = oItem;
+                                
+                                }
+                            
+                            }
+                        
+                        }
+                        while ((oNode = oNode.nextSibling));
+
+
+                        if (aItems.length > 0) {
+
+                            return aItems;
+                        
+                        }
+
+                    }
+                
+                }
+            
+            },
+
+    
+            /**
+            * @method getFocusedMenuItem
+            * @description Returns a reference to the menu item that currently 
+            * has focus.
+            * @return {YAHOO.widget.MenuItem}
+            */
+            getFocusedMenuItem: function () {
+    
+                return m_oFocusedMenuItem;
+    
+            },
+    
+    
+            /**
+            * @method getFocusedMenu
+            * @description Returns a reference to the menu that currently 
+            * has focus.
+            * @return {YAHOO.widget.Menu}
+            */
+            getFocusedMenu: function () {
+    
+                if (m_oFocusedMenuItem) {
+    
+                    return (m_oFocusedMenuItem.parent.getRoot());
+                
+                }
+    
+            },
+    
+        
+            /**
+            * @method toString
+            * @description Returns a string representing the menu manager.
+            * @return {String}
+            */
+            toString: function () {
+            
+                return "MenuManager";
+            
+            }
+    
+        };
+    
+    }();
+
+})();
+
+
+
+(function () {
+
+
+/**
+* The Menu class creates a container that holds a vertical list representing 
+* a set of options or commands.  Menu is the base class for all 
+* menu containers. 
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the menu.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source 
+* for the menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+* specifying the <code>&#60;div&#62;</code> element of the menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement 
+* Object specifying the <code>&#60;select&#62;</code> element to be used as 
+* the data source for the menu.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu. See configuration class documentation for 
+* more details.
+* @namespace YAHOO.widget
+* @class Menu
+* @constructor
+* @extends YAHOO.widget.Overlay
+*/
+YAHOO.widget.Menu = function (p_oElement, p_oConfig) {
+
+    if (p_oConfig) {
+
+        this.parent = p_oConfig.parent;
+        this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload;
+        this.itemData = p_oConfig.itemData || p_oConfig.itemdata;
+
+    }
+
+
+    YAHOO.widget.Menu.superclass.constructor.call(this, p_oElement, p_oConfig);
+
+};
+
+
+
+/**
+* @method checkPosition
+* @description Checks to make sure that the value of the "position" property 
+* is one of the supported strings. Returns true if the position is supported.
+* @private
+* @param {Object} p_sPosition String specifying the position of the menu.
+* @return {Boolean}
+*/
+function checkPosition(p_sPosition) {
+
+    if (typeof p_sPosition == "string") {
+
+        return ("dynamic,static".indexOf((p_sPosition.toLowerCase())) != -1);
+
+    }
+
+}
+
+
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Module = YAHOO.widget.Module,
+    Overlay = YAHOO.widget.Overlay,
+    Menu = YAHOO.widget.Menu,
+    MenuManager = YAHOO.widget.MenuManager,
+    CustomEvent = YAHOO.util.CustomEvent,
+    Lang = YAHOO.lang,
+    
+    m_oShadowTemplate,
+
+    /**
+    * Constant representing the name of the Menu's events
+    * @property EVENT_TYPES
+    * @private
+    * @final
+    * @type Object
+    */
+    EVENT_TYPES = {
+    
+        "MOUSE_OVER": "mouseover",
+        "MOUSE_OUT": "mouseout",
+        "MOUSE_DOWN": "mousedown",
+        "MOUSE_UP": "mouseup",
+        "CLICK": "click",
+        "KEY_PRESS": "keypress",
+        "KEY_DOWN": "keydown",
+        "KEY_UP": "keyup",
+        "FOCUS": "focus",
+        "BLUR": "blur",
+        "ITEM_ADDED": "itemAdded",
+        "ITEM_REMOVED": "itemRemoved"
+    
+    },
+
+
+    /**
+    * Constant representing the Menu's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
+    * @final
+    * @type Object
+    */
+    DEFAULT_CONFIG = {
+
+        "VISIBLE": { 
+            key: "visible", 
+            value: false, 
+            validator: Lang.isBoolean
+        }, 
+    
+        "CONSTRAIN_TO_VIEWPORT": {
+            key: "constraintoviewport", 
+            value: true, 
+            validator: Lang.isBoolean, 
+            supercedes: ["iframe","x","y","xy"]
+        }, 
+    
+        "POSITION": { 
+            key: "position", 
+            value: "dynamic", 
+            validator: checkPosition, 
+            supercedes: ["visible", "iframe"]
+        }, 
+    
+        "SUBMENU_ALIGNMENT": { 
+            key: "submenualignment", 
+            value: ["tl","tr"]
+        },
+    
+        "AUTO_SUBMENU_DISPLAY": { 
+            key: "autosubmenudisplay", 
+            value: true, 
+            validator: Lang.isBoolean 
+        }, 
+    
+        "SHOW_DELAY": { 
+            key: "showdelay", 
+            value: 250, 
+            validator: Lang.isNumber 
+        }, 
+    
+        "HIDE_DELAY": { 
+            key: "hidedelay", 
+            value: 0, 
+            validator: Lang.isNumber, 
+            suppressEvent: true
+        }, 
+    
+        "SUBMENU_HIDE_DELAY": { 
+            key: "submenuhidedelay", 
+            value: 250, 
+            validator: Lang.isNumber
+        }, 
+    
+        "CLICK_TO_HIDE": { 
+            key: "clicktohide", 
+            value: true, 
+            validator: Lang.isBoolean
+        },
+    
+        "CONTAINER": { 
+            key: "container"
+        }, 
+    
+        "MAX_HEIGHT": { 
+            key: "maxheight", 
+            value: 0, 
+            validator: Lang.isNumber,
+            supercedes: ["iframe"]
+        }, 
+    
+        "CLASS_NAME": { 
+            key: "classname", 
+            value: null, 
+            validator: Lang.isString
+        }, 
+    
+        "DISABLED": { 
+            key: "disabled", 
+            value: false, 
+            validator: Lang.isBoolean
+        }
+    
+    };
+
+
+
+YAHOO.lang.extend(Menu, Overlay, {
+
+
+// Constants
+
+
+/**
+* @property CSS_CLASS_NAME
+* @description String representing the CSS class(es) to be applied to the 
+* menu's <code>&#60;div&#62;</code> element.
+* @default "yuimenu"
+* @final
+* @type String
+*/
+CSS_CLASS_NAME: "yuimenu",
+
+
+/**
+* @property ITEM_TYPE
+* @description Object representing the type of menu item to instantiate and 
+* add when parsing the child nodes (either <code>&#60;li&#62;</code> element, 
+* <code>&#60;optgroup&#62;</code> element or <code>&#60;option&#62;</code>) 
+* of the menu's source HTML element.
+* @default YAHOO.widget.MenuItem
+* @final
+* @type YAHOO.widget.MenuItem
+*/
+ITEM_TYPE: null,
+
+
+/**
+* @property GROUP_TITLE_TAG_NAME
+* @description String representing the tagname of the HTML element used to 
+* title the menu's item groups.
+* @default H6
+* @final
+* @type String
+*/
+GROUP_TITLE_TAG_NAME: "h6",
+
+
+
+// Private properties
+
+
+/** 
+* @property _nHideDelayId
+* @description Number representing the time-out setting used to cancel the 
+* hiding of a menu.
+* @default null
+* @private
+* @type Number
+*/
+_nHideDelayId: null,
+
+
+/** 
+* @property _nShowDelayId
+* @description Number representing the time-out setting used to cancel the 
+* showing of a menu.
+* @default null
+* @private
+* @type Number
+*/
+_nShowDelayId: null,
+
+
+/** 
+* @property _nSubmenuHideDelayId
+* @description Number representing the time-out setting used to cancel the 
+* hiding of a submenu.
+* @default null
+* @private
+* @type Number
+*/
+_nSubmenuHideDelayId: null,
+
+
+/** 
+* @property _nBodyScrollId
+* @description Number representing the time-out setting used to cancel the 
+* scrolling of the menu's body element.
+* @default null
+* @private
+* @type Number
+*/
+_nBodyScrollId: null,
+
+
+/** 
+* @property _bHideDelayEventHandlersAssigned
+* @description Boolean indicating if the "mouseover" and "mouseout" event 
+* handlers used for hiding the menu via a call to "window.setTimeout" have 
+* already been assigned.
+* @default false
+* @private
+* @type Boolean
+*/
+_bHideDelayEventHandlersAssigned: false,
+
+
+/**
+* @property _bHandledMouseOverEvent
+* @description Boolean indicating the current state of the menu's 
+* "mouseover" event.
+* @default false
+* @private
+* @type Boolean
+*/
+_bHandledMouseOverEvent: false,
+
+
+/**
+* @property _bHandledMouseOutEvent
+* @description Boolean indicating the current state of the menu's
+* "mouseout" event.
+* @default false
+* @private
+* @type Boolean
+*/
+_bHandledMouseOutEvent: false,
+
+
+/**
+* @property _aGroupTitleElements
+* @description Array of HTML element used to title groups of menu items.
+* @default []
+* @private
+* @type Array
+*/
+_aGroupTitleElements: null,
+
+
+/**
+* @property _aItemGroups
+* @description Multi-dimensional Array representing the menu items as they
+* are grouped in the menu.
+* @default []
+* @private
+* @type Array
+*/
+_aItemGroups: null,
+
+
+/**
+* @property _aListElements
+* @description Array of <code>&#60;ul&#62;</code> elements, each of which is 
+* the parent node for each item's <code>&#60;li&#62;</code> element.
+* @default []
+* @private
+* @type Array
+*/
+_aListElements: null,
+
+
+/**
+* @property _nCurrentMouseX
+* @description The current x coordinate of the mouse inside the area of 
+* the menu.
+* @default 0
+* @private
+* @type Number
+*/
+_nCurrentMouseX: 0,
+
+
+/**
+* @property _nMaxHeight
+* @description The original value of the "maxheight" configuration property 
+* as set by the user.
+* @default -1
+* @private
+* @type Number
+*/
+_nMaxHeight: -1,
+
+
+/**
+* @property _bStopMouseEventHandlers
+* @description Stops "mouseover," "mouseout," and "mousemove" event handlers 
+* from executing.
+* @default false
+* @private
+* @type Boolean
+*/
+_bStopMouseEventHandlers: false,
+
+
+/**
+* @property _sClassName
+* @description The current value of the "classname" configuration attribute.
+* @default null
+* @private
+* @type String
+*/
+_sClassName: null,
+
+
+/**
+* @property _bDisabled
+* @description The current value of the "disabled" configuration attribute.
+* @default false
+* @private
+* @type Boolean
+*/
+_bDisabled: false,
+
+
+// Public properties
+
+
+/**
+* @property lazyLoad
+* @description Boolean indicating if the menu's "lazy load" feature is 
+* enabled.  If set to "true," initialization and rendering of the menu's 
+* items will be deferred until the first time it is made visible.  This 
+* property should be set via the constructor using the configuration 
+* object literal.
+* @default false
+* @type Boolean
+*/
+lazyLoad: false,
+
+
+/**
+* @property itemData
+* @description Array of items to be added to the menu.  The array can contain 
+* strings representing the text for each item to be created, object literals 
+* representing the menu item configuration properties, or MenuItem instances.  
+* This property should be set via the constructor using the configuration 
+* object literal.
+* @default null
+* @type Array
+*/
+itemData: null,
+
+
+/**
+* @property activeItem
+* @description Object reference to the item in the menu that has is selected.
+* @default null
+* @type YAHOO.widget.MenuItem
+*/
+activeItem: null,
+
+
+/**
+* @property parent
+* @description Object reference to the menu's parent menu or menu item.  
+* This property can be set via the constructor using the configuration 
+* object literal.
+* @default null
+* @type YAHOO.widget.MenuItem
+*/
+parent: null,
+
+
+/**
+* @property srcElement
+* @description Object reference to the HTML element (either 
+* <code>&#60;select&#62;</code> or <code>&#60;div&#62;</code>) used to 
+* create the menu.
+* @default null
+* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>|<a 
+* href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.
+* html#ID-22445964">HTMLDivElement</a>
+*/
+srcElement: null,
+
+
+
+// Events
+
+
+/**
+* @event mouseOverEvent
+* @description Fires when the mouse has entered the menu.  Passes back 
+* the DOM Event object as an argument.
+*/
+mouseOverEvent: null,
+
+
+/**
+* @event mouseOutEvent
+* @description Fires when the mouse has left the menu.  Passes back the DOM 
+* Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+mouseOutEvent: null,
+
+
+/**
+* @event mouseDownEvent
+* @description Fires when the user mouses down on the menu.  Passes back the 
+* DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+mouseDownEvent: null,
+
+
+/**
+* @event mouseUpEvent
+* @description Fires when the user releases a mouse button while the mouse is 
+* over the menu.  Passes back the DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+mouseUpEvent: null,
+
+
+/**
+* @event clickEvent
+* @description Fires when the user clicks the on the menu.  Passes back the 
+* DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+clickEvent: null,
+
+
+/**
+* @event keyPressEvent
+* @description Fires when the user presses an alphanumeric key when one of the
+* menu's items has focus.  Passes back the DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+keyPressEvent: null,
+
+
+/**
+* @event keyDownEvent
+* @description Fires when the user presses a key when one of the menu's items 
+* has focus.  Passes back the DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+keyDownEvent: null,
+
+
+/**
+* @event keyUpEvent
+* @description Fires when the user releases a key when one of the menu's items 
+* has focus.  Passes back the DOM Event object as an argument.
+* @type YAHOO.util.CustomEvent
+*/
+keyUpEvent: null,
+
+
+/**
+* @event itemAddedEvent
+* @description Fires when an item is added to the menu.
+* @type YAHOO.util.CustomEvent
+*/
+itemAddedEvent: null,
+
+
+/**
+* @event itemRemovedEvent
+* @description Fires when an item is removed to the menu.
+* @type YAHOO.util.CustomEvent
+*/
+itemRemovedEvent: null,
+
+
+/**
+* @method init
+* @description The Menu class's initialization method. This method is 
+* automatically called by the constructor, and sets up all DOM references 
+* for pre-existing markup, and creates required markup if it is not 
+* already present.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the menu.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source 
+* for the menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object 
+* specifying the <code>&#60;div&#62;</code> element of the menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement 
+* Object specifying the <code>&#60;select&#62;</code> element to be used as 
+* the data source for the menu.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu. See configuration class documentation for 
+* more details.
+*/
+init: function (p_oElement, p_oConfig) {
+
+    this._aItemGroups = [];
+    this._aListElements = [];
+    this._aGroupTitleElements = [];
+
+    if (!this.ITEM_TYPE) {
+
+        this.ITEM_TYPE = YAHOO.widget.MenuItem;
+
+    }
+
+
+    var oElement;
+
+    if (typeof p_oElement == "string") {
+
+        oElement = document.getElementById(p_oElement);
+
+    }
+    else if (p_oElement.tagName) {
+
+        oElement = p_oElement;
+
+    }
+
+
+    if (oElement && oElement.tagName) {
+
+        switch(oElement.tagName.toUpperCase()) {
+    
+            case "DIV":
+
+                this.srcElement = oElement;
+
+                if (!oElement.id) {
+
+                    oElement.setAttribute("id", Dom.generateId());
+
+                }
+
+
+                /* 
+                    Note: we don't pass the user config in here yet 
+                    because we only want it executed once, at the lowest 
+                    subclass level.
+                */ 
+            
+                Menu.superclass.init.call(this, oElement);
+
+                this.beforeInitEvent.fire(Menu);
+
+
+    
+            break;
+    
+            case "SELECT":
+    
+                this.srcElement = oElement;
+
+    
+                /*
+                    The source element is not something that we can use 
+                    outright, so we need to create a new Overlay
+
+                    Note: we don't pass the user config in here yet 
+                    because we only want it executed once, at the lowest 
+                    subclass level.
+                */ 
+
+                Menu.superclass.init.call(this, Dom.generateId());
+
+                this.beforeInitEvent.fire(Menu);
+
+
+
+            break;
+
+        }
+
+    }
+    else {
+
+        /* 
+            Note: we don't pass the user config in here yet 
+            because we only want it executed once, at the lowest 
+            subclass level.
+        */ 
+    
+        Menu.superclass.init.call(this, p_oElement);
+
+        this.beforeInitEvent.fire(Menu);
+
+
+
+    }
+
+
+    if (this.element) {
+
+        Dom.addClass(this.element, this.CSS_CLASS_NAME);
+
+
+        // Subscribe to Custom Events
+
+        this.initEvent.subscribe(this._onInit);
+        this.beforeRenderEvent.subscribe(this._onBeforeRender);
+        this.renderEvent.subscribe(this._onRender);
+        this.renderEvent.subscribe(this.onRender);
+        this.beforeShowEvent.subscribe(this._onBeforeShow);
+        this.showEvent.subscribe(this._onShow);
+        this.beforeHideEvent.subscribe(this._onBeforeHide);
+        this.hideEvent.subscribe(this._onHide);
+        this.mouseOverEvent.subscribe(this._onMouseOver);
+        this.mouseOutEvent.subscribe(this._onMouseOut);
+        this.clickEvent.subscribe(this._onClick);
+        this.keyDownEvent.subscribe(this._onKeyDown);
+        this.keyPressEvent.subscribe(this._onKeyPress);
+
+        Module.textResizeEvent.subscribe(this._onTextResize, this, true);
+
+
+        if (p_oConfig) {
+    
+            this.cfg.applyConfig(p_oConfig, true);
+    
+        }
+
+
+        // Register the Menu instance with the MenuManager
+
+        MenuManager.addMenu(this);
+        
+
+        this.initEvent.fire(Menu);
+
+    }
+
+},
+
+
+
+// Private methods
+
+
+/**
+* @method _initSubTree
+* @description Iterates the childNodes of the source element to find nodes 
+* used to instantiate menu and menu items.
+* @private
+*/
+_initSubTree: function () {
+
+    var oSrcElement = this.srcElement,
+        sSrcElementTagName,
+        nGroup,
+        sGroupTitleTagName,
+        oNode,
+        aListElements,
+        nListElements,
+        i;
+
+
+    if (oSrcElement) {
+    
+        sSrcElementTagName = 
+            (oSrcElement.tagName && oSrcElement.tagName.toUpperCase());
+
+
+        if (sSrcElementTagName == "DIV") {
+    
+            //  Populate the collection of item groups and item group titles
+    
+            oNode = this.body.firstChild;
+    
+
+            if (oNode) {
+    
+                nGroup = 0;
+                sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase();
+        
+                do {
+        
+
+                    if (oNode && oNode.tagName) {
+        
+                        switch (oNode.tagName.toUpperCase()) {
+        
+                            case sGroupTitleTagName:
+                            
+                                this._aGroupTitleElements[nGroup] = oNode;
+        
+                            break;
+        
+                            case "UL":
+        
+                                this._aListElements[nGroup] = oNode;
+                                this._aItemGroups[nGroup] = [];
+                                nGroup++;
+        
+                            break;
+        
+                        }
+                    
+                    }
+        
+                }
+                while ((oNode = oNode.nextSibling));
+        
+        
+                /*
+                    Apply the "first-of-type" class to the first UL to mimic 
+                    the "first-of-type" CSS3 psuedo class.
+                */
+        
+                if (this._aListElements[0]) {
+        
+                    Dom.addClass(this._aListElements[0], "first-of-type");
+        
+                }
+            
+            }
+    
+        }
+    
+    
+        oNode = null;
+    
+    
+
+        if (sSrcElementTagName) {
+    
+            switch (sSrcElementTagName) {
+        
+                case "DIV":
+
+                    aListElements = this._aListElements;
+                    nListElements = aListElements.length;
+        
+                    if (nListElements > 0) {
+        
+        
+                        i = nListElements - 1;
+        
+                        do {
+        
+                            oNode = aListElements[i].firstChild;
+            
+                            if (oNode) {
+
+            
+                                do {
+                
+                                    if (oNode && oNode.tagName && 
+                                        oNode.tagName.toUpperCase() == "LI") {
+                
+        
+                                        this.addItem(new this.ITEM_TYPE(oNode, 
+                                                    { parent: this }), i);
+            
+                                    }
+                        
+                                }
+                                while ((oNode = oNode.nextSibling));
+                            
+                            }
+                    
+                        }
+                        while (i--);
+        
+                    }
+        
+                break;
+        
+                case "SELECT":
+        
+        
+                    oNode = oSrcElement.firstChild;
+        
+                    do {
+        
+                        if (oNode && oNode.tagName) {
+                        
+                            switch (oNode.tagName.toUpperCase()) {
+            
+                                case "OPTGROUP":
+                                case "OPTION":
+            
+            
+                                    this.addItem(
+                                            new this.ITEM_TYPE(
+                                                    oNode, 
+                                                    { parent: this }
+                                                )
+                                            );
+            
+                                break;
+            
+                            }
+    
+                        }
+        
+                    }
+                    while ((oNode = oNode.nextSibling));
+        
+                break;
+        
+            }
+    
+        }    
+    
+    }
+
+},
+
+
+/**
+* @method _getFirstEnabledItem
+* @description Returns the first enabled item in the menu.
+* @return {YAHOO.widget.MenuItem}
+* @private
+*/
+_getFirstEnabledItem: function () {
+
+    var aItems = this.getItems(),
+        nItems = aItems.length,
+        oItem;
+    
+    for(var i=0; i<nItems; i++) {
+
+        oItem = aItems[i];
+
+        if (oItem && !oItem.cfg.getProperty("disabled") && 
+            oItem.element.style.display != "none") {
+
+            return oItem;
+
+        }
+    
+    }
+    
+},
+
+
+/**
+* @method _addItemToGroup
+* @description Adds a menu item to a group.
+* @private
+* @param {Number} p_nGroupIndex Number indicating the group to which the 
+* item belongs.
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance to be added to the menu.
+* @param {String} p_oItem String specifying the text of the item to be added 
+* to the menu.
+* @param {Object} p_oItem Object literal containing a set of menu item 
+* configuration properties.
+* @param {Number} p_nItemIndex Optional. Number indicating the index at 
+* which the menu item should be added.
+* @return {YAHOO.widget.MenuItem}
+*/
+_addItemToGroup: function (p_nGroupIndex, p_oItem, p_nItemIndex) {
+
+    var oItem,
+        bDisabled = this.cfg.getProperty("disabled"),
+        nGroupIndex,
+        aGroup,
+        oGroupItem,
+        bAppend,
+        oNextItemSibling,
+        nItemIndex;
+
+    function getNextItemSibling(p_aArray, p_nStartIndex) {
+
+        return (p_aArray[p_nStartIndex] || getNextItemSibling(p_aArray, 
+                (p_nStartIndex+1)));
+
+    }
+
+    if (p_oItem instanceof this.ITEM_TYPE) {
+
+        oItem = p_oItem;
+        oItem.parent = this;
+
+    }
+    else if (typeof p_oItem == "string") {
+
+        oItem = new this.ITEM_TYPE(p_oItem, { parent: this });
+    
+    }
+    else if (typeof p_oItem == "object") {
+
+        p_oItem.parent = this;
+
+        oItem = new this.ITEM_TYPE(p_oItem.text, p_oItem);
+
+    }
+
+
+    if (oItem) {
+
+        if (oItem.cfg.getProperty("selected")) {
+
+            this.activeItem = oItem;
+        
+        }
+
+
+        nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;
+        aGroup = this._getItemGroup(nGroupIndex);
+
+
+
+        if (!aGroup) {
+
+            aGroup = this._createItemGroup(nGroupIndex);
+
+        }
+
+
+        if (typeof p_nItemIndex == "number") {
+
+            bAppend = (p_nItemIndex >= aGroup.length);            
+
+
+            if (aGroup[p_nItemIndex]) {
+    
+                aGroup.splice(p_nItemIndex, 0, oItem);
+    
+            }
+            else {
+    
+                aGroup[p_nItemIndex] = oItem;
+    
+            }
+
+
+            oGroupItem = aGroup[p_nItemIndex];
+
+            if (oGroupItem) {
+
+                if (bAppend && (!oGroupItem.element.parentNode || 
+                        oGroupItem.element.parentNode.nodeType == 11)) {
+        
+                    this._aListElements[nGroupIndex].appendChild(
+                        oGroupItem.element);
+    
+                }
+                else {
+    
+                    oNextItemSibling = getNextItemSibling(aGroup, 
+                        (p_nItemIndex+1));
+    
+                    if (oNextItemSibling && (!oGroupItem.element.parentNode || 
+                            oGroupItem.element.parentNode.nodeType == 11)) {
+            
+                        this._aListElements[nGroupIndex].insertBefore(
+                                oGroupItem.element, 
+                                oNextItemSibling.element);
+        
+                    }
+    
+                }
+    
+
+                oGroupItem.parent = this;
+        
+                this._subscribeToItemEvents(oGroupItem);
+    
+                this._configureSubmenu(oGroupItem);
+                
+                this._updateItemProperties(nGroupIndex);
+        
+
+                this.itemAddedEvent.fire(oGroupItem);
+                this.changeContentEvent.fire();
+
+                return oGroupItem;
+    
+            }
+
+        }
+        else {
+    
+            nItemIndex = aGroup.length;
+    
+            aGroup[nItemIndex] = oItem;
+
+            oGroupItem = aGroup[nItemIndex];
+    
+
+            if (oGroupItem) {
+    
+                if (!Dom.isAncestor(this._aListElements[nGroupIndex], 
+                        oGroupItem.element)) {
+    
+                    this._aListElements[nGroupIndex].appendChild(
+                        oGroupItem.element);
+    
+                }
+    
+                oGroupItem.element.setAttribute("groupindex", nGroupIndex);
+                oGroupItem.element.setAttribute("index", nItemIndex);
+        
+                oGroupItem.parent = this;
+    
+                oGroupItem.index = nItemIndex;
+                oGroupItem.groupIndex = nGroupIndex;
+        
+                this._subscribeToItemEvents(oGroupItem);
+    
+                this._configureSubmenu(oGroupItem);
+    
+                if (nItemIndex === 0) {
+        
+                    Dom.addClass(oGroupItem.element, "first-of-type");
+        
+                }
+
+        
+
+                this.itemAddedEvent.fire(oGroupItem);
+                this.changeContentEvent.fire();
+
+                return oGroupItem;
+    
+            }
+    
+        }
+
+    }
+    
+},
+
+
+/**
+* @method _removeItemFromGroupByIndex
+* @description Removes a menu item from a group by index.  Returns the menu 
+* item that was removed.
+* @private
+* @param {Number} p_nGroupIndex Number indicating the group to which the menu 
+* item belongs.
+* @param {Number} p_nItemIndex Number indicating the index of the menu item 
+* to be removed.
+* @return {YAHOO.widget.MenuItem}
+*/
+_removeItemFromGroupByIndex: function (p_nGroupIndex, p_nItemIndex) {
+
+    var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,
+        aGroup = this._getItemGroup(nGroupIndex),
+        aArray,
+        oItem,
+        oUL;
+
+    if (aGroup) {
+
+        aArray = aGroup.splice(p_nItemIndex, 1);
+        oItem = aArray[0];
+    
+        if (oItem) {
+    
+            // Update the index and className properties of each member        
+            
+            this._updateItemProperties(nGroupIndex);
+    
+            if (aGroup.length === 0) {
+    
+                // Remove the UL
+    
+                oUL = this._aListElements[nGroupIndex];
+    
+                if (this.body && oUL) {
+    
+                    this.body.removeChild(oUL);
+    
+                }
+    
+                // Remove the group from the array of items
+    
+                this._aItemGroups.splice(nGroupIndex, 1);
+    
+    
+                // Remove the UL from the array of ULs
+    
+                this._aListElements.splice(nGroupIndex, 1);
+    
+    
+                /*
+                     Assign the "first-of-type" class to the new first UL 
+                     in the collection
+                */
+    
+                oUL = this._aListElements[0];
+    
+                if (oUL) {
+    
+                    Dom.addClass(oUL, "first-of-type");
+    
+                }            
+    
+            }
+    
+
+            this.itemRemovedEvent.fire(oItem);
+            this.changeContentEvent.fire();
+
+
+            // Return a reference to the item that was removed
+        
+            return oItem;
+    
+        }
+
+    }
+    
+},
+
+
+/**
+* @method _removeItemFromGroupByValue
+* @description Removes a menu item from a group by reference.  Returns the 
+* menu item that was removed.
+* @private
+* @param {Number} p_nGroupIndex Number indicating the group to which the
+* menu item belongs.
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance to be removed.
+* @return {YAHOO.widget.MenuItem}
+*/    
+_removeItemFromGroupByValue: function (p_nGroupIndex, p_oItem) {
+
+    var aGroup = this._getItemGroup(p_nGroupIndex),
+        nItems,
+        nItemIndex,
+        i;
+
+    if (aGroup) {
+
+        nItems = aGroup.length;
+        nItemIndex = -1;
+    
+        if (nItems > 0) {
+    
+            i = nItems-1;
+        
+            do {
+        
+                if (aGroup[i] == p_oItem) {
+        
+                    nItemIndex = i;
+                    break;    
+        
+                }
+        
+            }
+            while(i--);
+        
+            if (nItemIndex > -1) {
+        
+                return (this._removeItemFromGroupByIndex(p_nGroupIndex, 
+                            nItemIndex));
+        
+            }
+    
+        }
+    
+    }
+
+},
+
+
+/**
+* @method _updateItemProperties
+* @description Updates the "index," "groupindex," and "className" properties 
+* of the menu items in the specified group. 
+* @private
+* @param {Number} p_nGroupIndex Number indicating the group of items to update.
+*/
+_updateItemProperties: function (p_nGroupIndex) {
+
+    var aGroup = this._getItemGroup(p_nGroupIndex),
+        nItems = aGroup.length,
+        oItem,
+        oLI,
+        i;
+
+
+    if (nItems > 0) {
+
+        i = nItems - 1;
+
+        // Update the index and className properties of each member
+    
+        do {
+
+            oItem = aGroup[i];
+
+            if (oItem) {
+    
+                oLI = oItem.element;
+
+                oItem.index = i;
+                oItem.groupIndex = p_nGroupIndex;
+
+                oLI.setAttribute("groupindex", p_nGroupIndex);
+                oLI.setAttribute("index", i);
+
+                Dom.removeClass(oLI, "first-of-type");
+
+            }
+    
+        }
+        while(i--);
+
+
+        if (oLI) {
+
+            Dom.addClass(oLI, "first-of-type");
+
+        }
+
+    }
+
+},
+
+
+/**
+* @method _createItemGroup
+* @description Creates a new menu item group (array) and its associated 
+* <code>&#60;ul&#62;</code> element. Returns an aray of menu item groups.
+* @private
+* @param {Number} p_nIndex Number indicating the group to create.
+* @return {Array}
+*/
+_createItemGroup: function (p_nIndex) {
+
+    var oUL;
+
+    if (!this._aItemGroups[p_nIndex]) {
+
+        this._aItemGroups[p_nIndex] = [];
+
+        oUL = document.createElement("ul");
+
+        this._aListElements[p_nIndex] = oUL;
+
+        return this._aItemGroups[p_nIndex];
+
+    }
+
+},
+
+
+/**
+* @method _getItemGroup
+* @description Returns the menu item group at the specified index.
+* @private
+* @param {Number} p_nIndex Number indicating the index of the menu item group 
+* to be retrieved.
+* @return {Array}
+*/
+_getItemGroup: function (p_nIndex) {
+
+    var nIndex = ((typeof p_nIndex == "number") ? p_nIndex : 0);
+
+    return this._aItemGroups[nIndex];
+
+},
+
+
+/**
+* @method _configureSubmenu
+* @description Subscribes the menu item's submenu to its parent menu's events.
+* @private
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance with the submenu to be configured.
+*/
+_configureSubmenu: function (p_oItem) {
+
+    var oSubmenu = p_oItem.cfg.getProperty("submenu");
+
+    if (oSubmenu) {
+            
+        /*
+            Listen for configuration changes to the parent menu 
+            so they they can be applied to the submenu.
+        */
+
+        this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange, 
+                oSubmenu, true);
+
+        this.renderEvent.subscribe(this._onParentMenuRender, oSubmenu, true);
+
+        oSubmenu.beforeShowEvent.subscribe(this._onSubmenuBeforeShow, null, 
+            oSubmenu);
+
+        oSubmenu.showEvent.subscribe(this._onSubmenuShow, null, p_oItem);
+        oSubmenu.hideEvent.subscribe(this._onSubmenuHide, null, p_oItem);
+
+    }
+
+},
+
+
+/**
+* @method _subscribeToItemEvents
+* @description Subscribes a menu to a menu item's event.
+* @private
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance whose events should be subscribed to.
+*/
+_subscribeToItemEvents: function (p_oItem) {
+
+    p_oItem.focusEvent.subscribe(this._onMenuItemFocus);
+
+    p_oItem.blurEvent.subscribe(this._onMenuItemBlur);
+
+    p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,
+        p_oItem, this);
+
+},
+
+
+/**
+* @method _getOffsetWidth
+* @description Returns the offset width of the menu's 
+* <code>&#60;div&#62;</code> element.
+* @private
+*/
+_getOffsetWidth: function () {
+
+    var oClone = this.element.cloneNode(true);
+
+    Dom.removeClass(oClone, "visible");
+
+    Dom.setStyle(oClone, "width", "");
+
+    document.body.appendChild(oClone);
+
+    var sWidth = oClone.offsetWidth;
+
+    document.body.removeChild(oClone);
+
+    return sWidth;
+
+},
+
+
+/**
+* @method _setWidth
+* @description Sets the width of the menu's root <code>&#60;div&#62;</code> 
+* element to its offsetWidth.
+* @private
+*/
+_setWidth: function () {
+
+    var oElement = this.element,
+        bVisible = false,
+        sWidth;
+
+    if (oElement.parentNode.tagName.toUpperCase() == "BODY") {
+
+        if (YAHOO.env.ua.opera) {
+
+            sWidth = this._getOffsetWidth();
+        
+        }
+        else {
+
+            if (Dom.hasClass(oElement, "visible")) {
+
+                bVisible = true;
+                
+                Dom.removeClass(oElement, "visible");
+
+            }
+
+            Dom.setStyle(oElement, "width", "auto");
+            
+            sWidth = oElement.offsetWidth;
+        
+        }
+
+    }
+    else {
+    
+        sWidth = this._getOffsetWidth();
+    
+    }
+
+    this.cfg.setProperty("width", (sWidth + "px"));
+    
+
+    if (bVisible) {
+    
+        Dom.addClass(oElement, "visible");
+    
+    }
+
+},
+
+
+/**
+* @method _onWidthChange
+* @description Change event handler for the the menu's "width" configuration
+* property.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onWidthChange: function (p_sType, p_aArgs) {
+
+    var sWidth = p_aArgs[0];
+    
+    if (sWidth && !this._hasSetWidthHandlers) {
+
+        this.itemAddedEvent.subscribe(this._setWidth);
+        this.itemRemovedEvent.subscribe(this._setWidth);
+
+        this._hasSetWidthHandlers = true;
+
+    }
+    else if (this._hasSetWidthHandlers) {
+
+        this.itemAddedEvent.unsubscribe(this._setWidth);
+        this.itemRemovedEvent.unsubscribe(this._setWidth);
+
+        this._hasSetWidthHandlers = false;
+
+    }
+
+},
+
+
+/**
+* @method _onVisibleChange
+* @description Change event handler for the the menu's "visible" configuration
+* property.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onVisibleChange: function (p_sType, p_aArgs) {
+
+    var bVisible = p_aArgs[0];
+    
+    if (bVisible) {
+
+        Dom.addClass(this.element, "visible");
+
+    }
+    else {
+
+        Dom.removeClass(this.element, "visible");
+
+    }
+
+},
+
+
+/**
+* @method _cancelHideDelay
+* @description Cancels the call to "hideMenu."
+* @private
+*/
+_cancelHideDelay: function () {
+
+    var oRoot = this.getRoot();
+
+    if (oRoot._nHideDelayId) {
+
+        window.clearTimeout(oRoot._nHideDelayId);
+
+    }
+
+},
+
+
+/**
+* @method _execHideDelay
+* @description Hides the menu after the number of milliseconds specified by 
+* the "hidedelay" configuration property.
+* @private
+*/
+_execHideDelay: function () {
+
+    this._cancelHideDelay();
+
+    var oRoot = this.getRoot(),
+        me = this;
+
+    function hideMenu() {
+    
+        if (oRoot.activeItem) {
+
+            oRoot.clearActiveItem();
+
+        }
+
+        if (oRoot == me && !(me instanceof YAHOO.widget.MenuBar) && 
+            me.cfg.getProperty("position") == "dynamic") {
+
+            me.hide();
+        
+        }
+    
+    }
+
+
+    oRoot._nHideDelayId = 
+        window.setTimeout(hideMenu, oRoot.cfg.getProperty("hidedelay"));
+
+},
+
+
+/**
+* @method _cancelShowDelay
+* @description Cancels the call to the "showMenu."
+* @private
+*/
+_cancelShowDelay: function () {
+
+    var oRoot = this.getRoot();
+
+    if (oRoot._nShowDelayId) {
+
+        window.clearTimeout(oRoot._nShowDelayId);
+
+    }
+
+},
+
+
+/**
+* @method _execShowDelay
+* @description Shows the menu after the number of milliseconds specified by 
+* the "showdelay" configuration property have ellapsed.
+* @private
+* @param {YAHOO.widget.Menu} p_oMenu Object specifying the menu that should 
+* be made visible.
+*/
+_execShowDelay: function (p_oMenu) {
+
+    var oRoot = this.getRoot();
+
+    function showMenu() {
+
+        if (p_oMenu.parent.cfg.getProperty("selected")) {
+
+            p_oMenu.show();
+
+        }
+
+    }
+
+
+    oRoot._nShowDelayId = 
+        window.setTimeout(showMenu, oRoot.cfg.getProperty("showdelay"));
+
+},
+
+
+/**
+* @method _execSubmenuHideDelay
+* @description Hides a submenu after the number of milliseconds specified by 
+* the "submenuhidedelay" configuration property have ellapsed.
+* @private
+* @param {YAHOO.widget.Menu} p_oSubmenu Object specifying the submenu that  
+* should be hidden.
+* @param {Number} p_nMouseX The x coordinate of the mouse when it left 
+* the specified submenu's parent menu item.
+* @param {Number} p_nHideDelay The number of milliseconds that should ellapse
+* before the submenu is hidden.
+*/
+_execSubmenuHideDelay: function (p_oSubmenu, p_nMouseX, p_nHideDelay) {
+
+    var me = this;
+
+    p_oSubmenu._nSubmenuHideDelayId = window.setTimeout(function () {
+
+        if (me._nCurrentMouseX > (p_nMouseX + 10)) {
+
+            p_oSubmenu._nSubmenuHideDelayId = window.setTimeout(function () {
+        
+                p_oSubmenu.hide();
+
+            }, p_nHideDelay);
+
+        }
+        else {
+
+            p_oSubmenu.hide();
+        
+        }
+
+    }, 50);
+
+},
+
+
+
+// Protected methods
+
+
+/**
+* @method _disableScrollHeader
+* @description Disables the header used for scrolling the body of the menu.
+* @protected
+*/
+_disableScrollHeader: function () {
+
+    if (!this._bHeaderDisabled) {
+
+        Dom.addClass(this.header, "topscrollbar_disabled");
+        this._bHeaderDisabled = true;
+
+    }
+
+},
+
+
+/**
+* @method _disableScrollFooter
+* @description Disables the footer used for scrolling the body of the menu.
+* @protected
+*/
+_disableScrollFooter: function () {
+
+    if (!this._bFooterDisabled) {
+
+        Dom.addClass(this.footer, "bottomscrollbar_disabled");
+        this._bFooterDisabled = true;
+
+    }
+
+},
+
+
+/**
+* @method _enableScrollHeader
+* @description Enables the header used for scrolling the body of the menu.
+* @protected
+*/
+_enableScrollHeader: function () {
+
+    if (this._bHeaderDisabled) {
+
+        Dom.removeClass(this.header, "topscrollbar_disabled");
+        this._bHeaderDisabled = false;
+
+    }
+
+},
+
+
+/**
+* @method _enableScrollFooter
+* @description Enables the footer used for scrolling the body of the menu.
+* @protected
+*/
+_enableScrollFooter: function () {
+
+    if (this._bFooterDisabled) {
+
+        Dom.removeClass(this.footer, "bottomscrollbar_disabled");
+        this._bFooterDisabled = false;
+
+    }
+
+},
+
+
+/**
+* @method _onMouseOver
+* @description "mouseover" event handler for the menu.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onMouseOver: function (p_sType, p_aArgs) {
+
+    if (this._bStopMouseEventHandlers) {
+    
+        return false;
+    
+    }
+
+
+    var oEvent = p_aArgs[0],
+        oItem = p_aArgs[1],
+        oTarget = Event.getTarget(oEvent),
+        oParentMenu,
+        nShowDelay,
+        bShowDelay,
+        oActiveItem,
+        oItemCfg,
+        oSubmenu;
+
+
+    if (!this._bHandledMouseOverEvent && (oTarget == this.element || 
+        Dom.isAncestor(this.element, oTarget))) {
+
+        // Menu mouseover logic
+
+        this._nCurrentMouseX = 0;
+
+        Event.on(this.element, "mousemove", this._onMouseMove, this, true);
+
+
+        this.clearActiveItem();
+
+
+        if (this.parent && this._nSubmenuHideDelayId) {
+
+            window.clearTimeout(this._nSubmenuHideDelayId);
+
+            this.parent.cfg.setProperty("selected", true);
+
+            oParentMenu = this.parent.parent;
+
+            oParentMenu._bHandledMouseOutEvent = true;
+            oParentMenu._bHandledMouseOverEvent = false;
+
+        }
+
+
+        this._bHandledMouseOverEvent = true;
+        this._bHandledMouseOutEvent = false;
+    
+    }
+
+
+    if (oItem && !oItem.handledMouseOverEvent && 
+        !oItem.cfg.getProperty("disabled") && 
+        (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))) {
+
+        // Menu Item mouseover logic
+
+        nShowDelay = this.cfg.getProperty("showdelay");
+        bShowDelay = (nShowDelay > 0);
+
+
+        if (bShowDelay) {
+        
+            this._cancelShowDelay();
+        
+        }
+
+
+        oActiveItem = this.activeItem;
+    
+        if (oActiveItem) {
+    
+            oActiveItem.cfg.setProperty("selected", false);
+    
+        }
+
+
+        oItemCfg = oItem.cfg;
+    
+        // Select and focus the current menu item
+    
+        oItemCfg.setProperty("selected", true);
+
+
+        if (this.hasFocus()) {
+        
+            oItem.focus();
+        
+        }
+
+
+        if (this.cfg.getProperty("autosubmenudisplay")) {
+
+            // Show the submenu this menu item
+
+            oSubmenu = oItemCfg.getProperty("submenu");
+        
+            if (oSubmenu) {
+        
+                if (bShowDelay) {
+
+                    this._execShowDelay(oSubmenu);
+        
+                }
+                else {
+
+                    oSubmenu.show();
+
+                }
+
+            }
+
+        }                        
+
+        oItem.handledMouseOverEvent = true;
+        oItem.handledMouseOutEvent = false;
+
+    }
+
+},
+
+
+/**
+* @method _onMouseOut
+* @description "mouseout" event handler for the menu.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onMouseOut: function (p_sType, p_aArgs) {
+
+    if (this._bStopMouseEventHandlers) {
+    
+        return false;
+    
+    }
+
+
+    var oEvent = p_aArgs[0],
+        oItem = p_aArgs[1],
+        oRelatedTarget = Event.getRelatedTarget(oEvent),
+        bMovingToSubmenu = false,
+        oItemCfg,
+        oSubmenu,
+        nSubmenuHideDelay,
+        nShowDelay;
+
+
+    if (oItem && !oItem.cfg.getProperty("disabled")) {
+
+        oItemCfg = oItem.cfg;
+        oSubmenu = oItemCfg.getProperty("submenu");
+
+
+        if (oSubmenu && (oRelatedTarget == oSubmenu.element ||
+                Dom.isAncestor(oSubmenu.element, oRelatedTarget))) {
+
+            bMovingToSubmenu = true;
+
+        }
+
+
+        if (!oItem.handledMouseOutEvent && ((oRelatedTarget != oItem.element &&  
+            !Dom.isAncestor(oItem.element, oRelatedTarget)) || 
+            bMovingToSubmenu)) {
+
+            // Menu Item mouseout logic
+
+            if (!bMovingToSubmenu) {
+
+                oItem.cfg.setProperty("selected", false);
+
+
+                if (oSubmenu) {
+
+                    nSubmenuHideDelay = 
+                        this.cfg.getProperty("submenuhidedelay");
+
+                    nShowDelay = this.cfg.getProperty("showdelay");
+
+                    if (!(this instanceof YAHOO.widget.MenuBar) && 
+                        nSubmenuHideDelay > 0 && 
+                        nShowDelay >= nSubmenuHideDelay) {
+
+                        this._execSubmenuHideDelay(oSubmenu, 
+                                Event.getPageX(oEvent),
+                                nSubmenuHideDelay);
+
+                    }
+                    else {
+
+                        oSubmenu.hide();
+
+                    }
+
+                }
+
+            }
+
+
+            oItem.handledMouseOutEvent = true;
+            oItem.handledMouseOverEvent = false;
+    
+        }
+
+    }
+
+
+    if (!this._bHandledMouseOutEvent && ((oRelatedTarget != this.element &&  
+        !Dom.isAncestor(this.element, oRelatedTarget)) || bMovingToSubmenu)) {
+
+        // Menu mouseout logic
+
+        Event.removeListener(this.element, "mousemove", this._onMouseMove);
+
+        this._nCurrentMouseX = Event.getPageX(oEvent);
+
+        this._bHandledMouseOutEvent = true;
+        this._bHandledMouseOverEvent = false;
+
+    }
+
+},
+
+
+/**
+* @method _onMouseMove
+* @description "click" event handler for the menu.
+* @protected
+* @param {Event} p_oEvent Object representing the DOM event object passed 
+* back by the event utility (YAHOO.util.Event).
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+_onMouseMove: function (p_oEvent, p_oMenu) {
+
+    if (this._bStopMouseEventHandlers) {
+    
+        return false;
+    
+    }
+
+    this._nCurrentMouseX = Event.getPageX(p_oEvent);
+
+},
+
+
+/**
+* @method _onClick
+* @description "click" event handler for the menu.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onClick: function (p_sType, p_aArgs) {
+
+    var oEvent = p_aArgs[0],
+        oItem = p_aArgs[1],
+        oTarget,
+        oItemCfg,
+        oSubmenu,
+        sURL,
+        oRoot;
+
+
+    if (oItem && !oItem.cfg.getProperty("disabled")) {
+
+        oTarget = Event.getTarget(oEvent);
+        oItemCfg = oItem.cfg;
+        oSubmenu = oItemCfg.getProperty("submenu");
+
+
+        /*
+            ACCESSIBILITY FEATURE FOR SCREEN READERS: 
+            Expand/collapse the submenu when the user clicks 
+            on the submenu indicator image.
+        */        
+
+        if (oTarget == oItem.submenuIndicator && oSubmenu) {
+
+            if (oSubmenu.cfg.getProperty("visible")) {
+
+                oSubmenu.hide();
+                
+                oSubmenu.parent.focus();
+    
+            }
+            else {
+
+                this.clearActiveItem();
+
+                oItemCfg.setProperty("selected", true);
+
+                oSubmenu.show();
+                
+                oSubmenu.setInitialFocus();
+    
+            }
+
+            Event.preventDefault(oEvent);
+    
+        }
+        else {
+
+            sURL = oItemCfg.getProperty("url");
+
+            //  Prevent the browser from following links equal to "#"
+            
+            if ((sURL.substr((sURL.length-1),1) == "#")) {
+
+                Event.preventDefault(oEvent);
+
+                oItem.focus();
+            
+            }
+
+
+            if (!oSubmenu) {
+    
+                oRoot = this.getRoot();
+                
+                if (oRoot instanceof YAHOO.widget.MenuBar || 
+                    oRoot.cfg.getProperty("position") == "static") {
+    
+                    oRoot.clearActiveItem();
+    
+                }
+                else if (oRoot.cfg.getProperty("clicktohide")) {
+
+                    oRoot.hide();
+                
+                }
+    
+            }
+
+        }                    
+    
+    }
+
+},
+
+
+/**
+* @method _onKeyDown
+* @description "keydown" event handler for the menu.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onKeyDown: function (p_sType, p_aArgs) {
+
+    var oEvent = p_aArgs[0],
+        oItem = p_aArgs[1],
+        me = this,
+        oSubmenu,
+        oItemCfg,
+        oParentItem,
+        oRoot,
+        oNextItem,
+        oBody,
+        nBodyScrollTop,
+        nBodyOffsetHeight,
+        aItems,
+        nItems,
+        nNextItemOffsetTop,
+        nScrollTarget,
+        oParentMenu;
+
+
+    /*
+        This function is called to prevent a bug in Firefox.  In Firefox,
+        moving a DOM element into a stationary mouse pointer will cause the 
+        browser to fire mouse events.  This can result in the menu mouse
+        event handlers being called uncessarily, especially when menus are 
+        moved into a stationary mouse pointer as a result of a 
+        key event handler.
+    */
+    function stopMouseEventHandlers() {
+
+        me._bStopMouseEventHandlers = true;
+        
+        window.setTimeout(function () {
+        
+            me._bStopMouseEventHandlers = false;
+        
+        }, 10);
+
+    }
+
+
+    if (oItem && !oItem.cfg.getProperty("disabled")) {
+
+        oItemCfg = oItem.cfg;
+        oParentItem = this.parent;
+
+        switch(oEvent.keyCode) {
+    
+            case 38:    // Up arrow
+            case 40:    // Down arrow
+    
+                oNextItem = (oEvent.keyCode == 38) ? 
+                    oItem.getPreviousEnabledSibling() : 
+                    oItem.getNextEnabledSibling();
+        
+                if (oNextItem) {
+
+                    this.clearActiveItem();
+
+                    oNextItem.cfg.setProperty("selected", true);
+                    oNextItem.focus();
+
+
+                    if (this.cfg.getProperty("maxheight") > 0) {
+
+                        oBody = this.body;
+                        nBodyScrollTop = oBody.scrollTop;
+                        nBodyOffsetHeight = oBody.offsetHeight;
+                        aItems = this.getItems();
+                        nItems = aItems.length - 1;
+                        nNextItemOffsetTop = oNextItem.element.offsetTop;
+
+
+                        if (oEvent.keyCode == 40 ) {    // Down
+                       
+                            if (nNextItemOffsetTop >= (nBodyOffsetHeight + nBodyScrollTop)) {
+
+                                oBody.scrollTop = nNextItemOffsetTop - nBodyOffsetHeight;
+
+                            }
+                            else if (nNextItemOffsetTop <= nBodyScrollTop) {
+                            
+                                oBody.scrollTop = 0;
+                            
+                            }
+
+
+                            if (oNextItem == aItems[nItems]) {
+
+                                oBody.scrollTop = oNextItem.element.offsetTop;
+
+                            }
+
+                        }
+                        else {  // Up
+
+                            if (nNextItemOffsetTop <= nBodyScrollTop) {
+
+                                oBody.scrollTop = nNextItemOffsetTop - oNextItem.element.offsetHeight;
+                            
+                            }
+                            else if (nNextItemOffsetTop >= (nBodyScrollTop + nBodyOffsetHeight)) {
+                            
+                                oBody.scrollTop = nNextItemOffsetTop;
+                            
+                            }
+
+
+                            if (oNextItem == aItems[0]) {
+                            
+                                oBody.scrollTop = 0;
+                            
+                            }
+
+                        }
+
+
+                        nBodyScrollTop = oBody.scrollTop;
+                        nScrollTarget = oBody.scrollHeight - oBody.offsetHeight;
+
+                        if (nBodyScrollTop === 0) {
+
+                            this._disableScrollHeader();
+                            this._enableScrollFooter();
+
+                        }
+                        else if (nBodyScrollTop == nScrollTarget) {
+
+                             this._enableScrollHeader();
+                             this._disableScrollFooter();
+
+                        }
+                        else {
+
+                            this._enableScrollHeader();
+                            this._enableScrollFooter();
+
+                        }
+
+                    }
+
+                }
+
+    
+                Event.preventDefault(oEvent);
+
+                stopMouseEventHandlers();
+    
+            break;
+            
+    
+            case 39:    // Right arrow
+    
+                oSubmenu = oItemCfg.getProperty("submenu");
+    
+                if (oSubmenu) {
+    
+                    if (!oItemCfg.getProperty("selected")) {
+        
+                        oItemCfg.setProperty("selected", true);
+        
+                    }
+    
+                    oSubmenu.show();
+                    oSubmenu.setInitialFocus();
+                    oSubmenu.setInitialSelection();
+    
+                }
+                else {
+    
+                    oRoot = this.getRoot();
+                    
+                    if (oRoot instanceof YAHOO.widget.MenuBar) {
+    
+                        oNextItem = oRoot.activeItem.getNextEnabledSibling();
+    
+                        if (oNextItem) {
+                        
+                            oRoot.clearActiveItem();
+    
+                            oNextItem.cfg.setProperty("selected", true);
+    
+                            oSubmenu = oNextItem.cfg.getProperty("submenu");
+    
+                            if (oSubmenu) {
+    
+                                oSubmenu.show();
+                            
+                            }
+    
+                            oNextItem.focus();
+                        
+                        }
+                    
+                    }
+                
+                }
+    
+    
+                Event.preventDefault(oEvent);
+
+                stopMouseEventHandlers();
+
+            break;
+    
+    
+            case 37:    // Left arrow
+    
+                if (oParentItem) {
+    
+                    oParentMenu = oParentItem.parent;
+    
+                    if (oParentMenu instanceof YAHOO.widget.MenuBar) {
+    
+                        oNextItem = 
+                            oParentMenu.activeItem.getPreviousEnabledSibling();
+    
+                        if (oNextItem) {
+                        
+                            oParentMenu.clearActiveItem();
+    
+                            oNextItem.cfg.setProperty("selected", true);
+    
+                            oSubmenu = oNextItem.cfg.getProperty("submenu");
+    
+                            if (oSubmenu) {
+                            
+                                oSubmenu.show();
+                            
+                            }
+    
+                            oNextItem.focus();
+                        
+                        } 
+                    
+                    }
+                    else {
+    
+                        this.hide();
+    
+                        oParentItem.focus();
+                    
+                    }
+    
+                }
+    
+                Event.preventDefault(oEvent);
+
+                stopMouseEventHandlers();
+
+            break;        
+    
+        }
+
+
+    }
+
+
+    if (oEvent.keyCode == 27) { // Esc key
+
+        if (this.cfg.getProperty("position") == "dynamic") {
+        
+            this.hide();
+
+            if (this.parent) {
+
+                this.parent.focus();
+            
+            }
+
+        }
+        else if (this.activeItem) {
+
+            oSubmenu = this.activeItem.cfg.getProperty("submenu");
+
+            if (oSubmenu && oSubmenu.cfg.getProperty("visible")) {
+            
+                oSubmenu.hide();
+                this.activeItem.focus();
+            
+            }
+            else {
+
+                this.activeItem.blur();
+                this.activeItem.cfg.setProperty("selected", false);
+        
+            }
+        
+        }
+
+
+        Event.preventDefault(oEvent);
+    
+    }
+    
+},
+
+
+/**
+* @method _onKeyPress
+* @description "keypress" event handler for a Menu instance.
+* @protected
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
+* was fired.
+*/
+_onKeyPress: function (p_sType, p_aArgs) {
+    
+    var oEvent = p_aArgs[0];
+
+
+    if (oEvent.keyCode == 40 || oEvent.keyCode == 38) {
+
+        Event.preventDefault(oEvent);
+
+    }
+
+},
+
+
+/**
+* @method _onTextResize
+* @description "textresize" event handler for the menu.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+_onTextResize: function (p_sType, p_aArgs, p_oMenu) {
+
+    if (YAHOO.env.ua.gecko && !this._handleResize) {
+
+        this._handleResize = true;
+        return;
+    
+    }
+
+
+    var oConfig = this.cfg;
+
+    if (oConfig.getProperty("position") == "dynamic") {
+
+        oConfig.setProperty("width", (this._getOffsetWidth() + "px"));
+
+    }
+
+},
+
+
+/**
+* @method _onScrollTargetMouseOver
+* @description "mouseover" event handler for the menu's "header" and "footer" 
+* elements.  Used to scroll the body of the menu up and down when the 
+* menu's "maxheight" configuration property is set to a value greater than 0.
+* @protected
+* @param {Event} p_oEvent Object representing the DOM event object passed 
+* back by the event utility (YAHOO.util.Event).
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+_onScrollTargetMouseOver: function (p_oEvent, p_oMenu) {
+
+    this._cancelHideDelay();
+
+    var oTarget = Event.getTarget(p_oEvent),
+        oBody = this.body,
+        me = this,
+        nScrollTarget,
+        fnScrollFunction;
+
+
+    function scrollBodyDown() {
+
+        var nScrollTop = oBody.scrollTop;
+
+
+        if (nScrollTop < nScrollTarget) {
+
+            oBody.scrollTop = (nScrollTop + 1);
+
+            me._enableScrollHeader();
+
+        }
+        else {
+
+            oBody.scrollTop = nScrollTarget;
+            
+            window.clearInterval(me._nBodyScrollId);
+
+            me._disableScrollFooter();
+
+        }
+
+    }
+
+
+    function scrollBodyUp() {
+
+        var nScrollTop = oBody.scrollTop;
+
+
+        if (nScrollTop > 0) {
+
+            oBody.scrollTop = (nScrollTop - 1);
+
+            me._enableScrollFooter();
+
+        }
+        else {
+
+            oBody.scrollTop = 0;
+            
+            window.clearInterval(me._nBodyScrollId);
+
+            me._disableScrollHeader();
+
+        }
+
+    }
+
+    
+    if (Dom.hasClass(oTarget, "hd")) {
+
+        fnScrollFunction = scrollBodyUp;
+    
+    }
+    else {
+
+        nScrollTarget = oBody.scrollHeight - oBody.offsetHeight;
+
+        fnScrollFunction = scrollBodyDown;
+    
+    }
+
+
+    this._nBodyScrollId = window.setInterval(fnScrollFunction, 10);
+
+},
+
+
+/**
+* @method _onScrollTargetMouseOut
+* @description "mouseout" event handler for the menu's "header" and "footer" 
+* elements.  Used to stop scrolling the body of the menu up and down when the 
+* menu's "maxheight" configuration property is set to a value greater than 0.
+* @protected
+* @param {Event} p_oEvent Object representing the DOM event object passed 
+* back by the event utility (YAHOO.util.Event).
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+_onScrollTargetMouseOut: function (p_oEvent, p_oMenu) {
+
+    window.clearInterval(this._nBodyScrollId);
+
+    this._cancelHideDelay();
+
+},
+
+
+
+// Private methods
+
+
+/**
+* @method _onInit
+* @description "init" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onInit: function (p_sType, p_aArgs) {
+
+    this.cfg.subscribeToConfigEvent("width", this._onWidthChange);
+    this.cfg.subscribeToConfigEvent("visible", this._onVisibleChange);
+
+    var bRootMenu = !this.parent,
+        bLazyLoad = this.lazyLoad;
+
+
+    /*
+        Automatically initialize a menu's subtree if:
+
+        1) This is the root menu and lazyload is off
+        
+        2) This is the root menu, lazyload is on, but the menu is 
+           already visible
+
+        3) This menu is a submenu and lazyload is off
+    */
+
+
+
+    if (((bRootMenu && !bLazyLoad) || 
+        (bRootMenu && (this.cfg.getProperty("visible") || 
+        this.cfg.getProperty("position") == "static")) || 
+        (!bRootMenu && !bLazyLoad)) && this.getItemGroups().length === 0) {
+
+        if (this.srcElement) {
+
+            this._initSubTree();
+        
+        }
+
+
+        if (this.itemData) {
+
+            this.addItems(this.itemData);
+
+        }
+    
+    }
+    else if (bLazyLoad) {
+
+        this.cfg.fireQueue();
+    
+    }
+
+},
+
+
+/**
+* @method _onBeforeRender
+* @description "beforerender" event handler for the menu.  Appends all of the 
+* <code>&#60;ul&#62;</code>, <code>&#60;li&#62;</code> and their accompanying 
+* title elements to the body element of the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onBeforeRender: function (p_sType, p_aArgs) {
+
+    var oConfig = this.cfg,
+        oEl = this.element,
+        nListElements = this._aListElements.length,
+        bFirstList = true,
+        i = 0,
+        oUL,
+        oGroupTitle;
+
+    if (nListElements > 0) {
+
+        do {
+
+            oUL = this._aListElements[i];
+
+            if (oUL) {
+
+                if (bFirstList) {
+        
+                    Dom.addClass(oUL, "first-of-type");
+                    bFirstList = false;
+        
+                }
+
+
+                if (!Dom.isAncestor(oEl, oUL)) {
+
+                    this.appendToBody(oUL);
+
+                }
+
+
+                oGroupTitle = this._aGroupTitleElements[i];
+
+                if (oGroupTitle) {
+
+                    if (!Dom.isAncestor(oEl, oGroupTitle)) {
+
+                        oUL.parentNode.insertBefore(oGroupTitle, oUL);
+
+                    }
+
+
+                    Dom.addClass(oUL, "hastitle");
+
+                }
+
+            }
+
+            i++;
+
+        }
+        while(i < nListElements);
+
+    }
+
+},
+
+
+/**
+* @method _onRender
+* @description "render" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onRender: function (p_sType, p_aArgs) {
+
+    if (this.cfg.getProperty("position") == "dynamic" && 
+        !this.cfg.getProperty("width")) {
+
+        this._setWidth();
+    
+    }
+
+},
+
+
+/**
+* @method _onBeforeShow
+* @description "beforeshow" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onBeforeShow: function (p_sType, p_aArgs) {
+
+    var nOptions,
+        n,
+        nViewportHeight,
+        oRegion,
+        nMaxHeight,
+        oBody,
+        oSrcElement;
+
+
+    if (this.lazyLoad && this.getItemGroups().length === 0) {
+
+        if (this.srcElement) {
+        
+            this._initSubTree();
+
+        }
+
+
+        if (this.itemData) {
+
+            if (this.parent && this.parent.parent && 
+                this.parent.parent.srcElement && 
+                this.parent.parent.srcElement.tagName.toUpperCase() == 
+                "SELECT") {
+
+                nOptions = this.itemData.length;
+    
+                for(n=0; n<nOptions; n++) {
+
+                    if (this.itemData[n].tagName) {
+
+                        this.addItem((new this.ITEM_TYPE(this.itemData[n])));
+    
+                    }
+    
+                }
+            
+            }
+            else {
+
+                this.addItems(this.itemData);
+            
+            }
+        
+        }
+
+
+        oSrcElement = this.srcElement;
+
+        if (oSrcElement) {
+
+            if (oSrcElement.tagName.toUpperCase() == "SELECT") {
+
+                if (Dom.inDocument(oSrcElement)) {
+
+                    this.render(oSrcElement.parentNode);
+                
+                }
+                else {
+                
+                    this.render(this.cfg.getProperty("container"));
+                
+                }
+
+            }
+            else {
+
+                this.render();
+
+            }
+
+        }
+        else {
+
+            if (this.parent) {
+
+                this.render(this.parent.element);            
+
+            }
+            else {
+
+                this.render(this.cfg.getProperty("container"));
+                this.cfg.refireEvent("xy");
+
+            }                
+
+        }
+
+    }
+
+
+    if (!(this instanceof YAHOO.widget.MenuBar) && 
+        this.cfg.getProperty("position") == "dynamic") {
+
+        nViewportHeight = Dom.getViewportHeight();
+
+
+        if (this.parent && this.parent.parent instanceof YAHOO.widget.MenuBar) {
+           
+            oRegion = YAHOO.util.Region.getRegion(this.parent.element);
+            
+            nViewportHeight = (nViewportHeight - oRegion.bottom);
+
+        }
+
+
+        if (this.element.offsetHeight >= nViewportHeight) {
+    
+            nMaxHeight = this.cfg.getProperty("maxheight");
+
+            /*
+                Cache the original value for the "maxheight" configuration  
+                property so that we can set it back when the menu is hidden.
+            */
+    
+            this._nMaxHeight = nMaxHeight;
+
+            this.cfg.setProperty("maxheight", (nViewportHeight - 20));
+        
+        }
+    
+    
+        if (this.cfg.getProperty("maxheight") > 0) {
+    
+            oBody = this.body;
+    
+            if (oBody.scrollTop > 0) {
+    
+                oBody.scrollTop = 0;
+    
+            }
+
+            this._disableScrollHeader();
+            this._enableScrollFooter();
+    
+        }
+
+    }
+
+
+},
+
+
+/**
+* @method _onShow
+* @description "show" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onShow: function (p_sType, p_aArgs) {
+
+    var oParent = this.parent,
+        oParentMenu,
+        aParentAlignment,
+        aAlignment;
+
+
+    function disableAutoSubmenuDisplay(p_oEvent) {
+
+        var oTarget;
+
+        if (p_oEvent.type == "mousedown" || (p_oEvent.type == "keydown" && 
+            p_oEvent.keyCode == 27)) {
+
+            /*  
+                Set the "autosubmenudisplay" to "false" if the user
+                clicks outside the menu bar.
+            */
+
+            oTarget = Event.getTarget(p_oEvent);
+
+            if (oTarget != oParentMenu.element || 
+                !Dom.isAncestor(oParentMenu.element, oTarget)) {
+
+                oParentMenu.cfg.setProperty("autosubmenudisplay", false);
+
+                Event.removeListener(document, "mousedown", 
+                        disableAutoSubmenuDisplay);
+
+                Event.removeListener(document, "keydown", 
+                        disableAutoSubmenuDisplay);
+
+            }
+        
+        }
+
+    }
+
+
+    if (oParent) {
+
+        oParentMenu = oParent.parent;
+        aParentAlignment = oParentMenu.cfg.getProperty("submenualignment");
+        aAlignment = this.cfg.getProperty("submenualignment");
+
+
+        if ((aParentAlignment[0] != aAlignment[0]) &&
+            (aParentAlignment[1] != aAlignment[1])) {
+
+            this.cfg.setProperty("submenualignment", 
+                [aParentAlignment[0], aParentAlignment[1]]);
+        
+        }
+
+
+        if (!oParentMenu.cfg.getProperty("autosubmenudisplay") && 
+            (oParentMenu instanceof YAHOO.widget.MenuBar || 
+            oParentMenu.cfg.getProperty("position") == "static")) {
+
+            oParentMenu.cfg.setProperty("autosubmenudisplay", true);
+
+            Event.on(document, "mousedown", disableAutoSubmenuDisplay);                             
+            Event.on(document, "keydown", disableAutoSubmenuDisplay);
+
+        }
+
+    }
+
+},
+
+
+/**
+* @method _onBeforeHide
+* @description "beforehide" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onBeforeHide: function (p_sType, p_aArgs) {
+
+    var oActiveItem = this.activeItem,
+        oConfig,
+        oSubmenu;
+
+    if (oActiveItem) {
+
+        oConfig = oActiveItem.cfg;
+
+        oConfig.setProperty("selected", false);
+
+        oSubmenu = oConfig.getProperty("submenu");
+
+        if (oSubmenu) {
+
+            oSubmenu.hide();
+
+        }
+
+    }
+
+    if (this.getRoot() == this) {
+
+        this.blur();
+    
+    }
+
+},
+
+
+/**
+* @method _onHide
+* @description "hide" event handler for the menu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onHide: function (p_sType, p_aArgs) {
+
+    if (this._nMaxHeight != -1) {
+
+        this.cfg.setProperty("maxheight", this._nMaxHeight);
+
+        this._nMaxHeight = -1;
+
+    }
+
+},
+
+
+/**
+* @method _onParentMenuConfigChange
+* @description "configchange" event handler for a submenu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that 
+* subscribed to the event.
+*/
+_onParentMenuConfigChange: function (p_sType, p_aArgs, p_oSubmenu) {
+    
+    var sPropertyName = p_aArgs[0][0],
+        oPropertyValue = p_aArgs[0][1];
+
+    switch(sPropertyName) {
+
+        case "iframe":
+        case "constraintoviewport":
+        case "hidedelay":
+        case "showdelay":
+        case "submenuhidedelay":
+        case "clicktohide":
+        case "effect":
+        case "classname":
+
+            p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);
+                
+        break;        
+        
+    }
+    
+},
+
+
+/**
+* @method _onParentMenuRender
+* @description "render" event handler for a submenu.  Renders a  
+* submenu in response to the firing of its parent's "render" event.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that 
+* subscribed to the event.
+*/
+_onParentMenuRender: function (p_sType, p_aArgs, p_oSubmenu) {
+
+    var oParentMenu = p_oSubmenu.parent.parent,
+
+        oConfig = {
+
+            constraintoviewport: 
+                oParentMenu.cfg.getProperty("constraintoviewport"),
+
+            xy: [0,0],
+                
+            clicktohide: oParentMenu.cfg.getProperty("clicktohide"),
+                
+            effect: oParentMenu.cfg.getProperty("effect"),
+
+            showdelay: oParentMenu.cfg.getProperty("showdelay"),
+            
+            hidedelay: oParentMenu.cfg.getProperty("hidedelay"),
+
+            submenuhidedelay: oParentMenu.cfg.getProperty("submenuhidedelay"),
+
+            classname: oParentMenu.cfg.getProperty("classname")
+
+        },
+        
+        oLI;
+
+
+    /*
+        Only sync the "iframe" configuration property if the parent
+        menu's "position" configuration is the same.
+    */
+
+    if (this.cfg.getProperty("position") == 
+        oParentMenu.cfg.getProperty("position")) {
+
+        oConfig.iframe = oParentMenu.cfg.getProperty("iframe");
+    
+    }
+               
+
+    p_oSubmenu.cfg.applyConfig(oConfig);
+
+
+    if (!this.lazyLoad) {
+
+        oLI = this.parent.element;
+
+        if (this.element.parentNode == oLI) {
+    
+            this.render();
+    
+        }
+        else {
+
+            this.render(oLI);
+    
+        }
+
+    }
+    
+},
+
+
+/**
+* @method _onSubmenuBeforeShow
+* @description "beforeshow" event handler for a submenu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onSubmenuBeforeShow: function (p_sType, p_aArgs) {
+    
+    var oParent = this.parent,
+        aAlignment = oParent.parent.cfg.getProperty("submenualignment");
+
+    this.cfg.setProperty("context", 
+        [oParent.element, aAlignment[0], aAlignment[1]]);
+
+
+    var nScrollTop = oParent.parent.body.scrollTop;
+
+    if ((YAHOO.env.ua.gecko || YAHOO.env.ua.webkit) && nScrollTop > 0) {
+
+         this.cfg.setProperty("y", (this.cfg.getProperty("y") - nScrollTop));
+    
+    }
+
+},
+
+
+/**
+* @method _onSubmenuShow
+* @description "show" event handler for a submenu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onSubmenuShow: function (p_sType, p_aArgs) {
+    
+    this.submenuIndicator.innerHTML = this.EXPANDED_SUBMENU_INDICATOR_TEXT;
+
+},
+
+
+/**
+* @method _onSubmenuHide
+* @description "hide" Custom Event handler for a submenu.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onSubmenuHide: function (p_sType, p_aArgs) {
+    
+    this.submenuIndicator.innerHTML = this.COLLAPSED_SUBMENU_INDICATOR_TEXT;
+
+},
+
+
+/**
+* @method _onMenuItemFocus
+* @description "focus" event handler for the menu's items.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onMenuItemFocus: function (p_sType, p_aArgs) {
+
+    this.parent.focusEvent.fire(this);
+
+},
+
+
+/**
+* @method _onMenuItemBlur
+* @description "blur" event handler for the menu's items.
+* @private
+* @param {String} p_sType String representing the name of the event 
+* that was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+_onMenuItemBlur: function (p_sType, p_aArgs) {
+
+    this.parent.blurEvent.fire(this);
+
+},
+
+
+/**
+* @method _onMenuItemConfigChange
+* @description "configchange" event handler for the menu's items.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item 
+* that fired the event.
+*/
+_onMenuItemConfigChange: function (p_sType, p_aArgs, p_oItem) {
+
+    var sPropertyName = p_aArgs[0][0],
+        oPropertyValue = p_aArgs[0][1],
+        sWidth,
+        oSubmenu;
+
+    switch(sPropertyName) {
+
+        case "selected":
+
+            if (oPropertyValue === true) {
+
+                this.activeItem = p_oItem;
+            
+            }
+
+        break;
+
+        case "submenu":
+
+            oSubmenu = p_aArgs[0][1];
+
+            if (oSubmenu) {
+
+                this._configureSubmenu(p_oItem);
+
+            }
+
+        break;
+
+        case "text":
+        case "helptext":
+
+            /*
+                A change to an item's "text" or "helptext"
+                configuration properties requires the width of the parent
+                menu to be recalculated.
+            */
+
+            if (this.element.style.width) {
+    
+                sWidth = this._getOffsetWidth() + "px";
+
+                Dom.setStyle(this.element, "width", sWidth);
+
+            }
+
+        break;
+
+    }
+
+},
+
+
+
+// Public event handlers for configuration properties
+
+
+/**
+* @method enforceConstraints
+* @description The default event handler executed when the moveEvent is fired,  
+* if the "constraintoviewport" configuration property is set to true.
+* @param {String} type The name of the event that was fired.
+* @param {Array} args Collection of arguments sent when the 
+* event was fired.
+* @param {Array} obj Array containing the current Menu instance 
+* and the item that fired the event.
+*/
+enforceConstraints: function (type, args, obj) {
+
+    var oParentMenuItem = this.parent,
+        oElement,
+        oConfig,
+        pos,
+        x,
+        y,
+        offsetHeight,
+        offsetWidth,
+        viewPortWidth,
+        viewPortHeight,
+        scrollX,
+        scrollY,
+        nPadding,
+        topConstraint,
+        leftConstraint,
+        bottomConstraint,
+        rightConstraint,
+        aContext,
+        oContextElement;
+
+
+    if (oParentMenuItem && 
+        !(oParentMenuItem.parent instanceof YAHOO.widget.MenuBar)) {
+
+        oElement = this.element;
+    
+        oConfig = this.cfg;
+        pos = args[0];
+        
+        x = pos[0];
+        y = pos[1];
+        
+        offsetHeight = oElement.offsetHeight;
+        offsetWidth = oElement.offsetWidth;
+        
+        viewPortWidth = Dom.getViewportWidth();
+        viewPortHeight = Dom.getViewportHeight();
+        
+        scrollX = Dom.getDocumentScrollLeft();
+        scrollY = Dom.getDocumentScrollTop();
+        
+        nPadding = 
+            (oParentMenuItem.parent instanceof YAHOO.widget.MenuBar) ? 0 : 10;
+        
+        topConstraint = scrollY + nPadding;
+        leftConstraint = scrollX + nPadding;
+        
+        bottomConstraint = scrollY + viewPortHeight - offsetHeight - nPadding;
+        rightConstraint = scrollX + viewPortWidth - offsetWidth - nPadding;
+        
+        aContext = oConfig.getProperty("context");
+        oContextElement = aContext ? aContext[0] : null;
+    
+    
+        if (x < 10) {
+    
+            x = leftConstraint;
+    
+        } else if ((x + offsetWidth) > viewPortWidth) {
+    
+            if (oContextElement &&
+                ((x - oContextElement.offsetWidth) > offsetWidth)) {
+    
+                x = (x - (oContextElement.offsetWidth + offsetWidth));
+    
+            }
+            else {
+    
+                x = rightConstraint;
+    
+            }
+    
+        }
+    
+        if (y < 10) {
+    
+            y = topConstraint;
+    
+        } else if (y > bottomConstraint) {
+    
+            if (oContextElement && (y > offsetHeight)) {
+    
+                y = ((y + oContextElement.offsetHeight) - offsetHeight);
+    
+            }
+            else {
+    
+                y = bottomConstraint;
+    
+            }
+    
+        }
+    
+        oConfig.setProperty("x", x, true);
+        oConfig.setProperty("y", y, true);
+        oConfig.setProperty("xy", [x,y], true);
+    
+    }
+    else if (this == this.getRoot() && 
+        this.cfg.getProperty("position") == "dynamic") {
+    
+        Menu.superclass.enforceConstraints.call(this, type, args, obj);
+    
+    }
+
+},
+
+
+/**
+* @method configVisible
+* @description Event handler for when the "visible" configuration property 
+* the menu changes.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+configVisible: function (p_sType, p_aArgs, p_oMenu) {
+
+    var bVisible,
+        sDisplay;
+
+    if (this.cfg.getProperty("position") == "dynamic") {
+
+        Menu.superclass.configVisible.call(this, p_sType, p_aArgs, p_oMenu);
+
+    }
+    else {
+
+        bVisible = p_aArgs[0];
+        sDisplay = Dom.getStyle(this.element, "display");
+
+        if (bVisible) {
+
+            if (sDisplay != "block") {
+                this.beforeShowEvent.fire();
+                Dom.setStyle(this.element, "display", "block");
+                this.showEvent.fire();
+            }
+        
+        }
+        else {
+
+                       if (sDisplay == "block") {
+                               this.beforeHideEvent.fire();
+                               Dom.setStyle(this.element, "display", "none");
+                               this.hideEvent.fire();
+                       }
+        
+        }
+
+    }
+
+},
+
+
+/**
+* @method configPosition
+* @description Event handler for when the "position" configuration property 
+* of the menu changes.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+configPosition: function (p_sType, p_aArgs, p_oMenu) {
+
+    var oElement = this.element,
+        sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute",
+        sCurrentPosition = Dom.getStyle(oElement, "position"),
+        oCfg = this.cfg,
+        nZIndex;
+
+
+    Dom.setStyle(this.element, "position", sCSSPosition);
+
+
+    if (sCSSPosition == "static") {
+
+        /*
+            Remove the iframe for statically positioned menus since it will 
+            intercept mouse events.
+        */
+
+        oCfg.setProperty("iframe", false);
+
+
+        // Statically positioned menus are visible by default
+        
+        Dom.setStyle(this.element, "display", "block");
+
+        oCfg.setProperty("visible", true);
+
+    }
+    else {
+
+        if (sCurrentPosition != "absolute") {
+
+            oCfg.setProperty("iframe", (YAHOO.env.ua.ie == 6 ? true : false));
+
+        }
+
+        /*
+            Even though the "visible" property is queued to 
+            "false" by default, we need to set the "visibility" property to 
+            "hidden" since Overlay's "configVisible" implementation checks the 
+            element's "visibility" style property before deciding whether 
+            or not to show an Overlay instance.
+        */
+
+        Dom.setStyle(this.element, "visibility", "hidden");
+    
+    }
+
+
+    if (sCSSPosition == "absolute") {
+
+        nZIndex = oCfg.getProperty("zindex");
+
+        if (!nZIndex || nZIndex === 0) {
+
+            nZIndex = this.parent ? 
+                (this.parent.parent.cfg.getProperty("zindex") + 1) : 1;
+
+            oCfg.setProperty("zindex", nZIndex);
+
+        }
+
+    }
+
+},
+
+
+/**
+* @method configIframe
+* @description Event handler for when the "iframe" configuration property of 
+* the menu changes.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+configIframe: function (p_sType, p_aArgs, p_oMenu) {    
+
+    if (this.cfg.getProperty("position") == "dynamic") {
+
+        Menu.superclass.configIframe.call(this, p_sType, p_aArgs, p_oMenu);
+
+    }
+
+},
+
+
+/**
+* @method configHideDelay
+* @description Event handler for when the "hidedelay" configuration property 
+* of the menu changes.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+configHideDelay: function (p_sType, p_aArgs, p_oMenu) {
+
+    var nHideDelay = p_aArgs[0],
+        oMouseOutEvent = this.mouseOutEvent,
+        oMouseOverEvent = this.mouseOverEvent,
+        oKeyDownEvent = this.keyDownEvent;
+
+    if (nHideDelay > 0) {
+
+        /*
+            Only assign event handlers once. This way the user change 
+            the value for the hidedelay as many times as they want.
+        */
+
+        if (!this._bHideDelayEventHandlersAssigned) {
+
+            oMouseOutEvent.subscribe(this._execHideDelay);
+            oMouseOverEvent.subscribe(this._cancelHideDelay);
+            oKeyDownEvent.subscribe(this._cancelHideDelay);
+
+            this._bHideDelayEventHandlersAssigned = true;
+        
+        }
+
+    }
+    else {
+
+        oMouseOutEvent.unsubscribe(this._execHideDelay);
+        oMouseOverEvent.unsubscribe(this._cancelHideDelay);
+        oKeyDownEvent.unsubscribe(this._cancelHideDelay);
+
+        this._bHideDelayEventHandlersAssigned = false;
+
+    }
+
+},
+
+
+/**
+* @method configContainer
+* @description Event handler for when the "container" configuration property 
+of the menu changes.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
+* fired the event.
+*/
+configContainer: function (p_sType, p_aArgs, p_oMenu) {
+
+       var oElement = p_aArgs[0];
+
+       if (typeof oElement == 'string') {
+
+        this.cfg.setProperty("container", document.getElementById(oElement), 
+                true);
+
+       }
+
+},
+
+
+/**
+* @method _setMaxHeight
+* @description "renderEvent" handler used to defer the setting of the 
+* "maxheight" configuration property until the menu is rendered in lazy 
+* load scenarios.
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
+* was fired.
+* @param {Number} p_nMaxHeight Number representing the value to set for the 
+* "maxheight" configuration property.
+* @private
+*/
+_setMaxHeight: function (p_sType, p_aArgs, p_nMaxHeight) {
+
+    this.cfg.setProperty("maxheight", p_nMaxHeight);
+    this.renderEvent.unsubscribe(this._setMaxHeight);
+
+},
+
+
+/**
+* @method configMaxHeight
+* @description Event handler for when the "maxheight" configuration property of 
+* a Menu changes.
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
+* was fired.
+* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired
+* the event.
+*/
+configMaxHeight: function (p_sType, p_aArgs, p_oMenu) {
+
+    var nMaxHeight = p_aArgs[0],
+        oBody = this.body,
+        oHeader = this.header,
+        oFooter = this.footer,
+        fnMouseOver = this._onScrollTargetMouseOver,
+        fnMouseOut = this._onScrollTargetMouseOut,
+        nHeight;
+
+
+    if (this.lazyLoad && !oBody) {
+
+        this.renderEvent.unsubscribe(this._setMaxHeight);
+    
+        if (nMaxHeight > 0) {
+
+            this.renderEvent.subscribe(this._setMaxHeight, nMaxHeight, this);
+
+        }
+
+        return;
+    
+    }
+
+    Dom.setStyle(oBody, "height", "auto");
+    Dom.setStyle(oBody, "overflow", "visible");    
+
+
+    if ((nMaxHeight > 0) && (oBody.offsetHeight > nMaxHeight)) {
+
+        if (!this.cfg.getProperty("width")) {
+
+            this._setWidth();
+
+        }
+
+        if (!oHeader && !oFooter) {
+
+            this.setHeader("&#32;");
+            this.setFooter("&#32;");
+
+            oHeader = this.header;
+            oFooter = this.footer;
+
+            Dom.addClass(oHeader, "topscrollbar");
+            Dom.addClass(oFooter, "bottomscrollbar");
+            
+            this.element.insertBefore(oHeader, oBody);
+            this.element.appendChild(oFooter);
+
+            Event.on(oHeader, "mouseover", fnMouseOver, this, true);
+            Event.on(oHeader, "mouseout", fnMouseOut, this, true);
+            Event.on(oFooter, "mouseover", fnMouseOver, this, true);
+            Event.on(oFooter, "mouseout", fnMouseOut, this, true);
+        
+        }
+
+        nHeight = (nMaxHeight - (this.footer.offsetHeight + 
+                    this.header.offsetHeight));
+
+        Dom.setStyle(oBody, "height", (nHeight + "px"));
+        Dom.setStyle(oBody, "overflow", "hidden");
+
+    }
+    else if (oHeader && oFooter) {
+
+        Dom.setStyle(oBody, "height", "auto");
+        Dom.setStyle(oBody, "overflow", "visible");
+
+        Event.removeListener(oHeader, "mouseover", fnMouseOver);
+        Event.removeListener(oHeader, "mouseout", fnMouseOut);
+        Event.removeListener(oFooter, "mouseover", fnMouseOver);
+        Event.removeListener(oFooter, "mouseout", fnMouseOut);
+
+        this.element.removeChild(oHeader);
+        this.element.removeChild(oFooter);
+    
+        this.header = null;
+        this.footer = null;
+    
+    }
+
+    this.cfg.refireEvent("iframe");
+
+},
+
+
+/**
+* @method configClassName
+* @description Event handler for when the "classname" configuration property of 
+* a menu changes.
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event.
+*/
+configClassName: function (p_sType, p_aArgs, p_oMenu) {
+
+    var sClassName = p_aArgs[0];
+
+    if (this._sClassName) {
+
+        Dom.removeClass(this.element, this._sClassName);
+
+    }
+
+    Dom.addClass(this.element, sClassName);
+    this._sClassName = sClassName;
+
+},
+
+
+/**
+* @method _onItemAdded
+* @description "itemadded" event handler for a Menu instance.
+* @private
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
+* was fired.
+*/
+_onItemAdded: function (p_sType, p_aArgs) {
+
+    var oItem = p_aArgs[0];
+    
+    if (oItem) {
+
+        oItem.cfg.setProperty("disabled", true);
+    
+    }
+
+},
+
+
+/**
+* @method configDisabled
+* @description Event handler for when the "disabled" configuration property of 
+* a menu changes.
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event.
+*/
+configDisabled: function (p_sType, p_aArgs, p_oMenu) {
+
+    var bDisabled = p_aArgs[0],
+        aItems,
+        nItems,
+        i;
+
+    if (this._bDisabled != bDisabled) {
+
+        aItems = this.getItems();
+        nItems = aItems.length;
+
+        if (nItems > 0) {
+        
+            i = nItems - 1;
+    
+            do {
+    
+                aItems[i].cfg.setProperty("disabled", bDisabled);
+            
+            }
+            while (i--);
+        
+        }
+    
+        Dom[(bDisabled ? "addClass" : "removeClass")](this.element, "disabled");    
+
+        this.itemAddedEvent[(bDisabled ? "subscribe" : "unsubscribe")](
+            this._onItemAdded);
+    
+        this._bDisabled = bDisabled;
+    
+    }
+
+},
+
+
+/**
+* @method onRender
+* @description "render" event handler for the menu.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+onRender: function (p_sType, p_aArgs) {
+
+    function sizeShadow() {
+
+        var oElement = this.element,
+            oShadow = this._shadow;
+    
+        if (oShadow) {
+
+            oShadow.style.width = (oElement.offsetWidth + 6) + "px";
+            oShadow.style.height = (oElement.offsetHeight + 1) + "px";
+            
+        }
+    
+    }
+
+
+    function addShadowVisibleClass() {
+    
+        Dom.addClass(this._shadow, "yui-menu-shadow-visible");
+    
+    }
+    
+
+    function removeShadowVisibleClass() {
+
+        Dom.removeClass(this._shadow, "yui-menu-shadow-visible");
+    
+    }
+
+
+    function createShadow() {
+
+        var oShadow = this._shadow,
+            oElement,
+            me;
+
+        if (!oShadow) {
+
+            oElement = this.element;
+            me = this;
+
+            if (!m_oShadowTemplate) {
+
+                m_oShadowTemplate = document.createElement("div");
+                m_oShadowTemplate.className = "yui-menu-shadow";
+            
+            }
+
+            oShadow = m_oShadowTemplate.cloneNode(false);
+
+            oElement.appendChild(oShadow);
+            
+            this._shadow = oShadow;
+
+            addShadowVisibleClass.call(this);
+
+            this.beforeShowEvent.subscribe(addShadowVisibleClass);
+            this.beforeHideEvent.subscribe(removeShadowVisibleClass);
+
+            if (YAHOO.env.ua.ie) {
+        
+                /*
+                     Need to call sizeShadow & syncIframe via setTimeout for 
+                     IE 7 Quirks Mode and IE 6 Standards Mode and Quirks Mode 
+                     or the shadow and iframe shim will not be sized and 
+                     positioned properly.
+                */
+        
+                window.setTimeout(function () { 
+        
+                    sizeShadow.call(me); 
+                    me.syncIframe();
+        
+                }, 0);
+
+                this.cfg.subscribeToConfigEvent("width", sizeShadow);
+                this.cfg.subscribeToConfigEvent("height", sizeShadow);
+                this.changeContentEvent.subscribe(sizeShadow);
+
+                Module.textResizeEvent.subscribe(sizeShadow, me, true);
+                
+                this.destroyEvent.subscribe(function () {
+                
+                    Module.textResizeEvent.unsubscribe(sizeShadow, me);
+                
+                });
+        
+            }
+        
+        }
+
+    }
+
+
+    function onBeforeShow() {
+    
+        createShadow.call(this);
+
+        this.beforeShowEvent.unsubscribe(onBeforeShow);
+    
+    }
+
+
+    if (this.cfg.getProperty("position") == "dynamic") {
+
+        if (this.cfg.getProperty("visible")) {
+
+            createShadow.call(this);
+        
+        }
+        else {
+
+            this.beforeShowEvent.subscribe(onBeforeShow);
+        
+        }
+    
+    }
+
+},
+
+
+// Public methods
+
+
+/**
+* @method initEvents
+* @description Initializes the custom events for the menu.
+*/
+initEvents: function () {
+
+       Menu.superclass.initEvents.call(this);
+
+    // Create custom events
+
+    var SIGNATURE = CustomEvent.LIST;
+
+    this.mouseOverEvent = this.createEvent(EVENT_TYPES.MOUSE_OVER);
+    this.mouseOverEvent.signature = SIGNATURE;
+
+    this.mouseOutEvent = this.createEvent(EVENT_TYPES.MOUSE_OUT);
+    this.mouseOutEvent.signature = SIGNATURE;
+    
+    this.mouseDownEvent = this.createEvent(EVENT_TYPES.MOUSE_DOWN);
+    this.mouseDownEvent.signature = SIGNATURE;
+
+    this.mouseUpEvent = this.createEvent(EVENT_TYPES.MOUSE_UP);
+    this.mouseUpEvent.signature = SIGNATURE;
+    
+    this.clickEvent = this.createEvent(EVENT_TYPES.CLICK);
+    this.clickEvent.signature = SIGNATURE;
+    
+    this.keyPressEvent = this.createEvent(EVENT_TYPES.KEY_PRESS);
+    this.keyPressEvent.signature = SIGNATURE;
+    
+    this.keyDownEvent = this.createEvent(EVENT_TYPES.KEY_DOWN);
+    this.keyDownEvent.signature = SIGNATURE;
+    
+    this.keyUpEvent = this.createEvent(EVENT_TYPES.KEY_UP);
+    this.keyUpEvent.signature = SIGNATURE;
+    
+    this.focusEvent = this.createEvent(EVENT_TYPES.FOCUS);
+    this.focusEvent.signature = SIGNATURE;
+    
+    this.blurEvent = this.createEvent(EVENT_TYPES.BLUR);
+    this.blurEvent.signature = SIGNATURE;
+    
+    this.itemAddedEvent = this.createEvent(EVENT_TYPES.ITEM_ADDED);
+    this.itemAddedEvent.signature = SIGNATURE;
+    
+    this.itemRemovedEvent = this.createEvent(EVENT_TYPES.ITEM_REMOVED);
+    this.itemRemovedEvent.signature = SIGNATURE;
+
+},
+
+
+/**
+* @method getRoot
+* @description Finds the menu's root menu.
+*/
+getRoot: function () {
+
+    var oItem = this.parent,
+        oParentMenu;
+
+    if (oItem) {
+
+        oParentMenu = oItem.parent;
+
+        return oParentMenu ? oParentMenu.getRoot() : this;
+
+    }
+    else {
+    
+        return this;
+    
+    }
+
+},
+
+
+/**
+* @method toString
+* @description Returns a string representing the menu.
+* @return {String}
+*/
+toString: function () {
+
+    var sReturnVal = "Menu",
+        sId = this.id;
+
+    if (sId) {
+
+        sReturnVal += (" " + sId);
+    
+    }
+
+    return sReturnVal;
+
+},
+
+
+/**
+* @method setItemGroupTitle
+* @description Sets the title of a group of menu items.
+* @param {String} p_sGroupTitle String specifying the title of the group.
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to which
+* the title belongs.
+*/
+setItemGroupTitle: function (p_sGroupTitle, p_nGroupIndex) {
+
+    var nGroupIndex,
+        oTitle,
+        i,
+        nFirstIndex;
+        
+    if (typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {
+
+        nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;
+        oTitle = this._aGroupTitleElements[nGroupIndex];
+
+
+        if (oTitle) {
+
+            oTitle.innerHTML = p_sGroupTitle;
+            
+        }
+        else {
+
+            oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME);
+                    
+            oTitle.innerHTML = p_sGroupTitle;
+
+            this._aGroupTitleElements[nGroupIndex] = oTitle;
+
+        }
+
+
+        i = this._aGroupTitleElements.length - 1;
+
+        do {
+
+            if (this._aGroupTitleElements[i]) {
+
+                Dom.removeClass(this._aGroupTitleElements[i], "first-of-type");
+
+                nFirstIndex = i;
+
+            }
+
+        }
+        while(i--);
+
+
+        if (nFirstIndex !== null) {
+
+            Dom.addClass(this._aGroupTitleElements[nFirstIndex], 
+                "first-of-type");
+
+        }
+
+        this.changeContentEvent.fire();
+
+    }
+
+},
+
+
+
+/**
+* @method addItem
+* @description Appends an item to the menu.
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance to be added to the menu.
+* @param {String} p_oItem String specifying the text of the item to be added 
+* to the menu.
+* @param {Object} p_oItem Object literal containing a set of menu item 
+* configuration properties.
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to
+* which the item belongs.
+* @return {YAHOO.widget.MenuItem}
+*/
+addItem: function (p_oItem, p_nGroupIndex) {
+
+    if (p_oItem) {
+
+        return this._addItemToGroup(p_nGroupIndex, p_oItem);
+        
+    }
+
+},
+
+
+/**
+* @method addItems
+* @description Adds an array of items to the menu.
+* @param {Array} p_aItems Array of items to be added to the menu.  The array 
+* can contain strings specifying the text for each item to be created, object
+* literals specifying each of the menu item configuration properties, 
+* or MenuItem instances.
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to 
+* which the items belongs.
+* @return {Array}
+*/
+addItems: function (p_aItems, p_nGroupIndex) {
+
+    var nItems,
+        aItems,
+        oItem,
+        i;
+
+    if (Lang.isArray(p_aItems)) {
+
+        nItems = p_aItems.length;
+        aItems = [];
+
+        for(i=0; i<nItems; i++) {
+
+            oItem = p_aItems[i];
+
+            if (oItem) {
+
+                if (Lang.isArray(oItem)) {
+    
+                    aItems[aItems.length] = this.addItems(oItem, i);
+    
+                }
+                else {
+    
+                    aItems[aItems.length] = 
+                        this._addItemToGroup(p_nGroupIndex, oItem);
+                
+                }
+
+            }
+    
+        }
+
+
+        if (aItems.length) {
+        
+            return aItems;
+        
+        }
+
+    }
+
+},
+
+
+/**
+* @method insertItem
+* @description Inserts an item into the menu at the specified index.
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
+* instance to be added to the menu.
+* @param {String} p_oItem String specifying the text of the item to be added 
+* to the menu.
+* @param {Object} p_oItem Object literal containing a set of menu item 
+* configuration properties.
+* @param {Number} p_nItemIndex Number indicating the ordinal position at which
+* the item should be added.
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to which 
+* the item belongs.
+* @return {YAHOO.widget.MenuItem}
+*/
+insertItem: function (p_oItem, p_nItemIndex, p_nGroupIndex) {
+    
+    if (p_oItem) {
+
+        return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex);
+
+    }
+
+},
+
+
+/**
+* @method removeItem
+* @description Removes the specified item from the menu.
+* @param {YAHOO.widget.MenuItem} p_oObject Object reference for the MenuItem 
+* instance to be removed from the menu.
+* @param {Number} p_oObject Number specifying the index of the item 
+* to be removed.
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to 
+* which the item belongs.
+* @return {YAHOO.widget.MenuItem}
+*/
+removeItem: function (p_oObject, p_nGroupIndex) {
+
+    var oItem;
+    
+    if (typeof p_oObject != "undefined") {
+
+        if (p_oObject instanceof YAHOO.widget.MenuItem) {
+
+            oItem = this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject);           
+
+        }
+        else if (typeof p_oObject == "number") {
+
+            oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);
+
+        }
+
+        if (oItem) {
+
+            oItem.destroy();
+
+
+            return oItem;
+
+        }
+
+    }
+
+},
+
+
+/**
+* @method getItems
+* @description Returns an array of all of the items in the menu.
+* @return {Array}
+*/
+getItems: function () {
+
+    var aGroups = this._aItemGroups,
+        nGroups = aGroups.length;
+
+    return ((nGroups == 1) ? aGroups[0] : 
+                (Array.prototype.concat.apply([], aGroups)));
+
+},
+
+
+/**
+* @method getItemGroups
+* @description Multi-dimensional Array representing the menu items as they 
+* are grouped in the menu.
+* @return {Array}
+*/        
+getItemGroups: function () {
+
+    return this._aItemGroups;
+
+},
+
+
+/**
+* @method getItem
+* @description Returns the item at the specified index.
+* @param {Number} p_nItemIndex Number indicating the ordinal position of the 
+* item to be retrieved.
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to which 
+* the item belongs.
+* @return {YAHOO.widget.MenuItem}
+*/
+getItem: function (p_nItemIndex, p_nGroupIndex) {
+    
+    var aGroup;
+    
+    if (typeof p_nItemIndex == "number") {
+
+        aGroup = this._getItemGroup(p_nGroupIndex);
+
+        if (aGroup) {
+
+            return aGroup[p_nItemIndex];
+        
+        }
+
+    }
+    
+},
+
+
+/**
+* @method getSubmenus
+* @description Returns an array of all of the submenus that are immediate 
+* children of the menu.
+* @return {Array}
+*/
+getSubmenus: function () {
+
+    var aItems = this.getItems(),
+        nItems = aItems.length,
+        aSubmenus,
+        oSubmenu,
+        oItem,
+        i;
+
+
+    if (nItems > 0) {
+        
+        aSubmenus = [];
+
+        for(i=0; i<nItems; i++) {
+
+            oItem = aItems[i];
+            
+            if (oItem) {
+
+                oSubmenu = oItem.cfg.getProperty("submenu");
+                
+                if (oSubmenu) {
+
+                    aSubmenus[aSubmenus.length] = oSubmenu;
+
+                }
+            
+            }
+        
+        }
+    
+    }
+
+    return aSubmenus;
+
+},
+
+/**
+* @method clearContent
+* @description Removes all of the content from the menu, including the menu 
+* items, group titles, header and footer.
+*/
+clearContent: function () {
+
+    var aItems = this.getItems(),
+        nItems = aItems.length,
+        oElement = this.element,
+        oBody = this.body,
+        oHeader = this.header,
+        oFooter = this.footer,
+        oItem,
+        oSubmenu,
+        i;
+
+
+    if (nItems > 0) {
+
+        i = nItems - 1;
+
+        do {
+
+            oItem = aItems[i];
+
+            if (oItem) {
+
+                oSubmenu = oItem.cfg.getProperty("submenu");
+
+                if (oSubmenu) {
+
+                    this.cfg.configChangedEvent.unsubscribe(
+                        this._onParentMenuConfigChange, oSubmenu);
+
+                    this.renderEvent.unsubscribe(this._onParentMenuRender, 
+                        oSubmenu);
+
+                }
+                
+                this.removeItem(oItem);
+
+            }
+        
+        }
+        while(i--);
+
+    }
+
+
+    if (oHeader) {
+
+        Event.purgeElement(oHeader);
+        oElement.removeChild(oHeader);
+
+    }
+    
+
+    if (oFooter) {
+
+        Event.purgeElement(oFooter);
+        oElement.removeChild(oFooter);
+    }
+
+
+    if (oBody) {
+
+        Event.purgeElement(oBody);
+
+        oBody.innerHTML = "";
+
+    }
+
+
+    this._aItemGroups = [];
+    this._aListElements = [];
+    this._aGroupTitleElements = [];
+    
+    this.cfg.setProperty("width", null);
+
+},
+
+
+/**
+* @method destroy
+* @description Removes the menu's <code>&#60;div&#62;</code> element 
+* (and accompanying child nodes) from the document.
+*/
+destroy: function () {
+
+    Module.textResizeEvent.unsubscribe(this._onTextResize, this);
+
+
+    // Remove all items
+
+    this.clearContent();
+
+    this._aItemGroups = null;
+    this._aListElements = null;
+    this._aGroupTitleElements = null;
+
+
+    // Continue with the superclass implementation of this method
+
+    Menu.superclass.destroy.call(this);
+    
+
+},
+
+
+/**
+* @method setInitialFocus
+* @description Sets focus to the menu's first enabled item.
+*/
+setInitialFocus: function () {
+
+    var oItem = this._getFirstEnabledItem();
+    
+    if (oItem) {
+
+        oItem.focus();
+
+    }
+    
+},
+
+
+/**
+* @method setInitialSelection
+* @description Sets the "selected" configuration property of the menu's first 
+* enabled item to "true."
+*/
+setInitialSelection: function () {
+
+    var oItem = this._getFirstEnabledItem();
+    
+    if (oItem) {
+    
+        oItem.cfg.setProperty("selected", true);
+    }        
+
+},
+
+
+/**
+* @method clearActiveItem
+* @description Sets the "selected" configuration property of the menu's active
+* item to "false" and hides the item's submenu.
+* @param {Boolean} p_bBlur Boolean indicating if the menu's active item 
+* should be blurred.  
+*/
+clearActiveItem: function (p_bBlur) {
+
+    if (this.cfg.getProperty("showdelay") > 0) {
+    
+        this._cancelShowDelay();
+    
+    }
+
+
+    var oActiveItem = this.activeItem,
+        oConfig,
+        oSubmenu;
+
+    if (oActiveItem) {
+
+        oConfig = oActiveItem.cfg;
+
+        if (p_bBlur) {
+
+            oActiveItem.blur();
+        
+        }
+
+        oConfig.setProperty("selected", false);
+
+        oSubmenu = oConfig.getProperty("submenu");
+
+        if (oSubmenu) {
+
+            oSubmenu.hide();
+
+        }
+
+        this.activeItem = null;            
+
+    }
+
+},
+
+
+/**
+* @method focus
+* @description Causes the menu to receive focus and fires the "focus" event.
+*/
+focus: function () {
+
+    if (!this.hasFocus()) {
+
+        this.setInitialFocus();
+    
+    }
+
+},
+
+
+/**
+* @method blur
+* @description Causes the menu to lose focus and fires the "blur" event.
+*/    
+blur: function () {
+
+    var oItem;
+
+    if (this.hasFocus()) {
+    
+        oItem = MenuManager.getFocusedMenuItem();
+        
+        if (oItem) {
+
+            oItem.blur();
+
+        }
+
+    }
+
+},
+
+
+/**
+* @method hasFocus
+* @description Returns a boolean indicating whether or not the menu has focus.
+* @return {Boolean}
+*/
+hasFocus: function () {
+
+    return (MenuManager.getFocusedMenu() == this.getRoot());
+
+},
+
+
+/**
+* Adds the specified CustomEvent subscriber to the menu and each of 
+* its submenus.
+* @method subscribe
+* @param p_type     {string}   the type, or name of the event
+* @param p_fn       {function} the function to exectute when the event fires
+* @param p_obj      {Object}   An object to be passed along when the event 
+*                              fires
+* @param p_override {boolean}  If true, the obj passed in becomes the 
+*                              execution scope of the listener
+*/
+subscribe: function () {
+
+    function onItemAdded(p_sType, p_aArgs, p_oObject) {
+
+        var oItem = p_aArgs[0],
+            oSubmenu = oItem.cfg.getProperty("submenu");
+
+        if (oSubmenu) {
+
+            oSubmenu.subscribe.apply(oSubmenu, p_oObject);
+
+        }
+    
+    }
+
+
+    Menu.superclass.subscribe.apply(this, arguments);
+    Menu.superclass.subscribe.call(this, "itemAdded", onItemAdded, arguments);
+
+
+    var aSubmenus = this.getSubmenus(),
+        nSubmenus,
+        oSubmenu,
+        i;
+
+    if (aSubmenus) {
+
+        nSubmenus = aSubmenus.length;
+
+        if (nSubmenus > 0) {
+        
+            i = nSubmenus - 1;
+            
+            do {
+    
+                oSubmenu = aSubmenus[i];
+                
+                oSubmenu.subscribe.apply(oSubmenu, arguments);
+    
+            }
+            while(i--);
+        
+        }
+    
+    }
+
+},
+
+
+/**
+* @description Initializes the class's configurable properties which can be
+* changed using the menu's Config object ("cfg").
+* @method initDefaultConfig
+*/
+initDefaultConfig: function () {
+
+    Menu.superclass.initDefaultConfig.call(this);
+
+    var oConfig = this.cfg;
+
+       // Add configuration attributes
+
+    /*
+        Change the default value for the "visible" configuration 
+        property to "false" by re-adding the property.
+    */
+
+    /**
+    * @config visible
+    * @description Boolean indicating whether or not the menu is visible.  If 
+    * the menu's "position" configuration property is set to "dynamic" (the 
+    * default), this property toggles the menu's <code>&#60;div&#62;</code> 
+    * element's "visibility" style property between "visible" (true) or 
+    * "hidden" (false).  If the menu's "position" configuration property is 
+    * set to "static" this property toggles the menu's 
+    * <code>&#60;div&#62;</code> element's "display" style property 
+    * between "block" (true) or "none" (false).
+    * @default false
+    * @type Boolean
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.VISIBLE.key, 
+        {
+            handler: this.configVisible, 
+            value: DEFAULT_CONFIG.VISIBLE.value, 
+            validator: DEFAULT_CONFIG.VISIBLE.validator
+         }
+     );
+
+
+    /*
+        Change the default value for the "constraintoviewport" configuration 
+        property to "true" by re-adding the property.
+    */
+
+    /**
+    * @config constraintoviewport
+    * @description Boolean indicating if the menu will try to remain inside 
+    * the boundaries of the size of viewport.
+    * @default true
+    * @type Boolean
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, 
+        {
+            handler: this.configConstrainToViewport, 
+            value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
+            validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
+            supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes 
+        } 
+    );
+
+
+    /**
+    * @config position
+    * @description String indicating how a menu should be positioned on the 
+    * screen.  Possible values are "static" and "dynamic."  Static menus are 
+    * visible by default and reside in the normal flow of the document 
+    * (CSS position: static).  Dynamic menus are hidden by default, reside 
+    * out of the normal flow of the document (CSS position: absolute), and 
+    * can overlay other elements on the screen.
+    * @default dynamic
+    * @type String
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.POSITION.key, 
+        {
+            handler: this.configPosition,
+            value: DEFAULT_CONFIG.POSITION.value, 
+            validator: DEFAULT_CONFIG.POSITION.validator,
+            supercedes: DEFAULT_CONFIG.POSITION.supercedes
+        }
+    );
+
+
+    /**
+    * @config submenualignment
+    * @description Array defining how submenus should be aligned to their 
+    * parent menu item. The format is: [itemCorner, submenuCorner]. By default
+    * a submenu's top left corner is aligned to its parent menu item's top 
+    * right corner.
+    * @default ["tl","tr"]
+    * @type Array
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key, 
+        { 
+            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value 
+        }
+    );
+
+
+    /**
+    * @config autosubmenudisplay
+    * @description Boolean indicating if submenus are automatically made 
+    * visible when the user mouses over the menu's items.
+    * @default true
+    * @type Boolean
+    */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key, 
+          { 
+              value: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value, 
+              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator
+       } 
+    );
+
+
+    /**
+    * @config showdelay
+    * @description Number indicating the time (in milliseconds) that should 
+    * expire before a submenu is made visible when the user mouses over 
+    * the menu's items.
+    * @default 250
+    * @type Number
+    */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.SHOW_DELAY.key, 
+          { 
+              value: DEFAULT_CONFIG.SHOW_DELAY.value, 
+              validator: DEFAULT_CONFIG.SHOW_DELAY.validator
+       } 
+    );
+
+
+    /**
+    * @config hidedelay
+    * @description Number indicating the time (in milliseconds) that should 
+    * expire before the menu is hidden.
+    * @default 0
+    * @type Number
+    */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.HIDE_DELAY.key, 
+          { 
+              handler: this.configHideDelay,
+              value: DEFAULT_CONFIG.HIDE_DELAY.value, 
+              validator: DEFAULT_CONFIG.HIDE_DELAY.validator, 
+              suppressEvent: DEFAULT_CONFIG.HIDE_DELAY.suppressEvent
+       } 
+    );
+
+
+    /**
+    * @config submenuhidedelay
+    * @description Number indicating the time (in milliseconds) that should 
+    * expire before a submenu is hidden when the user mouses out of a menu item 
+    * heading in the direction of a submenu.  The value must be greater than or 
+    * equal to the value specified for the "showdelay" configuration property.
+    * @default 250
+    * @type Number
+    */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.key, 
+          { 
+              value: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.value, 
+              validator: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.validator
+       } 
+    );
+
+
+    /**
+    * @config clicktohide
+    * @description Boolean indicating if the menu will automatically be 
+    * hidden if the user clicks outside of it.
+    * @default true
+    * @type Boolean
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.CLICK_TO_HIDE.key,
+        {
+            value: DEFAULT_CONFIG.CLICK_TO_HIDE.value,
+            validator: DEFAULT_CONFIG.CLICK_TO_HIDE.validator
+        }
+    );
+
+
+       /**
+       * @config container
+       * @description HTML element reference or string specifying the id 
+       * attribute of the HTML element that the menu's markup should be 
+       * rendered into.
+       * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+       * level-one-html.html#ID-58190037">HTMLElement</a>|String
+       * @default document.body
+       */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.CONTAINER.key, 
+          { 
+              handler: this.configContainer,
+              value: document.body
+       } 
+   );
+
+
+    /**
+    * @config maxheight
+    * @description Defines the maximum height (in pixels) for a menu before the
+    * contents of the body are scrolled.
+    * @default 0
+    * @type Number
+    */
+    oConfig.addProperty(
+       DEFAULT_CONFIG.MAX_HEIGHT.key, 
+       {
+            handler: this.configMaxHeight,
+            value: DEFAULT_CONFIG.MAX_HEIGHT.value,
+            validator: DEFAULT_CONFIG.MAX_HEIGHT.validator
+       } 
+    );
+
+
+    /**
+    * @config classname
+    * @description CSS class to be applied to the menu's root 
+    * <code>&#60;div&#62;</code> element.  The specified class(es) are 
+    * appended in addition to the default class as specified by the menu's
+    * CSS_CLASS_NAME constant.
+    * @default null
+    * @type String
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.CLASS_NAME.key, 
+        { 
+            handler: this.configClassName,
+            value: DEFAULT_CONFIG.CLASS_NAME.value, 
+            validator: DEFAULT_CONFIG.CLASS_NAME.validator
+        }
+    );
+
+
+    /**
+    * @config disabled
+    * @description Boolean indicating if the menu should be disabled.  
+    * Disabling a menu disables each of its items.  (Disabled menu items are 
+    * dimmed and will not respond to user input or fire events.)  Disabled
+    * menus have a corresponding "disabled" CSS class applied to their root
+    * <code>&#60;div&#62;</code> element.
+    * @default false
+    * @type Boolean
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.DISABLED.key, 
+        { 
+            handler: this.configDisabled,
+            value: DEFAULT_CONFIG.DISABLED.value, 
+            validator: DEFAULT_CONFIG.DISABLED.validator
+        }
+    );
+
+}
+
+}); // END YAHOO.lang.extend
+
+})();
+
+
+
+(function() {
+
+
+/**
+* Creates an item for a menu.
+* 
+* @param {String} p_oObject String specifying the text of the menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying 
+* the <code>&#60;li&#62;</code> element of the menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object 
+* specifying the <code>&#60;option&#62;</code> element of the menu item.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu item. See configuration class documentation 
+* for more details.
+* @class MenuItem
+* @constructor
+*/
+YAHOO.widget.MenuItem = function(p_oObject, p_oConfig) {
+
+    if(p_oObject) {
+
+        if(p_oConfig) {
+    
+            this.parent = p_oConfig.parent;
+            this.value = p_oConfig.value;
+            this.id = p_oConfig.id;
+
+        }
+
+        this.init(p_oObject, p_oConfig);
+
+    }
+
+};
+
+var Dom = YAHOO.util.Dom,
+    Module = YAHOO.widget.Module,
+    Menu = YAHOO.widget.Menu,
+    MenuItem = YAHOO.widget.MenuItem,
+    CustomEvent = YAHOO.util.CustomEvent,
+    Lang = YAHOO.lang,
+
+    m_oMenuItemTemplate,
+
+    /**
+    * Constant representing the name of the MenuItem's events
+    * @property EVENT_TYPES
+    * @private
+    * @final
+    * @type Object
+    */
+    EVENT_TYPES = {
+    
+        "MOUSE_OVER": "mouseover",
+        "MOUSE_OUT": "mouseout",
+        "MOUSE_DOWN": "mousedown",
+        "MOUSE_UP": "mouseup",
+        "CLICK": "click",
+        "KEY_PRESS": "keypress",
+        "KEY_DOWN": "keydown",
+        "KEY_UP": "keyup",
+        "ITEM_ADDED": "itemAdded",
+        "ITEM_REMOVED": "itemRemoved",
+        "FOCUS": "focus",
+        "BLUR": "blur",
+        "DESTROY": "destroy"
+    
+    },
+
+    /**
+    * Constant representing the MenuItem's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
+    * @final
+    * @type Object
+    */
+    DEFAULT_CONFIG = {
+    
+        "TEXT": { 
+            key: "text", 
+            value: "", 
+            validator: Lang.isString, 
+            suppressEvent: true 
+        }, 
+    
+        "HELP_TEXT": { 
+            key: "helptext",
+            supercedes: ["text"]
+        },
+    
+        "URL": { 
+            key: "url", 
+            value: "#", 
+            suppressEvent: true 
+        }, 
+    
+        "TARGET": { 
+            key: "target", 
+            suppressEvent: true 
+        }, 
+    
+        "EMPHASIS": { 
+            key: "emphasis", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true, 
+            supercedes: ["text"]
+        }, 
+    
+        "STRONG_EMPHASIS": { 
+            key: "strongemphasis", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true,
+            supercedes: ["text"]
+        },
+    
+        "CHECKED": { 
+            key: "checked", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true, 
+            supercedes: ["text"]
+        }, 
+    
+        "DISABLED": { 
+            key: "disabled", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true,
+            supercedes: ["text"]
+        },
+    
+        "SELECTED": { 
+            key: "selected", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true
+        },
+    
+        "SUBMENU": { 
+            key: "submenu",
+            supercedes: ["text"]
+        },
+    
+        "ONCLICK": { 
+            key: "onclick"
+        },
+    
+        "CLASS_NAME": { 
+            key: "classname", 
+            value: null, 
+            validator: Lang.isString
+        }
+    
+    };
+
+
+MenuItem.prototype = {
+
+    // Constants
+
+    /**
+    * @property COLLAPSED_SUBMENU_INDICATOR_TEXT
+    * @description String representing the text for the <code>&#60;em&#62;</code>
+    * element used for the submenu arrow indicator.
+    * @default "Submenu collapsed.  Click to expand submenu."
+    * @final
+    * @type String
+    */
+    COLLAPSED_SUBMENU_INDICATOR_TEXT: 
+        "Submenu collapsed.  Click to expand submenu.",
+
+
+    /**
+    * @property EXPANDED_SUBMENU_INDICATOR_TEXT
+    * @description String representing the text for the submenu arrow indicator 
+    * element (<code>&#60;em&#62;</code>) when the submenu is visible.
+    * @default "Submenu expanded.  Click to collapse submenu."
+    * @final
+    * @type String
+    */
+    EXPANDED_SUBMENU_INDICATOR_TEXT: 
+        "Submenu expanded.  Click to collapse submenu.",
+
+
+    /**
+    * @property DISABLED_SUBMENU_INDICATOR_TEXT
+    * @description String representing the text for the submenu arrow indicator 
+    * element (<code>&#60;em&#62;</code>) when the menu item is disabled.
+    * @default "Submenu collapsed.  (Item disabled.)."
+    * @final
+    * @type String
+    */
+    DISABLED_SUBMENU_INDICATOR_TEXT: "Submenu collapsed.  (Item disabled.)",
+
+
+    /**
+    * @property CHECKED_TEXT
+    * @description String representing the text to be used for the checked 
+    * indicator element (<code>&#60;em&#62;</code>).
+    * @default "Checked."
+    * @final
+    * @type String
+    */
+    CHECKED_TEXT: "Menu item checked.",
+    
+    
+    /**
+    * @property DISABLED_CHECKED_TEXT
+    * @description String representing the text to be used for the checked 
+    * indicator element (<code>&#60;em&#62;</code>) when the menu item 
+    * is disabled.
+    * @default "Checked. (Item disabled.)"
+    * @final
+    * @type String
+    */
+    DISABLED_CHECKED_TEXT: "Checked. (Item disabled.)",
+
+
+    /**
+    * @property CSS_CLASS_NAME
+    * @description String representing the CSS class(es) to be applied to the 
+    * <code>&#60;li&#62;</code> element of the menu item.
+    * @default "yuimenuitem"
+    * @final
+    * @type String
+    */
+    CSS_CLASS_NAME: "yuimenuitem",
+
+
+    /**
+    * @property CSS_LABEL_CLASS_NAME
+    * @description String representing the CSS class(es) to be applied to the 
+    * menu item's <code>&#60;a&#62;</code> element.
+    * @default "yuimenuitemlabel"
+    * @final
+    * @type String
+    */
+    CSS_LABEL_CLASS_NAME: "yuimenuitemlabel",
+
+
+    /**
+    * @property SUBMENU_TYPE
+    * @description Object representing the type of menu to instantiate and 
+    * add when parsing the child nodes of the menu item's source HTML element.
+    * @final
+    * @type YAHOO.widget.Menu
+    */
+    SUBMENU_TYPE: null,
+
+
+
+    // Private member variables
+    
+
+    /**
+    * @property _oAnchor
+    * @description Object reference to the menu item's 
+    * <code>&#60;a&#62;</code> element.
+    * @default null 
+    * @private
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-48250443">HTMLAnchorElement</a>
+    */
+    _oAnchor: null,
+    
+    
+    /**
+    * @property _oHelpTextEM
+    * @description Object reference to the menu item's help text 
+    * <code>&#60;em&#62;</code> element.
+    * @default null
+    * @private
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-58190037">HTMLElement</a>
+    */
+    _oHelpTextEM: null,
+    
+    
+    /**
+    * @property _oSubmenu
+    * @description Object reference to the menu item's submenu.
+    * @default null
+    * @private
+    * @type YAHOO.widget.Menu
+    */
+    _oSubmenu: null,
+    
+
+    /**
+    * @property _oCheckedIndicator
+    * @description Object reference to the menu item's checkmark image.
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-58190037">HTMLElement</a>
+    * @private
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-58190037">HTMLElement</a>
+    */
+    _oCheckedIndicator: null,
+
+
+    /** 
+    * @property _oOnclickAttributeValue
+    * @description Object reference to the menu item's current value for the 
+    * "onclick" configuration attribute.
+    * @default null
+    * @private
+    * @type Object
+    */
+    _oOnclickAttributeValue: null,
+
+
+    /**
+    * @property _sClassName
+    * @description The current value of the "classname" configuration attribute.
+    * @default null
+    * @private
+    * @type String
+    */
+    _sClassName: null,
+
+
+
+    // Public properties
+
+
+       /**
+    * @property constructor
+       * @description Object reference to the menu item's constructor function.
+    * @default YAHOO.widget.MenuItem
+       * @type YAHOO.widget.MenuItem
+       */
+       constructor: MenuItem,
+
+
+    /**
+    * @property index
+    * @description Number indicating the ordinal position of the menu item in 
+    * its group.
+    * @default null
+    * @type Number
+    */
+    index: null,
+
+
+    /**
+    * @property groupIndex
+    * @description Number indicating the index of the group to which the menu 
+    * item belongs.
+    * @default null
+    * @type Number
+    */
+    groupIndex: null,
+
+
+    /**
+    * @property parent
+    * @description Object reference to the menu item's parent menu.
+    * @default null
+    * @type YAHOO.widget.Menu
+    */
+    parent: null,
+
+
+    /**
+    * @property element
+    * @description Object reference to the menu item's 
+    * <code>&#60;li&#62;</code> element.
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level
+    * -one-html.html#ID-74680021">HTMLLIElement</a>
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-74680021">HTMLLIElement</a>
+    */
+    element: null,
+
+
+    /**
+    * @property srcElement
+    * @description Object reference to the HTML element (either 
+    * <code>&#60;li&#62;</code>, <code>&#60;optgroup&#62;</code> or 
+    * <code>&#60;option&#62;</code>) used create the menu item.
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www.
+    * w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247"
+    * >HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM-
+    * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a>
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-74680021">HTMLLIElement</a>|<a href="http://www.w3.
+    * org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-38450247">
+    * HTMLOptGroupElement</a>|<a href="http://www.w3.org/TR/2000/WD-DOM-
+    * Level-1-20000929/level-one-html.html#ID-70901257">HTMLOptionElement</a>
+    */
+    srcElement: null,
+
+
+    /**
+    * @property value
+    * @description Object reference to the menu item's value.
+    * @default null
+    * @type Object
+    */
+    value: null,
+
+
+    /**
+    * @property submenuIndicator
+    * @description Object reference to the <code>&#60;em&#62;</code> element 
+    * used to create the submenu indicator for the menu item.
+    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-58190037">HTMLElement</a>
+    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-58190037">HTMLElement</a>
+    */
+    submenuIndicator: null,
+
+
+       /**
+    * @property browser
+    * @deprecated Use YAHOO.env.ua
+       * @description String representing the browser.
+       * @type String
+       */
+       browser: Module.prototype.browser,
+
+
+    /**
+    * @property id
+    * @description Id of the menu item's root <code>&#60;li&#62;</code> 
+    * element.  This property should be set via the constructor using the 
+    * configuration object literal.  If an id is not specified, then one will 
+    * be created using the "generateId" method of the Dom utility.
+    * @default null
+    * @type String
+    */
+    id: null,
+
+
+
+    // Events
+
+
+    /**
+    * @event destroyEvent
+    * @description Fires when the menu item's <code>&#60;li&#62;</code> 
+    * element is removed from its parent <code>&#60;ul&#62;</code> element.
+    * @type YAHOO.util.CustomEvent
+    */
+    destroyEvent: null,
+
+
+    /**
+    * @event mouseOverEvent
+    * @description Fires when the mouse has entered the menu item.  Passes 
+    * back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    mouseOverEvent: null,
+
+
+    /**
+    * @event mouseOutEvent
+    * @description Fires when the mouse has left the menu item.  Passes back 
+    * the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    mouseOutEvent: null,
+
+
+    /**
+    * @event mouseDownEvent
+    * @description Fires when the user mouses down on the menu item.  Passes 
+    * back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    mouseDownEvent: null,
+
+
+    /**
+    * @event mouseUpEvent
+    * @description Fires when the user releases a mouse button while the mouse 
+    * is over the menu item.  Passes back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    mouseUpEvent: null,
+
+
+    /**
+    * @event clickEvent
+    * @description Fires when the user clicks the on the menu item.  Passes 
+    * back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    clickEvent: null,
+
+
+    /**
+    * @event keyPressEvent
+    * @description Fires when the user presses an alphanumeric key when the 
+    * menu item has focus.  Passes back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    keyPressEvent: null,
+
+
+    /**
+    * @event keyDownEvent
+    * @description Fires when the user presses a key when the menu item has 
+    * focus.  Passes back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    keyDownEvent: null,
+
+
+    /**
+    * @event keyUpEvent
+    * @description Fires when the user releases a key when the menu item has 
+    * focus.  Passes back the DOM Event object as an argument.
+    * @type YAHOO.util.CustomEvent
+    */
+    keyUpEvent: null,
+
+
+    /**
+    * @event focusEvent
+    * @description Fires when the menu item receives focus.
+    * @type YAHOO.util.CustomEvent
+    */
+    focusEvent: null,
+
+
+    /**
+    * @event blurEvent
+    * @description Fires when the menu item loses the input focus.
+    * @type YAHOO.util.CustomEvent
+    */
+    blurEvent: null,
+
+
+    /**
+    * @method init
+    * @description The MenuItem class's initialization method. This method is 
+    * automatically called by the constructor, and sets up all DOM references 
+    * for pre-existing markup, and creates required markup if it is not 
+    * already present.
+    * @param {String} p_oObject String specifying the text of the menu item.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying 
+    * the <code>&#60;li&#62;</code> element of the menu item.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+    * specifying the <code>&#60;optgroup&#62;</code> element of the menu item.
+    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+    * one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object 
+    * specifying the <code>&#60;option&#62;</code> element of the menu item.
+    * @param {Object} p_oConfig Optional. Object literal specifying the 
+    * configuration for the menu item. See configuration class documentation 
+    * for more details.
+    */
+    init: function(p_oObject, p_oConfig) {
+
+
+        if(!this.SUBMENU_TYPE) {
+    
+            this.SUBMENU_TYPE = Menu;
+    
+        }
+
+
+        // Create the config object
+
+        this.cfg = new YAHOO.util.Config(this);
+
+        this.initDefaultConfig();
+
+        var SIGNATURE = CustomEvent.LIST,
+            oConfig = this.cfg,
+            sURL = "#",
+            oAnchor,
+            sTarget,
+            sText,
+            sId;
+
+
+        if(Lang.isString(p_oObject)) {
+
+            this._createRootNodeStructure();
+
+            oConfig.queueProperty("text", p_oObject);
+
+        }
+        else if(p_oObject && p_oObject.tagName) {
+
+            switch(p_oObject.tagName.toUpperCase()) {
+
+                case "OPTION":
+
+                    this._createRootNodeStructure();
+
+                    oConfig.queueProperty("text", p_oObject.text);
+
+                    this.srcElement = p_oObject;
+
+                break;
+
+                case "OPTGROUP":
+
+                    this._createRootNodeStructure();
+
+                    oConfig.queueProperty("text", p_oObject.label);
+
+                    this.srcElement = p_oObject;
+
+                    this._initSubTree();
+
+                break;
+
+                case "LI":
+
+                    // Get the anchor node (if it exists)
+                    
+                    oAnchor = Dom.getFirstChild(p_oObject);
+
+
+                    // Capture the "text" and/or the "URL"
+
+                    if(oAnchor) {
+
+                        sURL = oAnchor.getAttribute("href");
+                        sTarget = oAnchor.getAttribute("target");
+                        sText = oAnchor.innerHTML;
+
+                    }
+
+                    this.srcElement = p_oObject;
+                    this.element = p_oObject;
+                    this._oAnchor = oAnchor;
+
+                    /*
+                        Set these properties silently to sync up the 
+                        configuration object without making changes to the 
+                        element's DOM
+                    */ 
+
+                    oConfig.setProperty("text", sText, true);
+                    oConfig.setProperty("url", sURL, true);
+                    oConfig.setProperty("target", sTarget, true);
+
+                    this._initSubTree();
+
+                break;
+
+            }            
+
+        }
+
+
+        if(this.element) {
+
+            sId = this.element.id;
+
+            if(!sId) {
+
+                sId = this.id || Dom.generateId();
+
+                this.element.id = sId;
+
+            }
+
+            this.id = sId;
+
+
+            Dom.addClass(this.element, this.CSS_CLASS_NAME);
+            Dom.addClass(this._oAnchor, this.CSS_LABEL_CLASS_NAME);
+
+
+            // Create custom events
+
+            this.mouseOverEvent = this.createEvent(EVENT_TYPES.MOUSE_OVER);
+            this.mouseOverEvent.signature = SIGNATURE;
+
+            this.mouseOutEvent = this.createEvent(EVENT_TYPES.MOUSE_OUT);
+            this.mouseOutEvent.signature = SIGNATURE;
+
+            this.mouseDownEvent = this.createEvent(EVENT_TYPES.MOUSE_DOWN);
+            this.mouseDownEvent.signature = SIGNATURE;
+
+            this.mouseUpEvent = this.createEvent(EVENT_TYPES.MOUSE_UP);
+            this.mouseUpEvent.signature = SIGNATURE;
+
+            this.clickEvent = this.createEvent(EVENT_TYPES.CLICK);
+            this.clickEvent.signature = SIGNATURE;
+
+            this.keyPressEvent = this.createEvent(EVENT_TYPES.KEY_PRESS);
+            this.keyPressEvent.signature = SIGNATURE;
+
+            this.keyDownEvent = this.createEvent(EVENT_TYPES.KEY_DOWN);
+            this.keyDownEvent.signature = SIGNATURE;
+
+            this.keyUpEvent = this.createEvent(EVENT_TYPES.KEY_UP);
+            this.keyUpEvent.signature = SIGNATURE;
+
+            this.focusEvent = this.createEvent(EVENT_TYPES.FOCUS);
+            this.focusEvent.signature = SIGNATURE;
+
+            this.blurEvent = this.createEvent(EVENT_TYPES.BLUR);
+            this.blurEvent.signature = SIGNATURE;
+
+            this.destroyEvent = this.createEvent(EVENT_TYPES.DESTROY);
+            this.destroyEvent.signature = SIGNATURE;
+
+            if(p_oConfig) {
+    
+                oConfig.applyConfig(p_oConfig);
+    
+            }        
+
+            oConfig.fireQueue();
+
+        }
+
+    },
+
+
+
+    // Private methods
+
+
+    /**
+    * @method _createRootNodeStructure
+    * @description Creates the core DOM structure for the menu item.
+    * @private
+    */
+    _createRootNodeStructure: function () {
+
+        var oElement,
+            oAnchor;
+
+        if(!m_oMenuItemTemplate) {
+
+            m_oMenuItemTemplate = document.createElement("li");
+            m_oMenuItemTemplate.innerHTML = "<a href=\"#\"></a>";
+
+        }
+
+        oElement = m_oMenuItemTemplate.cloneNode(true);
+        oElement.className = this.CSS_CLASS_NAME;
+
+        oAnchor = oElement.firstChild;
+        oAnchor.className = this.CSS_LABEL_CLASS_NAME;
+        
+        this.element = oElement;
+        this._oAnchor = oAnchor;
+
+    },
+
+
+    /**
+    * @method _initSubTree
+    * @description Iterates the source element's childNodes collection and uses 
+    * the child nodes to instantiate other menus.
+    * @private
+    */
+    _initSubTree: function() {
+
+        var oSrcEl = this.srcElement,
+            oConfig = this.cfg,
+            oNode,
+            aOptions,
+            nOptions,
+            oMenu,
+            n;
+
+
+        if(oSrcEl.childNodes.length > 0) {
+
+            if(this.parent.lazyLoad && this.parent.srcElement && 
+                this.parent.srcElement.tagName.toUpperCase() == "SELECT") {
+
+                oConfig.setProperty(
+                        "submenu", 
+                        { id: Dom.generateId(), itemdata: oSrcEl.childNodes }
+                    );
+
+            }
+            else {
+
+                oNode = oSrcEl.firstChild;
+                aOptions = [];
+    
+                do {
+    
+                    if(oNode && oNode.tagName) {
+    
+                        switch(oNode.tagName.toUpperCase()) {
+                
+                            case "DIV":
+                
+                                oConfig.setProperty("submenu", oNode);
+                
+                            break;
+         
+                            case "OPTION":
+        
+                                aOptions[aOptions.length] = oNode;
+        
+                            break;
+               
+                        }
+                    
+                    }
+                
+                }        
+                while((oNode = oNode.nextSibling));
+    
+    
+                nOptions = aOptions.length;
+    
+                if(nOptions > 0) {
+    
+                    oMenu = new this.SUBMENU_TYPE(Dom.generateId());
+                    
+                    oConfig.setProperty("submenu", oMenu);
+    
+                    for(n=0; n<nOptions; n++) {
+        
+                        oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n])));
+        
+                    }
+        
+                }
+            
+            }
+
+        }
+
+    },
+
+
+
+    // Event handlers for configuration properties
+
+
+    /**
+    * @method configText
+    * @description Event handler for when the "text" configuration property of 
+    * the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */
+    configText: function(p_sType, p_aArgs, p_oItem) {
+
+        var sText = p_aArgs[0],
+            oConfig = this.cfg,
+            oAnchor = this._oAnchor,
+            sHelpText = oConfig.getProperty("helptext"),
+            sHelpTextHTML = "",
+            sCheckHTML = "",
+            oSubmenu = oConfig.getProperty("submenu"),
+            sSubmenuIndicatorHTML = "",
+            sEmphasisStartTag = "",
+            sEmphasisEndTag = "";
+
+
+        if (sText) {
+
+
+            if (sHelpText) {
+                    
+                sHelpTextHTML = "<em class=\"helptext\">" + sHelpText + "</em>";
+            
+            }
+
+
+            if (oConfig.getProperty("checked")) {
+
+                sCheckHTML = "<em class=\"checkedindicator\">" + 
+                    this.CHECKED_TEXT + "</em>";
+            
+            }
+            
+            
+            if (oSubmenu) {
+
+                sSubmenuIndicatorHTML =  "<em class=\"submenuindicator\">" + 
+                    ((oSubmenu instanceof Menu && 
+                    oSubmenu.cfg.getProperty("visible")) ? 
+                    this.EXPANDED_SUBMENU_INDICATOR_TEXT : 
+                    this.COLLAPSED_SUBMENU_INDICATOR_TEXT) + "</em>";
+            
+            }
+            
+
+            if (oConfig.getProperty("emphasis")) {
+
+                sEmphasisStartTag = "<em>";
+                sEmphasisEndTag = "</em>";
+
+            }
+
+
+            if (oConfig.getProperty("strongemphasis")) {
+
+                sEmphasisStartTag = "<strong>";
+                sEmphasisEndTag = "</strong>";
+            
+            }
+
+
+            oAnchor.innerHTML = (sEmphasisStartTag + sText + 
+                sEmphasisEndTag + sHelpTextHTML + 
+                sCheckHTML + sSubmenuIndicatorHTML);
+
+
+            if (oSubmenu) {
+
+                this.submenuIndicator = oAnchor.lastChild;
+            
+            }
+
+        }
+
+    },
+
+
+    /**
+    * @method configHelpText
+    * @description Event handler for when the "helptext" configuration property 
+    * of the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configHelpText: function(p_sType, p_aArgs, p_oItem) {
+
+        var sHelpText = p_aArgs[0],
+            oAnchor = this._oAnchor;
+
+        if (sHelpText) {
+
+            Dom.addClass(oAnchor, "hashelptext");
+
+        }
+        else {
+
+            Dom.removeClass(oAnchor, "hashelptext");
+        
+        }
+
+        this.cfg.refireEvent("text");
+
+    },
+
+
+    /**
+    * @method configURL
+    * @description Event handler for when the "url" configuration property of 
+    * the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configURL: function(p_sType, p_aArgs, p_oItem) {
+
+        var sURL = p_aArgs[0];
+
+        if(!sURL) {
+
+            sURL = "#";
+
+        }
+
+        this._oAnchor.setAttribute("href", sURL);
+
+    },
+
+
+    /**
+    * @method configTarget
+    * @description Event handler for when the "target" configuration property 
+    * of the menu item changes.  
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configTarget: function(p_sType, p_aArgs, p_oItem) {
+
+        var sTarget = p_aArgs[0],
+            oAnchor = this._oAnchor;
+
+        if(sTarget && sTarget.length > 0) {
+
+            oAnchor.setAttribute("target", sTarget);
+
+        }
+        else {
+
+            oAnchor.removeAttribute("target");
+        
+        }
+
+    },
+
+
+    /**
+    * @method configEmphasis
+    * @description Event handler for when the "emphasis" configuration property
+    * of the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configEmphasis: function(p_sType, p_aArgs, p_oItem) {
+
+        var bEmphasis = p_aArgs[0],
+            oConfig = this.cfg;
+
+
+        if(bEmphasis && oConfig.getProperty("strongemphasis")) {
+
+            oConfig.setProperty("strongemphasis", false);
+
+        }
+
+
+        oConfig.refireEvent("text");
+
+    },
+
+
+    /**
+    * @method configStrongEmphasis
+    * @description Event handler for when the "strongemphasis" configuration 
+    * property of the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configStrongEmphasis: function(p_sType, p_aArgs, p_oItem) {
+
+        var bStrongEmphasis = p_aArgs[0],
+            oConfig = this.cfg;
+
+
+        if(bStrongEmphasis && oConfig.getProperty("emphasis")) {
+
+            oConfig.setProperty("emphasis", false);
+
+        }
+
+        oConfig.refireEvent("text");
+
+    },
+
+
+    /**
+    * @method configChecked
+    * @description Event handler for when the "checked" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configChecked: function(p_sType, p_aArgs, p_oItem) {
+
+        var bChecked = p_aArgs[0],
+            oAnchor = this._oAnchor;
+
+        if (bChecked) {
+
+            Dom.addClass(oAnchor, "checked");
+
+        }
+        else {
+
+            Dom.removeClass(oAnchor, "checked");
+        
+        }
+
+        this.cfg.refireEvent("text");
+
+    },
+
+
+
+    /**
+    * @method configDisabled
+    * @description Event handler for when the "disabled" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configDisabled: function(p_sType, p_aArgs, p_oItem) {
+
+        var bDisabled = p_aArgs[0],
+            oConfig = this.cfg,
+            oAnchor = this._oAnchor;
+
+
+        if(bDisabled) {
+
+            if(oConfig.getProperty("selected")) {
+
+                oConfig.setProperty("selected", false);
+
+            }
+
+            oAnchor.removeAttribute("href");
+
+            Dom.addClass(oAnchor, "disabled");
+
+        }
+        else {
+
+            oAnchor.setAttribute("href", oConfig.getProperty("url"));
+
+            Dom.removeClass(oAnchor, "disabled");
+
+        }
+
+    },
+
+
+    /**
+    * @method configSelected
+    * @description Event handler for when the "selected" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configSelected: function(p_sType, p_aArgs, p_oItem) {
+
+        var bSelected,
+            oAnchor;
+
+        if(!this.cfg.getProperty("disabled")) {
+
+            bSelected = p_aArgs[0];
+            oAnchor = this._oAnchor;
+
+
+            if(bSelected) {
+    
+                Dom.addClass(oAnchor, "selected");
+    
+            }
+            else {
+    
+                Dom.removeClass(oAnchor, "selected");
+    
+            }
+
+        }
+
+    },
+
+
+    /**
+    * @method configSubmenu
+    * @description Event handler for when the "submenu" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */
+    configSubmenu: function(p_sType, p_aArgs, p_oItem) {
+
+        var oAnchor = this._oAnchor,
+            oSubmenu = p_aArgs[0],
+            oSubmenuIndicator = this.submenuIndicator,
+            oConfig = this.cfg,
+            bLazyLoad = this.parent && this.parent.lazyLoad,
+            oMenu,
+            sSubmenuId,
+            oSubmenuConfig;
+
+
+        if(oSubmenu) {
+
+            if(oSubmenu instanceof Menu) {
+
+                oMenu = oSubmenu;
+                oMenu.parent = this;
+                oMenu.lazyLoad = bLazyLoad;
+
+            }
+            else if(typeof oSubmenu == "object" && oSubmenu.id && 
+                !oSubmenu.nodeType) {
+
+                sSubmenuId = oSubmenu.id;
+                oSubmenuConfig = oSubmenu;
+
+                oSubmenuConfig.lazyload = bLazyLoad;
+                oSubmenuConfig.parent = this;
+
+                oMenu = new this.SUBMENU_TYPE(sSubmenuId, oSubmenuConfig);
+
+
+                // Set the value of the property to the Menu instance
+
+                this.cfg.setProperty("submenu", oMenu, true);
+
+            }
+            else {
+
+                oMenu = new this.SUBMENU_TYPE(oSubmenu,
+                                { lazyload: bLazyLoad, parent: this });
+
+
+                // Set the value of the property to the Menu instance
+                
+                this.cfg.setProperty("submenu", oMenu, true);
+
+            }
+
+
+            if(oMenu) {
+
+                Dom.addClass(oAnchor, "hassubmenu");
+
+                this._oSubmenu = oMenu;
+            
+            }
+
+        }
+        else {
+
+            Dom.removeClass(oAnchor, "hassubmenu");
+
+            if(oSubmenuIndicator) {
+
+                oAnchor.removeChild(oSubmenuIndicator);
+
+            }
+
+            if(this._oSubmenu) {
+
+                this._oSubmenu.destroy();
+
+            }
+
+        }
+        
+        oConfig.refireEvent("text");
+
+    },
+
+
+    /**
+    * @method configOnClick
+    * @description Event handler for when the "onclick" configuration property 
+    * of the menu item changes. 
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */
+    configOnClick: function(p_sType, p_aArgs, p_oItem) {
+
+        var oObject = p_aArgs[0];
+
+        /*
+            Remove any existing listeners if a "click" event handler has 
+            already been specified.
+        */
+
+        if(this._oOnclickAttributeValue && 
+            (this._oOnclickAttributeValue != oObject)) {
+
+            this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn, 
+                                this._oOnclickAttributeValue.obj);
+
+            this._oOnclickAttributeValue = null;
+
+        }
+
+
+        if(!this._oOnclickAttributeValue && typeof oObject == "object" && 
+            typeof oObject.fn == "function") {
+            
+            this.clickEvent.subscribe(oObject.fn, 
+                ((!YAHOO.lang.isUndefined(oObject.obj)) ? oObject.obj : this), 
+                oObject.scope);
+
+            this._oOnclickAttributeValue = oObject;
+
+        }
+    
+    },
+
+
+    /**
+    * @method configClassName
+    * @description Event handler for when the "classname" configuration 
+    * property of a menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */
+    configClassName: function(p_sType, p_aArgs, p_oItem) {
+    
+        var sClassName = p_aArgs[0];
+    
+        if(this._sClassName) {
+    
+            Dom.removeClass(this.element, this._sClassName);
+    
+        }
+    
+        Dom.addClass(this.element, sClassName);
+        this._sClassName = sClassName;
+    
+    },
+
+
+
+    // Public methods
+
+
+       /**
+    * @method initDefaultConfig
+       * @description Initializes an item's configurable properties.
+       */
+       initDefaultConfig : function() {
+
+        var oConfig = this.cfg;
+
+
+        // Define the configuration attributes
+
+        /**
+        * @config text
+        * @description String specifying the text label for the menu item.  
+        * When building a menu from existing HTML the value of this property
+        * will be interpreted from the menu's markup.
+        * @default ""
+        * @type String
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.TEXT.key, 
+            { 
+                handler: this.configText, 
+                value: DEFAULT_CONFIG.TEXT.value, 
+                validator: DEFAULT_CONFIG.TEXT.validator, 
+                suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent 
+            }
+        );
+        
+
+        /**
+        * @config helptext
+        * @description String specifying additional instructional text to 
+        * accompany the text for the menu item.
+        * @deprecated Use "text" configuration property to add help text markup.  
+        * For example: <code>oMenuItem.cfg.setProperty("text", "Copy &#60;em 
+        * class=\"helptext\"&#62;Ctrl + C&#60;/em&#60;");</code>
+        * @default null
+        * @type String|<a href="http://www.w3.org/TR/
+        * 2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037">
+        * HTMLElement</a>
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.HELP_TEXT.key,
+            { handler: this.configHelpText }
+        );
+
+
+        /**
+        * @config url
+        * @description String specifying the URL for the menu item's anchor's 
+        * "href" attribute.  When building a menu from existing HTML the value 
+        * of this property will be interpreted from the menu's markup.
+        * @default "#"
+        * @type String
+        */        
+        oConfig.addProperty(
+            DEFAULT_CONFIG.URL.key, 
+            {
+                handler: this.configURL, 
+                value: DEFAULT_CONFIG.URL.value, 
+                suppressEvent: DEFAULT_CONFIG.URL.suppressEvent
+            }
+        );
+
+
+        /**
+        * @config target
+        * @description String specifying the value for the "target" attribute 
+        * of the menu item's anchor element. <strong>Specifying a target will 
+        * require the user to click directly on the menu item's anchor node in
+        * order to cause the browser to navigate to the specified URL.</strong> 
+        * When building a menu from existing HTML the value of this property 
+        * will be interpreted from the menu's markup.
+        * @default null
+        * @type String
+        */        
+        oConfig.addProperty(
+            DEFAULT_CONFIG.TARGET.key, 
+            {
+                handler: this.configTarget, 
+                suppressEvent: DEFAULT_CONFIG.TARGET.suppressEvent
+            }
+        );
+
+
+        /**
+        * @config emphasis
+        * @description Boolean indicating if the text of the menu item will be 
+        * rendered with emphasis.
+        * @deprecated Use "text" configuration property to add emphasis.  
+        * For example: <code>oMenuItem.cfg.setProperty("text", "&#60;em&#62;Some 
+        * Text&#60;/em&#60;");</code>
+        * @default false
+        * @type Boolean
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.EMPHASIS.key, 
+            { 
+                handler: this.configEmphasis, 
+                value: DEFAULT_CONFIG.EMPHASIS.value, 
+                validator: DEFAULT_CONFIG.EMPHASIS.validator, 
+                suppressEvent: DEFAULT_CONFIG.EMPHASIS.suppressEvent 
+            }
+        );
+
+
+        /**
+        * @config strongemphasis
+        * @description Boolean indicating if the text of the menu item will be 
+        * rendered with strong emphasis.
+        * @deprecated Use "text" configuration property to add strong emphasis.  
+        * For example: <code>oMenuItem.cfg.setProperty("text", "&#60;strong&#62; 
+        * Some Text&#60;/strong&#60;");</code>
+        * @default false
+        * @type Boolean
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.STRONG_EMPHASIS.key,
+            {
+                handler: this.configStrongEmphasis,
+                value: DEFAULT_CONFIG.STRONG_EMPHASIS.value,
+                validator: DEFAULT_CONFIG.STRONG_EMPHASIS.validator,
+                suppressEvent: DEFAULT_CONFIG.STRONG_EMPHASIS.suppressEvent
+            }
+        );
+
+
+        /**
+        * @config checked
+        * @description Boolean indicating if the menu item should be rendered 
+        * with a checkmark.
+        * @default false
+        * @type Boolean
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.CHECKED.key, 
+            {
+                handler: this.configChecked, 
+                value: DEFAULT_CONFIG.CHECKED.value, 
+                validator: DEFAULT_CONFIG.CHECKED.validator, 
+                suppressEvent: DEFAULT_CONFIG.CHECKED.suppressEvent,
+                supercedes: DEFAULT_CONFIG.CHECKED.supercedes
+            } 
+        );
+
+
+        /**
+        * @config disabled
+        * @description Boolean indicating if the menu item should be disabled.  
+        * (Disabled menu items are  dimmed and will not respond to user input 
+        * or fire events.)
+        * @default false
+        * @type Boolean
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.DISABLED.key,
+            {
+                handler: this.configDisabled,
+                value: DEFAULT_CONFIG.DISABLED.value,
+                validator: DEFAULT_CONFIG.DISABLED.validator,
+                suppressEvent: DEFAULT_CONFIG.DISABLED.suppressEvent
+            }
+        );
+
+
+        /**
+        * @config selected
+        * @description Boolean indicating if the menu item should 
+        * be highlighted.
+        * @default false
+        * @type Boolean
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.SELECTED.key,
+            {
+                handler: this.configSelected,
+                value: DEFAULT_CONFIG.SELECTED.value,
+                validator: DEFAULT_CONFIG.SELECTED.validator,
+                suppressEvent: DEFAULT_CONFIG.SELECTED.suppressEvent
+            }
+        );
+
+
+        /**
+        * @config submenu
+        * @description Object specifying the submenu to be appended to the 
+        * menu item.  The value can be one of the following: <ul><li>Object 
+        * specifying a Menu instance.</li><li>Object literal specifying the
+        * menu to be created.  Format: <code>{ id: [menu id], itemdata: 
+        * [<a href="YAHOO.widget.Menu.html#itemData">array of values for 
+        * items</a>] }</code>.</li><li>String specifying the id attribute 
+        * of the <code>&#60;div&#62;</code> element of the menu.</li><li>
+        * Object specifying the <code>&#60;div&#62;</code> element of the 
+        * menu.</li></ul>
+        * @default null
+        * @type Menu|String|Object|<a href="http://www.w3.org/TR/2000/
+        * WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037">
+        * HTMLElement</a>
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.SUBMENU.key, 
+            { handler: this.configSubmenu }
+        );
+
+
+        /**
+        * @config onclick
+        * @description Object literal representing the code to be executed when 
+        * the item is clicked.  Format:<br> <code> {<br> 
+        * <strong>fn:</strong> Function,   &#47;&#47; The handler to call when 
+        * the event fires.<br> <strong>obj:</strong> Object, &#47;&#47; An 
+        * object to  pass back to the handler.<br> <strong>scope:</strong> 
+        * Object &#47;&#47; The object to use for the scope of the handler.
+        * <br> } </code>
+        * @type Object
+        * @default null
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.ONCLICK.key, 
+            { handler: this.configOnClick }
+        );
+
+
+        /**
+        * @config classname
+        * @description CSS class to be applied to the menu item's root 
+        * <code>&#60;li&#62;</code> element.  The specified class(es) are 
+        * appended in addition to the default class as specified by the menu 
+        * item's CSS_CLASS_NAME constant.
+        * @default null
+        * @type String
+        */
+        oConfig.addProperty(
+            DEFAULT_CONFIG.CLASS_NAME.key, 
+            { 
+                handler: this.configClassName,
+                value: DEFAULT_CONFIG.CLASS_NAME.value, 
+                validator: DEFAULT_CONFIG.CLASS_NAME.validator
+            }
+        );
+
+       },
+
+
+    /**
+    * @method getNextEnabledSibling
+    * @description Finds the menu item's next enabled sibling.
+    * @return YAHOO.widget.MenuItem
+    */
+    getNextEnabledSibling: function() {
+
+        var nGroupIndex,
+            aItemGroups,
+            oNextItem,
+            nNextGroupIndex,
+            aNextGroup;
+
+        function getNextArrayItem(p_aArray, p_nStartIndex) {
+
+            return p_aArray[p_nStartIndex] || 
+                getNextArrayItem(p_aArray, (p_nStartIndex+1));
+
+        }
+
+        if(this.parent instanceof Menu) {
+
+            nGroupIndex = this.groupIndex;
+    
+            aItemGroups = this.parent.getItemGroups();
+    
+            if(this.index < (aItemGroups[nGroupIndex].length - 1)) {
+    
+                oNextItem = getNextArrayItem(aItemGroups[nGroupIndex], 
+                        (this.index+1));
+    
+            }
+            else {
+    
+                if(nGroupIndex < (aItemGroups.length - 1)) {
+    
+                    nNextGroupIndex = nGroupIndex + 1;
+    
+                }
+                else {
+    
+                    nNextGroupIndex = 0;
+    
+                }
+    
+                aNextGroup = getNextArrayItem(aItemGroups, nNextGroupIndex);
+    
+                // Retrieve the first menu item in the next group
+    
+                oNextItem = getNextArrayItem(aNextGroup, 0);
+    
+            }
+    
+            return (oNextItem.cfg.getProperty("disabled") || 
+                oNextItem.element.style.display == "none") ? 
+                oNextItem.getNextEnabledSibling() : oNextItem;
+
+        }
+
+    },
+
+
+    /**
+    * @method getPreviousEnabledSibling
+    * @description Finds the menu item's previous enabled sibling.
+    * @return {YAHOO.widget.MenuItem}
+    */
+    getPreviousEnabledSibling: function() {
+
+        var nGroupIndex,
+            aItemGroups,
+            oPreviousItem,
+            nPreviousGroupIndex,
+            aPreviousGroup;
+
+        function getPreviousArrayItem(p_aArray, p_nStartIndex) {
+
+            return p_aArray[p_nStartIndex] ||  
+                getPreviousArrayItem(p_aArray, (p_nStartIndex-1));
+
+        }
+
+        function getFirstItemIndex(p_aArray, p_nStartIndex) {
+
+            return p_aArray[p_nStartIndex] ? p_nStartIndex : 
+                getFirstItemIndex(p_aArray, (p_nStartIndex+1));
+
+        }
+
+       if(this.parent instanceof Menu) {
+
+            nGroupIndex = this.groupIndex;
+            aItemGroups = this.parent.getItemGroups();
+
+    
+            if(this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)) {
+    
+                oPreviousItem = getPreviousArrayItem(aItemGroups[nGroupIndex], 
+                        (this.index-1));
+    
+            }
+            else {
+    
+                if(nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {
+    
+                    nPreviousGroupIndex = nGroupIndex - 1;
+    
+                }
+                else {
+    
+                    nPreviousGroupIndex = aItemGroups.length - 1;
+    
+                }
+    
+                aPreviousGroup = getPreviousArrayItem(aItemGroups, 
+                    nPreviousGroupIndex);
+    
+                oPreviousItem = getPreviousArrayItem(aPreviousGroup, 
+                        (aPreviousGroup.length - 1));
+    
+            }
+
+            return (oPreviousItem.cfg.getProperty("disabled") || 
+                oPreviousItem.element.style.display == "none") ? 
+                oPreviousItem.getPreviousEnabledSibling() : oPreviousItem;
+
+        }
+
+    },
+
+
+    /**
+    * @method focus
+    * @description Causes the menu item to receive the focus and fires the 
+    * focus event.
+    */
+    focus: function() {
+
+        var oParent = this.parent,
+            oAnchor = this._oAnchor,
+            oActiveItem = oParent.activeItem,
+            me = this;
+
+
+        function setFocus() {
+
+            try {
+
+                if (YAHOO.env.ua.ie && !document.hasFocus()) {
+                
+                    return;
+                
+                }
+
+                oAnchor.focus();
+
+            }
+            catch(e) {
+            
+            }
+
+        }
+
+
+        if(!this.cfg.getProperty("disabled") && oParent && 
+            oParent.cfg.getProperty("visible") && 
+            this.element.style.display != "none") {
+
+            if(oActiveItem) {
+
+                oActiveItem.blur();
+
+            }
+
+
+            /*
+                Setting focus via a timer fixes a race condition in Firefox, IE 
+                and Opera where the browser viewport jumps as it trys to 
+                position and focus the menu.
+            */
+
+            window.setTimeout(setFocus, 0);
+            
+            this.focusEvent.fire();
+
+        }
+
+    },
+
+
+    /**
+    * @method blur
+    * @description Causes the menu item to lose focus and fires the 
+    * blur event.
+    */    
+    blur: function() {
+
+        var oParent = this.parent;
+
+        if(!this.cfg.getProperty("disabled") && oParent && 
+            oParent.cfg.getProperty("visible")) {
+
+            this._oAnchor.blur();
+
+            this.blurEvent.fire();
+
+        }
+
+    },
+
+
+    /**
+    * @method hasFocus
+    * @description Returns a boolean indicating whether or not the menu item
+    * has focus.
+    * @return {Boolean}
+    */
+    hasFocus: function() {
+    
+        return (YAHOO.widget.MenuManager.getFocusedMenuItem() == this);
+    
+    },
+
+
+       /**
+    * @method destroy
+       * @description Removes the menu item's <code>&#60;li&#62;</code> element 
+       * from its parent <code>&#60;ul&#62;</code> element.
+       */
+    destroy: function() {
+
+        var oEl = this.element,
+            oSubmenu,
+            oParentNode;
+
+        if(oEl) {
+
+
+            // If the item has a submenu, destroy it first
+
+            oSubmenu = this.cfg.getProperty("submenu");
+
+            if(oSubmenu) {
+            
+                oSubmenu.destroy();
+            
+            }
+
+
+            // Remove CustomEvent listeners
+    
+            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();
+
+
+            // Remove the element from the parent node
+
+            oParentNode = oEl.parentNode;
+
+            if(oParentNode) {
+
+                oParentNode.removeChild(oEl);
+
+                this.destroyEvent.fire();
+
+            }
+
+            this.destroyEvent.unsubscribeAll();
+
+        }
+
+    },
+
+
+    /**
+    * @method toString
+    * @description Returns a string representing the menu item.
+    * @return {String}
+    */
+    toString: function() {
+
+        var sReturnVal = "MenuItem",
+            sId = this.id;
+
+        if(sId) {
+    
+            sReturnVal += (" " + sId);
+        
+        }
+
+        return sReturnVal;
+    
+    }
+
+};
+
+Lang.augmentProto(MenuItem, YAHOO.util.EventProvider);
+
+})();
+(function () {
+
+
+/**
+* Creates a list of options or commands which are made visible in response to 
+* an HTML element's "contextmenu" event ("mousedown" for Opera).
+*
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the context menu.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source for the 
+* context menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-
+* html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying the 
+* <code>&#60;div&#62;</code> element of the context menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-
+* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying 
+* the <code>&#60;select&#62;</code> element to be used as the data source for 
+* the context menu.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the context menu. See configuration class documentation 
+* for more details.
+* @class ContextMenu
+* @constructor
+* @extends YAHOO.widget.Menu
+* @namespace YAHOO.widget
+*/
+YAHOO.widget.ContextMenu = function(p_oElement, p_oConfig) {
+
+    YAHOO.widget.ContextMenu.superclass.constructor.call(this, 
+            p_oElement, p_oConfig);
+
+};
+
+var Event = YAHOO.util.Event,
+    ContextMenu = YAHOO.widget.ContextMenu,
+
+/**
+* Constant representing the name of the ContextMenu's events
+* @property EVENT_TYPES
+* @private
+* @final
+* @type Object
+*/
+    EVENT_TYPES = {
+
+        "TRIGGER_CONTEXT_MENU": "triggerContextMenu",
+        "CONTEXT_MENU": (YAHOO.env.ua.opera ? "mousedown" : "contextmenu"),
+        "CLICK": "click"
+
+    },
+    
+    
+    /**
+    * Constant representing the ContextMenu's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
+    * @final
+    * @type Object
+    */
+    DEFAULT_CONFIG = {
+    
+        "TRIGGER": { 
+            key: "trigger" 
+        }
+    
+    };
+
+
+YAHOO.lang.extend(ContextMenu, YAHOO.widget.Menu, {
+
+
+
+// Private properties
+
+
+/**
+* @property _oTrigger
+* @description Object reference to the current value of the "trigger" 
+* configuration property.
+* @default null
+* @private
+* @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/leve
+* l-one-html.html#ID-58190037">HTMLElement</a>|Array
+*/
+_oTrigger: null,
+
+
+/**
+* @property _bCancelled
+* @description Boolean indicating if the display of the context menu should 
+* be cancelled.
+* @default false
+* @private
+* @type Boolean
+*/
+_bCancelled: false,
+
+
+
+// Public properties
+
+
+/**
+* @property contextEventTarget
+* @description Object reference for the HTML element that was the target of the
+* "contextmenu" DOM event ("mousedown" for Opera) that triggered the display of 
+* the context menu.
+* @default null
+* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-
+* html.html#ID-58190037">HTMLElement</a>
+*/
+contextEventTarget: null,
+
+
+
+// Events
+
+
+/**
+* @event triggerContextMenuEvent
+* @description Custom Event wrapper for the "contextmenu" DOM event 
+* ("mousedown" for Opera) fired by the element(s) that trigger the display of 
+* the context menu.
+*/
+triggerContextMenuEvent: null,
+
+
+
+/**
+* @method init
+* @description The ContextMenu class's initialization method. This method is 
+* automatically called by the constructor, and sets up all DOM references for 
+* pre-existing markup, and creates required markup if it is not already present.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the context menu.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source for 
+* the context menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-
+* html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying the 
+* <code>&#60;div&#62;</code> element of the context menu.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-
+* html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object specifying 
+* the <code>&#60;select&#62;</code> element to be used as the data source for 
+* the context menu.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the context menu. See configuration class documentation 
+* for more details.
+*/
+init: function(p_oElement, p_oConfig) {
+
+    if(!this.ITEM_TYPE) {
+
+        this.ITEM_TYPE = YAHOO.widget.ContextMenuItem;
+
+    }
+
+
+    // Call the init of the superclass (YAHOO.widget.Menu)
+
+    ContextMenu.superclass.init.call(this, p_oElement);
+
+
+    this.beforeInitEvent.fire(ContextMenu);
+
+
+    if(p_oConfig) {
+
+        this.cfg.applyConfig(p_oConfig, true);
+
+    }
+    
+    
+    this.initEvent.fire(ContextMenu);
+    
+},
+
+
+/**
+* @method initEvents
+* @description Initializes the custom events for the context menu.
+*/
+initEvents: function() {
+
+       ContextMenu.superclass.initEvents.call(this);
+
+    // Create custom events
+
+    this.triggerContextMenuEvent = 
+        this.createEvent(EVENT_TYPES.TRIGGER_CONTEXT_MENU);
+
+    this.triggerContextMenuEvent.signature = YAHOO.util.CustomEvent.LIST;
+
+},
+
+
+/**
+* @method cancel
+* @description Cancels the display of the context menu.
+*/
+cancel: function() {
+
+    this._bCancelled = true;
+
+},
+
+
+
+// Private methods
+
+
+/**
+* @method _removeEventHandlers
+* @description Removes all of the DOM event handlers from the HTML element(s) 
+* whose "context menu" event ("click" for Opera) trigger the display of 
+* the context menu.
+* @private
+*/
+_removeEventHandlers: function() {
+
+    var oTrigger = this._oTrigger;
+
+
+    // Remove the event handlers from the trigger(s)
+
+    if (oTrigger) {
+
+        Event.removeListener(oTrigger, EVENT_TYPES.CONTEXT_MENU, 
+            this._onTriggerContextMenu);    
+        
+        if(YAHOO.env.ua.opera) {
+        
+            Event.removeListener(oTrigger, EVENT_TYPES.CLICK, 
+                this._onTriggerClick);
+    
+        }
+
+    }
+
+},
+
+
+
+// Private event handlers
+
+
+/**
+* @method _onTriggerClick
+* @description "click" event handler for the HTML element(s) identified as the 
+* "trigger" for the context menu.  Used to cancel default behaviors in Opera.
+* @private
+* @param {Event} p_oEvent Object representing the DOM event object passed back 
+* by the event utility (YAHOO.util.Event).
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context 
+* menu that is handling the event.
+*/
+_onTriggerClick: function(p_oEvent, p_oMenu) {
+
+    if(p_oEvent.ctrlKey) {
+    
+        Event.stopEvent(p_oEvent);
+
+    }
+    
+},
+
+
+/**
+* @method _onTriggerContextMenu
+* @description "contextmenu" event handler ("mousedown" for Opera) for the HTML 
+* element(s) that trigger the display of the context menu.
+* @private
+* @param {Event} p_oEvent Object representing the DOM event object passed back 
+* by the event utility (YAHOO.util.Event).
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context 
+* menu that is handling the event.
+*/
+_onTriggerContextMenu: function(p_oEvent, p_oMenu) {
+
+    if(p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {
+
+        return;
+
+    }
+
+
+    /*
+        Prevent the browser's default context menu from appearing and 
+        stop the propagation of the "contextmenu" event so that 
+        other ContextMenu instances are not displayed.
+    */
+
+    Event.stopEvent(p_oEvent);
+
+
+    // Hide any other ContextMenu instances that might be visible
+
+    YAHOO.widget.MenuManager.hideVisible();
+
+
+    this.contextEventTarget = Event.getTarget(p_oEvent);
+
+    this.triggerContextMenuEvent.fire(p_oEvent);
+
+
+    if(!this._bCancelled) {
+
+        // Position and display the context menu
+    
+        this.cfg.setProperty("xy", Event.getXY(p_oEvent));
+
+        this.show();
+
+    }
+
+    this._bCancelled = false;
+
+},
+
+
+
+// Public methods
+
+
+/**
+* @method toString
+* @description Returns a string representing the context menu.
+* @return {String}
+*/
+toString: function() {
+
+    var sReturnVal = "ContextMenu",
+        sId = this.id;
+
+    if(sId) {
+
+        sReturnVal += (" " + sId);
+    
+    }
+
+    return sReturnVal;
+
+},
+
+
+/**
+* @method initDefaultConfig
+* @description Initializes the class's configurable properties which can be 
+* changed using the context menu's Config object ("cfg").
+*/
+initDefaultConfig: function() {
+
+    ContextMenu.superclass.initDefaultConfig.call(this);
+
+    /**
+    * @config trigger
+    * @description The HTML element(s) whose "contextmenu" event ("mousedown" 
+    * for Opera) trigger the display of the context menu.  Can be a string 
+    * representing the id attribute of the HTML element, an object reference 
+    * for the HTML element, or an array of strings or HTML element references.
+    * @default null
+    * @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+    * level-one-html.html#ID-58190037">HTMLElement</a>|Array
+    */
+    this.cfg.addProperty(DEFAULT_CONFIG.TRIGGER.key, 
+        { handler: this.configTrigger });
+
+},
+
+
+/**
+* @method destroy
+* @description Removes the context menu's <code>&#60;div&#62;</code> element 
+* (and accompanying child nodes) from the document.
+*/
+destroy: function() {
+
+    // Remove the DOM event handlers from the current trigger(s)
+
+    this._removeEventHandlers();
+    
+
+    // Continue with the superclass implementation of this method
+
+    ContextMenu.superclass.destroy.call(this);
+
+},
+
+
+
+// Public event handlers for configuration properties
+
+
+/**
+* @method configTrigger
+* @description Event handler for when the value of the "trigger" configuration 
+* property changes. 
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.ContextMenu} p_oMenu Object representing the context 
+* menu that fired the event.
+*/
+configTrigger: function(p_sType, p_aArgs, p_oMenu) {
+    
+    var oTrigger = p_aArgs[0];
+
+    if(oTrigger) {
+
+        /*
+            If there is a current "trigger" - remove the event handlers 
+            from that element(s) before assigning new ones
+        */
+
+        if(this._oTrigger) {
+        
+            this._removeEventHandlers();
+
+        }
+
+        this._oTrigger = oTrigger;
+
+
+        /*
+            Listen for the "mousedown" event in Opera b/c it does not 
+            support the "contextmenu" event
+        */ 
+  
+        Event.on(oTrigger, EVENT_TYPES.CONTEXT_MENU, 
+            this._onTriggerContextMenu, this, true);
+
+
+        /*
+            Assign a "click" event handler to the trigger element(s) for
+            Opera to prevent default browser behaviors.
+        */
+
+        if(YAHOO.env.ua.opera) {
+        
+            Event.on(oTrigger, EVENT_TYPES.CLICK, this._onTriggerClick, 
+                this, true);
+
+        }
+
+    }
+    else {
+   
+        this._removeEventHandlers();
+    
+    }
+    
+}
+
+}); // END YAHOO.lang.extend
+
+}());
+
+
+
+/**
+* Creates an item for a context menu.
+* 
+* @param {String} p_oObject String specifying the text of the context menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the 
+* <code>&#60;li&#62;</code> element of the context menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+* specifying the <code>&#60;optgroup&#62;</code> element of the context 
+* menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying 
+* the <code>&#60;option&#62;</code> element of the context menu item.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the context menu item. See configuration class 
+* documentation for more details.
+* @class ContextMenuItem
+* @constructor
+* @extends YAHOO.widget.MenuItem
+*/
+YAHOO.widget.ContextMenuItem = function(p_oObject, p_oConfig) {
+
+    YAHOO.widget.ContextMenuItem.superclass.constructor.call(this, 
+        p_oObject, p_oConfig);
+
+};
+
+YAHOO.lang.extend(YAHOO.widget.ContextMenuItem, YAHOO.widget.MenuItem, {
+
+
+/**
+* @method init
+* @description The ContextMenuItem class's initialization method. This method 
+* is automatically called by the constructor, and sets up all DOM references 
+* for pre-existing markup, and creates required markup if it is not 
+* already present.
+* @param {String} p_oObject String specifying the text of the context menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the 
+* <code>&#60;li&#62;</code> element of the context menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+* specifying the <code>&#60;optgroup&#62;</code> element of the context 
+* menu item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying 
+* the <code>&#60;option&#62;</code> element of the context menu item.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the context menu item. See configuration class 
+* documentation for more details.
+*/
+init: function(p_oObject, p_oConfig) {
+    
+    if(!this.SUBMENU_TYPE) {
+
+        this.SUBMENU_TYPE = YAHOO.widget.ContextMenu;
+
+    }
+
+
+    /* 
+        Call the init of the superclass (YAHOO.widget.MenuItem)
+        Note: We don't pass the user config in here yet 
+        because we only want it executed once, at the lowest 
+        subclass level.
+    */ 
+
+    YAHOO.widget.ContextMenuItem.superclass.init.call(this, p_oObject);
+
+    var oConfig = this.cfg;
+
+    if(p_oConfig) {
+
+        oConfig.applyConfig(p_oConfig, true);
+
+    }
+
+    oConfig.fireQueue();
+
+},
+
+
+
+// Public methods
+
+
+/**
+* @method toString
+* @description Returns a string representing the context menu item.
+* @return {String}
+*/
+toString: function() {
+
+    var sReturnVal = "ContextMenuItem";
+
+    if(this.cfg && this.cfg.getProperty("text")) {
+
+        sReturnVal += (": " + this.cfg.getProperty("text"));
+
+    }
+
+    return sReturnVal;
+
+}
+    
+}); // END YAHOO.lang.extend
+(function () {
+
+
+/**
+* Horizontal collection of items, each of which can contain a submenu.
+* 
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the menu bar.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source for the 
+* menu bar.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying 
+* the <code>&#60;div&#62;</code> element of the menu bar.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object 
+* specifying the <code>&#60;select&#62;</code> element to be used as the data 
+* source for the menu bar.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu bar. See configuration class documentation for
+* more details.
+* @class MenuBar
+* @constructor
+* @extends YAHOO.widget.Menu
+* @namespace YAHOO.widget
+*/
+YAHOO.widget.MenuBar = function(p_oElement, p_oConfig) {
+
+    YAHOO.widget.MenuBar.superclass.constructor.call(this, 
+        p_oElement, p_oConfig);
+
+};
+
+
+/**
+* @method checkPosition
+* @description Checks to make sure that the value of the "position" property 
+* is one of the supported strings. Returns true if the position is supported.
+* @private
+* @param {Object} p_sPosition String specifying the position of the menu.
+* @return {Boolean}
+*/
+function checkPosition(p_sPosition) {
+
+    if (typeof p_sPosition == "string") {
+
+        return ("dynamic,static".indexOf((p_sPosition.toLowerCase())) != -1);
+
+    }
+
+}
+
+
+var Event = YAHOO.util.Event,
+    Dom = YAHOO.util.Dom,
+    MenuBar = YAHOO.widget.MenuBar,
+
+    /**
+    * Constant representing the MenuBar's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
+    * @final
+    * @type Object
+    */
+    DEFAULT_CONFIG = {
+    
+        "POSITION": { 
+            key: "position", 
+            value: "static", 
+            validator: checkPosition, 
+            supercedes: ["visible"] 
+        }, 
+    
+        "SUBMENU_ALIGNMENT": { 
+            key: "submenualignment", 
+            value: ["tl","bl"] 
+        },
+    
+        "AUTO_SUBMENU_DISPLAY": { 
+            key: "autosubmenudisplay", 
+            value: false, 
+            validator: YAHOO.lang.isBoolean 
+        }
+    
+    };
+
+
+
+YAHOO.lang.extend(MenuBar, YAHOO.widget.Menu, {
+
+/**
+* @method init
+* @description The MenuBar class's initialization method. This method is 
+* automatically called by the constructor, and sets up all DOM references for 
+* pre-existing markup, and creates required markup if it is not already present.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;div&#62;</code> element of the menu bar.
+* @param {String} p_oElement String specifying the id attribute of the 
+* <code>&#60;select&#62;</code> element to be used as the data source for the 
+* menu bar.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object specifying 
+* the <code>&#60;div&#62;</code> element of the menu bar.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement Object 
+* specifying the <code>&#60;select&#62;</code> element to be used as the data 
+* source for the menu bar.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu bar. See configuration class documentation for
+* more details.
+*/
+init: function(p_oElement, p_oConfig) {
+
+    if(!this.ITEM_TYPE) {
+
+        this.ITEM_TYPE = YAHOO.widget.MenuBarItem;
+
+    }
+
+
+    // Call the init of the superclass (YAHOO.widget.Menu)
+
+    MenuBar.superclass.init.call(this, p_oElement);
+
+
+    this.beforeInitEvent.fire(MenuBar);
+
+
+    if(p_oConfig) {
+
+        this.cfg.applyConfig(p_oConfig, true);
+
+    }
+
+    this.initEvent.fire(MenuBar);
+
+},
+
+
+
+// Constants
+
+
+/**
+* @property CSS_CLASS_NAME
+* @description String representing the CSS class(es) to be applied to the menu 
+* bar's <code>&#60;div&#62;</code> element.
+* @default "yuimenubar"
+* @final
+* @type String
+*/
+CSS_CLASS_NAME: "yuimenubar",
+
+
+
+// Protected event handlers
+
+
+/**
+* @method _onKeyDown
+* @description "keydown" Custom Event handler for the menu bar.
+* @private
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar 
+* that fired the event.
+*/
+_onKeyDown: function(p_sType, p_aArgs, p_oMenuBar) {
+
+    var oEvent = p_aArgs[0],
+        oItem = p_aArgs[1],
+        oSubmenu,
+        oItemCfg,
+        oNextItem;
+
+
+    if(oItem && !oItem.cfg.getProperty("disabled")) {
+
+        oItemCfg = oItem.cfg;
+
+        switch(oEvent.keyCode) {
+    
+            case 37:    // Left arrow
+            case 39:    // Right arrow
+    
+                if(oItem == this.activeItem && 
+                    !oItemCfg.getProperty("selected")) {
+    
+                    oItemCfg.setProperty("selected", true);
+    
+                }
+                else {
+    
+                    oNextItem = (oEvent.keyCode == 37) ? 
+                        oItem.getPreviousEnabledSibling() : 
+                        oItem.getNextEnabledSibling();
+            
+                    if(oNextItem) {
+    
+                        this.clearActiveItem();
+    
+                        oNextItem.cfg.setProperty("selected", true);
+    
+    
+                        if(this.cfg.getProperty("autosubmenudisplay")) {
+                        
+                            oSubmenu = oNextItem.cfg.getProperty("submenu");
+                            
+                            if(oSubmenu) {
+                        
+                                oSubmenu.show();
+                            
+                            }
+                
+                        }           
+    
+                        oNextItem.focus();
+    
+                    }
+    
+                }
+    
+                Event.preventDefault(oEvent);
+    
+            break;
+    
+            case 40:    // Down arrow
+    
+                if(this.activeItem != oItem) {
+    
+                    this.clearActiveItem();
+    
+                    oItemCfg.setProperty("selected", true);
+                    oItem.focus();
+                
+                }
+    
+                oSubmenu = oItemCfg.getProperty("submenu");
+    
+                if(oSubmenu) {
+    
+                    if(oSubmenu.cfg.getProperty("visible")) {
+    
+                        oSubmenu.setInitialSelection();
+                        oSubmenu.setInitialFocus();
+                    
+                    }
+                    else {
+    
+                        oSubmenu.show();
+                    
+                    }
+    
+                }
+    
+                Event.preventDefault(oEvent);
+    
+            break;
+    
+        }
+
+    }
+
+
+    if(oEvent.keyCode == 27 && this.activeItem) { // Esc key
+
+        oSubmenu = this.activeItem.cfg.getProperty("submenu");
+
+        if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {
+        
+            oSubmenu.hide();
+            this.activeItem.focus();
+        
+        }
+        else {
+
+            this.activeItem.cfg.setProperty("selected", false);
+            this.activeItem.blur();
+    
+        }
+
+        Event.preventDefault(oEvent);
+    
+    }
+
+},
+
+
+/**
+* @method _onClick
+* @description "click" event handler for the menu bar.
+* @protected
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.MenuBar} p_oMenuBar Object representing the menu bar 
+* that fired the event.
+*/
+_onClick: function(p_sType, p_aArgs, p_oMenuBar) {
+
+    MenuBar.superclass._onClick.call(this, p_sType, p_aArgs, p_oMenuBar);
+
+    var oItem = p_aArgs[1],
+        oEvent,
+        oTarget,
+        oActiveItem,
+        oConfig,
+        oSubmenu;
+    
+
+    if(oItem && !oItem.cfg.getProperty("disabled")) {
+
+        oEvent = p_aArgs[0];
+        oTarget = Event.getTarget(oEvent);
+        oActiveItem = this.activeItem;
+        oConfig = this.cfg;
+
+
+        // Hide any other submenus that might be visible
+    
+        if(oActiveItem && oActiveItem != oItem) {
+    
+            this.clearActiveItem();
+    
+        }
+
+    
+        oItem.cfg.setProperty("selected", true);
+    
+
+        // Show the submenu for the item
+    
+        oSubmenu = oItem.cfg.getProperty("submenu");
+
+
+        if(oSubmenu && oTarget != oItem.submenuIndicator) {
+        
+            if(oSubmenu.cfg.getProperty("visible")) {
+            
+                oSubmenu.hide();
+            
+            }
+            else {
+            
+                oSubmenu.show();                    
+            
+            }
+        
+        }
+    
+    }
+
+},
+
+
+
+// Public methods
+
+
+/**
+* @method toString
+* @description Returns a string representing the menu bar.
+* @return {String}
+*/
+toString: function() {
+
+    var sReturnVal = "MenuBar",
+        sId = this.id;
+
+    if(sId) {
+
+        sReturnVal += (" " + sId);
+    
+    }
+
+    return sReturnVal;
+
+},
+
+
+/**
+* @description Initializes the class's configurable properties which can be
+* changed using the menu bar's Config object ("cfg").
+* @method initDefaultConfig
+*/
+initDefaultConfig: function() {
+
+    MenuBar.superclass.initDefaultConfig.call(this);
+
+    var oConfig = this.cfg;
+
+       // Add configuration properties
+
+
+    /*
+        Set the default value for the "position" configuration property
+        to "static" by re-adding the property.
+    */
+
+
+    /**
+    * @config position
+    * @description String indicating how a menu bar should be positioned on the 
+    * screen.  Possible values are "static" and "dynamic."  Static menu bars 
+    * are visible by default and reside in the normal flow of the document 
+    * (CSS position: static).  Dynamic menu bars are hidden by default, reside
+    * out of the normal flow of the document (CSS position: absolute), and can 
+    * overlay other elements on the screen.
+    * @default static
+    * @type String
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.POSITION.key, 
+        {
+            handler: this.configPosition, 
+            value: DEFAULT_CONFIG.POSITION.value, 
+            validator: DEFAULT_CONFIG.POSITION.validator,
+            supercedes: DEFAULT_CONFIG.POSITION.supercedes
+        }
+    );
+
+
+    /*
+        Set the default value for the "submenualignment" configuration property
+        to ["tl","bl"] by re-adding the property.
+    */
+
+    /**
+    * @config submenualignment
+    * @description Array defining how submenus should be aligned to their 
+    * parent menu bar item. The format is: [itemCorner, submenuCorner].
+    * @default ["tl","bl"]
+    * @type Array
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key, 
+        {
+            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value
+        }
+    );
+
+
+    /*
+        Change the default value for the "autosubmenudisplay" configuration 
+        property to "false" by re-adding the property.
+    */
+
+    /**
+    * @config autosubmenudisplay
+    * @description Boolean indicating if submenus are automatically made 
+    * visible when the user mouses over the menu bar's items.
+    * @default false
+    * @type Boolean
+    */
+       oConfig.addProperty(
+          DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key, 
+          {
+              value: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value, 
+              validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator
+       } 
+    );
+
+}
+}); // END YAHOO.lang.extend
+
+}());
+
+
+
+/**
+* Creates an item for a menu bar.
+* 
+* @param {String} p_oObject String specifying the text of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the 
+* <code>&#60;li&#62;</code> element of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying 
+* the <code>&#60;option&#62;</code> element of the menu bar item.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu bar item. See configuration class documentation 
+* for more details.
+* @class MenuBarItem
+* @constructor
+* @extends YAHOO.widget.MenuItem
+*/
+YAHOO.widget.MenuBarItem = function(p_oObject, p_oConfig) {
+
+    YAHOO.widget.MenuBarItem.superclass.constructor.call(this, 
+        p_oObject, p_oConfig);
+
+};
+
+YAHOO.lang.extend(YAHOO.widget.MenuBarItem, YAHOO.widget.MenuItem, {
+
+
+
+/**
+* @method init
+* @description The MenuBarItem class's initialization method. This method is 
+* automatically called by the constructor, and sets up all DOM references for 
+* pre-existing markup, and creates required markup if it is not already present.
+* @param {String} p_oObject String specifying the text of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the 
+* <code>&#60;li&#62;</code> element of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
+* specifying the <code>&#60;optgroup&#62;</code> element of the menu bar item.
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
+* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying 
+* the <code>&#60;option&#62;</code> element of the menu bar item.
+* @param {Object} p_oConfig Optional. Object literal specifying the 
+* configuration for the menu bar item. See configuration class documentation 
+* for more details.
+*/
+init: function(p_oObject, p_oConfig) {
+
+    if(!this.SUBMENU_TYPE) {
+
+        this.SUBMENU_TYPE = YAHOO.widget.Menu;
+
+    }
+
+
+    /* 
+        Call the init of the superclass (YAHOO.widget.MenuItem)
+        Note: We don't pass the user config in here yet 
+        because we only want it executed once, at the lowest 
+        subclass level.
+    */ 
+
+    YAHOO.widget.MenuBarItem.superclass.init.call(this, p_oObject);  
+
+
+    var oConfig = this.cfg;
+
+    if(p_oConfig) {
+
+        oConfig.applyConfig(p_oConfig, true);
+
+    }
+
+    oConfig.fireQueue();
+
+},
+
+
+
+// Constants
+
+
+/**
+* @property CSS_CLASS_NAME
+* @description String representing the CSS class(es) to be applied to the 
+* <code>&#60;li&#62;</code> element of the menu bar item.
+* @default "yuimenubaritem"
+* @final
+* @type String
+*/
+CSS_CLASS_NAME: "yuimenubaritem",
+
+
+/**
+* @property CSS_LABEL_CLASS_NAME
+* @description String representing the CSS class(es) to be applied to the 
+* menu bar item's <code>&#60;a&#62;</code> element.
+* @default "yuimenubaritemlabel"
+* @final
+* @type String
+*/
+CSS_LABEL_CLASS_NAME: "yuimenubaritemlabel",
+
+
+
+// Public methods
+
+
+/**
+* @method toString
+* @description Returns a string representing the menu bar item.
+* @return {String}
+*/
+toString: function() {
+
+    var sReturnVal = "MenuBarItem";
+
+    if(this.cfg && this.cfg.getProperty("text")) {
+
+        sReturnVal += (": " + this.cfg.getProperty("text"));
+
+    }
+
+    return sReturnVal;
+
+}
+    
+}); // END YAHOO.lang.extend
+YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.3.0", build: "442"});
index 92d38afbb8c2a7a7c0896103080dfb5a5f725c38..4deb804abe3915b4e79667826d934d09a7be0f36 100755 (executable)
@@ -12,6 +12,14 @@ grids/README
 
 ************
 
+Version 2.3.0
+
+  * Changes to all three components.
+
+Version 2.2.0 - 2.2.2
+
+  * No changes.
+
 Version 0.12.0
 
   * Initial release.
index 2414d7b5d9b5f4e177857bcfb5d1066e66f460c5..a21e2c4458654f1126e068957975f4f692e2b606 100755 (executable)
@@ -1,3 +1,9 @@
-/*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;}
-/*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;}
-/*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
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/*reset.css*/body{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup,sub{line-height:-1px;vertical-align:text-top;}sub{vertical-align:text-bottom;}input, textarea, select{font-family:inherit;font-size:inherit;font-weight:inherit;}
+/*fonts.css*/body {font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:99%;}
+/*grids.css*/body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.301em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.117em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;margin-left:2%;width:32%;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{_margin-left:1.2%;*margin-left:1.7%;}.yui-g .yui-gb .yui-u{_margin-left:.8%;}.yui-gb .yui-u{margin-left:2%;width:32%;float:right;*width:31.8%;}.yui-gb div.first{margin-left:0;*margin-right:1px;float:left;}.yui-gb .yui-gb div.first{*margin-right:0;width:31.7%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-g .yui-gc div.first,.yui-g .yui-ge div.first{float:left;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-gb .yui-gc .yui-u,.yui-g .yui-gc .yui-u{_float:right;width:32%;_width:29.9%;}.yui-gb .yui-gc div.first{width:66%;*width:64.5%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:48.1%;*margin-left:0;}.yui-g .yui-g div.first{*margin:0;}.yui-gb .yui-g div.first{*margin-right:1px;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{_width:48.1%;*width:48.1%;*margin-left:0;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-gc div.first,.yui-gc div.first,.yui-gd .yui-g,.yui-gd .yui-u{width:66%;}.yui-gd div.first,.yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf div.first{width:24%;}.yui-ge div.first,.yui-gf .yui-g,.yui-gf .yui-u{width:74.2%;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
index ef9c4bd0edb73ad09097c9e133078f89f8300ec9..d84ebcca57bafc32f46c669cb1571da4736caeca 100755 (executable)
@@ -1,5 +1,20 @@
 YUI Library - Reset - Release Notes
 
+Version 2.3.0
+
+  * Removed: ul,ol {list-style:none;}
+  * Added: li {list-style:none;} because it's less impactful (easier to rebuild) and shorter
+  * Added: acronym {font-variant:normal;} to reset the "small-caps" variant that Opera displays
+  * Added: body {color:#000;background:#FFF;}
+  * Added: sup,sub {line-height:-1px;vertical-align: text-top;}sub{vertical-align:text-bottom;}
+  * Added: input, textarea, select{font-family:inherit;font-size:inherit;font-weight:inherit;} (doesn't fix textareas in Opera/Win+Mac, IE6/7
+  * Added: padding:0;margin:0; for the legend element which wasn't fully reset before (has 2px lateral padding on some browsers)
+  
+  
+Version 2.2.0 - 2.2.2
+
+  * No changes.
+
 Version 0.12.1 - 0.12.2
 
   * No changes.
@@ -7,9 +22,7 @@ Version 0.12.1 - 0.12.2
 Version 0.12.0
 
   * Added: h1,h2,h3,h4,h5,h6{font-weight:normal;}
-
   * Added: abbr,acronym {border:0;}
-  
   * Added: textarea {padding:0;margin:0;}
 
 Version 0.11.0
index 6eaffe815f44a300519de965958a6c908137762d..49362c9d9cfd959613153764c2bfea1752070532 100755 (executable)
@@ -1 +1,7 @@
-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
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+body{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup,sub{line-height:-1px;vertical-align:text-top;}sub{vertical-align:text-bottom;}input, textarea, select{font-family:inherit;font-size:inherit;font-weight:inherit;}
\ No newline at end of file
index 8f8151c30f7eba1d2f454ca6b016a857eaf4fb29..33735c64b86a9d4d3061813cc2b31ed246b2500b 100755 (executable)
@@ -1,9 +1,19 @@
-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;}
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+body {color:#000;background:#FFF;}
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}
 table{border-collapse:collapse;border-spacing:0;}
 fieldset,img{border:0;}
 address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
-ol,ul {list-style:none;}
+li {list-style:none;}
 caption,th {text-align:left;}
 h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
 q:before,q:after{content:'';}
-abbr,acronym {border:0;}
\ No newline at end of file
+abbr,acronym {border:0;font-variant:normal;}
+sup,sub {line-height:-1px;vertical-align: text-top;}
+sub {vertical-align:text-bottom;}
+input, textarea, select{font-family:inherit;font-size:inherit;font-weight:inherit;}
\ No newline at end of file
index c4320ee04878b66fc44b040f7f139fa15d1b1991..7d9ce17befd90864d4c7b3ea0cea509b2a9c8b55 100755 (executable)
@@ -1,12 +1,26 @@
 Slider - Release Notes
 
-0.12.2
+2.3.0
+   * Added valueChangeSource, which specifies whether the last value change
+     was the result of user interaction with the control, or a result of a
+     programmatic update (setValue)
+
+2.2.2
+   * No change
 
+2.2.1
+   * No change
+
+2.2.0
+   * Added the missing "force" parameter to the signature for setRegionValue
+   * Deprecated the moveComplete flag
+
+0.12.2
    * No change
 
 0.12.1
 
-   * Removed unneccessary getXY calls that were contribuing to slower performance
+   * Removed unnecessary getXY calls that were contributing to slower performance
      in FireFox when the slider was deeply nested in the DOM.
 
 0.12.0
index bbfb11793b2f29d586aec701729459781919f26d..404be58a33261f319730333b1076383eeb08d5bd 100755 (executable)
@@ -1,10 +1,9 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-
 /**
  * The Slider component is a UI control that enables the user to adjust 
  * values in a finite range along one or two axes. Typically, the Slider 
@@ -112,6 +111,7 @@ YAHOO.widget.Slider.getSliderRegion =
  */
 YAHOO.widget.Slider.ANIM_AVAIL = true;
 
+
 YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
 
     /**
@@ -205,9 +205,15 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
          * destination.  For animated slider, this value can be checked in 
          * the onChange handler to make it possible to execute logic only
          * when the move is complete rather than at all points along the way.
+         * Deprecated because this flag is only useful when the background is
+         * clicked and the slider is animated.  If the user drags the thumb,
+         * the flag is updated when the drag is over ... the final onDrag event
+         * fires before the mouseup the ends the drag, so the implementer will
+         * never see it.
          *
          * @property moveComplete
          * @type Boolean
+         * @deprecated use the slideEnd event instead
          */
         this.moveComplete = true;
 
@@ -219,6 +225,36 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
          * @default 0.2
          */
         this.animationDuration = 0.2;
+
+        /**
+         * Constant for valueChangeSource, indicating that the user clicked or
+         * dragged the slider to change the value.
+         * @property SOURCE_UI_EVENT
+         * @final
+         * @default 1
+         */
+        this.SOURCE_UI_EVENT = 1;
+
+        /**
+         * Constant for valueChangeSource, indicating that the value was altered
+         * by a programmatic call to setValue/setRegionValue.
+         * @property SOURCE_SET_VALUE
+         * @final
+         * @default 2
+         */
+        this.SOURCE_SET_VALUE = 2;
+
+        /**
+         * When the slider value changes, this property is set to identify where
+         * the update came from.  This will be either 1, meaning the slider was
+         * clicked or dragged, or 2, meaning that it was set via a setValue() call.
+         * This can be used within event handlers to apply some of the logic only
+         * when dealing with one source or another.
+         * @property valueChangeSource
+         * @type int
+         * @since 2.3.0
+         */
+        this.valueChangeSource = 0;
     },
 
     /**
@@ -462,6 +498,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      */
     focus: function() {
         this.logger.log("focus");
+        this.valueChangeSource = this.SOURCE_UI_EVENT;
 
         // Focus the background element if possible
         var el = this.getEl();
@@ -579,6 +616,8 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
     setValue: function(newOffset, skipAnim, force) {
         this.logger.log("setValue " + newOffset);
 
+        this.valueChangeSource = this.SOURCE_SET_VALUE;
+
         if (!this.thumb.available) {
             this.logger.log("defer setValue until after onAvailble");
             this.deferredSetValue = arguments;
@@ -629,6 +668,8 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      */
     setRegionValue: function(newOffset, newOffset2, skipAnim, force) {
 
+        this.valueChangeSource = this.SOURCE_SET_VALUE;
+
         if (!this.thumb.available) {
             this.logger.log("defer setRegionValue until after onAvailble");
             this.deferredSetRegionValue = arguments;
@@ -1251,3 +1292,4 @@ if ("undefined" == typeof YAHOO.util.Anim) {
     YAHOO.widget.Slider.ANIM_AVAIL = false;
 }
 
+YAHOO.register("slider", YAHOO.widget.Slider, {version: "2.3.0", build: "442"});
index b240840192f230f661cb98d8b01e4d028bac3aa3..4028c9e89b9d15e96d3cc8953a4b1058b1cb6c57 100755 (executable)
@@ -1,20 +1,19 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 
-
-YAHOO.widget.Slider=function(sElementId,sGroup,oThumb,sType){if(sElementId){this.init(sElementId,sGroup,true);this.initSlider(sType);this.initThumb(oThumb);}};YAHOO.widget.Slider.getHorizSlider=function(sBGElId,sHandleElId,iLeft,iRight,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,0,0,iTickSize),"horiz");};YAHOO.widget.Slider.getVertSlider=function(sBGElId,sHandleElId,iUp,iDown,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,0,0,iUp,iDown,iTickSize),"vert");};YAHOO.widget.Slider.getSliderRegion=function(sBGElId,sHandleElId,iLeft,iRight,iUp,iDown,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,iUp,iDown,iTickSize),"region");};YAHOO.widget.Slider.ANIM_AVAIL=true;YAHOO.extend(YAHOO.widget.Slider,YAHOO.util.DragDrop,{initSlider:function(sType){this.type=sType;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.isTarget=false;this.animate=YAHOO.widget.Slider.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;},initThumb:function(t){var self=this;this.thumb=t;t.cacheBetweenDrags=true;t.onChange=function(){self.handleThumbChange();};if(t._isHoriz&&t.xTicks&&t.xTicks.length){this.tickPause=Math.round(360/t.xTicks.length);}else if(t.yTicks&&t.yTicks.length){this.tickPause=Math.round(360/t.yTicks.length);}
+YAHOO.widget.Slider=function(sElementId,sGroup,oThumb,sType){if(sElementId){this.init(sElementId,sGroup,true);this.initSlider(sType);this.initThumb(oThumb);}};YAHOO.widget.Slider.getHorizSlider=function(sBGElId,sHandleElId,iLeft,iRight,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,0,0,iTickSize),"horiz");};YAHOO.widget.Slider.getVertSlider=function(sBGElId,sHandleElId,iUp,iDown,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,0,0,iUp,iDown,iTickSize),"vert");};YAHOO.widget.Slider.getSliderRegion=function(sBGElId,sHandleElId,iLeft,iRight,iUp,iDown,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,iUp,iDown,iTickSize),"region");};YAHOO.widget.Slider.ANIM_AVAIL=true;YAHOO.extend(YAHOO.widget.Slider,YAHOO.util.DragDrop,{initSlider:function(sType){this.type=sType;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.isTarget=false;this.animate=YAHOO.widget.Slider.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;this.SOURCE_UI_EVENT=1;this.SOURCE_SET_VALUE=2;this.valueChangeSource=0;},initThumb:function(t){var self=this;this.thumb=t;t.cacheBetweenDrags=true;t.onChange=function(){self.handleThumbChange();};if(t._isHoriz&&t.xTicks&&t.xTicks.length){this.tickPause=Math.round(360/t.xTicks.length);}else if(t.yTicks&&t.yTicks.length){this.tickPause=Math.round(360/t.yTicks.length);}
 t.onMouseDown=function(){return self.focus();};t.onMouseUp=function(){self.thumbMouseUp();};t.onDrag=function(){self.fireEvents(true);};t.onAvailable=function(){return self.setStartSliderState();};},onAvailable:function(){var Event=YAHOO.util.Event;Event.on(this.id,"keydown",this.handleKeyDown,this,true);Event.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(e){if(this.enableKeys){var Event=YAHOO.util.Event;var kc=Event.getCharCode(e);switch(kc){case 0x25:case 0x26:case 0x27:case 0x28:case 0x24:case 0x23:Event.preventDefault(e);break;default:}}},handleKeyDown:function(e){if(this.enableKeys){var Event=YAHOO.util.Event;var kc=Event.getCharCode(e),t=this.thumb;var h=this.getXValue(),v=this.getYValue();var horiz=false;var changeValue=true;switch(kc){case 0x25:h-=this.keyIncrement;break;case 0x26:v-=this.keyIncrement;break;case 0x27:h+=this.keyIncrement;break;case 0x28:v+=this.keyIncrement;break;case 0x24:h=t.leftConstraint;v=t.topConstraint;break;case 0x23:h=t.rightConstraint;v=t.bottomConstraint;break;default:changeValue=false;}
 if(changeValue){if(t._isRegion){this.setRegionValue(h,v,true);}else{var newVal=(t._isHoriz)?h:v;this.setValue(newVal,true);}
-Event.stopEvent(e);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=YAHOO.util.Dom.getXY(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this.setRegionValue.apply(this,this.deferredSetRegionValue,true);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true,true);}}else{if(this.deferredSetValue){this.setValue.apply(this,this.deferredSetValue,true);this.deferredSetValue=null;}else{this.setValue(0,true,true);}}},setThumbCenterPoint:function(){var el=this.thumb.getEl();if(el){this.thumbCenterPoint={x:parseInt(el.offsetWidth/2,10),y:parseInt(el.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){if(!this.isLocked()&&!this.moveComplete){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){var el=this.getEl();if(el.focus){try{el.focus();}catch(e){}}
-this.verifyOffset();if(this.isLocked()){return false;}else{this.onSlideStart();return true;}},onChange:function(firstOffset,secondOffset){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},handleThumbChange:function(){var t=this.thumb;if(t._isRegion){t.onChange(t.getXValue(),t.getYValue());this.fireEvent("change",{x:t.getXValue(),y:t.getYValue()});}else{t.onChange(t.getValue());this.fireEvent("change",t.getValue());}},setValue:function(newOffset,skipAnim,force){if(!this.thumb.available){this.deferredSetValue=arguments;return false;}
+Event.stopEvent(e);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=YAHOO.util.Dom.getXY(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this.setRegionValue.apply(this,this.deferredSetRegionValue,true);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true,true);}}else{if(this.deferredSetValue){this.setValue.apply(this,this.deferredSetValue,true);this.deferredSetValue=null;}else{this.setValue(0,true,true);}}},setThumbCenterPoint:function(){var el=this.thumb.getEl();if(el){this.thumbCenterPoint={x:parseInt(el.offsetWidth/2,10),y:parseInt(el.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){if(!this.isLocked()&&!this.moveComplete){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){this.valueChangeSource=this.SOURCE_UI_EVENT;var el=this.getEl();if(el.focus){try{el.focus();}catch(e){}}
+this.verifyOffset();if(this.isLocked()){return false;}else{this.onSlideStart();return true;}},onChange:function(firstOffset,secondOffset){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},handleThumbChange:function(){var t=this.thumb;if(t._isRegion){t.onChange(t.getXValue(),t.getYValue());this.fireEvent("change",{x:t.getXValue(),y:t.getYValue()});}else{t.onChange(t.getValue());this.fireEvent("change",t.getValue());}},setValue:function(newOffset,skipAnim,force){this.valueChangeSource=this.SOURCE_SET_VALUE;if(!this.thumb.available){this.deferredSetValue=arguments;return false;}
 if(this.isLocked()&&!force){return false;}
 if(isNaN(newOffset)){return false;}
 var t=this.thumb;var newX,newY;this.verifyOffset(true);if(t._isRegion){return false;}else if(t._isHoriz){this.onSlideStart();newX=t.initPageX+newOffset+this.thumbCenterPoint.x;this.moveThumb(newX,t.initPageY,skipAnim);}else{this.onSlideStart();newY=t.initPageY+newOffset+this.thumbCenterPoint.y;this.moveThumb(t.initPageX,newY,skipAnim);}
-return true;},setRegionValue:function(newOffset,newOffset2,skipAnim,force){if(!this.thumb.available){this.deferredSetRegionValue=arguments;return false;}
+return true;},setRegionValue:function(newOffset,newOffset2,skipAnim,force){this.valueChangeSource=this.SOURCE_SET_VALUE;if(!this.thumb.available){this.deferredSetRegionValue=arguments;return false;}
 if(this.isLocked()&&!force){return false;}
 if(isNaN(newOffset)){return false;}
 var t=this.thumb;if(t._isRegion){this.onSlideStart();var newX=t.initPageX+newOffset+this.thumbCenterPoint.x;var newY=t.initPageY+newOffset2+this.thumbCenterPoint.y;this.moveThumb(newX,newY,skipAnim);return true;}
@@ -33,4 +32,5 @@ return newOffset;},initSlider:function(iLeft,iRight,iUp,iDown,iTickSize){this.in
 this._isHoriz=(iLeft||iRight);this._isVert=(iUp||iDown);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this.tickSize=0;this._graduated=false;},getValue:function(){if(!this.available){return 0;}
 var val=(this._isHoriz)?this.getXValue():this.getYValue();return val;},getXValue:function(){if(!this.available){return 0;}
 var newOffset=this.getOffsetFromParent();return(newOffset[0]-this.startOffset[0]);},getYValue:function(){if(!this.available){return 0;}
-var newOffset=this.getOffsetFromParent();return(newOffset[1]-this.startOffset[1]);},toString:function(){return"SliderThumb "+this.id;},onChange:function(x,y){}});if("undefined"==typeof YAHOO.util.Anim){YAHOO.widget.Slider.ANIM_AVAIL=false;}
\ No newline at end of file
+var newOffset=this.getOffsetFromParent();return(newOffset[1]-this.startOffset[1]);},toString:function(){return"SliderThumb "+this.id;},onChange:function(x,y){}});if("undefined"==typeof YAHOO.util.Anim){YAHOO.widget.Slider.ANIM_AVAIL=false;}
+YAHOO.register("slider",YAHOO.widget.Slider,{version:"2.3.0",build:"442"});
\ No newline at end of file
index f5a1ad37439d61daec5511862df14b1f6aaff9c6..267047504930fd29a9e93660faa7859aab05b970 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 /**
  * The Slider component is a UI control that enables the user to adjust 
@@ -111,6 +111,7 @@ YAHOO.widget.Slider.getSliderRegion =
  */
 YAHOO.widget.Slider.ANIM_AVAIL = true;
 
+
 YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
 
     /**
@@ -203,9 +204,15 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
          * destination.  For animated slider, this value can be checked in 
          * the onChange handler to make it possible to execute logic only
          * when the move is complete rather than at all points along the way.
+         * Deprecated because this flag is only useful when the background is
+         * clicked and the slider is animated.  If the user drags the thumb,
+         * the flag is updated when the drag is over ... the final onDrag event
+         * fires before the mouseup the ends the drag, so the implementer will
+         * never see it.
          *
          * @property moveComplete
          * @type Boolean
+         * @deprecated use the slideEnd event instead
          */
         this.moveComplete = true;
 
@@ -217,6 +224,36 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
          * @default 0.2
          */
         this.animationDuration = 0.2;
+
+        /**
+         * Constant for valueChangeSource, indicating that the user clicked or
+         * dragged the slider to change the value.
+         * @property SOURCE_UI_EVENT
+         * @final
+         * @default 1
+         */
+        this.SOURCE_UI_EVENT = 1;
+
+        /**
+         * Constant for valueChangeSource, indicating that the value was altered
+         * by a programmatic call to setValue/setRegionValue.
+         * @property SOURCE_SET_VALUE
+         * @final
+         * @default 2
+         */
+        this.SOURCE_SET_VALUE = 2;
+
+        /**
+         * When the slider value changes, this property is set to identify where
+         * the update came from.  This will be either 1, meaning the slider was
+         * clicked or dragged, or 2, meaning that it was set via a setValue() call.
+         * This can be used within event handlers to apply some of the logic only
+         * when dealing with one source or another.
+         * @property valueChangeSource
+         * @type int
+         * @since 2.3.0
+         */
+        this.valueChangeSource = 0;
     },
 
     /**
@@ -454,6 +491,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      * @private
      */
     focus: function() {
+        this.valueChangeSource = this.SOURCE_UI_EVENT;
 
         // Focus the background element if possible
         var el = this.getEl();
@@ -567,6 +605,8 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      */
     setValue: function(newOffset, skipAnim, force) {
 
+        this.valueChangeSource = this.SOURCE_SET_VALUE;
+
         if (!this.thumb.available) {
             this.deferredSetValue = arguments;
             return false;
@@ -614,6 +654,8 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
      */
     setRegionValue: function(newOffset, newOffset2, skipAnim, force) {
 
+        this.valueChangeSource = this.SOURCE_SET_VALUE;
+
         if (!this.thumb.available) {
             this.deferredSetRegionValue = arguments;
             return false;
@@ -690,6 +732,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         var _p = t.getTargetCoord(x, y);
         var p = [_p.x, _p.y];
 
+
         this.fireEvent("slideStart");
 
         if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && t._graduated && !skipAnim) {
@@ -731,6 +774,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
 
         var t = this.thumb, tmp;
 
+
         // redundant call to getXY since we set the position most of time prior 
         // to getting here.  Moved to this.curCoord
         //var curCoord = YAHOO.util.Dom.getXY(t.getEl());
@@ -846,6 +890,7 @@ YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {
         this.thumb.resetConstraints();
     },
 
+
     /**
      * Handles the mousedown event for the slider background
      * @method onMouseDown
@@ -983,6 +1028,7 @@ YAHOO.widget.SliderThumb = function(id, sGroup, iLeft, iRight, iUp, iDown, iTick
         this.parentElId = sGroup;
     }
 
+
     //this.removeInvalidHandleType("A");
 
 
@@ -1056,6 +1102,7 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
      */
     _graduated: false,
 
+
     /**
      * Returns the difference between the location of the thumb and its parent.
      * @method getOffsetFromParent
@@ -1114,6 +1161,7 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
      */
     initSlider: function (iLeft, iRight, iUp, iDown, iTickSize) {
 
+
         //document these.  new for 0.12.1
         this.initLeft = iLeft;
         this.initRight = iRight;
@@ -1143,6 +1191,7 @@ YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {
         this._graduated = false;
     },
 
+
     /**
      * Gets the current offset from the element's start position in
      * pixels.
@@ -1206,3 +1255,4 @@ if ("undefined" == typeof YAHOO.util.Anim) {
     YAHOO.widget.Slider.ANIM_AVAIL = false;
 }
 
+YAHOO.register("slider", YAHOO.widget.Slider, {version: "2.3.0", build: "442"});
index e49ec56d05806f75755ec58d83a31a9bc5c8595a..47055d6dbb0dcabd7577fd822846b6973e04f3d0 100755 (executable)
@@ -1,3 +1,25 @@
+TabView Release Notes
+
+** version 2.3.0 ***
+* no longer firing tabChange if already selected
+* multiple clicks no longer trigger extra xhr if in progress
+* now using existing href for Tab href attribute
+* CLASSNAME now added if not present on tabview element
+
+*** version 2.2.2 ***
+
+* no change
+
+
+*** version 2.2.1 ***
+
+* no change
+
+*** version 2.2.0 ***
+
+* Element broken out into seperate pkg
+  NOTE: new dependency required - element-beta.js
+
 *** version 0.12.2 ***
 
 * var Tab is now private
index 28b1967dd8a725ef65bdb5d1b54dcee29ce89b9b..155ba7f1ae9f96658dd383eb30ec7b3ecb3019a5 100755 (executable)
@@ -1,3 +1,9 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
 .yui-navset .yui-nav li a, .yui-navset .yui-content {
     border:1px solid #000;  /* label and content borders */
 }
diff --git a/lib/yui/tabview/assets/loading.gif b/lib/yui/tabview/assets/loading.gif
new file mode 100755 (executable)
index 0000000..6a56815
Binary files /dev/null and b/lib/yui/tabview/assets/loading.gif differ
diff --git a/lib/yui/tabview/assets/skin-sam.css b/lib/yui/tabview/assets/skin-sam.css
new file mode 100755 (executable)
index 0000000..0f81811
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-navset .yui-nav li {
+    margin-right:0.16em; /* space between tabs */
+    padding-top:1px; /* gecko: make room for overflow */
+    zoom:1;
+}
+
+.yui-navset .yui-nav .selected { 
+    margin-bottom:-1px; /* for overlap */
+}
+
+.yui-navset .yui-nav a {
+    background:#dadbdb url(../../assets/skins/sam/sprite.png) repeat-x; /* sprite position for normal gradient */
+    border:solid #a3a3a3;
+    border-width:0 1px;
+    color:#000;
+    text-decoration:none;
+}
+
+.yui-navset .yui-nav li a em {
+    border-top:solid 1px #a3a3a3;
+    border-bottom:0;
+    cursor:hand;
+    padding:0.2em 0.5em;
+    top:-1px; /* for 1px rounded corners */
+    position:relative;
+}
+
+.yui-navset .yui-nav .selected a,
+.yui-navset .yui-nav a:focus,
+.yui-navset .yui-nav a:hover {
+    background:#214197 url(../../assets/skins/sam/sprite.png) repeat-x left -1400px;
+    color:#fff;
+}
+
+.yui-navset .yui-nav .selected a em {
+    padding:0.3em 0.5em; /* raise selected tab */
+}
+
+.yui-navset .yui-nav .selected a,
+.yui-navset .yui-nav a:hover,
+.yui-navset .yui-nav a:focus {
+    border-color:#243356;
+}
+
+.yui-navset .yui-nav a:hover em,
+.yui-navset .yui-nav a:focus em,
+.yui-navset .yui-nav .selected a em {
+    border-color:#233356 #406ed9;
+}
+
+.yui-navset .yui-nav {
+    border-bottom:1px solid #243356;
+    position:relative;
+    zoom:1;
+}
+
+.yui-navset .yui-content {
+    background:#abceff;
+    border-top:5px solid #214095;
+}
+
+.yui-navset .yui-content div {
+    border:1px solid #808080;
+    border-top-color:#243356;
+    padding:0.25em 0.5em;
+}
+
+.yui-navset .yui-content div div { /* kill inheritance */
+    border:0; 
+    padding:0;
+}
diff --git a/lib/yui/tabview/assets/skins/sam/tabview-skin.css b/lib/yui/tabview/assets/skins/sam/tabview-skin.css
new file mode 100755 (executable)
index 0000000..3aa177a
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* .yui-navset defaults to .yui-navset-top */
+.yui-skin-sam .yui-navset .yui-nav,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-nav { /* protect nested tabviews from other orientations */
+    border:solid #2647a0; /* color between tab list and content */
+    border-width:0 0 5px;
+    Xposition:relative;
+    zoom:1;
+}
+
+.yui-skin-sam .yui-navset .yui-nav li,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li {
+    margin:0 0.16em 0 0; /* space between tabs */
+    padding:1px 0 0; /* gecko: make room for overflow */
+    zoom:1;
+}
+
+.yui-skin-sam .yui-navset .yui-nav .selected,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected { 
+    margin:0 0.16em -1px 0; /* for overlap */
+}
+
+.yui-skin-sam .yui-navset .yui-nav a,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a {
+    background:#d8d8d8 url(../../../../assets/skins/sam/sprite.png) repeat-x; /* tab background */
+    border:solid #a3a3a3;
+    border-width:0 1px;
+    color:#000;
+    position:relative;
+    text-decoration:none;
+}
+
+.yui-skin-sam .yui-navset .yui-nav a em,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em {
+    border:solid #a3a3a3;
+    border-width:1px 0 0;
+    cursor:hand;
+    padding:0.25em .75em;
+    left:0; right: 0; bottom: 0; /* protect from other orientations */
+    top:-1px; /* for 1px rounded corners */
+    position:relative;
+}
+
+.yui-skin-sam .yui-navset .yui-nav .selected a,
+.yui-skin-sam .yui-navset .yui-nav .selected a:focus, /* no focus effect for selected */
+.yui-skin-sam .yui-navset .yui-nav .selected a:hover { /* no hover effect for selected */
+    background:#2647a0 url(../../../../assets/skins/sam/sprite.png) repeat-x left -1400px; /* selected tab background */
+    color:#fff;
+}
+
+.yui-skin-sam .yui-navset .yui-nav a:hover,
+.yui-skin-sam .yui-navset .yui-nav a:focus {
+    background:#bfdaff url(../../../../assets/skins/sam/sprite.png) repeat-x left -1300px; /* selected tab background */
+    outline:0;
+}
+
+.yui-skin-sam .yui-navset .yui-nav .selected a em {
+    padding:0.35em 0.75em; /* raise selected tab */
+}
+
+.yui-skin-sam .yui-navset .yui-nav .selected a,
+.yui-skin-sam .yui-navset .yui-nav .selected a em {
+    border-color:#243356; /* selected tab border color */
+}
+
+.yui-skin-sam .yui-navset .yui-content {
+    background:#edf5ff; /* content background color */
+}
+
+.yui-skin-sam .yui-navset .yui-content,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-content {
+    border:1px solid #808080; /* content border */
+    border-top-color:#243356; /* different border color */
+    padding:0.25em 0.5em; /* content padding */
+}
+
+/* left and right orientations */
+.yui-skin-sam .yui-navset-left .yui-nav,
+.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,
+.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,
+.yui-skin-sam .yui-navset-right .yui-nav {
+    border-width:0 5px 0 0;
+    Xposition:absolute; /* from tabview-core; have to reiterate for skin-sam due to pos:rel on skin-sam yui-nav */
+    top:0; bottom:0; /* stretch to fill content height */
+}
+
+.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,
+.yui-skin-sam .yui-navset-right .yui-nav {
+    border-width:0 0 0 5px;
+}
+
+.yui-skin-sam .yui-navset-left .yui-nav li,
+.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,
+.yui-skin-sam .yui-navset-right .yui-nav li {
+    margin:0 0 0.16em; /* space between tabs */
+    padding:0 0 0 1px; /* gecko: make room for overflow */
+}
+
+.yui-skin-sam .yui-navset-right .yui-nav li {
+    padding:0 1px 0 0; /* gecko: make room for overflow */
+}
+
+.yui-skin-sam .yui-navset-left .yui-nav .selected,
+.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected { 
+    margin:0 -1px 0.16em 0;
+}
+
+.yui-skin-sam .yui-navset-right .yui-nav .selected { 
+    margin:0 0 0.16em -1px;
+}
+
+.yui-skin-sam .yui-navset-left .yui-nav a,
+.yui-skin-sam .yui-navset-right .yui-nav a {
+    border-width:1px 0;
+}
+
+.yui-skin-sam .yui-navset-left .yui-nav a em,
+.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,
+.yui-skin-sam .yui-navset-right .yui-nav a em {
+    border-width:0 0 0 1px;
+    padding:0.2em .75em;
+    top:auto;
+    left:-1px; /* for 1px rounded corners */
+}
+
+.yui-skin-sam .yui-navset-right .yui-nav a em {
+    border-width:0 1px 0 0;
+    left:auto;
+    right:-1px; /* for 1px rounded corners */
+}
+
+.yui-skin-sam .yui-navset-left .yui-nav a,
+.yui-skin-sam .yui-navset-left .yui-nav .selected a,
+.yui-skin-sam .yui-navset-left .yui-nav a:hover,
+.yui-skin-sam .yui-navset-right .yui-nav a,
+.yui-skin-sam .yui-navset-right .yui-nav .selected a,
+.yui-skin-sam .yui-navset-right .yui-nav a:hover,
+.yui-skin-sam .yui-navset-bottom .yui-nav a,
+.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,
+.yui-skin-sam .yui-navset-bottom .yui-nav a:hover {
+    background-image:none; /* no left-right or bottom-top gradient */
+}
+
+.yui-skin-sam .yui-navset-left .yui-content {
+    border:1px solid #808080; /* content border */
+    border-left-color:#243356; /* different border color */
+}
+
+/* bottom orientation */
+.yui-skin-sam .yui-navset-bottom .yui-nav,
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav {
+    border-width:5px 0 0; /* color between tab list and content */
+}
+
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,
+.yui-skin-sam .yui-navset-bottom .yui-nav .selected { 
+    margin:-1px 0.16em 0 0; /* for overlap */
+}
+
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,
+.yui-skin-sam .yui-navset-bottom .yui-nav li { 
+    padding:0 0 1px 0; /* gecko: make room for overflow */
+    vertical-align:top;
+}
+
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,
+.yui-skin-sam .yui-navset-bottom .yui-nav li a { 
+}
+
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,
+.yui-skin-sam .yui-navset-bottom .yui-nav a em {
+    border-width:0 0 1px;
+    top:auto;
+    bottom:-1px; /* for 1px rounded corners */
+}
+
+.yui-skin-sam .yui-navset-bottom .yui-content,
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content {
+    border:1px solid #808080; /* content border */
+    border-bottom-color:#243356; /* different border color */
+}
+
diff --git a/lib/yui/tabview/assets/skins/sam/tabview.css b/lib/yui/tabview/assets/skins/sam/tabview.css
new file mode 100755 (executable)
index 0000000..81f30b0
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{Xoutline:0;}.yui-navset .yui-nav a{Xposition:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(../../../../assets/skins/sam/sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(../../../../assets/skins/sam/sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(../../../../assets/skins/sam/sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;}
diff --git a/lib/yui/tabview/assets/tabview-core.css b/lib/yui/tabview/assets/tabview-core.css
new file mode 100755 (executable)
index 0000000..0d072c1
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* default space between tabs */
+.yui-navset .yui-nav li,
+.yui-navset .yui-navset-top .yui-nav li,
+.yui-navset .yui-navset-bottom .yui-nav li {
+    margin:0 0.5em 0 0; /* horizontal tabs */
+}
+.yui-navset-left .yui-nav li,
+.yui-navset-right .yui-nav li {
+    margin:0 0 0.5em; /* vertical tabs */
+}
+
+/* default width for side tabs */
+.yui-navset .yui-navset-left .yui-nav,
+.yui-navset .yui-navset-right .yui-nav,
+.yui-navset-left .yui-nav,
+.yui-navset-right .yui-nav { width:6em; }
+.yui-navset-top .yui-nav,
+.yui-navset-bottom .yui-nav {
+    width:auto;
+}
+.yui-navset .yui-navset-left,
+.yui-navset-left { padding:0 0 0 6em; } /* map to nav width */
+.yui-navset-right { padding:0 6em 0 0; } /* ditto */
+
+.yui-navset-top,
+.yui-navset-bottom {
+    padding:auto;
+}
+/* core */
+
+.yui-nav,
+.yui-nav li {
+    margin:0;
+    padding:0;
+    list-style:none;
+}
+.yui-navset li em { font-style:normal; }
+
+.yui-navset {
+    position:relative; /* contain absolute positioned tabs (left/right) */
+    zoom:1;
+}
+
+.yui-navset .yui-content { zoom:1; }
+
+.yui-navset .yui-nav li,
+.yui-navset .yui-navset-top .yui-nav li, /* in case nested */
+.yui-navset .yui-navset-bottom .yui-nav li {
+    display:inline-block;
+    display:-moz-inline-stack;
+    *display:inline; /* IE */
+    vertical-align:bottom; /* safari: for overlap */
+    cursor:pointer; /* gecko: due to -moz-inline-stack on anchor */
+    zoom:1; /* IE: kill space between horizontal tabs */
+}
+
+.yui-navset-left .yui-nav li,
+.yui-navset-right .yui-nav li {
+    display:block;
+}
+
+.yui-navset .yui-nav a {
+    Xoutline:0; /* gecko: keep from shifting */
+}
+
+.yui-navset .yui-nav a { position:relative; } /* IE: to allow overlap */
+
+.yui-navset .yui-nav li a,
+.yui-navset-top .yui-nav li a,
+.yui-navset-bottom .yui-nav li a {
+    display:block;
+    display:inline-block;
+    vertical-align:bottom; /* safari: for overlap */
+    zoom:1;
+}
+
+.yui-navset-left .yui-nav li a,
+.yui-navset-right .yui-nav li a {
+    display:block;
+}
+
+.yui-navset-bottom .yui-nav li a {
+    vertical-align:text-top; /* for inline overlap (reverse for Opera border bug) */
+}
+
+.yui-navset .yui-nav li a em,
+.yui-navset-top .yui-nav li a em,
+.yui-navset-bottom .yui-nav li a em { display:block; }
+
+/* position left and right oriented tabs */
+.yui-navset .yui-navset-left .yui-nav,
+.yui-navset .yui-navset-right .yui-nav,
+.yui-navset-left .yui-nav,
+.yui-navset-right .yui-nav {
+   position:absolute;
+   z-index:1; 
+}
+
+.yui-navset-top .yui-nav,
+.yui-navset-bottom .yui-nav {
+    position:static;
+}
+.yui-navset .yui-navset-left .yui-nav,
+.yui-navset-left .yui-nav { left:0; right:auto; }
+
+.yui-navset .yui-navset-right .yui-nav,
+.yui-navset-right .yui-nav { right:0; left:auto; }
diff --git a/lib/yui/tabview/assets/tabview.css b/lib/yui/tabview/assets/tabview.css
new file mode 100644 (file)
index 0000000..f42457e
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* default space between tabs */
+.yui-navset .yui-nav li {
+    margin-right:0.5em; /* horizontal tabs */
+}
+.yui-navset-left .yui-nav li, .yui-navset-right .yui-nav li {
+    margin:0 0 0.5em; /* vertical tabs */
+}
+
+/* default width for side tabs */
+.yui-navset-left .yui-nav, .yui-navset-right .yui-nav { width:6em; }
+.yui-navset-left { padding-left:6em; } /* map to nav width */
+.yui-navset-right { padding-right:6em; } /* ditto */
+
+/* core */
+
+.yui-nav, .yui-nav li {
+    margin:0;
+    padding:0;
+    list-style:none;
+}
+.yui-navset li em { font-style:normal; }
+
+.yui-navset {
+    position:relative; /* contain absolute positioned tabs (left/right) */
+    zoom:1;
+}
+
+.yui-navset .yui-content { zoom:1; }
+
+.yui-navset .yui-nav li {
+    display:inline-block;
+    display:-moz-inline-stack;
+    *display:inline; /* IE */
+    vertical-align:bottom; /* safari: for overlap */
+    cursor:pointer; /* gecko: due to -moz-inline-stack on anchor */
+    zoom:1; /* IE: kill space between horizontal tabs */
+}
+
+.yui-navset-left .yui-nav li, .yui-navset-right .yui-nav li {
+    display:block;
+}
+
+.yui-navset .yui-nav a {
+    outline:0; /* gecko: keep from shifting */
+}
+
+.yui-navset .yui-nav a { position:relative; } /* IE: to allow overlap */
+
+.yui-navset .yui-nav li a {
+    display:block;
+    display:inline-block;
+    vertical-align:bottom; /* safari: for overlap */
+    zoom:1;
+}
+
+.yui-navset-left .yui-nav li a, .yui-navset-right .yui-nav li a {
+    display:block;
+}
+
+.yui-navset-bottom .yui-nav li a {
+    vertical-align:text-top; /* for inline overlap (reverse for Op border bug) */
+}
+
+.yui-navset .yui-nav li a em { display:block; }
+
+/* position left and right oriented tabs */
+.yui-navset-left .yui-nav, .yui-navset-right .yui-nav { position:absolute; z-index:1; }
+.yui-navset-left .yui-nav { left:0; }
+.yui-navset-right .yui-nav { right:0; }
index 4dd2b0323f4e88413e6b825d0f74e18521bb49df..068d438d6a25678b177f956db003bdc287721c52 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-YAHOO.util.Lang = {
-    isArray: function(val) { // frames lose type, so test constructor string
-        if (val.constructor && val.constructor.toString().indexOf('Array') > -1) {
-            return true;
-        } else {
-            return YAHOO.util.Lang.isObject(val) && val.constructor == Array;
+(function() {
+
+    /**
+     * The tabview module provides a widget for managing content bound to tabs.
+     * @module tabview
+     * @requires yahoo, dom, event, element
+     *
+     */
+    /**
+     * A widget to control tabbed views.
+     * @namespace YAHOO.widget
+     * @class TabView
+     * @extends YAHOO.util.Element
+     * @constructor
+     * @param {HTMLElement | String | Object} el(optional) The html 
+     * element that represents the TabView, or the attribute object to use. 
+     * An element will be created if none provided.
+     * @param {Object} attr (optional) A key map of the tabView's 
+     * initial attributes.  Ignored if first arg is attributes object.
+     */
+    YAHOO.widget.TabView = function(el, attr) {
+        attr = attr || {};
+        if (arguments.length == 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
+            attr = el; // treat first arg as attr object
+            el = attr.element || null;
         }
-    },
         
-    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';
-    }
-};
-
-/**
- * Provides Attribute configurations.
- * @namespace YAHOO.util
- * @class Attribute
- * @constructor
- * @param hash {Object} The intial Attribute.
- * @param {YAHOO.util.AttributeProvider} The owner of the Attribute instance.
- */
-
-YAHOO.util.Attribute = function(hash, owner) {
-    if (owner) { 
-        this.owner = owner;
-        this.configure(hash, true);
-    }
-};
+        if (!el && !attr.element) { // create if we dont have one
+            el = _createTabViewElement.call(this, attr);
+        }
+       YAHOO.widget.TabView.superclass.constructor.call(this, el, attr); 
+    };
 
-YAHOO.util.Attribute.prototype = {
-       /**
-     * The name of the attribute.
-        * @property name
-        * @type String
-        */
-    name: undefined,
-    
-       /**
-     * The value of the attribute.
-        * @property value
-        * @type String
-        */
-    value: null,
-    
-       /**
-     * The owner of the attribute.
-        * @property owner
-        * @type YAHOO.util.AttributeProvider
-        */
-    owner: null,
-    
-       /**
-     * Whether or not the attribute is read only.
-        * @property readOnly
-        * @type Boolean
-        */
-    readOnly: false,
+    YAHOO.extend(YAHOO.widget.TabView, YAHOO.util.Element);
     
-       /**
-     * Whether or not the attribute can only be written once.
-        * @property writeOnce
-        * @type Boolean
-        */
-    writeOnce: false,
-
-       /**
-     * The attribute's initial configuration.
-     * @private
-        * @property _initialConfig
-        * @type Object
-        */
-    _initialConfig: null,
+    var proto = YAHOO.widget.TabView.prototype;
+    var Dom = YAHOO.util.Dom;
+    var Event = YAHOO.util.Event;
+    var Tab = YAHOO.widget.Tab;
     
-       /**
-     * Whether or not the attribute's value has been set.
-     * @private
-        * @property _written
-        * @type Boolean
-        */
-    _written: false,
     
-       /**
-     * The method to use when setting the attribute's value.
-     * The method recieves the new value as the only argument.
-        * @property method
-        * @type Function
-        */
-    method: null,
+    /**
+     * The className to add when building from scratch. 
+     * @property CLASSNAME
+     * @default "navset"
+     */
+    proto.CLASSNAME = 'yui-navset';
     
-       /**
-     * The validator to use when setting the attribute's value.
-        * @property validator
-        * @type Function
-     * @return Boolean
-        */
-    validator: null,
+    /**
+     * The className of the HTMLElement containing the TabView's tab elements
+     * to look for when building from existing markup, or to add when building
+     * from scratch. 
+     * All childNodes of the tab container are treated as Tabs when building
+     * from existing markup.
+     * @property TAB_PARENT_CLASSNAME
+     * @default "nav"
+     */
+    proto.TAB_PARENT_CLASSNAME = 'yui-nav';
     
     /**
-     * Retrieves the current value of the attribute.
-     * @method getValue
-     * @return {any} The current value of the attribute.
+     * The className of the HTMLElement containing the TabView's label elements
+     * to look for when building from existing markup, or to add when building
+     * from scratch. 
+     * All childNodes of the content container are treated as content elements when
+     * building from existing markup.
+     * @property CONTENT_PARENT_CLASSNAME
+     * @default "nav-content"
      */
-    getValue: function() {
-        return this.value;
-    },
+    proto.CONTENT_PARENT_CLASSNAME = 'yui-content';
+    
+    proto._tabParent = null;
+    proto._contentParent = null; 
     
     /**
-     * Sets the value of the attribute and fires beforeChange and change events.
-     * @method setValue
-     * @param {Any} value The value to apply to the attribute.
-     * @param {Boolean} silent If true the change events will not be fired.
-     * @return {Boolean} Whether or not the value was set.
+     * Adds a Tab to the TabView instance.  
+     * If no index is specified, the tab is added to the end of the tab list.
+     * @method addTab
+     * @param {YAHOO.widget.Tab} tab A Tab instance to add.
+     * @param {Integer} index The position to add the tab. 
+     * @return void
      */
-    setValue: function(value, silent) {
-        var beforeRetVal;
-        var owner = this.owner;
-        var name = this.name;
+    proto.addTab = function(tab, index) {
+        var tabs = this.get('tabs');
+        if (!tabs) { // not ready yet
+            this._queue[this._queue.length] = ['addTab', arguments];
+            return false;
+        }
         
-        var event = {
-            type: name, 
-            prevValue: this.getValue(),
-            newValue: value
-        };
+        index = (index === undefined) ? tabs.length : index;
         
-        if (this.readOnly || ( this.writeOnce && this._written) ) {
-            return false; // write not allowed
-        }
+        var before = this.getTab(index);
         
-        if (this.validator && !this.validator.call(owner, value) ) {
-            return false; // invalid value
-        }
+        var self = this;
+        var el = this.get('element');
+        var tabParent = this._tabParent;
+        var contentParent = this._contentParent;
 
-        if (!silent) {
-            beforeRetVal = owner.fireBeforeChangeEvent(event);
-            if (beforeRetVal === false) {
-                YAHOO.log('setValue ' + name + 
-                        'cancelled by beforeChange event', 'info', 'Attribute');
-                return false;
-            }
+        var tabElement = tab.get('element');
+        var contentEl = tab.get('contentEl');
+
+        if ( before ) {
+            tabParent.insertBefore(tabElement, before.get('element'));
+        } else {
+            tabParent.appendChild(tabElement);
         }
 
-        if (this.method) {
-            this.method.call(owner, value);
+        if ( contentEl && !Dom.isAncestor(contentParent, contentEl) ) {
+            contentParent.appendChild(contentEl);
         }
         
-        this.value = value;
-        this._written = true;
+        if ( !tab.get('active') ) {
+            tab.set('contentVisible', false, true); /* hide if not active */
+        } else {
+            this.set('activeTab', tab, true);
+            
+        }
+
+        var activate = function(e) {
+            YAHOO.util.Event.preventDefault(e);
+            var silent = false;
+
+            if (this == self.get('activeTab')) {
+                silent = true; // dont fire activeTabChange if already active
+            }
+            self.set('activeTab', this, silent);
+        };
         
-        event.type = name;
+        tab.addListener( tab.get('activationEvent'), activate);
         
-        if (!silent) {
-            this.owner.fireChangeEvent(event);
-        }
+        tab.addListener('activationEventChange', function(e) {
+            if (e.prevValue != e.newValue) {
+                tab.removeListener(e.prevValue, activate);
+                tab.addListener(e.newValue, activate);
+            }
+        });
         
-        return true;
-    },
-    
+        tabs.splice(index, 0, tab);
+    };
+
     /**
-     * Allows for configuring the Attribute's properties.
-     * @method configure
-     * @param {Object} map A key-value map of Attribute properties.
-     * @param {Boolean} init Whether or not this should become the initial config.
+     * Routes childNode events.
+     * @method DOMEventHandler
+     * @param {event} e The Dom event that is being handled.
+     * @return void
      */
-    configure: function(map, init) {
-        map = map || {};
-        this._written = false; // reset writeOnce
-        this._initialConfig = this._initialConfig || {};
+    proto.DOMEventHandler = function(e) {
+        var el = this.get('element');
+        var target = YAHOO.util.Event.getTarget(e);
+        var tabParent = this._tabParent;
         
-        for (var key in map) {
-            if ( key && map.hasOwnProperty(key) ) {
-                this[key] = map[key];
-                if (init) {
-                    this._initialConfig[key] = map[key];
+        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; // note break
                 }
+            } 
+            
+            if (tab) {
+                tab.fireEvent(e.type, e);
             }
         }
-    },
+    };
     
     /**
-     * Resets the value to the initial config value.
-     * @method resetValue
-     * @return {Boolean} Whether or not the value was set.
+     * Returns the Tab instance at the specified index.
+     * @method getTab
+     * @param {Integer} index The position of the Tab.
+     * @return YAHOO.widget.Tab
      */
-    resetValue: function() {
-        return this.setValue(this._initialConfig.value);
-    },
+    proto.getTab = function(index) {
+       return this.get('tabs')[index];
+    };
     
     /**
-     * Resets the attribute config to the initial config state.
-     * @method resetConfig
+     * Returns the index of given tab.
+     * @method getTabIndex
+     * @param {YAHOO.widget.Tab} tab The tab whose index will be returned.
+     * @return int
      */
-    resetConfig: function() {
-        this.configure(this._initialConfig);
-    },
+    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;
+    };
     
     /**
-     * Resets the value to the current value.
-     * Useful when values may have gotten out of sync with actual properties.
-     * @method refresh
-     * @return {Boolean} Whether or not the value was set.
+     * Removes the specified Tab from the TabView.
+     * @method removeTab
+     * @param {YAHOO.widget.Tab} item The Tab instance to be removed.
+     * @return void
      */
-    refresh: function(silent) {
-        this.setValue(this.value, silent);
-    }
-};
-
-(function() {
-    var Lang = YAHOO.util.Lang;
+    proto.removeTab = function(tab) {
+        var tabCount = this.get('tabs').length;
 
-    /*
-    Copyright (c) 2006, Yahoo! Inc. All rights reserved.
-    Code licensed under the BSD License:
-    http://developer.yahoo.net/yui/license.txt
-    */
+        var index = this.getTabIndex(tab);
+        var nextIndex = index + 1;
+        if ( tab == this.get('activeTab') ) { // select next tab
+            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);
+       
+    };
+    
+    /**
+     * Provides a readable name for the TabView instance.
+     * @method toString
+     * @return String
+     */
+    proto.toString = function() {
+        var name = this.get('id') || this.get('tagName');
+        return "TabView " + name; 
+    };
     
     /**
-     * Provides and manages YAHOO.util.Attribute instances
-     * @namespace YAHOO.util
-     * @class AttributeProvider
-     * @uses YAHOO.util.EventProvider
+     * The transiton to use when switching between tabs.
+     * @method contentTransition
      */
-    YAHOO.util.AttributeProvider = function() {};
+    proto.contentTransition = function(newTab, oldTab) {
+        newTab.set('contentVisible', true);
+        oldTab.set('contentVisible', false);
+    };
     
-    YAHOO.util.AttributeProvider.prototype = {
+    /**
+     * setAttributeConfigs TabView specific properties.
+     * @method initAttributes
+     * @param {Object} attr Hash of initial attributes
+     */
+    proto.initAttributes = function(attr) {
+        YAHOO.widget.TabView.superclass.initAttributes.call(this, attr);
+        
+        if (!attr.orientation) {
+            attr.orientation = 'top';
+        }
+        
+        var el = this.get('element');
+
+        if (!YAHOO.util.Dom.hasClass(el, this.CLASSNAME)) {
+            YAHOO.util.Dom.addClass(el, this.CLASSNAME);        
+        }
         
         /**
-         * A key-value map of Attribute configurations
-         * @property _configs
-         * @protected (may be used by subclasses and augmentors)
-         * @private
-         * @type {Object}
+         * The Tabs belonging to the TabView instance.
+         * @config tabs
+         * @type Array
          */
-        _configs: null,
+        this.setAttributeConfig('tabs', {
+            value: [],
+            readOnly: true
+        });
+
         /**
-         * Returns the current value of the attribute.
-         * @method get
-         * @param {String} key The attribute whose value will be returned.
+         * The container of the tabView's label elements.
+         * @property _tabParent
+         * @private
+         * @type HTMLElement
          */
-        get: function(key){
-            var configs = this._configs || {};
-            var config = configs[key];
-            
-            if (!config) {
-                YAHOO.log(key + ' not found', 'error', 'AttributeProvider');
-                return undefined;
-            }
+        this._tabParent = 
+                this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,
+                        'ul' )[0] || _createTabParent.call(this);
             
-            return config.value;
-        },
-        
         /**
-         * Sets the value of a config.
-         * @method set
-         * @param {String} key The name of the attribute
-         * @param {Any} value The value to apply to the attribute
-         * @param {Boolean} silent Whether or not to suppress change events
-         * @return {Boolean} Whether or not the value was set.
-         */
-        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);
-        },
-    
-        /**
-         * Returns an array of attribute names.
-         * @method getAttributeKeys
-         * @return {Array} An array of attribute names.
+         * The container of the tabView's content elements.
+         * @property _contentParent
+         * @type HTMLElement
+         * @private
          */
-        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;
-        },
+        this._contentParent = 
+                this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,
+                        'div')[0] ||  _createContentParent.call(this);
         
         /**
-         * Sets multiple attribute values.
-         * @method setAttributes
-         * @param {Object} map  A key-value map of attributes
-         * @param {Boolean} silent Whether or not to suppress change events
+         * How the Tabs should be oriented relative to the TabView.
+         * @config orientation
+         * @type String
+         * @default "top"
          */
-        setAttributes: function(map, silent){
-            for (var key in map) {
-                if ( map.hasOwnProperty(key) ) {
-                    this.set(key, map[key], silent);
+        this.setAttributeConfig('orientation', {
+            value: attr.orientation,
+            method: function(value) {
+                var current = this.get('orientation');
+                this.addClass('yui-navset-' + value);
+                
+                if (current != value) {
+                    this.removeClass('yui-navset-' + current);
                 }
-            }
-        },
-    
-        /**
-         * Resets the specified attribute's value to its initial value.
-         * @method resetValue
-         * @param {String} key The name of the attribute
-         * @param {Boolean} silent Whether or not to suppress change events
-         * @return {Boolean} Whether or not the value was set
-         */
-        resetValue: function(key, silent){
-            var configs = this._configs || {};
-            if (configs[key]) {
-                this.set(key, configs[key]._initialConfig.value, silent);
-                return true;
-            }
-            return false;
-        },
-    
-        /**
-         * Sets the attribute's value to its current value.
-         * @method refresh
-         * @param {String | Array} key The attribute(s) to refresh
-         * @param {Boolean} silent Whether or not to suppress change events
-         */
-        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 ( // only set if there is a value and not null
-                    configs[key[i]] && 
-                    ! Lang.isUndefined(configs[key[i]].value) &&
-                    ! Lang.isNull(configs[key[i]].value) ) {
-                    configs[key[i]].refresh(silent);
+                
+                switch(value) {
+                    case 'bottom':
+                    this.appendChild(this._tabParent);
+                    break;
                 }
             }
-        },
-    
+        });
+        
         /**
-         * Adds an Attribute to the AttributeProvider instance. 
-         * @method register
-         * @param {String} key The attribute's name
-         * @param {Object} map A key-value map containing the
-         * attribute's properties.
+         * The index of the tab currently active.
+         * @config activeIndex
+         * @type Int
          */
-        register: function(key, map) {
-            this._configs = this._configs || {};
-            
-            if (this._configs[key]) { // dont override
-                return false;
+        this.setAttributeConfig('activeIndex', {
+            value: attr.activeIndex,
+            method: function(value) {
+                this.set('activeTab', this.getTab(value));
+            },
+            validator: function(value) {
+                return !this.getTab(value).get('disabled'); // cannot activate if disabled
             }
-            
-            map.name = key;
-            this._configs[key] = new YAHOO.util.Attribute(map, this);
-            return true;
-        },
+        });
         
         /**
-         * Returns the attribute's properties.
-         * @method getAttributeConfig
-         * @param {String} key The attribute's name
-         * @private
-         * @return {object} A key-value map containing all of the
-         * attribute's properties.
+         * The tab currently active.
+         * @config activeTab
+         * @type YAHOO.widget.Tab
          */
-        getAttributeConfig: function(key) {
-            var configs = this._configs || {};
-            var config = configs[key] || {};
-            var map = {}; // returning a copy to prevent overrides
-            
-            for (key in config) {
-                if ( config.hasOwnProperty(key) ) {
-                    map[key] = config[key];
+        this.setAttributeConfig('activeTab', {
+            value: attr.activeTab,
+            method: function(tab) {
+                var activeTab = this.get('activeTab');
+                
+                if (tab) {  
+                    tab.set('active', true);
+                    this._configs['activeIndex'].value = this.getTabIndex(tab); // keep in sync
+                }
+                
+                if (activeTab && activeTab != tab) {
+                    activeTab.set('active', false);
                 }
+                
+                if (activeTab && tab != activeTab) { // no transition if only 1
+                    this.contentTransition(tab, activeTab);
+                } else if (tab) {
+                    tab.set('contentVisible', true);
+                }
+            },
+            validator: function(value) {
+                return !value.get('disabled'); // cannot activate if disabled
             }
-    
-            return map;
-        },
+        });
+
+        if ( this._tabParent ) {
+            _initTabs.call(this);
+        }
         
-        /**
-         * Sets or updates an Attribute instance's properties. 
-         * @method configureAttribute
-         * @param {String} key The attribute's name.
-         * @param {Object} map A key-value map of attribute properties
-         * @param {Boolean} init Whether or not this should become the intial config.
-         */
-        configureAttribute: function(key, map, init) {
-            var configs = this._configs || {};
-            
-            if (!configs[key]) {
-                YAHOO.log('unable to configure, ' + key + ' not found',
-                        'error', 'AttributeProvider');
-                return false;
+        // Due to delegation we add all DOM_EVENTS to the TabView container
+        // but IE will leak when unsupported events are added, so remove these
+        this.DOM_EVENTS.submit = false;
+        this.DOM_EVENTS.focus = false;
+        this.DOM_EVENTS.blur = false;
+
+        for (var type in this.DOM_EVENTS) {
+            if ( YAHOO.lang.hasOwnProperty(this.DOM_EVENTS, type) ) {
+                this.addListener.call(this, type, this.DOMEventHandler);
             }
-            
-            configs[key].configure(map, init);
-        },
-        
-        /**
-         * Resets an attribute to its intial configuration. 
-         * @method resetAttributeConfig
-         * @param {String} key The attribute's name.
-         * @private
-         */
-        resetAttributeConfig: function(key){
-            var configs = this._configs || {};
-            configs[key].resetConfig();
-        },
-        
-        /**
-         * Fires the attribute's beforeChange event. 
-         * @method fireBeforeChangeEvent
-         * @param {String} key The attribute's name.
-         * @param {Obj} e The event object to pass to handlers.
-         */
-        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);
-        },
-        
-        /**
-         * Fires the attribute's change event. 
-         * @method fireChangeEvent
-         * @param {String} key The attribute's name.
-         * @param {Obj} e The event object to pass to the handlers.
-         */
-        fireChangeEvent: function(e) {
-            e.type += 'Change';
-            return this.fireEvent(e.type, e);
         }
     };
     
-    YAHOO.augment(YAHOO.util.AttributeProvider, YAHOO.util.EventProvider);
-})();
-
-(function() {
-// internal shorthand
-var Dom = YAHOO.util.Dom,
-    Lang = YAHOO.util.Lang,
-    EventPublisher = YAHOO.util.EventPublisher,
-    AttributeProvider = YAHOO.util.AttributeProvider;
-
-/**
- * Element provides an interface to an HTMLElement's attributes and common
- * methods.  Other commonly used attributes are added as well.
- * @namespace YAHOO.util
- * @class Element
- * @uses YAHOO.util.AttributeProvider
- * @constructor
- * @param el {HTMLElement | String} The html element that 
- * represents the Element.
- * @param {Object} map A key-value map of initial config names and values
- */
-YAHOO.util.Element = function(el, map) {
-    if (arguments.length) {
-        this.init(el, map);
-    }
-};
-
-YAHOO.util.Element.prototype = {
-       /**
-     * Dom events supported by the Element instance.
-        * @property DOM_EVENTS
-        * @type Object
-        */
-    DOM_EVENTS: null,
-
-       /**
-     * Wrapper for HTMLElement method.
-        * @method appendChild
-        * @param {Boolean} deep Whether or not to do a deep clone
-        */
-    appendChild: function(child) {
-        child = child.get ? child.get('element') : child;
-        this.get('element').appendChild(child);
-    },
-    
-       /**
-     * Wrapper for HTMLElement method.
-        * @method getElementsByTagName
-        * @param {String} tag The tagName to collect
-        */
-    getElementsByTagName: function(tag) {
-        return this.get('element').getElementsByTagName(tag);
-    },
-    
-       /**
-     * Wrapper for HTMLElement method.
-        * @method hasChildNodes
-        * @return {Boolean} Whether or not the element has childNodes
-        */
-    hasChildNodes: function() {
-        return this.get('element').hasChildNodes();
-    },
-    
-       /**
-     * Wrapper for HTMLElement method.
-        * @method insertBefore
-        * @param {HTMLElement} element The HTMLElement to insert
-        * @param {HTMLElement} before The HTMLElement to insert
-     * the element before.
-        */
-    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);
-    },
-    
-       /**
-     * Wrapper for HTMLElement method.
-        * @method removeChild
-        * @param {HTMLElement} child The HTMLElement to remove
-        */
-    removeChild: function(child) {
-        child = child.get ? child.get('element') : child;
-        this.get('element').removeChild(child);
-        return true;
-    },
-    
-       /**
-     * Wrapper for HTMLElement method.
-        * @method replaceChild
-        * @param {HTMLElement} newNode The HTMLElement to insert
-        * @param {HTMLElement} oldNode The HTMLElement to replace
-        */
-    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);
-    },
-
-    
     /**
-     * Registers Element specific attributes.
-     * @method initAttributes
-     * @param {Object} map A key-value map of initial attribute configs
+     * Creates Tab instances from a collection of HTMLElements.
+     * @method initTabs
+     * @private
+     * @return void
      */
-    initAttributes: function(map) {
-        map = map || {}; 
-        var element = Dom.get(map.element) || null;
-        
-        /**
-         * The HTMLElement the Element instance refers to.
-         * @config element
-         * @type HTMLElement
-         */
-        this.register('element', {
-            value: element,
-            readOnly: true
-         });
-    },
+    var _initTabs = function() {
+        var tab,
+            attr,
+            contentEl;
+            
+        var el = this.get('element');   
+        var tabs = _getChildNodes(this._tabParent);
+        var contentElements = _getChildNodes(this._contentParent);
 
-    /**
-     * Adds a listener for the given event.  These may be DOM or 
-     * customEvent listeners.  Any event that is fired via fireEvent
-     * can be listened for.  All handlers receive an event object. 
-     * @method addListener
-     * @param {String} type The name of the event to listen for
-     * @param {Function} fn The handler to call when the event fires
-     * @param {Any} obj A variable to pass to the handler
-     * @param {Object} scope The object to use for the scope of the handler 
-     */
-    addListener: function(type, fn, obj, scope) {
-        var el = this.get('element');
-        var scope = scope || this;
-        
-        el = this.get('id') || el;
-        
-        if (!this._events[type]) { // create on the fly
-            if ( this.DOM_EVENTS[type] ) {
-                YAHOO.util.Event.addListener(el, type, function(e) {
-                    if (e.srcElement && !e.target) { // supplement IE with target
-                        e.target = e.srcElement;
-                    }
-                    this.fireEvent(type, e);
-                }, obj, scope);
-            }
+        for (var i = 0, len = tabs.length; i < len; ++i) {
+            attr = {};
             
-            this.createEvent(type, this);
-            this._events[type] = true;
-        }
-        
-        this.subscribe.apply(this, arguments); // notify via customEvent
-    },
-    
-    
-    /**
-     * Alias for addListener
-     * @method on
-     * @param {String} type The name of the event to listen for
-     * @param {Function} fn The function call when the event fires
-     * @param {Any} obj A variable to pass to the handler
-     * @param {Object} scope The object to use for the scope of the handler 
-     */
-    on: function() { this.addListener.apply(this, arguments); },
-    
-    
-    /**
-     * Remove an event listener
-     * @method removeListener
-     * @param {String} type The name of the event to listen for
-     * @param {Function} fn The function call when the event fires
-     */
-    removeListener: function(type, fn) {
-        this.unsubscribe.apply(this, arguments);
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method addClass
-        * @param {String} className The className to add
-        */
-    addClass: function(className) {
-        Dom.addClass(this.get('element'), className);
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method getElementsByClassName
-        * @param {String} className The className to collect
-        * @param {String} tag (optional) The tag to use in
-     * conjunction with class name
-     * @return {Array} Array of HTMLElements
-        */
-    getElementsByClassName: function(className, tag) {
-        return Dom.getElementsByClassName(className, tag,
-                this.get('element') );
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method hasClass
-        * @param {String} className The className to add
-     * @return {Boolean} Whether or not the element has the class name
-        */
-    hasClass: function(className) {
-        return Dom.hasClass(this.get('element'), className); 
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method removeClass
-        * @param {String} className The className to remove
-        */
-    removeClass: function(className) {
-        return Dom.removeClass(this.get('element'), className);
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method replaceClass
-        * @param {String} oldClassName The className to replace
-        * @param {String} newClassName The className to add
-        */
-    replaceClass: function(oldClassName, newClassName) {
-        return Dom.replaceClass(this.get('element'), 
-                oldClassName, newClassName);
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method setStyle
-        * @param {String} property The style property to set
-        * @param {String} value The value to apply to the style property
-        */
-    setStyle: function(property, value) {
-        return Dom.setStyle(this.get('element'),  property, value);
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method getStyle
-        * @param {String} property The style property to retrieve
-        * @return {String} The current value of the property
-        */
-    getStyle: function(property) {
-        return Dom.getStyle(this.get('element'),  property);
-    },
-    
-       /**
-     * Apply any queued set calls.
-        * @method fireQueue
-        */
-    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]);
-        }
-    },
-    
-       /**
-     * Appends the HTMLElement into either the supplied parentNode.
-        * @method appendTo
-        * @param {HTMLElement | Element} parentNode The node to append to
-        * @param {HTMLElement | Element} before An optional node to insert before
-        */
-    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);
+            if (contentElements[i]) {
+                attr.contentEl = contentElements[i];
             }
-        }
-        
-        YAHOO.log(element + 'appended to ' + parent);
-        
-        if (!newAddition) {
-            return false; // note return; no refresh if in document
-        }
-        
-        // if a new addition, refresh HTMLElement any applied attributes
-        var keys = this.getAttributeKeys();
-        
-        for (var key in keys) { // only refresh HTMLElement attributes
-            if ( !Lang.isUndefined(element[key]) ) {
-                this.refresh(key);
+
+            tab = new YAHOO.widget.Tab(tabs[i], attr);
+            this.addTab(tab);
+            
+            if (tab.hasClass(tab.ACTIVE_CLASSNAME) ) {
+                this._configs.activeTab.value = tab; // dont invoke method
+                this._configs.activeIndex.value = this.getTabIndex(tab);
             }
         }
-    },
+    };
     
-    get: function(key) {
-        var configs = this._configs || {};
-        var el = configs.element; // avoid loop due to 'element'
-        if (el && !configs[key] && !Lang.isUndefined(el.value[key]) ) {
-            return el.value[key];
-        }
-
-        return AttributeProvider.prototype.get.call(this, key);
-    },
+    var _createTabViewElement = function(attr) {
+        var el = document.createElement('div');
 
-    set: function(key, value, silent) {
-        var el = this.get('element');
-        if (!el) {
-            this._queue[this._queue.length] = ['set', arguments];
-            return false;
+        if ( this.CLASSNAME ) {
+            el.className = this.CLASSNAME;
         }
         
-        // set it on the element if not a property
-        if ( !this._configs[key] && !Lang.isUndefined(el[key]) ) {
-            _registerHTMLAttr.call(this, key);
-        }
-
-        return AttributeProvider.prototype.set.apply(this, arguments);
-    },
+        return el;
+    };
     
-    register: function(key) { // protect html attributes
-        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;
+    var _createTabParent = function(attr) {
+        var el = document.createElement('ul');
+
+        if ( this.TAB_PARENT_CLASSNAME ) {
+            el.className = this.TAB_PARENT_CLASSNAME;
         }
         
-        return AttributeProvider.prototype.register.apply(this, arguments);
-    },
+        this.get('element').appendChild(el);
+        
+        return el;
+    };
     
-    configureAttribute: function(property, map, init) { // protect html attributes
-        var el = this.get('element');
-        if (!el) {
-            this._queue[this._queue.length] = ['configureAttribute', arguments];
-            return;
+    var _createContentParent = function(attr) {
+        var el = document.createElement('div');
+
+        if ( this.CONTENT_PARENT_CLASSNAME ) {
+            el.className = this.CONTENT_PARENT_CLASSNAME;
         }
         
-        if (!this._configs[property] && !Lang.isUndefined(el[property]) ) {
-            _registerHTMLAttr.call(this, property, map);
-        }
+        this.get('element').appendChild(el);
         
-        return AttributeProvider.prototype.configureAttribute.apply(this, arguments);
-    },
+        return el;
+    };
     
-    getAttributeKeys: function() {
-        var el = this.get('element');
-        var keys = AttributeProvider.prototype.getAttributeKeys.call(this);
+    var _getChildNodes = function(el) {
+        var nodes = [];
+        var childNodes = el.childNodes;
         
-        //add any unconfigured element keys
-        for (var key in el) {
-            if (!this._configs[key]) {
-                keys[key] = keys[key] || el[key];
+        for (var i = 0, len = childNodes.length; i < len; ++i) {
+            if (childNodes[i].nodeType == 1) {
+                nodes[nodes.length] = childNodes[i];
             }
         }
         
-        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.call(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);
-        }        
-    }
-};
-
-/**
- * Sets the value of the property and fires beforeChange and change events.
- * @private
- * @method _registerHTMLAttr
- * @param {YAHOO.util.Element} element The Element instance to
- * register the config to.
- * @param {String} key The name of the config to register
- * @param {Object} map A key-value map of the config's params
- */
-var _registerHTMLAttr = function(key, map) {
-    var el = this.get('element');
-    map = map || {};
-    map.name = key;
-    map.method = map.method || function(value) {
-        el[key] = value;
+        return nodes;
     };
-    map.value = map.value || el[key];
-    this._configs[key] = new YAHOO.util.Attribute(map, this);
-};
 
 /**
- * Fires when the Element's HTMLElement can be retrieved by Id.
- * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * Fires before the activeTab is changed.
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
+ * <p>If handler returns false, the change will be cancelled, and the value will not
+ * be set.</p>
  * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> available<br>
- * <code>&lt;HTMLElement&gt;
- * target</code> the HTMLElement bound to this Element instance<br>
+ * <code>&lt;String&gt; type</code> beforeActiveTabChange<br>
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
+ * prevValue</code> the currently active tab<br>
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
+ * newValue</code> the tab to be made active</p>
  * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var target = e.target};<br>
- * myTabs.addListener('available', handler);</code></p>
- * @event available
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>
+ * myTabs.addListener('beforeActiveTabChange', handler);</code></p>
+ * @event beforeActiveTabChange
+ */
+    
+/**
+ * Fires after the activeTab is changed.
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> activeTabChange<br>
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
+ * prevValue</code> the formerly active tab<br>
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
+ * newValue</code> the new active tab</p>
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>
+ * myTabs.addListener('activeTabChange', handler);</code></p>
+ * @event activeTabChange
  */
  
 /**
- * Fires when the Element's HTMLElement subtree is rendered.
- * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * Fires before the orientation is changed.
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
+ * <p>If handler returns false, the change will be cancelled, and the value will not
+ * be set.</p>
  * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> contentReady<br>
- * <code>&lt;HTMLElement&gt;
- * target</code> the HTMLElement bound to this Element instance<br>
+ * <code>&lt;String&gt; type</code> beforeOrientationChange<br>
+ * <code>&lt;String&gt;
+ * prevValue</code> the current orientation<br>
+ * <code>&lt;String&gt;
+ * newValue</code> the new orientation to be applied</p>
  * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var target = e.target};<br>
- * myTabs.addListener('contentReady', handler);</code></p>
- * @event contentReady
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>
+ * myTabs.addListener('beforeOrientationChange', handler);</code></p>
+ * @event beforeOrientationChange
+ */
+    
+/**
+ * Fires after the orientation is changed.
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> orientationChange<br>
+ * <code>&lt;String&gt;
+ * prevValue</code> the former orientation<br>
+ * <code>&lt;String&gt;
+ * newValue</code> the new orientation</p>
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>
+ * myTabs.addListener('orientationChange', handler);</code></p>
+ * @event orientationChange
  */
-
-
-YAHOO.augment(YAHOO.util.Element, AttributeProvider);
 })();
 
 (function() {
     var Dom = YAHOO.util.Dom,
-        Event = YAHOO.util.Event,
-        Lang = YAHOO.util.Lang;
+        Event = YAHOO.util.Event;
     
     /**
      * A representation of a Tab's label and content.
@@ -960,7 +545,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
      */
     var Tab = function(el, attr) {
         attr = attr || {};
-        if (arguments.length == 1 && !Lang.isString(el) && !el.nodeName) {
+        if (arguments.length == 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
             attr = el;
             el = attr.element;
         }
@@ -1033,6 +618,8 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
      * @type object
      */
     proto.loadHandler = null;
+
+    proto._loading = false;
     
     /**
      * Provides a readable name for the tab.
@@ -1046,7 +633,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
     };
     
     /**
-     * Registers TabView specific properties.
+     * setAttributeConfigs TabView specific properties.
      * @method initAttributes
      * @param {Object} attr Hash of initial attributes
      */
@@ -1061,7 +648,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config activationEvent
          * @type String
          */
-        this.register('activationEvent', {
+        this.setAttributeConfig('activationEvent', {
             value: attr.activationEvent || 'click'
         });        
 
@@ -1070,7 +657,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config labelEl
          * @type HTMLElement
          */
-        this.register('labelEl', {
+        this.setAttributeConfig('labelEl', {
             value: attr.labelEl || _getlabelEl.call(this),
             method: function(value) {
                 var current = this.get('labelEl');
@@ -1094,7 +681,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config label
          * @type String
          */
-        this.register('label', {
+        this.setAttributeConfig('label', {
             value: attr.label || _getLabel.call(this),
             method: function(value) {
                 var labelEl = this.get('labelEl');
@@ -1111,7 +698,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config contentEl
          * @type HTMLElement
          */
-        this.register('contentEl', { // TODO: apply className?
+        this.setAttributeConfig('contentEl', {
             value: attr.contentEl || document.createElement('div'),
             method: function(value) {
                 var current = this.get('contentEl');
@@ -1130,8 +717,8 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config content
          * @type String
          */
-        this.register('content', {
-            value: attr.content, // TODO: what about existing?
+        this.setAttributeConfig('content', {
+            value: attr.content,
             method: function(value) {
                 this.get('contentEl').innerHTML = value;
             }
@@ -1144,7 +731,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config dataSrc
          * @type String
          */
-        this.register('dataSrc', {
+        this.setAttributeConfig('dataSrc', {
             value: attr.dataSrc
         });
         
@@ -1154,9 +741,9 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @type Boolean
          * @default false
          */
-        this.register('cacheData', {
+        this.setAttributeConfig('cacheData', {
             value: attr.cacheData || false,
-            validator: Lang.isBoolean
+            validator: YAHOO.lang.isBoolean
         });
         
         /**
@@ -1165,9 +752,9 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @type String
          * @default "GET"
          */
-        this.register('loadMethod', {
+        this.setAttributeConfig('loadMethod', {
             value: attr.loadMethod || 'GET',
-            validator: Lang.isString
+            validator: YAHOO.lang.isString
         });
 
         /**
@@ -1175,9 +762,9 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config dataLoaded
          * @type Boolean
          */        
-        this.register('dataLoaded', {
+        this.setAttributeConfig('dataLoaded', {
             value: false,
-            validator: Lang.isBoolean,
+            validator: YAHOO.lang.isBoolean,
             writeOnce: true
         });
         
@@ -1187,9 +774,9 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @type Number
          * @default null
          */
-        this.register('dataTimeout', {
+        this.setAttributeConfig('dataTimeout', {
             value: attr.dataTimeout || null,
-            validator: Lang.isNumber
+            validator: YAHOO.lang.isNumber
         });
         
         /**
@@ -1199,7 +786,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config active
          * @type Boolean
          */
-        this.register('active', {
+        this.setAttributeConfig('active', {
             value: attr.active || this.hasClass(this.ACTIVE_CLASSNAME),
             method: function(value) {
                 if (value === true) {
@@ -1211,7 +798,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
                 }
             },
             validator: function(value) {
-                return Lang.isBoolean(value) && !this.get('disabled') ;
+                return YAHOO.lang.isBoolean(value) && !this.get('disabled') ;
             }
         });
         
@@ -1220,7 +807,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config disabled
          * @type Boolean
          */
-        this.register('disabled', {
+        this.setAttributeConfig('disabled', {
             value: attr.disabled || this.hasClass(this.DISABLED_CLASSNAME),
             method: function(value) {
                 if (value === true) {
@@ -1229,7 +816,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
                     Dom.removeClass(this.get('element'), this.DISABLED_CLASSNAME);
                 }
             },
-            validator: Lang.isBoolean
+            validator: YAHOO.lang.isBoolean
         });
         
         /**
@@ -1238,12 +825,13 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @type String
          * @default '#'
          */
-        this.register('href', {
-            value: attr.href || '#',
+        this.setAttributeConfig('href', {
+            value: attr.href ||
+                    this.getElementsByTagName('a')[0].getAttribute('href', 2) || '#',
             method: function(value) {
                 this.getElementsByTagName('a')[0].href = value;
             },
-            validator: Lang.isString
+            validator: YAHOO.lang.isString
         });
         
         /**
@@ -1252,15 +840,15 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @type Boolean
          * @default false
          */
-        this.register('contentVisible', {
+        this.setAttributeConfig('contentVisible', {
             value: attr.contentVisible,
             method: function(value) {
-                if (value == true) {
+                if (value) {
                     this.get('contentEl').style.display = 'block';
                     
                     if ( this.get('dataSrc') ) {
-                     // load dynamic content unless already loaded and caching
-                        if ( !this.get('dataLoaded') || !this.get('cacheData') ) {
+                     // load dynamic content unless already loading or loaded and caching
+                        if ( !this._loading && !(this.get('dataLoaded') && this.get('cacheData')) ) {
                             _dataConnect.call(this);
                         }
                     }
@@ -1268,7 +856,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
                     this.get('contentEl').style.display = 'none';
                 }
             },
-            validator: Lang.isBoolean
+            validator: YAHOO.lang.isBoolean
         });
     };
     
@@ -1329,7 +917,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
         }
 
         Dom.addClass(this.get('contentEl').parentNode, this.LOADING_CLASSNAME);
-        
+        this._loading = true; 
         this.dataConnection = YAHOO.util.Connect.asyncRequest(
             this.get('loadMethod'),
             this.get('dataSrc'), 
@@ -1340,12 +928,14 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
                     this.dataConnection = null;
                     Dom.removeClass(this.get('contentEl').parentNode,
                             this.LOADING_CLASSNAME);
+                    this._loading = false;
                 },
                 failure: function(o) {
                     this.loadHandler.failure.call(this, o);
                     this.dataConnection = null;
                     Dom.removeClass(this.get('contentEl').parentNode,
                             this.LOADING_CLASSNAME);
+                    this._loading = false;
                 },
                 scope: this,
                 timeout: this.get('dataTimeout')
@@ -1452,513 +1042,4 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
      */
 })();
 
-(function() {
-
-    /**
-     * The tabview module provides a widget for managing content bound to tabs.
-     * @module tabview
-     * @requires yahoo, dom, event
-     *
-     */
-    /**
-     * A widget to control tabbed views.
-     * @namespace YAHOO.widget
-     * @class TabView
-     * @extends YAHOO.util.Element
-     * @constructor
-     * @param {HTMLElement | String | Object} el(optional) The html 
-     * element that represents the TabView, or the attribute object to use. 
-     * An element will be created if none provided.
-     * @param {Object} attr (optional) A key map of the tabView's 
-     * initial attributes.  Ignored if first arg is attributes object.
-     */
-    YAHOO.widget.TabView = function(el, attr) {
-        attr = attr || {};
-        if (arguments.length == 1 && !Lang.isString(el) && !el.nodeName) {
-            attr = el; // treat first arg as attr object
-            el = attr.element || null;
-        }
-        
-        if (!el && !attr.element) { // create if we dont have one
-            el = _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;
-    
-    
-    /**
-     * The className to add when building from scratch. 
-     * @property CLASSNAME
-     * @default "navset"
-     */
-    proto.CLASSNAME = 'yui-navset';
-    
-    /**
-     * The className of the HTMLElement containing the TabView's tab elements
-     * to look for when building from existing markup, or to add when building
-     * from scratch. 
-     * All childNodes of the tab container are treated as Tabs when building
-     * from existing markup.
-     * @property TAB_PARENT_CLASSNAME
-     * @default "nav"
-     */
-    proto.TAB_PARENT_CLASSNAME = 'yui-nav';
-    
-    /**
-     * The className of the HTMLElement containing the TabView's label elements
-     * to look for when building from existing markup, or to add when building
-     * from scratch. 
-     * All childNodes of the content container are treated as content elements when
-     * building from existing markup.
-     * @property CONTENT_PARENT_CLASSNAME
-     * @default "nav-content"
-     */
-    proto.CONTENT_PARENT_CLASSNAME = 'yui-content';
-    
-    proto._tabParent = null;
-    proto._contentParent = null; 
-    
-    /**
-     * Adds a Tab to the TabView instance.  
-     * If no index is specified, the tab is added to the end of the tab list.
-     * @method addTab
-     * @param {YAHOO.widget.Tab} tab A Tab instance to add.
-     * @param {Integer} index The position to add the tab. 
-     * @return void
-     */
-    proto.addTab = function(tab, index) {
-        var tabs = this.get('tabs');
-        if (!tabs) { // not ready yet
-            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); /* hide if not active */
-        } 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);
-    };
-
-    /**
-     * Routes childNode events.
-     * @method DOMEventHandler
-     * @param {event} e The Dom event that is being handled.
-     * @return void
-     */
-    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; // note break
-                }
-            } 
-            
-            if (tab) {
-                tab.fireEvent(e.type, e);
-            }
-        }
-    };
-    
-    /**
-     * Returns the Tab instance at the specified index.
-     * @method getTab
-     * @param {Integer} index The position of the Tab.
-     * @return YAHOO.widget.Tab
-     */
-    proto.getTab = function(index) {
-       return this.get('tabs')[index];
-    };
-    
-    /**
-     * Returns the index of given tab.
-     * @method getTabIndex
-     * @param {YAHOO.widget.Tab} tab The tab whose index will be returned.
-     * @return int
-     */
-    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;
-    };
-    
-    /**
-     * Removes the specified Tab from the TabView.
-     * @method removeTab
-     * @param {YAHOO.widget.Tab} item The Tab instance to be removed.
-     * @return void
-     */
-    proto.removeTab = function(tab) {
-        var tabCount = this.get('tabs').length;
-
-        var index = this.getTabIndex(tab);
-        var nextIndex = index + 1;
-        if ( tab == this.get('activeTab') ) { // select next tab
-            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);
-       
-    };
-    
-    /**
-     * Provides a readable name for the TabView instance.
-     * @method toString
-     * @return String
-     */
-    proto.toString = function() {
-        var name = this.get('id') || this.get('tagName');
-        return "TabView " + name; 
-    };
-    
-    /**
-     * The transiton to use when switching between tabs.
-     * @method contentTransition
-     */
-    proto.contentTransition = function(newTab, oldTab) {
-        newTab.set('contentVisible', true);
-        oldTab.set('contentVisible', false);
-    };
-    
-    /**
-     * Registers TabView specific properties.
-     * @method initAttributes
-     * @param {Object} attr Hash of initial attributes
-     */
-    proto.initAttributes = function(attr) {
-        YAHOO.widget.TabView.superclass.initAttributes.call(this, attr);
-        
-        if (!attr.orientation) {
-            attr.orientation = 'top';
-        }
-        
-        var el = this.get('element');
-        
-        /**
-         * The Tabs belonging to the TabView instance.
-         * @config tabs
-         * @type Array
-         */
-        this.register('tabs', {
-            value: [],
-            readOnly: true
-        });
-
-        /**
-         * The container of the tabView's label elements.
-         * @property _tabParent
-         * @private
-         * @type HTMLElement
-         */
-        this._tabParent = 
-                this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,
-                        'ul' )[0] || _createTabParent.call(this);
-            
-        /**
-         * The container of the tabView's content elements.
-         * @property _contentParent
-         * @type HTMLElement
-         * @private
-         */
-        this._contentParent = 
-                this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,
-                        'div')[0] ||  _createContentParent.call(this);
-        
-        /**
-         * How the Tabs should be oriented relative to the TabView.
-         * @config orientation
-         * @type String
-         * @default "top"
-         */
-        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;
-                }
-            }
-        });
-        
-        /**
-         * The index of the tab currently active.
-         * @config activeIndex
-         * @type Int
-         */
-        this.register('activeIndex', {
-            value: attr.activeIndex,
-            method: function(value) {
-                this.set('activeTab', this.getTab(value));
-            },
-            validator: function(value) {
-                return !this.getTab(value).get('disabled'); // cannot activate if disabled
-            }
-        });
-        
-        /**
-         * The tab currently active.
-         * @config activeTab
-         * @type YAHOO.widget.Tab
-         */
-        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) { // no transition if only 1
-                    this.contentTransition(tab, activeTab);
-                } else if (tab) {
-                    tab.set('contentVisible', true);
-                }
-            },
-            validator: function(value) {
-                return !value.get('disabled'); // cannot activate if 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);
-            }
-        }
-    };
-    
-    /**
-     * Creates Tab instances from a collection of HTMLElements.
-     * @method createTabs
-     * @private
-     * @param {Array|HTMLCollection} elements The elements to use for Tabs.
-     * @return void
-     */
-    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; // dont invoke method
-            }
-        }
-    };
-    
-    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;
-    };
-
-/**
- * Fires before the activeTab is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p>If handler returns false, the change will be cancelled, and the value will not
- * be set.</p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> beforeActiveTabChange<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * prevValue</code> the currently active tab<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * newValue</code> the tab to be made active</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('beforeActiveTabChange', handler);</code></p>
- * @event beforeActiveTabChange
- */
-    
-/**
- * Fires after the activeTab is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> activeTabChange<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * prevValue</code> the formerly active tab<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * newValue</code> the new active tab</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('activeTabChange', handler);</code></p>
- * @event activeTabChange
- */
-/**
- * Fires before the orientation is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p>If handler returns false, the change will be cancelled, and the value will not
- * be set.</p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> beforeOrientationChange<br>
- * <code>&lt;String&gt;
- * prevValue</code> the current orientation<br>
- * <code>&lt;String&gt;
- * newValue</code> the new orientation to be applied</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('beforeOrientationChange', handler);</code></p>
- * @event beforeOrientationChange
- */
-    
-/**
- * Fires after the orientation is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> orientationChange<br>
- * <code>&lt;String&gt;
- * prevValue</code> the former orientation<br>
- * <code>&lt;String&gt;
- * newValue</code> the new orientation</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('orientationChange', handler);</code></p>
- * @event orientationChange
- */
-})();
-
+YAHOO.register("tabview", YAHOO.widget.TabView, {version: "2.3.0", build: "442"});
index 24e39dac3274250a41f33ff2741a5491b80bba4c..56a4b910f1b0b33cef8b7adffbbdd0096c4782fd 100755 (executable)
@@ -1,61 +1,37 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 
-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){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){return undefined;}
-return config.value;},set:function(key,value,silent){var configs=this._configs||{};var config=configs[key];if(!config){return false;}
-return config.setValue(value,silent);},getAttributeKeys:function(){var configs=this._configs;var keys=[];var config;for(var key in configs){config=configs[key];if(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]){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){return false;}
-if(!parent){return false;}
-if(element.parent!=parent){if(before){parent.insertBefore(element,before);}else{parent.appendChild(element);}}
-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[this._queue.length]=['set',arguments];return false;}
-if(!this._configs[key]&&!Lang.isUndefined(el[key])){_registerHTMLAttr.call(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])){return false;}
-return AttributeProvider.prototype.register.apply(this,arguments);},configureAttribute:function(property,map,init){var el=this.get('element');if(!el){this._queue[this._queue.length]=['configureAttribute',arguments];return;}
-if(!this._configs[property]&&!Lang.isUndefined(el[property])){_registerHTMLAttr.call(this,property,map);}
-return AttributeProvider.prototype.configureAttribute.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.call(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(key,map){var el=this.get('element');map=map||{};map.name=key;map.method=map.method||function(value){el[key]=value;};map.value=map.value||el[key];this._configs[key]=new YAHOO.util.Attribute(map,this);};YAHOO.augment(YAHOO.util.Element,AttributeProvider);})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.util.Lang;var 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){}};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){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;}
+(function(){YAHOO.widget.TabView=function(el,attr){attr=attr||{};if(arguments.length==1&&!YAHOO.lang.isString(el)&&!el.nodeName){attr=el;el=attr.element||null;}
 if(!el&&!attr.element){el=_createTabViewElement.call(this,attr);}
-YAHOO.widget.TabView.superclass.constructor.call(this,el,attr);};YAHOO.extend(YAHOO.widget.TabView,YAHOO.util.Element);var proto=YAHOO.widget.TabView.prototype;var Dom=YAHOO.util.Dom;var 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;}
+YAHOO.widget.TabView.superclass.constructor.call(this,el,attr);};YAHOO.extend(YAHOO.widget.TabView,YAHOO.util.Element);var proto=YAHOO.widget.TabView.prototype;var Dom=YAHOO.util.Dom;var Event=YAHOO.util.Event;var Tab=YAHOO.widget.Tab;proto.CLASSNAME='yui-navset';proto.TAB_PARENT_CLASSNAME='yui-nav';proto.CONTENT_PARENT_CLASSNAME='yui-content';proto._tabParent=null;proto._contentParent=null;proto.addTab=function(tab,index){var tabs=this.get('tabs');if(!tabs){this._queue[this._queue.length]=['addTab',arguments];return false;}
 index=(index===undefined)?tabs.length:index;var before=this.getTab(index);var self=this;var el=this.get('element');var tabParent=this._tabParent;var contentParent=this._contentParent;var tabElement=tab.get('element');var contentEl=tab.get('contentEl');if(before){tabParent.insertBefore(tabElement,before.get('element'));}else{tabParent.appendChild(tabElement);}
 if(contentEl&&!Dom.isAncestor(contentParent,contentEl)){contentParent.appendChild(contentEl);}
 if(!tab.get('active')){tab.set('contentVisible',false,true);}else{this.set('activeTab',tab,true);}
-var activate=function(e){YAHOO.util.Event.preventDefault(e);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;}}
+var activate=function(e){YAHOO.util.Event.preventDefault(e);var silent=false;if(this==self.get('activeTab')){silent=true;}
+self.set('activeTab',this,silent);};tab.addListener(tab.get('activationEvent'),activate);tab.addListener('activationEventChange',function(e){if(e.prevValue!=e.newValue){tab.removeListener(e.prevValue,activate);tab.addListener(e.newValue,activate);}});tabs.splice(index,0,tab);};proto.DOMEventHandler=function(e){var el=this.get('element');var target=YAHOO.util.Event.getTarget(e);var tabParent=this._tabParent;if(Dom.isAncestor(tabParent,target)){var tabEl;var tab=null;var contentEl;var tabs=this.get('tabs');for(var i=0,len=tabs.length;i<len;i++){tabEl=tabs[i].get('element');contentEl=tabs[i].get('contentEl');if(target==tabEl||Dom.isAncestor(tabEl,target)){tab=tabs[i];break;}}
 if(tab){tab.fireEvent(e.type,e);}}};proto.getTab=function(index){return this.get('tabs')[index];};proto.getTabIndex=function(tab){var index=null;var tabs=this.get('tabs');for(var i=0,len=tabs.length;i<len;++i){if(tab==tabs[i]){index=i;break;}}
 return index;};proto.removeTab=function(tab){var tabCount=this.get('tabs').length;var index=this.getTabIndex(tab);var nextIndex=index+1;if(tab==this.get('activeTab')){if(tabCount>1){if(index+1==tabCount){this.set('activeIndex',index-1);}else{this.set('activeIndex',index+1);}}}
 this._tabParent.removeChild(tab.get('element'));this._contentParent.removeChild(tab.get('contentEl'));this._configs.tabs.value.splice(index,1);};proto.toString=function(){var name=this.get('id')||this.get('tagName');return"TabView "+name;};proto.contentTransition=function(newTab,oldTab){newTab.set('contentVisible',true);oldTab.set('contentVisible',false);};proto.initAttributes=function(attr){YAHOO.widget.TabView.superclass.initAttributes.call(this,attr);if(!attr.orientation){attr.orientation='top';}
-var el=this.get('element');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);}
+var el=this.get('element');if(!YAHOO.util.Dom.hasClass(el,this.CLASSNAME)){YAHOO.util.Dom.addClass(el,this.CLASSNAME);}
+this.setAttributeConfig('tabs',{value:[],readOnly:true});this._tabParent=this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,'ul')[0]||_createTabParent.call(this);this._contentParent=this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,'div')[0]||_createContentParent.call(this);this.setAttributeConfig('orientation',{value:attr.orientation,method:function(value){var current=this.get('orientation');this.addClass('yui-navset-'+value);if(current!=value){this.removeClass('yui-navset-'+current);}
+switch(value){case'bottom':this.appendChild(this._tabParent);break;}}});this.setAttributeConfig('activeIndex',{value:attr.activeIndex,method:function(value){this.set('activeTab',this.getTab(value));},validator:function(value){return!this.getTab(value).get('disabled');}});this.setAttributeConfig('activeTab',{value:attr.activeTab,method:function(tab){var activeTab=this.get('activeTab');if(tab){tab.set('active',true);this._configs['activeIndex'].value=this.getTabIndex(tab);}
 if(activeTab&&activeTab!=tab){activeTab.set('active',false);}
 if(activeTab&&tab!=activeTab){this.contentTransition(tab,activeTab);}else if(tab){tab.set('contentVisible',true);}},validator:function(value){return!value.get('disabled');}});if(this._tabParent){_initTabs.call(this);}
-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;}
+this.DOM_EVENTS.submit=false;this.DOM_EVENTS.focus=false;this.DOM_EVENTS.blur=false;for(var type in this.DOM_EVENTS){if(YAHOO.lang.hasOwnProperty(this.DOM_EVENTS,type)){this.addListener.call(this,type,this.DOMEventHandler);}}};var _initTabs=function(){var tab,attr,contentEl;var el=this.get('element');var tabs=_getChildNodes(this._tabParent);var contentElements=_getChildNodes(this._contentParent);for(var i=0,len=tabs.length;i<len;++i){attr={};if(contentElements[i]){attr.contentEl=contentElements[i];}
+tab=new YAHOO.widget.Tab(tabs[i],attr);this.addTab(tab);if(tab.hasClass(tab.ACTIVE_CLASSNAME)){this._configs.activeTab.value=tab;this._configs.activeIndex.value=this.getTabIndex(tab);}}};var _createTabViewElement=function(attr){var el=document.createElement('div');if(this.CLASSNAME){el.className=this.CLASSNAME;}
 return el;};var _createTabParent=function(attr){var el=document.createElement('ul');if(this.TAB_PARENT_CLASSNAME){el.className=this.TAB_PARENT_CLASSNAME;}
 this.get('element').appendChild(el);return el;};var _createContentParent=function(attr){var el=document.createElement('div');if(this.CONTENT_PARENT_CLASSNAME){el.className=this.CONTENT_PARENT_CLASSNAME;}
 this.get('element').appendChild(el);return el;};var _getChildNodes=function(el){var nodes=[];var childNodes=el.childNodes;for(var i=0,len=childNodes.length;i<len;++i){if(childNodes[i].nodeType==1){nodes[nodes.length]=childNodes[i];}}
-return nodes;};})();
\ No newline at end of file
+return nodes;};})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event;var Tab=function(el,attr){attr=attr||{};if(arguments.length==1&&!YAHOO.lang.isString(el)&&!el.nodeName){attr=el;el=attr.element;}
+if(!el&&!attr.element){el=_createTabElement.call(this,attr);}
+this.loadHandler={success:function(o){this.set('content',o.responseText);},failure:function(o){}};Tab.superclass.constructor.call(this,el,attr);this.DOM_EVENTS={};};YAHOO.extend(Tab,YAHOO.util.Element);var proto=Tab.prototype;proto.LABEL_TAGNAME='em';proto.ACTIVE_CLASSNAME='selected';proto.DISABLED_CLASSNAME='disabled';proto.LOADING_CLASSNAME='loading';proto.dataConnection=null;proto.loadHandler=null;proto._loading=false;proto.toString=function(){var el=this.get('element');var id=el.id||el.tagName;return"Tab "+id;};proto.initAttributes=function(attr){attr=attr||{};Tab.superclass.initAttributes.call(this,attr);var el=this.get('element');this.setAttributeConfig('activationEvent',{value:attr.activationEvent||'click'});this.setAttributeConfig('labelEl',{value:attr.labelEl||_getlabelEl.call(this),method:function(value){var current=this.get('labelEl');if(current){if(current==value){return false;}
+this.replaceChild(value,current);}else if(el.firstChild){this.insertBefore(value,el.firstChild);}else{this.appendChild(value);}}});this.setAttributeConfig('label',{value:attr.label||_getLabel.call(this),method:function(value){var labelEl=this.get('labelEl');if(!labelEl){this.set('labelEl',_createlabelEl.call(this));}
+_setLabel.call(this,value);}});this.setAttributeConfig('contentEl',{value:attr.contentEl||document.createElement('div'),method:function(value){var current=this.get('contentEl');if(current){if(current==value){return false;}
+this.replaceChild(value,current);}}});this.setAttributeConfig('content',{value:attr.content,method:function(value){this.get('contentEl').innerHTML=value;}});var _dataLoaded=false;this.setAttributeConfig('dataSrc',{value:attr.dataSrc});this.setAttributeConfig('cacheData',{value:attr.cacheData||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig('loadMethod',{value:attr.loadMethod||'GET',validator:YAHOO.lang.isString});this.setAttributeConfig('dataLoaded',{value:false,validator:YAHOO.lang.isBoolean,writeOnce:true});this.setAttributeConfig('dataTimeout',{value:attr.dataTimeout||null,validator:YAHOO.lang.isNumber});this.setAttributeConfig('active',{value:attr.active||this.hasClass(this.ACTIVE_CLASSNAME),method:function(value){if(value===true){this.addClass(this.ACTIVE_CLASSNAME);this.set('title','active');}else{this.removeClass(this.ACTIVE_CLASSNAME);this.set('title','');}},validator:function(value){return YAHOO.lang.isBoolean(value)&&!this.get('disabled');}});this.setAttributeConfig('disabled',{value:attr.disabled||this.hasClass(this.DISABLED_CLASSNAME),method:function(value){if(value===true){Dom.addClass(this.get('element'),this.DISABLED_CLASSNAME);}else{Dom.removeClass(this.get('element'),this.DISABLED_CLASSNAME);}},validator:YAHOO.lang.isBoolean});this.setAttributeConfig('href',{value:attr.href||this.getElementsByTagName('a')[0].getAttribute('href',2)||'#',method:function(value){this.getElementsByTagName('a')[0].href=value;},validator:YAHOO.lang.isString});this.setAttributeConfig('contentVisible',{value:attr.contentVisible,method:function(value){if(value){this.get('contentEl').style.display='block';if(this.get('dataSrc')){if(!this._loading&&!(this.get('dataLoaded')&&this.get('cacheData'))){_dataConnect.call(this);}}}else{this.get('contentEl').style.display='none';}},validator:YAHOO.lang.isBoolean});};var _createTabElement=function(attr){var el=document.createElement('li');var a=document.createElement('a');a.href=attr.href||'#';el.appendChild(a);var label=attr.label||null;var labelEl=attr.labelEl||null;if(labelEl){if(!label){label=_getLabel.call(this,labelEl);}}else{labelEl=_createlabelEl.call(this);}
+a.appendChild(labelEl);return el;};var _getlabelEl=function(){return this.getElementsByTagName(this.LABEL_TAGNAME)[0];};var _createlabelEl=function(){var el=document.createElement(this.LABEL_TAGNAME);return el;};var _setLabel=function(label){var el=this.get('labelEl');el.innerHTML=label;};var _getLabel=function(){var label,el=this.get('labelEl');if(!el){return undefined;}
+return el.innerHTML;};var _dataConnect=function(){if(!YAHOO.util.Connect){return false;}
+Dom.addClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);this._loading=true;this.dataConnection=YAHOO.util.Connect.asyncRequest(this.get('loadMethod'),this.get('dataSrc'),{success:function(o){this.loadHandler.success.call(this,o);this.set('dataLoaded',true);this.dataConnection=null;Dom.removeClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);this._loading=false;},failure:function(o){this.loadHandler.failure.call(this,o);this.dataConnection=null;Dom.removeClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);this._loading=false;},scope:this,timeout:this.get('dataTimeout')});};YAHOO.widget.Tab=Tab;})();YAHOO.register("tabview",YAHOO.widget.TabView,{version:"2.3.0",build:"442"});
\ No newline at end of file
index 8f5d4bb02bb2495e57779114471c38cbe319ccaf..52d3caa8d9a5f0e0807286aefddf94a5ff0c5b9b 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-YAHOO.util.Lang = {
-    isArray: function(val) { // frames lose type, so test constructor string
-        if (val.constructor && val.constructor.toString().indexOf('Array') > -1) {
-            return true;
-        } else {
-            return YAHOO.util.Lang.isObject(val) && val.constructor == Array;
+(function() {
+
+    /**
+     * The tabview module provides a widget for managing content bound to tabs.
+     * @module tabview
+     * @requires yahoo, dom, event, element
+     *
+     */
+    /**
+     * A widget to control tabbed views.
+     * @namespace YAHOO.widget
+     * @class TabView
+     * @extends YAHOO.util.Element
+     * @constructor
+     * @param {HTMLElement | String | Object} el(optional) The html 
+     * element that represents the TabView, or the attribute object to use. 
+     * An element will be created if none provided.
+     * @param {Object} attr (optional) A key map of the tabView's 
+     * initial attributes.  Ignored if first arg is attributes object.
+     */
+    YAHOO.widget.TabView = function(el, attr) {
+        attr = attr || {};
+        if (arguments.length == 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
+            attr = el; // treat first arg as attr object
+            el = attr.element || null;
         }
-    },
         
-    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';
-    }
-};
-
-/**
- * Provides Attribute configurations.
- * @namespace YAHOO.util
- * @class Attribute
- * @constructor
- * @param hash {Object} The intial Attribute.
- * @param {YAHOO.util.AttributeProvider} The owner of the Attribute instance.
- */
-
-YAHOO.util.Attribute = function(hash, owner) {
-    if (owner) { 
-        this.owner = owner;
-        this.configure(hash, true);
-    }
-};
+        if (!el && !attr.element) { // create if we dont have one
+            el = _createTabViewElement.call(this, attr);
+        }
+       YAHOO.widget.TabView.superclass.constructor.call(this, el, attr); 
+    };
 
-YAHOO.util.Attribute.prototype = {
-       /**
-     * The name of the attribute.
-        * @property name
-        * @type String
-        */
-    name: undefined,
-    
-       /**
-     * The value of the attribute.
-        * @property value
-        * @type String
-        */
-    value: null,
-    
-       /**
-     * The owner of the attribute.
-        * @property owner
-        * @type YAHOO.util.AttributeProvider
-        */
-    owner: null,
-    
-       /**
-     * Whether or not the attribute is read only.
-        * @property readOnly
-        * @type Boolean
-        */
-    readOnly: false,
+    YAHOO.extend(YAHOO.widget.TabView, YAHOO.util.Element);
     
-       /**
-     * Whether or not the attribute can only be written once.
-        * @property writeOnce
-        * @type Boolean
-        */
-    writeOnce: false,
-
-       /**
-     * The attribute's initial configuration.
-     * @private
-        * @property _initialConfig
-        * @type Object
-        */
-    _initialConfig: null,
+    var proto = YAHOO.widget.TabView.prototype;
+    var Dom = YAHOO.util.Dom;
+    var Event = YAHOO.util.Event;
+    var Tab = YAHOO.widget.Tab;
     
-       /**
-     * Whether or not the attribute's value has been set.
-     * @private
-        * @property _written
-        * @type Boolean
-        */
-    _written: false,
     
-       /**
-     * The method to use when setting the attribute's value.
-     * The method recieves the new value as the only argument.
-        * @property method
-        * @type Function
-        */
-    method: null,
+    /**
+     * The className to add when building from scratch. 
+     * @property CLASSNAME
+     * @default "navset"
+     */
+    proto.CLASSNAME = 'yui-navset';
     
-       /**
-     * The validator to use when setting the attribute's value.
-        * @property validator
-        * @type Function
-     * @return Boolean
-        */
-    validator: null,
+    /**
+     * The className of the HTMLElement containing the TabView's tab elements
+     * to look for when building from existing markup, or to add when building
+     * from scratch. 
+     * All childNodes of the tab container are treated as Tabs when building
+     * from existing markup.
+     * @property TAB_PARENT_CLASSNAME
+     * @default "nav"
+     */
+    proto.TAB_PARENT_CLASSNAME = 'yui-nav';
     
     /**
-     * Retrieves the current value of the attribute.
-     * @method getValue
-     * @return {any} The current value of the attribute.
+     * The className of the HTMLElement containing the TabView's label elements
+     * to look for when building from existing markup, or to add when building
+     * from scratch. 
+     * All childNodes of the content container are treated as content elements when
+     * building from existing markup.
+     * @property CONTENT_PARENT_CLASSNAME
+     * @default "nav-content"
      */
-    getValue: function() {
-        return this.value;
-    },
+    proto.CONTENT_PARENT_CLASSNAME = 'yui-content';
+    
+    proto._tabParent = null;
+    proto._contentParent = null; 
     
     /**
-     * Sets the value of the attribute and fires beforeChange and change events.
-     * @method setValue
-     * @param {Any} value The value to apply to the attribute.
-     * @param {Boolean} silent If true the change events will not be fired.
-     * @return {Boolean} Whether or not the value was set.
+     * Adds a Tab to the TabView instance.  
+     * If no index is specified, the tab is added to the end of the tab list.
+     * @method addTab
+     * @param {YAHOO.widget.Tab} tab A Tab instance to add.
+     * @param {Integer} index The position to add the tab. 
+     * @return void
      */
-    setValue: function(value, silent) {
-        var beforeRetVal;
-        var owner = this.owner;
-        var name = this.name;
+    proto.addTab = function(tab, index) {
+        var tabs = this.get('tabs');
+        if (!tabs) { // not ready yet
+            this._queue[this._queue.length] = ['addTab', arguments];
+            return false;
+        }
         
-        var event = {
-            type: name, 
-            prevValue: this.getValue(),
-            newValue: value
-        };
+        index = (index === undefined) ? tabs.length : index;
         
-        if (this.readOnly || ( this.writeOnce && this._written) ) {
-            return false; // write not allowed
-        }
+        var before = this.getTab(index);
         
-        if (this.validator && !this.validator.call(owner, value) ) {
-            return false; // invalid value
-        }
+        var self = this;
+        var el = this.get('element');
+        var tabParent = this._tabParent;
+        var contentParent = this._contentParent;
 
-        if (!silent) {
-            beforeRetVal = owner.fireBeforeChangeEvent(event);
-            if (beforeRetVal === false) {
-                return false;
-            }
+        var tabElement = tab.get('element');
+        var contentEl = tab.get('contentEl');
+
+        if ( before ) {
+            tabParent.insertBefore(tabElement, before.get('element'));
+        } else {
+            tabParent.appendChild(tabElement);
         }
 
-        if (this.method) {
-            this.method.call(owner, value);
+        if ( contentEl && !Dom.isAncestor(contentParent, contentEl) ) {
+            contentParent.appendChild(contentEl);
         }
         
-        this.value = value;
-        this._written = true;
+        if ( !tab.get('active') ) {
+            tab.set('contentVisible', false, true); /* hide if not active */
+        } else {
+            this.set('activeTab', tab, true);
+            
+        }
+
+        var activate = function(e) {
+            YAHOO.util.Event.preventDefault(e);
+            var silent = false;
+
+            if (this == self.get('activeTab')) {
+                silent = true; // dont fire activeTabChange if already active
+            }
+            self.set('activeTab', this, silent);
+        };
         
-        event.type = name;
+        tab.addListener( tab.get('activationEvent'), activate);
         
-        if (!silent) {
-            this.owner.fireChangeEvent(event);
-        }
+        tab.addListener('activationEventChange', function(e) {
+            if (e.prevValue != e.newValue) {
+                tab.removeListener(e.prevValue, activate);
+                tab.addListener(e.newValue, activate);
+            }
+        });
         
-        return true;
-    },
-    
+        tabs.splice(index, 0, tab);
+    };
+
     /**
-     * Allows for configuring the Attribute's properties.
-     * @method configure
-     * @param {Object} map A key-value map of Attribute properties.
-     * @param {Boolean} init Whether or not this should become the initial config.
+     * Routes childNode events.
+     * @method DOMEventHandler
+     * @param {event} e The Dom event that is being handled.
+     * @return void
      */
-    configure: function(map, init) {
-        map = map || {};
-        this._written = false; // reset writeOnce
-        this._initialConfig = this._initialConfig || {};
+    proto.DOMEventHandler = function(e) {
+        var el = this.get('element');
+        var target = YAHOO.util.Event.getTarget(e);
+        var tabParent = this._tabParent;
         
-        for (var key in map) {
-            if ( key && map.hasOwnProperty(key) ) {
-                this[key] = map[key];
-                if (init) {
-                    this._initialConfig[key] = map[key];
+        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; // note break
                 }
+            } 
+            
+            if (tab) {
+                tab.fireEvent(e.type, e);
             }
         }
-    },
+    };
     
     /**
-     * Resets the value to the initial config value.
-     * @method resetValue
-     * @return {Boolean} Whether or not the value was set.
+     * Returns the Tab instance at the specified index.
+     * @method getTab
+     * @param {Integer} index The position of the Tab.
+     * @return YAHOO.widget.Tab
      */
-    resetValue: function() {
-        return this.setValue(this._initialConfig.value);
-    },
+    proto.getTab = function(index) {
+       return this.get('tabs')[index];
+    };
     
     /**
-     * Resets the attribute config to the initial config state.
-     * @method resetConfig
+     * Returns the index of given tab.
+     * @method getTabIndex
+     * @param {YAHOO.widget.Tab} tab The tab whose index will be returned.
+     * @return int
      */
-    resetConfig: function() {
-        this.configure(this._initialConfig);
-    },
+    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;
+    };
     
     /**
-     * Resets the value to the current value.
-     * Useful when values may have gotten out of sync with actual properties.
-     * @method refresh
-     * @return {Boolean} Whether or not the value was set.
+     * Removes the specified Tab from the TabView.
+     * @method removeTab
+     * @param {YAHOO.widget.Tab} item The Tab instance to be removed.
+     * @return void
      */
-    refresh: function(silent) {
-        this.setValue(this.value, silent);
-    }
-};
-
-(function() {
-    var Lang = YAHOO.util.Lang;
+    proto.removeTab = function(tab) {
+        var tabCount = this.get('tabs').length;
 
-    /*
-    Copyright (c) 2006, Yahoo! Inc. All rights reserved.
-    Code licensed under the BSD License:
-    http://developer.yahoo.net/yui/license.txt
-    */
+        var index = this.getTabIndex(tab);
+        var nextIndex = index + 1;
+        if ( tab == this.get('activeTab') ) { // select next tab
+            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);
+       
+    };
+    
+    /**
+     * Provides a readable name for the TabView instance.
+     * @method toString
+     * @return String
+     */
+    proto.toString = function() {
+        var name = this.get('id') || this.get('tagName');
+        return "TabView " + name; 
+    };
     
     /**
-     * Provides and manages YAHOO.util.Attribute instances
-     * @namespace YAHOO.util
-     * @class AttributeProvider
-     * @uses YAHOO.util.EventProvider
+     * The transiton to use when switching between tabs.
+     * @method contentTransition
      */
-    YAHOO.util.AttributeProvider = function() {};
+    proto.contentTransition = function(newTab, oldTab) {
+        newTab.set('contentVisible', true);
+        oldTab.set('contentVisible', false);
+    };
     
-    YAHOO.util.AttributeProvider.prototype = {
+    /**
+     * setAttributeConfigs TabView specific properties.
+     * @method initAttributes
+     * @param {Object} attr Hash of initial attributes
+     */
+    proto.initAttributes = function(attr) {
+        YAHOO.widget.TabView.superclass.initAttributes.call(this, attr);
+        
+        if (!attr.orientation) {
+            attr.orientation = 'top';
+        }
+        
+        var el = this.get('element');
+
+        if (!YAHOO.util.Dom.hasClass(el, this.CLASSNAME)) {
+            YAHOO.util.Dom.addClass(el, this.CLASSNAME);        
+        }
         
         /**
-         * A key-value map of Attribute configurations
-         * @property _configs
-         * @protected (may be used by subclasses and augmentors)
-         * @private
-         * @type {Object}
+         * The Tabs belonging to the TabView instance.
+         * @config tabs
+         * @type Array
          */
-        _configs: null,
+        this.setAttributeConfig('tabs', {
+            value: [],
+            readOnly: true
+        });
+
         /**
-         * Returns the current value of the attribute.
-         * @method get
-         * @param {String} key The attribute whose value will be returned.
+         * The container of the tabView's label elements.
+         * @property _tabParent
+         * @private
+         * @type HTMLElement
          */
-        get: function(key){
-            var configs = this._configs || {};
-            var config = configs[key];
-            
-            if (!config) {
-                return undefined;
-            }
+        this._tabParent = 
+                this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,
+                        'ul' )[0] || _createTabParent.call(this);
             
-            return config.value;
-        },
-        
         /**
-         * Sets the value of a config.
-         * @method set
-         * @param {String} key The name of the attribute
-         * @param {Any} value The value to apply to the attribute
-         * @param {Boolean} silent Whether or not to suppress change events
-         * @return {Boolean} Whether or not the value was set.
-         */
-        set: function(key, value, silent){
-            var configs = this._configs || {};
-            var config = configs[key];
-            
-            if (!config) {
-                return false;
-            }
-            
-            return config.setValue(value, silent);
-        },
-    
-        /**
-         * Returns an array of attribute names.
-         * @method getAttributeKeys
-         * @return {Array} An array of attribute names.
+         * The container of the tabView's content elements.
+         * @property _contentParent
+         * @type HTMLElement
+         * @private
          */
-        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;
-        },
+        this._contentParent = 
+                this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,
+                        'div')[0] ||  _createContentParent.call(this);
         
         /**
-         * Sets multiple attribute values.
-         * @method setAttributes
-         * @param {Object} map  A key-value map of attributes
-         * @param {Boolean} silent Whether or not to suppress change events
+         * How the Tabs should be oriented relative to the TabView.
+         * @config orientation
+         * @type String
+         * @default "top"
          */
-        setAttributes: function(map, silent){
-            for (var key in map) {
-                if ( map.hasOwnProperty(key) ) {
-                    this.set(key, map[key], silent);
+        this.setAttributeConfig('orientation', {
+            value: attr.orientation,
+            method: function(value) {
+                var current = this.get('orientation');
+                this.addClass('yui-navset-' + value);
+                
+                if (current != value) {
+                    this.removeClass('yui-navset-' + current);
                 }
-            }
-        },
-    
-        /**
-         * Resets the specified attribute's value to its initial value.
-         * @method resetValue
-         * @param {String} key The name of the attribute
-         * @param {Boolean} silent Whether or not to suppress change events
-         * @return {Boolean} Whether or not the value was set
-         */
-        resetValue: function(key, silent){
-            var configs = this._configs || {};
-            if (configs[key]) {
-                this.set(key, configs[key]._initialConfig.value, silent);
-                return true;
-            }
-            return false;
-        },
-    
-        /**
-         * Sets the attribute's value to its current value.
-         * @method refresh
-         * @param {String | Array} key The attribute(s) to refresh
-         * @param {Boolean} silent Whether or not to suppress change events
-         */
-        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 ( // only set if there is a value and not null
-                    configs[key[i]] && 
-                    ! Lang.isUndefined(configs[key[i]].value) &&
-                    ! Lang.isNull(configs[key[i]].value) ) {
-                    configs[key[i]].refresh(silent);
+                
+                switch(value) {
+                    case 'bottom':
+                    this.appendChild(this._tabParent);
+                    break;
                 }
             }
-        },
-    
+        });
+        
         /**
-         * Adds an Attribute to the AttributeProvider instance. 
-         * @method register
-         * @param {String} key The attribute's name
-         * @param {Object} map A key-value map containing the
-         * attribute's properties.
+         * The index of the tab currently active.
+         * @config activeIndex
+         * @type Int
          */
-        register: function(key, map) {
-            this._configs = this._configs || {};
-            
-            if (this._configs[key]) { // dont override
-                return false;
+        this.setAttributeConfig('activeIndex', {
+            value: attr.activeIndex,
+            method: function(value) {
+                this.set('activeTab', this.getTab(value));
+            },
+            validator: function(value) {
+                return !this.getTab(value).get('disabled'); // cannot activate if disabled
             }
-            
-            map.name = key;
-            this._configs[key] = new YAHOO.util.Attribute(map, this);
-            return true;
-        },
+        });
         
         /**
-         * Returns the attribute's properties.
-         * @method getAttributeConfig
-         * @param {String} key The attribute's name
-         * @private
-         * @return {object} A key-value map containing all of the
-         * attribute's properties.
+         * The tab currently active.
+         * @config activeTab
+         * @type YAHOO.widget.Tab
          */
-        getAttributeConfig: function(key) {
-            var configs = this._configs || {};
-            var config = configs[key] || {};
-            var map = {}; // returning a copy to prevent overrides
-            
-            for (key in config) {
-                if ( config.hasOwnProperty(key) ) {
-                    map[key] = config[key];
+        this.setAttributeConfig('activeTab', {
+            value: attr.activeTab,
+            method: function(tab) {
+                var activeTab = this.get('activeTab');
+                
+                if (tab) {  
+                    tab.set('active', true);
+                    this._configs['activeIndex'].value = this.getTabIndex(tab); // keep in sync
+                }
+                
+                if (activeTab && activeTab != tab) {
+                    activeTab.set('active', false);
                 }
+                
+                if (activeTab && tab != activeTab) { // no transition if only 1
+                    this.contentTransition(tab, activeTab);
+                } else if (tab) {
+                    tab.set('contentVisible', true);
+                }
+            },
+            validator: function(value) {
+                return !value.get('disabled'); // cannot activate if disabled
             }
-    
-            return map;
-        },
+        });
+
+        if ( this._tabParent ) {
+            _initTabs.call(this);
+        }
         
-        /**
-         * Sets or updates an Attribute instance's properties. 
-         * @method configureAttribute
-         * @param {String} key The attribute's name.
-         * @param {Object} map A key-value map of attribute properties
-         * @param {Boolean} init Whether or not this should become the intial config.
-         */
-        configureAttribute: function(key, map, init) {
-            var configs = this._configs || {};
-            
-            if (!configs[key]) {
-                return false;
+        // Due to delegation we add all DOM_EVENTS to the TabView container
+        // but IE will leak when unsupported events are added, so remove these
+        this.DOM_EVENTS.submit = false;
+        this.DOM_EVENTS.focus = false;
+        this.DOM_EVENTS.blur = false;
+
+        for (var type in this.DOM_EVENTS) {
+            if ( YAHOO.lang.hasOwnProperty(this.DOM_EVENTS, type) ) {
+                this.addListener.call(this, type, this.DOMEventHandler);
             }
-            
-            configs[key].configure(map, init);
-        },
-        
-        /**
-         * Resets an attribute to its intial configuration. 
-         * @method resetAttributeConfig
-         * @param {String} key The attribute's name.
-         * @private
-         */
-        resetAttributeConfig: function(key){
-            var configs = this._configs || {};
-            configs[key].resetConfig();
-        },
-        
-        /**
-         * Fires the attribute's beforeChange event. 
-         * @method fireBeforeChangeEvent
-         * @param {String} key The attribute's name.
-         * @param {Obj} e The event object to pass to handlers.
-         */
-        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);
-        },
-        
-        /**
-         * Fires the attribute's change event. 
-         * @method fireChangeEvent
-         * @param {String} key The attribute's name.
-         * @param {Obj} e The event object to pass to the handlers.
-         */
-        fireChangeEvent: function(e) {
-            e.type += 'Change';
-            return this.fireEvent(e.type, e);
         }
     };
     
-    YAHOO.augment(YAHOO.util.AttributeProvider, YAHOO.util.EventProvider);
-})();
-
-(function() {
-// internal shorthand
-var Dom = YAHOO.util.Dom,
-    Lang = YAHOO.util.Lang,
-    EventPublisher = YAHOO.util.EventPublisher,
-    AttributeProvider = YAHOO.util.AttributeProvider;
-
-/**
- * Element provides an interface to an HTMLElement's attributes and common
- * methods.  Other commonly used attributes are added as well.
- * @namespace YAHOO.util
- * @class Element
- * @uses YAHOO.util.AttributeProvider
- * @constructor
- * @param el {HTMLElement | String} The html element that 
- * represents the Element.
- * @param {Object} map A key-value map of initial config names and values
- */
-YAHOO.util.Element = function(el, map) {
-    if (arguments.length) {
-        this.init(el, map);
-    }
-};
-
-YAHOO.util.Element.prototype = {
-       /**
-     * Dom events supported by the Element instance.
-        * @property DOM_EVENTS
-        * @type Object
-        */
-    DOM_EVENTS: null,
-
-       /**
-     * Wrapper for HTMLElement method.
-        * @method appendChild
-        * @param {Boolean} deep Whether or not to do a deep clone
-        */
-    appendChild: function(child) {
-        child = child.get ? child.get('element') : child;
-        this.get('element').appendChild(child);
-    },
-    
-       /**
-     * Wrapper for HTMLElement method.
-        * @method getElementsByTagName
-        * @param {String} tag The tagName to collect
-        */
-    getElementsByTagName: function(tag) {
-        return this.get('element').getElementsByTagName(tag);
-    },
-    
-       /**
-     * Wrapper for HTMLElement method.
-        * @method hasChildNodes
-        * @return {Boolean} Whether or not the element has childNodes
-        */
-    hasChildNodes: function() {
-        return this.get('element').hasChildNodes();
-    },
-    
-       /**
-     * Wrapper for HTMLElement method.
-        * @method insertBefore
-        * @param {HTMLElement} element The HTMLElement to insert
-        * @param {HTMLElement} before The HTMLElement to insert
-     * the element before.
-        */
-    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);
-    },
-    
-       /**
-     * Wrapper for HTMLElement method.
-        * @method removeChild
-        * @param {HTMLElement} child The HTMLElement to remove
-        */
-    removeChild: function(child) {
-        child = child.get ? child.get('element') : child;
-        this.get('element').removeChild(child);
-        return true;
-    },
-    
-       /**
-     * Wrapper for HTMLElement method.
-        * @method replaceChild
-        * @param {HTMLElement} newNode The HTMLElement to insert
-        * @param {HTMLElement} oldNode The HTMLElement to replace
-        */
-    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);
-    },
-
-    
     /**
-     * Registers Element specific attributes.
-     * @method initAttributes
-     * @param {Object} map A key-value map of initial attribute configs
+     * Creates Tab instances from a collection of HTMLElements.
+     * @method initTabs
+     * @private
+     * @return void
      */
-    initAttributes: function(map) {
-        map = map || {}; 
-        var element = Dom.get(map.element) || null;
-        
-        /**
-         * The HTMLElement the Element instance refers to.
-         * @config element
-         * @type HTMLElement
-         */
-        this.register('element', {
-            value: element,
-            readOnly: true
-         });
-    },
+    var _initTabs = function() {
+        var tab,
+            attr,
+            contentEl;
+            
+        var el = this.get('element');   
+        var tabs = _getChildNodes(this._tabParent);
+        var contentElements = _getChildNodes(this._contentParent);
 
-    /**
-     * Adds a listener for the given event.  These may be DOM or 
-     * customEvent listeners.  Any event that is fired via fireEvent
-     * can be listened for.  All handlers receive an event object. 
-     * @method addListener
-     * @param {String} type The name of the event to listen for
-     * @param {Function} fn The handler to call when the event fires
-     * @param {Any} obj A variable to pass to the handler
-     * @param {Object} scope The object to use for the scope of the handler 
-     */
-    addListener: function(type, fn, obj, scope) {
-        var el = this.get('element');
-        var scope = scope || this;
-        
-        el = this.get('id') || el;
-        
-        if (!this._events[type]) { // create on the fly
-            if ( this.DOM_EVENTS[type] ) {
-                YAHOO.util.Event.addListener(el, type, function(e) {
-                    if (e.srcElement && !e.target) { // supplement IE with target
-                        e.target = e.srcElement;
-                    }
-                    this.fireEvent(type, e);
-                }, obj, scope);
-            }
+        for (var i = 0, len = tabs.length; i < len; ++i) {
+            attr = {};
             
-            this.createEvent(type, this);
-            this._events[type] = true;
-        }
-        
-        this.subscribe.apply(this, arguments); // notify via customEvent
-    },
-    
-    
-    /**
-     * Alias for addListener
-     * @method on
-     * @param {String} type The name of the event to listen for
-     * @param {Function} fn The function call when the event fires
-     * @param {Any} obj A variable to pass to the handler
-     * @param {Object} scope The object to use for the scope of the handler 
-     */
-    on: function() { this.addListener.apply(this, arguments); },
-    
-    
-    /**
-     * Remove an event listener
-     * @method removeListener
-     * @param {String} type The name of the event to listen for
-     * @param {Function} fn The function call when the event fires
-     */
-    removeListener: function(type, fn) {
-        this.unsubscribe.apply(this, arguments);
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method addClass
-        * @param {String} className The className to add
-        */
-    addClass: function(className) {
-        Dom.addClass(this.get('element'), className);
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method getElementsByClassName
-        * @param {String} className The className to collect
-        * @param {String} tag (optional) The tag to use in
-     * conjunction with class name
-     * @return {Array} Array of HTMLElements
-        */
-    getElementsByClassName: function(className, tag) {
-        return Dom.getElementsByClassName(className, tag,
-                this.get('element') );
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method hasClass
-        * @param {String} className The className to add
-     * @return {Boolean} Whether or not the element has the class name
-        */
-    hasClass: function(className) {
-        return Dom.hasClass(this.get('element'), className); 
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method removeClass
-        * @param {String} className The className to remove
-        */
-    removeClass: function(className) {
-        return Dom.removeClass(this.get('element'), className);
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method replaceClass
-        * @param {String} oldClassName The className to replace
-        * @param {String} newClassName The className to add
-        */
-    replaceClass: function(oldClassName, newClassName) {
-        return Dom.replaceClass(this.get('element'), 
-                oldClassName, newClassName);
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method setStyle
-        * @param {String} property The style property to set
-        * @param {String} value The value to apply to the style property
-        */
-    setStyle: function(property, value) {
-        return Dom.setStyle(this.get('element'),  property, value);
-    },
-    
-       /**
-     * Wrapper for Dom method.
-        * @method getStyle
-        * @param {String} property The style property to retrieve
-        * @return {String} The current value of the property
-        */
-    getStyle: function(property) {
-        return Dom.getStyle(this.get('element'),  property);
-    },
-    
-       /**
-     * Apply any queued set calls.
-        * @method fireQueue
-        */
-    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]);
-        }
-    },
-    
-       /**
-     * Appends the HTMLElement into either the supplied parentNode.
-        * @method appendTo
-        * @param {HTMLElement | Element} parentNode The node to append to
-        * @param {HTMLElement | Element} before An optional node to insert before
-        */
-    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) {
-            return false;
-        }
-        
-        if (!parent) {
-            return false;
-        }
-        
-        if (element.parent != parent) {
-            if (before) {
-                parent.insertBefore(element, before);
-            } else {
-                parent.appendChild(element);
+            if (contentElements[i]) {
+                attr.contentEl = contentElements[i];
             }
-        }
-        
-        
-        if (!newAddition) {
-            return false; // note return; no refresh if in document
-        }
-        
-        // if a new addition, refresh HTMLElement any applied attributes
-        var keys = this.getAttributeKeys();
-        
-        for (var key in keys) { // only refresh HTMLElement attributes
-            if ( !Lang.isUndefined(element[key]) ) {
-                this.refresh(key);
+
+            tab = new YAHOO.widget.Tab(tabs[i], attr);
+            this.addTab(tab);
+            
+            if (tab.hasClass(tab.ACTIVE_CLASSNAME) ) {
+                this._configs.activeTab.value = tab; // dont invoke method
+                this._configs.activeIndex.value = this.getTabIndex(tab);
             }
         }
-    },
+    };
     
-    get: function(key) {
-        var configs = this._configs || {};
-        var el = configs.element; // avoid loop due to 'element'
-        if (el && !configs[key] && !Lang.isUndefined(el.value[key]) ) {
-            return el.value[key];
-        }
-
-        return AttributeProvider.prototype.get.call(this, key);
-    },
+    var _createTabViewElement = function(attr) {
+        var el = document.createElement('div');
 
-    set: function(key, value, silent) {
-        var el = this.get('element');
-        if (!el) {
-            this._queue[this._queue.length] = ['set', arguments];
-            return false;
+        if ( this.CLASSNAME ) {
+            el.className = this.CLASSNAME;
         }
         
-        // set it on the element if not a property
-        if ( !this._configs[key] && !Lang.isUndefined(el[key]) ) {
-            _registerHTMLAttr.call(this, key);
-        }
-
-        return AttributeProvider.prototype.set.apply(this, arguments);
-    },
+        return el;
+    };
     
-    register: function(key) { // protect html attributes
-        var configs = this._configs || {};
-        var element = this.get('element') || null;
-        
-        if ( element && !Lang.isUndefined(element[key]) ) {
-            return false;
+    var _createTabParent = function(attr) {
+        var el = document.createElement('ul');
+
+        if ( this.TAB_PARENT_CLASSNAME ) {
+            el.className = this.TAB_PARENT_CLASSNAME;
         }
         
-        return AttributeProvider.prototype.register.apply(this, arguments);
-    },
+        this.get('element').appendChild(el);
+        
+        return el;
+    };
     
-    configureAttribute: function(property, map, init) { // protect html attributes
-        var el = this.get('element');
-        if (!el) {
-            this._queue[this._queue.length] = ['configureAttribute', arguments];
-            return;
+    var _createContentParent = function(attr) {
+        var el = document.createElement('div');
+
+        if ( this.CONTENT_PARENT_CLASSNAME ) {
+            el.className = this.CONTENT_PARENT_CLASSNAME;
         }
         
-        if (!this._configs[property] && !Lang.isUndefined(el[property]) ) {
-            _registerHTMLAttr.call(this, property, map);
-        }
+        this.get('element').appendChild(el);
         
-        return AttributeProvider.prototype.configureAttribute.apply(this, arguments);
-    },
+        return el;
+    };
     
-    getAttributeKeys: function() {
-        var el = this.get('element');
-        var keys = AttributeProvider.prototype.getAttributeKeys.call(this);
+    var _getChildNodes = function(el) {
+        var nodes = [];
+        var childNodes = el.childNodes;
         
-        //add any unconfigured element keys
-        for (var key in el) {
-            if (!this._configs[key]) {
-                keys[key] = keys[key] || el[key];
+        for (var i = 0, len = childNodes.length; i < len; ++i) {
+            if (childNodes[i].nodeType == 1) {
+                nodes[nodes.length] = childNodes[i];
             }
         }
         
-        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.call(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);
-        }        
-    }
-};
-
-/**
- * Sets the value of the property and fires beforeChange and change events.
- * @private
- * @method _registerHTMLAttr
- * @param {YAHOO.util.Element} element The Element instance to
- * register the config to.
- * @param {String} key The name of the config to register
- * @param {Object} map A key-value map of the config's params
- */
-var _registerHTMLAttr = function(key, map) {
-    var el = this.get('element');
-    map = map || {};
-    map.name = key;
-    map.method = map.method || function(value) {
-        el[key] = value;
+        return nodes;
     };
-    map.value = map.value || el[key];
-    this._configs[key] = new YAHOO.util.Attribute(map, this);
-};
 
 /**
- * Fires when the Element's HTMLElement can be retrieved by Id.
- * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * Fires before the activeTab is changed.
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
+ * <p>If handler returns false, the change will be cancelled, and the value will not
+ * be set.</p>
  * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> available<br>
- * <code>&lt;HTMLElement&gt;
- * target</code> the HTMLElement bound to this Element instance<br>
+ * <code>&lt;String&gt; type</code> beforeActiveTabChange<br>
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
+ * prevValue</code> the currently active tab<br>
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
+ * newValue</code> the tab to be made active</p>
  * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var target = e.target};<br>
- * myTabs.addListener('available', handler);</code></p>
- * @event available
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>
+ * myTabs.addListener('beforeActiveTabChange', handler);</code></p>
+ * @event beforeActiveTabChange
+ */
+    
+/**
+ * Fires after the activeTab is changed.
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> activeTabChange<br>
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
+ * prevValue</code> the formerly active tab<br>
+ * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
+ * newValue</code> the new active tab</p>
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>
+ * myTabs.addListener('activeTabChange', handler);</code></p>
+ * @event activeTabChange
  */
  
 /**
- * Fires when the Element's HTMLElement subtree is rendered.
- * <p>See: <a href="#addListener">Element.addListener</a></p>
+ * Fires before the orientation is changed.
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
+ * <p>If handler returns false, the change will be cancelled, and the value will not
+ * be set.</p>
  * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> contentReady<br>
- * <code>&lt;HTMLElement&gt;
- * target</code> the HTMLElement bound to this Element instance<br>
+ * <code>&lt;String&gt; type</code> beforeOrientationChange<br>
+ * <code>&lt;String&gt;
+ * prevValue</code> the current orientation<br>
+ * <code>&lt;String&gt;
+ * newValue</code> the new orientation to be applied</p>
  * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var target = e.target};<br>
- * myTabs.addListener('contentReady', handler);</code></p>
- * @event contentReady
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>
+ * myTabs.addListener('beforeOrientationChange', handler);</code></p>
+ * @event beforeOrientationChange
+ */
+    
+/**
+ * Fires after the orientation is changed.
+ * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
+ * <p><strong>Event fields:</strong><br>
+ * <code>&lt;String&gt; type</code> orientationChange<br>
+ * <code>&lt;String&gt;
+ * prevValue</code> the former orientation<br>
+ * <code>&lt;String&gt;
+ * newValue</code> the new orientation</p>
+ * <p><strong>Usage:</strong><br>
+ * <code>var handler = function(e) {var previous = e.prevValue};<br>
+ * myTabs.addListener('orientationChange', handler);</code></p>
+ * @event orientationChange
  */
-
-YAHOO.augment(YAHOO.util.Element, AttributeProvider);
 })();
 
 (function() {
     var Dom = YAHOO.util.Dom,
-        Event = YAHOO.util.Event,
-        Lang = YAHOO.util.Lang;
+        Event = YAHOO.util.Event;
     
     /**
      * A representation of a Tab's label and content.
@@ -945,7 +545,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
      */
     var Tab = function(el, attr) {
         attr = attr || {};
-        if (arguments.length == 1 && !Lang.isString(el) && !el.nodeName) {
+        if (arguments.length == 1 && !YAHOO.lang.isString(el) && !el.nodeName) {
             attr = el;
             el = attr.element;
         }
@@ -1016,6 +616,8 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
      * @type object
      */
     proto.loadHandler = null;
+
+    proto._loading = false;
     
     /**
      * Provides a readable name for the tab.
@@ -1029,7 +631,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
     };
     
     /**
-     * Registers TabView specific properties.
+     * setAttributeConfigs TabView specific properties.
      * @method initAttributes
      * @param {Object} attr Hash of initial attributes
      */
@@ -1044,7 +646,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config activationEvent
          * @type String
          */
-        this.register('activationEvent', {
+        this.setAttributeConfig('activationEvent', {
             value: attr.activationEvent || 'click'
         });        
 
@@ -1053,7 +655,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config labelEl
          * @type HTMLElement
          */
-        this.register('labelEl', {
+        this.setAttributeConfig('labelEl', {
             value: attr.labelEl || _getlabelEl.call(this),
             method: function(value) {
                 var current = this.get('labelEl');
@@ -1077,7 +679,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config label
          * @type String
          */
-        this.register('label', {
+        this.setAttributeConfig('label', {
             value: attr.label || _getLabel.call(this),
             method: function(value) {
                 var labelEl = this.get('labelEl');
@@ -1094,7 +696,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config contentEl
          * @type HTMLElement
          */
-        this.register('contentEl', { // TODO: apply className?
+        this.setAttributeConfig('contentEl', {
             value: attr.contentEl || document.createElement('div'),
             method: function(value) {
                 var current = this.get('contentEl');
@@ -1113,8 +715,8 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config content
          * @type String
          */
-        this.register('content', {
-            value: attr.content, // TODO: what about existing?
+        this.setAttributeConfig('content', {
+            value: attr.content,
             method: function(value) {
                 this.get('contentEl').innerHTML = value;
             }
@@ -1127,7 +729,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config dataSrc
          * @type String
          */
-        this.register('dataSrc', {
+        this.setAttributeConfig('dataSrc', {
             value: attr.dataSrc
         });
         
@@ -1137,9 +739,9 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @type Boolean
          * @default false
          */
-        this.register('cacheData', {
+        this.setAttributeConfig('cacheData', {
             value: attr.cacheData || false,
-            validator: Lang.isBoolean
+            validator: YAHOO.lang.isBoolean
         });
         
         /**
@@ -1148,9 +750,9 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @type String
          * @default "GET"
          */
-        this.register('loadMethod', {
+        this.setAttributeConfig('loadMethod', {
             value: attr.loadMethod || 'GET',
-            validator: Lang.isString
+            validator: YAHOO.lang.isString
         });
 
         /**
@@ -1158,9 +760,9 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config dataLoaded
          * @type Boolean
          */        
-        this.register('dataLoaded', {
+        this.setAttributeConfig('dataLoaded', {
             value: false,
-            validator: Lang.isBoolean,
+            validator: YAHOO.lang.isBoolean,
             writeOnce: true
         });
         
@@ -1170,9 +772,9 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @type Number
          * @default null
          */
-        this.register('dataTimeout', {
+        this.setAttributeConfig('dataTimeout', {
             value: attr.dataTimeout || null,
-            validator: Lang.isNumber
+            validator: YAHOO.lang.isNumber
         });
         
         /**
@@ -1182,7 +784,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config active
          * @type Boolean
          */
-        this.register('active', {
+        this.setAttributeConfig('active', {
             value: attr.active || this.hasClass(this.ACTIVE_CLASSNAME),
             method: function(value) {
                 if (value === true) {
@@ -1194,7 +796,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
                 }
             },
             validator: function(value) {
-                return Lang.isBoolean(value) && !this.get('disabled') ;
+                return YAHOO.lang.isBoolean(value) && !this.get('disabled') ;
             }
         });
         
@@ -1203,7 +805,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @config disabled
          * @type Boolean
          */
-        this.register('disabled', {
+        this.setAttributeConfig('disabled', {
             value: attr.disabled || this.hasClass(this.DISABLED_CLASSNAME),
             method: function(value) {
                 if (value === true) {
@@ -1212,7 +814,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
                     Dom.removeClass(this.get('element'), this.DISABLED_CLASSNAME);
                 }
             },
-            validator: Lang.isBoolean
+            validator: YAHOO.lang.isBoolean
         });
         
         /**
@@ -1221,12 +823,13 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @type String
          * @default '#'
          */
-        this.register('href', {
-            value: attr.href || '#',
+        this.setAttributeConfig('href', {
+            value: attr.href ||
+                    this.getElementsByTagName('a')[0].getAttribute('href', 2) || '#',
             method: function(value) {
                 this.getElementsByTagName('a')[0].href = value;
             },
-            validator: Lang.isString
+            validator: YAHOO.lang.isString
         });
         
         /**
@@ -1235,15 +838,15 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
          * @type Boolean
          * @default false
          */
-        this.register('contentVisible', {
+        this.setAttributeConfig('contentVisible', {
             value: attr.contentVisible,
             method: function(value) {
-                if (value == true) {
+                if (value) {
                     this.get('contentEl').style.display = 'block';
                     
                     if ( this.get('dataSrc') ) {
-                     // load dynamic content unless already loaded and caching
-                        if ( !this.get('dataLoaded') || !this.get('cacheData') ) {
+                     // load dynamic content unless already loading or loaded and caching
+                        if ( !this._loading && !(this.get('dataLoaded') && this.get('cacheData')) ) {
                             _dataConnect.call(this);
                         }
                     }
@@ -1251,7 +854,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
                     this.get('contentEl').style.display = 'none';
                 }
             },
-            validator: Lang.isBoolean
+            validator: YAHOO.lang.isBoolean
         });
     };
     
@@ -1310,7 +913,7 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
         }
 
         Dom.addClass(this.get('contentEl').parentNode, this.LOADING_CLASSNAME);
-        
+        this._loading = true; 
         this.dataConnection = YAHOO.util.Connect.asyncRequest(
             this.get('loadMethod'),
             this.get('dataSrc'), 
@@ -1321,12 +924,14 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
                     this.dataConnection = null;
                     Dom.removeClass(this.get('contentEl').parentNode,
                             this.LOADING_CLASSNAME);
+                    this._loading = false;
                 },
                 failure: function(o) {
                     this.loadHandler.failure.call(this, o);
                     this.dataConnection = null;
                     Dom.removeClass(this.get('contentEl').parentNode,
                             this.LOADING_CLASSNAME);
+                    this._loading = false;
                 },
                 scope: this,
                 timeout: this.get('dataTimeout')
@@ -1433,513 +1038,4 @@ YAHOO.augment(YAHOO.util.Element, AttributeProvider);
      */
 })();
 
-(function() {
-
-    /**
-     * The tabview module provides a widget for managing content bound to tabs.
-     * @module tabview
-     * @requires yahoo, dom, event
-     *
-     */
-    /**
-     * A widget to control tabbed views.
-     * @namespace YAHOO.widget
-     * @class TabView
-     * @extends YAHOO.util.Element
-     * @constructor
-     * @param {HTMLElement | String | Object} el(optional) The html 
-     * element that represents the TabView, or the attribute object to use. 
-     * An element will be created if none provided.
-     * @param {Object} attr (optional) A key map of the tabView's 
-     * initial attributes.  Ignored if first arg is attributes object.
-     */
-    YAHOO.widget.TabView = function(el, attr) {
-        attr = attr || {};
-        if (arguments.length == 1 && !Lang.isString(el) && !el.nodeName) {
-            attr = el; // treat first arg as attr object
-            el = attr.element || null;
-        }
-        
-        if (!el && !attr.element) { // create if we dont have one
-            el = _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;
-    
-    
-    /**
-     * The className to add when building from scratch. 
-     * @property CLASSNAME
-     * @default "navset"
-     */
-    proto.CLASSNAME = 'yui-navset';
-    
-    /**
-     * The className of the HTMLElement containing the TabView's tab elements
-     * to look for when building from existing markup, or to add when building
-     * from scratch. 
-     * All childNodes of the tab container are treated as Tabs when building
-     * from existing markup.
-     * @property TAB_PARENT_CLASSNAME
-     * @default "nav"
-     */
-    proto.TAB_PARENT_CLASSNAME = 'yui-nav';
-    
-    /**
-     * The className of the HTMLElement containing the TabView's label elements
-     * to look for when building from existing markup, or to add when building
-     * from scratch. 
-     * All childNodes of the content container are treated as content elements when
-     * building from existing markup.
-     * @property CONTENT_PARENT_CLASSNAME
-     * @default "nav-content"
-     */
-    proto.CONTENT_PARENT_CLASSNAME = 'yui-content';
-    
-    proto._tabParent = null;
-    proto._contentParent = null; 
-    
-    /**
-     * Adds a Tab to the TabView instance.  
-     * If no index is specified, the tab is added to the end of the tab list.
-     * @method addTab
-     * @param {YAHOO.widget.Tab} tab A Tab instance to add.
-     * @param {Integer} index The position to add the tab. 
-     * @return void
-     */
-    proto.addTab = function(tab, index) {
-        var tabs = this.get('tabs');
-        if (!tabs) { // not ready yet
-            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); /* hide if not active */
-        } 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);
-    };
-
-    /**
-     * Routes childNode events.
-     * @method DOMEventHandler
-     * @param {event} e The Dom event that is being handled.
-     * @return void
-     */
-    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; // note break
-                }
-            } 
-            
-            if (tab) {
-                tab.fireEvent(e.type, e);
-            }
-        }
-    };
-    
-    /**
-     * Returns the Tab instance at the specified index.
-     * @method getTab
-     * @param {Integer} index The position of the Tab.
-     * @return YAHOO.widget.Tab
-     */
-    proto.getTab = function(index) {
-       return this.get('tabs')[index];
-    };
-    
-    /**
-     * Returns the index of given tab.
-     * @method getTabIndex
-     * @param {YAHOO.widget.Tab} tab The tab whose index will be returned.
-     * @return int
-     */
-    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;
-    };
-    
-    /**
-     * Removes the specified Tab from the TabView.
-     * @method removeTab
-     * @param {YAHOO.widget.Tab} item The Tab instance to be removed.
-     * @return void
-     */
-    proto.removeTab = function(tab) {
-        var tabCount = this.get('tabs').length;
-
-        var index = this.getTabIndex(tab);
-        var nextIndex = index + 1;
-        if ( tab == this.get('activeTab') ) { // select next tab
-            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);
-       
-    };
-    
-    /**
-     * Provides a readable name for the TabView instance.
-     * @method toString
-     * @return String
-     */
-    proto.toString = function() {
-        var name = this.get('id') || this.get('tagName');
-        return "TabView " + name; 
-    };
-    
-    /**
-     * The transiton to use when switching between tabs.
-     * @method contentTransition
-     */
-    proto.contentTransition = function(newTab, oldTab) {
-        newTab.set('contentVisible', true);
-        oldTab.set('contentVisible', false);
-    };
-    
-    /**
-     * Registers TabView specific properties.
-     * @method initAttributes
-     * @param {Object} attr Hash of initial attributes
-     */
-    proto.initAttributes = function(attr) {
-        YAHOO.widget.TabView.superclass.initAttributes.call(this, attr);
-        
-        if (!attr.orientation) {
-            attr.orientation = 'top';
-        }
-        
-        var el = this.get('element');
-        
-        /**
-         * The Tabs belonging to the TabView instance.
-         * @config tabs
-         * @type Array
-         */
-        this.register('tabs', {
-            value: [],
-            readOnly: true
-        });
-
-        /**
-         * The container of the tabView's label elements.
-         * @property _tabParent
-         * @private
-         * @type HTMLElement
-         */
-        this._tabParent = 
-                this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,
-                        'ul' )[0] || _createTabParent.call(this);
-            
-        /**
-         * The container of the tabView's content elements.
-         * @property _contentParent
-         * @type HTMLElement
-         * @private
-         */
-        this._contentParent = 
-                this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,
-                        'div')[0] ||  _createContentParent.call(this);
-        
-        /**
-         * How the Tabs should be oriented relative to the TabView.
-         * @config orientation
-         * @type String
-         * @default "top"
-         */
-        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;
-                }
-            }
-        });
-        
-        /**
-         * The index of the tab currently active.
-         * @config activeIndex
-         * @type Int
-         */
-        this.register('activeIndex', {
-            value: attr.activeIndex,
-            method: function(value) {
-                this.set('activeTab', this.getTab(value));
-            },
-            validator: function(value) {
-                return !this.getTab(value).get('disabled'); // cannot activate if disabled
-            }
-        });
-        
-        /**
-         * The tab currently active.
-         * @config activeTab
-         * @type YAHOO.widget.Tab
-         */
-        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) { // no transition if only 1
-                    this.contentTransition(tab, activeTab);
-                } else if (tab) {
-                    tab.set('contentVisible', true);
-                }
-            },
-            validator: function(value) {
-                return !value.get('disabled'); // cannot activate if 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);
-            }
-        }
-    };
-    
-    /**
-     * Creates Tab instances from a collection of HTMLElements.
-     * @method createTabs
-     * @private
-     * @param {Array|HTMLCollection} elements The elements to use for Tabs.
-     * @return void
-     */
-    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; // dont invoke method
-            }
-        }
-    };
-    
-    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;
-    };
-
-/**
- * Fires before the activeTab is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p>If handler returns false, the change will be cancelled, and the value will not
- * be set.</p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> beforeActiveTabChange<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * prevValue</code> the currently active tab<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * newValue</code> the tab to be made active</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('beforeActiveTabChange', handler);</code></p>
- * @event beforeActiveTabChange
- */
-    
-/**
- * Fires after the activeTab is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> activeTabChange<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * prevValue</code> the formerly active tab<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * newValue</code> the new active tab</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('activeTabChange', handler);</code></p>
- * @event activeTabChange
- */
-/**
- * Fires before the orientation is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p>If handler returns false, the change will be cancelled, and the value will not
- * be set.</p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> beforeOrientationChange<br>
- * <code>&lt;String&gt;
- * prevValue</code> the current orientation<br>
- * <code>&lt;String&gt;
- * newValue</code> the new orientation to be applied</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('beforeOrientationChange', handler);</code></p>
- * @event beforeOrientationChange
- */
-    
-/**
- * Fires after the orientation is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> orientationChange<br>
- * <code>&lt;String&gt;
- * prevValue</code> the former orientation<br>
- * <code>&lt;String&gt;
- * newValue</code> the new orientation</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('orientationChange', handler);</code></p>
- * @event orientationChange
- */
-})();
-
+YAHOO.register("tabview", YAHOO.widget.TabView, {version: "2.3.0", build: "442"});
index 601db0b91ff44f6487bc5a3c75aaa46edae637ca..5dcd37ee9ce6c1951d6cb4769c9ea59c1466dc98 100755 (executable)
@@ -1,5 +1,36 @@
 TreeView - Release Notes
 
+2.3.0
+  * The image preload feature was restored.
+  * Added the new skin
+  * Leaf nodes created with expanded=true have the child div hidden initially
+    to work around an IE rendering issue.
+
+2.2.2
+  * No change
+
+2.2.1
+  * Fixed the default value in the documentation for the nowrap property in Node
+    (the default value is false).
+
+2.2.0
+
+  * Node::insertAfter properly nulls the nextSibling attribute when the
+    inserted before the firstChild.
+
+  * MenuNodes inserted at the root level will no longer lose the menu behavior.
+
+  * TextNode::setUpLabel sets the data.label property as well as the label property.
+
+  * TaskNode example: made the logger optional, and moved the creation of the logger
+    instance to the proper location.
+
+  * TaskNodes added to a node that is in a fully selected state will update the
+    parent to a partially selected state.
+
+  * TaskNode example fixed to propagate the labelClick event
+
+
 0.12.2
 
   * removeChildren will now work properly on the root node.
diff --git a/lib/yui/treeview/assets/skins/sam/treeview-loading.gif b/lib/yui/treeview/assets/skins/sam/treeview-loading.gif
new file mode 100755 (executable)
index 0000000..0bbf3bc
Binary files /dev/null and b/lib/yui/treeview/assets/skins/sam/treeview-loading.gif differ
diff --git a/lib/yui/treeview/assets/skins/sam/treeview-skin.css b/lib/yui/treeview/assets/skins/sam/treeview-skin.css
new file mode 100755 (executable)
index 0000000..8a26820
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* first or middle sibling, no children */
+.ygtvtn {
+       width:18px; height:22px; 
+       background: url(treeview-sprite.gif) 0 -5600px no-repeat; 
+}
+
+/* first or middle sibling, collapsable */
+.ygtvtm {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(treeview-sprite.gif) 0 -4000px no-repeat; 
+}
+
+/* first or middle sibling, collapsable, hover */
+.ygtvtmh {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(treeview-sprite.gif) 0 -4800px no-repeat; 
+}
+
+/* first or middle sibling, expandable */
+.ygtvtp {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(treeview-sprite.gif) 0 -6400px no-repeat; 
+}
+
+/* first or middle sibling, expandable, hover */
+.ygtvtph {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(treeview-sprite.gif) 0 -7200px no-repeat; 
+}
+
+/* last sibling, no children */
+.ygtvln {
+       width:18px; height:22px; 
+       background: url(treeview-sprite.gif) 0 -1600px no-repeat; 
+}
+
+/* Last sibling, collapsable */
+.ygtvlm {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(treeview-sprite.gif) 0 0px no-repeat; 
+}
+
+/* Last sibling, collapsable, hover */
+.ygtvlmh {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(treeview-sprite.gif) 0 -800px no-repeat; 
+}
+
+/* Last sibling, expandable */
+.ygtvlp { 
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(treeview-sprite.gif) 0 -2400px no-repeat; 
+}
+
+/* Last sibling, expandable, hover */
+.ygtvlph { 
+       width:18px; height:22px; cursor:pointer ;
+       background: url(treeview-sprite.gif) 0 -3200px no-repeat; 
+}
+
+/* Loading icon */
+.ygtvloading { 
+       width:18px; height:22px; 
+       background: url(treeview-loading.gif) 0 0 no-repeat; 
+}
+
+/* the style for the empty cells that are used for rendering the depth 
+ * of the node */
+.ygtvdepthcell { 
+       width:18px; height:22px; 
+       background: url(treeview-sprite.gif) 0 -8000px no-repeat; 
+}
+
+.ygtvblankdepthcell { width:18px; height:22px; }
+
+/* the style of the div around each node */
+.ygtvitem { }  
+
+/* the style of the div around each node's collection of children */
+.ygtvchildren {  
+    *zoom: 1;
+}  
+
+/* the style of the text label in ygTextNode */
+.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { 
+       margin-left:2px;
+       text-decoration: none;
+    background-color: white;
+}
+
+.ygtvspacer { height: 22px; width: 18px; }
diff --git a/lib/yui/treeview/assets/skins/sam/treeview-sprite.gif b/lib/yui/treeview/assets/skins/sam/treeview-sprite.gif
new file mode 100755 (executable)
index 0000000..a04eff6
Binary files /dev/null and b/lib/yui/treeview/assets/skins/sam/treeview-sprite.gif differ
diff --git a/lib/yui/treeview/assets/skins/sam/treeview.css b/lib/yui/treeview/assets/skins/sam/treeview.css
new file mode 100755 (executable)
index 0000000..b82d34e
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvitem{}.ygtvchildren{*zoom:1;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;}.ygtvspacer{height:22px;width:18px;}
diff --git a/lib/yui/treeview/assets/sprite-orig.gif b/lib/yui/treeview/assets/sprite-orig.gif
new file mode 100755 (executable)
index 0000000..fdf6fcf
Binary files /dev/null and b/lib/yui/treeview/assets/sprite-orig.gif differ
diff --git a/lib/yui/treeview/assets/treeview-core.css b/lib/yui/treeview/assets/treeview-core.css
new file mode 100755 (executable)
index 0000000..5aa3015
--- /dev/null
@@ -0,0 +1,6 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
diff --git a/lib/yui/treeview/assets/treeview-loading.gif b/lib/yui/treeview/assets/treeview-loading.gif
new file mode 100755 (executable)
index 0000000..0bbf3bc
Binary files /dev/null and b/lib/yui/treeview/assets/treeview-loading.gif differ
diff --git a/lib/yui/treeview/assets/treeview.css b/lib/yui/treeview/assets/treeview.css
new file mode 100755 (executable)
index 0000000..f4e86e4
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/* first or middle sibling, no children */
+.ygtvtn {
+       width:18px; height:22px; 
+       background: url(sprite-orig.gif) 0 -5600px no-repeat; 
+}
+
+/* first or middle sibling, collapsable */
+.ygtvtm {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(sprite-orig.gif) 0 -4000px no-repeat; 
+}
+
+/* first or middle sibling, collapsable, hover */
+.ygtvtmh {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(sprite-orig.gif) 0 -4800px no-repeat; 
+}
+
+/* first or middle sibling, expandable */
+.ygtvtp {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(sprite-orig.gif) 0 -6400px no-repeat; 
+}
+
+/* first or middle sibling, expandable, hover */
+.ygtvtph {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(sprite-orig.gif) 0 -7200px no-repeat; 
+}
+
+/* last sibling, no children */
+.ygtvln {
+       width:18px; height:22px; 
+       background: url(sprite-orig.gif) 0 -1600px no-repeat; 
+}
+
+/* Last sibling, collapsable */
+.ygtvlm {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(sprite-orig.gif) 0 0px no-repeat; 
+}
+
+/* Last sibling, collapsable, hover */
+.ygtvlmh {
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(sprite-orig.gif) 0 -800px no-repeat; 
+}
+
+/* Last sibling, expandable */
+.ygtvlp { 
+       width:18px; height:22px; 
+       cursor:pointer ;
+       background: url(sprite-orig.gif) 0 -2400px no-repeat; 
+}
+
+/* Last sibling, expandable, hover */
+.ygtvlph { 
+       width:18px; height:22px; cursor:pointer ;
+       background: url(sprite-orig.gif) 0 -3200px no-repeat; 
+}
+
+/* Loading icon */
+.ygtvloading { 
+       width:18px; height:22px; 
+       background: url(treeview-loading.gif) 0 0 no-repeat; 
+}
+
+/* the style for the empty cells that are used for rendering the depth 
+ * of the node */
+.ygtvdepthcell { 
+       width:18px; height:22px; 
+       background: url(sprite-orig.gif) 0 -8000px no-repeat; 
+}
+
+.ygtvblankdepthcell { width:18px; height:22px; }
+
+/* the style of the div around each node */
+.ygtvitem { }  
+
+/* the style of the div around each node's collection of children */
+.ygtvchildren {  }  
+* html .ygtvchildren { height:2%; }  
+
+/* the style of the text label in ygTextNode */
+.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { 
+       margin-left:2px;
+       text-decoration: none;
+    background-color: white; /* workaround for IE font smoothing bug */
+}
+
+.ygtvspacer { height: 22px; width: 18px; }
index f7e199000fb499ce01383ee3e7d9884b0e284155..1d6c31a6a6ba116ec92be7cd4943a28e4e1654cb 100755 (executable)
@@ -1,10 +1,9 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-
 /**
  * The treeview widget is a generic tree building tool.
  * @module treeview
@@ -44,7 +43,9 @@ YAHOO.widget.TreeView.prototype = {
     _el: null,
 
      /**
-     * Flat collection of all nodes in this tree
+     * Flat collection of all nodes in this tree.  This is a sparse
+     * array, so the length property can't be relied upon for a
+     * node count for the tree.
      * @property _nodes
      * @type Node[]
      * @private
@@ -282,15 +283,16 @@ YAHOO.widget.TreeView.prototype = {
         // Set up the root node
         this.root = new YAHOO.widget.RootNode(this);
 
-        this.logger = new YAHOO.widget.LogWriter(this.toString());
+        var LW = YAHOO.widget.LogWriter;
+
+        this.logger = (LW) ? new LW(this.toString()) : YAHOO;
 
         this.logger.log("tree init: " + this.id);
 
-        //YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true);
-        YAHOO.util.Event.on(this.id, "click", this.handleClick, this, true);
+        // YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true);
+        // YAHOO.util.Event.on(this.id, "click", this.handleClick, this, true);
     },
 
-
     //handleAvailable: function() {
         //var Event = YAHOO.util.Event;
         //Event.on(this.id, 
@@ -582,7 +584,9 @@ YAHOO.widget.TreeView.prototype = {
 YAHOO.augment(YAHOO.widget.TreeView, YAHOO.util.EventProvider);
 
 /**
- * Count of all nodes in all trees
+ * Running count of all nodes created in all trees.  This is 
+ * used to provide unique identifies for all nodes.  Deleting
+ * nodes does not change the nodeCount.
  * @property YAHOO.widget.TreeView.nodeCount
  * @type int
  * @static
@@ -675,19 +679,27 @@ YAHOO.widget.TreeView.removeHandler = function (el, sType, fn) {
  * images to preload, default is ygtv
  * @static
  */
-YAHOO.widget.TreeView.preload = function(prefix) {
+YAHOO.widget.TreeView.preload = function(e, prefix) {
     prefix = prefix || "ygtv";
+
+    YAHOO.log("Preloading images: " + prefix, "info", "TreeView");
+
     var styles = ["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];
+    // var styles = ["tp"];
 
     var sb = [];
     
-    for (var i = 0; i < styles.length; ++i) { 
+    // save the first one for the outer container
+    for (var i=1; i < styles.length; i=i+1) { 
         sb[sb.length] = '<span class="' + prefix + styles[i] + '">&#160;</span>';
     }
 
     var f = document.createElement("div");
     var s = f.style;
+    s.className = prefix + styles[0];
     s.position = "absolute";
+    s.height = "1px";
+    s.width = "1px";
     s.top = "-1000px";
     s.left = "-1000px";
     f.innerHTML = sb.join("");
@@ -879,7 +891,7 @@ YAHOO.widget.Node.prototype = {
      * to wrap.
      * @property nowrap
      * @type boolean
-     * @default true
+     * @default false
      */
     nowrap: false,
 
@@ -953,9 +965,11 @@ YAHOO.widget.Node.prototype = {
             this.href = "javascript:" + this.getToggleLink();
         }
 
-        if (! this.multiExpand) {
-            this.multiExpand = parentNode.multiExpand;
-        }
+        // @todo why was this put here.  This causes new nodes added at the
+        // root level to lose the menu behavior.
+        // if (! this.multiExpand) {
+            // this.multiExpand = parentNode.multiExpand;
+        // }
 
         this.tree.regNode(this);
         parentNode.childrenRendered = false;
@@ -986,6 +1000,14 @@ YAHOO.widget.Node.prototype = {
         this.children[this.children.length] = childNode;
         childNode.applyParent(this);
 
+        // part of the IE display issue workaround. If child nodes
+        // are added after the initial render, and the node was
+        // instantiated with expanded = true, we need to show the
+        // children div now that the node has a child.
+        if (this.childrenRendered && this.expanded) {
+            this.getChildrenEl().style.display = "";
+        }
+
         return childNode;
     },
 
@@ -1049,6 +1071,7 @@ YAHOO.widget.Node.prototype = {
             this.logger.log(refIndex);
 
             if (!node.nextSibling) {
+                this.nextSibling = null;
                 return this.appendTo(p);
             }
 
@@ -1519,10 +1542,15 @@ YAHOO.widget.Node.prototype = {
      */
     getChildrenHtml: function() {
 
+
         var sb = [];
         sb[sb.length] = '<div class="ygtvchildren"';
         sb[sb.length] = ' id="' + this.getChildrenElId() + '"';
-        if (!this.expanded) {
+
+        // This is a workaround for an IE rendering issue, the child div has layout
+        // in IE, creating extra space if a leaf node is created with the expanded
+        // property set to true.
+        if (!this.expanded || !this.hasChildren()) {
             sb[sb.length] = ' style="display:none;"';
         }
         sb[sb.length] = '>';
@@ -1698,47 +1726,6 @@ YAHOO.widget.Node.prototype = {
 
 YAHOO.augment(YAHOO.widget.Node, YAHOO.util.EventProvider);
 
-/**
- * A custom YAHOO.widget.Node that handles the unique nature of 
- * the virtual, presentationless root node.
- * @namespace YAHOO.widget
- * @class RootNode
- * @extends YAHOO.widget.Node
- * @param oTree {YAHOO.widget.TreeView} The tree instance this node belongs to
- * @constructor
- */
-YAHOO.widget.RootNode = function(oTree) {
-       // Initialize the node with null params.  The root node is a
-       // special case where the node has no presentation.  So we have
-       // to alter the standard properties a bit.
-       this.init(null, null, true);
-       
-       /*
-        * For the root node, we get the tree reference from as a param
-        * to the constructor instead of from the parent element.
-        */
-       this.tree = oTree;
-};
-
-YAHOO.extend(YAHOO.widget.RootNode, YAHOO.widget.Node, {
-    
-    // overrides YAHOO.widget.Node
-    getNodeHtml: function() { 
-        return ""; 
-    },
-
-    toString: function() { 
-        return "RootNode";
-    },
-
-    loadComplete: function() { 
-        this.tree.draw();
-    },
-
-    collapse: function() {},
-    expand: function() {}
-
-});
 /**
  * The default node presentation.  The first parameter should be
  * either a string that will be used as the node's label, or an object
@@ -1824,6 +1811,7 @@ YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {
             oData = { label: oData };
         }
         this.label = oData.label;
+        this.data.label = oData.label;
         
         // update the link
         if (oData.href) {
@@ -1945,37 +1933,44 @@ YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {
 
 });
 /**
- * A menu-specific implementation that differs from TextNode in that only 
- * one sibling can be expanded at a time.
+ * A custom YAHOO.widget.Node that handles the unique nature of 
+ * the virtual, presentationless root node.
  * @namespace YAHOO.widget
- * @class MenuNode
- * @extends YAHOO.widget.TextNode
- * @param oData {object} a string or object containing the data that will
- * be used to render this node
- * @param oParent {YAHOO.widget.Node} this node's parent node
- * @param expanded {boolean} the initial expanded/collapsed state
+ * @class RootNode
+ * @extends YAHOO.widget.Node
+ * @param oTree {YAHOO.widget.TreeView} The tree instance this node belongs to
  * @constructor
  */
-YAHOO.widget.MenuNode = function(oData, oParent, expanded) {
-       if (oData) { 
-               this.init(oData, oParent, expanded);
-               this.setUpLabel(oData);
-       }
-
-    /*
-     * Menus usually allow only one branch to be open at a time.
-     */
-       this.multiExpand = false;
-
-    this.logger     = new YAHOO.widget.LogWriter(this.toString());
-
+YAHOO.widget.RootNode = function(oTree) {
+       // Initialize the node with null params.  The root node is a
+       // special case where the node has no presentation.  So we have
+       // to alter the standard properties a bit.
+       this.init(null, null, true);
+       
+       /*
+        * For the root node, we get the tree reference from as a param
+        * to the constructor instead of from the parent element.
+        */
+       this.tree = oTree;
 };
 
-YAHOO.extend(YAHOO.widget.MenuNode, YAHOO.widget.TextNode, {
+YAHOO.extend(YAHOO.widget.RootNode, YAHOO.widget.Node, {
+    
+    // overrides YAHOO.widget.Node
+    getNodeHtml: function() { 
+        return ""; 
+    },
 
     toString: function() { 
-        return "MenuNode (" + this.index + ") " + this.label;
-    }
+        return "RootNode";
+    },
+
+    loadComplete: function() { 
+        this.tree.draw();
+    },
+
+    collapse: function() {},
+    expand: function() {}
 
 });
 /**
@@ -2101,6 +2096,40 @@ YAHOO.extend(YAHOO.widget.HTMLNode, YAHOO.widget.Node, {
         return "HTMLNode (" + this.index + ")";
     }
 
+});
+/**
+ * A menu-specific implementation that differs from TextNode in that only 
+ * one sibling can be expanded at a time.
+ * @namespace YAHOO.widget
+ * @class MenuNode
+ * @extends YAHOO.widget.TextNode
+ * @param oData {object} a string or object containing the data that will
+ * be used to render this node
+ * @param oParent {YAHOO.widget.Node} this node's parent node
+ * @param expanded {boolean} the initial expanded/collapsed state
+ * @constructor
+ */
+YAHOO.widget.MenuNode = function(oData, oParent, expanded) {
+       if (oData) { 
+               this.init(oData, oParent, expanded);
+               this.setUpLabel(oData);
+       }
+
+    /*
+     * Menus usually allow only one branch to be open at a time.
+     */
+       this.multiExpand = false;
+
+    this.logger     = new YAHOO.widget.LogWriter(this.toString());
+
+};
+
+YAHOO.extend(YAHOO.widget.MenuNode, YAHOO.widget.TextNode, {
+
+    toString: function() { 
+        return "MenuNode (" + this.index + ") " + this.label;
+    }
+
 });
 /**
  * A static factory class for tree view expand/collapse animations
@@ -2277,3 +2306,4 @@ YAHOO.widget.TVFadeOut.prototype = {
     }
 };
 
+YAHOO.register("treeview", YAHOO.widget.TreeView, {version: "2.3.0", build: "442"});
index 804f81b7e82c7420e2d8f6e6f8d3630ab85f7429..663cf728b85d1a92805d3b1485a1337deca6bcbd 100755 (executable)
@@ -1,17 +1,16 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 
-
 YAHOO.widget.TreeView=function(id){if(id){this.init(id);}};YAHOO.widget.TreeView.prototype={id:null,_el:null,_nodes:null,locked:false,_expandAnim:null,_collapseAnim:null,_animCount:0,maxAnim:2,setExpandAnim:function(type){if(YAHOO.widget.TVAnim.isValid(type)){this._expandAnim=type;}},setCollapseAnim:function(type){if(YAHOO.widget.TVAnim.isValid(type)){this._collapseAnim=type;}},animateExpand:function(el,node){if(this._expandAnim&&this._animCount<this.maxAnim){var tree=this;var a=YAHOO.widget.TVAnim.getAnim(this._expandAnim,el,function(){tree.expandComplete(node);});if(a){++this._animCount;this.fireEvent("animStart",{"node":node,"type":"expand"});a.animate();}
 return true;}
 return false;},animateCollapse:function(el,node){if(this._collapseAnim&&this._animCount<this.maxAnim){var tree=this;var a=YAHOO.widget.TVAnim.getAnim(this._collapseAnim,el,function(){tree.collapseComplete(node);});if(a){++this._animCount;this.fireEvent("animStart",{"node":node,"type":"collapse"});a.animate();}
 return true;}
 return false;},expandComplete:function(node){--this._animCount;this.fireEvent("animComplete",{"node":node,"type":"expand"});},collapseComplete:function(node){--this._animCount;this.fireEvent("animComplete",{"node":node,"type":"collapse"});},init:function(id){this.id=id;if("string"!==typeof id){this._el=id;this.id=this.generateId(id);}
-this.createEvent("animStart",this);this.createEvent("animComplete",this);this.createEvent("collapse",this);this.createEvent("collapseComplete",this);this.createEvent("expand",this);this.createEvent("expandComplete",this);this._nodes=[];YAHOO.widget.TreeView.trees[this.id]=this;this.root=new YAHOO.widget.RootNode(this);YAHOO.util.Event.on(this.id,"click",this.handleClick,this,true);},draw:function(){var html=this.root.getHtml();this.getEl().innerHTML=html;this.firstDraw=false;},getEl:function(){if(!this._el){this._el=document.getElementById(this.id);}
+this.createEvent("animStart",this);this.createEvent("animComplete",this);this.createEvent("collapse",this);this.createEvent("collapseComplete",this);this.createEvent("expand",this);this.createEvent("expandComplete",this);this._nodes=[];YAHOO.widget.TreeView.trees[this.id]=this;this.root=new YAHOO.widget.RootNode(this);var LW=YAHOO.widget.LogWriter;},draw:function(){var html=this.root.getHtml();this.getEl().innerHTML=html;this.firstDraw=false;},getEl:function(){if(!this._el){this._el=document.getElementById(this.id);}
 return this._el;},regNode:function(node){this._nodes[node.index]=node;},getRoot:function(){return this.root;},setDynamicLoad:function(fnDataLoader,iconMode){this.root.setDynamicLoad(fnDataLoader,iconMode);},expandAll:function(){if(!this.locked){this.root.expandAll();}},collapseAll:function(){if(!this.locked){this.root.collapseAll();}},getNodeByIndex:function(nodeIndex){var n=this._nodes[nodeIndex];return(n)?n:null;},getNodeByProperty:function(property,value){for(var i in this._nodes){var n=this._nodes[i];if(n.data&&value==n.data[property]){return n;}}
 return null;},getNodesByProperty:function(property,value){var values=[];for(var i in this._nodes){var n=this._nodes[i];if(n.data&&value==n.data[property]){values.push(n);}}
 return(values.length)?values:null;},removeNode:function(node,autoRefresh){if(node.isRoot()){return false;}
@@ -22,17 +21,17 @@ node.childrenRendered=false;node.dynamicLoadComplete=false;if(node.expanded){nod
 p.children=a;p.childrenRendered=false;if(node.previousSibling){node.previousSibling.nextSibling=node.nextSibling;}
 if(node.nextSibling){node.nextSibling.previousSibling=node.previousSibling;}
 node.parent=null;node.previousSibling=null;node.nextSibling=null;node.tree=null;delete this._nodes[node.index];},toString:function(){return"TreeView "+this.id;},generateId:function(el){var id=el.id;if(!id){id="yui-tv-auto-id-"+YAHOO.widget.TreeView.counter;++YAHOO.widget.TreeView.counter;}
-return id;},onExpand:function(node){},onCollapse:function(node){}};YAHOO.augment(YAHOO.widget.TreeView,YAHOO.util.EventProvider);YAHOO.widget.TreeView.nodeCount=0;YAHOO.widget.TreeView.trees=[];YAHOO.widget.TreeView.counter=0;YAHOO.widget.TreeView.getTree=function(treeId){var t=YAHOO.widget.TreeView.trees[treeId];return(t)?t:null;};YAHOO.widget.TreeView.getNode=function(treeId,nodeIndex){var t=YAHOO.widget.TreeView.getTree(treeId);return(t)?t.getNodeByIndex(nodeIndex):null;};YAHOO.widget.TreeView.addHandler=function(el,sType,fn){if(el.addEventListener){el.addEventListener(sType,fn,false);}else if(el.attachEvent){el.attachEvent("on"+sType,fn);}};YAHOO.widget.TreeView.removeHandler=function(el,sType,fn){if(el.removeEventListener){el.removeEventListener(sType,fn,false);}else if(el.detachEvent){el.detachEvent("on"+sType,fn);}};YAHOO.widget.TreeView.preload=function(prefix){prefix=prefix||"ygtv";var styles=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var sb=[];for(var i=0;i<styles.length;++i){sb[sb.length]='<span class="'+prefix+styles[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(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);}};YAHOO.widget.Node.prototype={index:0,children:null,tree:null,data:null,parent:null,depth:-1,href:null,target:"_self",expanded:false,multiExpand:true,renderHidden:false,childrenRendered:false,dynamicLoadComplete:false,previousSibling:null,nextSibling:null,_dynLoad:false,dataLoader:null,isLoading:false,hasIcon:true,iconMode:0,nowrap:false,_type:"Node",init:function(oData,oParent,expanded){this.data=oData;this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.expanded=expanded;this.createEvent("parentChange",this);if(oParent){oParent.appendChild(this);}},applyParent:function(parentNode){if(!parentNode){return false;}
+return id;},onExpand:function(node){},onCollapse:function(node){}};YAHOO.augment(YAHOO.widget.TreeView,YAHOO.util.EventProvider);YAHOO.widget.TreeView.nodeCount=0;YAHOO.widget.TreeView.trees=[];YAHOO.widget.TreeView.counter=0;YAHOO.widget.TreeView.getTree=function(treeId){var t=YAHOO.widget.TreeView.trees[treeId];return(t)?t:null;};YAHOO.widget.TreeView.getNode=function(treeId,nodeIndex){var t=YAHOO.widget.TreeView.getTree(treeId);return(t)?t.getNodeByIndex(nodeIndex):null;};YAHOO.widget.TreeView.addHandler=function(el,sType,fn){if(el.addEventListener){el.addEventListener(sType,fn,false);}else if(el.attachEvent){el.attachEvent("on"+sType,fn);}};YAHOO.widget.TreeView.removeHandler=function(el,sType,fn){if(el.removeEventListener){el.removeEventListener(sType,fn,false);}else if(el.detachEvent){el.detachEvent("on"+sType,fn);}};YAHOO.widget.TreeView.preload=function(e,prefix){prefix=prefix||"ygtv";var styles=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var sb=[];for(var i=1;i<styles.length;i=i+1){sb[sb.length]='<span class="'+prefix+styles[i]+'">&#160;</span>';}
+var f=document.createElement("div");var s=f.style;s.className=prefix+styles[0];s.position="absolute";s.height="1px";s.width="1px";s.top="-1000px";s.left="-1000px";f.innerHTML=sb.join("");document.body.appendChild(f);YAHOO.widget.TreeView.removeHandler(window,"load",YAHOO.widget.TreeView.preload);};YAHOO.widget.TreeView.addHandler(window,"load",YAHOO.widget.TreeView.preload);YAHOO.widget.Node=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);}};YAHOO.widget.Node.prototype={index:0,children:null,tree:null,data:null,parent:null,depth:-1,href:null,target:"_self",expanded:false,multiExpand:true,renderHidden:false,childrenRendered:false,dynamicLoadComplete:false,previousSibling:null,nextSibling:null,_dynLoad:false,dataLoader:null,isLoading:false,hasIcon:true,iconMode:0,nowrap:false,_type:"Node",init:function(oData,oParent,expanded){this.data=oData;this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.expanded=expanded;this.createEvent("parentChange",this);if(oParent){oParent.appendChild(this);}},applyParent:function(parentNode){if(!parentNode){return false;}
 this.tree=parentNode.tree;this.parent=parentNode;this.depth=parentNode.depth+1;if(!this.href){this.href="javascript:"+this.getToggleLink();}
-if(!this.multiExpand){this.multiExpand=parentNode.multiExpand;}
 this.tree.regNode(this);parentNode.childrenRendered=false;for(var i=0,len=this.children.length;i<len;++i){this.children[i].applyParent(this);}
 this.fireEvent("parentChange");return true;},appendChild:function(childNode){if(this.hasChildren()){var sib=this.children[this.children.length-1];sib.nextSibling=childNode;childNode.previousSibling=sib;}
-this.children[this.children.length]=childNode;childNode.applyParent(this);return childNode;},appendTo:function(parentNode){return parentNode.appendChild(this);},insertBefore:function(node){var p=node.parent;if(p){if(this.tree){this.tree.popNode(this);}
+this.children[this.children.length]=childNode;childNode.applyParent(this);if(this.childrenRendered&&this.expanded){this.getChildrenEl().style.display="";}
+return childNode;},appendTo:function(parentNode){return parentNode.appendChild(this);},insertBefore:function(node){var p=node.parent;if(p){if(this.tree){this.tree.popNode(this);}
 var refIndex=node.isChildOf(p);p.children.splice(refIndex,0,this);if(node.previousSibling){node.previousSibling.nextSibling=this;}
 this.previousSibling=node.previousSibling;this.nextSibling=node;node.previousSibling=this;this.applyParent(p);}
 return this;},insertAfter:function(node){var p=node.parent;if(p){if(this.tree){this.tree.popNode(this);}
-var refIndex=node.isChildOf(p);if(!node.nextSibling){return this.appendTo(p);}
+var refIndex=node.isChildOf(p);if(!node.nextSibling){this.nextSibling=null;return this.appendTo(p);}
 p.children.splice(refIndex+1,0,this);node.nextSibling.previousSibling=this;this.previousSibling=node;this.nextSibling=node.nextSibling;node.nextSibling=this;this.applyParent(p);}
 return this;},isChildOf:function(parentNode){if(parentNode&&parentNode.children){for(var i=0,len=parentNode.children.length;i<len;++i){if(parentNode.children[i]===this){return i;}}}
 return-1;},getSiblings:function(){return this.parent.children;},showChildren:function(){if(!this.tree.animateExpand(this.getChildrenEl(),this)){if(this.hasChildren()){this.getChildrenEl().style.display="";}}},hideChildren:function(){if(!this.tree.animateCollapse(this.getChildrenEl(),this)){this.getChildrenEl().style.display="none";}},getElId:function(){return"ygtv"+this.index;},getChildrenElId:function(){return"ygtvc"+this.index;},getToggleElId:function(){return"ygtvt"+this.index;},getEl:function(){return document.getElementById(this.getElId());},getChildrenEl:function(){return document.getElementById(this.getChildrenElId());},getToggleEl:function(){return document.getElementById(this.getToggleElId());},getToggleLink:function(){return"YAHOO.widget.TreeView.getNode(\'"+this.tree.id+"\',"+
@@ -50,23 +49,23 @@ if(!this.multiExpand){var sibs=this.getSiblings();for(var i=0;i<sibs.length;++i)
 this.showChildren();ret=this.tree.fireEvent("expandComplete",this);},updateIcon:function(){if(this.hasIcon){var el=this.getToggleEl();if(el){el.className=this.getStyle();}}},getStyle:function(){if(this.isLoading){return"ygtvloading";}else{var loc=(this.nextSibling)?"t":"l";var type="n";if(this.hasChildren(true)||(this.isDynamic()&&!this.getIconMode())){type=(this.expanded)?"m":"p";}
 return"ygtv"+loc+type;}},getHoverStyle:function(){var s=this.getStyle();if(this.hasChildren(true)&&!this.isLoading){s+="h";}
 return s;},expandAll:function(){for(var i=0;i<this.children.length;++i){var c=this.children[i];if(c.isDynamic()){alert("Not supported (lazy load + expand all)");break;}else if(!c.multiExpand){alert("Not supported (no multi-expand + expand all)");break;}else{c.expand();c.expandAll();}}},collapseAll:function(){for(var i=0;i<this.children.length;++i){this.children[i].collapse();this.children[i].collapseAll();}},setDynamicLoad:function(fnDataLoader,iconMode){if(fnDataLoader){this.dataLoader=fnDataLoader;this._dynLoad=true;}else{this.dataLoader=null;this._dynLoad=false;}
-if(iconMode){this.iconMode=iconMode;}},isRoot:function(){return(this==this.tree.root);},isDynamic:function(){var lazy=(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad));return lazy;},getIconMode:function(){return(this.iconMode||this.tree.root.iconMode);},hasChildren:function(checkForLazyLoad){return(this.children.length>0||(checkForLazyLoad&&this.isDynamic()&&!this.dynamicLoadComplete));},toggle:function(){if(!this.tree.locked&&(this.hasChildren(true)||this.isDynamic())){if(this.expanded){this.collapse();}else{this.expand();}}},getHtml:function(){this.childrenRendered=false;var sb=[];sb[sb.length]='<div class="ygtvitem" id="'+this.getElId()+'">';sb[sb.length]=this.getNodeHtml();sb[sb.length]=this.getChildrenHtml();sb[sb.length]='</div>';return sb.join("");},getChildrenHtml:function(){var sb=[];sb[sb.length]='<div class="ygtvchildren"';sb[sb.length]=' id="'+this.getChildrenElId()+'"';if(!this.expanded){sb[sb.length]=' style="display:none;"';}
+if(iconMode){this.iconMode=iconMode;}},isRoot:function(){return(this==this.tree.root);},isDynamic:function(){var lazy=(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad));return lazy;},getIconMode:function(){return(this.iconMode||this.tree.root.iconMode);},hasChildren:function(checkForLazyLoad){return(this.children.length>0||(checkForLazyLoad&&this.isDynamic()&&!this.dynamicLoadComplete));},toggle:function(){if(!this.tree.locked&&(this.hasChildren(true)||this.isDynamic())){if(this.expanded){this.collapse();}else{this.expand();}}},getHtml:function(){this.childrenRendered=false;var sb=[];sb[sb.length]='<div class="ygtvitem" id="'+this.getElId()+'">';sb[sb.length]=this.getNodeHtml();sb[sb.length]=this.getChildrenHtml();sb[sb.length]='</div>';return sb.join("");},getChildrenHtml:function(){var sb=[];sb[sb.length]='<div class="ygtvchildren"';sb[sb.length]=' id="'+this.getChildrenElId()+'"';if(!this.expanded||!this.hasChildren()){sb[sb.length]=' style="display:none;"';}
 sb[sb.length]='>';if((this.hasChildren(true)&&this.expanded)||(this.renderHidden&&!this.isDynamic())){sb[sb.length]=this.renderChildren();}
 sb[sb.length]='</div>';return sb.join("");},renderChildren:function(){var node=this;if(this.isDynamic()&&!this.dynamicLoadComplete){this.isLoading=true;this.tree.locked=true;if(this.dataLoader){setTimeout(function(){node.dataLoader(node,function(){node.loadComplete();});},10);}else if(this.tree.root.dataLoader){setTimeout(function(){node.tree.root.dataLoader(node,function(){node.loadComplete();});},10);}else{return"Error: data loader not found or not specified.";}
 return"";}else{return this.completeRender();}},completeRender:function(){var sb=[];for(var i=0;i<this.children.length;++i){sb[sb.length]=this.children[i].getHtml();}
 this.childrenRendered=true;return sb.join("");},loadComplete:function(){this.getChildrenEl().innerHTML=this.completeRender();this.dynamicLoadComplete=true;this.isLoading=false;this.expand();this.tree.locked=false;},getAncestor:function(depth){if(depth>=this.depth||depth<0){return null;}
 var p=this.parent;while(p.depth>depth){p=p.parent;}
-return p;},getDepthStyle:function(depth){return(this.getAncestor(depth).nextSibling)?"ygtvdepthcell":"ygtvblankdepthcell";},getNodeHtml:function(){return"";},refresh:function(){this.getChildrenEl().innerHTML=this.completeRender();if(this.hasIcon){var el=this.getToggleEl();if(el){el.className=this.getStyle();}}},toString:function(){return"Node ("+this.index+")";}};YAHOO.augment(YAHOO.widget.Node,YAHOO.util.EventProvider);YAHOO.widget.RootNode=function(oTree){this.init(null,null,true);this.tree=oTree;};YAHOO.extend(YAHOO.widget.RootNode,YAHOO.widget.Node,{getNodeHtml:function(){return"";},toString:function(){return"RootNode";},loadComplete:function(){this.tree.draw();},collapse:function(){},expand:function(){}});YAHOO.widget.TextNode=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);this.setUpLabel(oData);}};YAHOO.extend(YAHOO.widget.TextNode,YAHOO.widget.Node,{labelStyle:"ygtvlabel",labelElId:null,label:null,textNodeParentChange:function(){if(this.tree&&!this.tree.hasEvent("labelClick")){this.tree.createEvent("labelClick",this.tree);}},setUpLabel:function(oData){this.textNodeParentChange();this.subscribe("parentChange",this.textNodeParentChange);if(typeof oData=="string"){oData={label:oData};}
-this.label=oData.label;if(oData.href){this.href=oData.href;}
+return p;},getDepthStyle:function(depth){return(this.getAncestor(depth).nextSibling)?"ygtvdepthcell":"ygtvblankdepthcell";},getNodeHtml:function(){return"";},refresh:function(){this.getChildrenEl().innerHTML=this.completeRender();if(this.hasIcon){var el=this.getToggleEl();if(el){el.className=this.getStyle();}}},toString:function(){return"Node ("+this.index+")";}};YAHOO.augment(YAHOO.widget.Node,YAHOO.util.EventProvider);YAHOO.widget.TextNode=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);this.setUpLabel(oData);}};YAHOO.extend(YAHOO.widget.TextNode,YAHOO.widget.Node,{labelStyle:"ygtvlabel",labelElId:null,label:null,textNodeParentChange:function(){if(this.tree&&!this.tree.hasEvent("labelClick")){this.tree.createEvent("labelClick",this.tree);}},setUpLabel:function(oData){this.textNodeParentChange();this.subscribe("parentChange",this.textNodeParentChange);if(typeof oData=="string"){oData={label:oData};}
+this.label=oData.label;this.data.label=oData.label;if(oData.href){this.href=oData.href;}
 if(oData.target){this.target=oData.target;}
 if(oData.style){this.labelStyle=oData.style;}
 this.labelElId="ygtvlabelel"+this.index;},getLabelEl:function(){return document.getElementById(this.labelElId);},getNodeHtml:function(){var sb=[];sb[sb.length]='<table border="0" cellpadding="0" cellspacing="0">';sb[sb.length]='<tr>';for(var i=0;i<this.depth;++i){sb[sb.length]='<td class="'+this.getDepthStyle(i)+'"><div class="ygtvspacer"></div></td>';}
 var getNode='YAHOO.widget.TreeView.getNode(\''+
 this.tree.id+'\','+this.index+')';sb[sb.length]='<td';sb[sb.length]=' id="'+this.getToggleElId()+'"';sb[sb.length]=' class="'+this.getStyle()+'"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="this.className=';sb[sb.length]=getNode+'.getHoverStyle()"';sb[sb.length]=' onmouseout="this.className=';sb[sb.length]=getNode+'.getStyle()"';}
 sb[sb.length]=' onclick="javascript:'+this.getToggleLink()+'">';sb[sb.length]='<div class="ygtvspacer">';sb[sb.length]='</div>';sb[sb.length]='</td>';sb[sb.length]='<td ';sb[sb.length]=(this.nowrap)?' nowrap="nowrap" ':'';sb[sb.length]=' >';sb[sb.length]='<a';sb[sb.length]=' id="'+this.labelElId+'"';sb[sb.length]=' class="'+this.labelStyle+'"';sb[sb.length]=' href="'+this.href+'"';sb[sb.length]=' target="'+this.target+'"';sb[sb.length]=' onclick="return '+getNode+'.onLabelClick('+getNode+')"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="document.getElementById(\'';sb[sb.length]=this.getToggleElId()+'\').className=';sb[sb.length]=getNode+'.getHoverStyle()"';sb[sb.length]=' onmouseout="document.getElementById(\'';sb[sb.length]=this.getToggleElId()+'\').className=';sb[sb.length]=getNode+'.getStyle()"';}
-sb[sb.length]=' >';sb[sb.length]=this.label;sb[sb.length]='</a>';sb[sb.length]='</td>';sb[sb.length]='</tr>';sb[sb.length]='</table>';return sb.join("");},onLabelClick:function(me){return me.tree.fireEvent("labelClick",me);},toString:function(){return"TextNode ("+this.index+") "+this.label;}});YAHOO.widget.MenuNode=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);this.setUpLabel(oData);}
-this.multiExpand=false;};YAHOO.extend(YAHOO.widget.MenuNode,YAHOO.widget.TextNode,{toString:function(){return"MenuNode ("+this.index+") "+this.label;}});YAHOO.widget.HTMLNode=function(oData,oParent,expanded,hasIcon){if(oData){this.init(oData,oParent,expanded);this.initContent(oData,hasIcon);}};YAHOO.extend(YAHOO.widget.HTMLNode,YAHOO.widget.Node,{contentStyle:"ygtvhtml",contentElId:null,content:null,initContent:function(oData,hasIcon){if(typeof oData=="string"){oData={html:oData};}
+sb[sb.length]=' >';sb[sb.length]=this.label;sb[sb.length]='</a>';sb[sb.length]='</td>';sb[sb.length]='</tr>';sb[sb.length]='</table>';return sb.join("");},onLabelClick:function(me){return me.tree.fireEvent("labelClick",me);},toString:function(){return"TextNode ("+this.index+") "+this.label;}});YAHOO.widget.RootNode=function(oTree){this.init(null,null,true);this.tree=oTree;};YAHOO.extend(YAHOO.widget.RootNode,YAHOO.widget.Node,{getNodeHtml:function(){return"";},toString:function(){return"RootNode";},loadComplete:function(){this.tree.draw();},collapse:function(){},expand:function(){}});YAHOO.widget.HTMLNode=function(oData,oParent,expanded,hasIcon){if(oData){this.init(oData,oParent,expanded);this.initContent(oData,hasIcon);}};YAHOO.extend(YAHOO.widget.HTMLNode,YAHOO.widget.Node,{contentStyle:"ygtvhtml",contentElId:null,content:null,initContent:function(oData,hasIcon){if(typeof oData=="string"){oData={html:oData};}
 this.html=oData.html;this.contentElId="ygtvcontentel"+this.index;this.hasIcon=hasIcon;},getContentEl:function(){return document.getElementById(this.contentElId);},getNodeHtml:function(){var sb=[];sb[sb.length]='<table border="0" cellpadding="0" cellspacing="0">';sb[sb.length]='<tr>';for(var i=0;i<this.depth;++i){sb[sb.length]='<td class="'+this.getDepthStyle(i)+'"><div class="ygtvspacer"></div></td>';}
 if(this.hasIcon){sb[sb.length]='<td';sb[sb.length]=' id="'+this.getToggleElId()+'"';sb[sb.length]=' class="'+this.getStyle()+'"';sb[sb.length]=' onclick="javascript:'+this.getToggleLink()+'"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="this.className=';sb[sb.length]='YAHOO.widget.TreeView.getNode(\'';sb[sb.length]=this.tree.id+'\','+this.index+').getHoverStyle()"';sb[sb.length]=' onmouseout="this.className=';sb[sb.length]='YAHOO.widget.TreeView.getNode(\'';sb[sb.length]=this.tree.id+'\','+this.index+').getStyle()"';}
 sb[sb.length]='><div class="ygtvspacer"></div></td>';}
-sb[sb.length]='<td';sb[sb.length]=' id="'+this.contentElId+'"';sb[sb.length]=' class="'+this.contentStyle+'"';sb[sb.length]=(this.nowrap)?' nowrap="nowrap" ':'';sb[sb.length]=' >';sb[sb.length]=this.html;sb[sb.length]='</td>';sb[sb.length]='</tr>';sb[sb.length]='</table>';return sb.join("");},toString:function(){return"HTMLNode ("+this.index+")";}});YAHOO.widget.TVAnim=function(){return{FADE_IN:"TVFadeIn",FADE_OUT:"TVFadeOut",getAnim:function(type,el,callback){if(YAHOO.widget[type]){return new YAHOO.widget[type](el,callback);}else{return null;}},isValid:function(type){return(YAHOO.widget[type]);}};}();YAHOO.widget.TVFadeIn=function(el,callback){this.el=el;this.callback=callback;};YAHOO.widget.TVFadeIn.prototype={animate:function(){var tvanim=this;var s=this.el.style;s.opacity=0.1;s.filter="alpha(opacity=10)";s.display="";var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:0.1,to:1,unit:""}},dur);a.onComplete.subscribe(function(){tvanim.onComplete();});a.animate();},onComplete:function(){this.callback();},toString:function(){return"TVFadeIn";}};YAHOO.widget.TVFadeOut=function(el,callback){this.el=el;this.callback=callback;};YAHOO.widget.TVFadeOut.prototype={animate:function(){var tvanim=this;var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:1,to:0.1,unit:""}},dur);a.onComplete.subscribe(function(){tvanim.onComplete();});a.animate();},onComplete:function(){var s=this.el.style;s.display="none";s.filter="alpha(opacity=100)";this.callback();},toString:function(){return"TVFadeOut";}};
\ No newline at end of file
+sb[sb.length]='<td';sb[sb.length]=' id="'+this.contentElId+'"';sb[sb.length]=' class="'+this.contentStyle+'"';sb[sb.length]=(this.nowrap)?' nowrap="nowrap" ':'';sb[sb.length]=' >';sb[sb.length]=this.html;sb[sb.length]='</td>';sb[sb.length]='</tr>';sb[sb.length]='</table>';return sb.join("");},toString:function(){return"HTMLNode ("+this.index+")";}});YAHOO.widget.MenuNode=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);this.setUpLabel(oData);}
+this.multiExpand=false;};YAHOO.extend(YAHOO.widget.MenuNode,YAHOO.widget.TextNode,{toString:function(){return"MenuNode ("+this.index+") "+this.label;}});YAHOO.widget.TVAnim=function(){return{FADE_IN:"TVFadeIn",FADE_OUT:"TVFadeOut",getAnim:function(type,el,callback){if(YAHOO.widget[type]){return new YAHOO.widget[type](el,callback);}else{return null;}},isValid:function(type){return(YAHOO.widget[type]);}};}();YAHOO.widget.TVFadeIn=function(el,callback){this.el=el;this.callback=callback;};YAHOO.widget.TVFadeIn.prototype={animate:function(){var tvanim=this;var s=this.el.style;s.opacity=0.1;s.filter="alpha(opacity=10)";s.display="";var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:0.1,to:1,unit:""}},dur);a.onComplete.subscribe(function(){tvanim.onComplete();});a.animate();},onComplete:function(){this.callback();},toString:function(){return"TVFadeIn";}};YAHOO.widget.TVFadeOut=function(el,callback){this.el=el;this.callback=callback;};YAHOO.widget.TVFadeOut.prototype={animate:function(){var tvanim=this;var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:1,to:0.1,unit:""}},dur);a.onComplete.subscribe(function(){tvanim.onComplete();});a.animate();},onComplete:function(){var s=this.el.style;s.display="none";s.filter="alpha(opacity=100)";this.callback();},toString:function(){return"TVFadeOut";}};YAHOO.register("treeview",YAHOO.widget.TreeView,{version:"2.3.0",build:"442"});
\ No newline at end of file
index c8e82a8fbefce6112a879c3318ff905520693807..d70fc295fc701693a468b719fec9e661d21991d8 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 /**
  * The treeview widget is a generic tree building tool.
@@ -43,7 +43,9 @@ YAHOO.widget.TreeView.prototype = {
     _el: null,
 
      /**
-     * Flat collection of all nodes in this tree
+     * Flat collection of all nodes in this tree.  This is a sparse
+     * array, so the length property can't be relied upon for a
+     * node count for the tree.
      * @property _nodes
      * @type Node[]
      * @private
@@ -277,10 +279,12 @@ YAHOO.widget.TreeView.prototype = {
         // Set up the root node
         this.root = new YAHOO.widget.RootNode(this);
 
+        var LW = YAHOO.widget.LogWriter;
 
 
-        //YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true);
-        YAHOO.util.Event.on(this.id, "click", this.handleClick, this, true);
+
+        // YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true);
+        // YAHOO.util.Event.on(this.id, "click", this.handleClick, this, true);
     },
 
     //handleAvailable: function() {
@@ -526,6 +530,7 @@ YAHOO.widget.TreeView.prototype = {
         delete this._nodes[node.index];
     },
 
+
     /**
      * TreeView instance toString
      * @method toString
@@ -572,7 +577,9 @@ YAHOO.widget.TreeView.prototype = {
 YAHOO.augment(YAHOO.widget.TreeView, YAHOO.util.EventProvider);
 
 /**
- * Count of all nodes in all trees
+ * Running count of all nodes created in all trees.  This is 
+ * used to provide unique identifies for all nodes.  Deleting
+ * nodes does not change the nodeCount.
  * @property YAHOO.widget.TreeView.nodeCount
  * @type int
  * @static
@@ -609,6 +616,7 @@ YAHOO.widget.TreeView.getTree = function(treeId) {
     return (t) ? t : null;
 };
 
+
 /**
  * Global method for getting a node by its id.  Used in the generated
  * tree html.
@@ -664,19 +672,26 @@ YAHOO.widget.TreeView.removeHandler = function (el, sType, fn) {
  * images to preload, default is ygtv
  * @static
  */
-YAHOO.widget.TreeView.preload = function(prefix) {
+YAHOO.widget.TreeView.preload = function(e, prefix) {
     prefix = prefix || "ygtv";
+
+
     var styles = ["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];
+    // var styles = ["tp"];
 
     var sb = [];
     
-    for (var i = 0; i < styles.length; ++i) { 
+    // save the first one for the outer container
+    for (var i=1; i < styles.length; i=i+1) { 
         sb[sb.length] = '<span class="' + prefix + styles[i] + '">&#160;</span>';
     }
 
     var f = document.createElement("div");
     var s = f.style;
+    s.className = prefix + styles[0];
     s.position = "absolute";
+    s.height = "1px";
+    s.width = "1px";
     s.top = "-1000px";
     s.left = "-1000px";
     f.innerHTML = sb.join("");
@@ -868,7 +883,7 @@ YAHOO.widget.Node.prototype = {
      * to wrap.
      * @property nowrap
      * @type boolean
-     * @default true
+     * @default false
      */
     nowrap: false,
 
@@ -941,9 +956,11 @@ YAHOO.widget.Node.prototype = {
             this.href = "javascript:" + this.getToggleLink();
         }
 
-        if (! this.multiExpand) {
-            this.multiExpand = parentNode.multiExpand;
-        }
+        // @todo why was this put here.  This causes new nodes added at the
+        // root level to lose the menu behavior.
+        // if (! this.multiExpand) {
+            // this.multiExpand = parentNode.multiExpand;
+        // }
 
         this.tree.regNode(this);
         parentNode.childrenRendered = false;
@@ -974,6 +991,14 @@ YAHOO.widget.Node.prototype = {
         this.children[this.children.length] = childNode;
         childNode.applyParent(this);
 
+        // part of the IE display issue workaround. If child nodes
+        // are added after the initial render, and the node was
+        // instantiated with expanded = true, we need to show the
+        // children div now that the node has a child.
+        if (this.childrenRendered && this.expanded) {
+            this.getChildrenEl().style.display = "";
+        }
+
         return childNode;
     },
 
@@ -1033,6 +1058,7 @@ YAHOO.widget.Node.prototype = {
             var refIndex = node.isChildOf(p);
 
             if (!node.nextSibling) {
+                this.nextSibling = null;
                 return this.appendTo(p);
             }
 
@@ -1128,6 +1154,7 @@ YAHOO.widget.Node.prototype = {
         return "ygtvt" + this.index;
     },
 
+
     /*
      * Returns the id for this node's spacer image.  The spacer is positioned
      * over the toggle and provides feedback for screen readers.
@@ -1226,6 +1253,7 @@ YAHOO.widget.Node.prototype = {
             return;
         }
 
+
         if (!this.getEl()) {
             this.expanded = false;
         } else {
@@ -1490,10 +1518,15 @@ YAHOO.widget.Node.prototype = {
      */
     getChildrenHtml: function() {
 
+
         var sb = [];
         sb[sb.length] = '<div class="ygtvchildren"';
         sb[sb.length] = ' id="' + this.getChildrenElId() + '"';
-        if (!this.expanded) {
+
+        // This is a workaround for an IE rendering issue, the child div has layout
+        // in IE, creating extra space if a leaf node is created with the expanded
+        // property set to true.
+        if (!this.expanded || !this.hasChildren()) {
             sb[sb.length] = ' style="display:none;"';
         }
         sb[sb.length] = '>';
@@ -1661,47 +1694,6 @@ YAHOO.widget.Node.prototype = {
 
 YAHOO.augment(YAHOO.widget.Node, YAHOO.util.EventProvider);
 
-/**
- * A custom YAHOO.widget.Node that handles the unique nature of 
- * the virtual, presentationless root node.
- * @namespace YAHOO.widget
- * @class RootNode
- * @extends YAHOO.widget.Node
- * @param oTree {YAHOO.widget.TreeView} The tree instance this node belongs to
- * @constructor
- */
-YAHOO.widget.RootNode = function(oTree) {
-       // Initialize the node with null params.  The root node is a
-       // special case where the node has no presentation.  So we have
-       // to alter the standard properties a bit.
-       this.init(null, null, true);
-       
-       /*
-        * For the root node, we get the tree reference from as a param
-        * to the constructor instead of from the parent element.
-        */
-       this.tree = oTree;
-};
-
-YAHOO.extend(YAHOO.widget.RootNode, YAHOO.widget.Node, {
-    
-    // overrides YAHOO.widget.Node
-    getNodeHtml: function() { 
-        return ""; 
-    },
-
-    toString: function() { 
-        return "RootNode";
-    },
-
-    loadComplete: function() { 
-        this.tree.draw();
-    },
-
-    collapse: function() {},
-    expand: function() {}
-
-});
 /**
  * The default node presentation.  The first parameter should be
  * either a string that will be used as the node's label, or an object
@@ -1786,6 +1778,7 @@ YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {
             oData = { label: oData };
         }
         this.label = oData.label;
+        this.data.label = oData.label;
         
         // update the link
         if (oData.href) {
@@ -1886,6 +1879,7 @@ YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {
         return sb.join("");
     },
 
+
     /**
      * Executed when the label is clicked.  Fires the labelClick custom event.
      * @method onLabelClick
@@ -1904,36 +1898,44 @@ YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {
 
 });
 /**
- * A menu-specific implementation that differs from TextNode in that only 
- * one sibling can be expanded at a time.
+ * A custom YAHOO.widget.Node that handles the unique nature of 
+ * the virtual, presentationless root node.
  * @namespace YAHOO.widget
- * @class MenuNode
- * @extends YAHOO.widget.TextNode
- * @param oData {object} a string or object containing the data that will
- * be used to render this node
- * @param oParent {YAHOO.widget.Node} this node's parent node
- * @param expanded {boolean} the initial expanded/collapsed state
+ * @class RootNode
+ * @extends YAHOO.widget.Node
+ * @param oTree {YAHOO.widget.TreeView} The tree instance this node belongs to
  * @constructor
  */
-YAHOO.widget.MenuNode = function(oData, oParent, expanded) {
-       if (oData) { 
-               this.init(oData, oParent, expanded);
-               this.setUpLabel(oData);
-       }
-
-    /*
-     * Menus usually allow only one branch to be open at a time.
-     */
-       this.multiExpand = false;
-
-
+YAHOO.widget.RootNode = function(oTree) {
+       // Initialize the node with null params.  The root node is a
+       // special case where the node has no presentation.  So we have
+       // to alter the standard properties a bit.
+       this.init(null, null, true);
+       
+       /*
+        * For the root node, we get the tree reference from as a param
+        * to the constructor instead of from the parent element.
+        */
+       this.tree = oTree;
 };
 
-YAHOO.extend(YAHOO.widget.MenuNode, YAHOO.widget.TextNode, {
+YAHOO.extend(YAHOO.widget.RootNode, YAHOO.widget.Node, {
+    
+    // overrides YAHOO.widget.Node
+    getNodeHtml: function() { 
+        return ""; 
+    },
 
     toString: function() { 
-        return "MenuNode (" + this.index + ") " + this.label;
-    }
+        return "RootNode";
+    },
+
+    loadComplete: function() { 
+        this.tree.draw();
+    },
+
+    collapse: function() {},
+    expand: function() {}
 
 });
 /**
@@ -2057,6 +2059,39 @@ YAHOO.extend(YAHOO.widget.HTMLNode, YAHOO.widget.Node, {
         return "HTMLNode (" + this.index + ")";
     }
 
+});
+/**
+ * A menu-specific implementation that differs from TextNode in that only 
+ * one sibling can be expanded at a time.
+ * @namespace YAHOO.widget
+ * @class MenuNode
+ * @extends YAHOO.widget.TextNode
+ * @param oData {object} a string or object containing the data that will
+ * be used to render this node
+ * @param oParent {YAHOO.widget.Node} this node's parent node
+ * @param expanded {boolean} the initial expanded/collapsed state
+ * @constructor
+ */
+YAHOO.widget.MenuNode = function(oData, oParent, expanded) {
+       if (oData) { 
+               this.init(oData, oParent, expanded);
+               this.setUpLabel(oData);
+       }
+
+    /*
+     * Menus usually allow only one branch to be open at a time.
+     */
+       this.multiExpand = false;
+
+
+};
+
+YAHOO.extend(YAHOO.widget.MenuNode, YAHOO.widget.TextNode, {
+
+    toString: function() { 
+        return "MenuNode (" + this.index + ") " + this.label;
+    }
+
 });
 /**
  * A static factory class for tree view expand/collapse animations
@@ -2231,3 +2266,4 @@ YAHOO.widget.TVFadeOut.prototype = {
     }
 };
 
+YAHOO.register("treeview", YAHOO.widget.TreeView, {version: "2.3.0", build: "442"});
index 0cfcb617c0072b393c3803f951f74888b1471691..e0134323fee584f864650e31b3426e2d50994bc1 100755 (executable)
@@ -1,4 +1,4 @@
-utilities.js Release Notes
+utilities.js Release Notes
 
 *** NOTE ***
 
@@ -12,10 +12,9 @@ event/README
 connection/README
 animation/README
 dragdrop/README
+element/README
 
-************
-
-*** version 0.12.0 ***
+*************
 
 The utilities.js file rolls up all of the YUI utility components into a single
 file; it includes the following components:
@@ -25,11 +24,13 @@ file; it includes the following components:
 * Dom
 * Connection Manager
 * Animation
-* Drag & Drop
+* Drag &amp; Drop
+* Element
 
-For implementations that use a significant subset of these files, it may prove
+For implementations that use four or more  of these files, it may prove
 more efficient to include utilities.js as opposed to including separate files
 for each component.
 
-Note: If you are require only the Yahoo Global Object, Event Utility and Dom
-collection, consider using the special yahoo-event-dom.js aggregate instead.
+Note: If you require only the Yahoo Global Object, Event Utility and Dom
+collection, consider using the special yahoo-dom-event.js aggregate instead.
+
index 9d12134a83794a94ff14d5dce6b27b4452b39279..77068927b0f34eabd0feb887e9daa4d749d6a05f 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.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(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.extend=function(subc,superc,overrides){var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
-if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}};YAHOO.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;}
+YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
+return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]};}
+var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m);}
+if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(name){return YAHOO.env.modules[name]||null;};YAHOO.env.ua=function(){var o={ie:0,opera:0,gecko:0,webkit:0};var ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1;}
+m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1]);}
+if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1]);}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1]);}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1]);}}}}}
+return o;}();(function(){YAHOO.namespace("util","widget","example");if(typeof YAHOO_config!="undefined"){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break;}}
+if(unique){ls.push(l);}}}})();YAHOO.lang={isArray:function(o){if(o){var l=YAHOO.lang;return l.isNumber(o.length)&&l.isFunction(o.splice)&&!l.hasOwnProperty(o.length);}
+return false;},isBoolean:function(o){return typeof o==='boolean';},isFunction:function(o){return typeof o==='function';},isNull:function(o){return o===null;},isNumber:function(o){return typeof o==='number'&&isFinite(o);},isObject:function(o){return(o&&(typeof o==='object'||YAHOO.lang.isFunction(o)))||false;},isString:function(o){return typeof o==='string';},isUndefined:function(o){return typeof o==='undefined';},hasOwnProperty:function(o,prop){if(Object.prototype.hasOwnProperty){return o.hasOwnProperty(prop);}
+return!YAHOO.lang.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop];},_IEEnumFix:function(r,s){if(YAHOO.env.ua.ie){var add=["toString","valueOf"];for(i=0;i<add.length;i=i+1){var fname=add[i],f=s[fname];if(YAHOO.lang.isFunction(f)&&f!=Object.prototype[fname]){r[fname]=f;}}}},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");}
+var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
+if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}
+YAHOO.lang._IEEnumFix(subc.prototype,overrides);}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}
+var a=arguments,i,p,override=a[2];if(override&&override!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]];}}else{for(p in s){if(override||!r[p]){r[p]=s[p];}}
+YAHOO.lang._IEEnumFix(r,s);}},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}
+var a=[r.prototype,s.prototype];for(var i=2;i<arguments.length;i=i+1){a.push(arguments[i]);}
+YAHOO.lang.augmentObject.apply(this,a);},dump:function(o,d){var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=', ',ARROW=' => ';if(!l.isObject(o)||o instanceof Date||("nodeType"in o&&"tagName"in o)){return o;}else if(l.isFunction(o)){return FUN;}
+d=(l.isNumber(d))?d:3;if(l.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
+s.push(COMMA);}
+if(s.length>1){s.pop();}
+s.push("]");}else{s.push("{");for(i in o){if(l.hasOwnProperty(o,i)){s.push(i+ARROW);if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
+s.push(COMMA);}}
+if(s.length>1){s.pop();}
+s.push("}");}
+return s.join("");},substitute:function(s,o,f){var i,j,k,key,v,meta,l=YAHOO.lang,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}';for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break;}
+j=s.indexOf(RBRACE,i);if(i+1>=j){break;}
+token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k);}
+v=o[key];if(f){v=f(key,v,meta);}
+if(l.isObject(v)){if(l.isArray(v)){v=l.dump(v,parseInt(meta,10));}else{meta=meta||"";var dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4);}
+if(v.toString===Object.prototype.toString||dump>-1){v=l.dump(v,parseInt(meta,10));}else{v=v.toString();}}}else if(!l.isString(v)&&!l.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token;}
+s=s.substring(0,i)+v+s.substring(j+1);}
+for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g");}
+return s;},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"");}catch(e){return s;}},merge:function(){var o={},a=arguments,i;for(i=0;i<a.length;i=i+1){YAHOO.lang.augmentObject(o,a[i],true);}
+return o;},isValue:function(o){var l=YAHOO.lang;return(l.isObject(o)||l.isString(o)||l.isNumber(o)||l.isBoolean(o));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.3.0",build:"442"});
+(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={},reClassNameCache={};var isOpera=YAHOO.env.ua.opera,isSafari=YAHOO.env.ua.webkit,isGecko=YAHOO.env.ua.gecko,isIE=YAHOO.env.ua.ie;var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}
 if(propertyCache[property]){return propertyCache[property];}
-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)];}
+var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}
+propertyCache[property]=converted;return converted;};var getClassRegEx=function(className){var re=reClassNameCache[className];if(!re){re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');reClassNameCache[className]=re;}
+return re;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';}
+var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}
 return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}
-return val/100;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 val/100;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}
+if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}
+break;case'float':property='styleFloat';default:el.style[property]=val;}};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';}
+el.style[property]=val;};}
+var testElement=function(node,method){return node&&node.nodeType==1&&(!method||method(node));};YAHOO.util.Dom={get:function(el){if(!el||el.tagName||el.item){return el;}
+if(YAHOO.lang.isString(el)){return document.getElementById(el);}
+if(el.splice){var c=[];for(var i=0,len=el.length;i<len;++i){c[c.length]=Y.Dom.get(el[i]);}
+return c;}
+return el;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
+var parentNode=null;var pos=[];var box;var doc=el.ownerDocument;if(el.getBoundingClientRect){box=el.getBoundingClientRect();return[box.left+Y.Dom.getDocumentScrollLeft(el.ownerDocument),box.top+Y.Dom.getDocumentScrollTop(el.ownerDocument)];}
+else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;var hasAbs=this.getStyle(el,'position')=='absolute';if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;if(isSafari&&!hasAbs&&this.getStyle(parentNode,'position')=='absolute'){hasAbs=true;}
+parentNode=parentNode.offsetParent;}}
+if(isSafari&&hasAbs){pos[0]-=el.ownerDocument.body.offsetLeft;pos[1]-=el.ownerDocument.body.offsetTop;}}
+parentNode=el.parentNode;while(parentNode.tagName&&!patterns.ROOT_TAG.test(parentNode.tagName))
+{if(Y.Dom.getStyle(parentNode,'display').search(/^inline|table-row.*$/i)){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}
+parentNode=parentNode.parentNode;}
 return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}
 var pageXY=this.getXY(el);if(pageXY===false){return false;}
 var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}
 if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}
 if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
 if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
-if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){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||'*';var nodes=[];if(root){root=Y.Dom.get(root);if(!root){return nodes;}}else{root=document;}
-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);}
+if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
+var region=Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
+var nodes=[],elements=root.getElementsByTagName(tag),re=getClassRegEx(className);for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i].className)){nodes[nodes.length]=elements[i];if(apply){apply.call(elements[i],elements[i]);}}}
+return nodes;},hasClass:function(el,className){var re=getClassRegEx(className);var f=function(el){return re.test(el.className);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return false;}
+el.className=YAHOO.lang.trim([el.className,className].join(' '));return true;};return Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=getClassRegEx(className);var f=function(el){if(!this.hasClass(el,className)){return false;}
+var c=el.className;el.className=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}
+el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(!newClassName||oldClassName===newClassName){return false;}
+var re=getClassRegEx(oldClassName);var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return true;}
+el.className=el.className.replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}
+el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';var f=function(el){if(el&&el.id){return el.id;}
+var id=prefix+id_counter++;if(el){el.id=id;}
+return id;};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}
+var f=function(node){if(haystack.contains&&node.nodeType&&!isSafari){return haystack.contains(node);}
+else if(haystack.compareDocumentPosition&&node.nodeType){return!!(haystack.compareDocumentPosition(node)&16);}else if(node.nodeType){return!!this.getAncestorBy(node,function(el){return el==haystack;});}
+return false;};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){if(isSafari){while(el=el.parentNode){if(el==document.documentElement){return true;}}
+return false;}
+return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
+var nodes=[],elements=root.getElementsByTagName(tag);for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];if(apply){apply(elements[i]);}}}
+return nodes;},batch:function(el,method,o,override){el=(el&&el.tagName)?el:Y.Dom.get(el);if(!el||!method){return false;}
+var scope=(override)?o:window;if(el.tagName||(!el.item&&!el.slice)){return method.call(scope,el,o);}
+var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=method.call(scope,el[i],o);}
 return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}
 return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}
-return width;}};})();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();
-
+return width;},getAncestorBy:function(node,method){while(node=node.parentNode){if(testElement(node,method)){return node;}}
+return null;},getAncestorByClassName:function(node,className){node=Y.Dom.get(node);if(!node){return null;}
+var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getAncestorBy(node,method);},getAncestorByTagName:function(node,tagName){node=Y.Dom.get(node);if(!node){return null;}
+var method=function(el){return el.tagName&&el.tagName.toUpperCase()==tagName.toUpperCase();};return Y.Dom.getAncestorBy(node,method);},getPreviousSiblingBy:function(node,method){while(node){node=node.previousSibling;if(testElement(node,method)){return node;}}
+return null;},getPreviousSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
+return Y.Dom.getPreviousSiblingBy(node);},getNextSiblingBy:function(node,method){while(node){node=node.nextSibling;if(testElement(node,method)){return node;}}
+return null;},getNextSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
+return Y.Dom.getNextSiblingBy(node);},getFirstChildBy:function(node,method){var child=(testElement(node.firstChild,method))?node.firstChild:null;return child||Y.Dom.getNextSiblingBy(node.firstChild,method);},getFirstChild:function(node,method){node=Y.Dom.get(node);if(!node){return null;}
+return Y.Dom.getFirstChildBy(node);},getLastChildBy:function(node,method){if(!node){return null;}
+var child=(testElement(node.lastChild,method))?node.lastChild:null;return child||Y.Dom.getPreviousSiblingBy(node.lastChild,method);},getLastChild:function(node){node=Y.Dom.get(node);return Y.Dom.getLastChildBy(node);},getChildrenBy:function(node,method){var child=Y.Dom.getFirstChildBy(node,method);var children=child?[child]:[];Y.Dom.getNextSiblingBy(child,function(node){if(!method||method(node)){children[children.length]=node;}
+return false;});return children;},getChildren:function(node){node=Y.Dom.get(node);if(!node){}
+return Y.Dom.getChildrenBy(node);},getDocumentScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);},getDocumentScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);},insertBefore:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
+return referenceNode.parentNode.insertBefore(newNode,referenceNode);},insertAfter:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
+if(referenceNode.nextSibling){return referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);}else{return referenceNode.parentNode.appendChild(newNode);}}};})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(YAHOO.lang.isArray(x)){y=x[1];x=x[0];}
+this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.3.0",build:"442"});
 YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}
-var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
-this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
+var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}
+if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
+this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();}
+var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
 return found;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}
-var args=[],ret=true,i;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
+var args=[],ret=true,i,rebuild=false;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
 var argslength=args.length;if(!this.silent){}
-for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}
+for(i=0;i<len;++i){var s=this.subscribers[i];if(!s){rebuild=true;}else{if(!this.silent){}
 var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}
 ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}
 if(false===ret){if(!this.silent){}
 return false;}}}
-return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
-this.subscribers.splice(index,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=obj||null;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
-return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=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 self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
+if(rebuild){var newlist=[],subs=this.subscribers;for(i=0,len=subs.length;i<len;++i){s=subs[i];newlist.push(subs[i]);}
+this.subscribers=newlist;}
+return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}
+this.subscribers=[];return i;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
+this.subscribers[index]=null;},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=YAHOO.lang.isUndefined(obj)?null:obj;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
+return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var DOMReady=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var webkitKeymap={63232:38,63233:40,63234:37,63235:39};return{POLL_RETRYS:4000,POLL_INTERVAL:10,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onDOMReady:function(p_fn,p_obj,p_override){if(DOMReady){setTimeout(function(){var s=window;if(p_override){if(p_override===true){s=p_obj;}else{s=p_override;}}
+p_fn.call(s,"DOMReady",[],p_obj);},0);}else{this.DOMReadyEvent.subscribe(p_fn,p_obj,p_override);}},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
 if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}
-return ok;}else if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
+return ok;}else if(YAHOO.lang.isString(el)){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
 if(!el){return false;}
 if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}
 var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}
 var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
-legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(e){this.removeListener(el,sType,fn);return false;}}
-return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true;var le=legacyHandlers[legacyIndex];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var scope=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
-return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(!el.addEventListener&&!el.attachEvent){return true;}else if(this.isSafari){if("click"==sType||"dblclick"==sType){return true;}}
+legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}}
+return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true,le,lh,li,scope,ret;lh=legacyHandlers[legacyIndex];for(var i=0,len=lh.length;i<len;++i){li=lh[i];if(li&&li[this.WFN]){scope=li[this.ADJ_SCOPE];ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
+le=legacyEvents[legacyIndex];if(le&&le[2]){le[2](e);}
+return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(this.webkit&&("click"==sType||"dblclick"==sType)){var v=parseInt(this.webkit,10);if(!isNaN(v)&&v<418){return true;}}
 return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
 return ok;}
 if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
-if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners.splice(i,1);return true;}}
+if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners[i]=null;return true;}}
 return false;}
 var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}
 if(index>=0){cacheItem=listeners[index];}
 if(!el||!cacheItem){return false;}
-if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist.splice(i,1);break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(e){return false;}}
-delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
+if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist[i]=null;break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(ex){this.lastError=ex;return false;}}
+delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners[index]=null;return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
 return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
 return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
-return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}
+return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}
 return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
 c=c.caller;}}
-return ev;},getCharCode:function(ev){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
+return ev;},getCharCode:function(ev){var code=ev.keyCode||ev.charCode||0;if(YAHOO.env.ua.webkit&&(code in webkitKeymap)){code=webkitKeymap[code];}
+return code;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
 return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
-return id;},_isValidCollection:function(o){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){loadComplete=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}
+return id;},_isValidCollection:function(o){try{return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");}catch(e){return false;}},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(e){if(!loadComplete){loadComplete=true;var EU=YAHOO.util.Event;EU._ready();EU._tryPreloadAttach();}},_ready:function(e){if(!DOMReady){DOMReady=true;var EU=YAHOO.util.Event;EU.DOMReadyEvent.fire();EU._simpleRemove(document,"DOMContentLoaded",EU._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}
+if(this.isIE){if(!DOMReady){this.startInterval();return false;}}
 this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}
-var notAvail=[];for(var i=0,len=onAvailStack.length;i<len;++i){var item=onAvailStack[i];if(item){var el=this.getEl(item.id);if(el){if(!item.checkReady||loadComplete||el.nextSibling||(document&&document.body)){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
-item.fn.call(scope,item.obj);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
+var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
+item.fn.call(scope,item.obj);};var i,len,item,el;for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&!item.checkReady){el=this.getEl(item.id);if(el){executeItem(el,item);onAvailStack[i]=null;}else{notAvail.push(item);}}}
+for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&item.checkReady){el=this.getEl(item.id);if(el){if(loadComplete||el.nextSibling){executeItem(el,item);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
 retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}
-this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn);}}
-if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var elListeners=[];if(listeners&&listeners.length>0){for(var i=0,len=listeners.length;i<len;++i){var l=listeners[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){elListeners.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}
-return(elListeners.length)?elListeners:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
+this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn,l.index);}}
+if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else if(sType=="unload"){searchLists=[unloadListeners];}else{searchLists=[listeners];}
+for(var j=0;j<searchLists.length;++j){var searchList=searchLists[j];if(searchList&&searchList.length>0){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}
+return(results.length)?results:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
 l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}
 unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}
 j=j-1;}
 l=null;EU.clearCache();}
 for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}
-legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}
-EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
+legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var el,d=document,b=d.body;if(("undefined"!==typeof YAHOO_config)&&YAHOO_config.injecting){el=document.createElement("script");var p=d.getElementsByTagName("head")[0]||b;p.insertBefore(el,p.firstChild);}else{d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');el=document.getElementById("_yui_eu_dr");}
+if(el){el.onreadystatechange=function(){if("complete"===this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};}else{}
+el=null;}else if(EU.webkit){EU._drwatch=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._drwatch);EU._drwatch=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}
+EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
 YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}
-subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}else{return false;}},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=opts.silent||null;var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
+subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var evts=this.__yui_events;if(p_type){var ce=evts[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}}else{for(var i in evts){var ret=true;if(YAHOO.lang.hasOwnProperty(evts,i)){ret=ret&&evts[i].unsubscribe(p_fn,p_obj);}}
+return ret;}
+return false;},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=(opts.silent);var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
 this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}
-return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){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;}};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)
+return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(!ce){return null;}
+var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
+return ce.fire.apply(ce,args);},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}
+return false;}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else if(!keyData){}else if(!handler){}
+if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
+var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
+if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
+function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
+if(!keyData.alt){keyData.alt=false;}
+if(!keyData.ctrl){keyData.ctrl=false;}
+if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
+this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
+this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
+this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+
+(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.register("event",YAHOO.util.Event,{version:"2.3.0",build:"442"});
+YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',_use_default_xhr_header:true,_default_xhr_header:'XMLHttpRequest',_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function()
+{if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,'click',function(e){var obj=YAHOO.util.Event.getTarget(e);if(obj.type=='submit'){YAHOO.util.Connect._submitElementValue=encodeURIComponent(obj.name)+"="+encodeURIComponent(obj.value);}});return true;}
+return false;})(),startEvent:new YAHOO.util.CustomEvent('start'),completeEvent:new YAHOO.util.CustomEvent('complete'),successEvent:new YAHOO.util.CustomEvent('success'),failureEvent:new YAHOO.util.CustomEvent('failure'),uploadEvent:new YAHOO.util.CustomEvent('upload'),abortEvent:new YAHOO.util.CustomEvent('abort'),_customEvents:{onStart:['startEvent','start'],onComplete:['completeEvent','complete'],onSuccess:['successEvent','success'],onFailure:['failureEvent','failure'],onUpload:['uploadEvent','upload'],onAbort:['abortEvent','abort']},setProgId:function(id)
 {this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)
-{this._use_default_post_header=b;},setPollingInterval:function(i)
+{this._use_default_post_header=b;},setDefaultXhrHeader:function(b)
+{this._use_default_xhr_header=b;},setPollingInterval:function(i)
 {if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)
 {var obj,http;try
 {http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
@@ -134,105 +209,130 @@ catch(e)
 {http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId};break;}
 catch(e){}}}
 finally
-{return obj;}},getConnectionObject:function()
+{return obj;}},getConnectionObject:function(isFileUpload)
 {var o;var tId=this._transaction_id;try
-{o=this.createXhrObject(tId);if(o){this._transaction_id++;}}
+{if(!isFileUpload){o=this.createXhrObject(tId);}
+else{o={};o.tId=tId;o.isUpload=true;}
+if(o){this._transaction_id++;}}
 catch(e){}
 finally
 {return o;}},asyncRequest:function(method,uri,callback,postData)
-{var o=this.getConnectionObject();if(!o){return null;}
-else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,callback,uri,postData);this.releaseObject(o);return;}
-if(method=='GET'){if(this._sFormData.length!=0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}
+{var o=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();if(!o){return null;}
+else{if(callback&&callback.customevents){this.initCustomEvents(o,callback);}
+if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o,callback,uri,postData);return o;}
+if(method.toUpperCase()=='GET'){if(this._sFormData.length!==0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}
 else{uri+="?"+this._sFormData;}}
-else if(method=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
-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();}}
-if(this._has_http_headers){this.setHeader(o);}
-this.handleReadyState(o,callback);o.conn.send(postData||null);return o;}},handleReadyState:function(o,callback)
+else if(method.toUpperCase()=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
+o.conn.open(method,uri,true);if(this._use_default_xhr_header){if(!this._default_headers['X-Requested-With']){this.initHeader('X-Requested-With',this._default_xhr_header,true);}}
+if(this._isFormSubmit||(postData&&this._use_default_post_header)){this.initHeader('Content-Type',this._default_post_header);if(this._isFormSubmit){this.resetFormState();}}
+if(this._has_default_headers||this._has_http_headers){this.setHeader(o);}
+this.handleReadyState(o,callback);o.conn.send(postData||null);this.startEvent.fire(o);if(o.startEvent){o.startEvent.fire(o);}
+return o;}},initCustomEvents:function(o,callback)
+{for(var prop in callback.customevents){if(this._customEvents[prop][0]){o[this._customEvents[prop][0]]=new YAHOO.util.CustomEvent(this._customEvents[prop][1],(callback.scope)?callback.scope:null);o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);}}},handleReadyState:function(o,callback)
 {var oConn=this;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
-this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){delete oConn._timeOut[o.tId];}
+this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState===4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
+oConn.completeEvent.fire(o);if(o.completeEvent){o.completeEvent.fire(o);}
 oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort)
 {if(!callback){this.releaseObject(o);return;}
 var httpStatus,responseObject;try
-{if(o.conn.status!==undefined&&o.conn.status!=0){httpStatus=o.conn.status;}
+{if(o.conn.status!==undefined&&o.conn.status!==0){httpStatus=o.conn.status;}
 else{httpStatus=13030;}}
 catch(e){httpStatus=13030;}
-if(httpStatus>=200&&httpStatus<300){try
-{responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
-else{callback.success.apply(callback.scope,[responseObject]);}}}
-catch(e){}}
-else{try
-{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);}
+if(httpStatus>=200&&httpStatus<300||httpStatus===1223){responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
+else{callback.success.apply(callback.scope,[responseObject]);}}
+this.successEvent.fire(responseObject);if(o.successEvent){o.successEvent.fire(responseObject);}}
+else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,(isAbort?isAbort:false));if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
 else{callback.failure.apply(callback.scope,[responseObject]);}}
 break;default:responseObject=this.createResponseObject(o,callback.argument);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
-else{callback.failure.apply(callback.scope,[responseObject]);}}}}
-catch(e){}}
+else{callback.failure.apply(callback.scope,[responseObject]);}}}
+this.failureEvent.fire(responseObject);if(o.failureEvent){o.failureEvent.fire(responseObject);}}
 this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg)
 {var obj={};var headerObj={};try
 {var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}
 catch(e){}
-obj.tId=o.tId;obj.status=o.conn.status;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;}
+obj.tId=o.tId;obj.status=(o.conn.status==1223)?204:o.conn.status;obj.statusText=(o.conn.status==1223)?"No Content":o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof callbackArg!==undefined){obj.argument=callbackArg;}
 return obj;},createExceptionObject:function(tId,callbackArg,isAbort)
 {var COMM_CODE=0;var COMM_ERROR='communication failure';var ABORT_CODE=-1;var ABORT_ERROR='transaction aborted';var obj={};obj.tId=tId;if(isAbort){obj.status=ABORT_CODE;obj.statusText=ABORT_ERROR;}
 else{obj.status=COMM_CODE;obj.statusText=COMM_ERROR;}
 if(callbackArg){obj.argument=callbackArg;}
-return obj;},initHeader:function(label,value)
-{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;},setHeader:function(o)
-{for(var prop in this._http_header){if(this._http_header.hasOwnProperty(prop)){o.conn.setRequestHeader(prop,this._http_header[prop]);}}
-delete this._http_header;this._http_header={};this._has_http_headers=false;},setForm:function(formId,isUpload,secureUri)
+return obj;},initHeader:function(label,value,isDefault)
+{var headerObj=(isDefault)?this._default_headers:this._http_headers;if(headerObj[label]===undefined){headerObj[label]=value;}
+else{headerObj[label]=value+","+headerObj[label];}
+if(isDefault){this._has_default_headers=true;}
+else{this._has_http_headers=true;}},setHeader:function(o)
+{if(this._has_default_headers){for(var prop in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,prop)){o.conn.setRequestHeader(prop,this._default_headers[prop]);}}}
+if(this._has_http_headers){for(var prop in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,prop)){o.conn.setRequestHeader(prop,this._http_headers[prop]);}}
+delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(formId,isUpload,secureUri)
 {this.resetFormState();var oForm;if(typeof formId=='string'){oForm=(document.getElementById(formId)||document.forms[formId]);}
 else if(typeof formId=='object'){oForm=formId;}
 else{return;}
-if(isUpload){this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
+if(isUpload){var io=this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
 var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oElement=oForm.elements[i];oDisabled=oForm.elements[i].disabled;oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)
 {switch(oElement.type)
 {case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text)+'&';}
 else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text)+'&';}}}
 break;case'radio':case'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
-break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit==false){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);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';}
+break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+'&';}
+else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
+hasSubmit=true;}
+break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}}}
+this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(secureUri){var frameId='yuiIO'+this._transaction_id;var io;if(window.ActiveXObject){io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=='boolean'){io.src='javascript:false';}
 else if(typeof secureURI=='string'){io.src=secureUri;}}
-else{var io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
+else{io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
 io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)
 {var formElements=[];var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}
-return formElements;},uploadFile:function(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';}
-else{this._formNode.enctype='multipart/form-data';}
+return formElements;},uploadFile:function(o,callback,uri,postData){var frameId='yuiIO'+o.tId;var uploadEncoding='multipart/form-data';var io=document.getElementById(frameId);var oConn=this;var rawFormAttributes={action:this._formNode.getAttribute('action'),method:this._formNode.getAttribute('method'),target:this._formNode.getAttribute('target')};this._formNode.setAttribute('action',uri);this._formNode.setAttribute('method','POST');this._formNode.setAttribute('target',frameId);if(this._formNode.encoding){this._formNode.setAttribute('encoding',uploadEncoding);}
+else{this._formNode.setAttribute('enctype',uploadEncoding);}
 if(postData){var oElements=this.appendPostData(postData);}
-this._formNode.submit();if(oElements&&oElements.length>0){try
-{for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
-catch(e){}}
+this._formNode.submit();this.startEvent.fire(o);if(o.startEvent){o.startEvent.fire(o);}
+if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
+if(oElements&&oElements.length>0){for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
+for(var prop in rawFormAttributes){if(YAHOO.lang.hasOwnProperty(rawFormAttributes,prop)){if(rawFormAttributes[prop]){this._formNode.setAttribute(prop,rawFormAttributes[prop]);}
+else{this._formNode.removeAttribute(prop);}}}
 this.resetFormState();var uploadCallback=function()
-{var obj={};obj.tId=id;obj.argument=callback.argument;try
-{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;}
+{if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
+oConn.completeEvent.fire(o);if(o.completeEvent){o.completeEvent.fire(o);}
+var obj={};obj.tId=o.tId;obj.argument=callback.argument;try
+{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:io.contentWindow.document.documentElement.textContent;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}
 catch(e){}
-if(callback.upload){if(!callback.scope){callback.upload(obj);}
+if(callback&&callback.upload){if(!callback.scope){callback.upload(obj);}
 else{callback.upload.apply(callback.scope,[obj]);}}
+oConn.uploadEvent.fire(obj);if(o.uploadEvent){o.uploadEvent.fire(obj);}
 if(YAHOO.util.Event){YAHOO.util.Event.removeListener(io,"load",uploadCallback);}
 else if(window.detachEvent){io.detachEvent('onload',uploadCallback);}
 else{io.removeEventListener('load',uploadCallback,false);}
-setTimeout(function(){document.body.removeChild(io);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}
+setTimeout(function(){document.body.removeChild(io);oConn.releaseObject(o);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}
 else if(window.attachEvent){io.attachEvent('onload',uploadCallback);}
 else{io.addEventListener('load',uploadCallback,false);}},abort:function(o,callback,isTimeout)
-{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];}
-this.handleTransactionResponse(o,callback,true);return true;}
-else{return false;}},isCallInProgress:function(o)
-{if(o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}
+{var abortStatus;if(o.conn){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
+abortStatus=true;}}
+else if(o.isUpload===true){var frameId='yuiIO'+o.tId;var io=document.getElementById(frameId);if(io){document.body.removeChild(io);if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
+abortStatus=true;}}
+else{abortStatus=false;}
+if(abortStatus===true){this.abortEvent.fire(o);if(o.abortEvent){o.abortEvent.fire(o);}
+this.handleTransactionResponse(o,callback,true);}
+else{}
+return abortStatus;},isCallInProgress:function(o)
+{if(o&&o.conn){return o.conn.readyState!==4&&o.conn.readyState!==0;}
+else if(o&&o.isUpload===true){var frameId='yuiIO'+o.tId;return document.getElementById(frameId)?true:false;}
 else{return false;}},releaseObject:function(o)
-{o.conn=null;o=null;}};
-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;}
+{if(o.conn){o.conn=null;}
+o=null;}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.3.0",build:"442"});
+YAHOO.util.Anim=function(el,attributes,duration,method){if(!el){}
+this.init(el,attributes,duration,method);};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName||el;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}
 YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}
 var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}
 return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}
 return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}
-start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i];}}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();}
+start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i]*1;}}else{end=start+attributes[attr]['by']*1;}}
+this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);return true;},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=!YAHOO.lang.isUndefined(duration)?duration:1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.setEl=function(element){el=YAHOO.util.Dom.get(element);};this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}
+this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}
+YAHOO.util.AnimMgr.registerElement(this);return true;};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}
 YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}
 isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}
-actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index!=-1){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);}}
+actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index==-1){return false;}
+queue.splice(index,1);tweenCount-=1;if(tweenCount<=0){this.stop();}
+return true;};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[0].isAnimated()){this.unRegister(queue[0],0);}}
 queue=[];thread=null;tweenCount=0;}
 else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}
 if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null)
@@ -288,30 +388,8 @@ this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes
 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);}};})();
-
-(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,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=Dom.get(this.id);}
-return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}
-this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}
-var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}
-this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.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=Dom.generateId(id);}
-Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;}
-if(this.isLocked()){return;}
-this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}
-this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}
-delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
-valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Dom.hasClass(node,this.invalidHandleClasses[i]);}
-return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
-for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
-this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
-for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
-this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=iLeft;this.rightConstraint=iRight;this.minX=this.initPageX-iLeft;this.maxX=this.initPageX+iRight;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
-this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=iUp;this.bottomConstraint=iDown;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+iDown;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
-this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}
-if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}
-if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}
-return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};})();if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var Event=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}
+return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.3.0",build:"442"});
+if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var Event=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}
 oDD[sMethod].apply(oDD,args);}}},_onLoad:function(){this.init();Event.on(document,"mouseup",this.handleMouseUp,this,true);Event.on(document,"mousemove",this.handleMouseMove,this,true);Event.on(window,"unload",this._onUnload,this,true);Event.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,sGroup){if(!this.initialized){this.init();}
 if(!this.ids[sGroup]){this.ids[sGroup]={};}
 this.ids[sGroup][oDD.id]=oDD;},removeDDFromGroup:function(oDD,sGroup){if(!this.ids[sGroup]){this.ids[sGroup]={};}
@@ -321,58 +399,114 @@ this.handleIds[sDDId][sHandleId]=sHandleId;},isDragDrop:function(id){return(this
 if(!bTargetsOnly||dd.isTarget){oDDs[oDDs.length]=dd;}}}
 return oDDs;},isLegalTarget:function(oDD,oTargetDD){var targets=this.getRelated(oDD,true);for(var i=0,len=targets.length;i<len;++i){if(targets[i].id==oTargetDD.id){return true;}}
 return false;},isTypeOfDD:function(oDD){return(oDD&&oDD.__ygDragDrop);},isHandle:function(sDDId,sHandleId){return(this.handleIds[sDDId]&&this.handleIds[sDDId][sHandleId]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}
-return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);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);}
+return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);var dc=this.dragCurrent;if(dc){dc.b4StartDrag(x,y);}
+if(dc){dc.startDrag(x,y);}
+this.dragThreshMet=true;},handleMouseUp:function(e){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}
+this.stopDrag(e);this.stopEvent(e);}},stopEvent:function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}
+if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e,silent){if(this.dragCurrent&&!silent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}
 this.dragCurrent.onMouseUp(e);}
-this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){if(!this.dragCurrent){return true;}
-if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}
+this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){var dc=this.dragCurrent;if(dc){if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}
 if(!this.dragThreshMet){var diffX=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var diffY=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(diffX>this.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}
-if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}
-this.stopEvent(e);return true;},fireEvents:function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}
-var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}
-if(!this.isOverTarget(pt,ddo,this.mode)){outEvts.push(ddo);}
+if(this.dragThreshMet){dc.b4Drag(e);if(dc){dc.onDrag(e);}
+if(dc){this.fireEvents(e,false);}}
+this.stopEvent(e);}},fireEvents:function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}
+var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}
+if(!this.isOverTarget(pt,ddo,this.mode,curRegion)){outEvts.push(ddo);}
 oldOvers[i]=true;delete this.dragOvers[i];}
 for(var sGroup in dc.groups){if("string"!=typeof sGroup){continue;}
 for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD)){continue;}
-if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);}
+if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode,curRegion)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);}
 this.dragOvers[oDD.id]=oDD;}}}}}
-if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);dc.onDragOut(e,outEvts);}
-if(enterEvts.length){dc.onDragEnter(e,enterEvts);}
-if(overEvts.length){dc.b4DragOver(e,overEvts);dc.onDragOver(e,overEvts);}
-if(dropEvts.length){dc.b4DragDrop(e,dropEvts);dc.onDragDrop(e,dropEvts);}}else{var len=0;for(i=0,len=outEvts.length;i<len;++i){dc.b4DragOut(e,outEvts[i].id);dc.onDragOut(e,outEvts[i].id);}
-for(i=0,len=enterEvts.length;i<len;++i){dc.onDragEnter(e,enterEvts[i].id);}
-for(i=0,len=overEvts.length;i<len;++i){dc.b4DragOver(e,overEvts[i].id);dc.onDragOver(e,overEvts[i].id);}
-for(i=0,len=dropEvts.length;i<len;++i){dc.b4DragDrop(e,dropEvts[i].id);dc.onDragDrop(e,dropEvts[i].id);}}
-if(isDrop&&!dropEvts.length){dc.onInvalidDrop(e);}},getBestMatch:function(dds){var winner=null;var len=dds.length;if(len==1){winner=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(this.mode==this.INTERSECT&&dd.cursorIsOver){winner=dd;break;}else{if(!winner||!winner.overlap||(dd.overlap&&winner.overlap.getArea()<dd.overlap.getArea())){winner=dd;}}}}
-return winner;},refreshCache:function(groups){for(var sGroup in groups){if("string"!=typeof sGroup){continue;}
+this.interactionInfo={out:outEvts,enter:enterEvts,over:overEvts,drop:dropEvts,point:pt,draggedRegion:curRegion,sourceRegion:this.locationCache[dc.id],validDrop:isDrop};if(isDrop&&!dropEvts.length){this.interactionInfo.validDrop=false;dc.onInvalidDrop(e);}
+if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);if(dc){dc.onDragOut(e,outEvts);}}
+if(enterEvts.length){if(dc){dc.onDragEnter(e,enterEvts);}}
+if(overEvts.length){if(dc){dc.b4DragOver(e,overEvts);}
+if(dc){dc.onDragOver(e,overEvts);}}
+if(dropEvts.length){if(dc){dc.b4DragDrop(e,dropEvts);}
+if(dc){dc.onDragDrop(e,dropEvts);}}}else{var len=0;for(i=0,len=outEvts.length;i<len;++i){if(dc){dc.b4DragOut(e,outEvts[i].id);}
+if(dc){dc.onDragOut(e,outEvts[i].id);}}
+for(i=0,len=enterEvts.length;i<len;++i){if(dc){dc.onDragEnter(e,enterEvts[i].id);}}
+for(i=0,len=overEvts.length;i<len;++i){if(dc){dc.b4DragOver(e,overEvts[i].id);}
+if(dc){dc.onDragOver(e,overEvts[i].id);}}
+for(i=0,len=dropEvts.length;i<len;++i){if(dc){dc.b4DragDrop(e,dropEvts[i].id);}
+if(dc){dc.onDragDrop(e,dropEvts[i].id);}}}},getBestMatch:function(dds){var winner=null;var len=dds.length;if(len==1){winner=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(this.mode==this.INTERSECT&&dd.cursorIsOver){winner=dd;break;}else{if(!winner||!winner.overlap||(dd.overlap&&winner.overlap.getArea()<dd.overlap.getArea())){winner=dd;}}}}
+return winner;},refreshCache:function(groups){var g=groups||this.ids;for(var sGroup in g){if("string"!=typeof sGroup){continue;}
 for(var i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var parent=el.offsetParent;if(parent){return true;}}}catch(e){}
 return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}
 var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=YAHOO.util.Dom.getXY(el);}catch(e){}
 if(!pos){return null;}
-x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect){var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}
+x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect,curRegion){var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}
 if(!loc){return false;}
-oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}
-oTarget.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}
+oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}
+oTarget.overlap=null;if(!curRegion){var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);}
+var overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}
 this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}
 this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var oWrapper=this.elementCache[id];if(!oWrapper||!oWrapper.el){oWrapper=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}
-return oWrapper;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else{YAHOO.log("could not get scroll property");}
+return oWrapper;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else{}
 return{top:t,left:l};},getStyle:function(el,styleProp){return YAHOO.util.Dom.getStyle(el,styleProp);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(moveEl,targetEl){var aCoord=YAHOO.util.Dom.getXY(targetEl);YAHOO.util.Dom.setXY(moveEl,aCoord);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return(a-b);},_timeoutCount:0,_addListeners:function(){var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}
 return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}
-YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");}
-this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}
-if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}
-if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
-if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}
+(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=Dom.get(this.id);}
+return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){this._domRef=id;id=Dom.generateId(id);}
+this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}
+var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}
+this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
+this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
+Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;}
+if(this.isLocked()){return;}
+this.b4MouseDown(e);this.onMouseDown(e);this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}
 if(x>this.maxX){x=this.maxX;}}
 if(this.constrainY){if(y<this.minY){y=this.minY;}
 if(y>this.maxY){y=this.maxY;}}
-x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},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,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this;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(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
+x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
+this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
+delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
+valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Dom.hasClass(node,this.invalidHandleClasses[i]);}
+return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
+for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
+this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
+for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
+this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=parseInt(iLeft,10);this.rightConstraint=parseInt(iRight,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
+this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=parseInt(iUp,10);this.bottomConstraint=parseInt(iDown,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
+this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}
+if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}
+if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}
+return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};})();YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");}
+this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}
+if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}
+if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
+if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this,body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}
+var div=this.getDragEl(),Dom=YAHOO.util.Dom;if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;s.height="25px";s.width="25px";var _data=document.createElement('div');Dom.setStyle(_data,'height','100%');Dom.setStyle(_data,'width','100%');Dom.setStyle(_data,'background-color','#ccc');Dom.setStyle(_data,'opacity','0');div.appendChild(_data);body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
 this.setDragElPos(iPageX,iPageY);YAHOO.util.Dom.setStyle(dragEl,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var dragEl=this.getDragEl();var bt=parseInt(DOM.getStyle(dragEl,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(dragEl,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(dragEl,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(dragEl,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}
 if(isNaN(br)){br=0;}
 if(isNaN(bb)){bb=0;}
 if(isNaN(bl)){bl=0;}
-var newWidth=Math.max(0,el.offsetWidth-br-bl);var newHeight=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");}},b4MouseDown:function(e){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,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});
\ No newline at end of file
+var newWidth=Math.max(0,el.offsetWidth-br-bl);var newHeight=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");}},b4MouseDown:function(e){this.setStartPosition();var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.3.0",build:"442"});
+YAHOO.util.Attribute=function(hash,owner){if(owner){this.owner=owner;this.configure(hash,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(value,silent){var beforeRetVal;var owner=this.owner;var name=this.name;var event={type:name,prevValue:this.getValue(),newValue:value};if(this.readOnly||(this.writeOnce&&this._written)){return false;}
+if(this.validator&&!this.validator.call(owner,value)){return false;}
+if(!silent){beforeRetVal=owner.fireBeforeChangeEvent(event);if(beforeRetVal===false){return false;}}
+if(this.method){this.method.call(owner,value);}
+this.value=value;this._written=true;event.type=name;if(!silent){this.owner.fireChangeEvent(event);}
+return true;},configure:function(map,init){map=map||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var key in map){if(key&&YAHOO.lang.hasOwnProperty(map,key)){this[key]=map[key];if(init){this._initialConfig[key]=map[key];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(silent){this.setValue(this.value,silent);}};(function(){var Lang=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(key){var configs=this._configs||{};var config=configs[key];if(!config){return undefined;}
+return config.value;},set:function(key,value,silent){var configs=this._configs||{};var config=configs[key];if(!config){return false;}
+return config.setValue(value,silent);},getAttributeKeys:function(){var configs=this._configs;var keys=[];var config;for(var key in configs){config=configs[key];if(Lang.hasOwnProperty(configs,key)&&!Lang.isUndefined(config)){keys[keys.length]=key;}}
+return keys;},setAttributes:function(map,silent){for(var key in map){if(Lang.hasOwnProperty(map,key)){this.set(key,map[key],silent);}}},resetValue:function(key,silent){var configs=this._configs||{};if(configs[key]){this.set(key,configs[key]._initialConfig.value,silent);return true;}
+return false;},refresh:function(key,silent){var configs=this._configs;key=((Lang.isString(key))?[key]:key)||this.getAttributeKeys();for(var i=0,len=key.length;i<len;++i){if(configs[key[i]]&&!Lang.isUndefined(configs[key[i]].value)&&!Lang.isNull(configs[key[i]].value)){configs[key[i]].refresh(silent);}}},register:function(key,map){this.setAttributeConfig(key,map);},getAttributeConfig:function(key){var configs=this._configs||{};var config=configs[key]||{};var map={};for(key in config){if(Lang.hasOwnProperty(config,key)){map[key]=config[key];}}
+return map;},setAttributeConfig:function(key,map,init){var configs=this._configs||{};map=map||{};if(!configs[key]){map.name=key;configs[key]=new YAHOO.util.Attribute(map,this);}else{configs[key].configure(map,init);}},configureAttribute:function(key,map,init){this.setAttributeConfig(key,map,init);},resetAttributeConfig:function(key){var configs=this._configs||{};configs[key].resetConfig();},fireBeforeChangeEvent:function(e){var type='before';type+=e.type.charAt(0).toUpperCase()+e.type.substr(1)+'Change';e.type=type;return this.fireEvent(e.type,e);},fireChangeEvent:function(e){e.type+='Change';return this.fireEvent(e.type,e);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var Dom=YAHOO.util.Dom,AttributeProvider=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(el,map){if(arguments.length){this.init(el,map);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(child){child=child.get?child.get('element'):child;this.get('element').appendChild(child);},getElementsByTagName:function(tag){return this.get('element').getElementsByTagName(tag);},hasChildNodes:function(){return this.get('element').hasChildNodes();},insertBefore:function(element,before){element=element.get?element.get('element'):element;before=(before&&before.get)?before.get('element'):before;this.get('element').insertBefore(element,before);},removeChild:function(child){child=child.get?child.get('element'):child;this.get('element').removeChild(child);return true;},replaceChild:function(newNode,oldNode){newNode=newNode.get?newNode.get('element'):newNode;oldNode=oldNode.get?oldNode.get('element'):oldNode;return this.get('element').replaceChild(newNode,oldNode);},initAttributes:function(map){},addListener:function(type,fn,obj,scope){var el=this.get('element');scope=scope||this;el=this.get('id')||el;var self=this;if(!this._events[type]){if(this.DOM_EVENTS[type]){YAHOO.util.Event.addListener(el,type,function(e){if(e.srcElement&&!e.target){e.target=e.srcElement;}
+self.fireEvent(type,e);},obj,scope);}
+this.createEvent(type,this);}
+YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},subscribe:function(){this.addListener.apply(this,arguments);},removeListener:function(type,fn){this.unsubscribe.apply(this,arguments);},addClass:function(className){Dom.addClass(this.get('element'),className);},getElementsByClassName:function(className,tag){return Dom.getElementsByClassName(className,tag,this.get('element'));},hasClass:function(className){return Dom.hasClass(this.get('element'),className);},removeClass:function(className){return Dom.removeClass(this.get('element'),className);},replaceClass:function(oldClassName,newClassName){return Dom.replaceClass(this.get('element'),oldClassName,newClassName);},setStyle:function(property,value){var el=this.get('element');if(!el){return this._queue[this._queue.length]=['setStyle',arguments];}
+return Dom.setStyle(el,property,value);},getStyle:function(property){return Dom.getStyle(this.get('element'),property);},fireQueue:function(){var queue=this._queue;for(var i=0,len=queue.length;i<len;++i){this[queue[i][0]].apply(this,queue[i][1]);}},appendTo:function(parent,before){parent=(parent.get)?parent.get('element'):Dom.get(parent);this.fireEvent('beforeAppendTo',{type:'beforeAppendTo',target:parent});before=(before&&before.get)?before.get('element'):Dom.get(before);var element=this.get('element');if(!element){return false;}
+if(!parent){return false;}
+if(element.parent!=parent){if(before){parent.insertBefore(element,before);}else{parent.appendChild(element);}}
+this.fireEvent('appendTo',{type:'appendTo',target:parent});},get:function(key){var configs=this._configs||{};var el=configs.element;if(el&&!configs[key]&&!YAHOO.lang.isUndefined(el.value[key])){return el.value[key];}
+return AttributeProvider.prototype.get.call(this,key);},setAttributes:function(map,silent){var el=this.get('element');for(var key in map){if(!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){this.setAttributeConfig(key);}}
+for(var i=0,len=this._configOrder.length;i<len;++i){if(map[this._configOrder[i]]){this.set(this._configOrder[i],map[this._configOrder[i]],silent);}}},set:function(key,value,silent){var el=this.get('element');if(!el){this._queue[this._queue.length]=['set',arguments];if(this._configs[key]){this._configs[key].value=value;}
+return;}
+if(!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){_registerHTMLAttr.call(this,key);}
+return AttributeProvider.prototype.set.apply(this,arguments);},setAttributeConfig:function(key,map,init){var el=this.get('element');if(el&&!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){_registerHTMLAttr.call(this,key,map);}else{AttributeProvider.prototype.setAttributeConfig.apply(this,arguments);}
+this._configOrder.push(key);},getAttributeKeys:function(){var el=this.get('element');var keys=AttributeProvider.prototype.getAttributeKeys.call(this);for(var key in el){if(!this._configs[key]){keys[key]=keys[key]||el[key];}}
+return keys;},createEvent:function(type,scope){this._events[type]=true;AttributeProvider.prototype.createEvent.apply(this,arguments);},init:function(el,attr){_initElement.apply(this,arguments);}};var _initElement=function(el,attr){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];attr=attr||{};attr.element=attr.element||el||null;this.DOM_EVENTS={'click':true,'dblclick':true,'keydown':true,'keypress':true,'keyup':true,'mousedown':true,'mousemove':true,'mouseout':true,'mouseover':true,'mouseup':true,'focus':true,'blur':true,'submit':true};var isReady=false;if(YAHOO.lang.isString(el)){_registerHTMLAttr.call(this,'id',{value:attr.element});}
+if(Dom.get(el)){isReady=true;_initHTMLElement.call(this,attr);_initContent.call(this,attr);}
+YAHOO.util.Event.onAvailable(attr.element,function(){if(!isReady){_initHTMLElement.call(this,attr);}
+this.fireEvent('available',{type:'available',target:attr.element});},this,true);YAHOO.util.Event.onContentReady(attr.element,function(){if(!isReady){_initContent.call(this,attr);}
+this.fireEvent('contentReady',{type:'contentReady',target:attr.element});},this,true);};var _initHTMLElement=function(attr){this.setAttributeConfig('element',{value:Dom.get(attr.element),readOnly:true});};var _initContent=function(attr){this.initAttributes(attr);this.setAttributes(attr,true);this.fireQueue();};var _registerHTMLAttr=function(key,map){var el=this.get('element');map=map||{};map.name=key;map.method=map.method||function(value){el[key]=value;};map.value=map.value||el[key];this._configs[key]=new YAHOO.util.Attribute(map,this);};YAHOO.augment(YAHOO.util.Element,AttributeProvider);})();YAHOO.register("element",YAHOO.util.Element,{version:"2.3.0",build:"442"});YAHOO.register("utilities", YAHOO, {version: "2.3.0", build: "442"});
index 75b0828761060fce395aa007136dc4835f0e974b..1ee394d85036150b1705e914d53c3635c17ef9b2 100755 (executable)
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.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(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.extend=function(subc,superc,overrides){var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
-if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}};YAHOO.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;}
+YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
+return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]};}
+var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m);}
+if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(name){return YAHOO.env.modules[name]||null;};YAHOO.env.ua=function(){var o={ie:0,opera:0,gecko:0,webkit:0};var ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1;}
+m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1]);}
+if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1]);}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1]);}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1]);}}}}}
+return o;}();(function(){YAHOO.namespace("util","widget","example");if(typeof YAHOO_config!="undefined"){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break;}}
+if(unique){ls.push(l);}}}})();YAHOO.lang={isArray:function(o){if(o){var l=YAHOO.lang;return l.isNumber(o.length)&&l.isFunction(o.splice)&&!l.hasOwnProperty(o.length);}
+return false;},isBoolean:function(o){return typeof o==='boolean';},isFunction:function(o){return typeof o==='function';},isNull:function(o){return o===null;},isNumber:function(o){return typeof o==='number'&&isFinite(o);},isObject:function(o){return(o&&(typeof o==='object'||YAHOO.lang.isFunction(o)))||false;},isString:function(o){return typeof o==='string';},isUndefined:function(o){return typeof o==='undefined';},hasOwnProperty:function(o,prop){if(Object.prototype.hasOwnProperty){return o.hasOwnProperty(prop);}
+return!YAHOO.lang.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop];},_IEEnumFix:function(r,s){if(YAHOO.env.ua.ie){var add=["toString","valueOf"];for(i=0;i<add.length;i=i+1){var fname=add[i],f=s[fname];if(YAHOO.lang.isFunction(f)&&f!=Object.prototype[fname]){r[fname]=f;}}}},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");}
+var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
+if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}
+YAHOO.lang._IEEnumFix(subc.prototype,overrides);}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}
+var a=arguments,i,p,override=a[2];if(override&&override!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]];}}else{for(p in s){if(override||!r[p]){r[p]=s[p];}}
+YAHOO.lang._IEEnumFix(r,s);}},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}
+var a=[r.prototype,s.prototype];for(var i=2;i<arguments.length;i=i+1){a.push(arguments[i]);}
+YAHOO.lang.augmentObject.apply(this,a);},dump:function(o,d){var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=', ',ARROW=' => ';if(!l.isObject(o)||o instanceof Date||("nodeType"in o&&"tagName"in o)){return o;}else if(l.isFunction(o)){return FUN;}
+d=(l.isNumber(d))?d:3;if(l.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
+s.push(COMMA);}
+if(s.length>1){s.pop();}
+s.push("]");}else{s.push("{");for(i in o){if(l.hasOwnProperty(o,i)){s.push(i+ARROW);if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
+s.push(COMMA);}}
+if(s.length>1){s.pop();}
+s.push("}");}
+return s.join("");},substitute:function(s,o,f){var i,j,k,key,v,meta,l=YAHOO.lang,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}';for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break;}
+j=s.indexOf(RBRACE,i);if(i+1>=j){break;}
+token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k);}
+v=o[key];if(f){v=f(key,v,meta);}
+if(l.isObject(v)){if(l.isArray(v)){v=l.dump(v,parseInt(meta,10));}else{meta=meta||"";var dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4);}
+if(v.toString===Object.prototype.toString||dump>-1){v=l.dump(v,parseInt(meta,10));}else{v=v.toString();}}}else if(!l.isString(v)&&!l.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token;}
+s=s.substring(0,i)+v+s.substring(j+1);}
+for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g");}
+return s;},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"");}catch(e){return s;}},merge:function(){var o={},a=arguments,i;for(i=0;i<a.length;i=i+1){YAHOO.lang.augmentObject(o,a[i],true);}
+return o;},isValue:function(o){var l=YAHOO.lang;return(l.isObject(o)||l.isString(o)||l.isNumber(o)||l.isBoolean(o));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.3.0",build:"442"});
+(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={},reClassNameCache={};var isOpera=YAHOO.env.ua.opera,isSafari=YAHOO.env.ua.webkit,isGecko=YAHOO.env.ua.gecko,isIE=YAHOO.env.ua.ie;var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}
 if(propertyCache[property]){return propertyCache[property];}
-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)];}
+var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}
+propertyCache[property]=converted;return converted;};var getClassRegEx=function(className){var re=reClassNameCache[className];if(!re){re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');reClassNameCache[className]=re;}
+return re;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';}
+var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}
 return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}
-return val/100;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 val/100;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}
+if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}
+break;case'float':property='styleFloat';default:el.style[property]=val;}};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';}
+el.style[property]=val;};}
+var testElement=function(node,method){return node&&node.nodeType==1&&(!method||method(node));};YAHOO.util.Dom={get:function(el){if(!el||el.tagName||el.item){return el;}
+if(YAHOO.lang.isString(el)){return document.getElementById(el);}
+if(el.splice){var c=[];for(var i=0,len=el.length;i<len;++i){c[c.length]=Y.Dom.get(el[i]);}
+return c;}
+return el;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
+var parentNode=null;var pos=[];var box;var doc=el.ownerDocument;if(el.getBoundingClientRect){box=el.getBoundingClientRect();return[box.left+Y.Dom.getDocumentScrollLeft(el.ownerDocument),box.top+Y.Dom.getDocumentScrollTop(el.ownerDocument)];}
+else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;var hasAbs=this.getStyle(el,'position')=='absolute';if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;if(isSafari&&!hasAbs&&this.getStyle(parentNode,'position')=='absolute'){hasAbs=true;}
+parentNode=parentNode.offsetParent;}}
+if(isSafari&&hasAbs){pos[0]-=el.ownerDocument.body.offsetLeft;pos[1]-=el.ownerDocument.body.offsetTop;}}
+parentNode=el.parentNode;while(parentNode.tagName&&!patterns.ROOT_TAG.test(parentNode.tagName))
+{if(Y.Dom.getStyle(parentNode,'display').search(/^inline|table-row.*$/i)){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}
+parentNode=parentNode.parentNode;}
 return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}
 var pageXY=this.getXY(el);if(pageXY===false){return false;}
 var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}
 if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}
 if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
 if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
-if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){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||'*';var nodes=[];if(root){root=Y.Dom.get(root);if(!root){return nodes;}}else{root=document;}
-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);}
+if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=document.body){return false;}
+var region=Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
+var nodes=[],elements=root.getElementsByTagName(tag),re=getClassRegEx(className);for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i].className)){nodes[nodes.length]=elements[i];if(apply){apply.call(elements[i],elements[i]);}}}
+return nodes;},hasClass:function(el,className){var re=getClassRegEx(className);var f=function(el){return re.test(el.className);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return false;}
+el.className=YAHOO.lang.trim([el.className,className].join(' '));return true;};return Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=getClassRegEx(className);var f=function(el){if(!this.hasClass(el,className)){return false;}
+var c=el.className;el.className=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}
+el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(!newClassName||oldClassName===newClassName){return false;}
+var re=getClassRegEx(oldClassName);var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return true;}
+el.className=el.className.replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}
+el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';var f=function(el){if(el&&el.id){return el.id;}
+var id=prefix+id_counter++;if(el){el.id=id;}
+return id;};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}
+var f=function(node){if(haystack.contains&&node.nodeType&&!isSafari){return haystack.contains(node);}
+else if(haystack.compareDocumentPosition&&node.nodeType){return!!(haystack.compareDocumentPosition(node)&16);}else if(node.nodeType){return!!this.getAncestorBy(node,function(el){return el==haystack;});}
+return false;};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){if(isSafari){while(el=el.parentNode){if(el==document.documentElement){return true;}}
+return false;}
+return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
+var nodes=[],elements=root.getElementsByTagName(tag);for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];if(apply){apply(elements[i]);}}}
+return nodes;},batch:function(el,method,o,override){el=(el&&el.tagName)?el:Y.Dom.get(el);if(!el||!method){return false;}
+var scope=(override)?o:window;if(el.tagName||(!el.item&&!el.slice)){return method.call(scope,el,o);}
+var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=method.call(scope,el[i],o);}
 return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}
 return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}
-return width;}};})();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();
-
+return width;},getAncestorBy:function(node,method){while(node=node.parentNode){if(testElement(node,method)){return node;}}
+return null;},getAncestorByClassName:function(node,className){node=Y.Dom.get(node);if(!node){return null;}
+var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getAncestorBy(node,method);},getAncestorByTagName:function(node,tagName){node=Y.Dom.get(node);if(!node){return null;}
+var method=function(el){return el.tagName&&el.tagName.toUpperCase()==tagName.toUpperCase();};return Y.Dom.getAncestorBy(node,method);},getPreviousSiblingBy:function(node,method){while(node){node=node.previousSibling;if(testElement(node,method)){return node;}}
+return null;},getPreviousSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
+return Y.Dom.getPreviousSiblingBy(node);},getNextSiblingBy:function(node,method){while(node){node=node.nextSibling;if(testElement(node,method)){return node;}}
+return null;},getNextSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
+return Y.Dom.getNextSiblingBy(node);},getFirstChildBy:function(node,method){var child=(testElement(node.firstChild,method))?node.firstChild:null;return child||Y.Dom.getNextSiblingBy(node.firstChild,method);},getFirstChild:function(node,method){node=Y.Dom.get(node);if(!node){return null;}
+return Y.Dom.getFirstChildBy(node);},getLastChildBy:function(node,method){if(!node){return null;}
+var child=(testElement(node.lastChild,method))?node.lastChild:null;return child||Y.Dom.getPreviousSiblingBy(node.lastChild,method);},getLastChild:function(node){node=Y.Dom.get(node);return Y.Dom.getLastChildBy(node);},getChildrenBy:function(node,method){var child=Y.Dom.getFirstChildBy(node,method);var children=child?[child]:[];Y.Dom.getNextSiblingBy(child,function(node){if(!method||method(node)){children[children.length]=node;}
+return false;});return children;},getChildren:function(node){node=Y.Dom.get(node);if(!node){}
+return Y.Dom.getChildrenBy(node);},getDocumentScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);},getDocumentScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);},insertBefore:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
+return referenceNode.parentNode.insertBefore(newNode,referenceNode);},insertAfter:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
+if(referenceNode.nextSibling){return referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);}else{return referenceNode.parentNode.appendChild(newNode);}}};})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(YAHOO.lang.isArray(x)){y=x[1];x=x[0];}
+this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.3.0",build:"442"});
 YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}
-var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
-this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
+var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}
+if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
+this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();}
+var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
 return found;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}
-var args=[],ret=true,i;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
+var args=[],ret=true,i,rebuild=false;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
 var argslength=args.length;if(!this.silent){}
-for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}
+for(i=0;i<len;++i){var s=this.subscribers[i];if(!s){rebuild=true;}else{if(!this.silent){}
 var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}
 ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}
 if(false===ret){if(!this.silent){}
 return false;}}}
-return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
-this.subscribers.splice(index,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=obj||null;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
-return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=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 self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
+if(rebuild){var newlist=[],subs=this.subscribers;for(i=0,len=subs.length;i<len;++i){s=subs[i];newlist.push(subs[i]);}
+this.subscribers=newlist;}
+return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}
+this.subscribers=[];return i;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
+this.subscribers[index]=null;},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=YAHOO.lang.isUndefined(obj)?null:obj;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
+return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var DOMReady=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var webkitKeymap={63232:38,63233:40,63234:37,63235:39};return{POLL_RETRYS:4000,POLL_INTERVAL:10,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onDOMReady:function(p_fn,p_obj,p_override){if(DOMReady){setTimeout(function(){var s=window;if(p_override){if(p_override===true){s=p_obj;}else{s=p_override;}}
+p_fn.call(s,"DOMReady",[],p_obj);},0);}else{this.DOMReadyEvent.subscribe(p_fn,p_obj,p_override);}},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
 if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}
-return ok;}else if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
+return ok;}else if(YAHOO.lang.isString(el)){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
 if(!el){return false;}
 if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}
 var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}
 var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
-legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(e){this.removeListener(el,sType,fn);return false;}}
-return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true;var le=legacyHandlers[legacyIndex];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var scope=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
-return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(!el.addEventListener&&!el.attachEvent){return true;}else if(this.isSafari){if("click"==sType||"dblclick"==sType){return true;}}
+legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}}
+return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true,le,lh,li,scope,ret;lh=legacyHandlers[legacyIndex];for(var i=0,len=lh.length;i<len;++i){li=lh[i];if(li&&li[this.WFN]){scope=li[this.ADJ_SCOPE];ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
+le=legacyEvents[legacyIndex];if(le&&le[2]){le[2](e);}
+return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(this.webkit&&("click"==sType||"dblclick"==sType)){var v=parseInt(this.webkit,10);if(!isNaN(v)&&v<418){return true;}}
 return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
 return ok;}
 if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
-if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners.splice(i,1);return true;}}
+if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners[i]=null;return true;}}
 return false;}
 var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}
 if(index>=0){cacheItem=listeners[index];}
 if(!el||!cacheItem){return false;}
-if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist.splice(i,1);break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(e){return false;}}
-delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
+if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist[i]=null;break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(ex){this.lastError=ex;return false;}}
+delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners[index]=null;return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
 return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
 return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
-return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}
+return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}
 return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
 c=c.caller;}}
-return ev;},getCharCode:function(ev){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
+return ev;},getCharCode:function(ev){var code=ev.keyCode||ev.charCode||0;if(YAHOO.env.ua.webkit&&(code in webkitKeymap)){code=webkitKeymap[code];}
+return code;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
 return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
-return id;},_isValidCollection:function(o){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){loadComplete=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}
+return id;},_isValidCollection:function(o){try{return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");}catch(e){return false;}},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(e){if(!loadComplete){loadComplete=true;var EU=YAHOO.util.Event;EU._ready();EU._tryPreloadAttach();}},_ready:function(e){if(!DOMReady){DOMReady=true;var EU=YAHOO.util.Event;EU.DOMReadyEvent.fire();EU._simpleRemove(document,"DOMContentLoaded",EU._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}
+if(this.isIE){if(!DOMReady){this.startInterval();return false;}}
 this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}
-var notAvail=[];for(var i=0,len=onAvailStack.length;i<len;++i){var item=onAvailStack[i];if(item){var el=this.getEl(item.id);if(el){if(!item.checkReady||loadComplete||el.nextSibling||(document&&document.body)){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
-item.fn.call(scope,item.obj);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
+var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
+item.fn.call(scope,item.obj);};var i,len,item,el;for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&!item.checkReady){el=this.getEl(item.id);if(el){executeItem(el,item);onAvailStack[i]=null;}else{notAvail.push(item);}}}
+for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&item.checkReady){el=this.getEl(item.id);if(el){if(loadComplete||el.nextSibling){executeItem(el,item);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
 retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}
-this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn);}}
-if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var elListeners=[];if(listeners&&listeners.length>0){for(var i=0,len=listeners.length;i<len;++i){var l=listeners[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){elListeners.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}
-return(elListeners.length)?elListeners:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
+this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn,l.index);}}
+if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else if(sType=="unload"){searchLists=[unloadListeners];}else{searchLists=[listeners];}
+for(var j=0;j<searchLists.length;++j){var searchList=searchLists[j];if(searchList&&searchList.length>0){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}
+return(results.length)?results:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
 l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}
 unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}
 j=j-1;}
 l=null;EU.clearCache();}
 for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}
-legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}
-EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
+legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var el,d=document,b=d.body;if(("undefined"!==typeof YAHOO_config)&&YAHOO_config.injecting){el=document.createElement("script");var p=d.getElementsByTagName("head")[0]||b;p.insertBefore(el,p.firstChild);}else{d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');el=document.getElementById("_yui_eu_dr");}
+if(el){el.onreadystatechange=function(){if("complete"===this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};}else{}
+el=null;}else if(EU.webkit){EU._drwatch=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._drwatch);EU._drwatch=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}
+EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
 YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}
-subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}else{return false;}},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=opts.silent||null;var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
+subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var evts=this.__yui_events;if(p_type){var ce=evts[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}}else{for(var i in evts){var ret=true;if(YAHOO.lang.hasOwnProperty(evts,i)){ret=ret&&evts[i].unsubscribe(p_fn,p_obj);}}
+return ret;}
+return false;},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=(opts.silent);var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
 this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}
-return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){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
+return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(!ce){return null;}
+var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
+return ce.fire.apply(ce,args);},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}
+return false;}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else if(!keyData){}else if(!handler){}
+if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
+var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
+if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
+function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
+if(!keyData.alt){keyData.alt=false;}
+if(!keyData.ctrl){keyData.ctrl=false;}
+if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
+this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
+this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
+this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+
+(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.register("event",YAHOO.util.Event,{version:"2.3.0",build:"442"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.3.0", build: "442"});
index 5d9a85146999d07a539d7912fc78719212c357d6..23046a0f95f3f076bdff57aebcb0c289e6923fd9 100755 (executable)
@@ -1,5 +1,43 @@
 YAHOO Global - Release Notes
 
+2.3.0
+  * Added YAHOO.env.ua - browser detection
+  * Added YAHOO.lang.merge - object merge
+  * Added YAHOO.lang.trim - whitespace removal
+  * Added YAHOO.lang.augmentObject - mixins.  Renamed augment to augmentProto and 
+    made augment an alias to augmentProto
+  * isObject/isArray return false rather than null when testing null
+
+2.2.2
+
+  * No change
+
+2.2.1
+
+  * YAHOO.lang.isObject returns false for null
+  * YAHOO.lang.isArray no longer generates an error when the argument is null/undefined
+  * Better error messages for YAHOO.lang.augment/extend failures that are usually due 
+    to missing dependencies.
+
+2.2.0a
+
+  * Fixed a typo that prevented the proper detection of multiple YAHOO_config listeners
+
+2.2.0
+
+  * Added configuration of the library via a YAHOO_config object defined
+    prior to the reference to the library.  Currently it supports a listener
+    parameter that will execute every time a new module YUI module is loaded.
+
+  * Added YAHOO.register & YAHOO.getVersion for version stamping modules.
+  
+  * Added YAHOO.env which is the home for the information about the loaded
+    YUI modules, and will host more info later.
+    
+  * YAHOO.util.Lang was relocated to this package and is now YAHOO.lang.
+    YAHOO.extend and YAHOO.augment have moved to env (the original
+    functions still work).
+
 0.12.2
 
   * No change
index e1f745ca88021713ca7416fc70eeaced71dba1a0..a984e8ad35c0d88c053b329f6c89cb77884116b6 100755 (executable)
@@ -1,10 +1,9 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
-
 /**
  * The YAHOO object is the single global object used by YUI Library.  It
  * contains utility function for setting up namespaces, inheritance, and
@@ -14,9 +13,51 @@ version: 0.12.2
  * @title  YAHOO Global
  */
 
+/**
+ * YAHOO_config is not included as part of the library.  Instead it is an 
+ * object that can be defined by the implementer immediately before 
+ * including the YUI library.  The properties included in this object
+ * will be used to configure global properties needed as soon as the 
+ * library begins to load.
+ * @class YAHOO_config
+ * @static
+ */
+
+/**
+ * A reference to a function that will be executed every time a YAHOO module
+ * is loaded.  As parameter, this function will receive the version
+ * information for the module. See <a href="YAHOO.env.html#getVersion">
+ * YAHOO.env.getVersion</a> for the description of the version data structure.
+ * @property listener
+ * @type Function
+ * @static
+ * @default undefined
+ */
+
+/**
+ * Set to true if the library will be dynamically loaded after window.onload.
+ * Defaults to false 
+ * @property injecting
+ * @type boolean
+ * @static
+ * @default undefined
+ */
+
+/**
+ * Instructs the yuiloader component to dynamically load yui components and
+ * their dependencies.  See the yuiloader documentation for more information
+ * about dynamic loading
+ * @property load
+ * @static
+ * @default undefined
+ * @see yuiloader
+ */
+
 if (typeof YAHOO == "undefined") {
     /**
-     * The YAHOO global namespace object
+     * The YAHOO global namespace object.  If YAHOO is already defined, the
+     * existing YAHOO object will not be overwritten so that defined
+     * namespaces are preserved.
      * @class YAHOO
      * @static
      */
@@ -46,12 +87,12 @@ if (typeof YAHOO == "undefined") {
  */
 YAHOO.namespace = function() {
     var a=arguments, o=null, i, j, d;
-    for (i=0; i<a.length; ++i) {
+    for (i=0; i<a.length; i=i+1) {
         d=a[i].split(".");
         o=YAHOO;
 
         // YAHOO is implied, so it is ignored if it is included
-        for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; ++j) {
+        for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; j=j+1) {
             o[d[j]]=o[d[j]] || {};
             o=o[d[j]];
         }
@@ -61,7 +102,8 @@ YAHOO.namespace = function() {
 };
 
 /**
- * Uses YAHOO.widget.Logger to output a log message, if the widget is available.
+ * Uses YAHOO.widget.Logger to output a log message, if the widget is
+ * available.
  *
  * @method log
  * @static
@@ -82,63 +124,745 @@ YAHOO.log = function(msg, cat, src) {
 };
 
 /**
- * Utility to set up the prototype, constructor and superclass properties to
- * support an inheritance strategy that can chain constructors and methods.
- *
- * @method extend
+ * Registers a module with the YAHOO object
+ * @method register
  * @static
- * @param {Function} subc   the object to modify
- * @param {Function} superc the object to inherit
- * @param {Object} overrides  additional properties/methods to add to the
- *                              subclass prototype.  These will override the
- *                              matching items obtained from the superclass 
- *                              if present.
- */
-YAHOO.extend = function(subc, superc, overrides) {
-    var F = function() {};
-    F.prototype=superc.prototype;
-    subc.prototype=new F();
-    subc.prototype.constructor=subc;
-    subc.superclass=superc.prototype;
-    if (superc.prototype.constructor == Object.prototype.constructor) {
-        superc.prototype.constructor=superc;
+ * @param {String}   name    the name of the module (event, slider, etc)
+ * @param {Function} mainClass a reference to class in the module.  This
+ *                             class will be tagged with the version info
+ *                             so that it will be possible to identify the
+ *                             version that is in use when multiple versions
+ *                             have loaded
+ * @param {Object}   data      metadata object for the module.  Currently it
+ *                             is expected to contain a "version" property
+ *                             and a "build" property at minimum.
+ */
+YAHOO.register = function(name, mainClass, data) {
+    var mods = YAHOO.env.modules;
+    if (!mods[name]) {
+        mods[name] = { versions:[], builds:[] };
     }
-
-    if (overrides) {
-        for (var i in overrides) {
-            subc.prototype[i]=overrides[i];
-        }
+    var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;
+    m.name = name;
+    m.version = v;
+    m.build = b;
+    m.versions.push(v);
+    m.builds.push(b);
+    m.mainClass = mainClass;
+    // fire the module load listeners
+    for (var i=0;i<ls.length;i=i+1) {
+        ls[i](m);
+    }
+    // label the main class
+    if (mainClass) {
+        mainClass.VERSION = v;
+        mainClass.BUILD = b;
+    } else {
+        YAHOO.log("mainClass is undefined for module " + name, "warn");
     }
 };
 
 /**
- * Applies all prototype properties in the supplier to the receiver if the
- * receiver does not have these properties yet.  Optionally, one or more
- * methods/properties can be specified (as additional parameters).  This
- * option will overwrite the property if receiver has it already.
+ * YAHOO.env is used to keep track of what is known about the YUI library and
+ * the browsing environment
+ * @class YAHOO.env
+ * @static
+ */
+YAHOO.env = YAHOO.env || {
+
+    /**
+     * Keeps the version info for all YUI modules that have reported themselves
+     * @property modules
+     * @type Object[]
+     */
+    modules: [],
+    
+    /**
+     * List of functions that should be executed every time a YUI module
+     * reports itself.
+     * @property listeners
+     * @type Function[]
+     */
+    listeners: []
+};
+
+/**
+ * Returns the version data for the specified module:
+ *      <dl>
+ *      <dt>name:</dt>      <dd>The name of the module</dd>
+ *      <dt>version:</dt>   <dd>The version in use</dd>
+ *      <dt>build:</dt>     <dd>The build number in use</dd>
+ *      <dt>versions:</dt>  <dd>All versions that were registered</dd>
+ *      <dt>builds:</dt>    <dd>All builds that were registered.</dd>
+ *      <dt>mainClass:</dt> <dd>An object that was was stamped with the
+ *                 current version and build. If 
+ *                 mainClass.VERSION != version or mainClass.BUILD != build,
+ *                 multiple versions of pieces of the library have been
+ *                 loaded, potentially causing issues.</dd>
+ *       </dl>
  *
- * @method augment
+ * @method getVersion
  * @static
- * @param {Function} r  the object to receive the augmentation
- * @param {Function} s  the object that supplies the properties to augment
- * @param {String*}  arguments zero or more properties methods to augment the
- *                             receiver with.  If none specified, everything
- *                             in the supplier will be used unless it would
- *                             overwrite an existing property in the receiver
+ * @param {String}  name the name of the module (event, slider, etc)
+ * @return {Object} The version info
  */
-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]];
+YAHOO.env.getVersion = function(name) {
+    return YAHOO.env.modules[name] || null;
+};
+
+/**
+ * Do not fork for a browser if it can be avoided.  Use feature detection when
+ * you can.  Use the user agent as a last resort.  YAHOO.env.ua stores a version
+ * number for the browser engine, 0 otherwise.  This value may or may not map
+ * to the version number of the browser using the engine.  The value is 
+ * presented as a float so that it can easily be used for boolean evaluation 
+ * as well as for looking for a particular range of versions.  Because of this, 
+ * some of the granularity of the version info may be lost (e.g., Gecko 1.8.0.9 
+ * reports 1.8).
+ * @class YAHOO.env.ua
+ * @static
+ */
+YAHOO.env.ua = function() {
+    var o={
+
+        /**
+         * Internet Explorer version number or 0.  Example: 6
+         * @property ie
+         * @type float
+         */
+        ie:0,
+
+        /**
+         * Opera version number or 0.  Example: 9.2
+         * @property opera
+         * @type float
+         */
+        opera:0,
+
+        /**
+         * Gecko engine revision number.  Will evaluate to 1 if Gecko 
+         * is detected but the revision could not be found. Other browsers
+         * will be 0.  Example: 1.8
+         * <pre>
+         * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
+         * Firefox 1.5.0.9: 1.8.0.9 <-- Reports 1.8
+         * Firefox 2.0.0.3: 1.8.1.3 <-- Reports 1.8
+         * Firefox 3 alpha: 1.9a4   <-- Reports 1.9
+         * </pre>
+         * @property gecko
+         * @type float
+         */
+        gecko:0,
+
+        /**
+         * AppleWebKit version.  KHTML browsers that are not WebKit browsers 
+         * will evaluate to 1, other browsers 0.  Example: 418.9.1
+         * <pre>
+         * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the 
+         *                                   latest available for Mac OSX 10.3.
+         * Safari 2.0.2:         416     <-- hasOwnProperty introduced
+         * Safari 2.0.4:         418     <-- preventDefault fixed
+         * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
+         *                                   different versions of webkit
+         * Safari 2.0.4 (419.3): 419     <-- Current Safari release
+         * Webkit 212 nightly:   522+    <-- Safari 3.0 (with native SVG) should
+         *                                   be higher than this
+         *                                   
+         * </pre>
+         * http://developer.apple.com/internet/safari/uamatrix.html
+         * @property webkit
+         * @type float
+         */
+        webkit:0
+    };
+
+    var ua=navigator.userAgent, m;
+
+    // Modern KHTML browsers should qualify as Safari X-Grade
+    if ((/KHTML/).test(ua)) {
+        o.webkit=1;
+    }
+    // Modern WebKit browsers are at least X-Grade
+    m=ua.match(/AppleWebKit\/([^\s]*)/);
+    if (m&&m[1]) {
+        o.webkit=parseFloat(m[1]);
+    }
+
+    if (!o.webkit) { // not webkit
+        // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
+        m=ua.match(/Opera[\s\/]([^\s]*)/);
+        if (m&&m[1]) {
+            o.opera=parseFloat(m[1]);
+        } else { // not opera or webkit
+            m=ua.match(/MSIE\s([^;]*)/);
+            if (m&&m[1]) {
+                o.ie=parseFloat(m[1]);
+            } else { // not opera, webkit, or ie
+                m=ua.match(/Gecko\/([^\s]*)/);
+                if (m) {
+                    o.gecko=1; // Gecko detected, look for revision
+                    m=ua.match(/rv:([^\s\)]*)/);
+                    if (m&&m[1]) {
+                        o.gecko=parseFloat(m[1]);
+                    }
+                }
+            }
         }
-    } else {
-        for (p in sp) { 
-            if (!rp[p]) {
-                rp[p] = sp[p];
+    }
+    
+    return o;
+}();
+
+/*
+ * Initializes the global by creating the default namespaces and applying
+ * any new configuration information that is detected.  This is the setup
+ * for env.
+ * @method init
+ * @static
+ * @private
+ */
+(function() {
+    YAHOO.namespace("util", "widget", "example");
+    if (typeof YAHOO_config != "undefined") {
+        var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;
+        if (l) {
+            // if YAHOO is loaded multiple times we need to check to see if
+            // this is a new config object.  If it is, add the new component
+            // load listener to the stack
+            for (i=0;i<ls.length;i=i+1) {
+                if (ls[i]==l) {
+                    unique=false;
+                    break;
+                }
+            }
+            if (unique) {
+                ls.push(l);
             }
         }
     }
+})();
+/**
+ * Provides the language utilites and extensions used by the library
+ * @class YAHOO.lang
+ */
+YAHOO.lang = {
+    /**
+     * Determines whether or not the provided object is an array.
+     * Testing typeof/instanceof/constructor of arrays across frame 
+     * boundaries isn't possible in Safari unless you have a reference
+     * to the other frame to test against its Array prototype.  To
+     * handle this case, we test well-known array properties instead.
+     * properties.
+     * @method isArray
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isArray: function(o) { 
+
+        if (o) {
+           var l = YAHOO.lang;
+           return l.isNumber(o.length) && l.isFunction(o.splice) && 
+                  !l.hasOwnProperty(o.length);
+        }
+        return false;
+    },
+
+    /**
+     * Determines whether or not the provided object is a boolean
+     * @method isBoolean
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isBoolean: function(o) {
+        return typeof o === 'boolean';
+    },
+    
+    /**
+     * Determines whether or not the provided object is a function
+     * @method isFunction
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isFunction: function(o) {
+        return typeof o === 'function';
+    },
+        
+    /**
+     * Determines whether or not the provided object is null
+     * @method isNull
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isNull: function(o) {
+        return o === null;
+    },
+        
+    /**
+     * Determines whether or not the provided object is a legal number
+     * @method isNumber
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isNumber: function(o) {
+        return typeof o === 'number' && isFinite(o);
+    },
+      
+    /**
+     * Determines whether or not the provided object is of type object
+     * or function
+     * @method isObject
+     * @param {any} o The object being testing
+     * @return Boolean
+     */  
+    isObject: function(o) {
+return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
+    },
+        
+    /**
+     * Determines whether or not the provided object is a string
+     * @method isString
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isString: function(o) {
+        return typeof o === 'string';
+    },
+        
+    /**
+     * Determines whether or not the provided object is undefined
+     * @method isUndefined
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isUndefined: function(o) {
+        return typeof o === 'undefined';
+    },
+    
+    /**
+     * Determines whether or not the property was added
+     * to the object instance.  Returns false if the property is not present
+     * in the object, or was inherited from the prototype.
+     * This abstraction is provided to enable hasOwnProperty for Safari 1.3.x.
+     * There is a discrepancy between YAHOO.lang.hasOwnProperty and
+     * Object.prototype.hasOwnProperty when the property is a primitive added to
+     * both the instance AND prototype with the same value:
+     * <pre>
+     * var A = function() {};
+     * A.prototype.foo = 'foo';
+     * var a = new A();
+     * a.foo = 'foo';
+     * alert(a.hasOwnProperty('foo')); // true
+     * alert(YAHOO.lang.hasOwnProperty(a, 'foo')); // false when using fallback
+     * </pre>
+     * @method hasOwnProperty
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    hasOwnProperty: function(o, prop) {
+        if (Object.prototype.hasOwnProperty) {
+            return o.hasOwnProperty(prop);
+        }
+        
+        return !YAHOO.lang.isUndefined(o[prop]) && 
+                o.constructor.prototype[prop] !== o[prop];
+    },
+    /**
+     * IE will not enumerate native functions in a derived object even if the
+     * function was overridden.  This is a workaround for specific functions 
+     * we care about on the Object prototype. 
+     * @property _IEEnumFix
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @static
+     * @private
+     */
+    _IEEnumFix: function(r, s) {
+        if (YAHOO.env.ua.ie) {
+            var add=["toString", "valueOf"];
+            for (i=0;i<add.length;i=i+1) {
+                var fname=add[i],f=s[fname];
+                if (YAHOO.lang.isFunction(f) && f!=Object.prototype[fname]) {
+                    r[fname]=f;
+                }
+            }
+        }
+    },
+       
+    /**
+     * Utility to set up the prototype, constructor and superclass properties to
+     * support an inheritance strategy that can chain constructors and methods.
+     * Static members will not be inherited.
+     *
+     * @method extend
+     * @static
+     * @param {Function} subc   the object to modify
+     * @param {Function} superc the object to inherit
+     * @param {Object} overrides  additional properties/methods to add to the
+     *                              subclass prototype.  These will override the
+     *                              matching items obtained from the superclass 
+     *                              if present.
+     */
+    extend: function(subc, superc, overrides) {
+        if (!superc||!subc) {
+            throw new Error("YAHOO.lang.extend failed, please check that " +
+                            "all dependencies are included.");
+        }
+        var F = function() {};
+        F.prototype=superc.prototype;
+        subc.prototype=new F();
+        subc.prototype.constructor=subc;
+        subc.superclass=superc.prototype;
+        if (superc.prototype.constructor == Object.prototype.constructor) {
+            superc.prototype.constructor=superc;
+        }
+    
+        if (overrides) {
+            for (var i in overrides) {
+                subc.prototype[i]=overrides[i];
+            }
+
+            YAHOO.lang._IEEnumFix(subc.prototype, overrides);
+        }
+    },
+   
+    /**
+     * Applies all properties in the supplier to the receiver if the
+     * receiver does not have these properties yet.  Optionally, one or 
+     * more methods/properties can be specified (as additional 
+     * parameters).  This option will overwrite the property if receiver 
+     * has it already.  If true is passed as the third parameter, all 
+     * properties will be applied and _will_ overwrite properties in 
+     * the receiver.
+     *
+     * @method augmentObject
+     * @static
+     * @since 2.3.0
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @param {String*|boolean}  arguments zero or more properties methods 
+     *        to augment the receiver with.  If none specified, everything
+     *        in the supplier will be used unless it would
+     *        overwrite an existing property in the receiver. If true
+     *        is specified as the third parameter, all properties will
+     *        be applied and will overwrite an existing property in
+     *        the receiver
+     */
+    augmentObject: function(r, s) {
+        if (!s||!r) {
+            throw new Error("Absorb failed, verify dependencies.");
+        }
+        var a=arguments, i, p, override=a[2];
+        if (override && override!==true) { // only absorb the specified properties
+            for (i=2; i<a.length; i=i+1) {
+                r[a[i]] = s[a[i]];
+            }
+        } else { // take everything, overwriting only if the third parameter is true
+            for (p in s) { 
+                if (override || !r[p]) {
+                    r[p] = s[p];
+                }
+            }
+            
+            YAHOO.lang._IEEnumFix(r, s);
+        }
+    },
+    /**
+     * Same as YAHOO.lang.augmentObject, except it only applies prototype properties
+     * @see YAHOO.lang.augmentObject
+     * @method augmentProto
+     * @static
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @param {String*|boolean}  arguments zero or more properties methods 
+     *        to augment the receiver with.  If none specified, everything 
+     *        in the supplier will be used unless it would overwrite an existing 
+     *        property in the receiver.  if true is specified as the third 
+     *        parameter, all properties will be applied and will overwrite an 
+     *        existing property in the receiver
+     */
+    augmentProto: function(r, s) {
+        if (!s||!r) {
+            throw new Error("Augment failed, verify dependencies.");
+        }
+        //var a=[].concat(arguments);
+        var a=[r.prototype,s.prototype];
+        for (var i=2;i<arguments.length;i=i+1) {
+            a.push(arguments[i]);
+        }
+        YAHOO.lang.augmentObject.apply(this, a);
+    },
+
+      
+    /**
+     * Returns a simple string representation of the object or array.
+     * Other types of objects will be returned unprocessed.  Arrays
+     * are expected to be indexed.  Use object notation for
+     * associative arrays.
+     * @method dump
+     * @since 2.3.0
+     * @param o {Object} The object to dump
+     * @param d {int} How deep to recurse child objects, default 3
+     * @return {String} the dump result
+     */
+    dump: function(o, d) {
+        var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",
+            COMMA=', ', ARROW=' => ';
+
+        // Skip non-objects
+        // Skip dates because the std toString is what we want
+        // Skip HTMLElement-like objects because trying to dump 
+        // an element will cause an unhandled exception in FF 2.x
+        if (!l.isObject(o) || o instanceof Date || 
+            ("nodeType" in o && "tagName" in o)) {
+            return o;
+        } else if  (l.isFunction(o)) {
+            return FUN;
+        }
+
+        // dig into child objects the depth specifed. Default 3
+        d = (l.isNumber(d)) ? d : 3;
+
+        // arrays [1, 2, 3]
+        if (l.isArray(o)) {
+            s.push("[");
+            for (i=0,len=o.length;i<len;i=i+1) {
+                if (l.isObject(o[i])) {
+                    s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                } else {
+                    s.push(o[i]);
+                }
+                s.push(COMMA);
+            }
+            if (s.length > 1) {
+                s.pop();
+            }
+            s.push("]");
+        // objects {k1 => v1, k2 => v2}
+        } else {
+            s.push("{");
+            for (i in o) {
+                if (l.hasOwnProperty(o, i)) {
+                    s.push(i + ARROW);
+                    if (l.isObject(o[i])) {
+                        s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                    } else {
+                        s.push(o[i]);
+                    }
+                    s.push(COMMA);
+                }
+            }
+            if (s.length > 1) {
+                s.pop();
+            }
+            s.push("}");
+        }
+
+        return s.join("");
+    },
+
+    /**
+     * Does variable substitution on a string. It scans through the string 
+     * looking for expressions enclosed in { } braces. If an expression 
+     * is found, it is used a key on the object.  If there is a space in
+     * the key, the first word is used for the key and the rest is provided
+     * to an optional function to be used to programatically determine the
+     * value (the extra information might be used for this decision). If 
+     * the value for the key in the object, or what is returned from the
+     * function has a string value, number value, or object value, it is 
+     * substituted for the bracket expression and it repeats.  If this
+     * value is an object, it uses the Object's toString() if this has
+     * been overridden, otherwise it does a shallow dump of the key/value
+     * pairs.
+     * @method substitute
+     * @since 2.3.0
+     * @param s {String} The string that will be modified.
+     * @param o {Object} An object containing the replacement values
+     * @param f {Function} An optional function that can be used to
+     *                     process each match.  It receives the key,
+     *                     value, and any extra metadata included with
+     *                     the key inside of the braces.
+     * @return {String} the substituted string
+     */
+    substitute: function (s, o, f) {
+        var i, j, k, key, v, meta, l=YAHOO.lang, saved=[], token, 
+            DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}';
+
+
+        for (;;) {
+            i = s.lastIndexOf(LBRACE);
+            if (i < 0) {
+                break;
+            }
+            j = s.indexOf(RBRACE, i);
+            if (i + 1 >= j) {
+                break;
+            }
+
+            //Extract key and meta info 
+            token = s.substring(i + 1, j);
+            key = token;
+            meta = null;
+            k = key.indexOf(SPACE);
+            if (k > -1) {
+                meta = key.substring(k + 1);
+                key = key.substring(0, k);
+            }
+
+            // lookup the value
+            v = o[key];
+
+            // if a substitution function was provided, execute it
+            if (f) {
+                v = f(key, v, meta);
+            }
+
+            if (l.isObject(v)) {
+                if (l.isArray(v)) {
+                    v = l.dump(v, parseInt(meta, 10));
+                } else {
+                    meta = meta || "";
+
+                    // look for the keyword 'dump', if found force obj dump
+                    var dump = meta.indexOf(DUMP);
+                    if (dump > -1) {
+                        meta = meta.substring(4);
+                    }
+
+                    // use the toString if it is not the Object toString 
+                    // and the 'dump' meta info was not found
+                    if (v.toString===Object.prototype.toString||dump>-1) {
+                        v = l.dump(v, parseInt(meta, 10));
+                    } else {
+                        v = v.toString();
+                    }
+                }
+            } else if (!l.isString(v) && !l.isNumber(v)) {
+                // This {block} has no replace string. Save it for later.
+                v = "~-" + saved.length + "-~";
+                saved[saved.length] = token;
+
+                // break;
+            }
+
+            s = s.substring(0, i) + v + s.substring(j + 1);
+
+
+        }
+
+        // restore saved {block}s
+        for (i=saved.length-1; i>=0; i=i-1) {
+            s = s.replace(new RegExp("~-" + i + "-~"), "{"  + saved[i] + "}", "g");
+        }
+
+        return s;
+    },
+
+
+    /**
+     * Returns a string without any leading or trailing whitespace.  If 
+     * the input is not a string, the input will be returned untouched.
+     * @method trim
+     * @since 2.3.0
+     * @param s {string} the string to trim
+     * @return {string} the trimmed string
+     */
+    trim: function(s){
+        try {
+            return s.replace(/^\s+|\s+$/g, "");
+        } catch(e) {
+            return s;
+        }
+    },
+
+    /**
+     * Returns a new object containing all of the properties of
+     * all the supplied objects.  The properties from later objects
+     * will overwrite those in earlier objects.
+     * @method merge
+     * @since 2.3.0
+     * @param arguments {Object*} the objects to merge
+     * @return the new merged object
+     */
+    merge: function() {
+        var o={}, a=arguments, i;
+        for (i=0; i<a.length; i=i+1) {
+            YAHOO.lang.augmentObject(o, a[i], true);
+            /*
+            for (var j in a[i]) {
+                o[j] = a[i][j];
+            }
+            */
+        }
+        return o;
+    },
+
+    /**
+     * A convenience method for detecting a legitimate non-null value.
+     * Returns false for null/undefined/NaN, true for other values, 
+     * including 0/false/''
+     * @method isValue
+     * @since 2.3.0
+     * @param o {any} the item to test
+     * @return {boolean} true if it is not null/undefined/NaN || false
+     */
+    isValue: function(o) {
+        // return (o || o === false || o === 0 || o === ''); // Infinity fails
+        var l = YAHOO.lang;
+return (l.isObject(o) || l.isString(o) || l.isNumber(o) || l.isBoolean(o));
+    }
+
 };
 
-YAHOO.namespace("util", "widget", "example");
+/*
+ * An alias for <a href="YAHOO.lang.html">YAHOO.lang</a>
+ * @class YAHOO.util.Lang
+ */
+YAHOO.util.Lang = YAHOO.lang;
+/**
+ * Same as YAHOO.lang.augmentObject, except it only applies prototype 
+ * properties.  This is an alias for augmentProto.
+ * @see YAHOO.lang.augmentObject
+ * @method augment
+ * @static
+ * @param {Function} r  the object to receive the augmentation
+ * @param {Function} s  the object that supplies the properties to augment
+ * @param {String*|boolean}  arguments zero or more properties methods to 
+ *        augment the receiver with.  If none specified, everything
+ *        in the supplier will be used unless it would
+ *        overwrite an existing property in the receiver.  if true
+ *        is specified as the third parameter, all properties will
+ *        be applied and will overwrite an existing property in
+ *        the receiver
+ */
+YAHOO.lang.augment = YAHOO.lang.augmentProto;
+
+/**
+ * An alias for <a href="YAHOO.lang.html#augment">YAHOO.lang.augment</a>
+ * @for YAHOO
+ * @method augment
+ * @static
+ * @param {Function} r  the object to receive the augmentation
+ * @param {Function} s  the object that supplies the properties to augment
+ * @param {String*}  arguments zero or more properties methods to 
+ *        augment the receiver with.  If none specified, everything
+ *        in the supplier will be used unless it would
+ *        overwrite an existing property in the receiver
+ */
+YAHOO.augment = YAHOO.lang.augmentProto;
+       
+/**
+ * An alias for <a href="YAHOO.lang.html#extend">YAHOO.lang.extend</a>
+ * @method extend
+ * @static
+ * @param {Function} subc   the object to modify
+ * @param {Function} superc the object to inherit
+ * @param {Object} overrides  additional properties/methods to add to the
+ *        subclass prototype.  These will override the
+ *        matching items obtained from the superclass if present.
+ */
+YAHOO.extend = YAHOO.lang.extend;
+
+YAHOO.register("yahoo", YAHOO, {version: "2.3.0", build: "442"});
index fb93090be70176c79fa86bb4b9b00e08c668872a..cd51ef0ff3c5e96c0cb9e752bb62e15e842f8d52 100755 (executable)
@@ -1,12 +1,42 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.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(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.extend=function(subc,superc,overrides){var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
-if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}};YAHOO.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
+YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
+return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]};}
+var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m);}
+if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(name){return YAHOO.env.modules[name]||null;};YAHOO.env.ua=function(){var o={ie:0,opera:0,gecko:0,webkit:0};var ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1;}
+m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1]);}
+if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1]);}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1]);}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1]);}}}}}
+return o;}();(function(){YAHOO.namespace("util","widget","example");if(typeof YAHOO_config!="undefined"){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break;}}
+if(unique){ls.push(l);}}}})();YAHOO.lang={isArray:function(o){if(o){var l=YAHOO.lang;return l.isNumber(o.length)&&l.isFunction(o.splice)&&!l.hasOwnProperty(o.length);}
+return false;},isBoolean:function(o){return typeof o==='boolean';},isFunction:function(o){return typeof o==='function';},isNull:function(o){return o===null;},isNumber:function(o){return typeof o==='number'&&isFinite(o);},isObject:function(o){return(o&&(typeof o==='object'||YAHOO.lang.isFunction(o)))||false;},isString:function(o){return typeof o==='string';},isUndefined:function(o){return typeof o==='undefined';},hasOwnProperty:function(o,prop){if(Object.prototype.hasOwnProperty){return o.hasOwnProperty(prop);}
+return!YAHOO.lang.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop];},_IEEnumFix:function(r,s){if(YAHOO.env.ua.ie){var add=["toString","valueOf"];for(i=0;i<add.length;i=i+1){var fname=add[i],f=s[fname];if(YAHOO.lang.isFunction(f)&&f!=Object.prototype[fname]){r[fname]=f;}}}},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");}
+var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
+if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}
+YAHOO.lang._IEEnumFix(subc.prototype,overrides);}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}
+var a=arguments,i,p,override=a[2];if(override&&override!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]];}}else{for(p in s){if(override||!r[p]){r[p]=s[p];}}
+YAHOO.lang._IEEnumFix(r,s);}},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}
+var a=[r.prototype,s.prototype];for(var i=2;i<arguments.length;i=i+1){a.push(arguments[i]);}
+YAHOO.lang.augmentObject.apply(this,a);},dump:function(o,d){var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=', ',ARROW=' => ';if(!l.isObject(o)||o instanceof Date||("nodeType"in o&&"tagName"in o)){return o;}else if(l.isFunction(o)){return FUN;}
+d=(l.isNumber(d))?d:3;if(l.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
+s.push(COMMA);}
+if(s.length>1){s.pop();}
+s.push("]");}else{s.push("{");for(i in o){if(l.hasOwnProperty(o,i)){s.push(i+ARROW);if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
+s.push(COMMA);}}
+if(s.length>1){s.pop();}
+s.push("}");}
+return s.join("");},substitute:function(s,o,f){var i,j,k,key,v,meta,l=YAHOO.lang,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}';for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break;}
+j=s.indexOf(RBRACE,i);if(i+1>=j){break;}
+token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k);}
+v=o[key];if(f){v=f(key,v,meta);}
+if(l.isObject(v)){if(l.isArray(v)){v=l.dump(v,parseInt(meta,10));}else{meta=meta||"";var dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4);}
+if(v.toString===Object.prototype.toString||dump>-1){v=l.dump(v,parseInt(meta,10));}else{v=v.toString();}}}else if(!l.isString(v)&&!l.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token;}
+s=s.substring(0,i)+v+s.substring(j+1);}
+for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g");}
+return s;},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"");}catch(e){return s;}},merge:function(){var o={},a=arguments,i;for(i=0;i<a.length;i=i+1){YAHOO.lang.augmentObject(o,a[i],true);}
+return o;},isValue:function(o){var l=YAHOO.lang;return(l.isObject(o)||l.isString(o)||l.isNumber(o)||l.isBoolean(o));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.3.0",build:"442"});
\ No newline at end of file
index 2c3a17dec579792d6e2428fa16062018726b4e6f..a984e8ad35c0d88c053b329f6c89cb77884116b6 100755 (executable)
@@ -1,8 +1,8 @@
 /*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 0.12.2
+version: 2.3.0
 */
 /**
  * The YAHOO object is the single global object used by YUI Library.  It
@@ -13,9 +13,51 @@ version: 0.12.2
  * @title  YAHOO Global
  */
 
+/**
+ * YAHOO_config is not included as part of the library.  Instead it is an 
+ * object that can be defined by the implementer immediately before 
+ * including the YUI library.  The properties included in this object
+ * will be used to configure global properties needed as soon as the 
+ * library begins to load.
+ * @class YAHOO_config
+ * @static
+ */
+
+/**
+ * A reference to a function that will be executed every time a YAHOO module
+ * is loaded.  As parameter, this function will receive the version
+ * information for the module. See <a href="YAHOO.env.html#getVersion">
+ * YAHOO.env.getVersion</a> for the description of the version data structure.
+ * @property listener
+ * @type Function
+ * @static
+ * @default undefined
+ */
+
+/**
+ * Set to true if the library will be dynamically loaded after window.onload.
+ * Defaults to false 
+ * @property injecting
+ * @type boolean
+ * @static
+ * @default undefined
+ */
+
+/**
+ * Instructs the yuiloader component to dynamically load yui components and
+ * their dependencies.  See the yuiloader documentation for more information
+ * about dynamic loading
+ * @property load
+ * @static
+ * @default undefined
+ * @see yuiloader
+ */
+
 if (typeof YAHOO == "undefined") {
     /**
-     * The YAHOO global namespace object
+     * The YAHOO global namespace object.  If YAHOO is already defined, the
+     * existing YAHOO object will not be overwritten so that defined
+     * namespaces are preserved.
      * @class YAHOO
      * @static
      */
@@ -45,12 +87,12 @@ if (typeof YAHOO == "undefined") {
  */
 YAHOO.namespace = function() {
     var a=arguments, o=null, i, j, d;
-    for (i=0; i<a.length; ++i) {
+    for (i=0; i<a.length; i=i+1) {
         d=a[i].split(".");
         o=YAHOO;
 
         // YAHOO is implied, so it is ignored if it is included
-        for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; ++j) {
+        for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; j=j+1) {
             o[d[j]]=o[d[j]] || {};
             o=o[d[j]];
         }
@@ -60,7 +102,8 @@ YAHOO.namespace = function() {
 };
 
 /**
- * Uses YAHOO.widget.Logger to output a log message, if the widget is available.
+ * Uses YAHOO.widget.Logger to output a log message, if the widget is
+ * available.
  *
  * @method log
  * @static
@@ -81,63 +124,745 @@ YAHOO.log = function(msg, cat, src) {
 };
 
 /**
- * Utility to set up the prototype, constructor and superclass properties to
- * support an inheritance strategy that can chain constructors and methods.
- *
- * @method extend
+ * Registers a module with the YAHOO object
+ * @method register
  * @static
- * @param {Function} subc   the object to modify
- * @param {Function} superc the object to inherit
- * @param {Object} overrides  additional properties/methods to add to the
- *                              subclass prototype.  These will override the
- *                              matching items obtained from the superclass 
- *                              if present.
- */
-YAHOO.extend = function(subc, superc, overrides) {
-    var F = function() {};
-    F.prototype=superc.prototype;
-    subc.prototype=new F();
-    subc.prototype.constructor=subc;
-    subc.superclass=superc.prototype;
-    if (superc.prototype.constructor == Object.prototype.constructor) {
-        superc.prototype.constructor=superc;
+ * @param {String}   name    the name of the module (event, slider, etc)
+ * @param {Function} mainClass a reference to class in the module.  This
+ *                             class will be tagged with the version info
+ *                             so that it will be possible to identify the
+ *                             version that is in use when multiple versions
+ *                             have loaded
+ * @param {Object}   data      metadata object for the module.  Currently it
+ *                             is expected to contain a "version" property
+ *                             and a "build" property at minimum.
+ */
+YAHOO.register = function(name, mainClass, data) {
+    var mods = YAHOO.env.modules;
+    if (!mods[name]) {
+        mods[name] = { versions:[], builds:[] };
     }
-
-    if (overrides) {
-        for (var i in overrides) {
-            subc.prototype[i]=overrides[i];
-        }
+    var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;
+    m.name = name;
+    m.version = v;
+    m.build = b;
+    m.versions.push(v);
+    m.builds.push(b);
+    m.mainClass = mainClass;
+    // fire the module load listeners
+    for (var i=0;i<ls.length;i=i+1) {
+        ls[i](m);
     }
+    // label the main class
+    if (mainClass) {
+        mainClass.VERSION = v;
+        mainClass.BUILD = b;
+    } else {
+        YAHOO.log("mainClass is undefined for module " + name, "warn");
+    }
+};
+
+/**
+ * YAHOO.env is used to keep track of what is known about the YUI library and
+ * the browsing environment
+ * @class YAHOO.env
+ * @static
+ */
+YAHOO.env = YAHOO.env || {
+
+    /**
+     * Keeps the version info for all YUI modules that have reported themselves
+     * @property modules
+     * @type Object[]
+     */
+    modules: [],
+    
+    /**
+     * List of functions that should be executed every time a YUI module
+     * reports itself.
+     * @property listeners
+     * @type Function[]
+     */
+    listeners: []
 };
 
 /**
- * Applies all prototype properties in the supplier to the receiver if the
- * receiver does not have these properties yet.  Optionally, one or more
- * methods/properties can be specified (as additional parameters).  This
- * option will overwrite the property if receiver has it already.
+ * Returns the version data for the specified module:
+ *      <dl>
+ *      <dt>name:</dt>      <dd>The name of the module</dd>
+ *      <dt>version:</dt>   <dd>The version in use</dd>
+ *      <dt>build:</dt>     <dd>The build number in use</dd>
+ *      <dt>versions:</dt>  <dd>All versions that were registered</dd>
+ *      <dt>builds:</dt>    <dd>All builds that were registered.</dd>
+ *      <dt>mainClass:</dt> <dd>An object that was was stamped with the
+ *                 current version and build. If 
+ *                 mainClass.VERSION != version or mainClass.BUILD != build,
+ *                 multiple versions of pieces of the library have been
+ *                 loaded, potentially causing issues.</dd>
+ *       </dl>
  *
- * @method augment
+ * @method getVersion
  * @static
- * @param {Function} r  the object to receive the augmentation
- * @param {Function} s  the object that supplies the properties to augment
- * @param {String*}  arguments zero or more properties methods to augment the
- *                             receiver with.  If none specified, everything
- *                             in the supplier will be used unless it would
- *                             overwrite an existing property in the receiver
+ * @param {String}  name the name of the module (event, slider, etc)
+ * @return {Object} The version info
  */
-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]];
+YAHOO.env.getVersion = function(name) {
+    return YAHOO.env.modules[name] || null;
+};
+
+/**
+ * Do not fork for a browser if it can be avoided.  Use feature detection when
+ * you can.  Use the user agent as a last resort.  YAHOO.env.ua stores a version
+ * number for the browser engine, 0 otherwise.  This value may or may not map
+ * to the version number of the browser using the engine.  The value is 
+ * presented as a float so that it can easily be used for boolean evaluation 
+ * as well as for looking for a particular range of versions.  Because of this, 
+ * some of the granularity of the version info may be lost (e.g., Gecko 1.8.0.9 
+ * reports 1.8).
+ * @class YAHOO.env.ua
+ * @static
+ */
+YAHOO.env.ua = function() {
+    var o={
+
+        /**
+         * Internet Explorer version number or 0.  Example: 6
+         * @property ie
+         * @type float
+         */
+        ie:0,
+
+        /**
+         * Opera version number or 0.  Example: 9.2
+         * @property opera
+         * @type float
+         */
+        opera:0,
+
+        /**
+         * Gecko engine revision number.  Will evaluate to 1 if Gecko 
+         * is detected but the revision could not be found. Other browsers
+         * will be 0.  Example: 1.8
+         * <pre>
+         * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
+         * Firefox 1.5.0.9: 1.8.0.9 <-- Reports 1.8
+         * Firefox 2.0.0.3: 1.8.1.3 <-- Reports 1.8
+         * Firefox 3 alpha: 1.9a4   <-- Reports 1.9
+         * </pre>
+         * @property gecko
+         * @type float
+         */
+        gecko:0,
+
+        /**
+         * AppleWebKit version.  KHTML browsers that are not WebKit browsers 
+         * will evaluate to 1, other browsers 0.  Example: 418.9.1
+         * <pre>
+         * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the 
+         *                                   latest available for Mac OSX 10.3.
+         * Safari 2.0.2:         416     <-- hasOwnProperty introduced
+         * Safari 2.0.4:         418     <-- preventDefault fixed
+         * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
+         *                                   different versions of webkit
+         * Safari 2.0.4 (419.3): 419     <-- Current Safari release
+         * Webkit 212 nightly:   522+    <-- Safari 3.0 (with native SVG) should
+         *                                   be higher than this
+         *                                   
+         * </pre>
+         * http://developer.apple.com/internet/safari/uamatrix.html
+         * @property webkit
+         * @type float
+         */
+        webkit:0
+    };
+
+    var ua=navigator.userAgent, m;
+
+    // Modern KHTML browsers should qualify as Safari X-Grade
+    if ((/KHTML/).test(ua)) {
+        o.webkit=1;
+    }
+    // Modern WebKit browsers are at least X-Grade
+    m=ua.match(/AppleWebKit\/([^\s]*)/);
+    if (m&&m[1]) {
+        o.webkit=parseFloat(m[1]);
+    }
+
+    if (!o.webkit) { // not webkit
+        // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
+        m=ua.match(/Opera[\s\/]([^\s]*)/);
+        if (m&&m[1]) {
+            o.opera=parseFloat(m[1]);
+        } else { // not opera or webkit
+            m=ua.match(/MSIE\s([^;]*)/);
+            if (m&&m[1]) {
+                o.ie=parseFloat(m[1]);
+            } else { // not opera, webkit, or ie
+                m=ua.match(/Gecko\/([^\s]*)/);
+                if (m) {
+                    o.gecko=1; // Gecko detected, look for revision
+                    m=ua.match(/rv:([^\s\)]*)/);
+                    if (m&&m[1]) {
+                        o.gecko=parseFloat(m[1]);
+                    }
+                }
+            }
         }
-    } else {
-        for (p in sp) { 
-            if (!rp[p]) {
-                rp[p] = sp[p];
+    }
+    
+    return o;
+}();
+
+/*
+ * Initializes the global by creating the default namespaces and applying
+ * any new configuration information that is detected.  This is the setup
+ * for env.
+ * @method init
+ * @static
+ * @private
+ */
+(function() {
+    YAHOO.namespace("util", "widget", "example");
+    if (typeof YAHOO_config != "undefined") {
+        var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;
+        if (l) {
+            // if YAHOO is loaded multiple times we need to check to see if
+            // this is a new config object.  If it is, add the new component
+            // load listener to the stack
+            for (i=0;i<ls.length;i=i+1) {
+                if (ls[i]==l) {
+                    unique=false;
+                    break;
+                }
+            }
+            if (unique) {
+                ls.push(l);
+            }
+        }
+    }
+})();
+/**
+ * Provides the language utilites and extensions used by the library
+ * @class YAHOO.lang
+ */
+YAHOO.lang = {
+    /**
+     * Determines whether or not the provided object is an array.
+     * Testing typeof/instanceof/constructor of arrays across frame 
+     * boundaries isn't possible in Safari unless you have a reference
+     * to the other frame to test against its Array prototype.  To
+     * handle this case, we test well-known array properties instead.
+     * properties.
+     * @method isArray
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isArray: function(o) { 
+
+        if (o) {
+           var l = YAHOO.lang;
+           return l.isNumber(o.length) && l.isFunction(o.splice) && 
+                  !l.hasOwnProperty(o.length);
+        }
+        return false;
+    },
+
+    /**
+     * Determines whether or not the provided object is a boolean
+     * @method isBoolean
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isBoolean: function(o) {
+        return typeof o === 'boolean';
+    },
+    
+    /**
+     * Determines whether or not the provided object is a function
+     * @method isFunction
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isFunction: function(o) {
+        return typeof o === 'function';
+    },
+        
+    /**
+     * Determines whether or not the provided object is null
+     * @method isNull
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isNull: function(o) {
+        return o === null;
+    },
+        
+    /**
+     * Determines whether or not the provided object is a legal number
+     * @method isNumber
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isNumber: function(o) {
+        return typeof o === 'number' && isFinite(o);
+    },
+      
+    /**
+     * Determines whether or not the provided object is of type object
+     * or function
+     * @method isObject
+     * @param {any} o The object being testing
+     * @return Boolean
+     */  
+    isObject: function(o) {
+return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
+    },
+        
+    /**
+     * Determines whether or not the provided object is a string
+     * @method isString
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isString: function(o) {
+        return typeof o === 'string';
+    },
+        
+    /**
+     * Determines whether or not the provided object is undefined
+     * @method isUndefined
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    isUndefined: function(o) {
+        return typeof o === 'undefined';
+    },
+    
+    /**
+     * Determines whether or not the property was added
+     * to the object instance.  Returns false if the property is not present
+     * in the object, or was inherited from the prototype.
+     * This abstraction is provided to enable hasOwnProperty for Safari 1.3.x.
+     * There is a discrepancy between YAHOO.lang.hasOwnProperty and
+     * Object.prototype.hasOwnProperty when the property is a primitive added to
+     * both the instance AND prototype with the same value:
+     * <pre>
+     * var A = function() {};
+     * A.prototype.foo = 'foo';
+     * var a = new A();
+     * a.foo = 'foo';
+     * alert(a.hasOwnProperty('foo')); // true
+     * alert(YAHOO.lang.hasOwnProperty(a, 'foo')); // false when using fallback
+     * </pre>
+     * @method hasOwnProperty
+     * @param {any} o The object being testing
+     * @return Boolean
+     */
+    hasOwnProperty: function(o, prop) {
+        if (Object.prototype.hasOwnProperty) {
+            return o.hasOwnProperty(prop);
+        }
+        
+        return !YAHOO.lang.isUndefined(o[prop]) && 
+                o.constructor.prototype[prop] !== o[prop];
+    },
+    /**
+     * IE will not enumerate native functions in a derived object even if the
+     * function was overridden.  This is a workaround for specific functions 
+     * we care about on the Object prototype. 
+     * @property _IEEnumFix
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @static
+     * @private
+     */
+    _IEEnumFix: function(r, s) {
+        if (YAHOO.env.ua.ie) {
+            var add=["toString", "valueOf"];
+            for (i=0;i<add.length;i=i+1) {
+                var fname=add[i],f=s[fname];
+                if (YAHOO.lang.isFunction(f) && f!=Object.prototype[fname]) {
+                    r[fname]=f;
+                }
+            }
+        }
+    },
+       
+    /**
+     * Utility to set up the prototype, constructor and superclass properties to
+     * support an inheritance strategy that can chain constructors and methods.
+     * Static members will not be inherited.
+     *
+     * @method extend
+     * @static
+     * @param {Function} subc   the object to modify
+     * @param {Function} superc the object to inherit
+     * @param {Object} overrides  additional properties/methods to add to the
+     *                              subclass prototype.  These will override the
+     *                              matching items obtained from the superclass 
+     *                              if present.
+     */
+    extend: function(subc, superc, overrides) {
+        if (!superc||!subc) {
+            throw new Error("YAHOO.lang.extend failed, please check that " +
+                            "all dependencies are included.");
+        }
+        var F = function() {};
+        F.prototype=superc.prototype;
+        subc.prototype=new F();
+        subc.prototype.constructor=subc;
+        subc.superclass=superc.prototype;
+        if (superc.prototype.constructor == Object.prototype.constructor) {
+            superc.prototype.constructor=superc;
+        }
+    
+        if (overrides) {
+            for (var i in overrides) {
+                subc.prototype[i]=overrides[i];
+            }
+
+            YAHOO.lang._IEEnumFix(subc.prototype, overrides);
+        }
+    },
+   
+    /**
+     * Applies all properties in the supplier to the receiver if the
+     * receiver does not have these properties yet.  Optionally, one or 
+     * more methods/properties can be specified (as additional 
+     * parameters).  This option will overwrite the property if receiver 
+     * has it already.  If true is passed as the third parameter, all 
+     * properties will be applied and _will_ overwrite properties in 
+     * the receiver.
+     *
+     * @method augmentObject
+     * @static
+     * @since 2.3.0
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @param {String*|boolean}  arguments zero or more properties methods 
+     *        to augment the receiver with.  If none specified, everything
+     *        in the supplier will be used unless it would
+     *        overwrite an existing property in the receiver. If true
+     *        is specified as the third parameter, all properties will
+     *        be applied and will overwrite an existing property in
+     *        the receiver
+     */
+    augmentObject: function(r, s) {
+        if (!s||!r) {
+            throw new Error("Absorb failed, verify dependencies.");
+        }
+        var a=arguments, i, p, override=a[2];
+        if (override && override!==true) { // only absorb the specified properties
+            for (i=2; i<a.length; i=i+1) {
+                r[a[i]] = s[a[i]];
+            }
+        } else { // take everything, overwriting only if the third parameter is true
+            for (p in s) { 
+                if (override || !r[p]) {
+                    r[p] = s[p];
+                }
             }
+            
+            YAHOO.lang._IEEnumFix(r, s);
+        }
+    },
+    /**
+     * Same as YAHOO.lang.augmentObject, except it only applies prototype properties
+     * @see YAHOO.lang.augmentObject
+     * @method augmentProto
+     * @static
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @param {String*|boolean}  arguments zero or more properties methods 
+     *        to augment the receiver with.  If none specified, everything 
+     *        in the supplier will be used unless it would overwrite an existing 
+     *        property in the receiver.  if true is specified as the third 
+     *        parameter, all properties will be applied and will overwrite an 
+     *        existing property in the receiver
+     */
+    augmentProto: function(r, s) {
+        if (!s||!r) {
+            throw new Error("Augment failed, verify dependencies.");
+        }
+        //var a=[].concat(arguments);
+        var a=[r.prototype,s.prototype];
+        for (var i=2;i<arguments.length;i=i+1) {
+            a.push(arguments[i]);
+        }
+        YAHOO.lang.augmentObject.apply(this, a);
+    },
+
+      
+    /**
+     * Returns a simple string representation of the object or array.
+     * Other types of objects will be returned unprocessed.  Arrays
+     * are expected to be indexed.  Use object notation for
+     * associative arrays.
+     * @method dump
+     * @since 2.3.0
+     * @param o {Object} The object to dump
+     * @param d {int} How deep to recurse child objects, default 3
+     * @return {String} the dump result
+     */
+    dump: function(o, d) {
+        var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",
+            COMMA=', ', ARROW=' => ';
+
+        // Skip non-objects
+        // Skip dates because the std toString is what we want
+        // Skip HTMLElement-like objects because trying to dump 
+        // an element will cause an unhandled exception in FF 2.x
+        if (!l.isObject(o) || o instanceof Date || 
+            ("nodeType" in o && "tagName" in o)) {
+            return o;
+        } else if  (l.isFunction(o)) {
+            return FUN;
         }
+
+        // dig into child objects the depth specifed. Default 3
+        d = (l.isNumber(d)) ? d : 3;
+
+        // arrays [1, 2, 3]
+        if (l.isArray(o)) {
+            s.push("[");
+            for (i=0,len=o.length;i<len;i=i+1) {
+                if (l.isObject(o[i])) {
+                    s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                } else {
+                    s.push(o[i]);
+                }
+                s.push(COMMA);
+            }
+            if (s.length > 1) {
+                s.pop();
+            }
+            s.push("]");
+        // objects {k1 => v1, k2 => v2}
+        } else {
+            s.push("{");
+            for (i in o) {
+                if (l.hasOwnProperty(o, i)) {
+                    s.push(i + ARROW);
+                    if (l.isObject(o[i])) {
+                        s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                    } else {
+                        s.push(o[i]);
+                    }
+                    s.push(COMMA);
+                }
+            }
+            if (s.length > 1) {
+                s.pop();
+            }
+            s.push("}");
+        }
+
+        return s.join("");
+    },
+
+    /**
+     * Does variable substitution on a string. It scans through the string 
+     * looking for expressions enclosed in { } braces. If an expression 
+     * is found, it is used a key on the object.  If there is a space in
+     * the key, the first word is used for the key and the rest is provided
+     * to an optional function to be used to programatically determine the
+     * value (the extra information might be used for this decision). If 
+     * the value for the key in the object, or what is returned from the
+     * function has a string value, number value, or object value, it is 
+     * substituted for the bracket expression and it repeats.  If this
+     * value is an object, it uses the Object's toString() if this has
+     * been overridden, otherwise it does a shallow dump of the key/value
+     * pairs.
+     * @method substitute
+     * @since 2.3.0
+     * @param s {String} The string that will be modified.
+     * @param o {Object} An object containing the replacement values
+     * @param f {Function} An optional function that can be used to
+     *                     process each match.  It receives the key,
+     *                     value, and any extra metadata included with
+     *                     the key inside of the braces.
+     * @return {String} the substituted string
+     */
+    substitute: function (s, o, f) {
+        var i, j, k, key, v, meta, l=YAHOO.lang, saved=[], token, 
+            DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}';
+
+
+        for (;;) {
+            i = s.lastIndexOf(LBRACE);
+            if (i < 0) {
+                break;
+            }
+            j = s.indexOf(RBRACE, i);
+            if (i + 1 >= j) {
+                break;
+            }
+
+            //Extract key and meta info 
+            token = s.substring(i + 1, j);
+            key = token;
+            meta = null;
+            k = key.indexOf(SPACE);
+            if (k > -1) {
+                meta = key.substring(k + 1);
+                key = key.substring(0, k);
+            }
+
+            // lookup the value
+            v = o[key];
+
+            // if a substitution function was provided, execute it
+            if (f) {
+                v = f(key, v, meta);
+            }
+
+            if (l.isObject(v)) {
+                if (l.isArray(v)) {
+                    v = l.dump(v, parseInt(meta, 10));
+                } else {
+                    meta = meta || "";
+
+                    // look for the keyword 'dump', if found force obj dump
+                    var dump = meta.indexOf(DUMP);
+                    if (dump > -1) {
+                        meta = meta.substring(4);
+                    }
+
+                    // use the toString if it is not the Object toString 
+                    // and the 'dump' meta info was not found
+                    if (v.toString===Object.prototype.toString||dump>-1) {
+                        v = l.dump(v, parseInt(meta, 10));
+                    } else {
+                        v = v.toString();
+                    }
+                }
+            } else if (!l.isString(v) && !l.isNumber(v)) {
+                // This {block} has no replace string. Save it for later.
+                v = "~-" + saved.length + "-~";
+                saved[saved.length] = token;
+
+                // break;
+            }
+
+            s = s.substring(0, i) + v + s.substring(j + 1);
+
+
+        }
+
+        // restore saved {block}s
+        for (i=saved.length-1; i>=0; i=i-1) {
+            s = s.replace(new RegExp("~-" + i + "-~"), "{"  + saved[i] + "}", "g");
+        }
+
+        return s;
+    },
+
+
+    /**
+     * Returns a string without any leading or trailing whitespace.  If 
+     * the input is not a string, the input will be returned untouched.
+     * @method trim
+     * @since 2.3.0
+     * @param s {string} the string to trim
+     * @return {string} the trimmed string
+     */
+    trim: function(s){
+        try {
+            return s.replace(/^\s+|\s+$/g, "");
+        } catch(e) {
+            return s;
+        }
+    },
+
+    /**
+     * Returns a new object containing all of the properties of
+     * all the supplied objects.  The properties from later objects
+     * will overwrite those in earlier objects.
+     * @method merge
+     * @since 2.3.0
+     * @param arguments {Object*} the objects to merge
+     * @return the new merged object
+     */
+    merge: function() {
+        var o={}, a=arguments, i;
+        for (i=0; i<a.length; i=i+1) {
+            YAHOO.lang.augmentObject(o, a[i], true);
+            /*
+            for (var j in a[i]) {
+                o[j] = a[i][j];
+            }
+            */
+        }
+        return o;
+    },
+
+    /**
+     * A convenience method for detecting a legitimate non-null value.
+     * Returns false for null/undefined/NaN, true for other values, 
+     * including 0/false/''
+     * @method isValue
+     * @since 2.3.0
+     * @param o {any} the item to test
+     * @return {boolean} true if it is not null/undefined/NaN || false
+     */
+    isValue: function(o) {
+        // return (o || o === false || o === 0 || o === ''); // Infinity fails
+        var l = YAHOO.lang;
+return (l.isObject(o) || l.isString(o) || l.isNumber(o) || l.isBoolean(o));
     }
+
 };
 
-YAHOO.namespace("util", "widget", "example");
+/*
+ * An alias for <a href="YAHOO.lang.html">YAHOO.lang</a>
+ * @class YAHOO.util.Lang
+ */
+YAHOO.util.Lang = YAHOO.lang;
+/**
+ * Same as YAHOO.lang.augmentObject, except it only applies prototype 
+ * properties.  This is an alias for augmentProto.
+ * @see YAHOO.lang.augmentObject
+ * @method augment
+ * @static
+ * @param {Function} r  the object to receive the augmentation
+ * @param {Function} s  the object that supplies the properties to augment
+ * @param {String*|boolean}  arguments zero or more properties methods to 
+ *        augment the receiver with.  If none specified, everything
+ *        in the supplier will be used unless it would
+ *        overwrite an existing property in the receiver.  if true
+ *        is specified as the third parameter, all properties will
+ *        be applied and will overwrite an existing property in
+ *        the receiver
+ */
+YAHOO.lang.augment = YAHOO.lang.augmentProto;
+
+/**
+ * An alias for <a href="YAHOO.lang.html#augment">YAHOO.lang.augment</a>
+ * @for YAHOO
+ * @method augment
+ * @static
+ * @param {Function} r  the object to receive the augmentation
+ * @param {Function} s  the object that supplies the properties to augment
+ * @param {String*}  arguments zero or more properties methods to 
+ *        augment the receiver with.  If none specified, everything
+ *        in the supplier will be used unless it would
+ *        overwrite an existing property in the receiver
+ */
+YAHOO.augment = YAHOO.lang.augmentProto;
+       
+/**
+ * An alias for <a href="YAHOO.lang.html#extend">YAHOO.lang.extend</a>
+ * @method extend
+ * @static
+ * @param {Function} subc   the object to modify
+ * @param {Function} superc the object to inherit
+ * @param {Object} overrides  additional properties/methods to add to the
+ *        subclass prototype.  These will override the
+ *        matching items obtained from the superclass if present.
+ */
+YAHOO.extend = YAHOO.lang.extend;
+
+YAHOO.register("yahoo", YAHOO, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/yuiloader/README b/lib/yui/yuiloader/README
new file mode 100755 (executable)
index 0000000..ffc051f
--- /dev/null
@@ -0,0 +1,4 @@
+YUILoader Utility - Release Notes
+
+2.3.0
+   * Initial release
diff --git a/lib/yui/yuiloader/yuiloader-beta-debug.js b/lib/yui/yuiloader/yuiloader-beta-debug.js
new file mode 100755 (executable)
index 0000000..3ebf3fb
--- /dev/null
@@ -0,0 +1,1408 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * Provides dynamic loading for the YUI library.  It includes the dependency
+ * info for the library, and will automatically pull in dependencies for
+ * the modules requested.  It supports rollup files (such as utilities.js
+ * and yahoo-dom-event.js), and will automatically use these when
+ * appropriate in order to minimize the number of http connections
+ * required to load all of the dependencies.
+ * 
+ * @module yuiloader
+ * @namespace YAHOO.util
+ */
+
+/**
+ * YUILoader provides dynamic loading for YUI.
+ * @class YAHOO.util.YUILoader
+ * @todo
+ *      version management, automatic sandboxing
+ */
+(function() {
+    // Define YAHOO_config if it doesn't exist.  Only relevant if YAHOO is not
+    // already on the page
+    if (typeof YAHOO_config === "undefined") {
+        YAHOO_config = {};
+    }
+
+    // YUI is locally scoped, only pieces of it will be referenced in YAHOO
+    // after YAHOO has been loaded.
+    var YUI = {
+
+        /*
+         * The library metadata for the current release  The is the default
+         * value for YAHOO.util.YUILoader.moduleInfo
+         * @property YUIInfo
+         * @static
+         */
+        info: {
+
+    'base': 'http://yui.yahooapis.com/2.3.0/build/',
+
+    'skin': {
+        'defaultSkin': 'sam',
+        'base': 'assets/skins/',
+        'path': 'skin.css',
+        'rollup': 3
+    },
+
+    'moduleInfo': {
+
+        'animation': {
+            'type': 'js',
+            'path': 'animation/animation-min.js',
+            'requires': ['dom', 'event']
+        },
+
+        'autocomplete': {
+            'type': 'js',
+            'path': 'autocomplete/autocomplete-min.js',
+            'requires': ['dom', 'event'],
+            'optional': ['connection', 'animation'],
+            'skinnable': true
+        },
+
+        'button': {
+            'type': 'js',
+            'path': 'button/button-beta-min.js',
+            'requires': ['element'],
+            'optional': ['menu'],
+            'skinnable': true
+        },
+
+        'calendar': {
+            'type': 'js',
+            'path': 'calendar/calendar-min.js',
+            'requires': ['event', 'dom'],
+            'skinnable': true
+        },
+
+        'colorpicker': {
+            'type': 'js',
+            'path': 'colorpicker/colorpicker-beta-min.js',
+            'requires': ['slider', 'element'],
+            'optional': ['animation'],
+            'skinnable': true
+        },
+
+        'connection': {
+            'type': 'js',
+            'path': 'connection/connection-min.js',
+            'requires': ['event']
+        },
+
+        'container': {
+            'type': 'js',
+            'path': 'container/container-min.js',
+            'requires': ['dom', 'event'],
+            // button is optional, but creates a circular dep
+            //'optional': ['dragdrop', 'animation', 'button'],
+            'optional': ['dragdrop', 'animation'],
+            'supersedes': ['containercore'],
+            'skinnable': true
+        },
+
+        'containercore': {
+            'type': 'js',
+            'path': 'container/container_core-min.js',
+            'requires': ['dom', 'event']
+        },
+
+        'datasource': {
+            'type': 'js',
+            'path': 'datasource/datasource-beta-min.js',
+            'requires': ['event'],
+            'optional': ['connection']
+        },
+
+        'datatable': {
+            'type': 'js',
+            'path': 'datatable/datatable-beta-min.js',
+            'requires': ['element', 'datasource'],
+            'optional': ['calendar', 'dragdrop'],
+            'skinnable': true
+        },
+
+        'dom': {
+            'type': 'js',
+            'path': 'dom/dom-min.js',
+            'requires': ['yahoo']
+        },
+
+        'dragdrop': {
+            'type': 'js',
+            'path': 'dragdrop/dragdrop-min.js',
+            'requires': ['dom', 'event']
+        },
+
+        'editor': {
+            'type': 'js',
+            'path': 'editor/editor-beta-min.js',
+            'requires': ['menu', 'container', 'element', 'button'],
+            'optional': ['animation', 'dragdrop'],
+            'skinnable': true
+        },
+
+        'element': {
+            'type': 'js',
+            'path': 'element/element-beta-min.js',
+            'requires': ['dom', 'event']
+        },
+
+        'event': {
+            'type': 'js',
+            'path': 'event/event-min.js',
+            'requires': ['yahoo']
+        },
+
+        'fonts': {
+            'type': 'css',
+            'path': 'fonts/fonts-min.css'
+        },
+
+        'grids': {
+            'type': 'css',
+            'path': 'grids/grids-min.css',
+            'requires': ['fonts'],
+            'optional': ['reset']
+        },
+
+        'history': {
+            'type': 'js',
+            'path': 'history/history-beta-min.js',
+            'requires': ['event']
+        },
+
+        'imageloader': {
+            'type': 'js',
+            'path': 'imageloader/imageloader-experimental-min.js',
+            'requires': ['event', 'dom']
+        },
+
+        'logger': {
+            'type': 'js',
+            'path': 'logger/logger-min.js',
+            'requires': ['event', 'dom'],
+            'optional': ['dragdrop'],
+            'skinnable': true
+        },
+
+        'menu': {
+            'type': 'js',
+            'path': 'menu/menu-min.js',
+            'requires': ['containercore'],
+            'skinnable': true
+        },
+
+        'reset': {
+            'type': 'css',
+            'path': 'reset/reset-min.css'
+        },
+
+        'reset-fonts-grids': {
+            'type': 'css',
+            'path': 'reset-fonts-grids/reset-fonts-grids.css',
+            'supersedes': ['reset', 'fonts', 'grids']
+        },
+
+        'slider': {
+            'type': 'js',
+            'path': 'slider/slider-min.js',
+            'requires': ['dragdrop'],
+            'optional': ['animation']
+        },
+
+        'tabview': {
+            'type': 'js',
+            'path': 'tabview/tabview-min.js',
+            'requires': ['element'],
+            'optional': ['connection'],
+            'skinnable': true
+        },
+
+        'treeview': {
+            'type': 'js',
+            'path': 'treeview/treeview-min.js',
+            'requires': ['event'],
+            'skinnable': true
+        },
+
+        'utilities': {
+            'type': 'js',
+            'path': 'utilities/utilities.js',
+            'supersedes': ['yahoo', 'event', 'dragdrop', 'animation', 'dom', 'connection', 'element', 'yahoo-dom-event'],
+            'rollup': 6
+        },
+
+        'yahoo': {
+            'type': 'js',
+            'path': 'yahoo/yahoo-min.js'
+        },
+
+        'yahoo-dom-event': {
+            'type': 'js',
+            'path': 'yahoo-dom-event/yahoo-dom-event.js',
+            'supersedes': ['yahoo', 'event', 'dom'],
+            'rollup': 3
+        },
+
+        'yuiloader': {
+            'type': 'js',
+            'path': 'yuiloader/yuiloader-beta-min.js'
+        },
+
+        'yuitest': {
+            'type': 'js',
+            'path': 'yuitest/yuitest-beta-min.js',
+            'requires': ['logger'],
+            'skinnable': true
+        }
+    }
+}
+ , 
+
+        // Simple utils since we can't count on YAHOO.lang being available.
+        ObjectUtil: {
+            appendArray: function(o, a) {
+                if (a) {
+                    for (var i=0; i<a.length; i=i+1) {
+                        o[a[i]] = true;
+                    }
+                }
+            },
+
+            clone: function(o) {
+                var c = {};
+                for (var i in o) {
+                    c[i] = o[i];
+                }
+                return c;
+            },
+
+            merge: function() {
+                var o={}, a=arguments, i, j;
+                for (i=0; i<a.length; i=i+1) {
+                    
+                    for (j in a[i]) {
+                        o[j] = a[i][j];
+                    }
+                }
+                return o;
+            },
+
+            keys: function(o, ordered) {
+                var a=[], i;
+                for (i in o) {
+                    a.push(i);
+                }
+
+                return a;
+            }
+        },
+
+        ArrayUtil: {
+
+            appendArray: function(a1, a2) {
+                Array.prototype.push.apply(a1, a2);
+                /*
+                for (var i=0; i<a2.length; i=i+1) {
+                    a1.push(a2[i]);
+                }
+                */
+            },
+
+            indexOf: function(a, val) {
+                for (var i=0; i<a.length; i=i+1) {
+                    if (a[i] === val) {
+                        return i;
+                    }
+                }
+
+                return -1;
+            },
+
+            toObject: function(a) {
+                var o = {};
+                for (var i=0; i<a.length; i=i+1) {
+                    o[a[i]] = true;
+                }
+
+                return o;
+            },
+
+            /*
+             * Returns a unique array.  Does not maintain order, which is fine
+             * for this application, and performs better than it would if it
+             * did.
+             */
+            uniq: function(a) {
+                return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));
+            }
+        },
+
+
+        // loader instances
+        loaders: [],
+
+        finishInit: function(yahooref) {
+
+            // YAHOO has been loaded either in this window or passed 
+            // from the sandbox routine.  Set up local references 
+            // to the loader and module metadata in the YAHOO object
+            // in question so additional modules can be loaded. 
+
+            yahooref = yahooref || YAHOO;
+
+            yahooref.env.YUIInfo=YUI.info;
+            yahooref.util.YUILoader=YUI.YUILoader;
+
+        },
+
+        /*
+         * Global handler for the module loaded event exposed by
+         * YAHOO
+         */
+        onModuleLoaded: function(minfo) {
+
+            var mname = minfo.name, m;
+
+            for (var i=0; i<YUI.loaders.length; i=i+1) {
+                YUI.loaders[i].loadNext(mname);
+            }
+
+            //console.log(YAHOO.lang.dump(minfo));
+
+        },
+
+        /*
+         * Sets up the module metadata
+         */
+        init: function() {
+
+            var c = YAHOO_config, o = c.load, 
+                y_loaded = (typeof YAHOO !== "undefined" && YAHOO.env);
+
+
+            // add our listener to the existing YAHOO.env.listeners stack
+            if (y_loaded) {
+
+                YAHOO.env.listeners.push(YUI.onModuleLoaded);
+
+            // define a listener in YAHOO_config that YAHOO will pick up
+            // when it is loaded.
+            } else {
+
+                if (c.listener) {
+                    YUI.cachedCallback = c.listener;
+                }
+
+                c.listener = function(minfo) {
+                    YUI.onModuleLoaded(minfo);
+                    if (YUI.cachedCallback) {
+                        YUI.cachedCallback(minfo);
+                    }
+                };
+            }
+
+            // Fetch the required modules immediately if specified
+            // in YAHOO_config.  Otherwise detect YAHOO and fetch
+            // it if it doesn't exist so we have a place to put
+            // the loader.  The problem with this is that it will
+            // prevent rollups from working
+            if (o || !y_loaded) {
+
+                o = o || {};
+
+                var loader = new YUI.YUILoader(o);
+                loader.onLoadComplete = function() {
+
+                        YUI.finishInit();
+
+                        if (o.onLoadComplete) {
+
+                            loader._pushEvents();
+                            o.onLoadComplete(loader);
+                        }
+
+                        
+                    };
+
+                // If no load was requested, we must load YAHOO
+                // so we have a place to put the loader
+                if (!y_loaded) {
+                    loader.require("yahoo");
+                }
+
+                loader.insert(null, o);
+            } else {
+                YUI.finishInit();
+            }
+        }
+
+    };
+
+    YUI.YUILoader = function(o) {
+
+        // Inform the library that it is being injected
+        YAHOO_config.injecting = true;
+
+        o = o || {};
+
+        /**
+         * Internal callback to handle multiple internal insert() calls
+         * so that css is inserted prior to js
+         * @property _internalCallback
+         * @private
+         */
+        this._internalCallback = null;
+
+        /**
+         * Callback that will be executed when the loader is finished
+         * with an insert
+         * @method onLoadComplete
+         * @type function
+         */
+        this.onLoadComplete = null;
+
+        /**
+         * The base directory.
+         * @property base
+         * @type string
+         * @default build
+         */
+        this.base = ("base" in o) ? o.base : YUI.info.base;
+
+        /**
+         * Should we allow rollups
+         * @property allowRollup
+         * @type boolean
+         * @default true
+         */
+        this.allowRollup = ("allowRollup" in o) ? o.allowRollup : true;
+
+        /**
+         * Filter to apply to result url
+         * @property filter
+         * @type string|object
+         */
+        this.filter = o.filter;
+
+        /**
+         * Create a sandbox rather than inserting into lib into.
+         * the current context.  Not currently supported
+         * property sandbox
+         * @type boolean
+         * @default false
+         */
+        this.sandbox = o.sandbox;
+
+        /**
+         * The list of requested modules
+         * @property required
+         * @type {string: boolean}
+         */
+        this.required = {};
+
+        /**
+         * The library metadata
+         * @property moduleInfo
+         */
+        this.moduleInfo = o.moduleInfo || YUI.info.moduleInfo;
+
+        /**
+         * List of rollup files found in the library metadata
+         * @property rollups
+         */
+        this.rollups = null;
+
+        /**
+         * Whether or not to load optional dependencies for 
+         * the requested modules
+         * @property loadOptional
+         * @type boolean
+         * @default false
+         */
+        this.loadOptional = o.loadOptional || false;
+
+        /**
+         * All of the derived dependencies in sorted order, which
+         * will be populated when either calculate() or insert()
+         * is called
+         * @property sorted
+         * @type string[]
+         */
+        this.sorted = [];
+
+        /**
+         * Set when beginning to compute the dependency tree. 
+         * Composed of what YAHOO reports to be loaded combined
+         * with what has been loaded by the tool
+         * @propery loaded
+         * @type {string: boolean}
+         */
+        this.loaded = {};
+
+        /**
+         * Flag to indicate the dependency tree needs to be recomputed
+         * if insert is called again.
+         * @property dirty
+         * @type boolean
+         * @default true
+         */
+        this.dirty = true;
+
+        /**
+         * List of modules inserted by the utility
+         * @property inserted
+         * @type {string: boolean}
+         */
+        this.inserted = {};
+
+
+        /**
+         * Provides the information used to skin the skinnable components.
+         * The following skin definition would result in 'skin1' and 'skin2'
+         * being loaded for calendar (if calendar was requested), and
+         * 'sam' for all other skinnable components:
+         *
+         *   <code>
+         *   skin: {
+         *
+         *      // The default skin, which is automatically applied if not
+         *      // overriden by a component-specific skin definition.
+         *      // Change this in to apply a different skin globally
+         *      defaultSkin: 'sam', 
+         *
+         *      // This is combined with the loader base property to get
+         *      // the default root directory for a skin. ex:
+         *      // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
+         *      base: 'assets/skins/',
+         *
+         *      // The name of the rollup css file for the skin
+         *      path: 'skin.css',
+         *
+         *      // The number of skinnable components requested that are
+         *      // required before using the rollup file rather than the
+         *      // individual component css files
+         *      rollup: 3,
+         *
+         *      // Any component-specific overrides can be specified here,
+         *      // making it possible to load different skins for different
+         *      // components.  It is possible to load more than one skin
+         *      // for a given component as well.
+         *      overrides: {
+         *          calendar: ['skin1', 'skin2']
+         *      }
+         *   }
+         *   </code>
+         *   @property skin
+         */
+        this.skin = o.skin || YUI.ObjectUtil.clone(YUI.info.skin); 
+
+
+        if (o.require) {
+            this.require(o.require);
+        }
+
+        YUI.loaders.push(this);
+    };
+
+    YUI.YUILoader.prototype = {
+
+        FILTERS: {
+            RAW: { 
+                'searchExp': "-min\\.js", 
+                'replaceStr': ".js"
+            },
+            DEBUG: { 
+                'searchExp': "-min\\.js", 
+                'replaceStr': "-debug.js"
+            }
+        },
+
+        SKIN_PREFIX: "skin-",
+
+        /** Add a new module to the component metadata.  The javascript 
+         * component must also use YAHOO.register to notify the loader 
+         * when it has been loaded, or a verifier function must be
+         * provided
+         * <dl>
+         *     <dt>name:</dt>       <dd>required, the component name</dd>
+         *     <dt>type:</dt>       <dd>required, the component type (js or css)</dd>
+         *     <dt>path:</dt>       <dd>required, the path to the script from "base"</dd>
+         *     <dt>requires:</dt>   <dd>the modules required by this component</dd>
+         *     <dt>optional:</dt>   <dd>the optional modules for this component</dd>
+         *     <dt>supersedes:</dt> <dd>the modules this component replaces</dd>
+         *     <dt>rollup:</dt>     <dd>the number of superseded modules required for automatic rollup</dd>
+         *     <dt>verifier:</dt>   <dd>a function that is executed to determine when the module is fully loaded</dd>
+         *     <dt>fullpath:</dt>   <dd>If fullpath is specified, this is used instead of the configured base + path</dd>
+         *     <dt>skinnable:</dt>  <dd>flag to determine if skin assets should automatically be pulled in</dd>
+         * </dl>
+         * @method addModule
+         * @param o An object containing the module data
+         * @return {boolean} true if the module was added, false if 
+         * the object passed in did not provide all required attributes
+         */
+        addModule: function(o) {
+
+            if (!o || !o.name || !o.type || (!o.path && !o.fullpath)) {
+                return false;
+            }
+
+            this.moduleInfo[o.name] = o;
+            this.dirty = true;
+
+            return true;
+        },
+
+        /**
+         * Add a requirement for one or more module
+         * @method require
+         * @param what {string[] | string*} the modules to load
+         */
+        require: function(what) {
+            var a = (typeof what === "string") ? arguments : what;
+
+            this.dirty = true;
+
+            for (var i=0; i<a.length; i=i+1) {
+                this.required[a[i]] = true;
+                var s = this.parseSkin(a[i]);
+                if (s) {
+                    this._addSkin(s.skin, s.module);
+                }
+            }
+            YUI.ObjectUtil.appendArray(this.required, a);
+        },
+
+
+        /**
+         * Adds the skin def to the module info
+         * @method _addSkin
+         * @private
+         */
+        _addSkin: function(skin, mod) {
+
+            // Add a module definition for the skin rollup css
+            var name = this.formatSkin(skin);
+            if (!this.moduleInfo[name]) {
+                this.addModule({
+                    'name': name,
+                    'type': 'css',
+                    'path': this.skin.base + skin + "/" + this.skin.path,
+                    //'supersedes': '*',
+                    'rollup': this.skin.rollup
+                });
+            }
+
+            // Add a module definition for the module-specific skin css
+            if (mod) {
+                name = this.formatSkin(skin, mod);
+                if (!this.moduleInfo[name]) {
+                    this.addModule({
+                        'name': name,
+                        'type': 'css',
+                        //'path': this.skin.base + skin + "/" + mod + ".css"
+                        'path': mod + '/' + this.skin.base + skin + "/" + mod + ".css"
+                    });
+                }
+            }
+        },
+
+        /**
+         * Returns an object containing properties for all modules required
+         * in order to load the requested module
+         * @method getRequires
+         * @param mod The module definition from moduleInfo
+         */
+        getRequires: function(mod) {
+            if (!this.dirty && mod.expanded) {
+                return mod.expanded;
+            }
+
+            mod.requires=mod.requires || [];
+            var i, d=[], r=mod.requires, o=mod.optional, s=mod.supersedes, info=this.moduleInfo;
+            for (i=0; i<r.length; i=i+1) {
+                d.push(r[i]);
+                YUI.ArrayUtil.appendArray(d, this.getRequires(info[r[i]]));
+            }
+
+            if (o && this.loadOptional) {
+                for (i=0; i<o.length; i=i+1) {
+                    d.push(o[i]);
+                    YUI.ArrayUtil.appendArray(d, this.getRequires(info[o[i]]));
+                }
+            }
+
+            mod.expanded = YUI.ArrayUtil.uniq(d);
+
+            return mod.expanded;
+        },
+
+        /**
+         * Returns an object literal of the modules the supplied module satisfies
+         * @method getProvides
+         * @param mod The module definition from moduleInfo
+         * @return what this module provides
+         */
+        getProvides: function(name) {
+            var mod = this.moduleInfo[name];
+
+            var o = {};
+            o[name] = true;
+            s = mod && mod.supersedes;
+
+            YUI.ObjectUtil.appendArray(o, s);
+
+            // console.log(this.sorted + ", " + name + " provides " + YUI.ObjectUtil.keys(o));
+
+            return o;
+        },
+
+        /**
+         * Calculates the dependency tree, the result is stored in the sorted 
+         * property
+         * @method calculate
+         * @param o optional options object
+         */
+        calculate: function(o) {
+            if (this.dirty) {
+
+                this._setup(o);
+                this._explode();
+                this._skin();
+                if (this.allowRollup) {
+                    this._rollup();
+                }
+                this._reduce();
+                this._sort();
+
+                this.dirty = false;
+            }
+        },
+
+        /**
+         * Investigates the current YUI configuration on the page.  By default,
+         * modules already detected will not be loaded again unless a force
+         * option is encountered.  Called by calculate()
+         * @method _setup
+         * @param o optional options object
+         * @private
+         */
+        _setup: function(o) {
+
+            o = o || {};
+            this.loaded = YUI.ObjectUtil.clone(this.inserted); 
+            
+            if (!this.sandbox && typeof YAHOO !== "undefined" && YAHOO.env) {
+                this.loaded = YUI.ObjectUtil.merge(this.loaded, YAHOO.env.modules);
+            }
+
+            // add the ignore list to the list of loaded packages
+            if (o.ignore) {
+                YUI.ObjectUtil.appendArray(this.loaded, o.ignore);
+            }
+
+            // remove modules on the force list from the loaded list
+            if (o.force) {
+                for (var i=0; i<o.force.length; i=i+1) {
+                    if (o.force[i] in this.loaded) {
+                        delete this.loaded[o.force[i]];
+                    }
+                }
+            }
+        },
+        
+
+        /**
+         * Inspects the required modules list looking for additional 
+         * dependencies.  Expands the required list to include all 
+         * required modules.  Called by calculate()
+         * @method _explode
+         * @private
+         */
+        _explode: function() {
+
+            var r=this.required, i, mod;
+
+            for (i in r) {
+                mod = this.moduleInfo[i];
+                if (mod) {
+
+                    var req = this.getRequires(mod);
+
+                    if (req) {
+                        YUI.ObjectUtil.appendArray(r, req);
+                    }
+                }
+            }
+        },
+
+        /**
+         * Sets up the requirements for the skin assets if any of the
+         * requested modules are skinnable
+         * @method _skin
+         * @private
+         */
+        _skin: function() {
+
+            var r=this.required, i, mod;
+
+            for (i in r) {
+                mod = this.moduleInfo[i];
+                if (mod && mod.skinnable) {
+                    var o=this.skin.override, j;
+                    if (o && o[i]) {
+                        for (j=0; j<o[i].length; j=j+1) {
+                            this.require(this.formatSkin(o[i][j], i));
+                        }
+                    } else {
+                        this.require(this.formatSkin(this.skin.defaultSkin, i));
+                    }
+                }
+            }
+        },
+
+        /**
+         * Returns the skin module name for the specified skin name.  If a
+         * module name is supplied, the returned skin module name is 
+         * specific to the module passed in.
+         * @method formatSkin
+         * @param skin {string} the name of the skin
+         * @param mod {string} optional: the name of a module to skin
+         * @return {string} the full skin module name
+         */
+        formatSkin: function(skin, mod) {
+            var s = this.SKIN_PREFIX + skin;
+            if (mod) {
+                s = s + "-" + mod;
+            }
+
+            return s;
+        },
+        
+        /**
+         * Reverses <code>formatSkin</code>, providing the skin name and
+         * module name if the string matches the pattern for skins.
+         * @method parseSkin
+         * @param mod {string} the module name to parse
+         * @return {skin: string, module: string} the parsed skin name 
+         * and module name, or null if the supplied string does not match
+         * the skin pattern
+         */
+        parseSkin: function(mod) {
+            
+            if (mod.indexOf(this.SKIN_PREFIX) === 0) {
+                var a = mod.split("-");
+                return {skin: a[1], module: a[2]};
+            } 
+
+            return null;
+        },
+
+        /**
+         * Look for rollup packages to determine if all of the modules a
+         * rollup supersedes are required.  If so, include the rollup to
+         * help reduce the total number of connections required.  Called
+         * by calculate()
+         * @method _rollup
+         * @private
+         */
+        _rollup: function() {
+            var i, j, m, s, rollups={}, r=this.required, roll;
+
+            // find and cache rollup modules
+            if (this.dirty || !this.rollups) {
+                for (i in this.moduleInfo) {
+                    m = this.moduleInfo[i];
+                    //if (m && m.rollup && m.supersedes) {
+                    if (m && m.rollup) {
+                        rollups[i] = m;
+                    }
+                }
+
+                this.rollups = rollups;
+            }
+
+            // make as many passes as needed to pick up rollup rollups
+            for (;;) {
+                var rolled = false;
+
+                // go through the rollup candidates
+                for (i in rollups) { 
+
+                    // there can be only one
+                    if (!r[i] && !this.loaded[i]) {
+                        m =this.moduleInfo[i]; s = m.supersedes; roll=true;
+
+                        if (!m.rollup) {
+                            continue;
+                        }
+
+
+                        var skin = this.parseSkin(i), c = 0;
+                        if (skin) {
+
+                            for (j in r) {
+                                if (i !== j && this.parseSkin(j)) {
+                                    c++;
+                                    roll = (c >= m.rollup);
+                                    if (roll) {
+                                        break;
+                                    }
+                                }
+                            }
+
+
+                        } else {
+
+                            // require all modules to trigger a rollup (using the 
+                            // threshold value has not proved worthwhile)
+                            for (j=0;j<s.length;j=j+1) {
+
+                                // if the superseded module is loaded, we can't load the rollup
+                                if (this.loaded[s[j]]) {
+                                    roll = false;
+                                    break;
+                                // increment the counter if this module is required.  if we are
+                                // beyond the rollup threshold, we will use the rollup module
+                                } else if (r[s[j]]) {
+                                    c++;
+                                    roll = (c >= m.rollup);
+                                    if (roll) {
+                                        break;
+                                    }
+                                }
+                            }
+                        }
+
+                        if (roll) {
+                            // add the rollup
+                            r[i] = true;
+                            rolled = true;
+
+                            // expand the rollup's dependencies
+                            this.getRequires(m);
+                        }
+                    }
+                }
+
+                // if we made it here w/o rolling up something, we are done
+                if (!rolled) {
+                    break;
+                }
+            }
+        },
+
+        /**
+         * Remove superceded modules and loaded modules.  Called by
+         * calculate() after we have the mega list of all dependencies
+         * @method _reduce
+         * @private
+         */
+        _reduce: function() {
+
+            var i, j, s, m, r=this.required;
+            for (i in r) {
+
+                // remove if already loaded
+                if (i in this.loaded) { 
+                    delete r[i];
+
+                // remove anything this module supersedes
+                } else {
+
+                    var skinDef = this.parseSkin(i);
+
+                    if (skinDef) {
+                        //console.log("skin found in reduce: " + skinDef.skin + ", " + skinDef.module);
+                        // the skin rollup will not have a module name
+                        if (!skinDef.module) {
+                            var skin_pre = this.SKIN_PREFIX + skinDef.skin;
+                            //console.log("skin_pre: " + skin_pre);
+                            for (j in r) {
+                                if (j !== i && j.indexOf(skin_pre) > -1) {
+                                    //console.log ("removing component skin: " + j);
+                                    delete r[j];
+                                }
+                            }
+                        }
+                    } else {
+
+                         m = this.moduleInfo[i];
+                         s = m && m.supersedes;
+                         if (s) {
+                             for (j=0;j<s.length;j=j+1) {
+                                 if (s[j] in r) {
+                                     delete r[s[j]];
+                                 }
+                             }
+                         }
+                    }
+                }
+            }
+        },
+        
+        /**
+         * Sorts the dependency tree.  The last step of calculate()
+         * @method _sort
+         * @private
+         */
+        _sort: function() {
+            // create an indexed list
+            var s=[], info=this.moduleInfo, loaded=this.loaded;
+
+            // returns true if b is not loaded, and is required
+            // directly or by means of modules it supersedes.
+            var requires = function(aa, bb) {
+                if (loaded[bb]) {
+                    return false;
+                }
+
+                var ii, mm=info[aa], rr=mm && mm.expanded;
+
+                if (rr && YUI.ArrayUtil.indexOf(rr, bb) > -1) {
+                    return true;
+                }
+
+                var ss=info[bb] && info[bb].supersedes;
+                if (ss) {
+                    for (ii=0; ii<ss.length; ii=i+1) {
+                        if (requires(aa, ss[ii])) {
+                            return true;
+                        }
+                    }
+                }
+
+                return false;
+            };
+
+            // get the required items out of the obj into an array so we
+            // can sort
+            for (var i in this.required) {
+                s.push(i);
+            }
+
+            // pointer to the first unsorted item
+            var p=0; 
+
+            // keep going until we make a pass without moving anything
+            for (;;) {
+               
+                var l=s.length, a, b, j, k, moved=false;
+
+                // start the loop after items that are already sorted
+                for (j=p; j<l; j=j+1) {
+
+                    // check the next module on the list to see if its
+                    // dependencies have been met
+                    a = s[j];
+
+                    // check everything below current item and move if we
+                    // find a requirement for the current item
+                    for (k=j+1; k<l; k=k+1) {
+                        if (requires(a, s[k])) {
+
+                            // extract the dependency so we can move it up
+                            b = s.splice(k, 1);
+
+                            // insert the dependency above the item that 
+                            // requires it
+                            s.splice(j, 0, b[0]);
+
+                            moved = true;
+                            break;
+                        }
+                    }
+
+                    // jump out of loop if we moved something
+                    if (moved) {
+                        break;
+                    // this item is sorted, move our pointer and keep going
+                    } else {
+                        p = p + 1;
+                    }
+                }
+
+                // when we make it here and moved is false, we are 
+                // finished sorting
+                if (!moved) {
+                    break;
+                }
+
+            }
+
+            this.sorted = s;
+        },
+
+        /**
+         * inserts the requested modules and their dependencies.  
+         * <code>type</code> can be "js" or "css".  Both script and 
+         * css are inserted if type is not provided.
+         * @method insert
+         * @param callback {Function} a function to execute when the load
+         * is complete.
+         * @param o optional options object
+         * @param type {string} the type of dependency to insert
+         */
+        insert: function(callback, o, type) {
+
+            //if (!this.onLoadComplete) {
+                //this.onLoadComplete = callback;
+            //}
+
+            if (!type) {
+                var self = this;
+                this._internalCallback = function() {
+                            self._internalCallback = null;
+                            self.insert(callback, o, "js");
+                        };
+                this.insert(null, o, "css");
+                return;
+            }
+
+            o = o || {};
+
+            // store the callback for when we are done
+            this.onLoadComplete = callback || this.onLoadComplete;
+
+            // store the optional filter
+            var f = o && o.filter || null;
+
+            if (typeof f === "string") {
+                f = f.toUpperCase();
+
+                // the logger must be available in order to use the debug
+                // versions of the library
+                if (f === "DEBUG") {
+                    this.require("logger");
+                }
+            }
+
+            this.filter = this.FILTERS[f] || f || this.FILTERS[this.filter] || this.filter;
+
+            // store the options... not currently in use
+            this.insertOptions = o;
+
+            // build the dependency list
+            this.calculate(o);
+
+            // set a flag to indicate the load has started
+            this.loading = true;
+
+            // keep the loadType (js, css or undefined) cached
+            this.loadType = type;
+
+            // start the load
+            this.loadNext();
+
+        },
+
+        /**
+         * Executed every time a module is loaded, and if we are in a load
+         * cycle, we attempt to load the next script.  Public so that it
+         * is possible to call this if using a method other than
+         * YAHOO.register to determine when scripts are fully loaded
+         * @method loadNext
+         * @param mname {string} optional the name of the module that has
+         * been loaded (which is usually why it is time to load the next
+         * one)
+         */
+        loadNext: function(mname) {
+
+            // console.log("loadNext executing, just loaded " + mname);
+
+            // The global handler that is called when each module is loaded
+            // will pass that module name to this function.  Storing this
+            // data to avoid loading the same module multiple times
+            if (mname) {
+                this.inserted[mname] = true;
+                //var o = this.getProvides(mname);
+                //this.inserted = YUI.ObjectUtil.merge(this.inserted, o);
+            }
+
+            // It is possible that this function is executed due to something
+            // else one the page loading a YUI module.  Only react when we
+            // are actively loading something
+            if (!this.loading) {
+                return;
+            }
+
+            // if the module that was just loaded isn't what we were expecting,
+            // continue to wait
+            if (mname && mname !== this.loading) {
+                return;
+            }
+            
+            var s=this.sorted, len=s.length, i, m, url;
+
+            for (i=0; i<len; i=i+1) {
+
+                // This.inserted keeps track of what the loader has loaded
+                if (s[i] in this.inserted) {
+                    // console.log(s[i] + " alread loaded ");
+                    continue;
+                }
+
+                // Because rollups will cause multiple load notifications
+                // from YAHOO, loadNext may be called multiple times for
+                // the same module when loading a rollup.  We can safely
+                // skip the subsequent requests
+                if (s[i] === this.loading) {
+                    // console.log("still loading " + s[i] + ", waiting");
+                    return;
+                }
+
+                // log("inserting " + s[i]);
+
+                m = this.moduleInfo[s[i]];
+
+                // The load type is stored to offer the possibility to load
+                // the css separately from the script.
+                if (!this.loadType || this.loadType === m.type) {
+                    this.loading = s[i];
+
+                    // Insert the css node and continue.  It is possible
+                    // that the css file will load out of order ... this
+                    // may be a problem that needs to be addressed, but
+                    // unlike the script files, there is no notification
+                    // mechanism in place for the css files.
+                    if (m.type === "css") {
+
+                        url = m.fullpath || this._url(m.path);
+                        
+                        this.insertCss(url);
+                        this.inserted[s[i]] = true;
+
+                    // Scripts must be loaded in order, so we wait for the
+                    // notification from YAHOO or a verifier function to 
+                    // process the next script
+                    } else {
+
+                        url = m.fullpath || this._url(m.path);
+                        this.insertScript(url);
+
+                        // if a verifier was included for this module, execute
+                        // it, passing the name of the module, and a callback
+                        // that must be exectued when the verifier is done.
+                        if (m.verifier) {
+                            var self = this, name=s[i];
+                            m.verifier(name, function() {
+                                    self.loadNext(name);
+                                });
+                        }
+
+                        return;
+                    }
+                }
+            }
+
+            // we are finished
+            this.loading = null;
+
+
+            // internal callback for loading css first
+            if (this._internalCallback) {
+                var f = this._internalCallback;
+                this._internalCallback = null;
+                f(this);
+            } else if (this.onLoadComplete) {
+                this._pushEvents();
+                this.onLoadComplete(this);
+            }
+
+        },
+
+        /**
+         * In IE, the onAvailable/onDOMReady events need help when Event is
+         * loaded dynamically
+         * @method _pushEvents
+         * @private
+         */
+        _pushEvents: function() {
+            if (typeof YAHOO !== "undefined" && YAHOO.util && YAHOO.util.Event) {
+                YAHOO.util.Event._load();
+            }
+        },
+
+        /**
+         * Generates the full url for a module
+         * method _url
+         * @param path {string} the path fragment
+         * @return {string} the full url
+         * @private
+         */
+        _url: function(path) {
+            
+            var u = this.base || "", f=this.filter;
+            u = u + path;
+
+            if (f) {
+                // console.log("filter: " + f + ", " + f.searchExp + 
+                // ", " + f.replaceStr);
+                u = u.replace(new RegExp(f.searchExp), f.replaceStr);
+            }
+
+            // console.log(u);
+
+            return u;
+        },
+
+        /**
+         * Inserts a script node
+         * @method insertScript
+         * @param url {string} the full url for the script
+         * @param win {Window} optional window to target
+         */
+        insertScript: function(url, win) {
+
+            //console.log("inserting script " + url);
+            var w = win || window, d=w.document, n=d.createElement("script"),
+                h = d.getElementsByTagName("head")[0];
+
+            n.src = url;
+            n.type = "text/javascript";
+            h.appendChild(n);
+        },
+
+        /**
+         * Inserts a css link node
+         * @method insertCss
+         * @param url {string} the full url for the script
+         * @param win {Window} optional window to target
+         */
+        insertCss: function(url, win) {
+            // console.log("inserting css " + url);
+            var w = win || window, d=w.document, n=d.createElement("link"),
+                h = d.getElementsByTagName("head")[0];
+
+            n.href = url;
+            n.type = "text/css";
+            n.rel = "stylesheet";
+            h.appendChild(n);
+        },
+       
+        /*
+         * Interns the script for the requested modules.  The callback is
+         * provided a reference to the sandboxed YAHOO object.  This only
+         * applies to the script: css can not be sandboxed.  Not implemented.
+         * @method sandbox
+         * @param callback {Function} the callback to exectued when the load is
+         *        complete.
+         * @notimplemented
+         */
+        sandbox: function(callback) {
+            // this.calculate({
+                         //sandbox: true
+                     //});
+        }
+    };
+
+    YUI.init();
+
+})();
diff --git a/lib/yui/yuiloader/yuiloader-beta-min.js b/lib/yui/yuiloader/yuiloader-beta-min.js
new file mode 100755 (executable)
index 0000000..8696583
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
+(function(){if(typeof YAHOO_config==="undefined"){YAHOO_config={};}
+var YUI={info:{'base':'http://yui.yahooapis.com/2.3.0/build/','skin':{'defaultSkin':'sam','base':'assets/skins/','path':'skin.css','rollup':3},'moduleInfo':{'animation':{'type':'js','path':'animation/animation-min.js','requires':['dom','event']},'autocomplete':{'type':'js','path':'autocomplete/autocomplete-min.js','requires':['dom','event'],'optional':['connection','animation'],'skinnable':true},'button':{'type':'js','path':'button/button-beta-min.js','requires':['element'],'optional':['menu'],'skinnable':true},'calendar':{'type':'js','path':'calendar/calendar-min.js','requires':['event','dom'],'skinnable':true},'colorpicker':{'type':'js','path':'colorpicker/colorpicker-beta-min.js','requires':['slider','element'],'optional':['animation'],'skinnable':true},'connection':{'type':'js','path':'connection/connection-min.js','requires':['event']},'container':{'type':'js','path':'container/container-min.js','requires':['dom','event'],'optional':['dragdrop','animation'],'supersedes':['containercore'],'skinnable':true},'containercore':{'type':'js','path':'container/container_core-min.js','requires':['dom','event']},'datasource':{'type':'js','path':'datasource/datasource-beta-min.js','requires':['event'],'optional':['connection']},'datatable':{'type':'js','path':'datatable/datatable-beta-min.js','requires':['element','datasource'],'optional':['calendar','dragdrop'],'skinnable':true},'dom':{'type':'js','path':'dom/dom-min.js','requires':['yahoo']},'dragdrop':{'type':'js','path':'dragdrop/dragdrop-min.js','requires':['dom','event']},'editor':{'type':'js','path':'editor/editor-beta-min.js','requires':['menu','container','element','button'],'optional':['animation','dragdrop'],'skinnable':true},'element':{'type':'js','path':'element/element-beta-min.js','requires':['dom','event']},'event':{'type':'js','path':'event/event-min.js','requires':['yahoo']},'fonts':{'type':'css','path':'fonts/fonts-min.css'},'grids':{'type':'css','path':'grids/grids-min.css','requires':['fonts'],'optional':['reset']},'history':{'type':'js','path':'history/history-beta-min.js','requires':['event']},'imageloader':{'type':'js','path':'imageloader/imageloader-experimental-min.js','requires':['event','dom']},'logger':{'type':'js','path':'logger/logger-min.js','requires':['event','dom'],'optional':['dragdrop'],'skinnable':true},'menu':{'type':'js','path':'menu/menu-min.js','requires':['containercore'],'skinnable':true},'reset':{'type':'css','path':'reset/reset-min.css'},'reset-fonts-grids':{'type':'css','path':'reset-fonts-grids/reset-fonts-grids.css','supersedes':['reset','fonts','grids']},'slider':{'type':'js','path':'slider/slider-min.js','requires':['dragdrop'],'optional':['animation']},'tabview':{'type':'js','path':'tabview/tabview-min.js','requires':['element'],'optional':['connection'],'skinnable':true},'treeview':{'type':'js','path':'treeview/treeview-min.js','requires':['event'],'skinnable':true},'utilities':{'type':'js','path':'utilities/utilities.js','supersedes':['yahoo','event','dragdrop','animation','dom','connection','element','yahoo-dom-event'],'rollup':6},'yahoo':{'type':'js','path':'yahoo/yahoo-min.js'},'yahoo-dom-event':{'type':'js','path':'yahoo-dom-event/yahoo-dom-event.js','supersedes':['yahoo','event','dom'],'rollup':3},'yuiloader':{'type':'js','path':'yuiloader/yuiloader-beta-min.js'},'yuitest':{'type':'js','path':'yuitest/yuitest-beta-min.js','requires':['logger'],'skinnable':true}}},ObjectUtil:{appendArray:function(o,a){if(a){for(var i=0;i<a.length;i=i+1){o[a[i]]=true;}}},clone:function(o){var c={};for(var i in o){c[i]=o[i];}
+return c;},merge:function(){var o={},a=arguments,i,j;for(i=0;i<a.length;i=i+1){for(j in a[i]){o[j]=a[i][j];}}
+return o;},keys:function(o,ordered){var a=[],i;for(i in o){a.push(i);}
+return a;}},ArrayUtil:{appendArray:function(a1,a2){Array.prototype.push.apply(a1,a2);},indexOf:function(a,val){for(var i=0;i<a.length;i=i+1){if(a[i]===val){return i;}}
+return-1;},toObject:function(a){var o={};for(var i=0;i<a.length;i=i+1){o[a[i]]=true;}
+return o;},uniq:function(a){return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));}},loaders:[],finishInit:function(yahooref){yahooref=yahooref||YAHOO;yahooref.env.YUIInfo=YUI.info;yahooref.util.YUILoader=YUI.YUILoader;},onModuleLoaded:function(minfo){var mname=minfo.name,m;for(var i=0;i<YUI.loaders.length;i=i+1){YUI.loaders[i].loadNext(mname);}},init:function(){var c=YAHOO_config,o=c.load,y_loaded=(typeof YAHOO!=="undefined"&&YAHOO.env);if(y_loaded){YAHOO.env.listeners.push(YUI.onModuleLoaded);}else{if(c.listener){YUI.cachedCallback=c.listener;}
+c.listener=function(minfo){YUI.onModuleLoaded(minfo);if(YUI.cachedCallback){YUI.cachedCallback(minfo);}};}
+if(o||!y_loaded){o=o||{};var loader=new YUI.YUILoader(o);loader.onLoadComplete=function(){YUI.finishInit();if(o.onLoadComplete){loader._pushEvents();o.onLoadComplete(loader);}};if(!y_loaded){loader.require("yahoo");}
+loader.insert(null,o);}else{YUI.finishInit();}}};YUI.YUILoader=function(o){YAHOO_config.injecting=true;o=o||{};this._internalCallback=null;this.onLoadComplete=null;this.base=("base"in o)?o.base:YUI.info.base;this.allowRollup=("allowRollup"in o)?o.allowRollup:true;this.filter=o.filter;this.sandbox=o.sandbox;this.required={};this.moduleInfo=o.moduleInfo||YUI.info.moduleInfo;this.rollups=null;this.loadOptional=o.loadOptional||false;this.sorted=[];this.loaded={};this.dirty=true;this.inserted={};this.skin=o.skin||YUI.ObjectUtil.clone(YUI.info.skin);if(o.require){this.require(o.require);}
+YUI.loaders.push(this);};YUI.YUILoader.prototype={FILTERS:{RAW:{'searchExp':"-min\\.js",'replaceStr':".js"},DEBUG:{'searchExp':"-min\\.js",'replaceStr':"-debug.js"}},SKIN_PREFIX:"skin-",addModule:function(o){if(!o||!o.name||!o.type||(!o.path&&!o.fullpath)){return false;}
+this.moduleInfo[o.name]=o;this.dirty=true;return true;},require:function(what){var a=(typeof what==="string")?arguments:what;this.dirty=true;for(var i=0;i<a.length;i=i+1){this.required[a[i]]=true;var s=this.parseSkin(a[i]);if(s){this._addSkin(s.skin,s.module);}}
+YUI.ObjectUtil.appendArray(this.required,a);},_addSkin:function(skin,mod){var name=this.formatSkin(skin);if(!this.moduleInfo[name]){this.addModule({'name':name,'type':'css','path':this.skin.base+skin+"/"+this.skin.path,'rollup':this.skin.rollup});}
+if(mod){name=this.formatSkin(skin,mod);if(!this.moduleInfo[name]){this.addModule({'name':name,'type':'css','path':mod+'/'+this.skin.base+skin+"/"+mod+".css"});}}},getRequires:function(mod){if(!this.dirty&&mod.expanded){return mod.expanded;}
+mod.requires=mod.requires||[];var i,d=[],r=mod.requires,o=mod.optional,s=mod.supersedes,info=this.moduleInfo;for(i=0;i<r.length;i=i+1){d.push(r[i]);YUI.ArrayUtil.appendArray(d,this.getRequires(info[r[i]]));}
+if(o&&this.loadOptional){for(i=0;i<o.length;i=i+1){d.push(o[i]);YUI.ArrayUtil.appendArray(d,this.getRequires(info[o[i]]));}}
+mod.expanded=YUI.ArrayUtil.uniq(d);return mod.expanded;},getProvides:function(name){var mod=this.moduleInfo[name];var o={};o[name]=true;s=mod&&mod.supersedes;YUI.ObjectUtil.appendArray(o,s);return o;},calculate:function(o){if(this.dirty){this._setup(o);this._explode();this._skin();if(this.allowRollup){this._rollup();}
+this._reduce();this._sort();this.dirty=false;}},_setup:function(o){o=o||{};this.loaded=YUI.ObjectUtil.clone(this.inserted);if(!this.sandbox&&typeof YAHOO!=="undefined"&&YAHOO.env){this.loaded=YUI.ObjectUtil.merge(this.loaded,YAHOO.env.modules);}
+if(o.ignore){YUI.ObjectUtil.appendArray(this.loaded,o.ignore);}
+if(o.force){for(var i=0;i<o.force.length;i=i+1){if(o.force[i]in this.loaded){delete this.loaded[o.force[i]];}}}},_explode:function(){var r=this.required,i,mod;for(i in r){mod=this.moduleInfo[i];if(mod){var req=this.getRequires(mod);if(req){YUI.ObjectUtil.appendArray(r,req);}}}},_skin:function(){var r=this.required,i,mod;for(i in r){mod=this.moduleInfo[i];if(mod&&mod.skinnable){var o=this.skin.override,j;if(o&&o[i]){for(j=0;j<o[i].length;j=j+1){this.require(this.formatSkin(o[i][j],i));}}else{this.require(this.formatSkin(this.skin.defaultSkin,i));}}}},formatSkin:function(skin,mod){var s=this.SKIN_PREFIX+skin;if(mod){s=s+"-"+mod;}
+return s;},parseSkin:function(mod){if(mod.indexOf(this.SKIN_PREFIX)===0){var a=mod.split("-");return{skin:a[1],module:a[2]};}
+return null;},_rollup:function(){var i,j,m,s,rollups={},r=this.required,roll;if(this.dirty||!this.rollups){for(i in this.moduleInfo){m=this.moduleInfo[i];if(m&&m.rollup){rollups[i]=m;}}
+this.rollups=rollups;}
+for(;;){var rolled=false;for(i in rollups){if(!r[i]&&!this.loaded[i]){m=this.moduleInfo[i];s=m.supersedes;roll=true;if(!m.rollup){continue;}
+var skin=this.parseSkin(i),c=0;if(skin){for(j in r){if(i!==j&&this.parseSkin(j)){c++;roll=(c>=m.rollup);if(roll){break;}}}}else{for(j=0;j<s.length;j=j+1){if(this.loaded[s[j]]){roll=false;break;}else if(r[s[j]]){c++;roll=(c>=m.rollup);if(roll){break;}}}}
+if(roll){r[i]=true;rolled=true;this.getRequires(m);}}}
+if(!rolled){break;}}},_reduce:function(){var i,j,s,m,r=this.required;for(i in r){if(i in this.loaded){delete r[i];}else{var skinDef=this.parseSkin(i);if(skinDef){if(!skinDef.module){var skin_pre=this.SKIN_PREFIX+skinDef.skin;for(j in r){if(j!==i&&j.indexOf(skin_pre)>-1){delete r[j];}}}}else{m=this.moduleInfo[i];s=m&&m.supersedes;if(s){for(j=0;j<s.length;j=j+1){if(s[j]in r){delete r[s[j]];}}}}}}},_sort:function(){var s=[],info=this.moduleInfo,loaded=this.loaded;var requires=function(aa,bb){if(loaded[bb]){return false;}
+var ii,mm=info[aa],rr=mm&&mm.expanded;if(rr&&YUI.ArrayUtil.indexOf(rr,bb)>-1){return true;}
+var ss=info[bb]&&info[bb].supersedes;if(ss){for(ii=0;ii<ss.length;ii=i+1){if(requires(aa,ss[ii])){return true;}}}
+return false;};for(var i in this.required){s.push(i);}
+var p=0;for(;;){var l=s.length,a,b,j,k,moved=false;for(j=p;j<l;j=j+1){a=s[j];for(k=j+1;k<l;k=k+1){if(requires(a,s[k])){b=s.splice(k,1);s.splice(j,0,b[0]);moved=true;break;}}
+if(moved){break;}else{p=p+1;}}
+if(!moved){break;}}
+this.sorted=s;},insert:function(callback,o,type){if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(callback,o,"js");};this.insert(null,o,"css");return;}
+o=o||{};this.onLoadComplete=callback||this.onLoadComplete;var f=o&&o.filter||null;if(typeof f==="string"){f=f.toUpperCase();if(f==="DEBUG"){this.require("logger");}}
+this.filter=this.FILTERS[f]||f||this.FILTERS[this.filter]||this.filter;this.insertOptions=o;this.calculate(o);this.loading=true;this.loadType=type;this.loadNext();},loadNext:function(mname){if(mname){this.inserted[mname]=true;}
+if(!this.loading){return;}
+if(mname&&mname!==this.loading){return;}
+var s=this.sorted,len=s.length,i,m,url;for(i=0;i<len;i=i+1){if(s[i]in this.inserted){continue;}
+if(s[i]===this.loading){return;}
+m=this.moduleInfo[s[i]];if(!this.loadType||this.loadType===m.type){this.loading=s[i];if(m.type==="css"){url=m.fullpath||this._url(m.path);this.insertCss(url);this.inserted[s[i]]=true;}else{url=m.fullpath||this._url(m.path);this.insertScript(url);if(m.verifier){var self=this,name=s[i];m.verifier(name,function(){self.loadNext(name);});}
+return;}}}
+this.loading=null;if(this._internalCallback){var f=this._internalCallback;this._internalCallback=null;f(this);}else if(this.onLoadComplete){this._pushEvents();this.onLoadComplete(this);}},_pushEvents:function(){if(typeof YAHOO!=="undefined"&&YAHOO.util&&YAHOO.util.Event){YAHOO.util.Event._load();}},_url:function(path){var u=this.base||"",f=this.filter;u=u+path;if(f){u=u.replace(new RegExp(f.searchExp),f.replaceStr);}
+return u;},insertScript:function(url,win){var w=win||window,d=w.document,n=d.createElement("script"),h=d.getElementsByTagName("head")[0];n.src=url;n.type="text/javascript";h.appendChild(n);},insertCss:function(url,win){var w=win||window,d=w.document,n=d.createElement("link"),h=d.getElementsByTagName("head")[0];n.href=url;n.type="text/css";n.rel="stylesheet";h.appendChild(n);},sandbox:function(callback){}};YUI.init();})();
\ No newline at end of file
diff --git a/lib/yui/yuiloader/yuiloader-beta.js b/lib/yui/yuiloader/yuiloader-beta.js
new file mode 100755 (executable)
index 0000000..3ebf3fb
--- /dev/null
@@ -0,0 +1,1408 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+/**
+ * Provides dynamic loading for the YUI library.  It includes the dependency
+ * info for the library, and will automatically pull in dependencies for
+ * the modules requested.  It supports rollup files (such as utilities.js
+ * and yahoo-dom-event.js), and will automatically use these when
+ * appropriate in order to minimize the number of http connections
+ * required to load all of the dependencies.
+ * 
+ * @module yuiloader
+ * @namespace YAHOO.util
+ */
+
+/**
+ * YUILoader provides dynamic loading for YUI.
+ * @class YAHOO.util.YUILoader
+ * @todo
+ *      version management, automatic sandboxing
+ */
+(function() {
+    // Define YAHOO_config if it doesn't exist.  Only relevant if YAHOO is not
+    // already on the page
+    if (typeof YAHOO_config === "undefined") {
+        YAHOO_config = {};
+    }
+
+    // YUI is locally scoped, only pieces of it will be referenced in YAHOO
+    // after YAHOO has been loaded.
+    var YUI = {
+
+        /*
+         * The library metadata for the current release  The is the default
+         * value for YAHOO.util.YUILoader.moduleInfo
+         * @property YUIInfo
+         * @static
+         */
+        info: {
+
+    'base': 'http://yui.yahooapis.com/2.3.0/build/',
+
+    'skin': {
+        'defaultSkin': 'sam',
+        'base': 'assets/skins/',
+        'path': 'skin.css',
+        'rollup': 3
+    },
+
+    'moduleInfo': {
+
+        'animation': {
+            'type': 'js',
+            'path': 'animation/animation-min.js',
+            'requires': ['dom', 'event']
+        },
+
+        'autocomplete': {
+            'type': 'js',
+            'path': 'autocomplete/autocomplete-min.js',
+            'requires': ['dom', 'event'],
+            'optional': ['connection', 'animation'],
+            'skinnable': true
+        },
+
+        'button': {
+            'type': 'js',
+            'path': 'button/button-beta-min.js',
+            'requires': ['element'],
+            'optional': ['menu'],
+            'skinnable': true
+        },
+
+        'calendar': {
+            'type': 'js',
+            'path': 'calendar/calendar-min.js',
+            'requires': ['event', 'dom'],
+            'skinnable': true
+        },
+
+        'colorpicker': {
+            'type': 'js',
+            'path': 'colorpicker/colorpicker-beta-min.js',
+            'requires': ['slider', 'element'],
+            'optional': ['animation'],
+            'skinnable': true
+        },
+
+        'connection': {
+            'type': 'js',
+            'path': 'connection/connection-min.js',
+            'requires': ['event']
+        },
+
+        'container': {
+            'type': 'js',
+            'path': 'container/container-min.js',
+            'requires': ['dom', 'event'],
+            // button is optional, but creates a circular dep
+            //'optional': ['dragdrop', 'animation', 'button'],
+            'optional': ['dragdrop', 'animation'],
+            'supersedes': ['containercore'],
+            'skinnable': true
+        },
+
+        'containercore': {
+            'type': 'js',
+            'path': 'container/container_core-min.js',
+            'requires': ['dom', 'event']
+        },
+
+        'datasource': {
+            'type': 'js',
+            'path': 'datasource/datasource-beta-min.js',
+            'requires': ['event'],
+            'optional': ['connection']
+        },
+
+        'datatable': {
+            'type': 'js',
+            'path': 'datatable/datatable-beta-min.js',
+            'requires': ['element', 'datasource'],
+            'optional': ['calendar', 'dragdrop'],
+            'skinnable': true
+        },
+
+        'dom': {
+            'type': 'js',
+            'path': 'dom/dom-min.js',
+            'requires': ['yahoo']
+        },
+
+        'dragdrop': {
+            'type': 'js',
+            'path': 'dragdrop/dragdrop-min.js',
+            'requires': ['dom', 'event']
+        },
+
+        'editor': {
+            'type': 'js',
+            'path': 'editor/editor-beta-min.js',
+            'requires': ['menu', 'container', 'element', 'button'],
+            'optional': ['animation', 'dragdrop'],
+            'skinnable': true
+        },
+
+        'element': {
+            'type': 'js',
+            'path': 'element/element-beta-min.js',
+            'requires': ['dom', 'event']
+        },
+
+        'event': {
+            'type': 'js',
+            'path': 'event/event-min.js',
+            'requires': ['yahoo']
+        },
+
+        'fonts': {
+            'type': 'css',
+            'path': 'fonts/fonts-min.css'
+        },
+
+        'grids': {
+            'type': 'css',
+            'path': 'grids/grids-min.css',
+            'requires': ['fonts'],
+            'optional': ['reset']
+        },
+
+        'history': {
+            'type': 'js',
+            'path': 'history/history-beta-min.js',
+            'requires': ['event']
+        },
+
+        'imageloader': {
+            'type': 'js',
+            'path': 'imageloader/imageloader-experimental-min.js',
+            'requires': ['event', 'dom']
+        },
+
+        'logger': {
+            'type': 'js',
+            'path': 'logger/logger-min.js',
+            'requires': ['event', 'dom'],
+            'optional': ['dragdrop'],
+            'skinnable': true
+        },
+
+        'menu': {
+            'type': 'js',
+            'path': 'menu/menu-min.js',
+            'requires': ['containercore'],
+            'skinnable': true
+        },
+
+        'reset': {
+            'type': 'css',
+            'path': 'reset/reset-min.css'
+        },
+
+        'reset-fonts-grids': {
+            'type': 'css',
+            'path': 'reset-fonts-grids/reset-fonts-grids.css',
+            'supersedes': ['reset', 'fonts', 'grids']
+        },
+
+        'slider': {
+            'type': 'js',
+            'path': 'slider/slider-min.js',
+            'requires': ['dragdrop'],
+            'optional': ['animation']
+        },
+
+        'tabview': {
+            'type': 'js',
+            'path': 'tabview/tabview-min.js',
+            'requires': ['element'],
+            'optional': ['connection'],
+            'skinnable': true
+        },
+
+        'treeview': {
+            'type': 'js',
+            'path': 'treeview/treeview-min.js',
+            'requires': ['event'],
+            'skinnable': true
+        },
+
+        'utilities': {
+            'type': 'js',
+            'path': 'utilities/utilities.js',
+            'supersedes': ['yahoo', 'event', 'dragdrop', 'animation', 'dom', 'connection', 'element', 'yahoo-dom-event'],
+            'rollup': 6
+        },
+
+        'yahoo': {
+            'type': 'js',
+            'path': 'yahoo/yahoo-min.js'
+        },
+
+        'yahoo-dom-event': {
+            'type': 'js',
+            'path': 'yahoo-dom-event/yahoo-dom-event.js',
+            'supersedes': ['yahoo', 'event', 'dom'],
+            'rollup': 3
+        },
+
+        'yuiloader': {
+            'type': 'js',
+            'path': 'yuiloader/yuiloader-beta-min.js'
+        },
+
+        'yuitest': {
+            'type': 'js',
+            'path': 'yuitest/yuitest-beta-min.js',
+            'requires': ['logger'],
+            'skinnable': true
+        }
+    }
+}
+ , 
+
+        // Simple utils since we can't count on YAHOO.lang being available.
+        ObjectUtil: {
+            appendArray: function(o, a) {
+                if (a) {
+                    for (var i=0; i<a.length; i=i+1) {
+                        o[a[i]] = true;
+                    }
+                }
+            },
+
+            clone: function(o) {
+                var c = {};
+                for (var i in o) {
+                    c[i] = o[i];
+                }
+                return c;
+            },
+
+            merge: function() {
+                var o={}, a=arguments, i, j;
+                for (i=0; i<a.length; i=i+1) {
+                    
+                    for (j in a[i]) {
+                        o[j] = a[i][j];
+                    }
+                }
+                return o;
+            },
+
+            keys: function(o, ordered) {
+                var a=[], i;
+                for (i in o) {
+                    a.push(i);
+                }
+
+                return a;
+            }
+        },
+
+        ArrayUtil: {
+
+            appendArray: function(a1, a2) {
+                Array.prototype.push.apply(a1, a2);
+                /*
+                for (var i=0; i<a2.length; i=i+1) {
+                    a1.push(a2[i]);
+                }
+                */
+            },
+
+            indexOf: function(a, val) {
+                for (var i=0; i<a.length; i=i+1) {
+                    if (a[i] === val) {
+                        return i;
+                    }
+                }
+
+                return -1;
+            },
+
+            toObject: function(a) {
+                var o = {};
+                for (var i=0; i<a.length; i=i+1) {
+                    o[a[i]] = true;
+                }
+
+                return o;
+            },
+
+            /*
+             * Returns a unique array.  Does not maintain order, which is fine
+             * for this application, and performs better than it would if it
+             * did.
+             */
+            uniq: function(a) {
+                return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));
+            }
+        },
+
+
+        // loader instances
+        loaders: [],
+
+        finishInit: function(yahooref) {
+
+            // YAHOO has been loaded either in this window or passed 
+            // from the sandbox routine.  Set up local references 
+            // to the loader and module metadata in the YAHOO object
+            // in question so additional modules can be loaded. 
+
+            yahooref = yahooref || YAHOO;
+
+            yahooref.env.YUIInfo=YUI.info;
+            yahooref.util.YUILoader=YUI.YUILoader;
+
+        },
+
+        /*
+         * Global handler for the module loaded event exposed by
+         * YAHOO
+         */
+        onModuleLoaded: function(minfo) {
+
+            var mname = minfo.name, m;
+
+            for (var i=0; i<YUI.loaders.length; i=i+1) {
+                YUI.loaders[i].loadNext(mname);
+            }
+
+            //console.log(YAHOO.lang.dump(minfo));
+
+        },
+
+        /*
+         * Sets up the module metadata
+         */
+        init: function() {
+
+            var c = YAHOO_config, o = c.load, 
+                y_loaded = (typeof YAHOO !== "undefined" && YAHOO.env);
+
+
+            // add our listener to the existing YAHOO.env.listeners stack
+            if (y_loaded) {
+
+                YAHOO.env.listeners.push(YUI.onModuleLoaded);
+
+            // define a listener in YAHOO_config that YAHOO will pick up
+            // when it is loaded.
+            } else {
+
+                if (c.listener) {
+                    YUI.cachedCallback = c.listener;
+                }
+
+                c.listener = function(minfo) {
+                    YUI.onModuleLoaded(minfo);
+                    if (YUI.cachedCallback) {
+                        YUI.cachedCallback(minfo);
+                    }
+                };
+            }
+
+            // Fetch the required modules immediately if specified
+            // in YAHOO_config.  Otherwise detect YAHOO and fetch
+            // it if it doesn't exist so we have a place to put
+            // the loader.  The problem with this is that it will
+            // prevent rollups from working
+            if (o || !y_loaded) {
+
+                o = o || {};
+
+                var loader = new YUI.YUILoader(o);
+                loader.onLoadComplete = function() {
+
+                        YUI.finishInit();
+
+                        if (o.onLoadComplete) {
+
+                            loader._pushEvents();
+                            o.onLoadComplete(loader);
+                        }
+
+                        
+                    };
+
+                // If no load was requested, we must load YAHOO
+                // so we have a place to put the loader
+                if (!y_loaded) {
+                    loader.require("yahoo");
+                }
+
+                loader.insert(null, o);
+            } else {
+                YUI.finishInit();
+            }
+        }
+
+    };
+
+    YUI.YUILoader = function(o) {
+
+        // Inform the library that it is being injected
+        YAHOO_config.injecting = true;
+
+        o = o || {};
+
+        /**
+         * Internal callback to handle multiple internal insert() calls
+         * so that css is inserted prior to js
+         * @property _internalCallback
+         * @private
+         */
+        this._internalCallback = null;
+
+        /**
+         * Callback that will be executed when the loader is finished
+         * with an insert
+         * @method onLoadComplete
+         * @type function
+         */
+        this.onLoadComplete = null;
+
+        /**
+         * The base directory.
+         * @property base
+         * @type string
+         * @default build
+         */
+        this.base = ("base" in o) ? o.base : YUI.info.base;
+
+        /**
+         * Should we allow rollups
+         * @property allowRollup
+         * @type boolean
+         * @default true
+         */
+        this.allowRollup = ("allowRollup" in o) ? o.allowRollup : true;
+
+        /**
+         * Filter to apply to result url
+         * @property filter
+         * @type string|object
+         */
+        this.filter = o.filter;
+
+        /**
+         * Create a sandbox rather than inserting into lib into.
+         * the current context.  Not currently supported
+         * property sandbox
+         * @type boolean
+         * @default false
+         */
+        this.sandbox = o.sandbox;
+
+        /**
+         * The list of requested modules
+         * @property required
+         * @type {string: boolean}
+         */
+        this.required = {};
+
+        /**
+         * The library metadata
+         * @property moduleInfo
+         */
+        this.moduleInfo = o.moduleInfo || YUI.info.moduleInfo;
+
+        /**
+         * List of rollup files found in the library metadata
+         * @property rollups
+         */
+        this.rollups = null;
+
+        /**
+         * Whether or not to load optional dependencies for 
+         * the requested modules
+         * @property loadOptional
+         * @type boolean
+         * @default false
+         */
+        this.loadOptional = o.loadOptional || false;
+
+        /**
+         * All of the derived dependencies in sorted order, which
+         * will be populated when either calculate() or insert()
+         * is called
+         * @property sorted
+         * @type string[]
+         */
+        this.sorted = [];
+
+        /**
+         * Set when beginning to compute the dependency tree. 
+         * Composed of what YAHOO reports to be loaded combined
+         * with what has been loaded by the tool
+         * @propery loaded
+         * @type {string: boolean}
+         */
+        this.loaded = {};
+
+        /**
+         * Flag to indicate the dependency tree needs to be recomputed
+         * if insert is called again.
+         * @property dirty
+         * @type boolean
+         * @default true
+         */
+        this.dirty = true;
+
+        /**
+         * List of modules inserted by the utility
+         * @property inserted
+         * @type {string: boolean}
+         */
+        this.inserted = {};
+
+
+        /**
+         * Provides the information used to skin the skinnable components.
+         * The following skin definition would result in 'skin1' and 'skin2'
+         * being loaded for calendar (if calendar was requested), and
+         * 'sam' for all other skinnable components:
+         *
+         *   <code>
+         *   skin: {
+         *
+         *      // The default skin, which is automatically applied if not
+         *      // overriden by a component-specific skin definition.
+         *      // Change this in to apply a different skin globally
+         *      defaultSkin: 'sam', 
+         *
+         *      // This is combined with the loader base property to get
+         *      // the default root directory for a skin. ex:
+         *      // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
+         *      base: 'assets/skins/',
+         *
+         *      // The name of the rollup css file for the skin
+         *      path: 'skin.css',
+         *
+         *      // The number of skinnable components requested that are
+         *      // required before using the rollup file rather than the
+         *      // individual component css files
+         *      rollup: 3,
+         *
+         *      // Any component-specific overrides can be specified here,
+         *      // making it possible to load different skins for different
+         *      // components.  It is possible to load more than one skin
+         *      // for a given component as well.
+         *      overrides: {
+         *          calendar: ['skin1', 'skin2']
+         *      }
+         *   }
+         *   </code>
+         *   @property skin
+         */
+        this.skin = o.skin || YUI.ObjectUtil.clone(YUI.info.skin); 
+
+
+        if (o.require) {
+            this.require(o.require);
+        }
+
+        YUI.loaders.push(this);
+    };
+
+    YUI.YUILoader.prototype = {
+
+        FILTERS: {
+            RAW: { 
+                'searchExp': "-min\\.js", 
+                'replaceStr': ".js"
+            },
+            DEBUG: { 
+                'searchExp': "-min\\.js", 
+                'replaceStr': "-debug.js"
+            }
+        },
+
+        SKIN_PREFIX: "skin-",
+
+        /** Add a new module to the component metadata.  The javascript 
+         * component must also use YAHOO.register to notify the loader 
+         * when it has been loaded, or a verifier function must be
+         * provided
+         * <dl>
+         *     <dt>name:</dt>       <dd>required, the component name</dd>
+         *     <dt>type:</dt>       <dd>required, the component type (js or css)</dd>
+         *     <dt>path:</dt>       <dd>required, the path to the script from "base"</dd>
+         *     <dt>requires:</dt>   <dd>the modules required by this component</dd>
+         *     <dt>optional:</dt>   <dd>the optional modules for this component</dd>
+         *     <dt>supersedes:</dt> <dd>the modules this component replaces</dd>
+         *     <dt>rollup:</dt>     <dd>the number of superseded modules required for automatic rollup</dd>
+         *     <dt>verifier:</dt>   <dd>a function that is executed to determine when the module is fully loaded</dd>
+         *     <dt>fullpath:</dt>   <dd>If fullpath is specified, this is used instead of the configured base + path</dd>
+         *     <dt>skinnable:</dt>  <dd>flag to determine if skin assets should automatically be pulled in</dd>
+         * </dl>
+         * @method addModule
+         * @param o An object containing the module data
+         * @return {boolean} true if the module was added, false if 
+         * the object passed in did not provide all required attributes
+         */
+        addModule: function(o) {
+
+            if (!o || !o.name || !o.type || (!o.path && !o.fullpath)) {
+                return false;
+            }
+
+            this.moduleInfo[o.name] = o;
+            this.dirty = true;
+
+            return true;
+        },
+
+        /**
+         * Add a requirement for one or more module
+         * @method require
+         * @param what {string[] | string*} the modules to load
+         */
+        require: function(what) {
+            var a = (typeof what === "string") ? arguments : what;
+
+            this.dirty = true;
+
+            for (var i=0; i<a.length; i=i+1) {
+                this.required[a[i]] = true;
+                var s = this.parseSkin(a[i]);
+                if (s) {
+                    this._addSkin(s.skin, s.module);
+                }
+            }
+            YUI.ObjectUtil.appendArray(this.required, a);
+        },
+
+
+        /**
+         * Adds the skin def to the module info
+         * @method _addSkin
+         * @private
+         */
+        _addSkin: function(skin, mod) {
+
+            // Add a module definition for the skin rollup css
+            var name = this.formatSkin(skin);
+            if (!this.moduleInfo[name]) {
+                this.addModule({
+                    'name': name,
+                    'type': 'css',
+                    'path': this.skin.base + skin + "/" + this.skin.path,
+                    //'supersedes': '*',
+                    'rollup': this.skin.rollup
+                });
+            }
+
+            // Add a module definition for the module-specific skin css
+            if (mod) {
+                name = this.formatSkin(skin, mod);
+                if (!this.moduleInfo[name]) {
+                    this.addModule({
+                        'name': name,
+                        'type': 'css',
+                        //'path': this.skin.base + skin + "/" + mod + ".css"
+                        'path': mod + '/' + this.skin.base + skin + "/" + mod + ".css"
+                    });
+                }
+            }
+        },
+
+        /**
+         * Returns an object containing properties for all modules required
+         * in order to load the requested module
+         * @method getRequires
+         * @param mod The module definition from moduleInfo
+         */
+        getRequires: function(mod) {
+            if (!this.dirty && mod.expanded) {
+                return mod.expanded;
+            }
+
+            mod.requires=mod.requires || [];
+            var i, d=[], r=mod.requires, o=mod.optional, s=mod.supersedes, info=this.moduleInfo;
+            for (i=0; i<r.length; i=i+1) {
+                d.push(r[i]);
+                YUI.ArrayUtil.appendArray(d, this.getRequires(info[r[i]]));
+            }
+
+            if (o && this.loadOptional) {
+                for (i=0; i<o.length; i=i+1) {
+                    d.push(o[i]);
+                    YUI.ArrayUtil.appendArray(d, this.getRequires(info[o[i]]));
+                }
+            }
+
+            mod.expanded = YUI.ArrayUtil.uniq(d);
+
+            return mod.expanded;
+        },
+
+        /**
+         * Returns an object literal of the modules the supplied module satisfies
+         * @method getProvides
+         * @param mod The module definition from moduleInfo
+         * @return what this module provides
+         */
+        getProvides: function(name) {
+            var mod = this.moduleInfo[name];
+
+            var o = {};
+            o[name] = true;
+            s = mod && mod.supersedes;
+
+            YUI.ObjectUtil.appendArray(o, s);
+
+            // console.log(this.sorted + ", " + name + " provides " + YUI.ObjectUtil.keys(o));
+
+            return o;
+        },
+
+        /**
+         * Calculates the dependency tree, the result is stored in the sorted 
+         * property
+         * @method calculate
+         * @param o optional options object
+         */
+        calculate: function(o) {
+            if (this.dirty) {
+
+                this._setup(o);
+                this._explode();
+                this._skin();
+                if (this.allowRollup) {
+                    this._rollup();
+                }
+                this._reduce();
+                this._sort();
+
+                this.dirty = false;
+            }
+        },
+
+        /**
+         * Investigates the current YUI configuration on the page.  By default,
+         * modules already detected will not be loaded again unless a force
+         * option is encountered.  Called by calculate()
+         * @method _setup
+         * @param o optional options object
+         * @private
+         */
+        _setup: function(o) {
+
+            o = o || {};
+            this.loaded = YUI.ObjectUtil.clone(this.inserted); 
+            
+            if (!this.sandbox && typeof YAHOO !== "undefined" && YAHOO.env) {
+                this.loaded = YUI.ObjectUtil.merge(this.loaded, YAHOO.env.modules);
+            }
+
+            // add the ignore list to the list of loaded packages
+            if (o.ignore) {
+                YUI.ObjectUtil.appendArray(this.loaded, o.ignore);
+            }
+
+            // remove modules on the force list from the loaded list
+            if (o.force) {
+                for (var i=0; i<o.force.length; i=i+1) {
+                    if (o.force[i] in this.loaded) {
+                        delete this.loaded[o.force[i]];
+                    }
+                }
+            }
+        },
+        
+
+        /**
+         * Inspects the required modules list looking for additional 
+         * dependencies.  Expands the required list to include all 
+         * required modules.  Called by calculate()
+         * @method _explode
+         * @private
+         */
+        _explode: function() {
+
+            var r=this.required, i, mod;
+
+            for (i in r) {
+                mod = this.moduleInfo[i];
+                if (mod) {
+
+                    var req = this.getRequires(mod);
+
+                    if (req) {
+                        YUI.ObjectUtil.appendArray(r, req);
+                    }
+                }
+            }
+        },
+
+        /**
+         * Sets up the requirements for the skin assets if any of the
+         * requested modules are skinnable
+         * @method _skin
+         * @private
+         */
+        _skin: function() {
+
+            var r=this.required, i, mod;
+
+            for (i in r) {
+                mod = this.moduleInfo[i];
+                if (mod && mod.skinnable) {
+                    var o=this.skin.override, j;
+                    if (o && o[i]) {
+                        for (j=0; j<o[i].length; j=j+1) {
+                            this.require(this.formatSkin(o[i][j], i));
+                        }
+                    } else {
+                        this.require(this.formatSkin(this.skin.defaultSkin, i));
+                    }
+                }
+            }
+        },
+
+        /**
+         * Returns the skin module name for the specified skin name.  If a
+         * module name is supplied, the returned skin module name is 
+         * specific to the module passed in.
+         * @method formatSkin
+         * @param skin {string} the name of the skin
+         * @param mod {string} optional: the name of a module to skin
+         * @return {string} the full skin module name
+         */
+        formatSkin: function(skin, mod) {
+            var s = this.SKIN_PREFIX + skin;
+            if (mod) {
+                s = s + "-" + mod;
+            }
+
+            return s;
+        },
+        
+        /**
+         * Reverses <code>formatSkin</code>, providing the skin name and
+         * module name if the string matches the pattern for skins.
+         * @method parseSkin
+         * @param mod {string} the module name to parse
+         * @return {skin: string, module: string} the parsed skin name 
+         * and module name, or null if the supplied string does not match
+         * the skin pattern
+         */
+        parseSkin: function(mod) {
+            
+            if (mod.indexOf(this.SKIN_PREFIX) === 0) {
+                var a = mod.split("-");
+                return {skin: a[1], module: a[2]};
+            } 
+
+            return null;
+        },
+
+        /**
+         * Look for rollup packages to determine if all of the modules a
+         * rollup supersedes are required.  If so, include the rollup to
+         * help reduce the total number of connections required.  Called
+         * by calculate()
+         * @method _rollup
+         * @private
+         */
+        _rollup: function() {
+            var i, j, m, s, rollups={}, r=this.required, roll;
+
+            // find and cache rollup modules
+            if (this.dirty || !this.rollups) {
+                for (i in this.moduleInfo) {
+                    m = this.moduleInfo[i];
+                    //if (m && m.rollup && m.supersedes) {
+                    if (m && m.rollup) {
+                        rollups[i] = m;
+                    }
+                }
+
+                this.rollups = rollups;
+            }
+
+            // make as many passes as needed to pick up rollup rollups
+            for (;;) {
+                var rolled = false;
+
+                // go through the rollup candidates
+                for (i in rollups) { 
+
+                    // there can be only one
+                    if (!r[i] && !this.loaded[i]) {
+                        m =this.moduleInfo[i]; s = m.supersedes; roll=true;
+
+                        if (!m.rollup) {
+                            continue;
+                        }
+
+
+                        var skin = this.parseSkin(i), c = 0;
+                        if (skin) {
+
+                            for (j in r) {
+                                if (i !== j && this.parseSkin(j)) {
+                                    c++;
+                                    roll = (c >= m.rollup);
+                                    if (roll) {
+                                        break;
+                                    }
+                                }
+                            }
+
+
+                        } else {
+
+                            // require all modules to trigger a rollup (using the 
+                            // threshold value has not proved worthwhile)
+                            for (j=0;j<s.length;j=j+1) {
+
+                                // if the superseded module is loaded, we can't load the rollup
+                                if (this.loaded[s[j]]) {
+                                    roll = false;
+                                    break;
+                                // increment the counter if this module is required.  if we are
+                                // beyond the rollup threshold, we will use the rollup module
+                                } else if (r[s[j]]) {
+                                    c++;
+                                    roll = (c >= m.rollup);
+                                    if (roll) {
+                                        break;
+                                    }
+                                }
+                            }
+                        }
+
+                        if (roll) {
+                            // add the rollup
+                            r[i] = true;
+                            rolled = true;
+
+                            // expand the rollup's dependencies
+                            this.getRequires(m);
+                        }
+                    }
+                }
+
+                // if we made it here w/o rolling up something, we are done
+                if (!rolled) {
+                    break;
+                }
+            }
+        },
+
+        /**
+         * Remove superceded modules and loaded modules.  Called by
+         * calculate() after we have the mega list of all dependencies
+         * @method _reduce
+         * @private
+         */
+        _reduce: function() {
+
+            var i, j, s, m, r=this.required;
+            for (i in r) {
+
+                // remove if already loaded
+                if (i in this.loaded) { 
+                    delete r[i];
+
+                // remove anything this module supersedes
+                } else {
+
+                    var skinDef = this.parseSkin(i);
+
+                    if (skinDef) {
+                        //console.log("skin found in reduce: " + skinDef.skin + ", " + skinDef.module);
+                        // the skin rollup will not have a module name
+                        if (!skinDef.module) {
+                            var skin_pre = this.SKIN_PREFIX + skinDef.skin;
+                            //console.log("skin_pre: " + skin_pre);
+                            for (j in r) {
+                                if (j !== i && j.indexOf(skin_pre) > -1) {
+                                    //console.log ("removing component skin: " + j);
+                                    delete r[j];
+                                }
+                            }
+                        }
+                    } else {
+
+                         m = this.moduleInfo[i];
+                         s = m && m.supersedes;
+                         if (s) {
+                             for (j=0;j<s.length;j=j+1) {
+                                 if (s[j] in r) {
+                                     delete r[s[j]];
+                                 }
+                             }
+                         }
+                    }
+                }
+            }
+        },
+        
+        /**
+         * Sorts the dependency tree.  The last step of calculate()
+         * @method _sort
+         * @private
+         */
+        _sort: function() {
+            // create an indexed list
+            var s=[], info=this.moduleInfo, loaded=this.loaded;
+
+            // returns true if b is not loaded, and is required
+            // directly or by means of modules it supersedes.
+            var requires = function(aa, bb) {
+                if (loaded[bb]) {
+                    return false;
+                }
+
+                var ii, mm=info[aa], rr=mm && mm.expanded;
+
+                if (rr && YUI.ArrayUtil.indexOf(rr, bb) > -1) {
+                    return true;
+                }
+
+                var ss=info[bb] && info[bb].supersedes;
+                if (ss) {
+                    for (ii=0; ii<ss.length; ii=i+1) {
+                        if (requires(aa, ss[ii])) {
+                            return true;
+                        }
+                    }
+                }
+
+                return false;
+            };
+
+            // get the required items out of the obj into an array so we
+            // can sort
+            for (var i in this.required) {
+                s.push(i);
+            }
+
+            // pointer to the first unsorted item
+            var p=0; 
+
+            // keep going until we make a pass without moving anything
+            for (;;) {
+               
+                var l=s.length, a, b, j, k, moved=false;
+
+                // start the loop after items that are already sorted
+                for (j=p; j<l; j=j+1) {
+
+                    // check the next module on the list to see if its
+                    // dependencies have been met
+                    a = s[j];
+
+                    // check everything below current item and move if we
+                    // find a requirement for the current item
+                    for (k=j+1; k<l; k=k+1) {
+                        if (requires(a, s[k])) {
+
+                            // extract the dependency so we can move it up
+                            b = s.splice(k, 1);
+
+                            // insert the dependency above the item that 
+                            // requires it
+                            s.splice(j, 0, b[0]);
+
+                            moved = true;
+                            break;
+                        }
+                    }
+
+                    // jump out of loop if we moved something
+                    if (moved) {
+                        break;
+                    // this item is sorted, move our pointer and keep going
+                    } else {
+                        p = p + 1;
+                    }
+                }
+
+                // when we make it here and moved is false, we are 
+                // finished sorting
+                if (!moved) {
+                    break;
+                }
+
+            }
+
+            this.sorted = s;
+        },
+
+        /**
+         * inserts the requested modules and their dependencies.  
+         * <code>type</code> can be "js" or "css".  Both script and 
+         * css are inserted if type is not provided.
+         * @method insert
+         * @param callback {Function} a function to execute when the load
+         * is complete.
+         * @param o optional options object
+         * @param type {string} the type of dependency to insert
+         */
+        insert: function(callback, o, type) {
+
+            //if (!this.onLoadComplete) {
+                //this.onLoadComplete = callback;
+            //}
+
+            if (!type) {
+                var self = this;
+                this._internalCallback = function() {
+                            self._internalCallback = null;
+                            self.insert(callback, o, "js");
+                        };
+                this.insert(null, o, "css");
+                return;
+            }
+
+            o = o || {};
+
+            // store the callback for when we are done
+            this.onLoadComplete = callback || this.onLoadComplete;
+
+            // store the optional filter
+            var f = o && o.filter || null;
+
+            if (typeof f === "string") {
+                f = f.toUpperCase();
+
+                // the logger must be available in order to use the debug
+                // versions of the library
+                if (f === "DEBUG") {
+                    this.require("logger");
+                }
+            }
+
+            this.filter = this.FILTERS[f] || f || this.FILTERS[this.filter] || this.filter;
+
+            // store the options... not currently in use
+            this.insertOptions = o;
+
+            // build the dependency list
+            this.calculate(o);
+
+            // set a flag to indicate the load has started
+            this.loading = true;
+
+            // keep the loadType (js, css or undefined) cached
+            this.loadType = type;
+
+            // start the load
+            this.loadNext();
+
+        },
+
+        /**
+         * Executed every time a module is loaded, and if we are in a load
+         * cycle, we attempt to load the next script.  Public so that it
+         * is possible to call this if using a method other than
+         * YAHOO.register to determine when scripts are fully loaded
+         * @method loadNext
+         * @param mname {string} optional the name of the module that has
+         * been loaded (which is usually why it is time to load the next
+         * one)
+         */
+        loadNext: function(mname) {
+
+            // console.log("loadNext executing, just loaded " + mname);
+
+            // The global handler that is called when each module is loaded
+            // will pass that module name to this function.  Storing this
+            // data to avoid loading the same module multiple times
+            if (mname) {
+                this.inserted[mname] = true;
+                //var o = this.getProvides(mname);
+                //this.inserted = YUI.ObjectUtil.merge(this.inserted, o);
+            }
+
+            // It is possible that this function is executed due to something
+            // else one the page loading a YUI module.  Only react when we
+            // are actively loading something
+            if (!this.loading) {
+                return;
+            }
+
+            // if the module that was just loaded isn't what we were expecting,
+            // continue to wait
+            if (mname && mname !== this.loading) {
+                return;
+            }
+            
+            var s=this.sorted, len=s.length, i, m, url;
+
+            for (i=0; i<len; i=i+1) {
+
+                // This.inserted keeps track of what the loader has loaded
+                if (s[i] in this.inserted) {
+                    // console.log(s[i] + " alread loaded ");
+                    continue;
+                }
+
+                // Because rollups will cause multiple load notifications
+                // from YAHOO, loadNext may be called multiple times for
+                // the same module when loading a rollup.  We can safely
+                // skip the subsequent requests
+                if (s[i] === this.loading) {
+                    // console.log("still loading " + s[i] + ", waiting");
+                    return;
+                }
+
+                // log("inserting " + s[i]);
+
+                m = this.moduleInfo[s[i]];
+
+                // The load type is stored to offer the possibility to load
+                // the css separately from the script.
+                if (!this.loadType || this.loadType === m.type) {
+                    this.loading = s[i];
+
+                    // Insert the css node and continue.  It is possible
+                    // that the css file will load out of order ... this
+                    // may be a problem that needs to be addressed, but
+                    // unlike the script files, there is no notification
+                    // mechanism in place for the css files.
+                    if (m.type === "css") {
+
+                        url = m.fullpath || this._url(m.path);
+                        
+                        this.insertCss(url);
+                        this.inserted[s[i]] = true;
+
+                    // Scripts must be loaded in order, so we wait for the
+                    // notification from YAHOO or a verifier function to 
+                    // process the next script
+                    } else {
+
+                        url = m.fullpath || this._url(m.path);
+                        this.insertScript(url);
+
+                        // if a verifier was included for this module, execute
+                        // it, passing the name of the module, and a callback
+                        // that must be exectued when the verifier is done.
+                        if (m.verifier) {
+                            var self = this, name=s[i];
+                            m.verifier(name, function() {
+                                    self.loadNext(name);
+                                });
+                        }
+
+                        return;
+                    }
+                }
+            }
+
+            // we are finished
+            this.loading = null;
+
+
+            // internal callback for loading css first
+            if (this._internalCallback) {
+                var f = this._internalCallback;
+                this._internalCallback = null;
+                f(this);
+            } else if (this.onLoadComplete) {
+                this._pushEvents();
+                this.onLoadComplete(this);
+            }
+
+        },
+
+        /**
+         * In IE, the onAvailable/onDOMReady events need help when Event is
+         * loaded dynamically
+         * @method _pushEvents
+         * @private
+         */
+        _pushEvents: function() {
+            if (typeof YAHOO !== "undefined" && YAHOO.util && YAHOO.util.Event) {
+                YAHOO.util.Event._load();
+            }
+        },
+
+        /**
+         * Generates the full url for a module
+         * method _url
+         * @param path {string} the path fragment
+         * @return {string} the full url
+         * @private
+         */
+        _url: function(path) {
+            
+            var u = this.base || "", f=this.filter;
+            u = u + path;
+
+            if (f) {
+                // console.log("filter: " + f + ", " + f.searchExp + 
+                // ", " + f.replaceStr);
+                u = u.replace(new RegExp(f.searchExp), f.replaceStr);
+            }
+
+            // console.log(u);
+
+            return u;
+        },
+
+        /**
+         * Inserts a script node
+         * @method insertScript
+         * @param url {string} the full url for the script
+         * @param win {Window} optional window to target
+         */
+        insertScript: function(url, win) {
+
+            //console.log("inserting script " + url);
+            var w = win || window, d=w.document, n=d.createElement("script"),
+                h = d.getElementsByTagName("head")[0];
+
+            n.src = url;
+            n.type = "text/javascript";
+            h.appendChild(n);
+        },
+
+        /**
+         * Inserts a css link node
+         * @method insertCss
+         * @param url {string} the full url for the script
+         * @param win {Window} optional window to target
+         */
+        insertCss: function(url, win) {
+            // console.log("inserting css " + url);
+            var w = win || window, d=w.document, n=d.createElement("link"),
+                h = d.getElementsByTagName("head")[0];
+
+            n.href = url;
+            n.type = "text/css";
+            n.rel = "stylesheet";
+            h.appendChild(n);
+        },
+       
+        /*
+         * Interns the script for the requested modules.  The callback is
+         * provided a reference to the sandboxed YAHOO object.  This only
+         * applies to the script: css can not be sandboxed.  Not implemented.
+         * @method sandbox
+         * @param callback {Function} the callback to exectued when the load is
+         *        complete.
+         * @notimplemented
+         */
+        sandbox: function(callback) {
+            // this.calculate({
+                         //sandbox: true
+                     //});
+        }
+    };
+
+    YUI.init();
+
+})();
diff --git a/lib/yui/yuitest/README b/lib/yui/yuitest/README
new file mode 100755 (executable)
index 0000000..1b174fd
--- /dev/null
@@ -0,0 +1,4 @@
+YUI Test Utility - Release Notes
+
+2.3.0
+   * Initial release
diff --git a/lib/yui/yuitest/assets/skins/sam/yuitest-skin.css b/lib/yui/yuitest/assets/skins/sam/yuitest-skin.css
new file mode 100755 (executable)
index 0000000..8b4d7cd
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
diff --git a/lib/yui/yuitest/assets/skins/sam/yuitest.css b/lib/yui/yuitest/assets/skins/sam/yuitest.css
new file mode 100755 (executable)
index 0000000..8b4d7cd
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
diff --git a/lib/yui/yuitest/assets/testlogger.css b/lib/yui/yuitest/assets/testlogger.css
new file mode 100755 (executable)
index 0000000..4158a41
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+.yui-log {padding-top:3em;}
+/*
+.yui-log-container {position:relative;width:60em}
+.yui-log .yui-log-bd {height:auto; overflow:visible;}
+*/
+.yui-log-container {width:40em}
+.yui-log .yui-log-bd {height:60em}
+.yui-log .yui-log-btns {display:none;}
+.yui-log .yui-log-ft .yui-log-sourcefilters {visibility:hidden;}
+.yui-log .yui-log-hd {display:none;}
+.yui-log .yui-log-ft {position:absolute;top:0em;}
+
+.pass {
+    background-color: green;
+    font-weight: bold;
+    color: white;
+}
+.fail {
+    background-color: red;
+    font-weight: bold;
+    color: white;
+}
+.ignore {
+    background-color: #666;
+    font-weight: bold;
+    color: white;
+}
diff --git a/lib/yui/yuitest/assets/yuitest-core.css b/lib/yui/yuitest/assets/yuitest-core.css
new file mode 100755 (executable)
index 0000000..8b4d7cd
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
diff --git a/lib/yui/yuitest/yuitest-beta-debug.js b/lib/yui/yuitest/yuitest-beta-debug.js
new file mode 100755 (executable)
index 0000000..0efbbf5
--- /dev/null
@@ -0,0 +1,2669 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestLogger object
+//-----------------------------------------------------------------------------
+
+/**
+ * Displays test execution progress and results, providing filters based on
+ * different key events.
+ * @namespace YAHOO.tool
+ * @class TestLogger
+ * @constructor
+ * @param {HTMLElement} element (Optional) The element to create the logger in.
+ * @param {Object} config (Optional) Configuration options for the logger.
+ */
+YAHOO.tool.TestLogger = function (element, config) {
+    YAHOO.tool.TestLogger.superclass.constructor.call(this, element, config);
+    this.init();
+};
+
+YAHOO.lang.extend(YAHOO.tool.TestLogger, YAHOO.widget.LogReader, {
+
+    footerEnabled : true,
+    newestOnTop : false,
+
+    /**
+     * Formats message string to HTML for output to console.
+     * @private
+     * @method formatMsg
+     * @param oLogMsg {Object} Log message object.
+     * @return {String} HTML-formatted message for output to console.
+     */
+    formatMsg : function(message /*:Object*/) {
+    
+        var category /*:String*/ = message.category;        
+        var text /*:String*/ = this.html2Text(message.msg);
+        
+        return "<pre><p><span class=\"" + category + "\">" + category.toUpperCase() + "</span> " + text + "</p></pre>";
+    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /*
+     * Initializes the logger.
+     * @private
+     */
+    init : function () {
+    
+        //attach to any available TestRunner
+        if (YAHOO.tool.TestRunner){
+            this.setTestRunner(YAHOO.tool.TestRunner);
+        }
+        
+        //hide useless sources
+        this.hideSource("global");
+        this.hideSource("LogReader");
+        
+        //hide useless message categories
+        this.hideCategory("warn");
+        this.hideCategory("window");
+        this.hideCategory("time");
+        
+        //reset the logger
+        this.clearConsole();
+    },
+    
+    /**
+     * Clears the reference to the TestRunner from previous operations. This 
+     * unsubscribes all events and removes the object reference.
+     * @return {Void}
+     * @static
+     */
+    clearTestRunner : function () /*:Void*/ {
+        if (this._runner){
+            this._runner.unsubscribeAll();
+            this._runner = null;
+        }
+    },
+    
+    /**
+     * Sets the source test runner that the logger should monitor.
+     * @param {YAHOO.tool.TestRunner} testRunner The TestRunner to observe.
+     * @return {Void}
+     * @static
+     */
+    setTestRunner : function (testRunner /*:YAHOO.tool.TestRunner*/) /*:Void*/ {
+    
+        if (this._runner){
+            this.clearTestRunner();
+        }
+        
+        this._runner = testRunner;
+        
+        //setup event _handlers
+        testRunner.subscribe(testRunner.TEST_PASS_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_FAIL_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_IGNORE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Event Handlers
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Handles all TestRunner events, outputting appropriate data into the console.
+     * @param {Object} data The event data object.
+     * @return {Void}
+     * @private
+     */
+    _handleTestRunnerEvent : function (data /*:Object*/) /*:Void*/ {
+    
+        //shortcut variables
+        var TestRunner /*:Object*/ = YAHOO.tool.TestRunner;
+    
+        //data variables
+        var message /*:String*/ = "";
+        var messageType /*:String*/ = "";
+        
+        switch(data.type){
+            case TestRunner.BEGIN_EVENT:
+                message = "Testing began at " + (new Date()).toString() + ".";
+                messageType = "info";
+                break;
+                
+            case TestRunner.COMPLETE_EVENT:
+                message = "Testing completed at " + (new Date()).toString() + ".\nPassed:" 
+                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_FAIL_EVENT:
+                message = data.testName + ": " + data.error.getMessage();
+                messageType = "fail";
+                break;
+                
+            case TestRunner.TEST_IGNORE_EVENT:
+                message = data.testName + ": ignored.";
+                messageType = "ignore";
+                break;
+                
+            case TestRunner.TEST_PASS_EVENT:
+                message = data.testName + ": passed.";
+                messageType = "pass";
+                break;
+                
+            case TestRunner.TEST_SUITE_BEGIN_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_SUITE_COMPLETE_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" completed.\nPassed:" 
+                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_BEGIN_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_COMPLETE_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" completed.\nPassed:" 
+                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+            default:
+                message = "Unexpected event " + data.type;
+                message = "info";
+        }
+    
+        YAHOO.log(message, messageType, "TestRunner");    
+    }
+    
+});
+YAHOO.namespace("tool");
+
+/**
+ * The YUI test tool
+ * @module yuitest
+ * @namespace YAHOO.tool
+ * @requires yahoo,dom,event,logger
+ */
+
+
+//-----------------------------------------------------------------------------
+// TestRunner object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs test suites and test cases, providing events to allowing for the
+ * interpretation of test results.
+ * @namespace YAHOO.tool
+ * @class TestRunner
+ * @static
+ */
+YAHOO.tool.TestRunner = (function(){
+
+    function TestRunner(){
+    
+        //inherit from EventProvider
+        TestRunner.superclass.constructor.apply(this,arguments);
+        
+        /**
+         * The test objects to run.
+         * @type Array
+         * @private
+         */
+        this.items /*:Array*/ = [];
+        
+        //create events
+        var events /*:Array*/ = [
+            this.TEST_CASE_BEGIN_EVENT,
+            this.TEST_CASE_COMPLETE_EVENT,
+            this.TEST_SUITE_BEGIN_EVENT,
+            this.TEST_SUITE_COMPLETE_EVENT,
+            this.TEST_PASS_EVENT,
+            this.TEST_FAIL_EVENT,
+            this.TEST_IGNORE_EVENT,
+            this.COMPLETE_EVENT,
+            this.BEGIN_EVENT
+        ];
+        for (var i=0; i < events.length; i++){
+            this.createEvent(events[i], { scope: this });
+        }
+       
+   
+    }
+    
+    YAHOO.lang.extend(TestRunner, YAHOO.util.EventProvider, {
+    
+        //-------------------------------------------------------------------------
+        // Constants
+        //-------------------------------------------------------------------------
+         
+        /**
+         * Fires when a test case is opened but before the first 
+         * test is executed.
+         * @event testcasebegin
+         */         
+        TEST_CASE_BEGIN_EVENT /*:String*/ : "testcasebegin",
+        
+        /**
+         * Fires when all tests in a test case have been executed.
+         * @event testcasecomplete
+         */        
+        TEST_CASE_COMPLETE_EVENT /*:String*/ : "testcasecomplete",
+        
+        /**
+         * Fires when a test suite is opened but before the first 
+         * test is executed.
+         * @event testsuitebegin
+         */        
+        TEST_SUITE_BEGIN_EVENT /*:String*/ : "testsuitebegin",
+        
+        /**
+         * Fires when all test cases in a test suite have been
+         * completed.
+         * @event testsuitecomplete
+         */        
+        TEST_SUITE_COMPLETE_EVENT /*:String*/ : "testsuitecomplete",
+        
+        /**
+         * Fires when a test has passed.
+         * @event pass
+         */        
+        TEST_PASS_EVENT /*:String*/ : "pass",
+        
+        /**
+         * Fires when a test has failed.
+         * @event fail
+         */        
+        TEST_FAIL_EVENT /*:String*/ : "fail",
+        
+        /**
+         * Fires when a test has been ignored.
+         * @event ignore
+         */        
+        TEST_IGNORE_EVENT /*:String*/ : "ignore",
+        
+        /**
+         * Fires when all test suites and test cases have been completed.
+         * @event complete
+         */        
+        COMPLETE_EVENT /*:String*/ : "complete",
+        
+        /**
+         * Fires when the run() method is called.
+         * @event begin
+         */        
+        BEGIN_EVENT /*:String*/ : "begin",    
+    
+        //-------------------------------------------------------------------------
+        // Private Methods
+        //-------------------------------------------------------------------------
+         
+        /**
+         * Runs a given test case.
+         * @param {YAHOO.tool.TestCase} testCase The test case to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @method _runTestCase
+         * @private
+         * @static
+         */
+        _runTestCase : function (testCase /*YAHOO.tool.TestCase*/) /*:Void*/{
+        
+            //object to store results
+            var results /*:Object*/ = {};
+        
+            //test case begins
+            this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testCase });
+        
+            //gather the test functions
+            var tests /*:Array*/ = [];
+            for (var prop in testCase){
+                if (prop.indexOf("test") === 0 && typeof testCase[prop] == "function") {
+                    tests.push(prop);
+                }
+            }
+            
+            //get the "should" test cases
+            var shouldFail /*:Object*/ = testCase._should.fail || {};
+            var shouldError /*:Object*/ = testCase._should.error || {};
+            var shouldIgnore /*:Object*/ = testCase._should.ignore || {};
+            
+            //test counts
+            var failCount /*:int*/ = 0;
+            var passCount /*:int*/ = 0;
+            var runCount /*:int*/ = 0;
+            
+            //run each test
+            for (var i=0; i < tests.length; i++){
+            
+                //figure out if the test should be ignored or not
+                if (shouldIgnore[tests[i]]){
+                    this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: tests[i] });
+                    continue;
+                }
+            
+                //variable to hold whether or not the test failed
+                var failed /*:Boolean*/ = false;
+                var error /*:Error*/ = null;
+            
+                //run the setup
+                testCase.setUp();
+                
+                //try the test
+                try {
+                
+                    //run the test
+                    testCase[tests[i]]();
+                    
+                    //if it should fail, and it got here, then it's a fail because it didn't
+                    if (shouldFail[tests[i]]){
+                        error = new YAHOO.util.ShouldFail();
+                        failed = true;
+                    } else if (shouldError[tests[i]]){
+                        error = new YAHOO.util.ShouldError();
+                        failed = true;
+                    }
+                               
+                } catch (thrown /*:Error*/){
+                    if (thrown instanceof YAHOO.util.AssertionError) {
+                        if (!shouldFail[tests[i]]){
+                            error = thrown;
+                            failed = true;
+                        }
+                    } else {
+                        //first check to see if it should error
+                        if (!shouldError[tests[i]]) {                        
+                            error = new YAHOO.util.UnexpectedError(thrown);
+                            failed = true;
+                        } else {
+                            //check to see what type of data we have
+                            if (YAHOO.lang.isString(shouldError[tests[i]])){
+                                
+                                //if it's a string, check the error message
+                                if (thrown.message != shouldError[tests[i]]){
+                                    error = new YAHOO.util.UnexpectedError(thrown);
+                                    failed = true;                                    
+                                }
+                            } else if (YAHOO.lang.isObject(shouldError[tests[i]])){
+                            
+                                //if it's an object, check the instance and message
+                                if (!(thrown instanceof shouldError[tests[i]].constructor) || 
+                                        thrown.message != shouldError[tests[i]].message){
+                                    error = new YAHOO.util.UnexpectedError(thrown);
+                                    failed = true;                                    
+                                }
+                            
+                            }
+                        
+                        }
+                    }
+                    
+                } finally {
+                
+                    //fireEvent appropriate event
+                    if (failed) {
+                        this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: tests[i], error: error });
+                    } else {
+                        this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: tests[i] });
+                    }            
+                }
+                
+                //run the tear down
+                testCase.tearDown();
+                
+                //update results
+                results[tests[i]] = { 
+                    result: failed ? "fail" : "pass",
+                    message : error ? error.getMessage() : "Test passed"
+                };
+                
+                //update counts
+                runCount++;
+                failCount += (failed ? 1 : 0);
+                passCount += (failed ? 0 : 1);
+            }
+            
+            //add test counts to results
+            results.total = runCount;
+            results.failed = failCount;
+            results.passed = passCount;
+            
+            //test case is done
+            this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: testCase, results: results });
+            
+            //return results
+            return results;
+        
+        },
+        
+        /**
+         * Runs all the tests in a test suite.
+         * @param {YAHOO.tool.TestSuite} testSuite The test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @method _runTestSuite
+         * @private
+         * @static
+         */
+        _runTestSuite : function (testSuite /*:YAHOO.tool.TestSuite*/) {
+        
+            //object to store results
+            var results /*:Object*/ = {
+                passed: 0,
+                failed: 0,
+                total: 0
+            };
+        
+            //fireEvent event for beginning of test suite run
+            this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testSuite });
+        
+            //iterate over the test suite items
+            for (var i=0; i < testSuite.items.length; i++){
+                var result = null;
+                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    result = this._runTestSuite(testSuite.items[i]);
+                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    result = this._runTestCase(testSuite.items[i]);
+                }
+                
+                if (result !== null){
+                    results.total += result.total;
+                    results.passed += result.passed;
+                    results.failed += result.failed;
+                    results[testSuite.items[i].name] = result;
+                }
+            }
+    
+            //fireEvent event for completion of test suite run
+            this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: testSuite, results: results });
+            
+            //return the results
+            return results;
+        
+        },
+        
+        /**
+         * Runs a test case or test suite, returning the results.
+         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @private
+         * @method _run
+         * @static
+         */
+        _run : function (testObject /*:YAHOO.tool.TestCase|YAHOO.tool.TestSuite*/) /*:Void*/ {
+            if (YAHOO.lang.isObject(testObject)){
+                if (testObject instanceof YAHOO.tool.TestSuite) {
+                    return this._runTestSuite(testObject);
+                } else if (testObject instanceof YAHOO.tool.TestCase) {
+                    return this._runTestCase(testObject);
+                } else {
+                    throw new TypeError("_run(): Expected either YAHOO.tool.TestCase or YAHOO.tool.TestSuite.");
+                }    
+            }        
+        },
+        
+        //-------------------------------------------------------------------------
+        // Protected Methods
+        //-------------------------------------------------------------------------   
+    
+        /*
+         * Fires events for the TestRunner. This overrides the default fireEvent()
+         * method from EventProvider to add the type property to the data that is
+         * passed through on each event call.
+         * @param {String} type The type of event to fire.
+         * @param {Object} data (Optional) Data for the event.
+         * @method fireEvent
+         * @static
+         * @protected
+         */
+        fireEvent : function (type /*:String*/, data /*:Object*/) /*:Void*/ {
+            data = data || {};
+            data.type = type;
+            TestRunner.superclass.fireEvent.call(this, type, data);
+        },
+        
+        //-------------------------------------------------------------------------
+        // Public Methods
+        //-------------------------------------------------------------------------   
+    
+        /**
+         * Adds a test suite or test case to the list of test objects to run.
+         * @param testObject Either a TestCase or a TestSuite that should be run.
+         */
+        add : function (testObject /*:Object*/) /*:Void*/ {
+            this.items.push(testObject);
+        },
+        
+        /**
+         * Removes all test objects from the runner.
+         */
+        clear : function () /*:Void*/ {
+            while(this.items.length){
+                this.items.pop();
+            }
+        },
+    
+        /**
+         * Runs the test suite.
+         */
+        run : function (testObject /*:Object*/) /*:Void*/ { 
+            var results = null;
+            
+            this.fireEvent(this.BEGIN_EVENT);
+       
+            //an object passed in overrides everything else
+            if (YAHOO.lang.isObject(testObject)){
+                results = this._run(testObject);  
+            } else {
+                results = {
+                    passed: 0,
+                    failed: 0,
+                    total: 0
+                };
+                for (var i=0; i < this.items.length; i++){
+                    var result = this._run(this.items[i]);
+                    results.passed += result.passed;
+                    results.failed += result.failed;
+                    results.total += result.total;
+                    results[this.items[i].name] = result;
+                }            
+            }
+            
+            this.fireEvent(this.COMPLETE_EVENT, { results: results });
+        }    
+    });
+    
+    return new TestRunner();
+    
+})();
+YAHOO.namespace("tool");
+
+
+//-----------------------------------------------------------------------------
+// TestSuite object
+//-----------------------------------------------------------------------------
+
+/**
+ * A test suite that can contain a collection of TestCase and TestSuite objects.
+ * @param {String} name The name of the test fixture.
+ * @namespace YAHOO.tool
+ * @class TestSuite
+ * @constructor
+ */
+YAHOO.tool.TestSuite = function (name /*:String*/) {
+
+    /**
+     * The name of the test suite.
+     */
+    this.name /*:String*/ = name || YAHOO.util.Dom.generateId(null, "testSuite");
+
+    /**
+     * Array of test suites and
+     * @private
+     */
+    this.items /*:Array*/ = [];
+
+};
+
+YAHOO.tool.TestSuite.prototype = {
+    
+    /**
+     * Adds a test suite or test case to the test suite.
+     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
+     */
+    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
+            this.items.push(testObject);
+        }
+    }
+    
+};
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestCase object
+//-----------------------------------------------------------------------------
+
+/**
+ * Test case containing various tests to run.
+ * @param template An object containing any number of test methods, other methods,
+ *                 an optional name, and anything else the test case needs.
+ * @class TestCase
+ * @namespace YAHOO.tool
+ * @constructor
+ */
+YAHOO.tool.TestCase = function (template /*:Object*/) {
+    
+    /**
+     * Special rules for the test case. Possible subobjects
+     * are fail, for tests that should fail, and error, for
+     * tests that should throw an error.
+     */
+    this._should /*:Object*/ = {};
+    
+    //copy over all properties from the template to this object
+    for (var prop in template) {
+        this[prop] = template[prop];
+    }    
+    
+    //check for a valid name
+    if (!YAHOO.lang.isString(this.name)){
+        /**
+         * Name for the test case.
+         */
+        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
+    }
+
+};
+
+YAHOO.tool.TestCase.prototype = {  
+
+    //-------------------------------------------------------------------------
+    // Test Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     */
+    tearDown: function () /*:Void*/ {    
+    }
+};
+YAHOO.namespace("util");
+
+//-----------------------------------------------------------------------------
+// Assert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The Assert object provides functions to test JavaScript values against
+ * known and expected results. Whenever a comparison (assertion) fails,
+ * an error is thrown.
+ *
+ * @namespace YAHOO.util
+ * @class Assert
+ * @static
+ */
+YAHOO.util.Assert = {
+
+    //-------------------------------------------------------------------------
+    // Generic Assertion Methods
+    //-------------------------------------------------------------------------
+    
+    /** 
+     * Forces an assertion error to occur.
+     * @param {String} message (Optional) The message to display with the failure.
+     * @method fail
+     * @static
+     */
+    fail : function (message /*:String*/) /*:Void*/ {
+        throw new YAHOO.util.AssertionError(message || "Test force-failed.");
+    },       
+    
+    //-------------------------------------------------------------------------
+    // Equality Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    areEqual : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected != actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be equal.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotEqual
+     * @static
+     */
+    areNotEqual : function (unexpected /*:Object*/, actual /*:Object*/, 
+                         message /*:String*/) /*:Void*/ {
+        if (unexpected == actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be equal.", unexpected);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotSame
+     * @static
+     */
+    areNotSame : function (unexpected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (unexpected === actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be the same.", unexpected);
+        }
+    },
+
+    /**
+     * Asserts that a value is the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areSame
+     * @static
+     */
+    areSame : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be the same.", expected, actual);
+        }
+    },    
+    
+    //-------------------------------------------------------------------------
+    // Boolean Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is false. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFalse
+     * @static
+     */
+    isFalse : function (actual /*:Boolean*/, message /*:String*/) {
+        if (false !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be false.", false, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is true. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTrue
+     * @static
+     */
+    isTrue : function (actual /*:Boolean*/, message /*:String*/) /*:Void*/ {
+        if (true !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be true.", true, actual);
+        }
+
+    },
+    
+    //-------------------------------------------------------------------------
+    // Special Value Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is not a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNaN
+     * @static
+     */
+    isNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (!isNaN(actual)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be NaN.", NaN, actual);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not the special NaN value.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNaN
+     * @static
+     */
+    isNotNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (isNaN(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be NaN.", NaN);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNull
+     * @static
+     */
+    isNotNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be null.", null);
+        }
+    },
+
+    /**
+     * Asserts that a value is not undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotUndefined
+     * @static
+     */
+    isNotUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Value should not be undefined.", undefined);
+        }
+    },
+
+    /**
+     * Asserts that a value is null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNull
+     * @static
+     */
+    isNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be null.", null, actual);
+        }
+    },
+        
+    /**
+     * Asserts that a value is undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isUndefined
+     * @static
+     */
+    isUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be undefined.", undefined, actual);
+        }
+    },    
+    
+    //--------------------------------------------------------------------------
+    // Instance Assertion Methods
+    //--------------------------------------------------------------------------    
+   
+    /**
+     * Asserts that a value is an array.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isArray
+     * @static
+     */
+    isArray : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isArray(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an array.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a Boolean.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isBoolean
+     * @static
+     */
+    isBoolean : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isBoolean(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a Boolean.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a function.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFunction
+     * @static
+     */
+    isFunction : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isFunction(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a function.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is an instance of a particular object. This may return
+     * incorrect results when comparing objects from one frame to constructors in
+     * another frame. For best results, don't use in a cross-frame manner.
+     * @param {Function} expected The function that the object should be an instance of.
+     * @param {Object} actual The object to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isInstanceOf
+     * @static
+     */
+    isInstanceOf : function (expected /*:Function*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!(actual instanceof expected)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value isn't an instance of expected type.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNumber
+     * @static
+     */
+    isNumber : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNumber(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a number.", actual);
+        }    
+    },    
+    
+    /**
+     * Asserts that a value is an object.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isObject
+     * @static
+     */
+    isObject : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isObject(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an object.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a string.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isString
+     * @static
+     */
+    isString : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isString(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a string.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is of a particular type. 
+     * @param {String} expectedType The expected type of the variable.
+     * @param {Object} actualValue The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTypeOf
+     * @static
+     */
+    isTypeOf : function (expectedType /*:String*/, actualValue /*:Object*/, message /*:String*/) /*:Void*/{
+        if (typeof actualValue != expectedType){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be of type " + expected + ".", expected, typeof actual);
+        }
+    }
+};
+
+//-----------------------------------------------------------------------------
+// Assertion errors
+//-----------------------------------------------------------------------------
+
+/**
+ * AssertionError is thrown whenever an assertion fails. It provides methods
+ * to more easily get at error information and also provides a base class
+ * from which more specific assertion errors can be derived.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @class AssertionError
+ * @extends Error
+ * @constructor
+ */ 
+YAHOO.util.AssertionError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /*
+     * Error message. Must be duplicated to ensure browser receives it.
+     * @type String
+     * @property message
+     */
+    this.message /*:String*/ = message;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "AssertionError";
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.AssertionError, Error, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This should
+     * be overridden by all subclasses to provide specific information.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message;
+    },
+    
+    /**
+     * Returns a string representation of the error.
+     * @method toString
+     * @return {String} A string representation of the error.
+     */
+    toString : function () /*:String*/ {
+        return this.name + ": " + this.getMessage();
+    },
+    
+    /**
+     * Returns a primitive value version of the error. Same as toString().
+     * @method valueOf
+     * @return {String} A primitive value version of the error.
+     */
+    valueOf : function () /*:String*/ {
+        return this.toString();
+    }
+
+});
+
+/**
+ * ComparisonFailure is subclass of AssertionError that is thrown whenever
+ * a comparison between two values fails. It provides mechanisms to retrieve
+ * both the expected and actual value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} expected The expected value.
+ * @param {Object} actual The actual value that caused the assertion to fail.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ComparisonFailure
+ * @constructor
+ */ 
+YAHOO.util.ComparisonFailure = function (message /*:String*/, expected /*:Object*/, actual /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The expected value.
+     * @type Object
+     * @property expected
+     */
+    this.expected /*:Object*/ = expected;
+    
+    /**
+     * The actual value.
+     * @type Object
+     * @property actual
+     */
+    this.actual /*:Object*/ = actual;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ComparisonFailure";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ComparisonFailure, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This message
+     * provides information about the expected and actual values.
+     * @method toString
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nExpected: " + this.expected + " (" + (typeof this.expected) + ")"  +
+            "\nActual:" + this.actual + " (" + (typeof this.actual) + ")";
+    }
+
+});
+
+/**
+ * UnexpectedValue is subclass of AssertionError that is thrown whenever
+ * a value was unexpected in its scope. This typically means that a test
+ * was performed to determine that a value was *not* equal to a certain
+ * value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} unexpected The unexpected value.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedValue
+ * @constructor
+ */ 
+YAHOO.util.UnexpectedValue = function (message /*:String*/, unexpected /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The unexpected value.
+     * @type Object
+     * @property unexpected
+     */
+    this.unexpected /*:Object*/ = unexpected;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedValue";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedValue, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. The message
+     * contains information about the unexpected value that was encountered.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nUnexpected: " + this.unexpected + " (" + (typeof this.unexpected) + ") ";
+    }
+
+});
+
+/**
+ * ShouldFail is subclass of AssertionError that is thrown whenever
+ * a test was expected to fail but did not.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldFail
+ * @constructor
+ */  
+YAHOO.util.ShouldFail = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should fail but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldFail";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldFail, YAHOO.util.AssertionError);
+
+/**
+ * ShouldError is subclass of AssertionError that is thrown whenever
+ * a test is expected to throw an error but doesn't.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldError
+ * @constructor
+ */  
+YAHOO.util.ShouldError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should have thrown an error but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldError, YAHOO.util.AssertionError);
+
+/**
+ * UnexpectedError is subclass of AssertionError that is thrown whenever
+ * an error occurs within the course of a test and the test was not expected
+ * to throw an error.
+ *
+ * @param {Error} cause The unexpected error that caused this error to be 
+ *                      thrown.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedError
+ * @constructor
+ */  
+YAHOO.util.UnexpectedError = function (cause /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, "Unexpected error: " + cause.message);
+    
+    /**
+     * The unexpected error that occurred.
+     * @type Error
+     * @property cause
+     */
+    this.cause /*:Error*/ = cause;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedError, YAHOO.util.AssertionError);
+//-----------------------------------------------------------------------------
+// ArrayAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ArrayAssert object provides functions to test JavaScript array objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ArrayAssert
+ * @static
+ */
+YAHOO.util.ArrayAssert = {
+
+    /**
+     * Asserts that a value is present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method contains
+     * @static
+     */
+    contains : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value (" + needle + ") not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * be found.
+     * @param {Object[]} needles An array of values that are expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsItems
+     * @static
+     */
+    containsItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        //begin checking values
+        for (var i=0; i < needles.length; i++){
+            this.contains(needles[i], haystack, message);
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value matching some condition is present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsMatch
+     * @static
+     */
+    containsMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");
+        }
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "No match found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value is not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContain
+     * @static
+     */
+    doesNotContain : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * not be found.
+     * @param {Object[]} needles An array of values that are not expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainItems
+     * @static
+     */
+    doesNotContainItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        for (var i=0; i < needles.length; i++){
+            this.doesNotContain(needles[i], haystack, message);
+        }
+
+    },
+        
+    /**
+     * Asserts that no values matching a condition are present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainMatch
+     * @static
+     */
+    doesNotContainMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");
+        }
+
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+        
+    /**
+     * Asserts that the given value is contained in an array at the specified index.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method indexOf
+     * @static
+     */
+    indexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=0; i < haystack.length; i++){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    },
+        
+    /**
+     * Asserts that the values in an array are equal, and in the same position,
+     * as values in another array. This uses the double equals sign
+     * so type cohersion may occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreEqual
+     * @static
+     */
+    itemsAreEqual : function (expected /*:Array*/, actual /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areEqual(expected[i], actual[i], message || 
+                    "Values in position " + i + " are not equal.");
+        }
+    },
+    
+    /**
+     * Asserts that the values in an array are equivalent, and in the same position,
+     * as values in another array. This uses a function to determine if the values
+     * are equivalent. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {Function} comparator A function that returns true if the values are equivalent
+     *      or false if not.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @return {Void}
+     * @method itemsAreEquivalent
+     * @static
+     */
+    itemsAreEquivalent : function (expected /*:Array*/, actual /*:Array*/, 
+                           comparator /*:Function*/, message /*:String*/) /*:Void*/ {
+        
+        //make sure the comparator is valid
+        if (typeof comparator != "function"){
+            throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");
+        }
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            if (!comparator(expected[i], actual[i])){
+                throw new YAHOO.util.ComparisonFailure(message || "Values in position " + i + " are not equivalent.", expected[i], actual[i]);
+            }
+        }
+    },
+    
+    /**
+     * Asserts that an array is empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isEmpty
+     * @static
+     */
+    isEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length > 0){
+            YAHOO.util.Assert.fail(message || "Array should be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that an array is not empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotEmpty
+     * @static
+     */
+    isNotEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length === 0){
+            YAHOO.util.Assert.fail(message || "Array should not be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that the values in an array are the same, and in the same position,
+     * as values in another array. This uses the triple equals sign
+     * so no type cohersion will occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreSame
+     * @static
+     */
+    itemsAreSame : function (expected /*:Array*/, actual /*:Array*/, 
+                          message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areSame(expected[i], actual[i], 
+                message || "Values in position " + i + " are not the same.");
+        }
+    },
+    
+    /**
+     * Asserts that the given value is contained in an array at the specified index,
+     * starting from the back of the array.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method lastIndexOf
+     * @static
+     */
+    lastIndexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=haystack.length; i >= 0; i--){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    }
+    
+};
+YAHOO.namespace("util");
+
+
+//-----------------------------------------------------------------------------
+// ObjectAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ObjectAssert object provides functions to test JavaScript objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ObjectAssert
+ * @static
+ */
+YAHOO.util.ObjectAssert = {
+        
+    /**
+     * Asserts that all properties in the object exist in another object.
+     * @param {Object} expected An object with the expected properties.
+     * @param {Object} actual An object with the actual properties.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method propertiesAreEqual
+     * @static
+     */
+    propertiesAreEqual : function (expected /*:Object*/, actual /*:Object*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //get all properties in the object
+        var properties /*:Array*/ = [];        
+        for (var property in expected){
+            properties.push(property);
+        }
+        
+        //see if the properties are in the expected object
+        for (var i=0; i < properties.length; i++){
+            YAHOO.util.Assert.isNotUndefined(actual[properties[i]], message || 
+                    "Property'" + properties[i] + "' expected.");
+        }
+
+    },
+    
+    /**
+     * Asserts that an object has a property with the given name.
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(object[propertyName])){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object.");
+        }    
+    },
+    
+    /**
+     * Asserts that a property with the given name exists on an object instance (not on its prototype).
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasOwnProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.hasOwnProperty(object, propertyName)){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object instance.");
+        }     
+    }
+};
+//-----------------------------------------------------------------------------
+// DateAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The DateAssert object provides functions to test JavaScript Date objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class DateAssert
+ * @static
+ */
+YAHOO.util.DateAssert = {
+
+    /**
+     * Asserts that a date's month, day, and year are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    datesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getFullYear(), actual.getFullYear(), message || "Years should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMonth(), actual.getMonth(), message || "Months should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getDate(), actual.getDate(), message || "Day of month should be equal.");
+        } else {
+            throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    },
+
+    /**
+     * Asserts that a date's hour, minutes, and seconds are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    timesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getHours(), actual.getHours(), message || "Hours should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMinutes(), actual.getMinutes(), message || "Minutes should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getSeconds(), actual.getSeconds(), message || "Seconds should be equal.");
+        } else {
+            throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    }
+    
+};
+YAHOO.namespace("util");
+
+/**
+ * The UserAction object provides functions that simulate events occurring in
+ * the browser. Since these are simulated events, they do not behave exactly
+ * as regular, user-initiated events do, but can be used to test simple
+ * user interactions safely.
+ *
+ * @namespace YAHOO.util
+ * @class UserAction
+ * @static
+ */
+YAHOO.util.UserAction = {
+
+    //--------------------------------------------------------------------------
+    // Generic event methods
+    //--------------------------------------------------------------------------
+
+    /**
+     * Simulates a key event using the given event information to populate
+     * the generated event object. This method does browser-equalizing
+     * calculations to account for differences in the DOM and IE event models
+     * as well as different browser quirks. Note: keydown causes Safari 2.x to
+     * crash.
+     * @method simulateKeyEvent
+     * @private
+     * @static
+     * @param {HTMLElement} target The target of the given event.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: keyup, keydown, and keypress.
+     * @param {Boolean} bubbles (Optional) Indicates if the event can be
+     *      bubbled up. DOM Level 3 specifies that all key events bubble by
+     *      default. The default is true.
+     * @param {Boolean} cancelable (Optional) Indicates if the event can be
+     *      canceled using preventDefault(). DOM Level 3 specifies that all
+     *      key events can be cancelled. The default 
+     *      is true.
+     * @param {Window} view (Optional) The view containing the target. This is
+     *      typically the window object. The default is window.
+     * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} metaKey (Optional) Indicates if one of the META keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {int} keyCode (Optional) The code for the key that is in use. 
+     *      The default is 0.
+     * @param {int} charCode (Optional) The Unicode code for the character
+     *      associated with the key being used. The default is 0.
+     */
+    simulateKeyEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                                 bubbles /*:Boolean*/,  cancelable /*:Boolean*/,    
+                                 view /*:Window*/,
+                                 ctrlKey /*:Boolean*/,    altKey /*:Boolean*/, 
+                                 shiftKey /*:Boolean*/,   metaKey /*:Boolean*/, 
+                                 keyCode /*:int*/,        charCode /*:int*/) /*:Void*/                             
+    {
+        //check target
+        target = YAHOO.util.Dom.get(target);        
+        if (!target){
+            throw new Error("simulateKeyEvent(): Invalid target.");
+        }
+        
+        //check event type
+        if (YAHOO.lang.isString(type)){
+            type = type.toLowerCase();
+            switch(type){
+                case "keyup":
+                case "keydown":
+                case "keypress":
+                    break;
+                case "textevent": //DOM Level 3
+                    type = "keypress";
+                    break;
+                    // @TODO was the fallthrough intentional, if so throw error
+                default:
+                    throw new Error("simulateKeyEvent(): Event type '" + type + "' not supported.");
+            }
+        } else {
+            throw new Error("simulateKeyEvent(): Event type must be a string.");
+        }
+        
+        //setup default values
+        if (!YAHOO.lang.isBoolean(bubbles)){
+            bubbles = true; //all key events bubble
+        }
+        if (!YAHOO.lang.isBoolean(cancelable)){
+            cancelable = true; //all key events can be cancelled
+        }
+        if (!YAHOO.lang.isObject(view)){
+            view = window; //view is typically window
+        }
+        if (!YAHOO.lang.isBoolean(ctrlKey)){
+            ctrlKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(altKey)){
+            altKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(shiftKey)){
+            shiftKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(metaKey)){
+            metaKey = false;
+        }
+        if (!YAHOO.lang.isNumber(keyCode)){
+            keyCode = 0;
+        }
+        if (!YAHOO.lang.isNumber(charCode)){
+            charCode = 0; 
+        }
+        
+        //check for DOM-compliant browsers first
+        if (YAHOO.lang.isFunction(document.createEvent)){
+        
+            //try to create a mouse event
+            var event /*:MouseEvent*/ = null;
+            
+            try {
+                
+                //try to create key event
+                event = document.createEvent("KeyEvents");
+                
+                /*
+                 * Interesting problem: Firefox implemented a non-standard
+                 * version of initKeyEvent() based on DOM Level 2 specs.
+                 * Key event was removed from DOM Level 2 and re-introduced
+                 * in DOM Level 3 with a different interface. Firefox is the
+                 * only browser with any implementation of Key Events, so for
+                 * now, assume it's Firefox if the above line doesn't error.
+                 */
+                //TODO: Decipher between Firefox's implementation and a correct one.
+                event.initKeyEvent(type, bubbles, cancelable, view, ctrlKey,
+                    altKey, shiftKey, metaKey, keyCode, charCode);       
+                
+            } catch (ex /*:Error*/){
+
+                /*
+                 * If it got here, that means key events aren't officially supported. 
+                 * Safari/WebKit is a real problem now. WebKit 522 won't let you
+                 * set keyCode, charCode, or other properties if you use a
+                 * UIEvent, so we first must try to create a generic event. The
+                 * fun part is that this will throw an error on Safari 2.x. The
+                 * end result is that we need another try...catch statement just to
+                 * deal with this mess.
+                 */
+                try {
+
+                    //try to create generic event - will fail in Safari 2.x
+                    event = document.createEvent("Events");
+
+                } catch (uierror /*:Error*/){
+
+                    //the above failed, so create a UIEvent for Safari 2.x
+                    event = document.createEvent("UIEvents");
+
+                } finally {
+
+                    event.initEvent(type, bubbles, cancelable);
+    
+                    //initialize
+                    event.view = view;
+                    event.altKey = altKey;
+                    event.ctrlKey = ctrlKey;
+                    event.shiftKey = shiftKey;
+                    event.metaKey = metaKey;
+                    event.keyCode = keyCode;
+                    event.charCode = charCode;
+          
+                }          
+             
+            }
+            
+            //fire the event
+            target.dispatchEvent(event);
+
+        } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
+        
+            //create an IE event object
+            event = document.createEventObject();
+            
+            //assign available properties
+            event.bubbles = bubbles;
+            event.cancelable = cancelable;
+            event.view = view;
+            event.ctrlKey = ctrlKey;
+            event.altKey = altKey;
+            event.shiftKey = shiftKey;
+            event.metaKey = metaKey;
+            
+            /*
+             * IE doesn't support charCode explicitly. CharCode should
+             * take precedence over any keyCode value for accurate
+             * representation.
+             */
+            event.keyCode = (charCode > 0) ? charCode : keyCode;
+            
+            //fire the event
+            target.fireEvent("on" + type, event);  
+                    
+        } else {
+            throw new Error("simulateKeyEvent(): No event simulation framework present.");
+        }
+    },
+
+    /**
+     * Simulates a mouse event using the given event information to populate
+     * the generated event object. This method does browser-equalizing
+     * calculations to account for differences in the DOM and IE event models
+     * as well as different browser quirks.
+     * @method simulateMouseEvent
+     * @private
+     * @static
+     * @param {HTMLElement} target The target of the given event.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: click, dblclick, mousedown, mouseup, mouseout,
+     *      mouseover, and mousemove.
+     * @param {Boolean} bubbles (Optional) Indicates if the event can be
+     *      bubbled up. DOM Level 2 specifies that all mouse events bubble by
+     *      default. The default is true.
+     * @param {Boolean} cancelable (Optional) Indicates if the event can be
+     *      canceled using preventDefault(). DOM Level 2 specifies that all
+     *      mouse events except mousemove can be cancelled. The default 
+     *      is true for all events except mousemove, for which the default 
+     *      is false.
+     * @param {Window} view (Optional) The view containing the target. This is
+     *      typically the window object. The default is window.
+     * @param {int} detail (Optional) The number of times the mouse button has
+     *      been used. The default value is 1.
+     * @param {int} screenX (Optional) The x-coordinate on the screen at which
+     *      point the event occured. The default is 0.
+     * @param {int} screenY (Optional) The y-coordinate on the screen at which
+     *      point the event occured. The default is 0.
+     * @param {int} clientX (Optional) The x-coordinate on the client at which
+     *      point the event occured. The default is 0.
+     * @param {int} clientY (Optional) The y-coordinate on the client at which
+     *      point the event occured. The default is 0.
+     * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} metaKey (Optional) Indicates if one of the META keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {int} button (Optional) The button being pressed while the event
+     *      is executing. The value should be 0 for the primary mouse button
+     *      (typically the left button), 1 for the terciary mouse button
+     *      (typically the middle button), and 2 for the secondary mouse button
+     *      (typically the right button). The default is 0.
+     * @param {HTMLElement} relatedTarget (Optional) For mouseout events,
+     *      this is the element that the mouse has moved to. For mouseover
+     *      events, this is the element that the mouse has moved from. This
+     *      argument is ignored for all other events. The default is null.
+     */
+    simulateMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                                   bubbles /*:Boolean*/,  cancelable /*:Boolean*/,    
+                                   view /*:Window*/,        detail /*:int*/, 
+                                   screenX /*:int*/,        screenY /*:int*/, 
+                                   clientX /*:int*/,        clientY /*:int*/,       
+                                   ctrlKey /*:Boolean*/,    altKey /*:Boolean*/, 
+                                   shiftKey /*:Boolean*/,   metaKey /*:Boolean*/, 
+                                   button /*:int*/,         relatedTarget /*:HTMLElement*/) /*:Void*/
+    {
+        
+        //check target
+        target = YAHOO.util.Dom.get(target);        
+        if (!target){
+            throw new Error("simulateMouseEvent(): Invalid target.");
+        }
+        
+        //check event type
+        if (YAHOO.lang.isString(type)){
+            type = type.toLowerCase();
+            switch(type){
+                case "mouseover":
+                case "mouseout":
+                case "mousedown":
+                case "mouseup":
+                case "click":
+                case "dblclick":
+                case "mousemove":
+                    break;
+                default:
+                    throw new Error("simulateMouseEvent(): Event type '" + type + "' not supported.");
+            }
+        } else {
+            throw new Error("simulateMouseEvent(): Event type must be a string.");
+        }
+        
+        //setup default values
+        if (!YAHOO.lang.isBoolean(bubbles)){
+            bubbles = true; //all mouse events bubble
+        }
+        if (!YAHOO.lang.isBoolean(cancelable)){
+            cancelable = (type != "mousemove"); //mousemove is the only one that can't be cancelled
+        }
+        if (!YAHOO.lang.isObject(view)){
+            view = window; //view is typically window
+        }
+        if (!YAHOO.lang.isNumber(detail)){
+            detail = 1;  //number of mouse clicks must be at least one
+        }
+        if (!YAHOO.lang.isNumber(screenX)){
+            screenX = 0; 
+        }
+        if (!YAHOO.lang.isNumber(screenY)){
+            screenY = 0; 
+        }
+        if (!YAHOO.lang.isNumber(clientX)){
+            clientX = 0; 
+        }
+        if (!YAHOO.lang.isNumber(clientY)){
+            clientY = 0; 
+        }
+        if (!YAHOO.lang.isBoolean(ctrlKey)){
+            ctrlKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(altKey)){
+            altKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(shiftKey)){
+            shiftKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(metaKey)){
+            metaKey = false;
+        }
+        if (!YAHOO.lang.isNumber(button)){
+            button = 0; 
+        }
+        
+        //check for DOM-compliant browsers first
+        if (YAHOO.lang.isFunction(document.createEvent)){
+        
+            //try to create a mouse event
+            var event /*:MouseEvent*/ = document.createEvent("MouseEvents");
+            
+            //Safari 2.x (WebKit 418) still doesn't implement initMouseEvent()
+            if (event.initMouseEvent){
+                event.initMouseEvent(type, bubbles, cancelable, view, detail,
+                                     screenX, screenY, clientX, clientY, 
+                                     ctrlKey, altKey, shiftKey, metaKey, 
+                                     button, relatedTarget);
+            } else { //Safari
+            
+                //the closest thing available in Safari 2.x is UIEvents
+                event = document.createEvent("UIEvents");
+                event.initEvent(type, bubbles, cancelable);
+                event.view = view;
+                event.detail = detail;
+                event.screenX = screenX;
+                event.screenY = screenY;
+                event.clientX = clientX;
+                event.clientY = clientY;
+                event.ctrlKey = ctrlKey;
+                event.altKey = altKey;
+                event.metaKey = metaKey;
+                event.shiftKey = shiftKey;
+                event.button = button;
+                event.relatedTarget = relatedTarget;
+            }
+            
+            /*
+             * Check to see if relatedTarget has been assigned. Firefox
+             * versions less than 2.0 don't allow it to be assigned via
+             * initMouseEvent() and the property is readonly after event
+             * creation, so in order to keep YAHOO.util.getRelatedTarget()
+             * working, assign to the IE proprietary toElement property
+             * for mouseout event and fromElement property for mouseover
+             * event.
+             */
+            if (relatedTarget && !event.relatedTarget){
+                if (type == "mouseout"){
+                    event.toElement = relatedTarget;
+                } else if (type == "mouseover"){
+                    event.fromElement = relatedTarget;
+                }
+            }
+            
+            //fire the event
+            target.dispatchEvent(event);
+
+        } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
+        
+            //create an IE event object
+            event = document.createEventObject();
+            
+            //assign available properties
+            event.bubbles = bubbles;
+            event.cancelable = cancelable;
+            event.view = view;
+            event.detail = detail;
+            event.screenX = screenX;
+            event.screenY = screenY;
+            event.clientX = clientX;
+            event.clientY = clientY;
+            event.ctrlKey = ctrlKey;
+            event.altKey = altKey;
+            event.metaKey = metaKey;
+            event.shiftKey = shiftKey;
+
+            //fix button property for IE's wacky implementation
+            switch(button){
+                case 0:
+                    event.button = 1;
+                    break;
+                case 1:
+                    event.button = 4;
+                    break;
+                case 2:
+                    //leave as is
+                    break;
+                default:
+                    event.button = 0;                    
+            }    
+
+            /*
+             * Have to use relatedTarget because IE won't allow assignment
+             * to toElement or fromElement on generic events. This keeps
+             * YAHOO.util.Event.getRelatedTarget() functional.
+             */
+            event.relatedTarget = relatedTarget;
+            
+            //fire the event
+            target.fireEvent("on" + type, event);
+                    
+        } else {
+            throw new Error("simulateMouseEvent(): No event simulation framework present.");
+        }
+    },
+   
+    //--------------------------------------------------------------------------
+    // Mouse events
+    //--------------------------------------------------------------------------
+
+    /**
+     * Simulates a mouse event on a particular element.
+     * @param {HTMLElement} target The element to click on.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: click, dblclick, mousedown, mouseup, mouseout,
+     *      mouseover, and mousemove.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseEvent
+     * @static
+     */
+    fireMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                           options /*:Object*/) /*:Void*/
+    {
+        options = options || {};
+        this.simulateMouseEvent(target, type, options.bubbles,
+            options.cancelable, options.view, options.detail, options.screenX,        
+            options.screenY, options.clientX, options.clientY, options.ctrlKey,
+            options.altKey, options.shiftKey, options.metaKey, options.button,         
+            options.relatedTarget);        
+    },
+
+    /**
+     * Simulates a click on a particular element.
+     * @param {HTMLElement} target The element to click on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method click
+     * @static     
+     */
+    click : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "click", options);
+    },
+    
+    /**
+     * Simulates a double click on a particular element.
+     * @param {HTMLElement} target The element to double click on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method dblclick
+     * @static
+     */
+    dblclick : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireMouseEvent( target, "dblclick", options);
+    },
+    
+    /**
+     * Simulates a mousedown on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mousedown
+     * @static
+     */
+    mousedown : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mousedown", options);
+    },
+    
+    /**
+     * Simulates a mousemove on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mousemove
+     * @static
+     */
+    mousemove : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mousemove", options);
+    },
+    
+    /**
+     * Simulates a mouseout event on a particular element. Use "relatedTarget"
+     * on the options object to specify where the mouse moved to.
+     * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so
+     * toElement is assigned in its place. IE doesn't allow toElement to be
+     * be assigned, so relatedTarget is assigned in its place. Both of these
+     * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly
+     * in both browsers.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseout
+     * @static
+     */
+    mouseout : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseout", options);
+    },
+    
+    /**
+     * Simulates a mouseover event on a particular element. Use "relatedTarget"
+     * on the options object to specify where the mouse moved from.
+     * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so
+     * fromElement is assigned in its place. IE doesn't allow fromElement to be
+     * be assigned, so relatedTarget is assigned in its place. Both of these
+     * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly
+     * in both browsers.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseover
+     * @static
+     */
+    mouseover : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseover", options);
+    },
+    
+    /**
+     * Simulates a mouseup on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseup
+     * @static
+     */
+    mouseup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseup", options);
+    },
+    
+    //--------------------------------------------------------------------------
+    // Key events
+    //--------------------------------------------------------------------------
+
+    /**
+     * Fires an event that normally would be fired by the keyboard (keyup,
+     * keydown, keypress). Make sure to specify either keyCode or charCode as
+     * an option.
+     * @private
+     * @param {String} type The type of event ("keyup", "keydown" or "keypress").
+     * @param {HTMLElement} target The target of the event.
+     * @param {Object} options Options for the event. Either keyCode or charCode
+     *                         are required.
+     * @method fireKeyEvent
+     * @static
+     */     
+    fireKeyEvent : function (type /*:String*/, target /*:HTMLElement*/,
+                             options /*:Object*/) /*:Void*/ 
+    {
+        options = options || {};
+        this.simulateKeyEvent(target, type, options.bubbles,
+            options.cancelable, options.view, options.ctrlKey,
+            options.altKey, options.shiftKey, options.metaKey, 
+            options.keyCode, options.charCode);    
+    },
+    
+    /**
+     * Simulates a keydown event on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keydown
+     * @static
+     */
+    keydown : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireKeyEvent("keydown", target, options);
+    },
+    
+    /**
+     * Simulates a keypress on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keypress
+     * @static
+     */
+    keypress : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireKeyEvent("keypress", target, options);
+    },
+    
+    /**
+     * Simulates a keyup event on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keyup
+     * @static
+     */
+    keyup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireKeyEvent("keyup", target, options);
+    }
+    
+
+};
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestManager object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs pages containing test suite definitions.
+ * @namespace YAHOO.tool
+ * @class TestManager
+ * @static
+ */
+YAHOO.tool.TestManager = {
+
+    /**
+     * Constant for the testpagebegin custom event
+     * @property TEST_PAGE_BEGIN_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_PAGE_BEGIN_EVENT /*:String*/ : "testpagebegin",
+
+    /**
+     * Constant for the testpagecomplete custom event
+     * @property TEST_PAGE_COMPLETE_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_PAGE_COMPLETE_EVENT /*:String*/ : "testpagecomplete",
+
+    /**
+     * Constant for the testmanagerbegin custom event
+     * @property TEST_MANAGER_BEGIN_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_MANAGER_BEGIN_EVENT /*:String*/ : "testmanagerbegin",
+
+    /**
+     * Constant for the testmanagercomplete custom event
+     * @property TEST_MANAGER_COMPLETE_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_MANAGER_COMPLETE_EVENT /*:String*/ : "testmanagercomplete",
+
+    //-------------------------------------------------------------------------
+    // Private Properties
+    //-------------------------------------------------------------------------
+    
+    
+    /**
+     * The URL of the page currently being executed.
+     * @type String
+     * @private
+     * @property _curPage
+     * @static
+     */
+    _curPage /*:String*/ : null,
+    
+    /**
+     * The frame used to load and run tests.
+     * @type Window
+     * @private
+     * @property _frame
+     * @static
+     */
+    _frame /*:Window*/ : null,
+    
+    /**
+     * The logger used to output results from the various tests.
+     * @type YAHOO.tool.TestLogger
+     * @private
+     * @property _logger
+     * @static
+     */
+    _logger : null,
+    
+    /**
+     * The timeout ID for the next iteration through the tests.
+     * @type int
+     * @private
+     * @property _timeoutId
+     * @static
+     */
+    _timeoutId /*:int*/ : 0,
+    
+    /**
+     * Array of pages to load.
+     * @type String[]
+     * @private
+     * @property _pages
+     * @static
+     */
+    _pages /*:String[]*/ : [],
+    
+    /**
+     * Aggregated results
+     * @type Object
+     * @private
+     * @property _results
+     * @static
+     */
+    _results: null,
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Handles TestRunner.COMPLETE_EVENT, storing the results and beginning
+     * the loop again.
+     * @param {Object} data Data about the event.
+     * @return {Void}
+     * @private
+     * @static
+     */
+    _handleTestRunnerComplete : function (data /*:Object*/) /*:Void*/ {
+
+        this.fireEvent(this.TEST_PAGE_COMPLETE_EVENT, {
+                page: this._curPage,
+                results: data.results
+            });
+    
+        //save results
+        //this._results[this.curPage] = data.results;
+        
+        //process 'em
+        this._processResults(this._curPage, data.results);
+        
+        this._logger.clearTestRunner();
+    
+        //if there's more to do, set a timeout to begin again
+        if (this._pages.length){
+            this._timeoutId = setTimeout(function(){
+                YAHOO.tool.TestManager._run();
+            }, 1000);
+        }
+    },
+    
+    /**
+     * Processes the results of a test page run, outputting log messages
+     * for failed tests.
+     * @return {Void}
+     * @private
+     * @static
+     */
+    _processResults : function (page /*:String*/, results /*:Object*/) /*:Void*/ {
+
+        var r = this._results;
+
+        r.page_results[page] = results;
+
+        if (results.passed) {
+            r.pages_passed++;
+            r.tests_passed += results.passed;
+        }
+
+        if (results.failed) {
+            r.pages_failed++;
+            r.tests_failed += results.failed;
+            r.failed.push(page);
+        } else {
+            r.passed.push(page);
+        }
+
+        if (!this._pages.length) {
+            this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT, this._results);
+        }
+
+    },
+    
+    /**
+     * Loads the next test page into the iframe.
+     * @return {Void}
+     * @static
+     * @private
+     */
+    _run : function () /*:Void*/ {
+    
+        //set the current page
+        this._curPage = this._pages.shift();
+
+        this.fireEvent(this.TEST_PAGE_BEGIN_EVENT, this._curPage);
+        
+        //load the frame - destroy history in case there are other iframes that
+        //need testing
+        this._frame.location.replace(this._curPage);
+    
+    },
+        
+    //-------------------------------------------------------------------------
+    // Public Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Signals that a test page has been loaded. This should be called from
+     * within the test page itself to notify the TestManager that it is ready.
+     * @return {Void}
+     * @static
+     */
+    load : function () /*:Void*/ {
+        if (parent.YAHOO.tool.TestManager !== this){
+            parent.YAHOO.tool.TestManager.load();
+        } else {
+            
+            if (this._frame) {
+                //assign event handling
+                var TestRunner = this._frame.YAHOO.tool.TestRunner;
+
+                this._logger.setTestRunner(TestRunner);
+                TestRunner.subscribe(TestRunner.COMPLETE_EVENT, this._handleTestRunnerComplete, this, true);
+                
+                //run it
+                TestRunner.run();
+            }
+        }
+    },
+    
+    /**
+     * Sets the pages to be loaded.
+     * @param {String[]} pages An array of URLs to load.
+     * @return {Void}
+     * @static
+     */
+    setPages : function (pages /*:String[]*/) /*:Void*/ {
+        this._pages = pages;
+    },
+    
+    /**
+     * Begins the process of running the tests.
+     * @return {Void}
+     * @static
+     */
+    start : function () /*:Void*/ {
+
+        if (!this._initialized) {
+
+            /**
+             * Fires when loading a test page
+             * @event testpagebegin
+             * @param curPage {string} the page being loaded
+             * @static
+             */
+            this.createEvent(this.TEST_PAGE_BEGIN_EVENT);
+
+            /**
+             * Fires when a test page is complete
+             * @event testpagecomplete
+             * @param obj {page: string, results: object} the name of the
+             * page that was loaded, and the test suite results
+             * @static
+             */
+            this.createEvent(this.TEST_PAGE_COMPLETE_EVENT);
+
+            /**
+             * Fires when the test manager starts running all test pages
+             * @event testmanagerbegin
+             * @static
+             */
+            this.createEvent(this.TEST_MANAGER_BEGIN_EVENT);
+
+            /**
+             * Fires when the test manager finishes running all test pages.  External
+             * test runners should subscribe to this event in order to get the
+             * aggregated test results.
+             * @event testmanagercomplete
+             * @param obj { pages_passed: int, pages_failed: int, tests_passed: int
+             *              tests_failed: int, passed: string[], failed: string[],
+             *              page_results: {} }
+             * @static
+             */
+            this.createEvent(this.TEST_MANAGER_COMPLETE_EVENT);
+
+            //create iframe if not already available
+            if (!this._frame){
+                var frame /*:HTMLElement*/ = document.createElement("iframe");
+                frame.style.visibility = "hidden";
+                frame.style.position = "absolute";
+                document.body.appendChild(frame);
+                this._frame = frame.contentWindow || frame.contentDocument.ownerWindow;
+            }
+            
+            //create test logger if not already available
+            if (!this._logger){
+                this._logger = new YAHOO.tool.TestLogger();
+            }
+
+            this._initialized = true;
+        }
+
+
+        // reset the results cache
+        this._results = {
+            // number of pages that pass
+            pages_passed: 0,
+            // number of pages that fail
+            pages_failed: 0,
+            // total number of tests passed
+            tests_passed: 0,
+            // total number of tests failed
+            tests_failed: 0,
+            // array of pages that passed
+            passed: [],
+            // array of pages that failed
+            failed: [],
+            // map of full results for each page
+            page_results: {}
+        };
+
+        this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT, null);
+        this._run();
+    
+    },
+
+    /**
+     * Stops the execution of tests.
+     * @return {Void}
+     * @static
+     */
+    stop : function () /*:Void*/ {
+        clearTimeout(this._timeoutId);
+    }
+
+};
+
+YAHOO.lang.augmentObject(YAHOO.tool.TestManager, YAHOO.util.EventProvider.prototype);
+
+YAHOO.register("yuitest", YAHOO.tool.TestRunner, {version: "2.3.0", build: "442"});
diff --git a/lib/yui/yuitest/yuitest-beta-min.js b/lib/yui/yuitest/yuitest-beta-min.js
new file mode 100755 (executable)
index 0000000..2501793
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+
+YAHOO.namespace("tool");YAHOO.tool.TestLogger=function(element,config){YAHOO.tool.TestLogger.superclass.constructor.call(this,element,config);this.init();};YAHOO.lang.extend(YAHOO.tool.TestLogger,YAHOO.widget.LogReader,{footerEnabled:true,newestOnTop:false,formatMsg:function(message){var category=message.category;var text=this.html2Text(message.msg);return"<pre><p><span class=\""+category+"\">"+category.toUpperCase()+"</span> "+text+"</p></pre>";},init:function(){if(YAHOO.tool.TestRunner){this.setTestRunner(YAHOO.tool.TestRunner);}
+this.hideSource("global");this.hideSource("LogReader");this.hideCategory("warn");this.hideCategory("window");this.hideCategory("time");this.clearConsole();},clearTestRunner:function(){if(this._runner){this._runner.unsubscribeAll();this._runner=null;}},setTestRunner:function(testRunner){if(this._runner){this.clearTestRunner();}
+this._runner=testRunner;testRunner.subscribe(testRunner.TEST_PASS_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_FAIL_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_IGNORE_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.BEGIN_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_SUITE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_SUITE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_CASE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);testRunner.subscribe(testRunner.TEST_CASE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);},_handleTestRunnerEvent:function(data){var TestRunner=YAHOO.tool.TestRunner;var message="";var messageType="";switch(data.type){case TestRunner.BEGIN_EVENT:message="Testing began at "+(new Date()).toString()+".";messageType="info";break;case TestRunner.COMPLETE_EVENT:message="Testing completed at "+(new Date()).toString()+".\nPassed:"
++data.results.passed+" Failed:"+data.results.failed+" Total:"+data.results.total;messageType="info";break;case TestRunner.TEST_FAIL_EVENT:message=data.testName+": "+data.error.getMessage();messageType="fail";break;case TestRunner.TEST_IGNORE_EVENT:message=data.testName+": ignored.";messageType="ignore";break;case TestRunner.TEST_PASS_EVENT:message=data.testName+": passed.";messageType="pass";break;case TestRunner.TEST_SUITE_BEGIN_EVENT:message="Test suite \""+data.testSuite.name+"\" started.";messageType="info";break;case TestRunner.TEST_SUITE_COMPLETE_EVENT:message="Test suite \""+data.testSuite.name+"\" completed.\nPassed:"
++data.results.passed+" Failed:"+data.results.failed+" Total:"+data.results.total;messageType="info";break;case TestRunner.TEST_CASE_BEGIN_EVENT:message="Test case \""+data.testCase.name+"\" started.";messageType="info";break;case TestRunner.TEST_CASE_COMPLETE_EVENT:message="Test case \""+data.testCase.name+"\" completed.\nPassed:"
++data.results.passed+" Failed:"+data.results.failed+" Total:"+data.results.total;messageType="info";break;default:message="Unexpected event "+data.type;message="info";}
+YAHOO.log(message,messageType,"TestRunner");}});YAHOO.namespace("tool");YAHOO.tool.TestRunner=(function(){function TestRunner(){TestRunner.superclass.constructor.apply(this,arguments);this.items=[];var events=[this.TEST_CASE_BEGIN_EVENT,this.TEST_CASE_COMPLETE_EVENT,this.TEST_SUITE_BEGIN_EVENT,this.TEST_SUITE_COMPLETE_EVENT,this.TEST_PASS_EVENT,this.TEST_FAIL_EVENT,this.TEST_IGNORE_EVENT,this.COMPLETE_EVENT,this.BEGIN_EVENT];for(var i=0;i<events.length;i++){this.createEvent(events[i],{scope:this});}}
+YAHOO.lang.extend(TestRunner,YAHOO.util.EventProvider,{TEST_CASE_BEGIN_EVENT:"testcasebegin",TEST_CASE_COMPLETE_EVENT:"testcasecomplete",TEST_SUITE_BEGIN_EVENT:"testsuitebegin",TEST_SUITE_COMPLETE_EVENT:"testsuitecomplete",TEST_PASS_EVENT:"pass",TEST_FAIL_EVENT:"fail",TEST_IGNORE_EVENT:"ignore",COMPLETE_EVENT:"complete",BEGIN_EVENT:"begin",_runTestCase:function(testCase){var results={};this.fireEvent(this.TEST_CASE_BEGIN_EVENT,{testCase:testCase});var tests=[];for(var prop in testCase){if(prop.indexOf("test")===0&&typeof testCase[prop]=="function"){tests.push(prop);}}
+var shouldFail=testCase._should.fail||{};var shouldError=testCase._should.error||{};var shouldIgnore=testCase._should.ignore||{};var failCount=0;var passCount=0;var runCount=0;for(var i=0;i<tests.length;i++){if(shouldIgnore[tests[i]]){this.fireEvent(this.TEST_IGNORE_EVENT,{testCase:testCase,testName:tests[i]});continue;}
+var failed=false;var error=null;testCase.setUp();try{testCase[tests[i]]();if(shouldFail[tests[i]]){error=new YAHOO.util.ShouldFail();failed=true;}else if(shouldError[tests[i]]){error=new YAHOO.util.ShouldError();failed=true;}}catch(thrown){if(thrown instanceof YAHOO.util.AssertionError){if(!shouldFail[tests[i]]){error=thrown;failed=true;}}else{if(!shouldError[tests[i]]){error=new YAHOO.util.UnexpectedError(thrown);failed=true;}else{if(YAHOO.lang.isString(shouldError[tests[i]])){if(thrown.message!=shouldError[tests[i]]){error=new YAHOO.util.UnexpectedError(thrown);failed=true;}}else if(YAHOO.lang.isObject(shouldError[tests[i]])){if(!(thrown instanceof shouldError[tests[i]].constructor)||thrown.message!=shouldError[tests[i]].message){error=new YAHOO.util.UnexpectedError(thrown);failed=true;}}}}}finally{if(failed){this.fireEvent(this.TEST_FAIL_EVENT,{testCase:testCase,testName:tests[i],error:error});}else{this.fireEvent(this.TEST_PASS_EVENT,{testCase:testCase,testName:tests[i]});}}
+testCase.tearDown();results[tests[i]]={result:failed?"fail":"pass",message:error?error.getMessage():"Test passed"};runCount++;failCount+=(failed?1:0);passCount+=(failed?0:1);}
+results.total=runCount;results.failed=failCount;results.passed=passCount;this.fireEvent(this.TEST_CASE_COMPLETE_EVENT,{testCase:testCase,results:results});return results;},_runTestSuite:function(testSuite){var results={passed:0,failed:0,total:0};this.fireEvent(this.TEST_SUITE_BEGIN_EVENT,{testSuite:testSuite});for(var i=0;i<testSuite.items.length;i++){var result=null;if(testSuite.items[i]instanceof YAHOO.tool.TestSuite){result=this._runTestSuite(testSuite.items[i]);}else if(testSuite.items[i]instanceof YAHOO.tool.TestCase){result=this._runTestCase(testSuite.items[i]);}
+if(result!==null){results.total+=result.total;results.passed+=result.passed;results.failed+=result.failed;results[testSuite.items[i].name]=result;}}
+this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT,{testSuite:testSuite,results:results});return results;},_run:function(testObject){if(YAHOO.lang.isObject(testObject)){if(testObject instanceof YAHOO.tool.TestSuite){return this._runTestSuite(testObject);}else if(testObject instanceof YAHOO.tool.TestCase){return this._runTestCase(testObject);}else{throw new TypeError("_run(): Expected either YAHOO.tool.TestCase or YAHOO.tool.TestSuite.");}}},fireEvent:function(type,data){data=data||{};data.type=type;TestRunner.superclass.fireEvent.call(this,type,data);},add:function(testObject){this.items.push(testObject);},clear:function(){while(this.items.length){this.items.pop();}},run:function(testObject){var results=null;this.fireEvent(this.BEGIN_EVENT);if(YAHOO.lang.isObject(testObject)){results=this._run(testObject);}else{results={passed:0,failed:0,total:0};for(var i=0;i<this.items.length;i++){var result=this._run(this.items[i]);results.passed+=result.passed;results.failed+=result.failed;results.total+=result.total;results[this.items[i].name]=result;}}
+this.fireEvent(this.COMPLETE_EVENT,{results:results});}});return new TestRunner();})();YAHOO.namespace("tool");YAHOO.tool.TestSuite=function(name){this.name=name||YAHOO.util.Dom.generateId(null,"testSuite");this.items=[];};YAHOO.tool.TestSuite.prototype={add:function(testObject){if(testObject instanceof YAHOO.tool.TestSuite||testObject instanceof YAHOO.tool.TestCase){this.items.push(testObject);}}};YAHOO.namespace("tool");YAHOO.tool.TestCase=function(template){this._should={};for(var prop in template){this[prop]=template[prop];}
+if(!YAHOO.lang.isString(this.name)){this.name=YAHOO.util.Dom.generateId(null,"testCase");}};YAHOO.tool.TestCase.prototype={setUp:function(){},tearDown:function(){}};YAHOO.namespace("util");YAHOO.util.Assert={fail:function(message){throw new YAHOO.util.AssertionError(message||"Test force-failed.");},areEqual:function(expected,actual,message){if(expected!=actual){throw new YAHOO.util.ComparisonFailure(message||"Values should be equal.",expected,actual);}},areNotEqual:function(unexpected,actual,message){if(unexpected==actual){throw new YAHOO.util.UnexpectedValue(message||"Values should not be equal.",unexpected);}},areNotSame:function(unexpected,actual,message){if(unexpected===actual){throw new YAHOO.util.UnexpectedValue(message||"Values should not be the same.",unexpected);}},areSame:function(expected,actual,message){if(expected!==actual){throw new YAHOO.util.ComparisonFailure(message||"Values should be the same.",expected,actual);}},isFalse:function(actual,message){if(false!==actual){throw new YAHOO.util.ComparisonFailure(message||"Value should be false.",false,actual);}},isTrue:function(actual,message){if(true!==actual){throw new YAHOO.util.ComparisonFailure(message||"Value should be true.",true,actual);}},isNaN:function(actual,message){if(!isNaN(actual)){throw new YAHOO.util.ComparisonFailure(message||"Value should be NaN.",NaN,actual);}},isNotNaN:function(actual,message){if(isNaN(actual)){throw new YAHOO.util.UnexpectedValue(message||"Values should not be NaN.",NaN);}},isNotNull:function(actual,message){if(YAHOO.lang.isNull(actual)){throw new YAHOO.util.UnexpectedValue(message||"Values should not be null.",null);}},isNotUndefined:function(actual,message){if(YAHOO.lang.isUndefined(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should not be undefined.",undefined);}},isNull:function(actual,message){if(!YAHOO.lang.isNull(actual)){throw new YAHOO.util.ComparisonFailure(message||"Value should be null.",null,actual);}},isUndefined:function(actual,message){if(!YAHOO.lang.isUndefined(actual)){throw new YAHOO.util.ComparisonFailure(message||"Value should be undefined.",undefined,actual);}},isArray:function(actual,message){if(!YAHOO.lang.isArray(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be an array.",actual);}},isBoolean:function(actual,message){if(!YAHOO.lang.isBoolean(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be a Boolean.",actual);}},isFunction:function(actual,message){if(!YAHOO.lang.isFunction(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be a function.",actual);}},isInstanceOf:function(expected,actual,message){if(!(actual instanceof expected)){throw new YAHOO.util.ComparisonFailure(message||"Value isn't an instance of expected type.",expected,actual);}},isNumber:function(actual,message){if(!YAHOO.lang.isNumber(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be a number.",actual);}},isObject:function(actual,message){if(!YAHOO.lang.isObject(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be an object.",actual);}},isString:function(actual,message){if(!YAHOO.lang.isString(actual)){throw new YAHOO.util.UnexpectedValue(message||"Value should be a string.",actual);}},isTypeOf:function(expectedType,actualValue,message){if(typeof actualValue!=expectedType){throw new YAHOO.util.ComparisonFailure(message||"Value should be of type "+expected+".",expected,typeof actual);}}};YAHOO.util.AssertionError=function(message){arguments.callee.superclass.constructor.call(this,message);this.message=message;this.name="AssertionError";};YAHOO.lang.extend(YAHOO.util.AssertionError,Error,{getMessage:function(){return this.message;},toString:function(){return this.name+": "+this.getMessage();},valueOf:function(){return this.toString();}});YAHOO.util.ComparisonFailure=function(message,expected,actual){arguments.callee.superclass.constructor.call(this,message);this.expected=expected;this.actual=actual;this.name="ComparisonFailure";};YAHOO.lang.extend(YAHOO.util.ComparisonFailure,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nExpected: "+this.expected+" ("+(typeof this.expected)+")"+"\nActual:"+this.actual+" ("+(typeof this.actual)+")";}});YAHOO.util.UnexpectedValue=function(message,unexpected){arguments.callee.superclass.constructor.call(this,message);this.unexpected=unexpected;this.name="UnexpectedValue";};YAHOO.lang.extend(YAHOO.util.UnexpectedValue,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nUnexpected: "+this.unexpected+" ("+(typeof this.unexpected)+") ";}});YAHOO.util.ShouldFail=function(message){arguments.callee.superclass.constructor.call(this,message||"This test should fail but didn't.");this.name="ShouldFail";};YAHOO.lang.extend(YAHOO.util.ShouldFail,YAHOO.util.AssertionError);YAHOO.util.ShouldError=function(message){arguments.callee.superclass.constructor.call(this,message||"This test should have thrown an error but didn't.");this.name="ShouldError";};YAHOO.lang.extend(YAHOO.util.ShouldError,YAHOO.util.AssertionError);YAHOO.util.UnexpectedError=function(cause){arguments.callee.superclass.constructor.call(this,"Unexpected error: "+cause.message);this.cause=cause;this.name="UnexpectedError";};YAHOO.lang.extend(YAHOO.util.UnexpectedError,YAHOO.util.AssertionError);YAHOO.util.ArrayAssert={contains:function(needle,haystack,message){var found=false;for(var i=0;i<haystack.length&&!found;i++){if(haystack[i]===needle){found=true;}}
+if(!found){YAHOO.util.Assert.fail(message||"Value ("+needle+") not found in array.");}},containsItems:function(needles,haystack,message){for(var i=0;i<needles.length;i++){this.contains(needles[i],haystack,message);}
+if(!found){YAHOO.util.Assert.fail(message||"Value not found in array.");}},containsMatch:function(matcher,haystack,message){if(typeof matcher!="function"){throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");}
+var found=false;for(var i=0;i<haystack.length&&!found;i++){if(matcher(haystack[i])){found=true;}}
+if(!found){YAHOO.util.Assert.fail(message||"No match found in array.");}},doesNotContain:function(needle,haystack,message){var found=false;for(var i=0;i<haystack.length&&!found;i++){if(haystack[i]===needle){found=true;}}
+if(found){YAHOO.util.Assert.fail(message||"Value found in array.");}},doesNotContainItems:function(needles,haystack,message){for(var i=0;i<needles.length;i++){this.doesNotContain(needles[i],haystack,message);}},doesNotContainMatch:function(matcher,haystack,message){if(typeof matcher!="function"){throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");}
+var found=false;for(var i=0;i<haystack.length&&!found;i++){if(matcher(haystack[i])){found=true;}}
+if(found){YAHOO.util.Assert.fail(message||"Value found in array.");}},indexOf:function(needle,haystack,index,message){for(var i=0;i<haystack.length;i++){if(haystack[i]===needle){YAHOO.util.Assert.areEqual(index,i,message||"Value exists at index "+i+" but should be at index "+index+".");return;}}
+YAHOO.util.Assert.fail(message||"Value doesn't exist in array.");},itemsAreEqual:function(expected,actual,message){var len=Math.max(expected.length,actual.length);for(var i=0;i<len;i++){YAHOO.util.Assert.areEqual(expected[i],actual[i],message||"Values in position "+i+" are not equal.");}},itemsAreEquivalent:function(expected,actual,comparator,message){if(typeof comparator!="function"){throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");}
+var len=Math.max(expected.length,actual.length);for(var i=0;i<len;i++){if(!comparator(expected[i],actual[i])){throw new YAHOO.util.ComparisonFailure(message||"Values in position "+i+" are not equivalent.",expected[i],actual[i]);}}},isEmpty:function(actual,message){if(actual.length>0){YAHOO.util.Assert.fail(message||"Array should be empty.");}},isNotEmpty:function(actual,message){if(actual.length===0){YAHOO.util.Assert.fail(message||"Array should not be empty.");}},itemsAreSame:function(expected,actual,message){var len=Math.max(expected.length,actual.length);for(var i=0;i<len;i++){YAHOO.util.Assert.areSame(expected[i],actual[i],message||"Values in position "+i+" are not the same.");}},lastIndexOf:function(needle,haystack,index,message){for(var i=haystack.length;i>=0;i--){if(haystack[i]===needle){YAHOO.util.Assert.areEqual(index,i,message||"Value exists at index "+i+" but should be at index "+index+".");return;}}
+YAHOO.util.Assert.fail(message||"Value doesn't exist in array.");}};YAHOO.namespace("util");YAHOO.util.ObjectAssert={propertiesAreEqual:function(expected,actual,message){var properties=[];for(var property in expected){properties.push(property);}
+for(var i=0;i<properties.length;i++){YAHOO.util.Assert.isNotUndefined(actual[properties[i]],message||"Property'"+properties[i]+"' expected.");}},hasProperty:function(propertyName,object,message){if(YAHOO.lang.isUndefined(object[propertyName])){YAHOO.util.Assert.fail(message||"Property "+propertyName+" not found on object.");}},hasOwnProperty:function(propertyName,object,message){if(!YAHOO.lang.hasOwnProperty(object,propertyName)){YAHOO.util.Assert.fail(message||"Property "+propertyName+" not found on object instance.");}}};YAHOO.util.DateAssert={datesAreEqual:function(expected,actual,message){if(expected instanceof Date&&actual instanceof Date){YAHOO.util.Assert.areEqual(expected.getFullYear(),actual.getFullYear(),message||"Years should be equal.");YAHOO.util.Assert.areEqual(expected.getMonth(),actual.getMonth(),message||"Months should be equal.");YAHOO.util.Assert.areEqual(expected.getDate(),actual.getDate(),message||"Day of month should be equal.");}else{throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");}},timesAreEqual:function(expected,actual,message){if(expected instanceof Date&&actual instanceof Date){YAHOO.util.Assert.areEqual(expected.getHours(),actual.getHours(),message||"Hours should be equal.");YAHOO.util.Assert.areEqual(expected.getMinutes(),actual.getMinutes(),message||"Minutes should be equal.");YAHOO.util.Assert.areEqual(expected.getSeconds(),actual.getSeconds(),message||"Seconds should be equal.");}else{throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");}}};YAHOO.namespace("util");YAHOO.util.UserAction={simulateKeyEvent:function(target,type,bubbles,cancelable,view,ctrlKey,altKey,shiftKey,metaKey,keyCode,charCode)
+{target=YAHOO.util.Dom.get(target);if(!target){throw new Error("simulateKeyEvent(): Invalid target.");}
+if(YAHOO.lang.isString(type)){type=type.toLowerCase();switch(type){case"keyup":case"keydown":case"keypress":break;case"textevent":type="keypress";break;default:throw new Error("simulateKeyEvent(): Event type '"+type+"' not supported.");}}else{throw new Error("simulateKeyEvent(): Event type must be a string.");}
+if(!YAHOO.lang.isBoolean(bubbles)){bubbles=true;}
+if(!YAHOO.lang.isBoolean(cancelable)){cancelable=true;}
+if(!YAHOO.lang.isObject(view)){view=window;}
+if(!YAHOO.lang.isBoolean(ctrlKey)){ctrlKey=false;}
+if(!YAHOO.lang.isBoolean(altKey)){altKey=false;}
+if(!YAHOO.lang.isBoolean(shiftKey)){shiftKey=false;}
+if(!YAHOO.lang.isBoolean(metaKey)){metaKey=false;}
+if(!YAHOO.lang.isNumber(keyCode)){keyCode=0;}
+if(!YAHOO.lang.isNumber(charCode)){charCode=0;}
+if(YAHOO.lang.isFunction(document.createEvent)){var event=null;try{event=document.createEvent("KeyEvents");event.initKeyEvent(type,bubbles,cancelable,view,ctrlKey,altKey,shiftKey,metaKey,keyCode,charCode);}catch(ex){try{event=document.createEvent("Events");}catch(uierror){event=document.createEvent("UIEvents");}finally{event.initEvent(type,bubbles,cancelable);event.view=view;event.altKey=altKey;event.ctrlKey=ctrlKey;event.shiftKey=shiftKey;event.metaKey=metaKey;event.keyCode=keyCode;event.charCode=charCode;}}
+target.dispatchEvent(event);}else if(YAHOO.lang.isObject(document.createEventObject)){event=document.createEventObject();event.bubbles=bubbles;event.cancelable=cancelable;event.view=view;event.ctrlKey=ctrlKey;event.altKey=altKey;event.shiftKey=shiftKey;event.metaKey=metaKey;event.keyCode=(charCode>0)?charCode:keyCode;target.fireEvent("on"+type,event);}else{throw new Error("simulateKeyEvent(): No event simulation framework present.");}},simulateMouseEvent:function(target,type,bubbles,cancelable,view,detail,screenX,screenY,clientX,clientY,ctrlKey,altKey,shiftKey,metaKey,button,relatedTarget)
+{target=YAHOO.util.Dom.get(target);if(!target){throw new Error("simulateMouseEvent(): Invalid target.");}
+if(YAHOO.lang.isString(type)){type=type.toLowerCase();switch(type){case"mouseover":case"mouseout":case"mousedown":case"mouseup":case"click":case"dblclick":case"mousemove":break;default:throw new Error("simulateMouseEvent(): Event type '"+type+"' not supported.");}}else{throw new Error("simulateMouseEvent(): Event type must be a string.");}
+if(!YAHOO.lang.isBoolean(bubbles)){bubbles=true;}
+if(!YAHOO.lang.isBoolean(cancelable)){cancelable=(type!="mousemove");}
+if(!YAHOO.lang.isObject(view)){view=window;}
+if(!YAHOO.lang.isNumber(detail)){detail=1;}
+if(!YAHOO.lang.isNumber(screenX)){screenX=0;}
+if(!YAHOO.lang.isNumber(screenY)){screenY=0;}
+if(!YAHOO.lang.isNumber(clientX)){clientX=0;}
+if(!YAHOO.lang.isNumber(clientY)){clientY=0;}
+if(!YAHOO.lang.isBoolean(ctrlKey)){ctrlKey=false;}
+if(!YAHOO.lang.isBoolean(altKey)){altKey=false;}
+if(!YAHOO.lang.isBoolean(shiftKey)){shiftKey=false;}
+if(!YAHOO.lang.isBoolean(metaKey)){metaKey=false;}
+if(!YAHOO.lang.isNumber(button)){button=0;}
+if(YAHOO.lang.isFunction(document.createEvent)){var event=document.createEvent("MouseEvents");if(event.initMouseEvent){event.initMouseEvent(type,bubbles,cancelable,view,detail,screenX,screenY,clientX,clientY,ctrlKey,altKey,shiftKey,metaKey,button,relatedTarget);}else{event=document.createEvent("UIEvents");event.initEvent(type,bubbles,cancelable);event.view=view;event.detail=detail;event.screenX=screenX;event.screenY=screenY;event.clientX=clientX;event.clientY=clientY;event.ctrlKey=ctrlKey;event.altKey=altKey;event.metaKey=metaKey;event.shiftKey=shiftKey;event.button=button;event.relatedTarget=relatedTarget;}
+if(relatedTarget&&!event.relatedTarget){if(type=="mouseout"){event.toElement=relatedTarget;}else if(type=="mouseover"){event.fromElement=relatedTarget;}}
+target.dispatchEvent(event);}else if(YAHOO.lang.isObject(document.createEventObject)){event=document.createEventObject();event.bubbles=bubbles;event.cancelable=cancelable;event.view=view;event.detail=detail;event.screenX=screenX;event.screenY=screenY;event.clientX=clientX;event.clientY=clientY;event.ctrlKey=ctrlKey;event.altKey=altKey;event.metaKey=metaKey;event.shiftKey=shiftKey;switch(button){case 0:event.button=1;break;case 1:event.button=4;break;case 2:break;default:event.button=0;}
+event.relatedTarget=relatedTarget;target.fireEvent("on"+type,event);}else{throw new Error("simulateMouseEvent(): No event simulation framework present.");}},fireMouseEvent:function(target,type,options)
+{options=options||{};this.simulateMouseEvent(target,type,options.bubbles,options.cancelable,options.view,options.detail,options.screenX,options.screenY,options.clientX,options.clientY,options.ctrlKey,options.altKey,options.shiftKey,options.metaKey,options.button,options.relatedTarget);},click:function(target,options){this.fireMouseEvent(target,"click",options);},dblclick:function(target,options){this.fireMouseEvent(target,"dblclick",options);},mousedown:function(target,options){this.fireMouseEvent(target,"mousedown",options);},mousemove:function(target,options){this.fireMouseEvent(target,"mousemove",options);},mouseout:function(target,options){this.fireMouseEvent(target,"mouseout",options);},mouseover:function(target,options){this.fireMouseEvent(target,"mouseover",options);},mouseup:function(target,options){this.fireMouseEvent(target,"mouseup",options);},fireKeyEvent:function(type,target,options)
+{options=options||{};this.simulateKeyEvent(target,type,options.bubbles,options.cancelable,options.view,options.ctrlKey,options.altKey,options.shiftKey,options.metaKey,options.keyCode,options.charCode);},keydown:function(target,options){this.fireKeyEvent("keydown",target,options);},keypress:function(target,options){this.fireKeyEvent("keypress",target,options);},keyup:function(target,options){this.fireKeyEvent("keyup",target,options);}};YAHOO.namespace("tool");YAHOO.tool.TestManager={TEST_PAGE_BEGIN_EVENT:"testpagebegin",TEST_PAGE_COMPLETE_EVENT:"testpagecomplete",TEST_MANAGER_BEGIN_EVENT:"testmanagerbegin",TEST_MANAGER_COMPLETE_EVENT:"testmanagercomplete",_curPage:null,_frame:null,_logger:null,_timeoutId:0,_pages:[],_results:null,_handleTestRunnerComplete:function(data){this.fireEvent(this.TEST_PAGE_COMPLETE_EVENT,{page:this._curPage,results:data.results});this._processResults(this._curPage,data.results);this._logger.clearTestRunner();if(this._pages.length){this._timeoutId=setTimeout(function(){YAHOO.tool.TestManager._run();},1000);}},_processResults:function(page,results){var r=this._results;r.page_results[page]=results;if(results.passed){r.pages_passed++;r.tests_passed+=results.passed;}
+if(results.failed){r.pages_failed++;r.tests_failed+=results.failed;r.failed.push(page);}else{r.passed.push(page);}
+if(!this._pages.length){this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT,this._results);}},_run:function(){this._curPage=this._pages.shift();this.fireEvent(this.TEST_PAGE_BEGIN_EVENT,this._curPage);this._frame.location.replace(this._curPage);},load:function(){if(parent.YAHOO.tool.TestManager!==this){parent.YAHOO.tool.TestManager.load();}else{if(this._frame){var TestRunner=this._frame.YAHOO.tool.TestRunner;this._logger.setTestRunner(TestRunner);TestRunner.subscribe(TestRunner.COMPLETE_EVENT,this._handleTestRunnerComplete,this,true);TestRunner.run();}}},setPages:function(pages){this._pages=pages;},start:function(){if(!this._initialized){this.createEvent(this.TEST_PAGE_BEGIN_EVENT);this.createEvent(this.TEST_PAGE_COMPLETE_EVENT);this.createEvent(this.TEST_MANAGER_BEGIN_EVENT);this.createEvent(this.TEST_MANAGER_COMPLETE_EVENT);if(!this._frame){var frame=document.createElement("iframe");frame.style.visibility="hidden";frame.style.position="absolute";document.body.appendChild(frame);this._frame=frame.contentWindow||frame.contentDocument.ownerWindow;}
+if(!this._logger){this._logger=new YAHOO.tool.TestLogger();}
+this._initialized=true;}
+this._results={pages_passed:0,pages_failed:0,tests_passed:0,tests_failed:0,passed:[],failed:[],page_results:{}};this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT,null);this._run();},stop:function(){clearTimeout(this._timeoutId);}};YAHOO.lang.augmentObject(YAHOO.tool.TestManager,YAHOO.util.EventProvider.prototype);YAHOO.register("yuitest",YAHOO.tool.TestRunner,{version:"2.3.0",build:"442"});
\ No newline at end of file
diff --git a/lib/yui/yuitest/yuitest-beta.js b/lib/yui/yuitest/yuitest-beta.js
new file mode 100755 (executable)
index 0000000..0efbbf5
--- /dev/null
@@ -0,0 +1,2669 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.3.0
+*/
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestLogger object
+//-----------------------------------------------------------------------------
+
+/**
+ * Displays test execution progress and results, providing filters based on
+ * different key events.
+ * @namespace YAHOO.tool
+ * @class TestLogger
+ * @constructor
+ * @param {HTMLElement} element (Optional) The element to create the logger in.
+ * @param {Object} config (Optional) Configuration options for the logger.
+ */
+YAHOO.tool.TestLogger = function (element, config) {
+    YAHOO.tool.TestLogger.superclass.constructor.call(this, element, config);
+    this.init();
+};
+
+YAHOO.lang.extend(YAHOO.tool.TestLogger, YAHOO.widget.LogReader, {
+
+    footerEnabled : true,
+    newestOnTop : false,
+
+    /**
+     * Formats message string to HTML for output to console.
+     * @private
+     * @method formatMsg
+     * @param oLogMsg {Object} Log message object.
+     * @return {String} HTML-formatted message for output to console.
+     */
+    formatMsg : function(message /*:Object*/) {
+    
+        var category /*:String*/ = message.category;        
+        var text /*:String*/ = this.html2Text(message.msg);
+        
+        return "<pre><p><span class=\"" + category + "\">" + category.toUpperCase() + "</span> " + text + "</p></pre>";
+    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /*
+     * Initializes the logger.
+     * @private
+     */
+    init : function () {
+    
+        //attach to any available TestRunner
+        if (YAHOO.tool.TestRunner){
+            this.setTestRunner(YAHOO.tool.TestRunner);
+        }
+        
+        //hide useless sources
+        this.hideSource("global");
+        this.hideSource("LogReader");
+        
+        //hide useless message categories
+        this.hideCategory("warn");
+        this.hideCategory("window");
+        this.hideCategory("time");
+        
+        //reset the logger
+        this.clearConsole();
+    },
+    
+    /**
+     * Clears the reference to the TestRunner from previous operations. This 
+     * unsubscribes all events and removes the object reference.
+     * @return {Void}
+     * @static
+     */
+    clearTestRunner : function () /*:Void*/ {
+        if (this._runner){
+            this._runner.unsubscribeAll();
+            this._runner = null;
+        }
+    },
+    
+    /**
+     * Sets the source test runner that the logger should monitor.
+     * @param {YAHOO.tool.TestRunner} testRunner The TestRunner to observe.
+     * @return {Void}
+     * @static
+     */
+    setTestRunner : function (testRunner /*:YAHOO.tool.TestRunner*/) /*:Void*/ {
+    
+        if (this._runner){
+            this.clearTestRunner();
+        }
+        
+        this._runner = testRunner;
+        
+        //setup event _handlers
+        testRunner.subscribe(testRunner.TEST_PASS_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_FAIL_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_IGNORE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_SUITE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_BEGIN_EVENT, this._handleTestRunnerEvent, this, true);
+        testRunner.subscribe(testRunner.TEST_CASE_COMPLETE_EVENT, this._handleTestRunnerEvent, this, true);    
+    },
+    
+    //-------------------------------------------------------------------------
+    // Event Handlers
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Handles all TestRunner events, outputting appropriate data into the console.
+     * @param {Object} data The event data object.
+     * @return {Void}
+     * @private
+     */
+    _handleTestRunnerEvent : function (data /*:Object*/) /*:Void*/ {
+    
+        //shortcut variables
+        var TestRunner /*:Object*/ = YAHOO.tool.TestRunner;
+    
+        //data variables
+        var message /*:String*/ = "";
+        var messageType /*:String*/ = "";
+        
+        switch(data.type){
+            case TestRunner.BEGIN_EVENT:
+                message = "Testing began at " + (new Date()).toString() + ".";
+                messageType = "info";
+                break;
+                
+            case TestRunner.COMPLETE_EVENT:
+                message = "Testing completed at " + (new Date()).toString() + ".\nPassed:" 
+                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_FAIL_EVENT:
+                message = data.testName + ": " + data.error.getMessage();
+                messageType = "fail";
+                break;
+                
+            case TestRunner.TEST_IGNORE_EVENT:
+                message = data.testName + ": ignored.";
+                messageType = "ignore";
+                break;
+                
+            case TestRunner.TEST_PASS_EVENT:
+                message = data.testName + ": passed.";
+                messageType = "pass";
+                break;
+                
+            case TestRunner.TEST_SUITE_BEGIN_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_SUITE_COMPLETE_EVENT:
+                message = "Test suite \"" + data.testSuite.name + "\" completed.\nPassed:" 
+                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_BEGIN_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" started.";
+                messageType = "info";
+                break;
+                
+            case TestRunner.TEST_CASE_COMPLETE_EVENT:
+                message = "Test case \"" + data.testCase.name + "\" completed.\nPassed:" 
+                    + data.results.passed + " Failed:" + data.results.failed + " Total:" + data.results.total;
+                messageType = "info";
+                break;
+            default:
+                message = "Unexpected event " + data.type;
+                message = "info";
+        }
+    
+        YAHOO.log(message, messageType, "TestRunner");    
+    }
+    
+});
+YAHOO.namespace("tool");
+
+/**
+ * The YUI test tool
+ * @module yuitest
+ * @namespace YAHOO.tool
+ * @requires yahoo,dom,event,logger
+ */
+
+
+//-----------------------------------------------------------------------------
+// TestRunner object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs test suites and test cases, providing events to allowing for the
+ * interpretation of test results.
+ * @namespace YAHOO.tool
+ * @class TestRunner
+ * @static
+ */
+YAHOO.tool.TestRunner = (function(){
+
+    function TestRunner(){
+    
+        //inherit from EventProvider
+        TestRunner.superclass.constructor.apply(this,arguments);
+        
+        /**
+         * The test objects to run.
+         * @type Array
+         * @private
+         */
+        this.items /*:Array*/ = [];
+        
+        //create events
+        var events /*:Array*/ = [
+            this.TEST_CASE_BEGIN_EVENT,
+            this.TEST_CASE_COMPLETE_EVENT,
+            this.TEST_SUITE_BEGIN_EVENT,
+            this.TEST_SUITE_COMPLETE_EVENT,
+            this.TEST_PASS_EVENT,
+            this.TEST_FAIL_EVENT,
+            this.TEST_IGNORE_EVENT,
+            this.COMPLETE_EVENT,
+            this.BEGIN_EVENT
+        ];
+        for (var i=0; i < events.length; i++){
+            this.createEvent(events[i], { scope: this });
+        }
+       
+   
+    }
+    
+    YAHOO.lang.extend(TestRunner, YAHOO.util.EventProvider, {
+    
+        //-------------------------------------------------------------------------
+        // Constants
+        //-------------------------------------------------------------------------
+         
+        /**
+         * Fires when a test case is opened but before the first 
+         * test is executed.
+         * @event testcasebegin
+         */         
+        TEST_CASE_BEGIN_EVENT /*:String*/ : "testcasebegin",
+        
+        /**
+         * Fires when all tests in a test case have been executed.
+         * @event testcasecomplete
+         */        
+        TEST_CASE_COMPLETE_EVENT /*:String*/ : "testcasecomplete",
+        
+        /**
+         * Fires when a test suite is opened but before the first 
+         * test is executed.
+         * @event testsuitebegin
+         */        
+        TEST_SUITE_BEGIN_EVENT /*:String*/ : "testsuitebegin",
+        
+        /**
+         * Fires when all test cases in a test suite have been
+         * completed.
+         * @event testsuitecomplete
+         */        
+        TEST_SUITE_COMPLETE_EVENT /*:String*/ : "testsuitecomplete",
+        
+        /**
+         * Fires when a test has passed.
+         * @event pass
+         */        
+        TEST_PASS_EVENT /*:String*/ : "pass",
+        
+        /**
+         * Fires when a test has failed.
+         * @event fail
+         */        
+        TEST_FAIL_EVENT /*:String*/ : "fail",
+        
+        /**
+         * Fires when a test has been ignored.
+         * @event ignore
+         */        
+        TEST_IGNORE_EVENT /*:String*/ : "ignore",
+        
+        /**
+         * Fires when all test suites and test cases have been completed.
+         * @event complete
+         */        
+        COMPLETE_EVENT /*:String*/ : "complete",
+        
+        /**
+         * Fires when the run() method is called.
+         * @event begin
+         */        
+        BEGIN_EVENT /*:String*/ : "begin",    
+    
+        //-------------------------------------------------------------------------
+        // Private Methods
+        //-------------------------------------------------------------------------
+         
+        /**
+         * Runs a given test case.
+         * @param {YAHOO.tool.TestCase} testCase The test case to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @method _runTestCase
+         * @private
+         * @static
+         */
+        _runTestCase : function (testCase /*YAHOO.tool.TestCase*/) /*:Void*/{
+        
+            //object to store results
+            var results /*:Object*/ = {};
+        
+            //test case begins
+            this.fireEvent(this.TEST_CASE_BEGIN_EVENT, { testCase: testCase });
+        
+            //gather the test functions
+            var tests /*:Array*/ = [];
+            for (var prop in testCase){
+                if (prop.indexOf("test") === 0 && typeof testCase[prop] == "function") {
+                    tests.push(prop);
+                }
+            }
+            
+            //get the "should" test cases
+            var shouldFail /*:Object*/ = testCase._should.fail || {};
+            var shouldError /*:Object*/ = testCase._should.error || {};
+            var shouldIgnore /*:Object*/ = testCase._should.ignore || {};
+            
+            //test counts
+            var failCount /*:int*/ = 0;
+            var passCount /*:int*/ = 0;
+            var runCount /*:int*/ = 0;
+            
+            //run each test
+            for (var i=0; i < tests.length; i++){
+            
+                //figure out if the test should be ignored or not
+                if (shouldIgnore[tests[i]]){
+                    this.fireEvent(this.TEST_IGNORE_EVENT, { testCase: testCase, testName: tests[i] });
+                    continue;
+                }
+            
+                //variable to hold whether or not the test failed
+                var failed /*:Boolean*/ = false;
+                var error /*:Error*/ = null;
+            
+                //run the setup
+                testCase.setUp();
+                
+                //try the test
+                try {
+                
+                    //run the test
+                    testCase[tests[i]]();
+                    
+                    //if it should fail, and it got here, then it's a fail because it didn't
+                    if (shouldFail[tests[i]]){
+                        error = new YAHOO.util.ShouldFail();
+                        failed = true;
+                    } else if (shouldError[tests[i]]){
+                        error = new YAHOO.util.ShouldError();
+                        failed = true;
+                    }
+                               
+                } catch (thrown /*:Error*/){
+                    if (thrown instanceof YAHOO.util.AssertionError) {
+                        if (!shouldFail[tests[i]]){
+                            error = thrown;
+                            failed = true;
+                        }
+                    } else {
+                        //first check to see if it should error
+                        if (!shouldError[tests[i]]) {                        
+                            error = new YAHOO.util.UnexpectedError(thrown);
+                            failed = true;
+                        } else {
+                            //check to see what type of data we have
+                            if (YAHOO.lang.isString(shouldError[tests[i]])){
+                                
+                                //if it's a string, check the error message
+                                if (thrown.message != shouldError[tests[i]]){
+                                    error = new YAHOO.util.UnexpectedError(thrown);
+                                    failed = true;                                    
+                                }
+                            } else if (YAHOO.lang.isObject(shouldError[tests[i]])){
+                            
+                                //if it's an object, check the instance and message
+                                if (!(thrown instanceof shouldError[tests[i]].constructor) || 
+                                        thrown.message != shouldError[tests[i]].message){
+                                    error = new YAHOO.util.UnexpectedError(thrown);
+                                    failed = true;                                    
+                                }
+                            
+                            }
+                        
+                        }
+                    }
+                    
+                } finally {
+                
+                    //fireEvent appropriate event
+                    if (failed) {
+                        this.fireEvent(this.TEST_FAIL_EVENT, { testCase: testCase, testName: tests[i], error: error });
+                    } else {
+                        this.fireEvent(this.TEST_PASS_EVENT, { testCase: testCase, testName: tests[i] });
+                    }            
+                }
+                
+                //run the tear down
+                testCase.tearDown();
+                
+                //update results
+                results[tests[i]] = { 
+                    result: failed ? "fail" : "pass",
+                    message : error ? error.getMessage() : "Test passed"
+                };
+                
+                //update counts
+                runCount++;
+                failCount += (failed ? 1 : 0);
+                passCount += (failed ? 0 : 1);
+            }
+            
+            //add test counts to results
+            results.total = runCount;
+            results.failed = failCount;
+            results.passed = passCount;
+            
+            //test case is done
+            this.fireEvent(this.TEST_CASE_COMPLETE_EVENT, { testCase: testCase, results: results });
+            
+            //return results
+            return results;
+        
+        },
+        
+        /**
+         * Runs all the tests in a test suite.
+         * @param {YAHOO.tool.TestSuite} testSuite The test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @method _runTestSuite
+         * @private
+         * @static
+         */
+        _runTestSuite : function (testSuite /*:YAHOO.tool.TestSuite*/) {
+        
+            //object to store results
+            var results /*:Object*/ = {
+                passed: 0,
+                failed: 0,
+                total: 0
+            };
+        
+            //fireEvent event for beginning of test suite run
+            this.fireEvent(this.TEST_SUITE_BEGIN_EVENT, { testSuite: testSuite });
+        
+            //iterate over the test suite items
+            for (var i=0; i < testSuite.items.length; i++){
+                var result = null;
+                if (testSuite.items[i] instanceof YAHOO.tool.TestSuite) {
+                    result = this._runTestSuite(testSuite.items[i]);
+                } else if (testSuite.items[i] instanceof YAHOO.tool.TestCase) {
+                    result = this._runTestCase(testSuite.items[i]);
+                }
+                
+                if (result !== null){
+                    results.total += result.total;
+                    results.passed += result.passed;
+                    results.failed += result.failed;
+                    results[testSuite.items[i].name] = result;
+                }
+            }
+    
+            //fireEvent event for completion of test suite run
+            this.fireEvent(this.TEST_SUITE_COMPLETE_EVENT, { testSuite: testSuite, results: results });
+            
+            //return the results
+            return results;
+        
+        },
+        
+        /**
+         * Runs a test case or test suite, returning the results.
+         * @param {YAHOO.tool.TestCase|YAHOO.tool.TestSuite} testObject The test case or test suite to run.
+         * @return {Object} Results of the execution with properties passed, failed, and total.
+         * @private
+         * @method _run
+         * @static
+         */
+        _run : function (testObject /*:YAHOO.tool.TestCase|YAHOO.tool.TestSuite*/) /*:Void*/ {
+            if (YAHOO.lang.isObject(testObject)){
+                if (testObject instanceof YAHOO.tool.TestSuite) {
+                    return this._runTestSuite(testObject);
+                } else if (testObject instanceof YAHOO.tool.TestCase) {
+                    return this._runTestCase(testObject);
+                } else {
+                    throw new TypeError("_run(): Expected either YAHOO.tool.TestCase or YAHOO.tool.TestSuite.");
+                }    
+            }        
+        },
+        
+        //-------------------------------------------------------------------------
+        // Protected Methods
+        //-------------------------------------------------------------------------   
+    
+        /*
+         * Fires events for the TestRunner. This overrides the default fireEvent()
+         * method from EventProvider to add the type property to the data that is
+         * passed through on each event call.
+         * @param {String} type The type of event to fire.
+         * @param {Object} data (Optional) Data for the event.
+         * @method fireEvent
+         * @static
+         * @protected
+         */
+        fireEvent : function (type /*:String*/, data /*:Object*/) /*:Void*/ {
+            data = data || {};
+            data.type = type;
+            TestRunner.superclass.fireEvent.call(this, type, data);
+        },
+        
+        //-------------------------------------------------------------------------
+        // Public Methods
+        //-------------------------------------------------------------------------   
+    
+        /**
+         * Adds a test suite or test case to the list of test objects to run.
+         * @param testObject Either a TestCase or a TestSuite that should be run.
+         */
+        add : function (testObject /*:Object*/) /*:Void*/ {
+            this.items.push(testObject);
+        },
+        
+        /**
+         * Removes all test objects from the runner.
+         */
+        clear : function () /*:Void*/ {
+            while(this.items.length){
+                this.items.pop();
+            }
+        },
+    
+        /**
+         * Runs the test suite.
+         */
+        run : function (testObject /*:Object*/) /*:Void*/ { 
+            var results = null;
+            
+            this.fireEvent(this.BEGIN_EVENT);
+       
+            //an object passed in overrides everything else
+            if (YAHOO.lang.isObject(testObject)){
+                results = this._run(testObject);  
+            } else {
+                results = {
+                    passed: 0,
+                    failed: 0,
+                    total: 0
+                };
+                for (var i=0; i < this.items.length; i++){
+                    var result = this._run(this.items[i]);
+                    results.passed += result.passed;
+                    results.failed += result.failed;
+                    results.total += result.total;
+                    results[this.items[i].name] = result;
+                }            
+            }
+            
+            this.fireEvent(this.COMPLETE_EVENT, { results: results });
+        }    
+    });
+    
+    return new TestRunner();
+    
+})();
+YAHOO.namespace("tool");
+
+
+//-----------------------------------------------------------------------------
+// TestSuite object
+//-----------------------------------------------------------------------------
+
+/**
+ * A test suite that can contain a collection of TestCase and TestSuite objects.
+ * @param {String} name The name of the test fixture.
+ * @namespace YAHOO.tool
+ * @class TestSuite
+ * @constructor
+ */
+YAHOO.tool.TestSuite = function (name /*:String*/) {
+
+    /**
+     * The name of the test suite.
+     */
+    this.name /*:String*/ = name || YAHOO.util.Dom.generateId(null, "testSuite");
+
+    /**
+     * Array of test suites and
+     * @private
+     */
+    this.items /*:Array*/ = [];
+
+};
+
+YAHOO.tool.TestSuite.prototype = {
+    
+    /**
+     * Adds a test suite or test case to the test suite.
+     * @param {YAHOO.tool.TestSuite||YAHOO.tool.TestCase} testObject The test suite or test case to add.
+     */
+    add : function (testObject /*:YAHOO.tool.TestSuite*/) /*:Void*/ {
+        if (testObject instanceof YAHOO.tool.TestSuite || testObject instanceof YAHOO.tool.TestCase) {
+            this.items.push(testObject);
+        }
+    }
+    
+};
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestCase object
+//-----------------------------------------------------------------------------
+
+/**
+ * Test case containing various tests to run.
+ * @param template An object containing any number of test methods, other methods,
+ *                 an optional name, and anything else the test case needs.
+ * @class TestCase
+ * @namespace YAHOO.tool
+ * @constructor
+ */
+YAHOO.tool.TestCase = function (template /*:Object*/) {
+    
+    /**
+     * Special rules for the test case. Possible subobjects
+     * are fail, for tests that should fail, and error, for
+     * tests that should throw an error.
+     */
+    this._should /*:Object*/ = {};
+    
+    //copy over all properties from the template to this object
+    for (var prop in template) {
+        this[prop] = template[prop];
+    }    
+    
+    //check for a valid name
+    if (!YAHOO.lang.isString(this.name)){
+        /**
+         * Name for the test case.
+         */
+        this.name /*:String*/ = YAHOO.util.Dom.generateId(null, "testCase");
+    }
+
+};
+
+YAHOO.tool.TestCase.prototype = {  
+
+    //-------------------------------------------------------------------------
+    // Test Methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Function to run before each test is executed.
+     */
+    setUp : function () /*:Void*/ {
+    },
+    
+    /**
+     * Function to run after each test is executed.
+     */
+    tearDown: function () /*:Void*/ {    
+    }
+};
+YAHOO.namespace("util");
+
+//-----------------------------------------------------------------------------
+// Assert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The Assert object provides functions to test JavaScript values against
+ * known and expected results. Whenever a comparison (assertion) fails,
+ * an error is thrown.
+ *
+ * @namespace YAHOO.util
+ * @class Assert
+ * @static
+ */
+YAHOO.util.Assert = {
+
+    //-------------------------------------------------------------------------
+    // Generic Assertion Methods
+    //-------------------------------------------------------------------------
+    
+    /** 
+     * Forces an assertion error to occur.
+     * @param {String} message (Optional) The message to display with the failure.
+     * @method fail
+     * @static
+     */
+    fail : function (message /*:String*/) /*:Void*/ {
+        throw new YAHOO.util.AssertionError(message || "Test force-failed.");
+    },       
+    
+    //-------------------------------------------------------------------------
+    // Equality Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    areEqual : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected != actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be equal.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not equal to another. This uses the double equals sign
+     * so type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotEqual
+     * @static
+     */
+    areNotEqual : function (unexpected /*:Object*/, actual /*:Object*/, 
+                         message /*:String*/) /*:Void*/ {
+        if (unexpected == actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be equal.", unexpected);
+        }
+    },
+    
+    /**
+     * Asserts that a value is not the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} unexpected The unexpected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areNotSame
+     * @static
+     */
+    areNotSame : function (unexpected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (unexpected === actual) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be the same.", unexpected);
+        }
+    },
+
+    /**
+     * Asserts that a value is the same as another. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areSame
+     * @static
+     */
+    areSame : function (expected /*:Object*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (expected !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Values should be the same.", expected, actual);
+        }
+    },    
+    
+    //-------------------------------------------------------------------------
+    // Boolean Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is false. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFalse
+     * @static
+     */
+    isFalse : function (actual /*:Boolean*/, message /*:String*/) {
+        if (false !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be false.", false, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is true. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTrue
+     * @static
+     */
+    isTrue : function (actual /*:Boolean*/, message /*:String*/) /*:Void*/ {
+        if (true !== actual) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be true.", true, actual);
+        }
+
+    },
+    
+    //-------------------------------------------------------------------------
+    // Special Value Assertion Methods
+    //-------------------------------------------------------------------------    
+    
+    /**
+     * Asserts that a value is not a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNaN
+     * @static
+     */
+    isNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (!isNaN(actual)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be NaN.", NaN, actual);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not the special NaN value.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNaN
+     * @static
+     */
+    isNotNaN : function (actual /*:Object*/, message /*:String*/) /*:Void*/{
+        if (isNaN(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be NaN.", NaN);
+        }    
+    },
+    
+    /**
+     * Asserts that a value is not null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotNull
+     * @static
+     */
+    isNotNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Values should not be null.", null);
+        }
+    },
+
+    /**
+     * Asserts that a value is not undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotUndefined
+     * @static
+     */
+    isNotUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.UnexpectedValue(message || "Value should not be undefined.", undefined);
+        }
+    },
+
+    /**
+     * Asserts that a value is null. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNull
+     * @static
+     */
+    isNull : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNull(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be null.", null, actual);
+        }
+    },
+        
+    /**
+     * Asserts that a value is undefined. This uses the triple equals sign
+     * so no type cohersion may occur.
+     * @param {Object} expected The expected value.
+     * @param {Object} actual The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isUndefined
+     * @static
+     */
+    isUndefined : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isUndefined(actual)) {
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be undefined.", undefined, actual);
+        }
+    },    
+    
+    //--------------------------------------------------------------------------
+    // Instance Assertion Methods
+    //--------------------------------------------------------------------------    
+   
+    /**
+     * Asserts that a value is an array.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isArray
+     * @static
+     */
+    isArray : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isArray(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an array.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a Boolean.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isBoolean
+     * @static
+     */
+    isBoolean : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isBoolean(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a Boolean.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is a function.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isFunction
+     * @static
+     */
+    isFunction : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isFunction(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a function.", actual);
+        }    
+    },
+   
+    /**
+     * Asserts that a value is an instance of a particular object. This may return
+     * incorrect results when comparing objects from one frame to constructors in
+     * another frame. For best results, don't use in a cross-frame manner.
+     * @param {Function} expected The function that the object should be an instance of.
+     * @param {Object} actual The object to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isInstanceOf
+     * @static
+     */
+    isInstanceOf : function (expected /*:Function*/, actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!(actual instanceof expected)){
+            throw new YAHOO.util.ComparisonFailure(message || "Value isn't an instance of expected type.", expected, actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a number.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNumber
+     * @static
+     */
+    isNumber : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isNumber(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a number.", actual);
+        }    
+    },    
+    
+    /**
+     * Asserts that a value is an object.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isObject
+     * @static
+     */
+    isObject : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isObject(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be an object.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is a string.
+     * @param {Object} actual The value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isString
+     * @static
+     */
+    isString : function (actual /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.isString(actual)){
+            throw new YAHOO.util.UnexpectedValue(message || "Value should be a string.", actual);
+        }
+    },
+    
+    /**
+     * Asserts that a value is of a particular type. 
+     * @param {String} expectedType The expected type of the variable.
+     * @param {Object} actualValue The actual value to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isTypeOf
+     * @static
+     */
+    isTypeOf : function (expectedType /*:String*/, actualValue /*:Object*/, message /*:String*/) /*:Void*/{
+        if (typeof actualValue != expectedType){
+            throw new YAHOO.util.ComparisonFailure(message || "Value should be of type " + expected + ".", expected, typeof actual);
+        }
+    }
+};
+
+//-----------------------------------------------------------------------------
+// Assertion errors
+//-----------------------------------------------------------------------------
+
+/**
+ * AssertionError is thrown whenever an assertion fails. It provides methods
+ * to more easily get at error information and also provides a base class
+ * from which more specific assertion errors can be derived.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @class AssertionError
+ * @extends Error
+ * @constructor
+ */ 
+YAHOO.util.AssertionError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /*
+     * Error message. Must be duplicated to ensure browser receives it.
+     * @type String
+     * @property message
+     */
+    this.message /*:String*/ = message;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "AssertionError";
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.AssertionError, Error, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This should
+     * be overridden by all subclasses to provide specific information.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message;
+    },
+    
+    /**
+     * Returns a string representation of the error.
+     * @method toString
+     * @return {String} A string representation of the error.
+     */
+    toString : function () /*:String*/ {
+        return this.name + ": " + this.getMessage();
+    },
+    
+    /**
+     * Returns a primitive value version of the error. Same as toString().
+     * @method valueOf
+     * @return {String} A primitive value version of the error.
+     */
+    valueOf : function () /*:String*/ {
+        return this.toString();
+    }
+
+});
+
+/**
+ * ComparisonFailure is subclass of AssertionError that is thrown whenever
+ * a comparison between two values fails. It provides mechanisms to retrieve
+ * both the expected and actual value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} expected The expected value.
+ * @param {Object} actual The actual value that caused the assertion to fail.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ComparisonFailure
+ * @constructor
+ */ 
+YAHOO.util.ComparisonFailure = function (message /*:String*/, expected /*:Object*/, actual /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The expected value.
+     * @type Object
+     * @property expected
+     */
+    this.expected /*:Object*/ = expected;
+    
+    /**
+     * The actual value.
+     * @type Object
+     * @property actual
+     */
+    this.actual /*:Object*/ = actual;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ComparisonFailure";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ComparisonFailure, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. This message
+     * provides information about the expected and actual values.
+     * @method toString
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nExpected: " + this.expected + " (" + (typeof this.expected) + ")"  +
+            "\nActual:" + this.actual + " (" + (typeof this.actual) + ")";
+    }
+
+});
+
+/**
+ * UnexpectedValue is subclass of AssertionError that is thrown whenever
+ * a value was unexpected in its scope. This typically means that a test
+ * was performed to determine that a value was *not* equal to a certain
+ * value.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @param {Object} unexpected The unexpected value.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedValue
+ * @constructor
+ */ 
+YAHOO.util.UnexpectedValue = function (message /*:String*/, unexpected /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message);
+    
+    /**
+     * The unexpected value.
+     * @type Object
+     * @property unexpected
+     */
+    this.unexpected /*:Object*/ = unexpected;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedValue";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedValue, YAHOO.util.AssertionError, {
+
+    /**
+     * Returns a fully formatted error for an assertion failure. The message
+     * contains information about the unexpected value that was encountered.
+     * @method getMessage
+     * @return {String} A string describing the error.
+     */
+    getMessage : function () /*:String*/ {
+        return this.message + "\nUnexpected: " + this.unexpected + " (" + (typeof this.unexpected) + ") ";
+    }
+
+});
+
+/**
+ * ShouldFail is subclass of AssertionError that is thrown whenever
+ * a test was expected to fail but did not.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldFail
+ * @constructor
+ */  
+YAHOO.util.ShouldFail = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should fail but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldFail";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldFail, YAHOO.util.AssertionError);
+
+/**
+ * ShouldError is subclass of AssertionError that is thrown whenever
+ * a test is expected to throw an error but doesn't.
+ *
+ * @param {String} message The message to display when the error occurs.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class ShouldError
+ * @constructor
+ */  
+YAHOO.util.ShouldError = function (message /*:String*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, message || "This test should have thrown an error but didn't.");
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "ShouldError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.ShouldError, YAHOO.util.AssertionError);
+
+/**
+ * UnexpectedError is subclass of AssertionError that is thrown whenever
+ * an error occurs within the course of a test and the test was not expected
+ * to throw an error.
+ *
+ * @param {Error} cause The unexpected error that caused this error to be 
+ *                      thrown.
+ * @namespace YAHOO.util
+ * @extends YAHOO.util.AssertionError
+ * @class UnexpectedError
+ * @constructor
+ */  
+YAHOO.util.UnexpectedError = function (cause /*:Object*/){
+
+    //call superclass
+    arguments.callee.superclass.constructor.call(this, "Unexpected error: " + cause.message);
+    
+    /**
+     * The unexpected error that occurred.
+     * @type Error
+     * @property cause
+     */
+    this.cause /*:Error*/ = cause;
+    
+    /**
+     * The name of the error that occurred.
+     * @type String
+     * @property name
+     */
+    this.name /*:String*/ = "UnexpectedError";
+    
+};
+
+//inherit methods
+YAHOO.lang.extend(YAHOO.util.UnexpectedError, YAHOO.util.AssertionError);
+//-----------------------------------------------------------------------------
+// ArrayAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ArrayAssert object provides functions to test JavaScript array objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ArrayAssert
+ * @static
+ */
+YAHOO.util.ArrayAssert = {
+
+    /**
+     * Asserts that a value is present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method contains
+     * @static
+     */
+    contains : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value (" + needle + ") not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * be found.
+     * @param {Object[]} needles An array of values that are expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsItems
+     * @static
+     */
+    containsItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        //begin checking values
+        for (var i=0; i < needles.length; i++){
+            this.contains(needles[i], haystack, message);
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "Value not found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value matching some condition is present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method containsMatch
+     * @static
+     */
+    containsMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");
+        }
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (!found){
+            YAHOO.util.Assert.fail(message || "No match found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a value is not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur.
+     * @param {Object} needle The value that is expected in the array.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContain
+     * @static
+     */
+    doesNotContain : function (needle /*:Object*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (haystack[i] === needle) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+
+    /**
+     * Asserts that a set of values are not present in an array. This uses the triple equals 
+     * sign so no type cohersion may occur. For this assertion to pass, all values must
+     * not be found.
+     * @param {Object[]} needles An array of values that are not expected in the array.
+     * @param {Array} haystack An array of values to check.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainItems
+     * @static
+     */
+    doesNotContainItems : function (needles /*:Object[]*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+
+        for (var i=0; i < needles.length; i++){
+            this.doesNotContain(needles[i], haystack, message);
+        }
+
+    },
+        
+    /**
+     * Asserts that no values matching a condition are present in an array. This uses
+     * a function to determine a match.
+     * @param {Function} matcher A function that returns true if the items matches or false if not.
+     * @param {Array} haystack An array of values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method doesNotContainMatch
+     * @static
+     */
+    doesNotContainMatch : function (matcher /*:Function*/, haystack /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //check for valid matcher
+        if (typeof matcher != "function"){
+            throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");
+        }
+
+        var found /*:Boolean*/ = false;
+        
+        //begin checking values
+        for (var i=0; i < haystack.length && !found; i++){
+            if (matcher(haystack[i])) {
+                found = true;
+            }
+        }
+        
+        if (found){
+            YAHOO.util.Assert.fail(message || "Value found in array.");
+        }
+    },
+        
+    /**
+     * Asserts that the given value is contained in an array at the specified index.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method indexOf
+     * @static
+     */
+    indexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=0; i < haystack.length; i++){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    },
+        
+    /**
+     * Asserts that the values in an array are equal, and in the same position,
+     * as values in another array. This uses the double equals sign
+     * so type cohersion may occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreEqual
+     * @static
+     */
+    itemsAreEqual : function (expected /*:Array*/, actual /*:Array*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areEqual(expected[i], actual[i], message || 
+                    "Values in position " + i + " are not equal.");
+        }
+    },
+    
+    /**
+     * Asserts that the values in an array are equivalent, and in the same position,
+     * as values in another array. This uses a function to determine if the values
+     * are equivalent. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {Function} comparator A function that returns true if the values are equivalent
+     *      or false if not.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @return {Void}
+     * @method itemsAreEquivalent
+     * @static
+     */
+    itemsAreEquivalent : function (expected /*:Array*/, actual /*:Array*/, 
+                           comparator /*:Function*/, message /*:String*/) /*:Void*/ {
+        
+        //make sure the comparator is valid
+        if (typeof comparator != "function"){
+            throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");
+        }
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            if (!comparator(expected[i], actual[i])){
+                throw new YAHOO.util.ComparisonFailure(message || "Values in position " + i + " are not equivalent.", expected[i], actual[i]);
+            }
+        }
+    },
+    
+    /**
+     * Asserts that an array is empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isEmpty
+     * @static
+     */
+    isEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length > 0){
+            YAHOO.util.Assert.fail(message || "Array should be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that an array is not empty.
+     * @param {Array} actual The array to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method isNotEmpty
+     * @static
+     */
+    isNotEmpty : function (actual /*:Array*/, message /*:String*/) /*:Void*/ {        
+        if (actual.length === 0){
+            YAHOO.util.Assert.fail(message || "Array should not be empty.");
+        }
+    },    
+    
+    /**
+     * Asserts that the values in an array are the same, and in the same position,
+     * as values in another array. This uses the triple equals sign
+     * so no type cohersion will occur. Note that the array objects themselves
+     * need not be the same for this test to pass.
+     * @param {Array} expected An array of the expected values.
+     * @param {Array} actual Any array of the actual values.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method itemsAreSame
+     * @static
+     */
+    itemsAreSame : function (expected /*:Array*/, actual /*:Array*/, 
+                          message /*:String*/) /*:Void*/ {
+        
+        //one may be longer than the other, so get the maximum length
+        var len /*:int*/ = Math.max(expected.length, actual.length);
+        
+        //begin checking values
+        for (var i=0; i < len; i++){
+            YAHOO.util.Assert.areSame(expected[i], actual[i], 
+                message || "Values in position " + i + " are not the same.");
+        }
+    },
+    
+    /**
+     * Asserts that the given value is contained in an array at the specified index,
+     * starting from the back of the array.
+     * This uses the triple equals sign so no type cohersion will occur.
+     * @param {Object} needle The value to look for.
+     * @param {Array} haystack The array to search in.
+     * @param {int} index The index at which the value should exist.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method lastIndexOf
+     * @static
+     */
+    lastIndexOf : function (needle /*:Object*/, haystack /*:Array*/, index /*:int*/, message /*:String*/) /*:Void*/ {
+    
+        //try to find the value in the array
+        for (var i=haystack.length; i >= 0; i--){
+            if (haystack[i] === needle){
+                YAHOO.util.Assert.areEqual(index, i, message || "Value exists at index " + i + " but should be at index " + index + ".");
+                return;
+            }
+        }
+        
+        //if it makes it here, it wasn't found at all
+        YAHOO.util.Assert.fail(message || "Value doesn't exist in array.");        
+    }
+    
+};
+YAHOO.namespace("util");
+
+
+//-----------------------------------------------------------------------------
+// ObjectAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The ObjectAssert object provides functions to test JavaScript objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class ObjectAssert
+ * @static
+ */
+YAHOO.util.ObjectAssert = {
+        
+    /**
+     * Asserts that all properties in the object exist in another object.
+     * @param {Object} expected An object with the expected properties.
+     * @param {Object} actual An object with the actual properties.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method propertiesAreEqual
+     * @static
+     */
+    propertiesAreEqual : function (expected /*:Object*/, actual /*:Object*/, 
+                           message /*:String*/) /*:Void*/ {
+        
+        //get all properties in the object
+        var properties /*:Array*/ = [];        
+        for (var property in expected){
+            properties.push(property);
+        }
+        
+        //see if the properties are in the expected object
+        for (var i=0; i < properties.length; i++){
+            YAHOO.util.Assert.isNotUndefined(actual[properties[i]], message || 
+                    "Property'" + properties[i] + "' expected.");
+        }
+
+    },
+    
+    /**
+     * Asserts that an object has a property with the given name.
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (YAHOO.lang.isUndefined(object[propertyName])){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object.");
+        }    
+    },
+    
+    /**
+     * Asserts that a property with the given name exists on an object instance (not on its prototype).
+     * @param {String} propertyName The name of the property to test.
+     * @param {Object} object The object to search.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method hasProperty
+     * @static
+     */    
+    hasOwnProperty : function (propertyName /*:String*/, object /*:Object*/, message /*:String*/) /*:Void*/ {
+        if (!YAHOO.lang.hasOwnProperty(object, propertyName)){
+            YAHOO.util.Assert.fail(message || 
+                    "Property " + propertyName + " not found on object instance.");
+        }     
+    }
+};
+//-----------------------------------------------------------------------------
+// DateAssert object
+//-----------------------------------------------------------------------------
+
+/**
+ * The DateAssert object provides functions to test JavaScript Date objects
+ * for a variety of cases.
+ *
+ * @namespace YAHOO.util
+ * @class DateAssert
+ * @static
+ */
+YAHOO.util.DateAssert = {
+
+    /**
+     * Asserts that a date's month, day, and year are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    datesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getFullYear(), actual.getFullYear(), message || "Years should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMonth(), actual.getMonth(), message || "Months should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getDate(), actual.getDate(), message || "Day of month should be equal.");
+        } else {
+            throw new TypeError("DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    },
+
+    /**
+     * Asserts that a date's hour, minutes, and seconds are equal to another date's.
+     * @param {Date} expected The expected date.
+     * @param {Date} actual The actual date to test.
+     * @param {String} message (Optional) The message to display if the assertion fails.
+     * @method areEqual
+     * @static
+     */
+    timesAreEqual : function (expected /*:Date*/, actual /*:Date*/, message /*:String*/){
+        if (expected instanceof Date && actual instanceof Date){
+            YAHOO.util.Assert.areEqual(expected.getHours(), actual.getHours(), message || "Hours should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getMinutes(), actual.getMinutes(), message || "Minutes should be equal.");
+            YAHOO.util.Assert.areEqual(expected.getSeconds(), actual.getSeconds(), message || "Seconds should be equal.");
+        } else {
+            throw new TypeError("DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");
+        }
+    }
+    
+};
+YAHOO.namespace("util");
+
+/**
+ * The UserAction object provides functions that simulate events occurring in
+ * the browser. Since these are simulated events, they do not behave exactly
+ * as regular, user-initiated events do, but can be used to test simple
+ * user interactions safely.
+ *
+ * @namespace YAHOO.util
+ * @class UserAction
+ * @static
+ */
+YAHOO.util.UserAction = {
+
+    //--------------------------------------------------------------------------
+    // Generic event methods
+    //--------------------------------------------------------------------------
+
+    /**
+     * Simulates a key event using the given event information to populate
+     * the generated event object. This method does browser-equalizing
+     * calculations to account for differences in the DOM and IE event models
+     * as well as different browser quirks. Note: keydown causes Safari 2.x to
+     * crash.
+     * @method simulateKeyEvent
+     * @private
+     * @static
+     * @param {HTMLElement} target The target of the given event.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: keyup, keydown, and keypress.
+     * @param {Boolean} bubbles (Optional) Indicates if the event can be
+     *      bubbled up. DOM Level 3 specifies that all key events bubble by
+     *      default. The default is true.
+     * @param {Boolean} cancelable (Optional) Indicates if the event can be
+     *      canceled using preventDefault(). DOM Level 3 specifies that all
+     *      key events can be cancelled. The default 
+     *      is true.
+     * @param {Window} view (Optional) The view containing the target. This is
+     *      typically the window object. The default is window.
+     * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} metaKey (Optional) Indicates if one of the META keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {int} keyCode (Optional) The code for the key that is in use. 
+     *      The default is 0.
+     * @param {int} charCode (Optional) The Unicode code for the character
+     *      associated with the key being used. The default is 0.
+     */
+    simulateKeyEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                                 bubbles /*:Boolean*/,  cancelable /*:Boolean*/,    
+                                 view /*:Window*/,
+                                 ctrlKey /*:Boolean*/,    altKey /*:Boolean*/, 
+                                 shiftKey /*:Boolean*/,   metaKey /*:Boolean*/, 
+                                 keyCode /*:int*/,        charCode /*:int*/) /*:Void*/                             
+    {
+        //check target
+        target = YAHOO.util.Dom.get(target);        
+        if (!target){
+            throw new Error("simulateKeyEvent(): Invalid target.");
+        }
+        
+        //check event type
+        if (YAHOO.lang.isString(type)){
+            type = type.toLowerCase();
+            switch(type){
+                case "keyup":
+                case "keydown":
+                case "keypress":
+                    break;
+                case "textevent": //DOM Level 3
+                    type = "keypress";
+                    break;
+                    // @TODO was the fallthrough intentional, if so throw error
+                default:
+                    throw new Error("simulateKeyEvent(): Event type '" + type + "' not supported.");
+            }
+        } else {
+            throw new Error("simulateKeyEvent(): Event type must be a string.");
+        }
+        
+        //setup default values
+        if (!YAHOO.lang.isBoolean(bubbles)){
+            bubbles = true; //all key events bubble
+        }
+        if (!YAHOO.lang.isBoolean(cancelable)){
+            cancelable = true; //all key events can be cancelled
+        }
+        if (!YAHOO.lang.isObject(view)){
+            view = window; //view is typically window
+        }
+        if (!YAHOO.lang.isBoolean(ctrlKey)){
+            ctrlKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(altKey)){
+            altKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(shiftKey)){
+            shiftKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(metaKey)){
+            metaKey = false;
+        }
+        if (!YAHOO.lang.isNumber(keyCode)){
+            keyCode = 0;
+        }
+        if (!YAHOO.lang.isNumber(charCode)){
+            charCode = 0; 
+        }
+        
+        //check for DOM-compliant browsers first
+        if (YAHOO.lang.isFunction(document.createEvent)){
+        
+            //try to create a mouse event
+            var event /*:MouseEvent*/ = null;
+            
+            try {
+                
+                //try to create key event
+                event = document.createEvent("KeyEvents");
+                
+                /*
+                 * Interesting problem: Firefox implemented a non-standard
+                 * version of initKeyEvent() based on DOM Level 2 specs.
+                 * Key event was removed from DOM Level 2 and re-introduced
+                 * in DOM Level 3 with a different interface. Firefox is the
+                 * only browser with any implementation of Key Events, so for
+                 * now, assume it's Firefox if the above line doesn't error.
+                 */
+                //TODO: Decipher between Firefox's implementation and a correct one.
+                event.initKeyEvent(type, bubbles, cancelable, view, ctrlKey,
+                    altKey, shiftKey, metaKey, keyCode, charCode);       
+                
+            } catch (ex /*:Error*/){
+
+                /*
+                 * If it got here, that means key events aren't officially supported. 
+                 * Safari/WebKit is a real problem now. WebKit 522 won't let you
+                 * set keyCode, charCode, or other properties if you use a
+                 * UIEvent, so we first must try to create a generic event. The
+                 * fun part is that this will throw an error on Safari 2.x. The
+                 * end result is that we need another try...catch statement just to
+                 * deal with this mess.
+                 */
+                try {
+
+                    //try to create generic event - will fail in Safari 2.x
+                    event = document.createEvent("Events");
+
+                } catch (uierror /*:Error*/){
+
+                    //the above failed, so create a UIEvent for Safari 2.x
+                    event = document.createEvent("UIEvents");
+
+                } finally {
+
+                    event.initEvent(type, bubbles, cancelable);
+    
+                    //initialize
+                    event.view = view;
+                    event.altKey = altKey;
+                    event.ctrlKey = ctrlKey;
+                    event.shiftKey = shiftKey;
+                    event.metaKey = metaKey;
+                    event.keyCode = keyCode;
+                    event.charCode = charCode;
+          
+                }          
+             
+            }
+            
+            //fire the event
+            target.dispatchEvent(event);
+
+        } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
+        
+            //create an IE event object
+            event = document.createEventObject();
+            
+            //assign available properties
+            event.bubbles = bubbles;
+            event.cancelable = cancelable;
+            event.view = view;
+            event.ctrlKey = ctrlKey;
+            event.altKey = altKey;
+            event.shiftKey = shiftKey;
+            event.metaKey = metaKey;
+            
+            /*
+             * IE doesn't support charCode explicitly. CharCode should
+             * take precedence over any keyCode value for accurate
+             * representation.
+             */
+            event.keyCode = (charCode > 0) ? charCode : keyCode;
+            
+            //fire the event
+            target.fireEvent("on" + type, event);  
+                    
+        } else {
+            throw new Error("simulateKeyEvent(): No event simulation framework present.");
+        }
+    },
+
+    /**
+     * Simulates a mouse event using the given event information to populate
+     * the generated event object. This method does browser-equalizing
+     * calculations to account for differences in the DOM and IE event models
+     * as well as different browser quirks.
+     * @method simulateMouseEvent
+     * @private
+     * @static
+     * @param {HTMLElement} target The target of the given event.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: click, dblclick, mousedown, mouseup, mouseout,
+     *      mouseover, and mousemove.
+     * @param {Boolean} bubbles (Optional) Indicates if the event can be
+     *      bubbled up. DOM Level 2 specifies that all mouse events bubble by
+     *      default. The default is true.
+     * @param {Boolean} cancelable (Optional) Indicates if the event can be
+     *      canceled using preventDefault(). DOM Level 2 specifies that all
+     *      mouse events except mousemove can be cancelled. The default 
+     *      is true for all events except mousemove, for which the default 
+     *      is false.
+     * @param {Window} view (Optional) The view containing the target. This is
+     *      typically the window object. The default is window.
+     * @param {int} detail (Optional) The number of times the mouse button has
+     *      been used. The default value is 1.
+     * @param {int} screenX (Optional) The x-coordinate on the screen at which
+     *      point the event occured. The default is 0.
+     * @param {int} screenY (Optional) The y-coordinate on the screen at which
+     *      point the event occured. The default is 0.
+     * @param {int} clientX (Optional) The x-coordinate on the client at which
+     *      point the event occured. The default is 0.
+     * @param {int} clientY (Optional) The y-coordinate on the client at which
+     *      point the event occured. The default is 0.
+     * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {Boolean} metaKey (Optional) Indicates if one of the META keys
+     *      is pressed while the event is firing. The default is false.
+     * @param {int} button (Optional) The button being pressed while the event
+     *      is executing. The value should be 0 for the primary mouse button
+     *      (typically the left button), 1 for the terciary mouse button
+     *      (typically the middle button), and 2 for the secondary mouse button
+     *      (typically the right button). The default is 0.
+     * @param {HTMLElement} relatedTarget (Optional) For mouseout events,
+     *      this is the element that the mouse has moved to. For mouseover
+     *      events, this is the element that the mouse has moved from. This
+     *      argument is ignored for all other events. The default is null.
+     */
+    simulateMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                                   bubbles /*:Boolean*/,  cancelable /*:Boolean*/,    
+                                   view /*:Window*/,        detail /*:int*/, 
+                                   screenX /*:int*/,        screenY /*:int*/, 
+                                   clientX /*:int*/,        clientY /*:int*/,       
+                                   ctrlKey /*:Boolean*/,    altKey /*:Boolean*/, 
+                                   shiftKey /*:Boolean*/,   metaKey /*:Boolean*/, 
+                                   button /*:int*/,         relatedTarget /*:HTMLElement*/) /*:Void*/
+    {
+        
+        //check target
+        target = YAHOO.util.Dom.get(target);        
+        if (!target){
+            throw new Error("simulateMouseEvent(): Invalid target.");
+        }
+        
+        //check event type
+        if (YAHOO.lang.isString(type)){
+            type = type.toLowerCase();
+            switch(type){
+                case "mouseover":
+                case "mouseout":
+                case "mousedown":
+                case "mouseup":
+                case "click":
+                case "dblclick":
+                case "mousemove":
+                    break;
+                default:
+                    throw new Error("simulateMouseEvent(): Event type '" + type + "' not supported.");
+            }
+        } else {
+            throw new Error("simulateMouseEvent(): Event type must be a string.");
+        }
+        
+        //setup default values
+        if (!YAHOO.lang.isBoolean(bubbles)){
+            bubbles = true; //all mouse events bubble
+        }
+        if (!YAHOO.lang.isBoolean(cancelable)){
+            cancelable = (type != "mousemove"); //mousemove is the only one that can't be cancelled
+        }
+        if (!YAHOO.lang.isObject(view)){
+            view = window; //view is typically window
+        }
+        if (!YAHOO.lang.isNumber(detail)){
+            detail = 1;  //number of mouse clicks must be at least one
+        }
+        if (!YAHOO.lang.isNumber(screenX)){
+            screenX = 0; 
+        }
+        if (!YAHOO.lang.isNumber(screenY)){
+            screenY = 0; 
+        }
+        if (!YAHOO.lang.isNumber(clientX)){
+            clientX = 0; 
+        }
+        if (!YAHOO.lang.isNumber(clientY)){
+            clientY = 0; 
+        }
+        if (!YAHOO.lang.isBoolean(ctrlKey)){
+            ctrlKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(altKey)){
+            altKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(shiftKey)){
+            shiftKey = false;
+        }
+        if (!YAHOO.lang.isBoolean(metaKey)){
+            metaKey = false;
+        }
+        if (!YAHOO.lang.isNumber(button)){
+            button = 0; 
+        }
+        
+        //check for DOM-compliant browsers first
+        if (YAHOO.lang.isFunction(document.createEvent)){
+        
+            //try to create a mouse event
+            var event /*:MouseEvent*/ = document.createEvent("MouseEvents");
+            
+            //Safari 2.x (WebKit 418) still doesn't implement initMouseEvent()
+            if (event.initMouseEvent){
+                event.initMouseEvent(type, bubbles, cancelable, view, detail,
+                                     screenX, screenY, clientX, clientY, 
+                                     ctrlKey, altKey, shiftKey, metaKey, 
+                                     button, relatedTarget);
+            } else { //Safari
+            
+                //the closest thing available in Safari 2.x is UIEvents
+                event = document.createEvent("UIEvents");
+                event.initEvent(type, bubbles, cancelable);
+                event.view = view;
+                event.detail = detail;
+                event.screenX = screenX;
+                event.screenY = screenY;
+                event.clientX = clientX;
+                event.clientY = clientY;
+                event.ctrlKey = ctrlKey;
+                event.altKey = altKey;
+                event.metaKey = metaKey;
+                event.shiftKey = shiftKey;
+                event.button = button;
+                event.relatedTarget = relatedTarget;
+            }
+            
+            /*
+             * Check to see if relatedTarget has been assigned. Firefox
+             * versions less than 2.0 don't allow it to be assigned via
+             * initMouseEvent() and the property is readonly after event
+             * creation, so in order to keep YAHOO.util.getRelatedTarget()
+             * working, assign to the IE proprietary toElement property
+             * for mouseout event and fromElement property for mouseover
+             * event.
+             */
+            if (relatedTarget && !event.relatedTarget){
+                if (type == "mouseout"){
+                    event.toElement = relatedTarget;
+                } else if (type == "mouseover"){
+                    event.fromElement = relatedTarget;
+                }
+            }
+            
+            //fire the event
+            target.dispatchEvent(event);
+
+        } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE
+        
+            //create an IE event object
+            event = document.createEventObject();
+            
+            //assign available properties
+            event.bubbles = bubbles;
+            event.cancelable = cancelable;
+            event.view = view;
+            event.detail = detail;
+            event.screenX = screenX;
+            event.screenY = screenY;
+            event.clientX = clientX;
+            event.clientY = clientY;
+            event.ctrlKey = ctrlKey;
+            event.altKey = altKey;
+            event.metaKey = metaKey;
+            event.shiftKey = shiftKey;
+
+            //fix button property for IE's wacky implementation
+            switch(button){
+                case 0:
+                    event.button = 1;
+                    break;
+                case 1:
+                    event.button = 4;
+                    break;
+                case 2:
+                    //leave as is
+                    break;
+                default:
+                    event.button = 0;                    
+            }    
+
+            /*
+             * Have to use relatedTarget because IE won't allow assignment
+             * to toElement or fromElement on generic events. This keeps
+             * YAHOO.util.Event.getRelatedTarget() functional.
+             */
+            event.relatedTarget = relatedTarget;
+            
+            //fire the event
+            target.fireEvent("on" + type, event);
+                    
+        } else {
+            throw new Error("simulateMouseEvent(): No event simulation framework present.");
+        }
+    },
+   
+    //--------------------------------------------------------------------------
+    // Mouse events
+    //--------------------------------------------------------------------------
+
+    /**
+     * Simulates a mouse event on a particular element.
+     * @param {HTMLElement} target The element to click on.
+     * @param {String} type The type of event to fire. This can be any one of
+     *      the following: click, dblclick, mousedown, mouseup, mouseout,
+     *      mouseover, and mousemove.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseEvent
+     * @static
+     */
+    fireMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, 
+                           options /*:Object*/) /*:Void*/
+    {
+        options = options || {};
+        this.simulateMouseEvent(target, type, options.bubbles,
+            options.cancelable, options.view, options.detail, options.screenX,        
+            options.screenY, options.clientX, options.clientY, options.ctrlKey,
+            options.altKey, options.shiftKey, options.metaKey, options.button,         
+            options.relatedTarget);        
+    },
+
+    /**
+     * Simulates a click on a particular element.
+     * @param {HTMLElement} target The element to click on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method click
+     * @static     
+     */
+    click : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "click", options);
+    },
+    
+    /**
+     * Simulates a double click on a particular element.
+     * @param {HTMLElement} target The element to double click on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method dblclick
+     * @static
+     */
+    dblclick : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireMouseEvent( target, "dblclick", options);
+    },
+    
+    /**
+     * Simulates a mousedown on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mousedown
+     * @static
+     */
+    mousedown : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mousedown", options);
+    },
+    
+    /**
+     * Simulates a mousemove on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mousemove
+     * @static
+     */
+    mousemove : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mousemove", options);
+    },
+    
+    /**
+     * Simulates a mouseout event on a particular element. Use "relatedTarget"
+     * on the options object to specify where the mouse moved to.
+     * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so
+     * toElement is assigned in its place. IE doesn't allow toElement to be
+     * be assigned, so relatedTarget is assigned in its place. Both of these
+     * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly
+     * in both browsers.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseout
+     * @static
+     */
+    mouseout : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseout", options);
+    },
+    
+    /**
+     * Simulates a mouseover event on a particular element. Use "relatedTarget"
+     * on the options object to specify where the mouse moved from.
+     * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so
+     * fromElement is assigned in its place. IE doesn't allow fromElement to be
+     * be assigned, so relatedTarget is assigned in its place. Both of these
+     * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly
+     * in both browsers.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseover
+     * @static
+     */
+    mouseover : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseover", options);
+    },
+    
+    /**
+     * Simulates a mouseup on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method mouseup
+     * @static
+     */
+    mouseup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireMouseEvent(target, "mouseup", options);
+    },
+    
+    //--------------------------------------------------------------------------
+    // Key events
+    //--------------------------------------------------------------------------
+
+    /**
+     * Fires an event that normally would be fired by the keyboard (keyup,
+     * keydown, keypress). Make sure to specify either keyCode or charCode as
+     * an option.
+     * @private
+     * @param {String} type The type of event ("keyup", "keydown" or "keypress").
+     * @param {HTMLElement} target The target of the event.
+     * @param {Object} options Options for the event. Either keyCode or charCode
+     *                         are required.
+     * @method fireKeyEvent
+     * @static
+     */     
+    fireKeyEvent : function (type /*:String*/, target /*:HTMLElement*/,
+                             options /*:Object*/) /*:Void*/ 
+    {
+        options = options || {};
+        this.simulateKeyEvent(target, type, options.bubbles,
+            options.cancelable, options.view, options.ctrlKey,
+            options.altKey, options.shiftKey, options.metaKey, 
+            options.keyCode, options.charCode);    
+    },
+    
+    /**
+     * Simulates a keydown event on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keydown
+     * @static
+     */
+    keydown : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireKeyEvent("keydown", target, options);
+    },
+    
+    /**
+     * Simulates a keypress on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keypress
+     * @static
+     */
+    keypress : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ {
+        this.fireKeyEvent("keypress", target, options);
+    },
+    
+    /**
+     * Simulates a keyup event on a particular element.
+     * @param {HTMLElement} target The element to act on.
+     * @param {Object} options Additional event options (use DOM standard names).
+     * @method keyup
+     * @static
+     */
+    keyup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ {
+        this.fireKeyEvent("keyup", target, options);
+    }
+    
+
+};
+YAHOO.namespace("tool");
+
+//-----------------------------------------------------------------------------
+// TestManager object
+//-----------------------------------------------------------------------------
+
+/**
+ * Runs pages containing test suite definitions.
+ * @namespace YAHOO.tool
+ * @class TestManager
+ * @static
+ */
+YAHOO.tool.TestManager = {
+
+    /**
+     * Constant for the testpagebegin custom event
+     * @property TEST_PAGE_BEGIN_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_PAGE_BEGIN_EVENT /*:String*/ : "testpagebegin",
+
+    /**
+     * Constant for the testpagecomplete custom event
+     * @property TEST_PAGE_COMPLETE_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_PAGE_COMPLETE_EVENT /*:String*/ : "testpagecomplete",
+
+    /**
+     * Constant for the testmanagerbegin custom event
+     * @property TEST_MANAGER_BEGIN_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_MANAGER_BEGIN_EVENT /*:String*/ : "testmanagerbegin",
+
+    /**
+     * Constant for the testmanagercomplete custom event
+     * @property TEST_MANAGER_COMPLETE_EVENT
+     * @static
+     * @type string
+     * @final
+     */
+    TEST_MANAGER_COMPLETE_EVENT /*:String*/ : "testmanagercomplete",
+
+    //-------------------------------------------------------------------------
+    // Private Properties
+    //-------------------------------------------------------------------------
+    
+    
+    /**
+     * The URL of the page currently being executed.
+     * @type String
+     * @private
+     * @property _curPage
+     * @static
+     */
+    _curPage /*:String*/ : null,
+    
+    /**
+     * The frame used to load and run tests.
+     * @type Window
+     * @private
+     * @property _frame
+     * @static
+     */
+    _frame /*:Window*/ : null,
+    
+    /**
+     * The logger used to output results from the various tests.
+     * @type YAHOO.tool.TestLogger
+     * @private
+     * @property _logger
+     * @static
+     */
+    _logger : null,
+    
+    /**
+     * The timeout ID for the next iteration through the tests.
+     * @type int
+     * @private
+     * @property _timeoutId
+     * @static
+     */
+    _timeoutId /*:int*/ : 0,
+    
+    /**
+     * Array of pages to load.
+     * @type String[]
+     * @private
+     * @property _pages
+     * @static
+     */
+    _pages /*:String[]*/ : [],
+    
+    /**
+     * Aggregated results
+     * @type Object
+     * @private
+     * @property _results
+     * @static
+     */
+    _results: null,
+    
+    //-------------------------------------------------------------------------
+    // Private Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Handles TestRunner.COMPLETE_EVENT, storing the results and beginning
+     * the loop again.
+     * @param {Object} data Data about the event.
+     * @return {Void}
+     * @private
+     * @static
+     */
+    _handleTestRunnerComplete : function (data /*:Object*/) /*:Void*/ {
+
+        this.fireEvent(this.TEST_PAGE_COMPLETE_EVENT, {
+                page: this._curPage,
+                results: data.results
+            });
+    
+        //save results
+        //this._results[this.curPage] = data.results;
+        
+        //process 'em
+        this._processResults(this._curPage, data.results);
+        
+        this._logger.clearTestRunner();
+    
+        //if there's more to do, set a timeout to begin again
+        if (this._pages.length){
+            this._timeoutId = setTimeout(function(){
+                YAHOO.tool.TestManager._run();
+            }, 1000);
+        }
+    },
+    
+    /**
+     * Processes the results of a test page run, outputting log messages
+     * for failed tests.
+     * @return {Void}
+     * @private
+     * @static
+     */
+    _processResults : function (page /*:String*/, results /*:Object*/) /*:Void*/ {
+
+        var r = this._results;
+
+        r.page_results[page] = results;
+
+        if (results.passed) {
+            r.pages_passed++;
+            r.tests_passed += results.passed;
+        }
+
+        if (results.failed) {
+            r.pages_failed++;
+            r.tests_failed += results.failed;
+            r.failed.push(page);
+        } else {
+            r.passed.push(page);
+        }
+
+        if (!this._pages.length) {
+            this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT, this._results);
+        }
+
+    },
+    
+    /**
+     * Loads the next test page into the iframe.
+     * @return {Void}
+     * @static
+     * @private
+     */
+    _run : function () /*:Void*/ {
+    
+        //set the current page
+        this._curPage = this._pages.shift();
+
+        this.fireEvent(this.TEST_PAGE_BEGIN_EVENT, this._curPage);
+        
+        //load the frame - destroy history in case there are other iframes that
+        //need testing
+        this._frame.location.replace(this._curPage);
+    
+    },
+        
+    //-------------------------------------------------------------------------
+    // Public Methods
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Signals that a test page has been loaded. This should be called from
+     * within the test page itself to notify the TestManager that it is ready.
+     * @return {Void}
+     * @static
+     */
+    load : function () /*:Void*/ {
+        if (parent.YAHOO.tool.TestManager !== this){
+            parent.YAHOO.tool.TestManager.load();
+        } else {
+            
+            if (this._frame) {
+                //assign event handling
+                var TestRunner = this._frame.YAHOO.tool.TestRunner;
+
+                this._logger.setTestRunner(TestRunner);
+                TestRunner.subscribe(TestRunner.COMPLETE_EVENT, this._handleTestRunnerComplete, this, true);
+                
+                //run it
+                TestRunner.run();
+            }
+        }
+    },
+    
+    /**
+     * Sets the pages to be loaded.
+     * @param {String[]} pages An array of URLs to load.
+     * @return {Void}
+     * @static
+     */
+    setPages : function (pages /*:String[]*/) /*:Void*/ {
+        this._pages = pages;
+    },
+    
+    /**
+     * Begins the process of running the tests.
+     * @return {Void}
+     * @static
+     */
+    start : function () /*:Void*/ {
+
+        if (!this._initialized) {
+
+            /**
+             * Fires when loading a test page
+             * @event testpagebegin
+             * @param curPage {string} the page being loaded
+             * @static
+             */
+            this.createEvent(this.TEST_PAGE_BEGIN_EVENT);
+
+            /**
+             * Fires when a test page is complete
+             * @event testpagecomplete
+             * @param obj {page: string, results: object} the name of the
+             * page that was loaded, and the test suite results
+             * @static
+             */
+            this.createEvent(this.TEST_PAGE_COMPLETE_EVENT);
+
+            /**
+             * Fires when the test manager starts running all test pages
+             * @event testmanagerbegin
+             * @static
+             */
+            this.createEvent(this.TEST_MANAGER_BEGIN_EVENT);
+
+            /**
+             * Fires when the test manager finishes running all test pages.  External
+             * test runners should subscribe to this event in order to get the
+             * aggregated test results.
+             * @event testmanagercomplete
+             * @param obj { pages_passed: int, pages_failed: int, tests_passed: int
+             *              tests_failed: int, passed: string[], failed: string[],
+             *              page_results: {} }
+             * @static
+             */
+            this.createEvent(this.TEST_MANAGER_COMPLETE_EVENT);
+
+            //create iframe if not already available
+            if (!this._frame){
+                var frame /*:HTMLElement*/ = document.createElement("iframe");
+                frame.style.visibility = "hidden";
+                frame.style.position = "absolute";
+                document.body.appendChild(frame);
+                this._frame = frame.contentWindow || frame.contentDocument.ownerWindow;
+            }
+            
+            //create test logger if not already available
+            if (!this._logger){
+                this._logger = new YAHOO.tool.TestLogger();
+            }
+
+            this._initialized = true;
+        }
+
+
+        // reset the results cache
+        this._results = {
+            // number of pages that pass
+            pages_passed: 0,
+            // number of pages that fail
+            pages_failed: 0,
+            // total number of tests passed
+            tests_passed: 0,
+            // total number of tests failed
+            tests_failed: 0,
+            // array of pages that passed
+            passed: [],
+            // array of pages that failed
+            failed: [],
+            // map of full results for each page
+            page_results: {}
+        };
+
+        this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT, null);
+        this._run();
+    
+    },
+
+    /**
+     * Stops the execution of tests.
+     * @return {Void}
+     * @static
+     */
+    stop : function () /*:Void*/ {
+        clearTimeout(this._timeoutId);
+    }
+
+};
+
+YAHOO.lang.augmentObject(YAHOO.tool.TestManager, YAHOO.util.EventProvider.prototype);
+
+YAHOO.register("yuitest", YAHOO.tool.TestRunner, {version: "2.3.0", build: "442"});